mulmoclaude 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/bin/mulmoclaude.js +11 -1
- package/client/assets/JsonEditor-D6WBWLoa.js +10 -0
- package/client/assets/JsonEditor-Di5xGeZY.css +1 -0
- package/client/assets/_plugin-vue_export-helper-BOai-rQB.js +1 -0
- package/client/assets/chunk-D8eiyYIV-LcKZGJv5.js +1 -0
- package/client/assets/{html2canvas-CDGcmOD3-Bkf2uOth.js → html2canvas-CDGcmOD3-XVrO-eyz.js} +1 -1
- package/client/assets/index-CyBr8Mkr.css +2 -0
- package/client/assets/index-zZIqEbNX.js +5106 -0
- package/client/assets/{index.es-DqtpmBm8-D9mAh_KQ.js → index.es-DqtpmBm8-DHT6q10o.js} +1 -1
- package/client/assets/material-symbols-outlined-DtIK7AQn.woff2 +0 -0
- package/client/assets/runtime-protocol-vue-D6kcV0wa.js +1 -0
- package/client/assets/{runtime-vue-BVUzgYGA.js → runtime-vue-fFYhnNg3.js} +1 -1
- package/client/assets/{vue-C8UuIO9J.js → vue-D4w8THF_.js} +1 -1
- package/client/assets/vue-i18n-CQbxVmNs.js +3 -0
- package/client/assets/vue.runtime.esm-bundler-BTyIdNAI.js +4 -0
- package/client/index.html +10 -10
- package/package.json +9 -8
- package/server/agent/backend/claude-code.ts +34 -0
- package/server/agent/backend/fake-echo.ts +370 -0
- package/server/agent/backend/index.ts +16 -1
- package/server/agent/config.ts +74 -24
- package/server/agent/index.ts +104 -80
- package/server/agent/mcpFailureMonitor.ts +167 -0
- package/server/agent/mcpPreflight.ts +185 -0
- package/server/agent/prompt.ts +50 -359
- package/server/agent/stdioHttpShim.ts +171 -0
- package/server/agent/stream.ts +12 -1
- package/server/api/routes/encore.ts +55 -0
- package/server/api/routes/files.ts +22 -0
- package/server/api/routes/mulmo-script.ts +19 -1
- package/server/api/routes/schedulerHandlers.ts +52 -4
- package/server/api/routes/sessions.ts +15 -0
- package/server/api/routes/skills.ts +263 -0
- package/server/build/dispatcher.mjs +299 -0
- package/server/encore/INVARIANTS.md +272 -0
- package/server/encore/boot.ts +39 -0
- package/server/encore/closure.ts +36 -0
- package/server/encore/cycle.ts +276 -0
- package/server/encore/dispatch.ts +103 -0
- package/server/encore/handlers/amend.ts +99 -0
- package/server/encore/handlers/appendNote.ts +74 -0
- package/server/encore/handlers/defineEncore.ts +42 -0
- package/server/encore/handlers/listTickets.ts +107 -0
- package/server/encore/handlers/markStepDone.ts +41 -0
- package/server/encore/handlers/markTargetSkipped.ts +33 -0
- package/server/encore/handlers/query.ts +138 -0
- package/server/encore/handlers/recordValues.ts +44 -0
- package/server/encore/handlers/resolveNotification.ts +121 -0
- package/server/encore/handlers/setup.ts +81 -0
- package/server/encore/handlers/shared.ts +137 -0
- package/server/encore/handlers/snooze.ts +87 -0
- package/server/encore/handlers/startObligationChat.ts +64 -0
- package/server/encore/handlers/startSetupChat.ts +50 -0
- package/server/encore/lock.ts +61 -0
- package/server/encore/notifier.ts +123 -0
- package/server/encore/obligation.ts +25 -0
- package/server/encore/paths.ts +78 -0
- package/server/encore/reconcile.ts +661 -0
- package/server/encore/tick.ts +191 -0
- package/server/encore/yaml-fm.ts +63 -0
- package/server/events/notifications.ts +19 -91
- package/server/index.ts +94 -9
- package/server/notifier/engine.ts +102 -1
- package/server/notifier/macosReminderAdapter.ts +30 -0
- package/server/notifier/runtime-api.ts +41 -1
- package/server/notifier/types.ts +15 -2
- package/server/plugins/runtime.ts +11 -2
- package/server/prompts/index.ts +39 -0
- package/server/prompts/system/journal-pointer.md +12 -0
- package/server/prompts/system/memory-management-atomic.md +33 -0
- package/server/prompts/system/memory-management-topic.md +60 -0
- package/server/prompts/system/news-concierge.md +24 -0
- package/server/prompts/system/sandbox-tools.md +10 -0
- package/server/prompts/system/sources-context.md +16 -0
- package/server/prompts/system/system.md +91 -0
- package/server/system/announceOptionalDeps.ts +57 -0
- package/server/system/appVersion.ts +34 -0
- package/server/system/config.ts +17 -1
- package/server/system/docker.ts +14 -6
- package/server/system/env.ts +18 -5
- package/server/system/optionalDeps.ts +129 -0
- package/server/utils/cli-flags.d.mts +14 -0
- package/server/utils/cli-flags.mjs +53 -0
- package/server/utils/files/encore-io.ts +111 -0
- package/server/utils/time.ts +6 -0
- package/server/workspace/helps/business.md +2 -2
- package/server/workspace/helps/encore-dsl.md +482 -0
- package/server/workspace/helps/index.md +15 -13
- package/server/workspace/helps/mulmoscript.md +3 -3
- package/server/workspace/helps/sandbox.md +2 -2
- package/server/workspace/hooks/dispatcher.ts +7 -5
- package/server/workspace/hooks/provision.ts +6 -3
- package/server/workspace/paths.ts +13 -4
- package/server/workspace/skills/catalog.ts +355 -0
- package/server/workspace/skills/external/catalog.ts +283 -0
- package/server/workspace/skills/external/clone.ts +129 -0
- package/server/workspace/skills/external/id.ts +194 -0
- package/server/workspace/skills/external/install.ts +417 -0
- package/server/workspace/skills/external/presets.ts +50 -0
- package/server/workspace/skills-preset.ts +29 -17
- package/server/workspace/workspace.ts +10 -5
- package/src/App.vue +37 -8
- package/src/components/FileContentRenderer.vue +102 -9
- package/src/components/JsonEditor.vue +160 -0
- package/src/components/NotificationBell.vue +35 -3
- package/src/components/PluginLauncher.vue +20 -41
- package/src/components/RightSidebar.vue +19 -0
- package/src/components/SettingsMcpTab.vue +58 -11
- package/src/components/SettingsModal.vue +22 -1
- package/src/components/StackView.vue +10 -1
- package/src/components/TodoExplorer.vue +16 -0
- package/src/components/todo/TodoKanbanView.vue +34 -6
- package/src/composables/useNotifications.ts +21 -1
- package/src/config/apiRoutes.ts +0 -6
- package/src/config/mcpCatalog.ts +12 -7
- package/src/config/mcpTypes.ts +5 -0
- package/src/config/roles.ts +52 -15
- package/src/config/systemFileDescriptors.ts +12 -0
- package/src/lang/de.ts +108 -12
- package/src/lang/en.ts +105 -11
- package/src/lang/es.ts +106 -11
- package/src/lang/fr.ts +106 -11
- package/src/lang/ja.ts +104 -11
- package/src/lang/ko.ts +105 -11
- package/src/lang/pt-BR.ts +106 -11
- package/src/lang/zh.ts +103 -11
- package/src/main.ts +1 -0
- package/src/plugins/_generated/metas.ts +4 -0
- package/src/plugins/_generated/registrations.ts +2 -0
- package/src/plugins/_generated/server-bindings.ts +5 -0
- package/src/plugins/encore/EncoreDashboard.vue +504 -0
- package/src/plugins/encore/EncoreRedirect.vue +116 -0
- package/src/plugins/encore/View.vue +36 -0
- package/src/plugins/encore/defineEncoreDefinition.ts +74 -0
- package/src/plugins/encore/defineEncoreMeta.ts +13 -0
- package/src/plugins/encore/index.ts +93 -0
- package/src/plugins/encore/manageEncoreDefinition.ts +100 -0
- package/src/plugins/encore/manageEncoreMeta.ts +36 -0
- package/src/plugins/manageSkills/View.vue +832 -30
- package/src/plugins/manageSkills/categories.ts +125 -0
- package/src/plugins/manageSkills/meta.ts +30 -0
- package/src/plugins/markdown/definition.ts +3 -3
- package/src/plugins/meta-types.ts +5 -0
- package/src/plugins/presentMulmoScript/Preview.vue +3 -3
- package/src/plugins/presentMulmoScript/View.vue +157 -33
- package/src/plugins/presentMulmoScript/meta.ts +4 -0
- package/src/plugins/scheduler/View.vue +45 -9
- package/src/plugins/scheduler/calendarDefinition.ts +6 -2
- package/src/plugins/scheduler/multiDayHelpers.ts +95 -0
- package/src/plugins/skill/View.vue +1 -5
- package/src/plugins/spreadsheet/View.vue +3 -3
- package/src/plugins/spreadsheet/definition.ts +1 -1
- package/src/plugins/textResponse/Preview.vue +14 -1
- package/src/plugins/textResponse/View.vue +39 -24
- package/src/plugins/wiki/components/WikiPageBody.vue +4 -0
- package/src/router/index.ts +11 -0
- package/src/router/pageRoutes.ts +1 -0
- package/src/types/encore-dsl/at-expression.ts +120 -0
- package/src/types/encore-dsl/at-resolver.ts +32 -0
- package/src/types/encore-dsl/cadence.ts +289 -0
- package/src/types/encore-dsl/schema.ts +288 -0
- package/src/types/notification.ts +2 -1
- package/src/types/session.ts +6 -0
- package/src/types/sse.ts +5 -0
- package/src/types/toolCallHistory.ts +7 -0
- package/src/utils/agent/eventDispatch.ts +26 -5
- package/src/utils/agent/mcpHint.ts +50 -0
- package/src/utils/image/htmlSrcAttrs.ts +117 -13
- package/src/utils/session/sessionEntries.ts +8 -32
- package/client/assets/PluginScopedRoot-YjvQq0Nn.js +0 -3
- package/client/assets/chunk-CernVdwh.js +0 -1
- package/client/assets/chunk-D8eiyYIV-CAXpUwLd.js +0 -1
- package/client/assets/index-BwrlMMHr.js +0 -5005
- package/client/assets/index-CvvNuegU.css +0 -2
- package/client/assets/material-symbols-outlined-BOZVWuR3.woff2 +0 -0
- package/client/assets/runtime-protocol-vue-C1To4M3t.js +0 -1
- package/client/assets/vue.runtime.esm-bundler-DQ8Kjjui.js +0 -4
- package/server/api/routes/notifications.ts +0 -195
- package/server/notifier/legacy-adapters.ts +0 -76
- package/server/workspace/hooks/dispatcher.mjs +0 -300
- package/src/composables/useSelectedResult.ts +0 -49
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
// via the AgentEventContext adapter. No Vue refs, no component scope.
|
|
3
3
|
|
|
4
4
|
import type { ActiveSession } from "../../types/session";
|
|
5
|
-
import type { SseEvent } from "../../types/sse";
|
|
5
|
+
import type { SseEvent, SseToolCallResult } from "../../types/sse";
|
|
6
6
|
import { EVENT_TYPES, generationKey } from "../../types/events";
|
|
7
|
+
import type { ToolCallHistoryItem } from "../../types/toolCallHistory";
|
|
7
8
|
import { findPendingToolCall, toToolCallEntry } from "./toolCalls";
|
|
9
|
+
import { extractMcpHint } from "./mcpHint";
|
|
8
10
|
import { pushErrorMessage, applySkillEvent, applyTextEvent, applyToolResultToSession } from "../session/sessionHelpers";
|
|
9
11
|
|
|
10
12
|
export interface AgentEventContext {
|
|
@@ -14,6 +16,27 @@ export interface AgentEventContext {
|
|
|
14
16
|
onGenerationsDrained: () => void;
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
// Route a `toolCallResult` SSE event onto the pending history entry.
|
|
20
|
+
// Errors land on `entry.error` (drives the red chip) with an optional
|
|
21
|
+
// catalog-derived MCP hint; successes land on `entry.result`. Pulled
|
|
22
|
+
// out of `applyAgentEvent` so the dispatch switch keeps its cognitive
|
|
23
|
+
// complexity below the lint budget (#1354).
|
|
24
|
+
function applyToolCallResult(history: ToolCallHistoryItem[], event: SseToolCallResult): void {
|
|
25
|
+
const entry = findPendingToolCall(history, event.toolUseId);
|
|
26
|
+
if (!entry) return;
|
|
27
|
+
if (event.isError === true) {
|
|
28
|
+
// Clear any prior success content so the UI never shows a stale
|
|
29
|
+
// green `result` chip next to a fresh red `error` chip for the
|
|
30
|
+
// same toolUseId. (Sourcery review on #1357.)
|
|
31
|
+
entry.result = undefined;
|
|
32
|
+
entry.error = event.content;
|
|
33
|
+
const hint = extractMcpHint(entry.toolName);
|
|
34
|
+
if (hint !== null) entry.mcpHint = hint;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
entry.result = event.content;
|
|
38
|
+
}
|
|
39
|
+
|
|
17
40
|
export async function applyAgentEvent(event: SseEvent, ctx: AgentEventContext): Promise<void> {
|
|
18
41
|
const { session } = ctx;
|
|
19
42
|
switch (event.type) {
|
|
@@ -21,12 +44,10 @@ export async function applyAgentEvent(event: SseEvent, ctx: AgentEventContext):
|
|
|
21
44
|
session.toolCallHistory.push(toToolCallEntry(event));
|
|
22
45
|
ctx.scrollSidebarToBottom();
|
|
23
46
|
return;
|
|
24
|
-
case EVENT_TYPES.toolCallResult:
|
|
25
|
-
|
|
26
|
-
if (entry) entry.result = event.content;
|
|
47
|
+
case EVENT_TYPES.toolCallResult:
|
|
48
|
+
applyToolCallResult(session.toolCallHistory, event);
|
|
27
49
|
ctx.scrollSidebarToBottom();
|
|
28
50
|
return;
|
|
29
|
-
}
|
|
30
51
|
case EVENT_TYPES.status:
|
|
31
52
|
session.statusMessage = event.message;
|
|
32
53
|
return;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Frontend-side helper that turns an `mcp__<server>__<tool>` name
|
|
2
|
+
// into a structured hint the right-sidebar can render alongside an
|
|
3
|
+
// MCP tool's error body (#1354).
|
|
4
|
+
//
|
|
5
|
+
// The hint is *user-facing only* — pulled from the same `mcpCatalog`
|
|
6
|
+
// the Settings UI uses, so it stays consistent with whatever the
|
|
7
|
+
// user installed via Settings. Non-MCP tools and custom (off-catalog)
|
|
8
|
+
// servers return `null` and the UI falls back to the plain error
|
|
9
|
+
// chip.
|
|
10
|
+
|
|
11
|
+
import { findCatalogEntry, requiredKeysOf } from "../../config/mcpCatalog";
|
|
12
|
+
|
|
13
|
+
export interface McpHint {
|
|
14
|
+
/** Catalog id parsed from the tool name (`notion`, `github`, …). */
|
|
15
|
+
server: string;
|
|
16
|
+
/** i18n key for the server's localised display name. Render via
|
|
17
|
+
* `t(displayNameKey)` in the consuming component. */
|
|
18
|
+
displayNameKey: string;
|
|
19
|
+
/** External setup-guide URL when the catalog entry provides one. */
|
|
20
|
+
setupGuideUrl?: string;
|
|
21
|
+
/** Sorted list of `configSchema[].key` values the catalog marks
|
|
22
|
+
* `required: true`. Empty when the entry has no required fields. */
|
|
23
|
+
requiredKeys: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Allow `[A-Za-z0-9_-]+` for the server segment so a future catalog
|
|
27
|
+
// id with an underscore (none today, all current ids use `-`) is
|
|
28
|
+
// still recognised. The greedy match works because `findCatalogEntry`
|
|
29
|
+
// is the actual gatekeeper — anything that fails the catalog lookup
|
|
30
|
+
// returns `null` upstream regardless of how the regex grouped it.
|
|
31
|
+
// (Sourcery review on #1357.)
|
|
32
|
+
const MCP_TOOL_NAME_PATTERN = /^mcp__([A-Za-z0-9_-]+)__/;
|
|
33
|
+
|
|
34
|
+
/** Returns a structured hint when `toolName` references an MCP
|
|
35
|
+
* server present in the catalog; `null` otherwise. */
|
|
36
|
+
export function extractMcpHint(toolName: string): McpHint | null {
|
|
37
|
+
const match = MCP_TOOL_NAME_PATTERN.exec(toolName);
|
|
38
|
+
if (match === null) return null;
|
|
39
|
+
const [, server] = match;
|
|
40
|
+
const entry = findCatalogEntry(server);
|
|
41
|
+
if (entry === null) return null;
|
|
42
|
+
const requiredKeys = [...requiredKeysOf(entry)].sort();
|
|
43
|
+
const hint: McpHint = {
|
|
44
|
+
server,
|
|
45
|
+
displayNameKey: entry.displayName,
|
|
46
|
+
requiredKeys,
|
|
47
|
+
};
|
|
48
|
+
if (entry.setupGuideUrl) hint.setupGuideUrl = entry.setupGuideUrl;
|
|
49
|
+
return hint;
|
|
50
|
+
}
|
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
// other doesn't. Single helper here, two callers, one tag list — the
|
|
12
12
|
// drift becomes structurally impossible (#1011 Stage B).
|
|
13
13
|
//
|
|
14
|
-
// `srcset`
|
|
15
|
-
//
|
|
16
|
-
//
|
|
14
|
+
// `srcset` is handled by a dedicated split/rewrite pass (it's a
|
|
15
|
+
// comma-separated `url descriptor` list, not a single URL) — see
|
|
16
|
+
// `SRCSET_TAG_ATTRS` + `rewriteSrcset` below. SVG `<image href>` /
|
|
17
|
+
// CSS `url()` remain out of scope — see the deferred-list comment
|
|
18
|
+
// on `RESOLVABLE_TAG_ATTRS` below.
|
|
17
19
|
|
|
18
20
|
// Tag (lowercased) → URL-bearing attribute(s). Adding a row here
|
|
19
21
|
// extends both Markdown and PDF surfaces simultaneously.
|
|
20
22
|
//
|
|
21
23
|
// Deferred (NOT here):
|
|
22
|
-
// - `srcset` on `<img>` / `<source>` — comma-separated list with
|
|
23
|
-
// descriptors (`url 1x, url2 2x`), needs a separate split/rewrite
|
|
24
|
-
// pass. Tracked under #1011 Stage B follow-up.
|
|
25
24
|
// - SVG `<image href>` — gap table item #9, low priority per plan
|
|
26
25
|
// §修正提案 P3-A.
|
|
27
26
|
// - CSS `url()` in `style=` attributes — gap table item #8, same
|
|
@@ -33,6 +32,98 @@ export const RESOLVABLE_TAG_ATTRS: Readonly<Record<string, readonly string[]>> =
|
|
|
33
32
|
audio: ["src"],
|
|
34
33
|
};
|
|
35
34
|
|
|
35
|
+
// `srcset`-bearing attributes (comma-separated `url descriptor`
|
|
36
|
+
// list). Parsed/rewritten by `rewriteSrcset`, NOT the single-URL
|
|
37
|
+
// path. Tag set is a subset of `RESOLVABLE_TAG_ATTRS`'s keys so the
|
|
38
|
+
// outer tag regex already matches them — no alternation change
|
|
39
|
+
// needed (#1275, deferred from #1011 Stage B).
|
|
40
|
+
export const SRCSET_TAG_ATTRS: Readonly<Record<string, readonly string[]>> = {
|
|
41
|
+
img: ["srcset"],
|
|
42
|
+
source: ["srcset"],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function isSrcsetWs(char: string): boolean {
|
|
46
|
+
return char === " " || char === "\t" || char === "\n" || char === "\f" || char === "\r";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface SrcsetCandidate {
|
|
50
|
+
url: string;
|
|
51
|
+
descriptor: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function stripTrailingCommas(token: string): string {
|
|
55
|
+
let end = token.length;
|
|
56
|
+
while (end > 0 && token[end - 1] === ",") end--;
|
|
57
|
+
return token.slice(0, end);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function skipWsAndCommas(input: string, from: number): number {
|
|
61
|
+
let pos = from;
|
|
62
|
+
while (pos < input.length && (isSrcsetWs(input[pos]) || input[pos] === ",")) pos++;
|
|
63
|
+
return pos;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Read one `{ url, descriptor }` candidate starting at `from`.
|
|
67
|
+
// Returns the candidate (or null when only whitespace remained) and
|
|
68
|
+
// the position to resume from.
|
|
69
|
+
function readCandidate(input: string, from: number): { candidate: SrcsetCandidate | null; next: number } {
|
|
70
|
+
let pos = from;
|
|
71
|
+
const urlStart = pos;
|
|
72
|
+
while (pos < input.length && !isSrcsetWs(input[pos])) pos++;
|
|
73
|
+
const rawUrl = input.slice(urlStart, pos);
|
|
74
|
+
const url = stripTrailingCommas(rawUrl);
|
|
75
|
+
if (url.length !== rawUrl.length) {
|
|
76
|
+
// Trailing comma(s) on the URL run → candidate separator, no
|
|
77
|
+
// descriptor. (`data:` internal commas are not trailing, so
|
|
78
|
+
// they stay part of the URL.)
|
|
79
|
+
return { candidate: url ? { url, descriptor: "" } : null, next: pos };
|
|
80
|
+
}
|
|
81
|
+
while (pos < input.length && isSrcsetWs(input[pos])) pos++;
|
|
82
|
+
const descStart = pos;
|
|
83
|
+
while (pos < input.length && input[pos] !== ",") pos++;
|
|
84
|
+
const descriptor = input.slice(descStart, pos).trim();
|
|
85
|
+
if (pos < input.length && input[pos] === ",") pos++;
|
|
86
|
+
return { candidate: url ? { url, descriptor } : null, next: pos };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Split a `srcset` value into candidates per the WHATWG "parse a
|
|
90
|
+
// srcset attribute" boundary rules. A naive `split(",")` corrupts
|
|
91
|
+
// `data:` URIs (their base64 payload contains commas); the spec
|
|
92
|
+
// collects the URL as a run of non-whitespace and treats only
|
|
93
|
+
// *trailing* commas on that run as separators (Codex review). Pure
|
|
94
|
+
// scan, no regex → ReDoS-safe.
|
|
95
|
+
function splitSrcsetCandidates(input: string): SrcsetCandidate[] {
|
|
96
|
+
const candidates: SrcsetCandidate[] = [];
|
|
97
|
+
let pos = 0;
|
|
98
|
+
while (pos < input.length) {
|
|
99
|
+
pos = skipWsAndCommas(input, pos);
|
|
100
|
+
if (pos >= input.length) break;
|
|
101
|
+
const { candidate, next } = readCandidate(input, pos);
|
|
102
|
+
pos = next;
|
|
103
|
+
if (candidate) candidates.push(candidate);
|
|
104
|
+
}
|
|
105
|
+
return candidates;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Rewrite the URL portion of every candidate in a `srcset` value,
|
|
109
|
+
// preserving descriptors (`1x` / `2x` / `480w`). If no candidate's
|
|
110
|
+
// URL is actually changed (every `transform` returned `null` or the
|
|
111
|
+
// same string), the ORIGINAL value is returned byte-verbatim so a
|
|
112
|
+
// no-op never normalises the author's whitespace (CodeRabbit
|
|
113
|
+
// review). Boundary parsing is `data:`-URI-safe (see
|
|
114
|
+
// `splitSrcsetCandidates`).
|
|
115
|
+
export function rewriteSrcset(value: string, transform: (url: string) => string | null): string {
|
|
116
|
+
const candidates = splitSrcsetCandidates(value);
|
|
117
|
+
if (candidates.length === 0) return value;
|
|
118
|
+
let changed = false;
|
|
119
|
+
const rendered = candidates.map(({ url, descriptor }) => {
|
|
120
|
+
const replaced = transform(url);
|
|
121
|
+
const finalUrl = replaced === null || replaced === url ? url : ((changed = true), replaced);
|
|
122
|
+
return descriptor ? `${finalUrl} ${descriptor}` : finalUrl;
|
|
123
|
+
});
|
|
124
|
+
return changed ? rendered.join(", ") : value;
|
|
125
|
+
}
|
|
126
|
+
|
|
36
127
|
// Outer regex: scan any tag whose name appears in `RESOLVABLE_TAG_ATTRS`,
|
|
37
128
|
// respecting quoted attribute values so `>` inside e.g. `alt="x>y"`
|
|
38
129
|
// doesn't terminate the tag early. The body is one of:
|
|
@@ -95,13 +186,20 @@ export function transformResolvableUrlsInHtml(html: string, transform: (url: str
|
|
|
95
186
|
return html.replace(RESOLVABLE_TAG_OUTER_RE, (tag) => {
|
|
96
187
|
const tagNameMatch = TAG_NAME_RE.exec(tag);
|
|
97
188
|
if (!tagNameMatch) return tag;
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
189
|
+
const tagName = tagNameMatch[1].toLowerCase();
|
|
190
|
+
const resolvableAttrs = RESOLVABLE_TAG_ATTRS[tagName];
|
|
191
|
+
const srcsetAttrs = SRCSET_TAG_ATTRS[tagName];
|
|
192
|
+
if (!resolvableAttrs && !srcsetAttrs) return tag;
|
|
193
|
+
return tag.replace(ATTR_ITER_RE, (...captures: unknown[]) => replaceAttrIfResolvable(captures, resolvableAttrs ?? [], srcsetAttrs ?? [], transform));
|
|
101
194
|
});
|
|
102
195
|
}
|
|
103
196
|
|
|
104
|
-
function replaceAttrIfResolvable(
|
|
197
|
+
function replaceAttrIfResolvable(
|
|
198
|
+
captures: unknown[],
|
|
199
|
+
resolvableAttrs: readonly string[],
|
|
200
|
+
srcsetAttrs: readonly string[],
|
|
201
|
+
transform: (url: string) => string | null,
|
|
202
|
+
): string {
|
|
105
203
|
const [full, leading, name, eqWithSpaces, , doubleQuoted, singleQuoted, bare] = captures as [
|
|
106
204
|
string,
|
|
107
205
|
string,
|
|
@@ -112,11 +210,17 @@ function replaceAttrIfResolvable(captures: unknown[], resolvableAttrs: readonly
|
|
|
112
210
|
string | undefined,
|
|
113
211
|
string | undefined,
|
|
114
212
|
];
|
|
115
|
-
if (!eqWithSpaces
|
|
213
|
+
if (!eqWithSpaces) return full;
|
|
214
|
+
const lowerName = name.toLowerCase();
|
|
215
|
+
const isSrcset = srcsetAttrs.includes(lowerName);
|
|
216
|
+
if (!isSrcset && !resolvableAttrs.includes(lowerName)) return full;
|
|
116
217
|
const value = (doubleQuoted ?? singleQuoted ?? bare ?? "").trim();
|
|
117
218
|
if (!value) return full;
|
|
118
|
-
const replacement = transform(value);
|
|
119
|
-
|
|
219
|
+
const replacement = isSrcset ? rewriteSrcset(value, transform) : transform(value);
|
|
220
|
+
// Single-URL: null means "leave verbatim". srcset: rewriteSrcset
|
|
221
|
+
// always returns a string (per-candidate nulls handled inside),
|
|
222
|
+
// and a no-op rewrite equal to the original is also left verbatim.
|
|
223
|
+
if (replacement === null || replacement === value) return full;
|
|
120
224
|
const quote = doubleQuoted !== undefined ? '"' : singleQuoted !== undefined ? "'" : '"';
|
|
121
225
|
return `${leading}${name}${eqWithSpaces}${quote}${replacement}${quote}`;
|
|
122
226
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// Tracks #175.
|
|
7
7
|
|
|
8
|
-
import { makeSkillResult, makeTextResult
|
|
8
|
+
import { makeSkillResult, makeTextResult } from "../tools/result";
|
|
9
9
|
import {
|
|
10
10
|
isSessionOrigin,
|
|
11
11
|
isSkillEntry,
|
|
@@ -78,35 +78,12 @@ export function parseSessionEntries(entries: readonly SessionEntry[], sessionOri
|
|
|
78
78
|
return out;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// Pick the `selectedResultUuid` the session should restore to
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
// 2. Otherwise pick the most recent non-text-like tool result —
|
|
87
|
-
// images, wiki pages, etc. carry more visual information
|
|
88
|
-
// than a bare text response or a collapsed skill card.
|
|
89
|
-
// 3. If every result is text-like (`text-response` or `skill`,
|
|
90
|
-
// see `TEXT_LIKE_RESULT_TOOL_NAMES`), fall back to the last
|
|
91
|
-
// one — typically the most recent assistant reply, NOT the
|
|
92
|
-
// skill card that preceded it. Codex iter-4 review on PR
|
|
93
|
-
// #1220 surfaced the inconsistency between this reload-time
|
|
94
|
-
// selector and the live-run `shouldSelectAssistantText`
|
|
95
|
-
// before they were unified on the same allowlist.
|
|
96
|
-
// 4. If the list is empty, return null.
|
|
97
|
-
//
|
|
98
|
-
export function resolveSelectedUuid(toolResults: readonly ToolResultComplete[], urlResult: string | null): string | null {
|
|
99
|
-
if (urlResult && toolResults.some((result) => result.uuid === urlResult)) {
|
|
100
|
-
return urlResult;
|
|
101
|
-
}
|
|
81
|
+
// Pick the `selectedResultUuid` the session should restore to on
|
|
82
|
+
// fresh load: the most recent result in the conversation, whether
|
|
83
|
+
// it's a tool result or a text result. Returns null only when the
|
|
84
|
+
// list is empty.
|
|
85
|
+
export function resolveSelectedUuid(toolResults: readonly ToolResultComplete[]): string | null {
|
|
102
86
|
if (toolResults.length === 0) return null;
|
|
103
|
-
// Iterate backwards for the "last non-text-like" lookup so
|
|
104
|
-
// callers don't pay for an intermediate reverse copy.
|
|
105
|
-
for (let i = toolResults.length - 1; i >= 0; i--) {
|
|
106
|
-
if (!TEXT_LIKE_RESULT_TOOL_NAMES.has(toolResults[i].toolName)) {
|
|
107
|
-
return toolResults[i].uuid;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
87
|
return toolResults[toolResults.length - 1].uuid;
|
|
111
88
|
}
|
|
112
89
|
|
|
@@ -147,15 +124,14 @@ export function buildLoadedSession(opts: {
|
|
|
147
124
|
id: string;
|
|
148
125
|
entries: readonly SessionEntry[];
|
|
149
126
|
defaultRoleId: string;
|
|
150
|
-
urlResult: string | null;
|
|
151
127
|
serverSummary: SessionSummary | undefined;
|
|
152
128
|
nowIso: string;
|
|
153
129
|
}): ActiveSession {
|
|
154
|
-
const { id, entries, defaultRoleId,
|
|
130
|
+
const { id, entries, defaultRoleId, serverSummary, nowIso } = opts;
|
|
155
131
|
const meta = entries.find((entry) => entry.type === EVENT_TYPES.sessionMeta);
|
|
156
132
|
const roleId = meta?.roleId ?? defaultRoleId;
|
|
157
133
|
const toolResults = parseSessionEntries(entries, serverSummary?.origin);
|
|
158
|
-
const selectedResultUuid = resolveSelectedUuid(toolResults
|
|
134
|
+
const selectedResultUuid = resolveSelectedUuid(toolResults);
|
|
159
135
|
const { startedAt, updatedAt } = resolveSessionTimestamps(serverSummary, nowIso);
|
|
160
136
|
const resultTimestamps = interpolateTimestamps(toolResults, startedAt, updatedAt);
|
|
161
137
|
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CernVdwh.js";import{B as t,F as n,Fn as r,Ht as i,In as a,K as o,Kt as s,Lt as c,Qn as l,Rt as u,Vn as d,Wn as f,Wt as p,X as m,Y as h,Yn as g,Zt as _,ar as v,at as y,gt as b,jr as x,n as S,pt as ee,q as C,rt as w,wt as T,yn as te}from"./vue.runtime.esm-bundler-DQ8Kjjui.js";import{t as E}from"./vue-C8UuIO9J.js";function ne(e,t){typeof console<`u`&&(console.warn(`[intlify] `+e),t&&console.warn(t.stack))}var re=typeof window<`u`,D=(e,t=!1)=>t?Symbol.for(e):Symbol(e),ie=(e,t,n)=>ae({l:e,k:t,s:n}),ae=e=>JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),O=e=>typeof e==`number`&&isFinite(e),oe=e=>_e(e)===`[object Date]`,se=e=>_e(e)===`[object RegExp]`,ce=e=>R(e)&&Object.keys(e).length===0,k=Object.assign,le=Object.create,A=(e=null)=>le(e),ue,j=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:A();function de(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function fe(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function pe(e){return e=e.replace(/(\w+)\s*=\s*"([^"]*)"/g,(e,t,n)=>`${t}="${fe(n)}"`),e=e.replace(/(\w+)\s*=\s*'([^']*)'/g,(e,t,n)=>`${t}='${fe(n)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(t=>{e=e.replace(t,`$1javascript:`)}),e}var me=Object.prototype.hasOwnProperty;function M(e,t){return me.call(e,t)}var N=Array.isArray,P=e=>typeof e==`function`,F=e=>typeof e==`string`,I=e=>typeof e==`boolean`,L=e=>typeof e==`object`&&!!e,he=e=>L(e)&&P(e.then)&&P(e.catch),ge=Object.prototype.toString,_e=e=>ge.call(e),R=e=>_e(e)===`[object Object]`,ve=e=>e==null?``:N(e)||R(e)&&e.toString===ge?JSON.stringify(e,null,2):String(e);function ye(e,t=``){return e.reduce((e,n,r)=>r===0?e+n:e+t+n,``)}var be=e=>!L(e)||N(e);function xe(e,t){if(be(e)||be(t))throw Error(`Invalid value`);let n=[{src:e,des:t}];for(;n.length;){let{src:e,des:t}=n.pop();Object.keys(e).forEach(r=>{r!==`__proto__`&&(L(e[r])&&!L(t[r])&&(t[r]=Array.isArray(e[r])?[]:A()),be(t[r])||be(e[r])?t[r]=e[r]:n.push({src:e[r],des:t[r]}))})}}function Se(e,t,n){return{line:e,column:t,offset:n}}function Ce(e,t,n){let r={start:e,end:t};return n!=null&&(r.source=n),r}var z={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};z.EXPECTED_TOKEN,z.INVALID_TOKEN_IN_PLACEHOLDER,z.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,z.UNKNOWN_ESCAPE_SEQUENCE,z.INVALID_UNICODE_ESCAPE_SEQUENCE,z.UNBALANCED_CLOSING_BRACE,z.UNTERMINATED_CLOSING_BRACE,z.EMPTY_PLACEHOLDER,z.NOT_ALLOW_NEST_PLACEHOLDER,z.INVALID_LINKED_FORMAT,z.MUST_HAVE_MESSAGES_IN_PLURAL,z.UNEXPECTED_EMPTY_LINKED_MODIFIER,z.UNEXPECTED_EMPTY_LINKED_KEY,z.UNEXPECTED_LEXICAL_ANALYSIS,z.UNHANDLED_CODEGEN_NODE_TYPE,z.UNHANDLED_MINIFIER_NODE_TYPE;function we(e,t,n={}){let{domain:r,messages:i,args:a}=n,o=SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function Te(e){throw e}var B=` `,Ee=`\r`,V=`
|
|
2
|
-
`,De=`\u2028`,Oe=`\u2029`;function ke(e){let t=e,n=0,r=1,i=1,a=0,o=e=>t[e]===Ee&&t[e+1]===V,s=e=>t[e]===V,c=e=>t[e]===Oe,l=e=>t[e]===De,u=e=>o(e)||s(e)||c(e)||l(e),d=()=>n,f=()=>r,p=()=>i,m=()=>a,h=e=>o(e)||c(e)||l(e)?V:t[e],g=()=>h(n),_=()=>h(n+a);function v(){return a=0,u(n)&&(r++,i=0),o(n)&&n++,n++,i++,t[n]}function y(){return o(n+a)&&a++,a++,t[n+a]}function b(){n=0,r=1,i=1,a=0}function x(e=0){a=e}function S(){let e=n+a;for(;e!==n;)v();a=0}return{index:d,line:f,column:p,peekOffset:m,charAt:h,currentChar:g,currentPeek:_,next:v,peek:y,reset:b,resetPeek:x,skipToPeek:S}}var Ae=void 0,H=`'`,je=`tokenizer`;function Me(e,t={}){let n=t.location!==!1,r=ke(e),i=()=>r.index(),a=()=>Se(r.line(),r.column(),r.index()),o=a(),s=i(),c={currentType:13,offset:s,startLoc:o,endLoc:o,lastType:13,lastOffset:s,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:``},l=()=>c,{onError:u}=t;function d(e,t,r,...i){let a=l();t.column+=r,t.offset+=r,u&&u(we(e,n?Ce(a.startLoc,t):null,{domain:je,args:i}))}function f(e,t,r){e.endLoc=a(),e.currentType=t;let i={type:t};return n&&(i.loc=Ce(e.startLoc,e.endLoc)),r!=null&&(i.value=r),i}let p=e=>f(e,13);function m(e,t){return e.currentChar()===t?(e.next(),t):(d(z.EXPECTED_TOKEN,a(),0,t),``)}function h(e){let t=``;for(;e.currentPeek()===B||e.currentPeek()===V;)t+=e.currentPeek(),e.peek();return t}function g(e){let t=h(e);return e.skipToPeek(),t}function _(e){if(e===Ae)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t===95}function v(e){if(e===Ae)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function y(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function b(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=v(e.currentPeek()===`-`?e.peek():e.currentPeek());return e.resetPeek(),r}function x(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=e.currentPeek()===H;return e.resetPeek(),r}function S(e,t){let{currentType:n}=t;if(n!==7)return!1;h(e);let r=e.currentPeek()===`.`;return e.resetPeek(),r}function ee(e,t){let{currentType:n}=t;if(n!==8)return!1;h(e);let r=_(e.currentPeek());return e.resetPeek(),r}function C(e,t){let{currentType:n}=t;if(!(n===7||n===11))return!1;h(e);let r=e.currentPeek()===`:`;return e.resetPeek(),r}function w(e,t){let{currentType:n}=t;if(n!==9)return!1;let r=()=>{let t=e.currentPeek();return t===`{`?_(e.peek()):t===`@`||t===`|`||t===`:`||t===`.`||t===B||!t?!1:t===V?(e.peek(),r()):te(e,!1)},i=r();return e.resetPeek(),i}function T(e){h(e);let t=e.currentPeek()===`|`;return e.resetPeek(),t}function te(e,t=!0){let n=(t=!1,r=``)=>{let i=e.currentPeek();return i===`{`||i===`@`||!i?t:i===`|`?!(r===B||r===V):i===B?(e.peek(),n(!0,B)):i===V?(e.peek(),n(!0,V)):!0},r=n();return t&&e.resetPeek(),r}function E(e,t){let n=e.currentChar();return n===Ae?Ae:t(n)?(e.next(),n):null}function ne(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36}function re(e){return E(e,ne)}function D(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36||t===45}function ie(e){return E(e,D)}function ae(e){let t=e.charCodeAt(0);return t>=48&&t<=57}function O(e){return E(e,ae)}function oe(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function se(e){return E(e,oe)}function ce(e){let t=``,n=``;for(;t=O(e);)n+=t;return n}function k(e){let t=``;for(;;){let n=e.currentChar();if(n===`\\`){let r=e.peek();r===`{`||r===`}`||r===`@`||r===`|`||r===`\\`?(t+=n+r,e.next(),e.next()):(e.resetPeek(),t+=n,e.next())}else if(n===`{`||n===`}`||n===`@`||n===`|`||!n)break;else if(n===B||n===V)if(te(e))t+=n,e.next();else if(T(e))break;else t+=n,e.next();else t+=n,e.next()}return t}function le(e){g(e);let t=``,n=``;for(;t=ie(e);)n+=t;let r=e.currentChar();if(r&&r!==`}`&&r!==Ae&&r!==B&&r!==V&&r!==` `){let t=me(e);return d(z.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n+t),n+t}return e.currentChar()===Ae&&d(z.UNTERMINATED_CLOSING_BRACE,a(),0),n}function A(e){g(e);let t=``;return e.currentChar()===`-`?(e.next(),t+=`-${ce(e)}`):t+=ce(e),e.currentChar()===Ae&&d(z.UNTERMINATED_CLOSING_BRACE,a(),0),t}function ue(e){return e!==H&&e!==V}function j(e){g(e),m(e,`'`);let t=``,n=``;for(;t=E(e,ue);)t===`\\`?n+=de(e):n+=t;let r=e.currentChar();return r===V||r===Ae?(d(z.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),r===V&&(e.next(),m(e,`'`)),n):(m(e,`'`),n)}function de(e){let t=e.currentChar();switch(t){case`\\`:case`'`:return e.next(),`\\${t}`;case`u`:return fe(e,t,4);case`U`:return fe(e,t,6);default:return d(z.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),``}}function fe(e,t,n){m(e,t);let r=``;for(let i=0;i<n;i++){let n=se(e);if(!n){d(z.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),0,`\\${t}${r}${e.currentChar()}`);break}r+=n}return`\\${t}${r}`}function pe(e){return e!==`{`&&e!==`}`&&e!==B&&e!==V}function me(e){g(e);let t=``,n=``;for(;t=E(e,pe);)n+=t;return n}function M(e){let t=``,n=``;for(;t=re(e);)n+=t;return n}function N(e){let t=n=>{let r=e.currentChar();return r===`{`||r===`@`||r===`|`||r===`(`||r===`)`||!r||r===B?n:(n+=r,e.next(),t(n))};return t(``)}function P(e){g(e);let t=m(e,`|`);return g(e),t}function F(e,t){let n=null;switch(e.currentChar()){case`{`:return t.braceNest>=1&&d(z.NOT_ALLOW_NEST_PLACEHOLDER,a(),0),e.next(),n=f(t,2,`{`),g(e),t.braceNest++,n;case`}`:return t.braceNest>0&&t.currentType===2&&d(z.EMPTY_PLACEHOLDER,a(),0),e.next(),n=f(t,3,`}`),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&t.braceNest===0&&(t.inLinked=!1),n;case`@`:return t.braceNest>0&&d(z.UNTERMINATED_CLOSING_BRACE,a(),0),n=I(e,t)||p(t),t.braceNest=0,n;default:{let r=!0,i=!0,o=!0;if(T(e))return t.braceNest>0&&d(z.UNTERMINATED_CLOSING_BRACE,a(),0),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(t.currentType===4||t.currentType===5||t.currentType===6))return d(z.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,L(e,t);if(r=y(e,t))return n=f(t,4,le(e)),g(e),n;if(i=b(e,t))return n=f(t,5,A(e)),g(e),n;if(o=x(e,t))return n=f(t,6,j(e)),g(e),n;if(!r&&!i&&!o)return n=f(t,12,me(e)),d(z.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),g(e),n;break}}return n}function I(e,t){let{currentType:n}=t,r=null,i=e.currentChar();switch((n===7||n===8||n===11||n===9)&&(i===V||i===B)&&d(z.INVALID_LINKED_FORMAT,a(),0),i){case`@`:return e.next(),r=f(t,7,`@`),t.inLinked=!0,r;case`.`:return g(e),e.next(),f(t,8,`.`);case`:`:return g(e),e.next(),f(t,9,`:`);default:return T(e)?(r=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r):S(e,t)||C(e,t)?(g(e),I(e,t)):ee(e,t)?(g(e),f(t,11,M(e))):w(e,t)?(g(e),i===`{`?F(e,t)||r:f(t,10,N(e))):(n===7&&d(z.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,L(e,t))}}function L(e,t){let n={type:13};if(t.braceNest>0)return F(e,t)||p(t);if(t.inLinked)return I(e,t)||p(t);switch(e.currentChar()){case`{`:return F(e,t)||p(t);case`}`:return d(z.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),f(t,3,`}`);case`@`:return I(e,t)||p(t);default:if(T(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(te(e))return f(t,0,k(e));break}return n}function he(){let{currentType:e,offset:t,startLoc:n,endLoc:o}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=n,c.lastEndLoc=o,c.offset=i(),c.startLoc=a(),r.currentChar()===Ae?f(c,13):L(r,c)}return{nextToken:he,currentOffset:i,currentPosition:a,context:l}}var Ne=`parser`,Pe=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,Fe=/\\([\\@{}|])/g;function Ie(e,t){return t}function Le(e,t,n){switch(e){case`\\\\`:return`\\`;case`\\'`:return`'`;default:{let e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):`�`}}}function Re(e={}){let t=e.location!==!1,{onError:n}=e;function r(e,r,i,a,...o){let s=e.currentPosition();s.offset+=a,s.column+=a,n&&n(we(r,t?Ce(i,s):null,{domain:Ne,args:o}))}function i(e,n,r){let i={type:e};return t&&(i.start=n,i.end=n,i.loc={start:r,end:r}),i}function a(e,n,r,i){t&&(e.end=n,e.loc&&(e.loc.end=r))}function o(e,t){let n=e.context(),r=i(3,n.offset,n.startLoc);return r.value=t.replace(Fe,Ie),a(r,e.currentOffset(),e.currentPosition()),r}function s(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(5,n,r);return o.index=parseInt(t,10),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function c(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(4,n,r);return o.key=t,e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function l(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(9,n,r);return o.value=t.replace(Pe,Le),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function u(e){let t=e.nextToken(),n=e.context(),{lastOffset:o,lastStartLoc:s}=n,c=i(8,o,s);return t.type===11?(t.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,U(t)),c.value=t.value||``,a(c,e.currentOffset(),e.currentPosition()),{node:c}):(r(e,z.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),c.value=``,a(c,o,s),{nextConsumeToken:t,node:c})}function d(e,t){let n=e.context(),r=i(7,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function f(e){let t=e.context(),n=i(6,t.offset,t.startLoc),o=e.nextToken();if(o.type===8){let t=u(e);n.modifier=t.node,o=t.nextConsumeToken||e.nextToken()}switch(o.type!==9&&r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(o)),o=e.nextToken(),o.type===2&&(o=e.nextToken()),o.type){case 10:o.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(o)),n.key=d(e,o.value||``);break;case 4:o.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(o)),n.key=c(e,o.value||``);break;case 5:o.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(o)),n.key=s(e,o.value||``);break;case 6:o.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(o)),n.key=l(e,o.value||``);break;default:{r(e,z.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);let s=e.context(),c=i(7,s.offset,s.startLoc);return c.value=``,a(c,s.offset,s.startLoc),n.key=c,a(n,s.offset,s.startLoc),{nextConsumeToken:o,node:n}}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function p(e){let t=e.context(),n=i(2,t.currentType===1?e.currentOffset():t.offset,t.currentType===1?t.endLoc:t.startLoc);n.items=[];let u=null;do{let i=u||e.nextToken();switch(u=null,i.type){case 0:i.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(i)),n.items.push(o(e,i.value||``));break;case 5:i.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(i)),n.items.push(s(e,i.value||``));break;case 4:i.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(i)),n.items.push(c(e,i.value||``));break;case 6:i.value??r(e,z.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,U(i)),n.items.push(l(e,i.value||``));break;case 7:{let t=f(e);n.items.push(t.node),u=t.nextConsumeToken||null;break}}}while(t.currentType!==13&&t.currentType!==1);return a(n,t.currentType===1?t.lastOffset:e.currentOffset(),t.currentType===1?t.lastEndLoc:e.currentPosition()),n}function m(e,t,n,o){let s=e.context(),c=o.items.length===0,l=i(1,t,n);l.cases=[],l.cases.push(o);do{let t=p(e);c||=t.items.length===0,l.cases.push(t)}while(s.currentType!==13);return c&&r(e,z.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(l,e.currentOffset(),e.currentPosition()),l}function h(e){let t=e.context(),{offset:n,startLoc:r}=t,i=p(e);return t.currentType===13?i:m(e,n,r,i)}function g(n){let o=Me(n,k({},e)),s=o.context(),c=i(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=h(o),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),s.currentType!==13&&r(o,z.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,0,n[s.offset]||``),a(c,o.currentOffset(),o.currentPosition()),c}return{parse:g}}function U(e){if(e.type===13)return`EOF`;let t=(e.value||``).replace(/\r?\n/gu,`\\n`);return t.length>10?t.slice(0,9)+`…`:t}function ze(e,t={}){let n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function Be(e,t){for(let n=0;n<e.length;n++)Ve(e[n],t)}function Ve(e,t){switch(e.type){case 1:Be(e.cases,t),t.helper(`plural`);break;case 2:Be(e.items,t);break;case 6:Ve(e.key,t),t.helper(`linked`),t.helper(`type`);break;case 5:t.helper(`interpolate`),t.helper(`list`);break;case 4:t.helper(`interpolate`),t.helper(`named`);break}}function He(e,t={}){let n=ze(e);n.helper(`normalize`),e.body&&Ve(e.body,n);let r=n.context();e.helpers=Array.from(r.helpers)}function Ue(e){let t=e.body;return t.type===2?We(t):t.cases.forEach(e=>We(e)),e}function We(e){if(e.items.length===1){let t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{let t=[];for(let n=0;n<e.items.length;n++){let r=e.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;t.push(r.value)}if(t.length===e.items.length){e.static=ye(t);for(let t=0;t<e.items.length;t++){let n=e.items[t];(n.type===3||n.type===9)&&delete n.value}}}}function Ge(e){switch(e.t=e.type,e.type){case 0:{let t=e;Ge(t.body),t.b=t.body,delete t.body;break}case 1:{let t=e,n=t.cases;for(let e=0;e<n.length;e++)Ge(n[e]);t.c=n,delete t.cases;break}case 2:{let t=e,n=t.items;for(let e=0;e<n.length;e++)Ge(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{let t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{let t=e;Ge(t.key),t.k=t.key,delete t.key,t.modifier&&(Ge(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{let t=e;t.i=t.index,delete t.index;break}case 4:{let t=e;t.k=t.key,delete t.key;break}default:}delete e.type}function Ke(e,t){let{sourceMap:n,filename:r,breakLineCode:i,needIndent:a}=t,o=t.location!==!1,s={filename:r,code:``,column:1,line:1,offset:0,map:void 0,breakLineCode:i,needIndent:a,indentLevel:0};o&&e.loc&&(s.source=e.loc.source);let c=()=>s;function l(e,t){s.code+=e}function u(e,t=!0){let n=t?i:``;l(a?n+` `.repeat(e):n)}function d(e=!0){let t=++s.indentLevel;e&&u(t)}function f(e=!0){let t=--s.indentLevel;e&&u(t)}function p(){u(s.indentLevel)}return{context:c,push:l,indent:d,deindent:f,newline:p,helper:e=>`_${e}`,needIndent:()=>s.needIndent}}function qe(e,t){let{helper:n}=e;e.push(`${n(`linked`)}(`),Ze(e,t.key),t.modifier?(e.push(`, `),Ze(e,t.modifier),e.push(`, _type`)):e.push(`, undefined, _type`),e.push(`)`)}function Je(e,t){let{helper:n,needIndent:r}=e;e.push(`${n(`normalize`)}([`),e.indent(r());let i=t.items.length;for(let n=0;n<i&&(Ze(e,t.items[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}function Ye(e,t){let{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n(`plural`)}([`),e.indent(r());let i=t.cases.length;for(let n=0;n<i&&(Ze(e,t.cases[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}}function Xe(e,t){t.body?Ze(e,t.body):e.push(`null`)}function Ze(e,t){let{helper:n}=e;switch(t.type){case 0:Xe(e,t);break;case 1:Ye(e,t);break;case 2:Je(e,t);break;case 6:qe(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n(`interpolate`)}(${n(`list`)}(${t.index}))`,t);break;case 4:e.push(`${n(`interpolate`)}(${n(`named`)}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break;default:}}var Qe=(e,t={})=>{let n=F(t.mode)?t.mode:`normal`,r=F(t.filename)?t.filename:`message.intl`,i=!!t.sourceMap,a=t.breakLineCode==null?n===`arrow`?`;`:`
|
|
3
|
-
`:t.breakLineCode,o=t.needIndent?t.needIndent:n!==`arrow`,s=e.helpers||[],c=Ke(e,{mode:n,filename:r,sourceMap:i,breakLineCode:a,needIndent:o});c.push(n===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),c.indent(o),s.length>0&&(c.push(`const { ${ye(s.map(e=>`${e}: _${e}`),`, `)} } = ctx`),c.newline()),c.push(`return `),Ze(c,e),c.deindent(o),c.push(`}`),delete e.helpers;let{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function $e(e,t={}){let n=k({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null?!0:n.optimize,o=Re(n).parse(e);return r?(a&&Ue(o),i&&Ge(o),{ast:o,code:``}):(He(o,n),Qe(o,n))}function et(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(j().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!=`boolean`&&(j().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function W(e){return L(e)&&ut(e)===0&&(M(e,`b`)||M(e,`body`))}var tt=[`b`,`body`];function nt(e){return _t(e,tt)}var rt=[`c`,`cases`];function it(e){return _t(e,rt,[])}var at=[`s`,`static`];function ot(e){return _t(e,at)}var st=[`i`,`items`];function ct(e){return _t(e,st,[])}var lt=[`t`,`type`];function ut(e){return _t(e,lt)}var dt=[`v`,`value`];function ft(e,t){let n=_t(e,dt);if(n!=null)return n;throw yt(t)}var pt=[`m`,`modifier`];function mt(e){return _t(e,pt)}var ht=[`k`,`key`];function gt(e){let t=_t(e,ht);if(t)return t;throw yt(6)}function _t(e,t,n){for(let n=0;n<t.length;n++){let r=t[n];if(M(e,r)&&e[r]!=null)return e[r]}return n}var vt=[...tt,...rt,...at,...st,...ht,...pt,...dt,...lt];function yt(e){return Error(`unhandled node type: ${e}`)}function bt(e){return t=>xt(t,e)}function xt(e,t){let n=nt(t);if(n==null)throw yt(0);if(ut(n)===1){let t=it(n);return e.plural(t.reduce((t,n)=>[...t,St(e,n)],[]))}else return St(e,n)}function St(e,t){let n=ot(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=ct(t).reduce((t,n)=>[...t,Ct(e,n)],[]);return e.normalize(n)}}function Ct(e,t){let n=ut(t);switch(n){case 3:return ft(t,n);case 9:return ft(t,n);case 4:{let r=t;if(M(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(M(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw yt(n)}case 5:{let r=t;if(M(r,`i`)&&O(r.i))return e.interpolate(e.list(r.i));if(M(r,`index`)&&O(r.index))return e.interpolate(e.list(r.index));throw yt(n)}case 6:{let n=t,r=mt(n),i=gt(n);return e.linked(Ct(e,i),r?Ct(e,r):void 0,e.type)}case 7:return ft(t,n);case 8:return ft(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}var wt=e=>e,Tt=A();function Et(e,t={}){let n=!1,r=t.onError||Te;return t.onError=e=>{n=!0,r(e)},{...$e(e,t),detectError:n}}function Dt(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&F(e)){I(t.warnHtmlMessage)&&t.warnHtmlMessage;let n=(t.onCacheKey||wt)(e),r=Tt[n];if(r)return r;let{ast:i,detectError:a}=Et(e,{...t,location:!1,jit:!0}),o=bt(i);return a?o:Tt[n]=o}else{let t=e.cacheKey;return t?Tt[t]||(Tt[t]=bt(e)):bt(e)}}var Ot=null;function kt(e){Ot=e}function At(e,t,n){Ot&&Ot.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}var jt=Mt(`function:translate`);function Mt(e){return t=>Ot&&Ot.emit(e,t)}var G={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function Nt(e){return we(e,null,void 0)}G.INVALID_ARGUMENT,G.INVALID_DATE_ARGUMENT,G.INVALID_ISO_DATE_ARGUMENT,G.NOT_SUPPORT_NON_STRING_MESSAGE,G.NOT_SUPPORT_LOCALE_PROMISE_VALUE,G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,G.NOT_SUPPORT_LOCALE_TYPE;function Pt(e,t){return t.locale==null?It(e.locale):It(t.locale)}var Ft;function It(e){if(F(e))return e;if(P(e)){if(e.resolvedOnce&&Ft!=null)return Ft;if(e.constructor.name===`Function`){let t=e();if(he(t))throw Nt(G.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ft=t}else throw Nt(G.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Nt(G.NOT_SUPPORT_LOCALE_TYPE)}function Lt(e,t,n){return[...new Set([n,...N(t)?t:L(t)?Object.keys(t):F(t)?[t]:[n]])]}function Rt(e,t,n){let r=F(n)?n:en,i=e;i.__localeChainCache||=new Map;let a=i.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;N(e);)e=zt(a,e,t);let o=N(t)||!R(t)?t:t.default?t.default:null;e=F(o)?[o]:o,N(e)&&zt(a,e,!1),i.__localeChainCache.set(r,a)}return a}function zt(e,t,n){let r=!0;for(let i=0;i<t.length&&I(r);i++){let a=t[i];F(a)&&(r=Bt(e,t[i],n))}return r}function Bt(e,t,n){let r,i=t.split(`-`);do r=Vt(e,i.join(`-`),n),i.splice(-1,1);while(i.length&&r===!0);return r}function Vt(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!==`!`;let i=t.replace(/!/g,``);e.push(i),(N(n)||R(n))&&n[i]&&(r=n[i])}return r}var Ht=[];Ht[0]={w:[0],i:[3,0],"[":[4],o:[7]},Ht[1]={w:[1],".":[2],"[":[4],o:[7]},Ht[2]={w:[2],i:[3,0],0:[3,0]},Ht[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Ht[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Ht[5]={"'":[4,0],o:8,l:[5,0]},Ht[6]={'"':[4,0],o:8,l:[6,0]};var Ut=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Wt(e){return Ut.test(e)}function Gt(e){let t=e.charCodeAt(0);return t===e.charCodeAt(e.length-1)&&(t===34||t===39)?e.slice(1,-1):e}function Kt(e){if(e==null)return`o`;switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return`i`;case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return`w`}return`i`}function qt(e){let t=e.trim();return e.charAt(0)===`0`&&isNaN(parseInt(e))?!1:Wt(t)?Gt(t):`*`+t}function Jt(e){let t=[],n=-1,r=0,i=0,a,o,s,c,l,u,d,f=[];f[0]=()=>{o===void 0?o=s:o+=s},f[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=qt(o),o===!1))return!1;f[1]()}};function p(){let t=e[n+1];if(r===5&&t===`'`||r===6&&t===`"`)return n++,s=`\\`+t,f[0](),!0}for(;r!==null;)if(n++,a=e[n],!(a===`\\`&&p())){if(c=Kt(a),d=Ht[r],l=d[c]||d.l||8,l===8||(r=l[0],l[1]!==void 0&&(u=f[l[1]],u&&(s=a,u()===!1))))return;if(r===7)return t}}var Yt=new Map;function Xt(e,t){return L(e)?e[t]:null}function Zt(e,t){if(!L(e))return null;let n=Yt.get(t);if(n||(n=Jt(t),n&&Yt.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a<r;){let e=n[a];if(vt.includes(e)&&W(i)||!L(i)||!M(i,e))return null;let t=i[e];if(t===void 0||P(i))return null;i=t,a++}return i}var Qt={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,INVALID_NUMBER_ARGUMENT:8,INVALID_DATE_ARGUMENT:9};Qt.NOT_FOUND_KEY,Qt.FALLBACK_TO_TRANSLATE,Qt.CANNOT_FORMAT_NUMBER,Qt.FALLBACK_TO_NUMBER_FORMAT,Qt.CANNOT_FORMAT_DATE,Qt.FALLBACK_TO_DATE_FORMAT,Qt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER,Qt.INVALID_NUMBER_ARGUMENT,Qt.INVALID_DATE_ARGUMENT;var $t=`11.4.2`,en=`en-US`,tn=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function nn(){return{upper:(e,t)=>t===`text`&&F(e)?e.toUpperCase():t===`vnode`&&L(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&F(e)?e.toLowerCase():t===`vnode`&&L(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&F(e)?tn(e):t===`vnode`&&L(e)&&`__v_isVNode`in e?tn(e.children):e}}var rn;function an(e){rn=e}var on;function sn(e){on=e}var cn;function ln(e){cn=e}var un=null,dn=()=>un,fn=null,pn=e=>{fn=e},mn=()=>fn,hn=0;function gn(e={}){let t=P(e.onWarn)?e.onWarn:ne,n=F(e.version)?e.version:$t,r=F(e.locale)||P(e.locale)?e.locale:en,i=P(r)?en:r,a=N(e.fallbackLocale)||R(e.fallbackLocale)||F(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=R(e.messages)?e.messages:_n(i),s=R(e.datetimeFormats)?e.datetimeFormats:_n(i),c=R(e.numberFormats)?e.numberFormats:_n(i),l=k(A(),e.modifiers,nn()),u=e.pluralRules||A(),d=P(e.missing)?e.missing:null,f=I(e.missingWarn)||se(e.missingWarn)?e.missingWarn:!0,p=I(e.fallbackWarn)||se(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=P(e.postTranslation)?e.postTranslation:null,_=R(e.processor)?e.processor:null,v=I(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter,b=P(e.messageCompiler)?e.messageCompiler:rn,x=P(e.messageResolver)?e.messageResolver:on||Xt,S=P(e.localeFallbacker)?e.localeFallbacker:cn||Lt,ee=L(e.fallbackContext)?e.fallbackContext:void 0,C=e,w=L(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,T=L(C.__numberFormatters)?C.__numberFormatters:new Map,te=L(C.__meta)?C.__meta:{};hn++;let E={version:n,cid:hn,locale:r,fallbackLocale:a,messages:o,modifiers:l,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:h,postTranslation:g,processor:_,warnHtmlMessage:v,escapeParameter:y,messageCompiler:b,messageResolver:x,localeFallbacker:S,fallbackContext:ee,onWarn:t,__meta:te};return E.datetimeFormats=s,E.numberFormats=c,E.__datetimeFormatters=w,E.__numberFormatters=T,__INTLIFY_PROD_DEVTOOLS__&&At(E,n,te),E}var _n=e=>({[e]:A()});function vn(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return F(r)?r:t}else return t}function yn(e,t,n){let r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function bn(e,t){return e===t?!1:e.split(`-`)[0]===t.split(`-`)[0]}function xn(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r<t.length;r++)if(bn(e,t[r]))return!0;return!1}var Sn=typeof Intl<`u`;Sn&&Intl.DateTimeFormat,Sn&&Intl.NumberFormat;function Cn(e,...t){let{datetimeFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__datetimeFormatters:s}=e;if(!F(t[0])&&!oe(t[0])&&!O(t[0]))return``;let[c,l,u,d]=Tn(...t),f=I(u.missingWarn)?u.missingWarn:e.missingWarn;I(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Pt(e,u),h=o(e,i,m);if(!F(c)||c===``)return new Intl.DateTimeFormat(m.replace(/!/g,``),d).format(l);let g={},_,v=null;for(let t=0;t<h.length&&(_=h[t],g=n[_]||{},v=g[c],!R(v));t++)vn(e,c,_,f,`datetime format`);if(!R(v)||!F(_))return r?-1:c;let y=`${_}__${c}`;ce(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.DateTimeFormat(_,k({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var wn=[`localeMatcher`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`formatMatcher`,`hour12`,`timeZone`,`dateStyle`,`timeStyle`,`calendar`,`dayPeriod`,`numberingSystem`,`hourCycle`,`fractionalSecondDigits`];function Tn(...e){let[t,n,r,i]=e,a=A(),o=A(),s;if(F(t)){let e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Nt(G.INVALID_ISO_DATE_ARGUMENT);let n=e[3]?e[3].trim().startsWith(`T`)?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();s=new Date(n);try{s.toISOString()}catch{throw Nt(G.INVALID_ISO_DATE_ARGUMENT)}}else if(oe(t)){if(isNaN(t.getTime()))throw Nt(G.INVALID_DATE_ARGUMENT);s=t}else if(O(t))s=t;else throw Nt(G.INVALID_ARGUMENT);return F(n)?a.key=n:R(n)&&Object.keys(n).forEach(e=>{wn.includes(e)?o[e]=n[e]:a[e]=n[e]}),F(r)?a.locale=r:R(r)&&(o=r),R(i)&&(o=i),[a.key||``,s,a,o]}function En(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function Dn(e,...t){let{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:a,localeFallbacker:o}=e,{__numberFormatters:s}=e;if(!O(t[0]))return``;let[c,l,u,d]=kn(...t),f=I(u.missingWarn)?u.missingWarn:e.missingWarn;I(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;let p=!!u.part,m=Pt(e,u),h=o(e,i,m);if(!F(c)||c===``)return new Intl.NumberFormat(m.replace(/!/g,``),d).format(l);let g={},_,v=null;for(let t=0;t<h.length&&(_=h[t],g=n[_]||{},v=g[c],!R(v));t++)vn(e,c,_,f,`number format`);if(!R(v)||!F(_))return r?-1:c;let y=`${_}__${c}`;ce(d)||(y=`${y}__${JSON.stringify(d)}`);let b=s.get(y);return b||(b=new Intl.NumberFormat(_,k({},v,d)),s.set(y,b)),p?b.formatToParts(l):b.format(l)}var On=[`localeMatcher`,`style`,`currency`,`currencyDisplay`,`currencySign`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`roundingMode`,`roundingPriority`,`roundingIncrement`,`trailingZeroDisplay`];function kn(...e){let[t,n,r,i]=e,a=A(),o=A();if(!O(t))throw Nt(G.INVALID_ARGUMENT);let s=t;return F(n)?a.key=n:R(n)&&Object.keys(n).forEach(e=>{On.includes(e)?o[e]=n[e]:a[e]=n[e]}),F(r)?a.locale=r:R(r)&&(o=r),R(i)&&(o=i),[a.key||``,s,a,o]}function An(e,t,n){let r=e;for(let e in n){let n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}var jn=e=>e,Mn=e=>``,Nn=`text`,Pn=e=>e.length===0?``:ye(e),Fn=ve;function In(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function Ln(e){let t=O(e.pluralIndex)?e.pluralIndex:-1;return O(e.named?.count)?e.named.count:O(e.named?.n)?e.named.n:t}function Rn(e={}){let t=e.locale,n=Ln(e),r=F(t)&&P(e.pluralRules?.[t])?e.pluralRules[t]:In,i=r===In?void 0:In,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||A();O(e.pluralIndex)&&(c.count||=e.pluralIndex,c.n||=e.pluralIndex);let l=e=>c[e];function u(t,n){return(P(e.messages)?e.messages(t,!!n):L(e.messages)?e.messages[t]:!1)||(e.parent?e.parent.message(t):Mn)}let d=t=>e.modifiers?e.modifiers[t]:jn,f=P(e.processor?.normalize)?e.processor.normalize:Pn,p=P(e.processor?.interpolate)?e.processor.interpolate:Fn,m={list:s,named:l,plural:a,linked:(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?L(n)?(a=n.modifier||a,i=n.type||i):F(n)&&(a=n||a):t.length===2&&(F(n)&&(a=n||a),F(r)&&(i=r||i));let o=u(e,!0)(m),s=o===``||o===void 0?e:o,c=i===`vnode`&&N(s)&&a?s[0]:s;return a?d(a)(c,i):c},message:u,type:F(e.processor?.type)?e.processor.type:Nn,interpolate:p,normalize:f,values:k(A(),o,c)};return m}var zn=()=>``,K=e=>P(e);function Bn(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=Gn(...t),u=I(l.missingWarn)?l.missingWarn:e.missingWarn,d=I(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=I(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=F(l.default)||I(l.default)?I(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(F(m)||P(m)),g=Pt(e,l);f&&Vn(l);let[_,v,y]=p?[c,g,s[g]||A()]:Hn(e,c,g,o,d,u),b=_,x=c;if(!p&&!(F(b)||W(b)||K(b))&&h&&(b=m,x=b),!p&&(!(F(b)||W(b)||K(b))||!F(v)))return i?-1:c;let S=!1,ee=K(b)?b:Un(e,c,v,b,x,()=>{S=!0});if(S)return b;let C=Wn(e,ee,Rn(qn(e,v,y,l))),w=r?r(C,c):C;if(f&&F(w)&&(w=pe(w)),__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:F(c)?c:K(b)?b.key:``,locale:v||(K(b)?b.locale:``),format:F(b)?b:K(b)?b.source:``,message:w};t.meta=k({},e.__meta,dn()||{}),jt(t)}return w}function Vn(e){N(e.list)?e.list=e.list.map(e=>F(e)?de(e):e):L(e.named)&&Object.keys(e.named).forEach(t=>{F(e.named[t])&&(e.named[t]=de(e.named[t]))})}function Hn(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=A(),f,p=null;for(let n=0;n<u.length&&(f=u[n],d=o[f]||A(),(p=c(d,t))===null&&(p=d[t]),!(F(p)||W(p)||K(p)));n++)if(!xn(f,u)){let n=vn(e,t,f,a,`translate`);n!==t&&(p=n)}return[p,f,d]}function Un(e,t,n,r,i,a){let{messageCompiler:o,warnHtmlMessage:s}=e;if(K(r)){let e=r;return e.locale=e.locale||n,e.key=e.key||t,e}if(o==null){let e=(()=>r);return e.locale=n,e.key=t,e}let c=o(r,Kn(e,n,i,r,s,a));return c.locale=n,c.key=t,c.source=r,c}function Wn(e,t,n){return t(n)}function Gn(...e){let[t,n,r]=e,i=A();if(!F(t)&&!O(t)&&!K(t)&&!W(t))throw Nt(G.INVALID_ARGUMENT);let a=O(t)?String(t):(K(t),t);return O(n)?i.plural=n:F(n)?i.default=n:R(n)&&!ce(n)?i.named=n:N(n)&&(i.list=n),O(r)?i.plural=r:F(r)?i.default=r:R(r)&&k(i,r),[a,i]}function Kn(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>ie(t,n,e)}}function qn(e,t,n,r){let{modifiers:i,pluralRules:a,messageResolver:o,fallbackLocale:s,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,d={locale:t,modifiers:i,pluralRules:a,messages:(r,i)=>{let a=o(n,r);if(a==null&&(u||i)){let[n,,i]=Hn(u||e,r,t,s,c,l);a=n??o(i,r)}if(F(a)||W(a)){let n=!1,i=Un(e,r,t,a,r,()=>{n=!0});return n?zn:i}else if(K(a))return a;else return zn}};return e.processor&&(d.processor=e.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),O(r.plural)&&(d.pluralIndex=r.plural),d}et();var Jn=`11.4.2`;function Yn(){typeof __VUE_I18N_FULL_INSTALL__!=`boolean`&&(j().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!=`boolean`&&(j().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!=`boolean`&&(j().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(j().__INTLIFY_PROD_DEVTOOLS__=!1)}var q={UNEXPECTED_RETURN_TYPE:24,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function J(e,...t){return we(e,null,void 0)}q.UNEXPECTED_RETURN_TYPE,q.INVALID_ARGUMENT,q.MUST_BE_CALL_SETUP_TOP,q.NOT_INSTALLED,q.UNEXPECTED_ERROR,q.REQUIRED_VALUE,q.INVALID_VALUE,q.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN,q.NOT_INSTALLED_WITH_PROVIDE,q.NOT_COMPATIBLE_LEGACY_VUE_I18N,q.NOT_AVAILABLE_COMPOSITION_IN_LEGACY;var Xn=D(`__translateVNode`),Zn=D(`__datetimeParts`),Qn=D(`__numberParts`),$n=D(`__setPluralRules`);D(`__intlifyMeta`);var er=D(`__injectWithOption`),tr=D(`__dispose`),nr={FALLBACK_TO_ROOT:10,NOT_FOUND_PARENT_SCOPE:11,IGNORE_OBJ_FLATTEN:12,DEPRECATE_LEGACY_MODE:13,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:14,DUPLICATE_USE_I18N_CALLING:15};nr.FALLBACK_TO_ROOT,nr.NOT_FOUND_PARENT_SCOPE,nr.IGNORE_OBJ_FLATTEN,nr.DEPRECATE_LEGACY_MODE,nr.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE,nr.DUPLICATE_USE_I18N_CALLING;function rr(e){if(!L(e)||W(e))return e;for(let t in e)if(M(e,t))if(!t.includes(`.`))L(e[t])&&rr(e[t]);else{let n=t.split(`.`),r=n.length-1,i=e,a=!1;for(let e=0;e<r;e++){if(n[e]===`__proto__`)throw Error(`unsafe key: ${n[e]}`);if(n[e]in i||(i[n[e]]=A()),!L(i[n[e]])){a=!0;break}i=i[n[e]]}if(a||(W(i)?vt.includes(n[r])||delete e[t]:(i[n[r]]=e[t],delete e[t])),!W(i)){let e=i[n[r]];L(e)&&rr(e)}}return e}function ir(e,t){let{messages:n,__i18n:r,messageResolver:i,flatJson:a}=t,o=R(n)?n:N(r)?A():{[e]:A()};if(N(r)&&r.forEach(e=>{if(`locale`in e&&`resource`in e){let{locale:t,resource:n}=e;t?(o[t]=o[t]||A(),xe(n,o[t])):xe(n,o)}else F(e)&&xe(JSON.parse(e),o)}),i==null&&a)for(let e in o)M(o,e)&&rr(o[e]);return o}function ar(e){return e.type}function or(e,t,n){let r=L(t.messages)?t.messages:A();`__i18nGlobal`in n&&(r=ir(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));let i=Object.keys(r);if(i.length&&i.forEach(t=>{e.mergeLocaleMessage(t,r[t])}),L(t.datetimeFormats)){let n=Object.keys(t.datetimeFormats);n.length&&n.forEach(n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])})}if(L(t.numberFormats)){let n=Object.keys(t.numberFormats);n.length&&n.forEach(n=>{e.mergeNumberFormat(n,t.numberFormats[n])})}}function sr(e){return w(t,null,e,0)}function cr(){let e=`currentInstance`;return e in S?S[e]:ee()}var lr=()=>[],ur=()=>!1,dr=0;function fr(e){return((t,n,r,i)=>e(n,r,cr()||void 0,i))}function pr(e={}){let{__root:t,__injectWithOption:n}=e,r=t===void 0,i=e.flatJson,a=re?g:l,s=I(e.inheritLocale)?e.inheritLocale:!0,c=a(t&&s?t.locale.value:F(e.locale)?e.locale:en),u=a(t&&s?t.fallbackLocale.value:F(e.fallbackLocale)||N(e.fallbackLocale)||R(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:c.value),d=a(ir(c.value,e)),f=a(R(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),p=a(R(e.numberFormats)?e.numberFormats:{[c.value]:{}}),m=t?t.missingWarn:I(e.missingWarn)||se(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:I(e.fallbackWarn)||se(e.fallbackWarn)?e.fallbackWarn:!0,_=t?t.fallbackRoot:I(e.fallbackRoot)?e.fallbackRoot:!0,v=!!e.fallbackFormat,y=P(e.missing)?e.missing:null,b=P(e.missing)?fr(e.missing):null,x=P(e.postTranslation)?e.postTranslation:null,S=t?t.warnHtmlMessage:I(e.warnHtmlMessage)?e.warnHtmlMessage:!0,ee=!!e.escapeParameter,C=t?t.modifiers:R(e.modifiers)?e.modifiers:{},w=e.pluralRules||t&&t.pluralRules,T;T=(()=>{r&&pn(null);let t={version:Jn,locale:c.value,fallbackLocale:u.value,messages:d.value,modifiers:C,pluralRules:w,missing:b===null?void 0:b,missingWarn:m,fallbackWarn:h,fallbackFormat:v,unresolving:!0,postTranslation:x===null?void 0:x,warnHtmlMessage:S,escapeParameter:ee,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:`vue`}};t.datetimeFormats=f.value,t.numberFormats=p.value,t.__datetimeFormatters=R(T)?T.__datetimeFormatters:void 0,t.__numberFormatters=R(T)?T.__numberFormatters:void 0;let n=gn(t);return r&&pn(n),n})(),yn(T,c.value,u.value);function E(){return[c.value,u.value,d.value,f.value,p.value]}let ne=o({get:()=>c.value,set:e=>{T.locale=e,c.value=e}}),D=o({get:()=>u.value,set:e=>{T.fallbackLocale=e,u.value=e,yn(T,c.value,e)}}),ie=o(()=>d.value),ae=o(()=>f.value),oe=o(()=>p.value);function ce(){return P(x)?x:null}function le(e){x=e,T.postTranslation=e}function A(){return y}function ue(e){e!==null&&(b=fr(e)),y=e,T.missing=b}let j=(e,n,i,a,o,s)=>{E();let c;try{__INTLIFY_PROD_DEVTOOLS__,r||(T.fallbackContext=t?mn():void 0),c=e(T)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(T.fallbackContext=void 0)}if(i!==`translate exists`&&O(c)&&c===-1||i===`translate exists`&&!c){let[e,r]=n();return t&&_?a(t):o(e)}else if(s(c))return c;else throw J(q.UNEXPECTED_RETURN_TYPE)};function de(...e){return j(t=>Reflect.apply(Bn,null,[t,...e]),()=>Gn(...e),`translate`,t=>Reflect.apply(t.t,t,[...e]),e=>e,e=>F(e))}function fe(...e){let[t,n,r]=e;if(r&&!L(r))throw J(q.INVALID_ARGUMENT);return de(t,n,k({resolvedMessage:!0},r||{}))}function pe(...e){return j(t=>Reflect.apply(Cn,null,[t,...e]),()=>Tn(...e),`datetime format`,t=>Reflect.apply(t.d,t,[...e]),()=>``,e=>F(e)||N(e))}function me(...e){return j(t=>Reflect.apply(Dn,null,[t,...e]),()=>kn(...e),`number format`,t=>Reflect.apply(t.n,t,[...e]),()=>``,e=>F(e)||N(e))}function he(e){return e.map(e=>F(e)||O(e)||I(e)?sr(String(e)):e)}let ge={normalize:he,interpolate:e=>e,type:`vnode`};function _e(...e){return j(t=>{let n,r=t;try{r.processor=ge,n=Reflect.apply(Bn,null,[r,...e])}finally{r.processor=null}return n},()=>Gn(...e),`translate`,t=>t[Xn](...e),e=>[sr(e)],e=>N(e))}function ve(...e){return j(t=>Reflect.apply(Dn,null,[t,...e]),()=>kn(...e),`number format`,t=>t[Qn](...e),lr,e=>F(e)||N(e))}function ye(...e){return j(t=>Reflect.apply(Cn,null,[t,...e]),()=>Tn(...e),`datetime format`,t=>t[Zn](...e),lr,e=>F(e)||N(e))}function be(e){w=e,T.pluralRules=w}function Se(e,t){return j(()=>{if(!e)return!1;let n=F(t)?t:c.value,r=F(t)?[n]:Rt(T,u.value,n);for(let t=0;t<r.length;t++){let n=we(r[t]),i=T.messageResolver(n,e);if(i===null&&(i=n[e]),W(i)||K(i)||F(i))return!0}return!1},()=>[e],`translate exists`,n=>Reflect.apply(n.te,n,[e,t]),ur,e=>I(e))}function Ce(e){let t=null,n=Rt(T,u.value,c.value);for(let r=0;r<n.length;r++){let i=d.value[n[r]]||{},a=T.messageResolver(i,e);if(a!=null){t=a;break}}return t}function z(e){return Ce(e)??(t&&t.tm(e)||{})}function we(e){return d.value[e]||{}}function Te(e,t){if(i){let n={[e]:t};for(let e in n)M(n,e)&&rr(n[e]);t=n[e]}d.value[e]=t,T.messages=d.value}function B(e,t){d.value[e]=d.value[e]||{};let n={[e]:t};if(i)for(let e in n)M(n,e)&&rr(n[e]);t=n[e],xe(t,d.value[e]),T.messages=d.value}function Ee(e){return f.value[e]||{}}function V(e,t){f.value[e]=t,T.datetimeFormats=f.value,En(T,e,t)}function De(e,t){f.value[e]=k(f.value[e]||{},t),T.datetimeFormats=f.value,En(T,e,t)}function Oe(e){return p.value[e]||{}}function ke(e,t){p.value[e]=t,T.numberFormats=p.value,An(T,e,t)}function Ae(e,t){p.value[e]=k(p.value[e]||{},t),T.numberFormats=p.value,An(T,e,t)}dr++,t&&re&&(te(t.locale,e=>{s&&(c.value=e,T.locale=e,yn(T,c.value,u.value))}),te(t.fallbackLocale,e=>{s&&(u.value=e,T.fallbackLocale=e,yn(T,c.value,u.value))}));let H={id:dr,locale:ne,fallbackLocale:D,get inheritLocale(){return s},set inheritLocale(e){s=e,e&&t&&(c.value=t.locale.value,u.value=t.fallbackLocale.value,yn(T,c.value,u.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:ie,get modifiers(){return C},get pluralRules(){return w||{}},get isGlobal(){return r},get missingWarn(){return m},set missingWarn(e){m=e,T.missingWarn=m},get fallbackWarn(){return h},set fallbackWarn(e){h=e,T.fallbackWarn=h},get fallbackRoot(){return _},set fallbackRoot(e){_=e},get fallbackFormat(){return v},set fallbackFormat(e){v=e,T.fallbackFormat=v},get warnHtmlMessage(){return S},set warnHtmlMessage(e){S=e,T.warnHtmlMessage=e},get escapeParameter(){return ee},set escapeParameter(e){ee=e,T.escapeParameter=e},t:de,getLocaleMessage:we,setLocaleMessage:Te,mergeLocaleMessage:B,getPostTranslationHandler:ce,setPostTranslationHandler:le,getMissingHandler:A,setMissingHandler:ue,[$n]:be};return H.datetimeFormats=ae,H.numberFormats=oe,H.rt=fe,H.te=Se,H.tm=z,H.d=pe,H.n=me,H.getDateTimeFormat=Ee,H.setDateTimeFormat=V,H.mergeDateTimeFormat=De,H.getNumberFormat=Oe,H.setNumberFormat=ke,H.mergeNumberFormat=Ae,H[er]=n,H[Xn]=_e,H[Zn]=ye,H[Qn]=ve,H}function mr(e){let t=F(e.locale)?e.locale:en,n=F(e.fallbackLocale)||N(e.fallbackLocale)||R(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=P(e.missing)?e.missing:void 0,i=I(e.silentTranslationWarn)||se(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,a=I(e.silentFallbackWarn)||se(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,o=I(e.fallbackRoot)?e.fallbackRoot:!0,s=!!e.formatFallbackMessages,c=R(e.modifiers)?e.modifiers:{},l=e.pluralizationRules,u=P(e.postTranslation)?e.postTranslation:void 0,d=F(e.warnHtmlInMessage)?e.warnHtmlInMessage!==`off`:!0,f=!!e.escapeParameterHtml,p=I(e.sync)?e.sync:!0,m=e.messages;if(R(e.sharedMessages)){let t=e.sharedMessages;m=Object.keys(t).reduce((e,n)=>(k(e[n]||(e[n]={}),t[n]),e),m||{})}let{__i18n:h,__root:g,__injectWithOption:_}=e,v=e.datetimeFormats,y=e.numberFormats,b=e.flatJson;return{locale:t,fallbackLocale:n,messages:m,flatJson:b,datetimeFormats:v,numberFormats:y,missing:r,missingWarn:i,fallbackWarn:a,fallbackRoot:o,fallbackFormat:s,modifiers:c,pluralRules:l,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:p,__i18n:h,__root:g,__injectWithOption:_}}function hr(e={}){let t=pr(mr(e)),{__extender:n}=e,r={id:t.id,get locale(){return t.locale.value},set locale(e){t.locale.value=e},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(e){t.fallbackLocale.value=e},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(e){t.setMissingHandler(e)},get silentTranslationWarn(){return I(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(e){t.missingWarn=I(e)?!e:e},get silentFallbackWarn(){return I(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(e){t.fallbackWarn=I(e)?!e:e},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(e){t.fallbackFormat=e},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(e){t.setPostTranslationHandler(e)},get sync(){return t.inheritLocale},set sync(e){t.inheritLocale=e},get warnHtmlInMessage(){return t.warnHtmlMessage?`warn`:`off`},set warnHtmlInMessage(e){t.warnHtmlMessage=e!==`off`},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(e){t.escapeParameter=e},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...e){return Reflect.apply(t.t,t,[...e])},rt(...e){return Reflect.apply(t.rt,t,[...e])},te(e,n){return t.te(e,n)},tm(e){return t.tm(e)},getLocaleMessage(e){return t.getLocaleMessage(e)},setLocaleMessage(e,n){t.setLocaleMessage(e,n)},mergeLocaleMessage(e,n){t.mergeLocaleMessage(e,n)},d(...e){return Reflect.apply(t.d,t,[...e])},getDateTimeFormat(e){return t.getDateTimeFormat(e)},setDateTimeFormat(e,n){t.setDateTimeFormat(e,n)},mergeDateTimeFormat(e,n){t.mergeDateTimeFormat(e,n)},n(...e){return Reflect.apply(t.n,t,[...e])},getNumberFormat(e){return t.getNumberFormat(e)},setNumberFormat(e,n){t.setNumberFormat(e,n)},mergeNumberFormat(e,n){t.mergeNumberFormat(e,n)}};return r.__extender=n,r}function gr(e,t,n){return{beforeCreate(){let r=cr();if(!r)throw J(q.UNEXPECTED_ERROR);let i=this.$options;if(i.i18n){let r=i.i18n;if(i.__i18n&&(r.__i18n=i.__i18n),r.__root=t,this===this.$root)this.$i18n=_r(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=hr(r);let e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}}else if(i.__i18n)if(this===this.$root)this.$i18n=_r(e,i);else{this.$i18n=hr({__i18n:i.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});let e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}else this.$i18n=e;i.__i18nGlobal&&or(t,i,i),this.$t=(...e)=>this.$i18n.t(...e),this.$rt=(...e)=>this.$i18n.rt(...e),this.$te=(e,t)=>this.$i18n.te(e,t),this.$d=(...e)=>this.$i18n.d(...e),this.$n=(...e)=>this.$i18n.n(...e),this.$tm=e=>this.$i18n.tm(e),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){let e=cr();if(!e)throw J(q.UNEXPECTED_ERROR);let t=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,t.__disposer&&(t.__disposer(),delete t.__disposer,delete t.__extender),n.__deleteInstance(e),delete this.$i18n}}}function _r(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[$n](t.pluralizationRules||e.pluralizationRules);let n=ir(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(t=>e.mergeLocaleMessage(t,n[t])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(n=>e.mergeDateTimeFormat(n,t.datetimeFormats[n])),t.numberFormats&&Object.keys(t.numberFormats).forEach(n=>e.mergeNumberFormat(n,t.numberFormats[n])),e}var vr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e===`parent`||e===`global`,default:`parent`},i18n:{type:Object}};function yr({slots:e},t){return t.length===1&&t[0]===`default`?(e.default?e.default():[]).reduce((e,t)=>[...e,...t.type===n?t.children:[t]],[]):t.reduce((t,n)=>{let r=e[n];return r&&(t[n]=r()),t},A())}function br(){return n}var xr=y({name:`i18n-t`,props:k({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>O(e)||!isNaN(e)}},vr),setup(e,t){let{slots:n,attrs:r}=t,i=e.i18n||Mr({useScope:e.scope,__useComponent:!0});return()=>{let a=()=>{let r=Object.keys(n).filter(e=>e[0]!==`_`),a=A();e.locale&&(a.locale=e.locale),e.plural!==void 0&&(a.plural=F(e.plural)?+e.plural:e.plural);let o=yr(t,r);return i[Xn](e.keypath,o,a)},o=k(A(),r),s=F(e.tag)||L(e.tag)?e.tag:br();return L(s)?b(s,o,{default:a}):b(s,o,a())}}});function Sr(e){return N(e)&&!F(e[0])}function Cr(e,t,n,r){let{slots:i,attrs:a}=t;return()=>{let t=()=>{let t={part:!0},a=A();e.locale&&(t.locale=e.locale),F(e.format)?t.key=e.format:L(e.format)&&(F(e.format.key)&&(t.key=e.format.key),a=Object.keys(e.format).reduce((t,r)=>n.includes(r)?k(A(),t,{[r]:e.format[r]}):t,A()));let o=r(e.value,t,a),s=[t.key];return N(o)?s=o.map((e,t)=>{let n=i[e.type],r=n?n({[e.type]:e.value,index:t,parts:o}):[e.value];return Sr(r)&&(r[0].key=`${e.type}-${t}`),r}):F(o)&&(s=[o]),s},o=k(A(),a),s=F(e.tag)||L(e.tag)?e.tag:br();return L(s)?b(s,o,{default:t}):b(s,o,t())}}var wr=y({name:`i18n-n`,props:k({value:{type:Number,required:!0},format:{type:[String,Object]}},vr),setup(e,t){let n=e.i18n||Mr({useScope:e.scope,__useComponent:!0});return Cr(e,t,On,(...e)=>n[Qn](...e))}});function Tr(e,t){let n=e;if(e.mode===`composition`)return n.__getInstance(t)||e.global;{let r=n.__getInstance(t);return r==null?e.global.__composer:r.__composer}}function Er(e){let t=t=>{let{instance:n,value:r}=t;if(!n||!n.$)throw J(q.UNEXPECTED_ERROR);let i=Tr(e,n.$),a=Dr(r);return[Reflect.apply(i.t,i,[...Or(a)]),i]};return{created:(e,n)=>{let[r,i]=t(n);re&&(e.__i18nWatcher=te(i.locale,()=>{n.instance&&n.instance.$forceUpdate()})),e.__composer=i,e.textContent=r},unmounted:e=>{re&&e.__i18nWatcher&&(e.__i18nWatcher(),e.__i18nWatcher=void 0,delete e.__i18nWatcher),e.__composer&&(e.__composer=void 0,delete e.__composer)},beforeUpdate:(e,{value:t})=>{if(e.__composer){let n=e.__composer,r=Dr(t);e.textContent=Reflect.apply(n.t,n,[...Or(r)])}},getSSRProps:e=>{let[n]=t(e);return{textContent:n}}}}function Dr(e){if(F(e))return{path:e};if(R(e)){if(!(`path`in e))throw J(q.REQUIRED_VALUE,`path`);return e}else throw J(q.INVALID_VALUE)}function Or(e){let{path:t,locale:n,args:r,choice:i,plural:a}=e,o={},s=r||{};return F(n)&&(o.locale=n),O(i)&&(o.plural=i),O(a)&&(o.plural=a),[t,s,o]}function kr(e,t,...n){let r=R(n[0])?n[0]:{};(!I(r.globalInstall)||r.globalInstall)&&([xr.name,`I18nT`].forEach(t=>e.component(t,xr)),[wr.name,`I18nN`].forEach(t=>e.component(t,wr)),[Ur.name,`I18nD`].forEach(t=>e.component(t,Ur))),e.directive(`t`,Er(t))}var Ar=D(`global-vue-i18n`);function jr(e={}){let t=__VUE_I18N_LEGACY_API__&&I(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=I(e.globalInjection)?e.globalInjection:!0,r=new Map,[i,a]=Nr(e,t),o=D(``);function s(e){return r.get(e)||null}function c(e,t){r.set(e,t)}function l(e){r.delete(e)}let u={get mode(){return __VUE_I18N_LEGACY_API__&&t?`legacy`:`composition`},async install(e,...r){if(e.__VUE_I18N_SYMBOL__=o,e.provide(e.__VUE_I18N_SYMBOL__,u),R(r[0])){let e=r[0];u.__composerExtend=e.__composerExtend,u.__vueI18nExtend=e.__vueI18nExtend}let i=null;!t&&n&&(i=Hr(e,u.global)),__VUE_I18N_FULL_INSTALL__&&kr(e,u,...r),__VUE_I18N_LEGACY_API__&&t&&e.mixin(gr(a,a.__composer,u));let s=e.unmount;e.unmount=()=>{i&&i(),u.dispose(),s()}},get global(){return a},dispose(){i.stop()},__instances:r,__getInstance:s,__setInstance:c,__deleteInstance:l};return u}function Mr(e={}){let t=cr();if(t==null)throw J(q.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw J(q.NOT_INSTALLED);let n=Pr(t),r=Ir(n),i=ar(t),o=Fr(e,i);if(o===`global`)return or(r,e,i),r;if(o===`parent`){let i=Lr(n,t,e.__useComponent);return i??=r,i}if(o===`isolated`){if(n.mode!==`composition`)throw J(q.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);let i=n,o=k({},e);o.__root=Lr(n,t)||r;let s=pr(o);return i.__composerExtend&&(s[tr]=i.__composerExtend(s)),a()&&f(()=>{let e=s[tr];e&&(e(),delete s[tr])}),s}let s=n,c=s.__getInstance(t);if(c==null){let n=k({},e);`__i18n`in i&&(n.__i18n=i.__i18n),r&&(n.__root=r),c=pr(n),s.__composerExtend&&(c[tr]=s.__composerExtend(c)),zr(s,t,c),s.__setInstance(t,c)}return c}function Nr(e,t){let n=r(),i=__VUE_I18N_LEGACY_API__&&t?n.run(()=>hr(e)):n.run(()=>pr(e));if(i==null)throw J(q.UNEXPECTED_ERROR);return[n,i]}function Pr(e){let t=T(e.isCE?Ar:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw J(e.isCE?q.NOT_INSTALLED_WITH_PROVIDE:q.UNEXPECTED_ERROR);return t}function Fr(e,t){return ce(e)?`__i18n`in t?`local`:`global`:e.useScope?e.useScope:`local`}function Ir(e){return e.mode===`composition`?e.global:e.global.__composer}function Lr(e,t,n=!1){let r=null,i=t.root,a=Rr(t,n);for(;a!=null;){let t=e;if(e.mode===`composition`)r=t.__getInstance(a);else if(__VUE_I18N_LEGACY_API__){let e=t.__getInstance(a);e!=null&&(r=e.__composer,n&&r&&!r[er]&&(r=null))}if(r!=null||i===a)break;a=a.parent}return r}function Rr(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function zr(e,t,n){u(()=>{},t),i(()=>{let r=n;e.__deleteInstance(t);let i=r[tr];i&&(i(),delete r[tr])},t)}var Br=[`locale`,`fallbackLocale`,`availableLocales`],Vr=[`t`,`rt`,`d`,`n`,`tm`,`te`];function Hr(e,t){let n=Object.create(null);return Br.forEach(e=>{let r=Object.getOwnPropertyDescriptor(t,e);if(!r)throw J(q.UNEXPECTED_ERROR);let i=d(r.value)?{get(){return r.value.value},set(e){r.value.value=e}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,e,i)}),e.config.globalProperties.$i18n=n,Vr.forEach(n=>{let r=Object.getOwnPropertyDescriptor(t,n);if(!r||!r.value)throw J(q.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${n}`,r)}),()=>{delete e.config.globalProperties.$i18n,Vr.forEach(t=>{delete e.config.globalProperties[`$${t}`]})}}var Ur=y({name:`i18n-d`,props:k({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},vr),setup(e,t){let n=e.i18n||Mr({useScope:e.scope,__useComponent:!0});return Cr(e,t,wn,(...e)=>n[Zn](...e))}});if(Yn(),an(Dt),sn(Zt),ln(Rt),__INTLIFY_PROD_DEVTOOLS__){let e=j();e.__INTLIFY__=!0,kt(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}function Wr(e,t){if(e instanceof Error)return e.message;if(typeof e==`object`&&e){let t=e;if(typeof t.details==`string`&&t.details)return t.details;if(typeof t.message==`string`&&t.message)return t.message}return t===void 0?String(e):t}function Gr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Kr(e){return typeof e==`object`&&!!e}function qr(e){return typeof e==`string`&&e.trim().length>0}function Jr(e,t){return Gr(e)&&typeof e[t]==`string`}var Yr=null;function Xr(e){Yr=e}function Zr(e){if(!e)return``;let t=[];for(let[n,r]of Object.entries(e))r!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`);return t.length===0?``:`?${t.join(`&`)}`}function Qr(e,t){let n={...e.headers??{}};return t&&n[`Content-Type`]===void 0&&(n[`Content-Type`]=`application/json`),Yr&&n.Authorization===void 0&&(n.Authorization=`Bearer ${Yr}`),n}async function $r(e){let{status:t}=e;try{let n=await e.clone().json();if(Jr(n,`error`))return{error:n.error,status:t}}catch{}return{error:e.statusText||`Request failed (${t})`,status:t}}async function ei(e,t={}){let n=t.method??`GET`,r=t.body!==void 0,i=`${e}${Zr(t.query)}`,a={method:n,headers:Qr(t,r),signal:t.signal};r&&(a.body=JSON.stringify(t.body));let o;try{o=await fetch(i,a)}catch(e){return{ok:!1,error:Wr(e),status:0}}if(!o.ok){let{error:e,status:t}=await $r(o);return{ok:!1,error:e,status:t}}try{return{ok:!0,data:await o.json()}}catch(e){return{ok:!1,error:`Invalid JSON response: ${Wr(e)}`,status:o.status}}}function ti(e,t,n={}){return ei(e,{...n,method:`GET`,query:t})}function ni(e,t,n={}){return ei(e,{...n,method:`POST`,body:t})}function ri(e,t,n={}){return ei(e,{...n,method:`PUT`,body:t})}function ii(e,t,n={}){return ei(e,{...n,method:`DELETE`,body:t})}async function ai(e,t={}){let n=`${e}${Zr(t.query)}`,r={method:t.method??`GET`,headers:Qr(t,!1),body:t.body,signal:t.signal};return fetch(n,r)}var oi={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`};function Y(e){return e}function si(e,t){if(!t)return e.url;let{url:n}=e;for(let[e,r]of Object.entries(t)){let t=`:${e}`;n.includes(t)&&(n=n.split(t).join(encodeURIComponent(String(r))))}return n}var ci=Y({toolName:`manageAccounting`,apiNamespace:`accounting`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,workspaceDirs:{accounting:`data/accounting`,accountingBooks:`data/accounting/books`},staticChannels:{accountingBooks:`accounting:books`}});function li(e){return`accounting:${e}`}var ui=Y({toolName:`openCanvas`,apiNamespace:`canvas`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),di=Y({toolName:`presentChart`,apiNamespace:`chart`,apiRoutes:{create:{method:`POST`,path:``}},mcpDispatch:`create`}),fi=Y({toolName:`editImages`}),pi=Y({toolName:`generateImage`}),mi=Y({toolName:`manageSkills`,apiNamespace:`skills`,apiRoutes:{list:{method:`GET`,path:``},detail:{method:`GET`,path:`/:name`},create:{method:`POST`,path:``},update:{method:`PUT`,path:`/:name`},remove:{method:`DELETE`,path:`/:name`}},mcpDispatch:`create`}),hi=Y({toolName:`manageSource`,apiNamespace:`sources`,apiRoutes:{list:{method:`GET`,path:``},create:{method:`POST`,path:``},remove:{method:`DELETE`,path:`/:slug`},rebuild:{method:`POST`,path:`/rebuild`},manage:{method:`POST`,path:`/manage`}},mcpDispatch:`manage`}),gi=Y({toolName:`presentDocument`,apiNamespace:`markdown`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),_i=Y({toolName:`managePhotoLocations`,apiNamespace:`photoLocations`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`,staticChannels:{locationsChanged:`photoLocations:locations-changed`}}),vi=Y({toolName:`presentForm`,apiNamespace:`form`,apiRoutes:{dispatch:{method:`POST`,path:``}},mcpDispatch:`dispatch`}),yi=Y({toolName:`presentHtml`,apiNamespace:`html`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),bi=Y({toolName:`presentMulmoScript`,apiNamespace:`mulmoScript`,apiRoutes:{save:{method:`POST`,path:`/save`},updateBeat:{method:`POST`,path:`/update-beat`},updateScript:{method:`POST`,path:`/update-script`},beatImage:{method:`GET`,path:`/beat-image`},beatAudio:{method:`GET`,path:`/beat-audio`},generateBeatAudio:{method:`POST`,path:`/generate-beat-audio`},renderBeat:{method:`POST`,path:`/render-beat`},uploadBeatImage:{method:`POST`,path:`/upload-beat-image`},characterImage:{method:`GET`,path:`/character-image`},renderCharacter:{method:`POST`,path:`/render-character`},uploadCharacterImage:{method:`POST`,path:`/upload-character-image`},movieStatus:{method:`GET`,path:`/movie-status`},generateMovie:{method:`POST`,path:`/generate-movie`},downloadMovie:{method:`GET`,path:`/download-movie`}},mcpDispatch:`save`}),xi=Y({toolName:`presentSVG`,apiNamespace:`svg`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Si=Y({toolName:`manageAutomations`}),Ci=Y({toolName:`manageCalendar`,apiNamespace:`scheduler`,apiRoutes:{list:{method:`GET`,path:``},dispatch:{method:`POST`,path:``},tasksList:{method:`GET`,path:`/tasks`},tasksCreate:{method:`POST`,path:`/tasks`},taskUpdate:{method:`PUT`,path:`/tasks/:id`},taskDelete:{method:`DELETE`,path:`/tasks/:id`},taskRun:{method:`POST`,path:`/tasks/:id/run`},logs:{method:`GET`,path:`/logs`}},mcpDispatch:`dispatch`}),wi=Y({toolName:`presentSpreadsheet`,apiNamespace:`spreadsheet`,apiRoutes:{create:{method:`POST`,path:``},update:{method:`PUT`,path:`/update`}},mcpDispatch:`create`}),Ti=[ci,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Y({toolName:`manageWiki`})];function Ei(e,t,n){let r={},i={},a=[];for(let o of e){let e=t(o);if(e)for(let[t,s]of Object.entries(e)){let e=i[t];if(e!==void 0){a.push({dimension:n,key:t,plugins:[e,o.toolName]});continue}r[t]=s,i[t]=o.toolName}}return{aggregate:r,owner:i,collisions:a}}function Di(e,t,n,r){let i={},a=[];for(let[o,s]of Object.entries(n)){if(t.has(o)){a.push({label:e,key:o,plugin:r[o]??``});continue}i[o]=s}return{cleaned:i,dropped:a}}function Oi(e,t){let{aggregate:n,owner:r,collisions:i}=Ei(e,t.extract,t.dimension),a=new Set(Object.keys(t.hostRecord));if(t.additionalReservedKeys)for(let e of t.additionalReservedKeys)a.add(e);let{cleaned:o,dropped:s}=Di(t.label,a,n,r);return{merged:{...t.hostRecord,...o},hostCollisions:s,intraCollisions:i}}function ki(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]={method:i.method,url:`/api/${e}${i.path}`};return n}var Ai=Oi(Ti,{label:`API_ROUTES`,hostRecord:{health:`/api/health`,sandbox:`/api/sandbox`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`}},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:oi,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`,refresh:`/api/config/refresh`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},attachments:{upload:`/api/attachments`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifications:{test:`/api/notifications/test`},notifier:{dispatch:`/api/notifier`},journal:{latestDaily:`/api/journal/latest-daily`},pdf:{markdown:`/api/pdf/markdown`},translation:{translate:`/api/translation`},plugins:{mindmap:`/api/mindmap`,quiz:`/api/quiz`,present3d:`/api/present3d`,googleMap:`/api/google-map`,runtimeList:`/api/plugins/runtime/list`,runtimeDispatch:`/api/plugins/runtime/:pkg/dispatch`,runtimeOauthCallback:`/api/plugins/runtime/oauth-callback/:alias`,diagnostics:`/api/plugins/diagnostics`,runtimeAsset:`/api/plugins/runtime/:pkg/:version/{*splat}`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`,bookmark:`/api/sessions/:id/bookmark`},news:{items:`/api/news/items`,itemBody:`/api/news/items/:id/body`,readState:`/api/news/read-state`},hooks:{log:`/api/hooks/log`},wiki:{base:`/api/wiki`,pageHistory:`/api/wiki/pages/:slug/history`,pageHistorySnapshot:`/api/wiki/pages/:slug/history/:stamp`,pageHistoryRestore:`/api/wiki/pages/:slug/history/:stamp/restore`,internalSnapshot:`/api/wiki/internal/snapshot`}},extract:e=>{if(e.apiRoutes===void 0)return;let t=e.apiNamespace??e.toolName;return{[t]:ki(t,e.apiRoutes)}},dimension:`apiNamespace`});Ai.hostCollisions,Ai.intraCollisions;var ji=Ai.merged,Mi=Object.create(null);Mi.open=`0`,Mi.close=`1`,Mi.ping=`2`,Mi.pong=`3`,Mi.message=`4`,Mi.upgrade=`5`,Mi.noop=`6`;var Ni=Object.create(null);Object.keys(Mi).forEach(e=>{Ni[Mi[e]]=e});var Pi={type:`error`,data:`parser error`},Fi=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,Ii=typeof ArrayBuffer==`function`,Li=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Ri=({type:e,data:t},n,r)=>Fi&&t instanceof Blob?n?r(t):zi(t,r):Ii&&(t instanceof ArrayBuffer||Li(t))?n?r(t):zi(new Blob([t]),r):r(Mi[e]+(t||``)),zi=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function Bi(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Vi;function Hi(e,t){if(Fi&&e.data instanceof Blob)return e.data.arrayBuffer().then(Bi).then(t);if(Ii&&(e.data instanceof ArrayBuffer||Li(e.data)))return t(Bi(e.data));Ri(e,!1,e=>{Vi||=new TextEncoder,t(Vi.encode(e))})}var Ui=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Wi=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)Wi[Ui.charCodeAt(e)]=e;var Gi=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=Wi[e.charCodeAt(r)],o=Wi[e.charCodeAt(r+1)],s=Wi[e.charCodeAt(r+2)],c=Wi[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},Ki=typeof ArrayBuffer==`function`,qi=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:Yi(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:Ji(e.substring(1),t)}:Ni[n]?e.length>1?{type:Ni[n],data:e.substring(1)}:{type:Ni[n]}:Pi},Ji=(e,t)=>Ki?Yi(Gi(e),t):{base64:!0,data:e},Yi=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},Xi=``,Zi=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{Ri(e,!1,e=>{r[a]=e,++i===n&&t(r.join(Xi))})})},Qi=(e,t)=>{let n=e.split(Xi),r=[];for(let e=0;e<n.length;e++){let i=qi(n[e],t);if(r.push(i),i.type===`error`)break}return r};function $i(){return new TransformStream({transform(e,t){Hi(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var ea;function ta(e){return e.reduce((e,t)=>e+t.length,0)}function na(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function ra(e,t){ea||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(ta(n)<1)break;let e=na(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(ta(n)<2)break;let e=na(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(ta(n)<8)break;let e=na(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(Pi);break}i=a*2**32+t.getUint32(4),r=3}else{if(ta(n)<i)break;let e=na(n,i);s.enqueue(qi(a?e:ea.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(Pi);break}}}})}function X(e){if(e)return ia(e)}function ia(e){for(var t in X.prototype)e[t]=X.prototype[t];return e}X.prototype.on=X.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},X.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},X.prototype.off=X.prototype.removeListener=X.prototype.removeAllListeners=X.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},X.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},X.prototype.emitReserved=X.prototype.emit,X.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},X.prototype.hasListeners=function(e){return!!this.listeners(e).length};var aa=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Z=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),oa=`arraybuffer`;function sa(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var ca=Z.setTimeout,la=Z.clearTimeout;function ua(e,t){t.useNativeTimers?(e.setTimeoutFn=ca.bind(Z),e.clearTimeoutFn=la.bind(Z)):(e.setTimeoutFn=Z.setTimeout.bind(Z),e.clearTimeoutFn=Z.clearTimeout.bind(Z))}var da=1.33;function fa(e){return typeof e==`string`?pa(e):Math.ceil((e.byteLength||e.size)*da)}function pa(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function ma(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function ha(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function ga(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var _a=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},va=class extends X{constructor(e){super(),this.writable=!1,ua(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new _a(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=qi(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=ha(e);return t.length?`?`+t:``}},ya=class extends va{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){Qi(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,Zi(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=ma()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},ba=!1;try{ba=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var xa=ba;function Sa(){}var Ca=class extends ya{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},wa=class e extends X{constructor(e,t,n){super(),this.createRequest=e,ua(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=sa(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(this._xhr===void 0||this._xhr===null)){if(this._xhr.onreadystatechange=Sa,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(wa.requestsCount=0,wa.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Ta);else if(typeof addEventListener==`function`){let e=`onpagehide`in Z?`pagehide`:`unload`;addEventListener(e,Ta,!1)}}function Ta(){for(let e in wa.requests)wa.requests.hasOwnProperty(e)&&wa.requests[e].abort()}var Ea=(function(){let e=Oa({xdomain:!1});return e&&e.responseType!==null})(),Da=class extends Ca{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ea&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new wa(Oa,this.uri(),e)}};function Oa(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||xa))return new XMLHttpRequest}catch{}if(!t)try{return new Z[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var ka=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,Aa=class extends va{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=ka?{}:sa(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;Ri(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&aa(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=ma()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},ja=Z.WebSocket||Z.MozWebSocket,Ma={websocket:class extends Aa{createSocket(e,t,n){return ka?new ja(e,t,n):t?new ja(e,t):new ja(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends va{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=ra(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=$i();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&aa(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:Da},Na=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Pa=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function Fa(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Na.exec(e||``),a={},o=14;for(;o--;)a[Pa[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=Ia(a,a.path),a.queryKey=La(a,a.query),a}function Ia(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function La(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var Ra=typeof addEventListener==`function`&&typeof removeEventListener==`function`,za=[];Ra&&addEventListener(`offline`,()=>{za.forEach(e=>e())},!1);var Ba=class e extends X{constructor(e,t){if(super(),this.binaryType=oa,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=Fa(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=Fa(t.host).host);ua(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=ga(this.opts.query)),Ra&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},za.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data);break}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=fa(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,aa(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),Ra&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=za.indexOf(this._offlineEventListener);e!==-1&&za.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};Ba.protocol=4;var Va=class extends Ba{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Ba.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n)if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;Ba.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},Ha=class extends Va{constructor(e,t={}){let n=typeof e==`object`?e:t;(!n.transports||n.transports&&typeof n.transports[0]==`string`)&&(n.transports=(n.transports||[`polling`,`websocket`,`webtransport`]).map(e=>Ma[e]).filter(e=>!!e)),super(e,n)}};Ha.protocol;function Ua(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=Fa(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var Wa=typeof ArrayBuffer==`function`,Ga=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Ka=Object.prototype.toString,qa=typeof Blob==`function`||typeof Blob<`u`&&Ka.call(Blob)===`[object BlobConstructor]`,Ja=typeof File==`function`||typeof File<`u`&&Ka.call(File)===`[object FileConstructor]`;function Ya(e){return Wa&&(e instanceof ArrayBuffer||Ga(e))||qa&&e instanceof Blob||Ja&&e instanceof File}function Xa(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(Xa(e[t]))return!0;return!1}if(Ya(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return Xa(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&Xa(e[t]))return!0;return!1}function Za(e){let t=[],n=e.data,r=e;return r.data=Qa(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Qa(e,t){if(!e)return e;if(Ya(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=Qa(e[r],t);return n}else if(typeof e==`object`&&!(e instanceof Date)){let n={};for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Qa(e[r],t));return n}return e}function $a(e,t){return e.data=eo(e.data,t),delete e.attachments,e}function eo(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=eo(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=eo(e[n],t));return e}var to=e({Decoder:()=>io,Encoder:()=>ro,PacketType:()=>Q,isPacketValid:()=>fo,protocol:()=>5}),no=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],Q;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(Q||={});var ro=class{constructor(e){this.replacer=e}encode(e){return(e.type===Q.EVENT||e.type===Q.ACK)&&Xa(e)?this.encodeAsBinary({type:e.type===Q.EVENT?Q.BINARY_EVENT:Q.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===Q.BINARY_EVENT||e.type===Q.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Za(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},io=class e extends X{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===Q.BINARY_EVENT;n||t.type===Q.BINARY_ACK?(t.type=n?Q.EVENT:Q.ACK,this.reconstructor=new ao(t),t.attachments===0&&super.emitReserved(`decoded`,t)):super.emitReserved(`decoded`,t)}else if(Ya(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`);else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(Q[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===Q.BINARY_EVENT||r.type===Q.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!so(a)||a<0)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&!(t.charAt(n)===`,`||n===t.length););r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Q.CONNECT:return lo(t);case Q.DISCONNECT:return t===void 0;case Q.CONNECT_ERROR:return typeof t==`string`||lo(t);case Q.EVENT:case Q.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&no.indexOf(t[0])===-1);case Q.ACK:case Q.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},ao=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=$a(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function oo(e){return typeof e==`string`}var so=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function co(e){return e===void 0||so(e)}function lo(e){return Object.prototype.toString.call(e)===`[object Object]`}function uo(e,t){switch(e){case Q.CONNECT:return t===void 0||lo(t);case Q.DISCONNECT:return t===void 0;case Q.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&no.indexOf(t[0])===-1);case Q.ACK:return Array.isArray(t);case Q.CONNECT_ERROR:return typeof t==`string`||lo(t);default:return!1}}function fo(e){return oo(e.nsp)&&co(e.id)&&uo(e.type,e.data)}function $(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var po=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),mo=class extends X{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[$(e,`open`,this.onopen.bind(this)),$(e,`packet`,this.onpacket.bind(this)),$(e,`error`,this.onerror.bind(this)),$(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(po.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:Q.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Q.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Q.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case Q.EVENT:case Q.BINARY_EVENT:this.onevent(e);break;case Q.ACK:case Q.BINARY_ACK:this.onack(e);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:Q.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Q.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function ho(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ho.prototype.duration=function(){var e=this.ms*this.factor**+ this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},ho.prototype.reset=function(){this.attempts=0},ho.prototype.setMin=function(e){this.ms=e},ho.prototype.setMax=function(e){this.max=e},ho.prototype.setJitter=function(e){this.jitter=e};var go=class extends X{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,ua(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new ho({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||to;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new Ha(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=$(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=$(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push($(e,`ping`,this.onping.bind(this)),$(e,`data`,this.ondata.bind(this)),$(e,`error`,this.onerror.bind(this)),$(e,`close`,this.onclose.bind(this)),$(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){aa(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new mo(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},_o={};function vo(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=Ua(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=_o[i]&&a in _o[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new go(r,t):(_o[i]||(_o[i]=new go(r,t)),c=_o[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(vo,{Manager:go,Socket:mo,io:vo,connect:vo});var yo=null,bo=new Map;function xo(e){for(let t of bo.keys())e.emit(`subscribe`,t)}function So(){if(yo)return yo;let e=vo({path:`/ws/pubsub`,transports:[`websocket`]});return e.on(`connect`,()=>xo(e)),e.on(`data`,e=>{let t=bo.get(e.channel);if(t)for(let n of t)n(e.data)}),yo=e,e}function Co(){bo.size>0||(yo&&=(yo.disconnect(),null))}function wo(){function e(e,t){let n=bo.get(e);n||(n=new Set,bo.set(e,n)),n.add(t);let r=So();return r.connected&&r.emit(`subscribe`,e),()=>{let n=bo.get(e);n&&(n.delete(t),n.size===0&&(bo.delete(e),yo?.connected&&yo.emit(`unsubscribe`,e)),Co())}}return{subscribe:e}}function To(e,t){return`plugin:${e}:${t}`}function Eo(e){let{subscribe:t}=wo();return{subscribe(n,r){return t(To(e,n),r)}}}function Do(e){let t=`[plugin/${e}]`;return{debug:(e,n)=>console.debug(t,e,n),info:(e,n)=>console.info(t,e,n),warn:(e,n)=>console.warn(t,e,n),error:(e,n)=>console.error(t,e,n)}}var Oo=new Set([`http:`,`https:`]);function ko(e){return t=>{let n;try{n=new URL(t)}catch{console.warn(`[plugin/${e}] openUrl rejected unparseable URL`,{url:t});return}if(!Oo.has(n.protocol)){console.warn(`[plugin/${e}] openUrl rejected non-http(s) scheme`,{scheme:n.protocol});return}window.open(t,`_blank`,`noopener,noreferrer`)||console.warn(`[plugin/${e}] window.open returned null`,{url:t})}}function Ao(e){let t=ji.plugins.runtimeDispatch.replace(`:pkg`,encodeURIComponent(e));return async n=>{let r=await ni(t,n);if(!r.ok)throw Error(`plugin/${e} dispatch failed (${r.status}): ${r.error}`);return r.data}}function jo(e){let{pkgName:t,endpoints:n}=e,{locale:r}=Mr(),i=o(()=>String(r.value));return{pubsub:Eo(t),locale:i,log:Do(t),openUrl:ko(t),dispatch:Ao(t),endpoints:n}}function Mo(e){let t=g(null),n=g(!1),r=g(0),i=o(()=>{if(!t.value)return``;let e=t.value.message||String(t.value),n=t.value.stack??``;return n?`${e}\n\n${n}`:e});function a(n){let r=n instanceof Error?n:Error(String(n));console.error(`[plugin/${e}] uncaught error`,r),t.value=r}function s(){t.value=null,n.value=!1,r.value+=1}return{error:t,showDetails:n,mountKey:r,errorDetails:i,captureError:a,retry:s}}var No={key:0,class:`rounded border border-red-200 bg-red-50 p-3 text-sm`,"data-testid":`plugin-error-boundary`,role:`alert`},Po={class:`flex items-center gap-2 mb-1`},Fo={class:`font-medium text-red-800`},Io={class:`text-red-700 mb-2`},Lo={class:`flex items-center gap-3`},Ro={key:0,class:`mt-2 text-xs text-red-900 bg-red-100 p-2 rounded overflow-auto max-h-40 whitespace-pre-wrap break-words`},zo=y({__name:`PluginScopedRoot`,props:{pkgName:{},endpoints:{}},setup(e){let t=e,{t:n}=Mr();s(E,jo({pkgName:t.pkgName,endpoints:t.endpoints}));let{error:r,showDetails:i,mountKey:a,errorDetails:o,captureError:l,retry:u}=Mo(t.pkgName);return c(e=>(l(e),!1)),(t,s)=>v(r)?(p(),m(`div`,No,[C(`div`,Po,[s[2]||=C(`span`,{class:`material-icons text-red-500`,"aria-hidden":`true`},`error_outline`,-1),C(`span`,Fo,x(v(n)(`pluginErrorBoundary.title`,{pkg:e.pkgName})),1)]),C(`p`,Io,x(v(n)(`pluginErrorBoundary.subtitle`)),1),C(`div`,Lo,[C(`button`,{type:`button`,class:`text-xs text-red-600 hover:underline`,"data-testid":`plugin-error-toggle-details`,onClick:s[0]||=e=>i.value=!v(i)},x(v(i)?v(n)(`pluginErrorBoundary.hideDetails`):v(n)(`pluginErrorBoundary.showDetails`)),1),C(`button`,{type:`button`,class:`text-xs text-red-600 hover:underline`,"data-testid":`plugin-error-retry`,onClick:s[1]||=(...e)=>v(u)&&v(u)(...e)},x(v(n)(`pluginErrorBoundary.retry`)),1)]),v(i)?(p(),m(`pre`,Ro,x(v(o)),1)):h(``,!0)])):_(t.$slots,`default`,{key:v(a)})}}),Bo=e({default:()=>Vo}),Vo=zo;export{Gr as A,ai as C,Xr as D,ri as E,jr as M,Mr as N,qr as O,ii as S,ni as T,ui as _,Ti as a,si as b,xi as c,vi as d,_i as f,di as g,mi as h,ji as i,Wr as j,Kr as k,bi as l,hi as m,Bo as n,Oi as o,gi as p,wo as r,wi as s,Vo as t,yi as u,ci as v,ti as w,ei as x,li as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e),f=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{d as a,f as i,o as n,u as o,c as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-CernVdwh.js";var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{o as n,c as t};
|