@x18n/ui 0.0.13 → 0.0.15
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/dist/index.d.mts +26 -2
- package/dist/index.mjs +109 -5
- package/dist/nitro.json +1 -1
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/2EfS_HwS.js +1 -0
- package/dist/public/_nuxt/{C2NDV-aj.js → A6qWjb0Q.js} +1 -1
- package/dist/public/_nuxt/{BMk3frKd.js → B-DdkvQu.js} +1 -1
- package/dist/public/_nuxt/B-S62flX.js +1 -0
- package/dist/public/_nuxt/B4ABs1rO.js +1 -0
- package/dist/public/_nuxt/BJYSGhlR.js +1 -0
- package/dist/public/_nuxt/{rgsxZ82X.js → BNUykbYB.js} +1 -1
- package/dist/public/_nuxt/{DwfVoZK4.js → BbXhWA6A.js} +1 -1
- package/dist/public/_nuxt/BiTAHOW7.js +1 -0
- package/dist/public/_nuxt/{BrQXMZiN.js → BqpxToIr.js} +1 -1
- package/dist/public/_nuxt/C0Kqp-hV.js +5 -0
- package/dist/public/_nuxt/{CmTOev3L.js → C7dnh697.js} +1 -1
- package/dist/public/_nuxt/COLXubwN.js +1 -0
- package/dist/public/_nuxt/COw7EUr6.js +1 -0
- package/dist/public/_nuxt/{C-FN7NZ5.js → CaGk4C9N.js} +1 -1
- package/dist/public/_nuxt/CeO45pG4.js +1 -0
- package/dist/public/_nuxt/{BXMubO3c.js → Ck7RwzOo.js} +1 -1
- package/dist/public/_nuxt/D0euMYu_.js +1 -0
- package/dist/public/_nuxt/{BdRzFi-7.js → D2RlCm6R.js} +1 -1
- package/dist/public/_nuxt/{D0qDe1RK.js → D4MpZjss.js} +1 -1
- package/dist/public/_nuxt/{DEHKzIZA.js → DAUGp_mK.js} +1 -1
- package/dist/public/_nuxt/DAg5vorC.js +1 -0
- package/dist/public/_nuxt/DFEXkmyM.js +1 -0
- package/dist/public/_nuxt/DG8ByoxA.js +1 -0
- package/dist/public/_nuxt/DJeY8XBB.js +1 -0
- package/dist/public/_nuxt/DOrNqXOJ.js +1 -0
- package/dist/public/_nuxt/DmrYWbap.js +1 -0
- package/dist/public/_nuxt/ExT4dgIR.js +1 -0
- package/dist/public/_nuxt/{BvWJ0ee6.js → PhlVcHMP.js} +1 -1
- package/dist/public/_nuxt/{BksN_39l.js → YoPGJNOu.js} +1 -1
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/a6858f7b-83c5-413c-99d8-4a0183e59820.json +1 -0
- package/dist/public/_nuxt/entry.BYxRFyZC.css +1 -0
- package/dist/public/_nuxt/{CYt0tzKv.js → q3Dg6uA2.js} +1 -1
- package/dist/public/index.html +1 -1
- package/package.json +4 -4
- package/dist/public/_nuxt/12HrXUU5.js +0 -5
- package/dist/public/_nuxt/By9SURJ0.js +0 -1
- package/dist/public/_nuxt/C9NjIzeY.js +0 -1
- package/dist/public/_nuxt/CJYF9l4i.js +0 -1
- package/dist/public/_nuxt/CTHz3W6Z.js +0 -1
- package/dist/public/_nuxt/CjABOUCt.js +0 -1
- package/dist/public/_nuxt/Cla6r_hp.js +0 -1
- package/dist/public/_nuxt/CqFP5-dM.js +0 -1
- package/dist/public/_nuxt/DGZ47nDY.js +0 -1
- package/dist/public/_nuxt/DxKFtHBx.js +0 -1
- package/dist/public/_nuxt/GykjZmqe.js +0 -1
- package/dist/public/_nuxt/OCEG5gyJ.js +0 -1
- package/dist/public/_nuxt/builds/meta/c60d9467-2fa6-472d-9d90-af221fa1690a.json +0 -1
- package/dist/public/_nuxt/codzHuXh.js +0 -1
- package/dist/public/_nuxt/entry.Bz8D4poF.css +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DevframeDefinition, DevframeNodeContext } from "devframe";
|
|
2
2
|
import { ExtractCandidate } from "@x18n/builtins/extractors";
|
|
3
|
-
import { Decision, EditOp, FileChange, KeyString, LocaleCode, MessageLeaf, PlaceholderProblem, Project, ProjectExplanation, Severity, TextRange, UsageKind, WireDiagnostic } from "@x18n/core";
|
|
3
|
+
import { Decision, EditOp, FileChange, KeyString, LocaleCode, MessageLeaf, PlaceholderProblem, Project, ProjectExplanation, ReviewState, ReviewThread, ReviewType, Severity, TextRange, UsageKind, WireDiagnostic } from "@x18n/core";
|
|
4
4
|
//#region src/node/types.d.ts
|
|
5
5
|
/** A loaded project as the UI sees it. */
|
|
6
6
|
interface UiProject {
|
|
@@ -53,6 +53,12 @@ interface ApplyQuery extends PlanQuery {
|
|
|
53
53
|
/** Write values whose placeholders differ from the source value. */
|
|
54
54
|
readonly force?: boolean | undefined;
|
|
55
55
|
}
|
|
56
|
+
interface ReviewQuery extends ProjectQuery {
|
|
57
|
+
readonly key?: KeyString | undefined;
|
|
58
|
+
readonly locale?: LocaleCode | undefined;
|
|
59
|
+
/** Only unresolved comments. */
|
|
60
|
+
readonly open?: boolean | undefined;
|
|
61
|
+
}
|
|
56
62
|
interface ExtractQuery extends ProjectQuery {
|
|
57
63
|
readonly files?: readonly string[] | undefined;
|
|
58
64
|
}
|
|
@@ -76,6 +82,10 @@ interface AgentKeysQuery extends ProjectQuery, PageQuery {
|
|
|
76
82
|
readonly namespace?: string | undefined;
|
|
77
83
|
readonly values?: boolean | undefined;
|
|
78
84
|
}
|
|
85
|
+
interface AgentSearchQuery extends ProjectQuery, PageQuery {
|
|
86
|
+
readonly query: string;
|
|
87
|
+
readonly exact?: boolean | undefined;
|
|
88
|
+
}
|
|
79
89
|
interface AgentUsagesQuery extends UsageQuery, PageQuery {}
|
|
80
90
|
interface AgentCheckQuery extends ProjectQuery, PageQuery {
|
|
81
91
|
readonly only?: readonly string[] | undefined;
|
|
@@ -94,6 +104,13 @@ interface AgentRenameQuery extends ProjectQuery, Confirmable {
|
|
|
94
104
|
readonly to: KeyString;
|
|
95
105
|
readonly usages?: boolean | undefined;
|
|
96
106
|
}
|
|
107
|
+
interface AgentReviewQuery extends ProjectQuery {
|
|
108
|
+
readonly key: KeyString;
|
|
109
|
+
readonly locale: LocaleCode;
|
|
110
|
+
readonly review: ReviewType;
|
|
111
|
+
readonly text?: string | undefined;
|
|
112
|
+
readonly suggestion?: string | undefined;
|
|
113
|
+
}
|
|
97
114
|
interface AgentDeleteQuery extends ProjectQuery, Confirmable {
|
|
98
115
|
readonly key: KeyString;
|
|
99
116
|
readonly locales?: readonly LocaleCode[] | undefined;
|
|
@@ -154,6 +171,8 @@ interface ProjectSummary {
|
|
|
154
171
|
readonly presets: readonly string[];
|
|
155
172
|
/** The latest revisions in history, local changes first. */
|
|
156
173
|
readonly changes: readonly ChangeGroup[];
|
|
174
|
+
/** Threads with open comments; undefined when reviews are off. */
|
|
175
|
+
readonly reviews: number | undefined;
|
|
157
176
|
}
|
|
158
177
|
interface ProjectList {
|
|
159
178
|
readonly projects: readonly ProjectSummary[];
|
|
@@ -172,6 +191,8 @@ interface KeyRow {
|
|
|
172
191
|
readonly outdated: readonly LocaleCode[];
|
|
173
192
|
/** The latest change in any locale (ms); local changes count as now. */
|
|
174
193
|
readonly changedAt: number | undefined;
|
|
194
|
+
/** Review state per locale with open comments. */
|
|
195
|
+
readonly reviews: Readonly<Record<LocaleCode, ReviewState>>;
|
|
175
196
|
}
|
|
176
197
|
interface KeyTable {
|
|
177
198
|
readonly project: string;
|
|
@@ -224,6 +245,8 @@ interface KeyDetail {
|
|
|
224
245
|
readonly missing: readonly LocaleCode[];
|
|
225
246
|
readonly usages: readonly UsageView[];
|
|
226
247
|
readonly diagnostics: readonly WireDiagnostic[];
|
|
248
|
+
/** Every thread, resolved comments included. */
|
|
249
|
+
readonly reviews: readonly ReviewThread[];
|
|
227
250
|
}
|
|
228
251
|
interface AnalysisView {
|
|
229
252
|
readonly project: string;
|
|
@@ -266,6 +289,7 @@ declare module "devframe" {
|
|
|
266
289
|
"x18n:usages": (query: UsageQuery) => UsageView[];
|
|
267
290
|
"x18n:analysis": (query: ProjectQuery) => AnalysisView;
|
|
268
291
|
"x18n:explain": () => ExplainList;
|
|
292
|
+
"x18n:reviews": (query: ReviewQuery) => ReviewThread[];
|
|
269
293
|
"x18n:translate-prompt": (query: PromptQuery) => string;
|
|
270
294
|
"x18n:plan": (query: PlanQuery) => PlanView;
|
|
271
295
|
"x18n:apply": (query: ApplyQuery) => Promise<ApplyView>;
|
|
@@ -289,4 +313,4 @@ export type UiProjectLoader = (ctx: DevframeNodeContext) => Promise<readonly UiP
|
|
|
289
313
|
/** The x18n UI, RPC functions and MCP tools over loaded projects, as a devframe definition. */
|
|
290
314
|
export declare function createX18nDevframe(source: readonly UiProject[] | UiProjectLoader, options?: RpcOptions): DevframeDefinition;
|
|
291
315
|
//#endregion
|
|
292
|
-
export type { AgentCheckQuery, AgentDeleteQuery, AgentKeysQuery, AgentRenameQuery, AgentSetQuery, AgentUsagesQuery, AnalysisView, ApplyQuery, ApplyView, ChangeGroup, ChangeView, DiagnosticCounts, ExplainList, ExplainView, ExtractApplyQuery, ExtractPlanItem, ExtractQuery, HistoryView, KeyDetail, KeyQuery, KeyRow, KeyTable, LocaleSummary, MessageView, OpenQuery, PlanQuery, PlanView, ProjectList, ProjectQuery, ProjectSummary, PromptQuery, Snippet, UiEditOp, UiLocation, UiProject, UsageQuery, UsageView, RpcOptions as X18nDevframeOptions, X18nState };
|
|
316
|
+
export type { AgentCheckQuery, AgentDeleteQuery, AgentKeysQuery, AgentRenameQuery, AgentReviewQuery, AgentSearchQuery, AgentSetQuery, AgentUsagesQuery, AnalysisView, ApplyQuery, ApplyView, ChangeGroup, ChangeView, DiagnosticCounts, ExplainList, ExplainView, ExtractApplyQuery, ExtractPlanItem, ExtractQuery, HistoryView, KeyDetail, KeyQuery, KeyRow, KeyTable, LocaleSummary, MessageView, OpenQuery, PlanQuery, PlanView, ProjectList, ProjectQuery, ProjectSummary, PromptQuery, ReviewQuery, Snippet, UiEditOp, UiLocation, UiProject, UsageQuery, UsageView, RpcOptions as X18nDevframeOptions, X18nState };
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { createLineIndex, errors, parseMessageBatch, placeholderProblems, render
|
|
|
6
6
|
import * as v from "valibot";
|
|
7
7
|
//#region package.json
|
|
8
8
|
var name = "@x18n/ui";
|
|
9
|
-
var version = "0.0.
|
|
9
|
+
var version = "0.0.15";
|
|
10
10
|
var description = "x18n UI as a devframe: dev server, static report, in-browser workspace and VS Code panel";
|
|
11
11
|
var homepage = "https://github.com/x18n-dev/x18n#readme";
|
|
12
12
|
//#endregion
|
|
@@ -44,6 +44,12 @@ const PromptQuerySchema = v.object({
|
|
|
44
44
|
cursor: v.optional(text("`nextCursor` of the previous prompt.")),
|
|
45
45
|
stale: v.optional(v.pipe(v.boolean(), v.description("Also translate stale translations: those older than their source message.")))
|
|
46
46
|
});
|
|
47
|
+
const reviewType = v.picklist([
|
|
48
|
+
"comment",
|
|
49
|
+
"approve",
|
|
50
|
+
"request-change",
|
|
51
|
+
"suggestion"
|
|
52
|
+
]);
|
|
47
53
|
const EditOpSchema = v.variant("type", [
|
|
48
54
|
v.object({
|
|
49
55
|
type: v.literal("set"),
|
|
@@ -67,8 +73,35 @@ const EditOpSchema = v.variant("type", [
|
|
|
67
73
|
type: v.literal("delete"),
|
|
68
74
|
key: v.string(),
|
|
69
75
|
locales: v.exactOptional(v.union([v.literal("all"), v.array(v.string())]))
|
|
76
|
+
}),
|
|
77
|
+
v.object({
|
|
78
|
+
type: v.literal("review"),
|
|
79
|
+
key: v.string(),
|
|
80
|
+
locale: v.string(),
|
|
81
|
+
review: reviewType,
|
|
82
|
+
text: v.exactOptional(v.string()),
|
|
83
|
+
suggestion: v.exactOptional(v.string())
|
|
84
|
+
}),
|
|
85
|
+
v.object({
|
|
86
|
+
type: v.literal("resolve-review"),
|
|
87
|
+
id: v.string()
|
|
88
|
+
}),
|
|
89
|
+
v.object({
|
|
90
|
+
type: v.literal("apply-suggestion"),
|
|
91
|
+
id: v.string()
|
|
92
|
+
}),
|
|
93
|
+
v.object({
|
|
94
|
+
type: v.literal("mark-fresh"),
|
|
95
|
+
key: v.string(),
|
|
96
|
+
locales: v.exactOptional(v.array(v.string()))
|
|
70
97
|
})
|
|
71
98
|
]);
|
|
99
|
+
const ReviewQuerySchema = v.object({
|
|
100
|
+
project,
|
|
101
|
+
key: v.optional(text("Only reviews of this key.")),
|
|
102
|
+
locale: v.optional(text("Only reviews of this locale.")),
|
|
103
|
+
open: v.optional(v.pipe(v.boolean(), v.description("Only unresolved comments, and only threads that have some.")))
|
|
104
|
+
});
|
|
72
105
|
const PlanQuerySchema = v.object({
|
|
73
106
|
project,
|
|
74
107
|
ops: v.array(EditOpSchema)
|
|
@@ -113,6 +146,13 @@ const AgentKeysSchema = v.object({
|
|
|
113
146
|
limit: v.optional(v.pipe(v.number(), v.description("Page size. Default 100."))),
|
|
114
147
|
cursor: v.optional(text("`nextCursor` of the previous page."))
|
|
115
148
|
});
|
|
149
|
+
const AgentSearchSchema = v.object({
|
|
150
|
+
project,
|
|
151
|
+
query: text("Text of the message, as seen in the app, in any locale."),
|
|
152
|
+
exact: v.optional(v.pipe(v.boolean(), v.description("Only values containing the query. By default a fuzzy match also counts."))),
|
|
153
|
+
limit: v.optional(v.pipe(v.number(), v.description("Page size. Default 100."))),
|
|
154
|
+
cursor: v.optional(text("`nextCursor` of the previous page."))
|
|
155
|
+
});
|
|
116
156
|
const AgentUsagesSchema = v.object({
|
|
117
157
|
project,
|
|
118
158
|
key: v.optional(text("Only usages of this key.")),
|
|
@@ -142,6 +182,14 @@ const AgentRenameSchema = v.object({
|
|
|
142
182
|
confirm,
|
|
143
183
|
answers
|
|
144
184
|
});
|
|
185
|
+
const AgentReviewSchema = v.object({
|
|
186
|
+
project,
|
|
187
|
+
key: text("Key of the reviewed message."),
|
|
188
|
+
locale: text("Locale of the reviewed message."),
|
|
189
|
+
review: v.pipe(reviewType, v.description("`request-change` for a wrong translation (say why in `text`), `suggestion` to propose a value (in `suggestion`), `approve` for a good one, `comment` for anything else.")),
|
|
190
|
+
text: v.optional(text("The comment: what is wrong, or why.")),
|
|
191
|
+
suggestion: v.optional(text("The proposed value, for `review: \"suggestion\"`. Keep every placeholder."))
|
|
192
|
+
});
|
|
145
193
|
const AgentDeleteSchema = v.object({
|
|
146
194
|
project,
|
|
147
195
|
key: text("Key (or parent of keys) to delete."),
|
|
@@ -242,7 +290,8 @@ function summarize({ name, project }) {
|
|
|
242
290
|
byCode: [...byCode.values()].sort((a, b) => b.count - a.count || a.code.localeCompare(b.code))
|
|
243
291
|
},
|
|
244
292
|
presets: project.explain().presets.filter((p) => p.reason === "listed" || p.reason === "detected").map((p) => p.name),
|
|
245
|
-
changes: recentChangeGroups(project)
|
|
293
|
+
changes: recentChangeGroups(project),
|
|
294
|
+
reviews: project.reviewFile === void 0 ? void 0 : project.reviews({ open: true }).length
|
|
246
295
|
};
|
|
247
296
|
}
|
|
248
297
|
function keyTable({ name, project }) {
|
|
@@ -257,6 +306,11 @@ function keyTable({ name, project }) {
|
|
|
257
306
|
list.push(c.locale);
|
|
258
307
|
}
|
|
259
308
|
const outdated = outdatedByKey(analysis.coverage);
|
|
309
|
+
const reviews = /* @__PURE__ */ new Map();
|
|
310
|
+
for (const thread of project.reviews({ open: true })) if (thread.state) reviews.set(thread.key, {
|
|
311
|
+
...reviews.get(thread.key),
|
|
312
|
+
[thread.locale]: thread.state
|
|
313
|
+
});
|
|
260
314
|
const now = Date.now();
|
|
261
315
|
return {
|
|
262
316
|
project: name,
|
|
@@ -273,7 +327,8 @@ function keyTable({ name, project }) {
|
|
|
273
327
|
unused: unused.has(key),
|
|
274
328
|
diagnostics: diagnostics.get(key) ?? 0,
|
|
275
329
|
outdated: outdated.get(key) ?? [],
|
|
276
|
-
changedAt: times.length ? Math.max(...times) : void 0
|
|
330
|
+
changedAt: times.length ? Math.max(...times) : void 0,
|
|
331
|
+
reviews: reviews.get(key) ?? {}
|
|
277
332
|
};
|
|
278
333
|
})
|
|
279
334
|
};
|
|
@@ -358,7 +413,8 @@ function keyDetail(p, key) {
|
|
|
358
413
|
}),
|
|
359
414
|
missing: info.missing,
|
|
360
415
|
usages: usageViews(p, info.usages),
|
|
361
|
-
diagnostics: wire(p, info.diagnostics)
|
|
416
|
+
diagnostics: wire(p, info.diagnostics),
|
|
417
|
+
reviews: info.reviews
|
|
362
418
|
};
|
|
363
419
|
}
|
|
364
420
|
function analysisView(p) {
|
|
@@ -390,7 +446,12 @@ function previewOps(p, ops) {
|
|
|
390
446
|
return planView(p.project.plan(ops), placeholderProblems(p.project, ops));
|
|
391
447
|
}
|
|
392
448
|
/** Plans and applies ops; placeholder problems block the write unless `force`. */
|
|
393
|
-
async function applyOps(p,
|
|
449
|
+
async function applyOps(p, input, options = {}) {
|
|
450
|
+
const author = input.some((op) => op.type === "review" && !op.author) ? await p.project.reviewAuthor() : void 0;
|
|
451
|
+
const ops = author ? input.map((op) => op.type === "review" && !op.author ? {
|
|
452
|
+
...op,
|
|
453
|
+
author
|
|
454
|
+
} : op) : input;
|
|
394
455
|
const plan = p.project.plan(ops);
|
|
395
456
|
const problems = placeholderProblems(p.project, ops);
|
|
396
457
|
if (problems.length > 0 && !options.force) return {
|
|
@@ -460,6 +521,24 @@ function registerAgentTools(ctx, projects) {
|
|
|
460
521
|
if (!detail) throw errors.X18N4006({ key: query.key });
|
|
461
522
|
return detail;
|
|
462
523
|
});
|
|
524
|
+
tool("search", "read", "Find keys by their value, best match first: the key behind a text seen in the app. Searches every locale, ignoring case, and matches fuzzily unless `exact`. Each match has the matched locale and value, and the usages in code with file, line and column.", AgentSearchSchema, (query) => {
|
|
525
|
+
const p = pick(query.project);
|
|
526
|
+
const { items, ...rest } = page(p.project.search(query.query, { exact: query.exact }), query);
|
|
527
|
+
return {
|
|
528
|
+
...rest,
|
|
529
|
+
matches: items.map((m) => ({
|
|
530
|
+
key: m.key,
|
|
531
|
+
locale: m.locale,
|
|
532
|
+
value: m.value,
|
|
533
|
+
usages: usageViews(p, p.project.usages({ key: m.key })).map((u) => ({
|
|
534
|
+
path: u.path,
|
|
535
|
+
line: u.line,
|
|
536
|
+
column: u.column,
|
|
537
|
+
possible: u.possible
|
|
538
|
+
}))
|
|
539
|
+
}))
|
|
540
|
+
};
|
|
541
|
+
});
|
|
463
542
|
tool("usages", "read", "Usages in code, paged: of one `key` (usages with a computed key under a prefix of it are marked `possible`), of one file (`path`), or all. Each usage has file, line, column and a code snippet.", AgentUsagesSchema, (query) => {
|
|
464
543
|
const p = pick(query.project);
|
|
465
544
|
const { items, ...rest } = page(p.project.usages({
|
|
@@ -492,6 +571,21 @@ function registerAgentTools(ctx, projects) {
|
|
|
492
571
|
const p = pick(query.project);
|
|
493
572
|
return applyOps(p, parseMessageBatch(p.project, query.messages), { force: query.force });
|
|
494
573
|
});
|
|
574
|
+
tool("reviews", "read", "Review threads: comments, approvals, change requests and suggested values on messages, per key and locale, with each thread's state. Pass `open: true` for unresolved ones only.", ReviewQuerySchema, (query) => {
|
|
575
|
+
const { project, ...filter } = query;
|
|
576
|
+
return { threads: pick(project).project.reviews(filter) };
|
|
577
|
+
});
|
|
578
|
+
tool("review", "action", "Leave a review on one message for a human: `request-change` with the reason in `text`, or `suggestion` with a better value in `suggestion` (a human applies it), `approve`, or `comment`. Use it when a human should decide, instead of changing values yourself.", AgentReviewSchema, (query) => {
|
|
579
|
+
const p = pick(query.project);
|
|
580
|
+
return applyOps(p, [{
|
|
581
|
+
type: "review",
|
|
582
|
+
key: p.project.parseKey(query.key),
|
|
583
|
+
locale: query.locale,
|
|
584
|
+
review: query.review,
|
|
585
|
+
text: query.text,
|
|
586
|
+
suggestion: query.suggestion
|
|
587
|
+
}]);
|
|
588
|
+
});
|
|
495
589
|
tool("rename_key", "destructive", "Rename a key (or every key under a parent) in all locales, and its usages in code unless `usages: false`. Without `confirm` it returns the plan (files to change, decisions, warnings); call again with `confirm: true` to apply it.", AgentRenameSchema, (query) => {
|
|
496
590
|
const p = pick(query.project);
|
|
497
591
|
return confirmable(p, [{
|
|
@@ -580,6 +674,16 @@ function registerRpc(ctx, projects, options) {
|
|
|
580
674
|
handler: (query) => analysisView(pickProject(projects, v.parse(ProjectQuerySchema, query).project)),
|
|
581
675
|
dump: () => ({ inputs: perProject() })
|
|
582
676
|
}));
|
|
677
|
+
rpc.register(defineRpcFunction({
|
|
678
|
+
name: "reviews",
|
|
679
|
+
type: "query",
|
|
680
|
+
jsonSerializable: true,
|
|
681
|
+
handler: (query) => {
|
|
682
|
+
const { project, ...filter } = v.parse(ReviewQuerySchema, query);
|
|
683
|
+
return [...pickProject(projects, project).project.reviews(filter)];
|
|
684
|
+
},
|
|
685
|
+
dump: () => ({ inputs: perProject() })
|
|
686
|
+
}));
|
|
583
687
|
rpc.register(defineRpcFunction({
|
|
584
688
|
name: "explain",
|
|
585
689
|
type: "static",
|
package/dist/nitro.json
CHANGED
package/dist/public/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>x18n</title><script type="importmap">{"imports":{"#entry":"./_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>x18n</title><script type="importmap">{"imports":{"#entry":"./_nuxt/C0Kqp-hV.js"}}</script><script>{const p=new URLSearchParams(location.hash.slice(1)),c=p.get('devframe_otp');if(c){sessionStorage.setItem('x18n:otp',c);history.replaceState(null,'',location.pathname+location.search+'#'+(p.get('route')||'/'))}}</script><link rel="stylesheet" href="./_nuxt/entry.BYxRFyZC.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="./_nuxt/C0Kqp-hV.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/BeAZf7La.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/B4prFwj0.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/DoHg1T7s.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/BbIaocwP.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/B-DdkvQu.js"><script type="module" src="./_nuxt/C0Kqp-hV.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="./_nuxt/B48W2q7f.js"><link rel="prefetch" as="script" crossorigin href="./_nuxt/ChbLIx1c.js"><link rel="prefetch" as="style" crossorigin href="./_nuxt/error-404.BgnUIvx5.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/DFSrEpkt.js"><link rel="prefetch" as="style" crossorigin href="./_nuxt/error-500.BI0LH_MG.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/CEnmEDIF.js"><meta name="description" content="View and maintain the i18n messages of your project: coverage, keys, usages, diagnostics and extraction."><meta name="color-scheme" content="light dark"><meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)"><meta name="theme-color" content="#0a0a0a" media="(prefers-color-scheme: dark)"><link rel="icon" href="./logo.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="./apple-touch-icon.png"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildId:"a6858f7b-83c5-413c-99d8-4a0183e59820",buildAssetsDir:"./_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1793066931008,false]</script></body></html>
|
package/dist/public/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>x18n</title><script type="importmap">{"imports":{"#entry":"./_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>x18n</title><script type="importmap">{"imports":{"#entry":"./_nuxt/C0Kqp-hV.js"}}</script><script>{const p=new URLSearchParams(location.hash.slice(1)),c=p.get('devframe_otp');if(c){sessionStorage.setItem('x18n:otp',c);history.replaceState(null,'',location.pathname+location.search+'#'+(p.get('route')||'/'))}}</script><link rel="stylesheet" href="./_nuxt/entry.BYxRFyZC.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="./_nuxt/C0Kqp-hV.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/BeAZf7La.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/B4prFwj0.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/DoHg1T7s.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/BbIaocwP.js"><link rel="modulepreload" as="script" crossorigin href="./_nuxt/B-DdkvQu.js"><script type="module" src="./_nuxt/C0Kqp-hV.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="./_nuxt/B48W2q7f.js"><link rel="prefetch" as="script" crossorigin href="./_nuxt/ChbLIx1c.js"><link rel="prefetch" as="style" crossorigin href="./_nuxt/error-404.BgnUIvx5.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/DFSrEpkt.js"><link rel="prefetch" as="style" crossorigin href="./_nuxt/error-500.BI0LH_MG.css"><link rel="prefetch" as="script" crossorigin href="./_nuxt/CEnmEDIF.js"><meta name="description" content="View and maintain the i18n messages of your project: coverage, keys, usages, diagnostics and extraction."><meta name="color-scheme" content="light dark"><meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)"><meta name="theme-color" content="#0a0a0a" media="(prefers-color-scheme: dark)"><link rel="icon" href="./logo.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="./apple-touch-icon.png"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"./",buildId:"a6858f7b-83c5-413c-99d8-4a0183e59820",buildAssetsDir:"./_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1793066931009,false]</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={app:{error:`Não foi possível conectar: {message}`,language:`Idioma`,loading:`Carregando o projeto…`,name:`x18n`,project:`Projeto`,static:`Relatório somente leitura`,staticHint:"Um snapshot gerado com `x18n build`. Execute `x18n ui` para editar."},auth:{code:`Código de autenticação`,hint:"Digite o código de 6 dígitos que o `x18n ui` exibiu no terminal.",label:`Autenticação`,rejected:`Esse código não funcionou. Confira o código atual no terminal.`,submit:`Conectar`,title:`Conectar ao x18n`},detail:{back:`Voltar às chaves`,diagnostics:`Problemas`,edit:`Editar`,label:`Chave`,noUsages:`Nenhum código usa esta chave.`,notFound:`Esta chave não está definida.`,openInEditor:`Abrir no editor`,possible:`possível`,usages:`Usos ({count})`,values:`Valores`,showAllLocales:`Mostrar todos os idiomas`,file:`Arquivo`},edit:{dismiss:`Dispensar`,placeholdersExtra:`placeholders inesperados {names}`,placeholdersMissing:`placeholders ausentes {names}`,rejected:`Não salvo: {key} em {locale}: {message}.`,saveAnyway:`Salvar mesmo assim`,save:`Salvar`,cancel:`Cancelar`,hint:`Enter para salvar · Shift+Enter para nova linha · Esc para cancelar`},extract:{apply:`Extrair ({count})`,differs:`A mensagem de origem difere desta string; a extração mantém as mensagens existentes.`,done:`Chaves extraídas: {count}. Arquivos alterados: {files}.`,existing:`Reutiliza uma chave existente`,file:`Extrair este arquivo`,hint:`Strings fixas no código com uma chave sugerida. Edite as chaves e extraia uma string, um arquivo ou todas as strings marcadas.`,key:`Chave`,new:`Cria uma chave nova`,none:`Nenhuma string fixa encontrada.`,one:`Extrair esta string`,strings:`Strings: {count}`},keys:{allNamespaces:`Todos os namespaces`,anyLocale:`Qualquer idioma`,count:`{shown} de {total} chaves`,diagnosticsHint:`Problemas nesta chave`,editValue:`Valor de {key} em {locale}`,empty:`Nenhuma chave corresponde.`,grid:`Chaves e valores por idioma`,helpEdit:`Enter para editar, Esc para cancelar`,helpMove:`Setas ou j/k para mover`,helpOpen:`o para abrir a chave`,helpSearch:`/ para buscar`,key:`Chave`,missingIn:`Ausente em`,missingInLocale:`Ausente em {locale}`,namespace:`Namespace`,search:`Buscar chaves e valores`,unused:`Não usadas`,unusedHint:`Nenhum código usa esta chave`,withDiagnostics:`Com problemas`,outdated:`Desatualizadas`,sort:`Ordem`,sortKey:`Chave`,sortRecent:`Alteradas recentemente`,reviewed:`Com revisão`},locale:{complete:`Todas as chaves estão traduzidas.`,empty:`Vazias ({count})`,label:`Idioma`,missing:`Ausentes ({count})`,notFound:`Este projeto não tem esse idioma.`,openInGrid:`Mostrar na grade`,problems:`Problemas de placeholder e sintaxe ({count})`,progress:`{translated} de {total} traduzidas ({percent})`,outdated:`Desatualizadas ({count})`},localeBar:{bar:`Idiomas a exibir`,noneShown:`Todos os idiomas estão ocultos. Escolha um na barra acima.`,showAll:`Mostrar todos`,shown:`{shown} de {total} exibidos`,title:`Idiomas`,toggle:`Mostrar ou ocultar {locale}`,resetOrder:`Redefinir ordem`,flags:`Mostrar bandeiras`,reorder:`Arraste, ou pressione Alt e uma seta, para reordenar.`},nav:{extract:`Extrair`,keys:`Chaves`,overview:`Visão geral`,project:`Projeto`,usages:`Usos`,reviews:`Revisões`},overview:{clean:`Nenhum problema encontrado.`,coverage:`Cobertura`,diagnostics:`Diagnósticos`,errors:`Erros: {count}`,keys:`Chaves`,locales:`Idiomas`,missing:`{missing} ausentes, {empty} vazias`,noPresets:`Nenhum preset detectado.`,noRecent:`Nada mudou desde que a página foi aberta.`,presets:`Presets`,recent:`Alterações recentes`,resources:`Recursos`,source:`origem`,usages:`Usos`,warnings:`Avisos: {count}`,outdated:`{count} desatualizadas`},project:{config:`Configuração e a origem de cada valor`,conflict:`.{extension}: {winner} prevalece sobre {loser}`,files:`Arquivos: {count}`,finders:`Localizadores de idiomas`,formats:`Formatos`,presets:`Presets`,problems:`Problemas`,resources:`Recursos: {count}`,scanners:`Scanners`,showAllPresets:`Mostrar todos os presets`,plugins:`Plugins`,none:`Nada encontrado`,duplicates:`Recursos duplicados ignorados: {count}`,skipped:`Presets e plugins ignorados`,rawConfig:`Configuração bruta`},prompt:{copied:`Copiado`,copy:`Copiar prompt de tradução`,hint:`Copiar um prompt para um LLM ou agente traduzir as mensagens ausentes`,copyStale:`Copiar prompt com desatualizadas`,staleHint:`Copia um prompt para um LLM ou agente que traduz as mensagens ausentes e atualiza as desatualizadas`,copyAll:`Copiar o prompt de tradução de todos os idiomas`,allHint:`Copia um prompt para um LLM ou agente que traduza o que falta em cada idioma`},usages:{all:`Todos ({count})`,dynamic:`Dinâmicos ({count})`,dynamicHint:`Usos com chave calculada. Chaves sob o prefixo contam como usadas.`,filter:`Filtrar por arquivo ou chave`,missing:`Não definidas ({count})`,missingHint:`Chaves usadas no código, mas não definidas no idioma de origem.`,unused:`Não usadas ({count})`,unusedHint:`Chaves definidas no idioma de origem que nenhum código usa.`},value:{empty:`vazio`,missing:`ausente`},history:{title:`Histórico`,local:`alterado localmente`,outdated:`desatualizada`,outdatedHint:`A mensagem de origem mudou depois desta tradução`,sourceThen:`Origem na época`,sourceNow:`Origem agora`,more:`e mais {count}`,locales:`{count} idiomas`},sidebar:{list:`Visualização em lista`,tree:`Visualização em árvore`,filter:`Filtrar chaves`,view:`Visualização da lista de chaves`},diagnostics:{all:`Todos ({count})`,viewAll:`Ver todos`,copyFix:`Copiar prompt de correção`,fixHint:`Copia um prompt para um LLM ou agente que corrige todos os diagnósticos deste projeto`,fixCodeHint:`Copia um prompt para um LLM ou agente que corrige os diagnósticos {code}`},review:{add:`Revisar`,type:`Tipo de revisão`,textPlaceholder:`Comentário`,suggestionPlaceholder:`Valor sugerido`,send:`Enviar`,resolve:`Resolver`,apply:`Aplicar`,resolved:`resolvido`,stale:`alterado desde então`,unknownAuthor:`Alguém`,empty:`Nenhuma revisão para mostrar.`,off:`As revisões estão desativadas neste projeto.`,all:`Todas ({count})`,showResolved:`Mostrar resolvidas`,states:{changesRequested:`Alterações solicitadas`,approved:`Aprovado`,staleApproval:`Aprovado, alterado desde então`,suggested:`Sugestão`,commented:`Comentários`},types:{comment:`Comentar`,approve:`Aprovar`,requestChange:`Pedir alteração`,suggestion:`Sugerir`},done:{comment:`comentou`,approve:`aprovou`,requestChange:`pediu uma alteração`,suggestion:`sugeriu um valor`},hint:`Enter para enviar · Shift+Enter para nova linha · Esc para cancelar`,resolvedCount:`{count} resolvidas`,hideResolved:`Ocultar resolvidas`}};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as e,H as t,M as n,P as r,Q as i,U as a,_ as o,c as s,d as c,h as l,it as u,l as d,m as f,r as p,s as m,u as h}from"./B4prFwj0.js";import{o as g}from"./DoHg1T7s.js";import{S as _,m as v}from"./
|
|
1
|
+
import{Et as e,H as t,M as n,P as r,Q as i,U as a,_ as o,c as s,d as c,h as l,it as u,l as d,m as f,r as p,s as m,u as h}from"./B4prFwj0.js";import{o as g}from"./DoHg1T7s.js";import{S as _,m as v}from"./B-DdkvQu.js";import{a as y}from"#entry";import{t as b}from"./DAUGp_mK.js";import{t as x}from"./ztSLDBsK.js";import{t as S}from"./C7dnh697.js";import{t as C}from"./C7ReGOzp.js";var w={class:`flex flex-wrap items-center gap-3 border-b border-base px-4 py-3`},T=[`placeholder`,`aria-label`],E={class:`border-b border-base px-4 py-2 text-xs color-muted`},D={class:`font-mono font-medium color-error`},O={class:`border-b border-base px-4 py-2 text-xs color-muted`},k={class:`border-b border-base px-4 py-2 text-xs color-muted`},A={class:`flex items-center gap-2`},j={class:`font-mono text-xs color-info`},M={key:1,class:`truncate font-mono text-xs color-muted`},N=o({__name:`usages`,setup(o){let N=v((e,t)=>e.analysis(t)),P=v((e,t)=>e.usages(t)),F=i(`missing`),I=i(``),L=m(()=>{let e=new Map;for(let t of N.value?.undefinedUsages??[]){let n=e.get(t.key??t.raw)??[];e.set(t.key??t.raw,n),n.push(t)}return[...e]}),R=m(()=>(P.value??[]).filter(e=>e.dynamic!==!1)),z=m(()=>(P.value??[]).filter(e=>!I.value||e.path.includes(I.value)||(e.key??e.raw).includes(I.value))),B=m(()=>[{value:`missing`,label:_(`usages.missing`,{count:L.value.length})},{value:`unused`,label:_(`usages.unused`,{count:N.value?.unused.length??0})},{value:`dynamic`,label:_(`usages.dynamic`,{count:R.value.length})},{value:`all`,label:_(`usages.all`,{count:P.value?.length??0})}]);return(i,o)=>(n(),d(x,null,{default:t(()=>[s(`div`,w,[l(C,{modelValue:F.value,"onUpdate:modelValue":o[0]||=e=>F.value=e,options:B.value,label:u(_)(`nav.usages`)},null,8,[`modelValue`,`options`,`label`]),F.value===`all`?a((n(),c(`input`,{key:0,"onUpdate:modelValue":o[1]||=e=>I.value=e,class:`input w-72`,placeholder:u(_)(`usages.filter`),"aria-label":u(_)(`usages.filter`)},null,8,T)),[[g,I.value]]):h(``,!0)]),F.value===`missing`?(n(),c(p,{key:0},[s(`p`,E,e(u(_)(`usages.missingHint`)),1),(n(!0),c(p,null,r(L.value,([t,i])=>(n(),c(`div`,{key:t,class:`grid gap-2 border-b border-base px-4 py-3`},[s(`span`,D,e(t),1),(n(!0),c(p,null,r(i,(e,t)=>(n(),c(`div`,{key:t,class:`grid gap-1`},[l(b,{path:e.path,line:e.line,column:e.column},null,8,[`path`,`line`,`column`]),l(S,{usage:e},null,8,[`usage`])]))),128))]))),128))],64)):F.value===`unused`?(n(),c(p,{key:1},[s(`p`,O,e(u(_)(`usages.unusedHint`)),1),(n(!0),c(p,null,r(u(N)?.unused,r=>(n(),d(u(y),{key:r,to:`/keys/${encodeURIComponent(r)}`,class:`focus-ring flex items-center gap-2 border-b border-base px-4 py-1.5 font-mono text-xs transition-colors hover:bg-hover`},{default:t(()=>[o[2]||=s(`span`,{class:`i-ph-ghost-duotone color-faint`},null,-1),f(` `+e(r),1)]),_:2},1032,[`to`]))),128))],64)):F.value===`dynamic`?(n(),c(p,{key:2},[s(`p`,k,e(u(_)(`usages.dynamicHint`)),1),(n(!0),c(p,null,r(R.value,(t,r)=>(n(),c(`div`,{key:r,class:`grid gap-1 border-b border-base px-4 py-3`},[s(`div`,A,[l(b,{path:t.path,line:t.line},null,8,[`path`,`line`]),s(`code`,j,e(t.raw),1)]),l(S,{usage:t},null,8,[`usage`])]))),128))],64)):(n(!0),c(p,{key:3},r(z.value,(r,i)=>(n(),c(`div`,{key:i,class:`grid grid-cols-[minmax(0,22rem)_1fr] items-center gap-4 border-b border-base px-4 py-1 transition-colors hover:bg-hover`},[l(b,{path:r.path,line:r.line},null,8,[`path`,`line`]),r.key?(n(),d(u(y),{key:0,to:`/keys/${encodeURIComponent(r.key)}`,class:`truncate font-mono text-xs hover:underline`},{default:t(()=>[f(e(r.key),1)]),_:2},1032,[`to`])):(n(),c(`span`,M,e(r.raw),1))]))),128))]),_:1}))}});export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,E as t,K as n,Q as r,V as i,W as a,Y as o,Z as s,et as c,it as l,j as u,nt as d,rt as f,s as p,tt as m,v as h}from"./B4prFwj0.js";var g=`modulepreload`,ee=function(e,t){return new URL(e,t).href},_={},v=function(e){return e.pathname.endsWith(`.css`)},y=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ee(t,n);let r=s(t),i=v(r);return y(_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:g,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function x(e,t){return n()?(o(e,t),!0):!1}var S=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var C=Object.prototype.toString,te=e=>C.call(e)===`[object Object]`,w=()=>{},T=E();function E(){var e,t;return S&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ne(...e){if(e.length!==1)return d(...e);let t=e[0];return typeof t==`function`?s(a(()=>({get:t,set:w}))):r(t)}function re(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var D=e=>e();function ie(e=D,t={}){let{initialState:n=`active`}=t,r=ne(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:c(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function O(e){return Array.isArray(e)?e:[e]}function ae(e){return e||h()}function oe(t,n,r={}){let{eventFilter:i=D,...a}=r;return e(t,re(i,n),a)}function se(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=ie(r,{initialState:i});return{stop:oe(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function k(e,n=!0,r){ae(r)?u(e,r):n?e():t(e)}function ce(t,n,r){return e(t,n,{...r,immediate:!0})}var A=S?window:void 0;S&&window.document,S&&window.navigator,S&&window.location;function j(e){let t=f(e);return t?.$el??t}function M(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=p(()=>{let t=O(f(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return ce(()=>[n.value?.map(e=>j(e))??[A].filter(e=>e!=null),O(f(n.value?e[1]:e[0])),O(l(n.value?e[2]:e[1])),f(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=te(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var N=!1;function le(e,t,n={}){let{window:r=A,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:w,cancel:w,trigger:w}:w;if(T&&!N){N=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>t.addEventListener(`click`,w,e)),r.document.documentElement.addEventListener(`click`,w,e)}let c=!0,l=e=>f(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=j(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=f(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=f(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let p=n=>{let r=j(e);n.target!=null&&(!(r instanceof Element)&&u(e)&&d(e,n)||r&&r!==n.target&&!n.composedPath().includes(r)&&(`detail`in n&&n.detail===0&&(c=!l(n)),c?t(n):c=!0))},m=!1,h=[M(r,`click`,e=>{m||(m=!0,setTimeout(()=>{m=!1},0),p(e))},{passive:!0,capture:a}),M(r,`pointerdown`,t=>{let n=j(e);c=!l(t)&&!(!n||t.composedPath().includes(n))},{passive:!0}),o&&M(r,`blur`,n=>{setTimeout(()=>{let i=j(e),a=r.document.activeElement;for(;a?.shadowRoot;)a=a.shadowRoot.activeElement;a?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>h.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,p(e),c=!1}}:g}function ue(){let e=m(!1),t=h();return t&&u(()=>{e.value=!0},t),e}function de(e){let t=ue();return p(()=>(t.value,!!e()))}var P=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},F=`__vueuse_ssr_handlers__`,fe=pe();function pe(){return F in P||(P[F]=P[F]||{}),P[F]}function me(e,t){return fe[e]||t}function he(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var ge={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},I=`vueuse-storage`;function _e(n,i,a,o={}){let{flush:s=`pre`,deep:c=!0,listenToStorageChanges:l=!0,writeDefaults:u=!0,mergeDefaults:d=!1,shallow:h,window:g=A,eventFilter:ee,onError:_=e=>{console.error(e)},initOnMounted:v}=o,y=(h?m:r)(typeof i==`function`?i():i),b=p(()=>f(n));if(!a)try{a=me(`getDefaultStorage`,()=>A?.localStorage)()}catch(e){_(e)}if(!a)return y;let x=f(i),S=he(x),C=o.serializer??ge[S],{pause:te,resume:w}=se(y,e=>ne(e),{flush:s,deep:c,eventFilter:ee});e(b,()=>D(),{flush:s});let T=!1;g&&l&&(a instanceof Storage?M(g,`storage`,e=>{(!v||T)&&D(e)},{passive:!0}):M(g,I,e=>{(!v||T)&&ie(e)})),v?k(()=>{T=!0,D()}):D();function E(e,t){if(g){let n={key:b.value,oldValue:e,newValue:t,storageArea:a};g.dispatchEvent(a instanceof Storage?new StorageEvent(`storage`,n):new CustomEvent(I,{detail:n}))}}function ne(e){try{let t=a.getItem(b.value);if(e==null)E(t,null),a.removeItem(b.value);else{let n=C.write(e);t!==n&&(a.setItem(b.value,n),E(t,n))}}catch(e){_(e)}}function re(e){let t=e?e.newValue:a.getItem(b.value);if(t==null)return u&&x!=null&&a.setItem(b.value,C.write(x)),x;if(!e&&d){let e=C.read(t);return typeof d==`function`?d(e,x):S===`object`&&!Array.isArray(e)?{...x,...e}:e}return typeof t==`string`?C.read(t):t}function D(e){if(!(e&&e.storageArea!==a)){if(e&&e.key==null)y.value=x;else if(!(e&&e.key!==b.value)){te();try{let t=C.write(y.value);(e===void 0||e?.newValue!==t)&&(y.value=re(e))}catch(e){_(e)}finally{e?t(w):w()}}}}function ie(e){D(e.detail)}return y}function ve(t,n,r={}){let{window:i=A,...a}=r,o,s=de(()=>i&&`ResizeObserver`in i),c=()=>{o&&=(o.disconnect(),void 0)},l=p(()=>{let e=f(t);return Array.isArray(e)?e.map(e=>j(e)):[j(e)]}),u=e(l,e=>{if(c(),s.value&&i){o=new ResizeObserver(n);for(let t of e)t instanceof Element&&o.observe(t,a)}},{immediate:!0,flush:`post`}),d=()=>{c(),u()};return x(d),{isSupported:s,stop:d}}function ye(t,n={width:0,height:0},r={}){let{window:i=A,box:a=`content-box`}=r,o=p(()=>{var e;return(e=j(t))==null||(e=e.namespaceURI)==null?void 0:e.includes(`svg`)}),s=m(n.width),c=m(n.height),{stop:l}=ve(t,([e])=>{let n=a===`border-box`?e.borderBoxSize:a===`content-box`?e.contentBoxSize:e.devicePixelContentBoxSize;if(i&&o.value){let e=j(t);if(e){let t=e.getBoundingClientRect();s.value=t.width,c.value=t.height}}else if(n){let e=O(n);s.value=e.reduce((e,{inlineSize:t})=>e+t,0),c.value=e.reduce((e,{blockSize:t})=>e+t,0)}else s.value=e.contentRect.width,c.value=e.contentRect.height},r);k(()=>{let e=j(t);if(e&&`offsetWidth`in e){if(a===`content-box`&&i){let t=i.getComputedStyle(e),n=Number.parseFloat(t.paddingLeft)+Number.parseFloat(t.paddingRight),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom),a=Number.parseFloat(t.borderLeftWidth)+Number.parseFloat(t.borderRightWidth),o=Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth);s.value=e.offsetWidth-n-a,c.value=e.offsetHeight-r-o}else s.value=e.offsetWidth,c.value=e.offsetHeight}else e&&(s.value=n.width,c.value=n.height)});let u=e(()=>j(t),e=>{s.value=e?n.width:0,c.value=e?n.height:0});function d(){l(),u()}return{width:s,height:c,stop:d}}function L(e,t,n={}){let{window:r=A}=n;return _e(e,t,r?.localStorage,n)}function be(e,t){let{containerStyle:n,wrapperProps:r,scrollTo:i,calculateRange:a,currentList:o,containerRef:s}=`itemHeight`in t?Te(t,e):we(t,e);return{list:o,scrollTo:i,containerProps:{ref:s,onScroll:()=>{a()},style:n},wrapperProps:r}}function R(e){let t=m(null),n=ye(t),i=r([]),a=m(e);return{state:r({start:0,end:10}),source:a,currentList:i,size:n,containerRef:t}}function z(e,t,n){return r=>{if(typeof n==`number`)return Math.ceil(r/n);let{start:i=0}=e.value,a=0,o=0;for(let e=i;e<t.value.length;e++){let t=n(e);if(a+=t,o=e,a>r)break}return o-i}}function B(e,t){return n=>{if(typeof t==`number`)return Math.floor(n/t)+1;let r=0,i=0;for(let a=0;a<e.value.length;a++){let e=t(a);if(r+=e,r>=n){i=a;break}}return i+1}}function V(e,t,n,r,{containerRef:i,state:a,currentList:o,source:s}){return()=>{let c=i.value;if(c){let i=n(e===`vertical`?c.scrollTop:c.scrollLeft),l=r(e===`vertical`?c.clientHeight:c.clientWidth),u=i-t,d=i+l+t;a.value={start:u<0?0:u,end:d>s.value.length?s.value.length:d},o.value=s.value.slice(a.value.start,a.value.end).map((e,t)=>({data:e,index:t+a.value.start}))}}}function H(e,t){return n=>typeof e==`number`?n*e:t.value.slice(0,n).reduce((t,n,r)=>t+e(r),0)}function U(t,n,r,i,a){e([t.width,t.height,n,r,i],()=>{a()})}function W(e,t){return p(()=>typeof e==`number`?t.value.length*e:t.value.reduce((t,n,r)=>t+e(r),0))}var xe={horizontal:`scrollLeft`,vertical:`scrollTop`},Se={horizontal:`left`,vertical:`top`},G={behavior:`auto`,block:`start`,inline:`nearest`};function Ce(e,t,n,r,i){return(a,o=G)=>{if(!r.value)return;o={...G,...o};let s=0,c=o[e===`horizontal`?`inline`:`block`];if(c){let t=e===`horizontal`?r.value.clientWidth:r.value.clientHeight,o=typeof i==`number`?i:i(a);if(c===`center`)s=t/2-o/2;else if(c===`end`)s=t-o;else if(c===`nearest`){let i=r.value[xe[e]];n(a)>i+t/2&&(s=t-o)}}r.value.scrollTo({[Se[e]]:n(a)-s,behavior:o.behavior}),t()}}function we(e,t){let n=R(t),{state:r,source:i,currentList:a,size:o,containerRef:s}=n,c={overflowX:`auto`},{itemWidth:l,overscan:u=5}=e,d=z(r,i,l),f=V(`horizontal`,u,B(i,l),d,n),m=H(l,i),h=p(()=>m(r.value.start)),g=W(l,i);return U(o,i,g,s,f),{scrollTo:Ce(`horizontal`,f,m,s,l),calculateRange:f,wrapperProps:p(()=>({style:{height:`100%`,width:`${g.value-h.value}px`,marginLeft:`${h.value}px`,display:`flex`}})),containerStyle:c,currentList:a,containerRef:s}}function Te(e,t){let n=R(t),{state:r,source:i,currentList:a,size:o,containerRef:s}=n,c={overflowY:`auto`},{itemHeight:l,overscan:u=5}=e,d=z(r,i,l),f=V(`vertical`,u,B(i,l),d,n),m=H(l,i),h=p(()=>m(r.value.start)),g=W(l,i);return U(o,i,g,s,f),{calculateRange:f,scrollTo:Ce(`vertical`,f,m,s,l),containerStyle:c,wrapperProps:p(()=>({style:{width:`100%`,height:`${g.value-h.value}px`,marginTop:`${h.value}px`}})),currentList:a,containerRef:s}}var Ee={app:{name:`x18n`,loading:`Loading the project…`,error:`Could not connect: {message}`,project:`Project`,static:`Read-only report`,staticHint:"A snapshot built with `x18n build`. Run `x18n ui` to edit.",language:`Language`},auth:{label:`Authentication`,title:`Connect to x18n`,hint:"Enter the 6-digit code that `x18n ui` printed in the terminal.",code:`Auth code`,submit:`Connect`,rejected:`That code did not work. Check the terminal for the current one.`},nav:{overview:`Overview`,keys:`Keys`,usages:`Usages`,extract:`Extract`,project:`Project`},localeBar:{title:`Locales`,bar:`Locales to show`,toggle:`Show or hide {locale}`,shown:`{shown} of {total} shown`,showAll:`Show all`,noneShown:`Every locale is hidden. Pick one in the bar above.`,resetOrder:`Reset order`,flags:`Show flags`,reorder:`Drag, or press Alt and an arrow key, to reorder.`},overview:{keys:`Keys`,resources:`Resources`,usages:`Usages`,locales:`Locales`,coverage:`Coverage`,source:`source`,missing:`{missing} missing, {empty} empty`,diagnostics:`Diagnostics`,errors:`Errors: {count}`,warnings:`Warnings: {count}`,clean:`No problems found.`,presets:`Presets`,noPresets:`No preset detected.`,recent:`Recent changes`,noRecent:`Nothing changed since the page opened.`,outdated:`{count} outdated`},keys:{search:`Search keys and values`,namespace:`Namespace`,allNamespaces:`All namespaces`,missingIn:`Missing in`,anyLocale:`Any locale`,missingInLocale:`Missing in {locale}`,unused:`Unused`,withDiagnostics:`With problems`,count:`{shown} of {total} keys`,grid:`Keys and values per locale`,key:`Key`,unusedHint:`No code uses this key`,diagnosticsHint:`Problems on this key`,editValue:`Value of {key} in {locale}`,empty:`No keys match.`,helpMove:`Arrows or j/k to move`,helpEdit:`Enter to edit, Esc to cancel`,helpOpen:`o to open the key`,helpSearch:`/ to search`,outdated:`Outdated`,sort:`Sort`,sortKey:`Key`,sortRecent:`Recently changed`},value:{missing:`missing`,empty:`empty`},edit:{rejected:`Not saved: {key} in {locale}: {message}.`,placeholdersMissing:`missing placeholders {names}`,placeholdersExtra:`unexpected placeholders {names}`,saveAnyway:`Save anyway`,dismiss:`Dismiss`,save:`Save`,cancel:`Cancel`,hint:`Enter to save · Shift+Enter for a new line · Esc to cancel`},detail:{label:`Key`,back:`Back to keys`,notFound:`This key is not defined.`,values:`Values`,edit:`Edit`,diagnostics:`Problems`,usages:`Usages ({count})`,noUsages:`No code uses this key.`,possible:`possible`,openInEditor:`Open in editor`,showAllLocales:`Show all locales`,file:`File`},prompt:{copy:`Copy translate prompt`,copied:`Copied`,hint:`Copy a prompt for an LLM or agent that translates the missing messages`,copyStale:`Copy prompt with outdated`,staleHint:`Copy a prompt for an LLM or agent that translates the missing messages and updates the outdated ones`,copyAll:`Copy translate prompt for all locales`,allHint:`Copy a prompt for an LLM or agent that translates what is missing in every locale`},locale:{label:`Locale`,openInGrid:`Show in the grid`,progress:`{translated} of {total} translated ({percent})`,missing:`Missing ({count})`,empty:`Empty ({count})`,problems:`Placeholder and syntax problems ({count})`,notFound:`This project has no such locale.`,complete:`Every key is translated.`,outdated:`Outdated ({count})`},diagnostics:{all:`All ({count})`,viewAll:`View all`,copyFix:`Copy fix prompt`,fixHint:`Copy a prompt for an LLM or agent that fixes every diagnostic of this project`,fixCodeHint:`Copy a prompt for an LLM or agent that fixes the {code} diagnostics`},usages:{missing:`Not defined ({count})`,unused:`Unused ({count})`,dynamic:`Dynamic ({count})`,all:`All ({count})`,missingHint:`Keys used in code but not defined in the source locale.`,unusedHint:`Keys defined in the source locale that no code uses.`,dynamicHint:`Usages with a computed key. Keys under their prefix count as used.`,filter:`Filter by file or key`},extract:{hint:`Hard-coded strings with a proposed key. Edit keys, then extract one string, one file, or every ticked string.`,none:`No hard-coded strings found.`,key:`Key`,apply:`Extract ({count})`,done:`Extracted keys: {count}. Changed files: {files}.`,strings:`Strings: {count}`,one:`Extract this string`,existing:`Reuses an existing key`,new:`Creates a new key`,file:`Extract this file`,differs:`Its source message differs from this string; extraction keeps the existing messages.`},project:{presets:`Presets`,finders:`Locale finders`,resources:`Resources: {count}`,formats:`Formats`,scanners:`Scanners`,files:`Files: {count}`,problems:`Problems`,conflict:`.{extension}: {winner} wins over {loser}`,config:`Config and where each value comes from`,showAllPresets:`Show all presets`,plugins:`Plugins`,none:`Nothing found`,duplicates:`Skipped duplicate resources: {count}`,skipped:`Skipped presets and plugins`,rawConfig:`Raw config`},history:{title:`History`,local:`changed locally`,outdated:`outdated`,outdatedHint:`The source message changed after this translation`,sourceThen:`Source then`,sourceNow:`Source now`,more:`and {count} more`,locales:`{count} locales`},sidebar:{list:`List view`,tree:`Tree view`,filter:`Filter keys`,view:`Key list view`}};function K(e,t=``,n=new Map){for(let[r,i]of Object.entries(e))typeof i==`string`?n.set(`${t}${r}`,i):K(i,`${t}${r}.`,n);return n}var De=[`en`,`zh-Hans`,`zh-Hant`,`ja`,`ko`,`de`,`fr`,`es`,`pt-BR`,`ru`],Oe=Object.assign({"./locales/de.json":()=>b(()=>import(`./Cla6r_hp.js`).then(e=>e.default),[],import.meta.url),"./locales/es.json":()=>b(()=>import(`./CTHz3W6Z.js`).then(e=>e.default),[],import.meta.url),"./locales/fr.json":()=>b(()=>import(`./OCEG5gyJ.js`).then(e=>e.default),[],import.meta.url),"./locales/ja.json":()=>b(()=>import(`./DxKFtHBx.js`).then(e=>e.default),[],import.meta.url),"./locales/ko.json":()=>b(()=>import(`./By9SURJ0.js`).then(e=>e.default),[],import.meta.url),"./locales/pt-BR.json":()=>b(()=>import(`./DGZ47nDY.js`).then(e=>e.default),[],import.meta.url),"./locales/ru.json":()=>b(()=>import(`./CqFP5-dM.js`).then(e=>e.default),[],import.meta.url),"./locales/zh-Hans.json":()=>b(()=>import(`./GykjZmqe.js`).then(e=>e.default),[],import.meta.url),"./locales/zh-Hant.json":()=>b(()=>import(`./CJYF9l4i.js`).then(e=>e.default),[],import.meta.url)}),q=K(Ee),ke=`x18n:lang`,J=r(`en`),Ae=m(q);function je(e){let t;try{t=new Intl.Locale(e).maximize()}catch{return}return t.language===`zh`?t.script===`Hant`?`zh-Hant`:`zh-Hans`:t.language===`pt`?`pt-BR`:De.find(e=>e===t.language)}function Me(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Ne(){J.value=[new URLSearchParams(location.search).get(`lang`),localStorage.getItem(ke),...navigator.languages].map(e=>e?je(e):void 0).find(e=>e!==void 0)??`en`,i(async()=>{let e=J.value;document.documentElement.lang=e;let t=e===`en`?void 0:await Oe[`./locales/${e}.json`]?.();e===J.value&&(Ae.value=t?K(t):q)})}function Pe(e){J.value=e,localStorage.setItem(ke,e)}function Fe(e,t={}){return(Ae.value.get(e)??q.get(e)??e).replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:typeof r==`number`?r.toLocaleString(J.value):r})}function Ie(e){return(e/100).toLocaleString(J.value,{style:`percent`,maximumFractionDigits:1})}function Le(e){try{return new Intl.DisplayNames([J.value],{type:`language`}).of(e)}catch{return}}var Re=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function ze(e){let t=e-Date.now(),[n,r]=Re.find(([,e])=>Math.abs(t)>=e)??[`second`,1e3];return new Intl.RelativeTimeFormat(J.value,{numeric:`auto`}).format(Math.round(t/r),n)}var Be=m(),Ve=m(),Y=r(),He=r(0),Ue=m([]),We=p(()=>Ve.value?.projects.find(e=>e.name===Y.value)),X=L(`x18n:locale-order`,{}),Z=p(()=>{let e=We.value;if(!e)return[];let t=[...e.locales.filter(t=>t.code===e.sourceLocale),...e.locales.filter(t=>t.code!==e.sourceLocale)],n=X.value[e.name]??[],r=e=>{let t=n.indexOf(e);return t===-1?n.length:t};return t.map((e,t)=>({locale:e,i:t})).sort((e,t)=>r(e.locale.code)-r(t.locale.code)||e.i-t.i).map(({locale:e})=>e)}),Ge=p(()=>!!X.value[Y.value??``]);function Ke(e,t){let n=Y.value;if(!n)return;let r=Z.value.map(e=>e.code).filter(t=>t!==e);r.splice(Math.max(0,Math.min(t,r.length)),0,e),X.value={...X.value,[n]:r}}function qe(){let{[Y.value??``]:e,...t}=X.value;X.value=t}var Q=L(`x18n:hidden-locales`,{}),$=p(()=>new Set(Q.value[Y.value??``]??[])),Je=p(()=>Z.value.filter(e=>!$.value.has(e.code)));function Ye(e){return!$.value.has(e)}function Xe(e){let t=Y.value;if(!t)return;let n=new Set($.value);n.delete(e)||n.add(e),Q.value={...Q.value,[t]:[...n]}}function Ze(){let{[Y.value??``]:e,...t}=Q.value;Q.value=t}function Qe(e){let t=m(),n=0;return i(()=>{let r=Be.value,i=Y.value;if(He.value,!r||!i)return;let a=++n;e(r,i).then(e=>{a===n&&(t.value=e)})}),t}export{J as C,be as D,L as E,b as O,Fe as S,le as T,ze as _,Z as a,Pe as b,Y as c,He as d,Ze as f,Me as g,Je as h,Ye as i,Ue as l,Qe as m,We as n,Ke as o,Xe as p,Ge as r,Ve as s,Be as t,qe as u,Ie as v,De as w,Ne as x,Le as y};
|
|
1
|
+
import{B as e,E as t,K as n,Q as r,V as i,W as a,Y as o,Z as s,et as c,it as l,j as u,nt as d,rt as f,s as p,tt as m,v as h}from"./B4prFwj0.js";var g=`modulepreload`,ee=function(e,t){return new URL(e,t).href},_={},v=function(e){return e.pathname.endsWith(`.css`)},y=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ee(t,n);let r=s(t),i=v(r);return y(_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:g,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function x(e,t){return n()?(o(e,t),!0):!1}var S=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var C=Object.prototype.toString,te=e=>C.call(e)===`[object Object]`,w=()=>{},T=E();function E(){var e,t;return S&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ne(...e){if(e.length!==1)return d(...e);let t=e[0];return typeof t==`function`?s(a(()=>({get:t,set:w}))):r(t)}function re(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var D=e=>e();function ie(e=D,t={}){let{initialState:n=`active`}=t,r=ne(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:c(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function O(e){return Array.isArray(e)?e:[e]}function ae(e){return e||h()}function oe(t,n,r={}){let{eventFilter:i=D,...a}=r;return e(t,re(i,n),a)}function se(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=ie(r,{initialState:i});return{stop:oe(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function k(e,n=!0,r){ae(r)?u(e,r):n?e():t(e)}function ce(t,n,r){return e(t,n,{...r,immediate:!0})}var A=S?window:void 0;S&&window.document,S&&window.navigator,S&&window.location;function j(e){let t=f(e);return t?.$el??t}function M(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=p(()=>{let t=O(f(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return ce(()=>[n.value?.map(e=>j(e))??[A].filter(e=>e!=null),O(f(n.value?e[1]:e[0])),O(l(n.value?e[2]:e[1])),f(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=te(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var N=!1;function le(e,t,n={}){let{window:r=A,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:w,cancel:w,trigger:w}:w;if(T&&!N){N=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>t.addEventListener(`click`,w,e)),r.document.documentElement.addEventListener(`click`,w,e)}let c=!0,l=e=>f(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=j(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=f(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=f(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let p=n=>{let r=j(e);n.target!=null&&(!(r instanceof Element)&&u(e)&&d(e,n)||r&&r!==n.target&&!n.composedPath().includes(r)&&(`detail`in n&&n.detail===0&&(c=!l(n)),c?t(n):c=!0))},m=!1,h=[M(r,`click`,e=>{m||(m=!0,setTimeout(()=>{m=!1},0),p(e))},{passive:!0,capture:a}),M(r,`pointerdown`,t=>{let n=j(e);c=!l(t)&&!(!n||t.composedPath().includes(n))},{passive:!0}),o&&M(r,`blur`,n=>{setTimeout(()=>{let i=j(e),a=r.document.activeElement;for(;a?.shadowRoot;)a=a.shadowRoot.activeElement;a?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>h.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,p(e),c=!1}}:g}function ue(){let e=m(!1),t=h();return t&&u(()=>{e.value=!0},t),e}function de(e){let t=ue();return p(()=>(t.value,!!e()))}var P=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},F=`__vueuse_ssr_handlers__`,fe=pe();function pe(){return F in P||(P[F]=P[F]||{}),P[F]}function me(e,t){return fe[e]||t}function he(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var ge={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},I=`vueuse-storage`;function _e(n,i,a,o={}){let{flush:s=`pre`,deep:c=!0,listenToStorageChanges:l=!0,writeDefaults:u=!0,mergeDefaults:d=!1,shallow:h,window:g=A,eventFilter:ee,onError:_=e=>{console.error(e)},initOnMounted:v}=o,y=(h?m:r)(typeof i==`function`?i():i),b=p(()=>f(n));if(!a)try{a=me(`getDefaultStorage`,()=>A?.localStorage)()}catch(e){_(e)}if(!a)return y;let x=f(i),S=he(x),C=o.serializer??ge[S],{pause:te,resume:w}=se(y,e=>ne(e),{flush:s,deep:c,eventFilter:ee});e(b,()=>D(),{flush:s});let T=!1;g&&l&&(a instanceof Storage?M(g,`storage`,e=>{(!v||T)&&D(e)},{passive:!0}):M(g,I,e=>{(!v||T)&&ie(e)})),v?k(()=>{T=!0,D()}):D();function E(e,t){if(g){let n={key:b.value,oldValue:e,newValue:t,storageArea:a};g.dispatchEvent(a instanceof Storage?new StorageEvent(`storage`,n):new CustomEvent(I,{detail:n}))}}function ne(e){try{let t=a.getItem(b.value);if(e==null)E(t,null),a.removeItem(b.value);else{let n=C.write(e);t!==n&&(a.setItem(b.value,n),E(t,n))}}catch(e){_(e)}}function re(e){let t=e?e.newValue:a.getItem(b.value);if(t==null)return u&&x!=null&&a.setItem(b.value,C.write(x)),x;if(!e&&d){let e=C.read(t);return typeof d==`function`?d(e,x):S===`object`&&!Array.isArray(e)?{...x,...e}:e}return typeof t==`string`?C.read(t):t}function D(e){if(!(e&&e.storageArea!==a)){if(e&&e.key==null)y.value=x;else if(!(e&&e.key!==b.value)){te();try{let t=C.write(y.value);(e===void 0||e?.newValue!==t)&&(y.value=re(e))}catch(e){_(e)}finally{e?t(w):w()}}}}function ie(e){D(e.detail)}return y}function ve(t,n,r={}){let{window:i=A,...a}=r,o,s=de(()=>i&&`ResizeObserver`in i),c=()=>{o&&=(o.disconnect(),void 0)},l=p(()=>{let e=f(t);return Array.isArray(e)?e.map(e=>j(e)):[j(e)]}),u=e(l,e=>{if(c(),s.value&&i){o=new ResizeObserver(n);for(let t of e)t instanceof Element&&o.observe(t,a)}},{immediate:!0,flush:`post`}),d=()=>{c(),u()};return x(d),{isSupported:s,stop:d}}function ye(t,n={width:0,height:0},r={}){let{window:i=A,box:a=`content-box`}=r,o=p(()=>{var e;return(e=j(t))==null||(e=e.namespaceURI)==null?void 0:e.includes(`svg`)}),s=m(n.width),c=m(n.height),{stop:l}=ve(t,([e])=>{let n=a===`border-box`?e.borderBoxSize:a===`content-box`?e.contentBoxSize:e.devicePixelContentBoxSize;if(i&&o.value){let e=j(t);if(e){let t=e.getBoundingClientRect();s.value=t.width,c.value=t.height}}else if(n){let e=O(n);s.value=e.reduce((e,{inlineSize:t})=>e+t,0),c.value=e.reduce((e,{blockSize:t})=>e+t,0)}else s.value=e.contentRect.width,c.value=e.contentRect.height},r);k(()=>{let e=j(t);if(e&&`offsetWidth`in e){if(a===`content-box`&&i){let t=i.getComputedStyle(e),n=Number.parseFloat(t.paddingLeft)+Number.parseFloat(t.paddingRight),r=Number.parseFloat(t.paddingTop)+Number.parseFloat(t.paddingBottom),a=Number.parseFloat(t.borderLeftWidth)+Number.parseFloat(t.borderRightWidth),o=Number.parseFloat(t.borderTopWidth)+Number.parseFloat(t.borderBottomWidth);s.value=e.offsetWidth-n-a,c.value=e.offsetHeight-r-o}else s.value=e.offsetWidth,c.value=e.offsetHeight}else e&&(s.value=n.width,c.value=n.height)});let u=e(()=>j(t),e=>{s.value=e?n.width:0,c.value=e?n.height:0});function d(){l(),u()}return{width:s,height:c,stop:d}}function L(e,t,n={}){let{window:r=A}=n;return _e(e,t,r?.localStorage,n)}function be(e,t){let{containerStyle:n,wrapperProps:r,scrollTo:i,calculateRange:a,currentList:o,containerRef:s}=`itemHeight`in t?Te(t,e):we(t,e);return{list:o,scrollTo:i,containerProps:{ref:s,onScroll:()=>{a()},style:n},wrapperProps:r}}function R(e){let t=m(null),n=ye(t),i=r([]),a=m(e);return{state:r({start:0,end:10}),source:a,currentList:i,size:n,containerRef:t}}function z(e,t,n){return r=>{if(typeof n==`number`)return Math.ceil(r/n);let{start:i=0}=e.value,a=0,o=0;for(let e=i;e<t.value.length;e++){let t=n(e);if(a+=t,o=e,a>r)break}return o-i}}function B(e,t){return n=>{if(typeof t==`number`)return Math.floor(n/t)+1;let r=0,i=0;for(let a=0;a<e.value.length;a++){let e=t(a);if(r+=e,r>=n){i=a;break}}return i+1}}function V(e,t,n,r,{containerRef:i,state:a,currentList:o,source:s}){return()=>{let c=i.value;if(c){let i=n(e===`vertical`?c.scrollTop:c.scrollLeft),l=r(e===`vertical`?c.clientHeight:c.clientWidth),u=i-t,d=i+l+t;a.value={start:u<0?0:u,end:d>s.value.length?s.value.length:d},o.value=s.value.slice(a.value.start,a.value.end).map((e,t)=>({data:e,index:t+a.value.start}))}}}function H(e,t){return n=>typeof e==`number`?n*e:t.value.slice(0,n).reduce((t,n,r)=>t+e(r),0)}function U(t,n,r,i,a){e([t.width,t.height,n,r,i],()=>{a()})}function W(e,t){return p(()=>typeof e==`number`?t.value.length*e:t.value.reduce((t,n,r)=>t+e(r),0))}var xe={horizontal:`scrollLeft`,vertical:`scrollTop`},Se={horizontal:`left`,vertical:`top`},G={behavior:`auto`,block:`start`,inline:`nearest`};function Ce(e,t,n,r,i){return(a,o=G)=>{if(!r.value)return;o={...G,...o};let s=0,c=o[e===`horizontal`?`inline`:`block`];if(c){let t=e===`horizontal`?r.value.clientWidth:r.value.clientHeight,o=typeof i==`number`?i:i(a);if(c===`center`)s=t/2-o/2;else if(c===`end`)s=t-o;else if(c===`nearest`){let i=r.value[xe[e]];n(a)>i+t/2&&(s=t-o)}}r.value.scrollTo({[Se[e]]:n(a)-s,behavior:o.behavior}),t()}}function we(e,t){let n=R(t),{state:r,source:i,currentList:a,size:o,containerRef:s}=n,c={overflowX:`auto`},{itemWidth:l,overscan:u=5}=e,d=z(r,i,l),f=V(`horizontal`,u,B(i,l),d,n),m=H(l,i),h=p(()=>m(r.value.start)),g=W(l,i);return U(o,i,g,s,f),{scrollTo:Ce(`horizontal`,f,m,s,l),calculateRange:f,wrapperProps:p(()=>({style:{height:`100%`,width:`${g.value-h.value}px`,marginLeft:`${h.value}px`,display:`flex`}})),containerStyle:c,currentList:a,containerRef:s}}function Te(e,t){let n=R(t),{state:r,source:i,currentList:a,size:o,containerRef:s}=n,c={overflowY:`auto`},{itemHeight:l,overscan:u=5}=e,d=z(r,i,l),f=V(`vertical`,u,B(i,l),d,n),m=H(l,i),h=p(()=>m(r.value.start)),g=W(l,i);return U(o,i,g,s,f),{calculateRange:f,scrollTo:Ce(`vertical`,f,m,s,l),containerStyle:c,wrapperProps:p(()=>({style:{width:`100%`,height:`${g.value-h.value}px`,marginTop:`${h.value}px`}})),currentList:a,containerRef:s}}var Ee={app:{name:`x18n`,loading:`Loading the project…`,error:`Could not connect: {message}`,project:`Project`,static:`Read-only report`,staticHint:"A snapshot built with `x18n build`. Run `x18n ui` to edit.",language:`Language`},auth:{label:`Authentication`,title:`Connect to x18n`,hint:"Enter the 6-digit code that `x18n ui` printed in the terminal.",code:`Auth code`,submit:`Connect`,rejected:`That code did not work. Check the terminal for the current one.`},nav:{overview:`Overview`,keys:`Keys`,usages:`Usages`,extract:`Extract`,project:`Project`,reviews:`Reviews`},localeBar:{title:`Locales`,bar:`Locales to show`,toggle:`Show or hide {locale}`,shown:`{shown} of {total} shown`,showAll:`Show all`,noneShown:`Every locale is hidden. Pick one in the bar above.`,resetOrder:`Reset order`,flags:`Show flags`,reorder:`Drag, or press Alt and an arrow key, to reorder.`},overview:{keys:`Keys`,resources:`Resources`,usages:`Usages`,locales:`Locales`,coverage:`Coverage`,source:`source`,missing:`{missing} missing, {empty} empty`,diagnostics:`Diagnostics`,errors:`Errors: {count}`,warnings:`Warnings: {count}`,clean:`No problems found.`,presets:`Presets`,noPresets:`No preset detected.`,recent:`Recent changes`,noRecent:`Nothing changed since the page opened.`,outdated:`{count} outdated`},keys:{search:`Search keys and values`,namespace:`Namespace`,allNamespaces:`All namespaces`,missingIn:`Missing in`,anyLocale:`Any locale`,missingInLocale:`Missing in {locale}`,unused:`Unused`,withDiagnostics:`With problems`,count:`{shown} of {total} keys`,grid:`Keys and values per locale`,key:`Key`,unusedHint:`No code uses this key`,diagnosticsHint:`Problems on this key`,editValue:`Value of {key} in {locale}`,empty:`No keys match.`,helpMove:`Arrows or j/k to move`,helpEdit:`Enter to edit, Esc to cancel`,helpOpen:`o to open the key`,helpSearch:`/ to search`,outdated:`Outdated`,sort:`Sort`,sortKey:`Key`,sortRecent:`Recently changed`,reviewed:`Reviewed`},value:{missing:`missing`,empty:`empty`},edit:{rejected:`Not saved: {key} in {locale}: {message}.`,placeholdersMissing:`missing placeholders {names}`,placeholdersExtra:`unexpected placeholders {names}`,saveAnyway:`Save anyway`,dismiss:`Dismiss`,save:`Save`,cancel:`Cancel`,hint:`Enter to save · Shift+Enter for a new line · Esc to cancel`},detail:{label:`Key`,back:`Back to keys`,notFound:`This key is not defined.`,values:`Values`,edit:`Edit`,diagnostics:`Problems`,usages:`Usages ({count})`,noUsages:`No code uses this key.`,possible:`possible`,openInEditor:`Open in editor`,showAllLocales:`Show all locales`,file:`File`},prompt:{copy:`Copy translate prompt`,copied:`Copied`,hint:`Copy a prompt for an LLM or agent that translates the missing messages`,copyStale:`Copy prompt with outdated`,staleHint:`Copy a prompt for an LLM or agent that translates the missing messages and updates the outdated ones`,copyAll:`Copy translate prompt for all locales`,allHint:`Copy a prompt for an LLM or agent that translates what is missing in every locale`},locale:{label:`Locale`,openInGrid:`Show in the grid`,progress:`{translated} of {total} translated ({percent})`,missing:`Missing ({count})`,empty:`Empty ({count})`,problems:`Placeholder and syntax problems ({count})`,notFound:`This project has no such locale.`,complete:`Every key is translated.`,outdated:`Outdated ({count})`},diagnostics:{all:`All ({count})`,viewAll:`View all`,copyFix:`Copy fix prompt`,fixHint:`Copy a prompt for an LLM or agent that fixes every diagnostic of this project`,fixCodeHint:`Copy a prompt for an LLM or agent that fixes the {code} diagnostics`},usages:{missing:`Not defined ({count})`,unused:`Unused ({count})`,dynamic:`Dynamic ({count})`,all:`All ({count})`,missingHint:`Keys used in code but not defined in the source locale.`,unusedHint:`Keys defined in the source locale that no code uses.`,dynamicHint:`Usages with a computed key. Keys under their prefix count as used.`,filter:`Filter by file or key`},extract:{hint:`Hard-coded strings with a proposed key. Edit keys, then extract one string, one file, or every ticked string.`,none:`No hard-coded strings found.`,key:`Key`,apply:`Extract ({count})`,done:`Extracted keys: {count}. Changed files: {files}.`,strings:`Strings: {count}`,one:`Extract this string`,existing:`Reuses an existing key`,new:`Creates a new key`,file:`Extract this file`,differs:`Its source message differs from this string; extraction keeps the existing messages.`},project:{presets:`Presets`,finders:`Locale finders`,resources:`Resources: {count}`,formats:`Formats`,scanners:`Scanners`,files:`Files: {count}`,problems:`Problems`,conflict:`.{extension}: {winner} wins over {loser}`,config:`Config and where each value comes from`,showAllPresets:`Show all presets`,plugins:`Plugins`,none:`Nothing found`,duplicates:`Skipped duplicate resources: {count}`,skipped:`Skipped presets and plugins`,rawConfig:`Raw config`},history:{title:`History`,local:`changed locally`,outdated:`outdated`,outdatedHint:`The source message changed after this translation`,sourceThen:`Source then`,sourceNow:`Source now`,more:`and {count} more`,locales:`{count} locales`},sidebar:{list:`List view`,tree:`Tree view`,filter:`Filter keys`,view:`Key list view`},review:{add:`Review`,type:`Review type`,textPlaceholder:`Comment`,suggestionPlaceholder:`Suggested value`,send:`Send`,resolve:`Resolve`,apply:`Apply`,resolved:`resolved`,stale:`changed since`,unknownAuthor:`Someone`,empty:`No reviews to show.`,off:`Reviews are off for this project.`,all:`All ({count})`,showResolved:`Show resolved`,states:{changesRequested:`Changes requested`,approved:`Approved`,staleApproval:`Approved, changed since`,suggested:`Suggestion`,commented:`Comments`},types:{comment:`Comment`,approve:`Approve`,requestChange:`Request change`,suggestion:`Suggest`},done:{comment:`commented`,approve:`approved`,requestChange:`requested a change`,suggestion:`suggested a value`},hint:`Enter to send · Shift+Enter for a new line · Esc to cancel`,resolvedCount:`{count} resolved`,hideResolved:`Hide resolved`}};function K(e,t=``,n=new Map){for(let[r,i]of Object.entries(e))typeof i==`string`?n.set(`${t}${r}`,i):K(i,`${t}${r}.`,n);return n}var De=[`en`,`zh-Hans`,`zh-Hant`,`ja`,`ko`,`de`,`fr`,`es`,`pt-BR`,`ru`],Oe=Object.assign({"./locales/de.json":()=>b(()=>import(`./DG8ByoxA.js`).then(e=>e.default),[],import.meta.url),"./locales/es.json":()=>b(()=>import(`./CeO45pG4.js`).then(e=>e.default),[],import.meta.url),"./locales/fr.json":()=>b(()=>import(`./D0euMYu_.js`).then(e=>e.default),[],import.meta.url),"./locales/ja.json":()=>b(()=>import(`./COLXubwN.js`).then(e=>e.default),[],import.meta.url),"./locales/ko.json":()=>b(()=>import(`./DmrYWbap.js`).then(e=>e.default),[],import.meta.url),"./locales/pt-BR.json":()=>b(()=>import(`./2EfS_HwS.js`).then(e=>e.default),[],import.meta.url),"./locales/ru.json":()=>b(()=>import(`./DAg5vorC.js`).then(e=>e.default),[],import.meta.url),"./locales/zh-Hans.json":()=>b(()=>import(`./DJeY8XBB.js`).then(e=>e.default),[],import.meta.url),"./locales/zh-Hant.json":()=>b(()=>import(`./DFEXkmyM.js`).then(e=>e.default),[],import.meta.url)}),q=K(Ee),ke=`x18n:lang`,J=r(`en`),Ae=m(q);function je(e){let t;try{t=new Intl.Locale(e).maximize()}catch{return}return t.language===`zh`?t.script===`Hant`?`zh-Hant`:`zh-Hans`:t.language===`pt`?`pt-BR`:De.find(e=>e===t.language)}function Me(e){return new Intl.DisplayNames([e],{type:`language`}).of(e)??e}function Ne(){J.value=[new URLSearchParams(location.search).get(`lang`),localStorage.getItem(ke),...navigator.languages].map(e=>e?je(e):void 0).find(e=>e!==void 0)??`en`,i(async()=>{let e=J.value;document.documentElement.lang=e;let t=e===`en`?void 0:await Oe[`./locales/${e}.json`]?.();e===J.value&&(Ae.value=t?K(t):q)})}function Pe(e){J.value=e,localStorage.setItem(ke,e)}function Fe(e,t={}){return(Ae.value.get(e)??q.get(e)??e).replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:typeof r==`number`?r.toLocaleString(J.value):r})}function Ie(e){return(e/100).toLocaleString(J.value,{style:`percent`,maximumFractionDigits:1})}function Le(e){try{return new Intl.DisplayNames([J.value],{type:`language`}).of(e)}catch{return}}var Re=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function ze(e){let t=e-Date.now(),[n,r]=Re.find(([,e])=>Math.abs(t)>=e)??[`second`,1e3];return new Intl.RelativeTimeFormat(J.value,{numeric:`auto`}).format(Math.round(t/r),n)}var Be=m(),Ve=m(),Y=r(),He=r(0),Ue=m([]),We=p(()=>Ve.value?.projects.find(e=>e.name===Y.value)),X=L(`x18n:locale-order`,{}),Z=p(()=>{let e=We.value;if(!e)return[];let t=[...e.locales.filter(t=>t.code===e.sourceLocale),...e.locales.filter(t=>t.code!==e.sourceLocale)],n=X.value[e.name]??[],r=e=>{let t=n.indexOf(e);return t===-1?n.length:t};return t.map((e,t)=>({locale:e,i:t})).sort((e,t)=>r(e.locale.code)-r(t.locale.code)||e.i-t.i).map(({locale:e})=>e)}),Ge=p(()=>!!X.value[Y.value??``]);function Ke(e,t){let n=Y.value;if(!n)return;let r=Z.value.map(e=>e.code).filter(t=>t!==e);r.splice(Math.max(0,Math.min(t,r.length)),0,e),X.value={...X.value,[n]:r}}function qe(){let{[Y.value??``]:e,...t}=X.value;X.value=t}var Q=L(`x18n:hidden-locales`,{}),$=p(()=>new Set(Q.value[Y.value??``]??[])),Je=p(()=>Z.value.filter(e=>!$.value.has(e.code)));function Ye(e){return!$.value.has(e)}function Xe(e){let t=Y.value;if(!t)return;let n=new Set($.value);n.delete(e)||n.add(e),Q.value={...Q.value,[t]:[...n]}}function Ze(){let{[Y.value??``]:e,...t}=Q.value;Q.value=t}function Qe(e){let t=m(),n=0;return i(()=>{let r=Be.value,i=Y.value;if(He.value,!r||!i)return;let a=++n;e(r,i).then(e=>{a===n&&(t.value=e)})}),t}export{J as C,be as D,L as E,b as O,Fe as S,le as T,ze as _,Z as a,Pe as b,Y as c,He as d,Ze as f,Me as g,Je as h,Ye as i,Ue as l,Qe as m,We as n,Ke as o,Xe as p,Ge as r,Ve as s,Be as t,qe as u,Ie as v,De as w,Ne as x,Le as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,Ct as t,E as n,Et as r,H as i,M as a,P as o,Q as s,R as c,T as l,Tt as u,U as d,_ as f,c as p,d as m,h,it as g,j as _,l as v,m as y,r as b,s as x,u as S,w as C,wt as w,y as T,z as E}from"./B4prFwj0.js";import{c as D,o as O,s as k}from"./DoHg1T7s.js";import{u as A}from"./BbIaocwP.js";import{D as ee,E as te,S as j,a as M,c as N,f as P,h as F,m as I,n as L,t as R}from"./B-DdkvQu.js";import{a as z,n as B}from"#entry";import{t as V}from"./BbXhWA6A.js";import{n as ne,r as H}from"./CaGk4C9N.js";import{t as U}from"./DAUGp_mK.js";import{t as W}from"./D4MpZjss.js";import{t as G}from"./DQNu8teu.js";import{t as re}from"./BNUykbYB.js";import{t as ie}from"./C7dnh697.js";import{t as ae}from"./ExT4dgIR.js";import{a as K,i as q,n as J,o as oe,r as Y,t as X}from"./BiTAHOW7.js";import{t as se}from"./COw7EUr6.js";function Z(e){return[...e.matchAll(/[^.:]+/g)].map(t=>({id:e.slice(0,t.index+t[0].length),label:t[0]}))}function ce(e,t,n=!1){let r=new Map;for(let t of e){let e=r,n;for(let{id:r,label:i}of Z(t))n=e.get(i)??{id:r,label:i,key:void 0,children:new Map},e.set(i,n),e=n.children;n&&(n.key=t)}let i=[],a=(e,r)=>{for(let o of[...e.values()].sort((e,t)=>e.label.localeCompare(t.label))){let e=o.children.size>0,s=n||t.has(o.id);i.push({id:o.id,label:o.label,depth:r,key:o.key,branch:e,open:e&&s}),e&&s&&a(o.children,r+1)}};return a(r,0),i}function le(e){return Z(e).slice(0,-1).map(e=>e.id)}var ue={class:`min-h-0 flex flex-auto flex-col`},de={class:`flex items-center gap-2 border-b border-base px-3 py-2`},fe={class:`label`},pe={class:`font-mono text-xs color-faint tabular-nums`},me=[`aria-label`],he=[`aria-pressed`,`title`,`aria-label`],ge=[`aria-pressed`,`title`,`aria-label`],_e={class:`border-b border-base px-3 py-2`},ve=[`placeholder`,`aria-label`],ye=[`aria-expanded`,`aria-label`,`onClick`],be={key:1,class:`size-4 shrink-0`},xe=[`onClick`],Q=28,Se=f({__name:`KeySidebar`,setup(c){let f=A(),h=x(()=>String(f.params.key)),_=I((e,t)=>e.keys(t)),C=te(`x18n:key-view`,`tree`),E=s(``),D=s(new Set);e(h,e=>{D.value=new Set([...D.value,...le(e)])},{immediate:!0});let k=x(()=>_.value?.rows.map(e=>e.key)??[]),M=x(()=>{let e=E.value.trim();return e?k.value.map(t=>({key:t,score:ae(e,t)})).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.key):k.value}),N=x(()=>C.value===`tree`?ce(M.value,D.value,E.value.trim()!==``):M.value.map(e=>({id:e,label:e,depth:0,key:e,branch:!1,open:!1}))),{list:P,containerProps:F,wrapperProps:L}=ee(N,{itemHeight:Q,overscan:10});function R(e){let t=new Set(D.value);t.delete(e.id)||t.add(e.id),D.value=t}async function B(){await n();let e=F.ref.value,t=N.value.findIndex(e=>e.key===h.value);if(!e||t<0)return;let r=t*Q;(r<e.scrollTop||r+Q>e.scrollTop+e.clientHeight)&&(e.scrollTop=Math.max(0,r-e.clientHeight/2))}return e([h,C,()=>_.value?.rows.length],B,{flush:`post`}),(e,n)=>(a(),m(`div`,ue,[p(`div`,de,[p(`span`,fe,r(g(j)(`nav.keys`)),1),p(`span`,pe,r(k.value.length),1),n[5]||=p(`span`,{class:`flex-auto`},null,-1),p(`div`,{class:`flex`,role:`group`,"aria-label":g(j)(`sidebar.view`)},[p(`button`,{type:`button`,class:t([`btn-icon h-6 w-6 text-sm`,g(C)===`list`&&`bg-hover color-base`]),"aria-pressed":g(C)===`list`,title:g(j)(`sidebar.list`),"aria-label":g(j)(`sidebar.list`),onClick:n[0]||=e=>C.value=`list`},[...n[3]||=[p(`span`,{class:`i-ph-list-bullets-duotone`},null,-1)]],10,he),p(`button`,{type:`button`,class:t([`btn-icon h-6 w-6 text-sm`,g(C)===`tree`&&`bg-hover color-base`]),"aria-pressed":g(C)===`tree`,title:g(j)(`sidebar.tree`),"aria-label":g(j)(`sidebar.tree`),onClick:n[1]||=e=>C.value=`tree`},[...n[4]||=[p(`span`,{class:`i-ph-tree-structure-duotone`},null,-1)]],10,ge)],8,me)]),p(`div`,_e,[d(p(`input`,{"onUpdate:modelValue":n[2]||=e=>E.value=e,class:`input h-7 w-full font-mono text-xs`,type:`search`,placeholder:g(j)(`sidebar.filter`),"aria-label":g(j)(`sidebar.filter`)},null,8,ve),[[O,E.value]])]),p(`div`,l(g(F),{class:`min-h-0 flex-auto`}),[p(`div`,w(T(g(L))),[(a(!0),m(b,null,o(g(P),({data:e})=>(a(),m(`div`,{key:e.id,class:t([`h-7 flex items-center pr-2 font-mono text-xs transition-colors hover:bg-hover`,e.key===h.value?`bg-hover color-base shadow-[inset_2px_0_var(--x-fg)]`:`color-muted`]),style:u({paddingLeft:`${8+e.depth*12}px`})},[g(C)===`tree`?(a(),m(b,{key:0},[e.branch?(a(),m(`button`,{key:0,type:`button`,class:`focus-ring size-4 flex shrink-0 items-center justify-center`,"aria-expanded":e.open,"aria-label":e.label,onClick:t=>R(e)},[p(`span`,{class:t([`i-ph-caret-right-duotone transition-transform`,e.open&&`rotate-90`])},null,2)],8,ye)):(a(),m(`span`,be))],64)):S(``,!0),e.key?(a(),v(g(z),{key:1,to:`/keys/${encodeURIComponent(e.key)}`,class:`focus-ring ml-1 min-w-0 flex-auto truncate`,"aria-current":e.key===h.value?`page`:void 0,title:e.key},{default:i(()=>[y(r(e.label),1)]),_:2},1032,[`to`,`aria-current`,`title`])):(a(),m(`button`,{key:2,type:`button`,class:`focus-ring ml-1 min-w-0 flex-auto truncate text-left`,onClick:t=>R(e)},r(e.label),9,xe))],6))),128))],16)],16)]))}}),Ce=[`aria-label`],we=[`aria-label`],Te={key:0,class:`flex items-center gap-2 border-t border-base px-3 py-1.5 text-xs color-warn`,role:`alert`},Ee={class:`flex-auto`},De={class:`flex items-center gap-2 border-t border-base py-1 pl-3 pr-1`},Oe={class:`flex-auto font-mono text-[11px] color-faint`},ke=f({__name:`MessageEditor`,props:C({label:{},problem:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:C([`save`,`cancel`],[`update:modelValue`]),setup(e,{emit:t}){let n=t,i=c(e,`modelValue`),o=E(`field`);return _(()=>{let e=o.value;e.focus(),e.setSelectionRange(e.value.length,e.value.length)}),(t,s)=>(a(),m(`div`,{class:`border border-inverse bg-base`,role:`group`,"aria-label":e.label},[d(p(`textarea`,{ref_key:`field`,ref:o,"onUpdate:modelValue":s[0]||=e=>i.value=e,class:`block min-h-16 w-full resize-none bg-transparent px-3 py-2 font-mono text-sm outline-none [field-sizing:content]`,rows:`2`,"aria-label":e.label,onKeydown:[s[1]||=k(D(e=>n(`save`,!1),[`exact`,`prevent`]),[`enter`]),s[2]||=k(D(e=>n(`cancel`),[`prevent`]),[`escape`])]},null,40,we),[[O,i.value]]),e.problem?(a(),m(`div`,Te,[s[6]||=p(`span`,{class:`i-ph-warning-duotone shrink-0`},null,-1),p(`span`,Ee,r(e.problem),1),p(`button`,{class:`btn-outline h-7`,onClick:s[3]||=e=>n(`save`,!0)},r(g(j)(`edit.saveAnyway`)),1)])):S(``,!0),p(`div`,De,[p(`span`,Oe,r(g(j)(`edit.hint`)),1),p(`button`,{class:`btn-ghost h-7`,onClick:s[4]||=e=>n(`cancel`)},[s[7]||=p(`span`,{class:`i-ph-x`},null,-1),y(` `+r(g(j)(`edit.cancel`)),1)]),p(`button`,{class:`btn-solid h-7`,onClick:s[5]||=e=>n(`save`,!1)},[s[8]||=p(`span`,{class:`i-ph-check`},null,-1),y(` `+r(g(j)(`edit.save`)),1)])])],8,Ce))}}),Ae=[`aria-label`],je=[`aria-label`],Me=[`aria-selected`,`onClick`],Ne=[`placeholder`,`aria-label`,`onKeydown`],Pe=[`placeholder`,`aria-label`,`onKeydown`],Fe={class:`flex items-center gap-2 border-t border-base py-1 pl-3 pr-1`},Ie={class:`flex-auto font-mono text-[11px] color-faint`},Le=[`disabled`],Re=f({__name:`ReviewComposer`,props:{reviewKey:{},locale:{},current:{type:[String,Number,Boolean,null]}},emits:[`close`],setup(i,{emit:c}){let l=c,u=s(`comment`),f=s(``),h=s(i.current===void 0||i.current===null?``:String(i.current)),v=s(!1),C=E(`textField`),w=E(`valueField`),T=x(()=>!v.value&&(u.value===`suggestion`?h.value!==``&&h.value!==String(i.current??``):u.value===`approve`||f.value.trim()!==``));_(()=>C.value?.focus()),e(u,async e=>{await n(),e===`suggestion`?w.value?.select():C.value?.focus()});async function A(){if(T.value){v.value=!0;try{await q([{type:`review`,key:i.reviewKey,locale:i.locale,review:u.value,...f.value.trim()&&{text:f.value.trim()},...u.value===`suggestion`&&{suggestion:h.value}}]),l(`close`)}finally{v.value=!1}}}return(e,n)=>(a(),m(`form`,{class:`border border-inverse bg-base`,"aria-label":g(j)(`review.add`),onSubmit:D(A,[`prevent`]),onKeydown:n[3]||=k(D(e=>l(`close`),[`prevent`]),[`escape`])},[p(`div`,{class:`flex flex-wrap gap-1 border-b border-base p-1`,role:`tablist`,"aria-label":g(j)(`review.type`)},[(a(!0),m(b,null,o(g(J),e=>(a(),m(`button`,{key:e,type:`button`,role:`tab`,"aria-selected":u.value===e,class:t([`btn h-7 px-2`,u.value===e?`border-strong bg-hover color-base`:`border-transparent color-muted hover:color-base hover:bg-hover`]),onClick:t=>u.value=e},[p(`span`,{class:t([g(Y)[e].icon,u.value===e&&g(Y)[e].color])},null,2),y(` `+r(g(j)(g(Y)[e].label)),1)],10,Me))),128))],8,je),u.value===`suggestion`?d((a(),m(`input`,{key:0,ref_key:`valueField`,ref:w,"onUpdate:modelValue":n[0]||=e=>h.value=e,class:`block w-full border-b border-base bg-transparent px-3 py-2 font-mono text-sm outline-none placeholder:color-faint`,placeholder:g(j)(`review.suggestionPlaceholder`),"aria-label":g(j)(`review.suggestionPlaceholder`),onKeydown:k(D(A,[`prevent`]),[`enter`])},null,40,Ne)),[[O,h.value]]):S(``,!0),d(p(`textarea`,{ref_key:`textField`,ref:C,"onUpdate:modelValue":n[1]||=e=>f.value=e,class:`block min-h-14 w-full resize-none bg-transparent px-3 py-2 text-sm outline-none placeholder:color-faint [field-sizing:content]`,rows:`2`,placeholder:g(j)(`review.textPlaceholder`),"aria-label":g(j)(`review.textPlaceholder`),onKeydown:k(D(A,[`exact`,`prevent`]),[`enter`])},null,40,Pe),[[O,f.value]]),p(`div`,Fe,[p(`span`,Ie,r(g(j)(`review.hint`)),1),p(`button`,{type:`button`,class:`btn-ghost h-7`,onClick:n[2]||=e=>l(`close`)},[n[4]||=p(`span`,{class:`i-ph-x`},null,-1),y(` `+r(g(j)(`edit.cancel`)),1)]),p(`button`,{type:`submit`,class:`btn-solid h-7`,disabled:!T.value},[n[5]||=p(`span`,{class:`i-ph-paper-plane-tilt`},null,-1),y(` `+r(g(j)(`review.send`)),1)],8,Le)])],40,Ae))}}),ze={class:`mx-auto h-full w-full flex max-w-6xl border-x border-base xl:max-w-[90rem]`},Be={class:`hidden w-72 shrink-0 flex-col border-r border-base xl:flex`},Ve={class:`min-w-0 flex-auto of-y-auto`},He={class:`flex items-center gap-3 border-b border-base px-4 py-4`},Ue={class:`grid gap-1`},We={class:`label`},Ge={class:`break-all font-mono text-xl font-medium`},Ke={key:0,class:`badge self-end`},qe={key:0,class:`px-4 py-3 color-muted`},Je={key:0,class:`px-4 py-3 color-muted`},Ye=[`data-locale`],Xe={class:`flex flex-wrap items-center gap-2 pt-0.5 font-mono`},Ze={key:0,class:`badge`},Qe=[`title`],$e=[`title`],et=[`title`,`onDblclick`],tt={key:0,class:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 border-l-2 border-[var(--x-warn)] py-0.5 pl-3 text-xs`},$={class:`label`},nt={class:`color-muted line-through decoration-[var(--x-faint)]`},rt={class:`label`},it={class:`flex gap-1`},at=[`aria-label`,`title`,`aria-expanded`,`onClick`],ot={key:2,class:`col-span-2 col-start-2 grid gap-3 pb-1`},st={class:`font-mono text-xs color-muted`},ct={class:`flex-auto`},lt=[`onClick`],ut={key:0,class:`px-4 py-3 color-muted`},dt={class:`flex items-center gap-2`},ft={key:0,class:`badge`},pt=[`onClick`],mt=f({__name:`[key]`,setup(e){let n=A(),c=x(()=>String(n.params.key)),l=I((e,t)=>e.key(t,c.value)),u=x(()=>F.value.map(e=>({locale:e.code,message:l.value?.messages.find(t=>t.locale===e.code),thread:l.value?.reviews.find(t=>t.locale===e.code)}))),d=s(),f=x(()=>R.value?.capabilities.write===!0&&L.value?.reviews!==void 0),_=x(()=>M.value.length-F.value.length),C=x(()=>l.value?.messages.find(e=>e.locale===L.value?.sourceLocale)?.value),w=s(),T=s();async function E(e=!1){let t=w.value;if(!t)return;let n=await oe(c.value,t.locale,t.draft,e);n.applied?(w.value=void 0,T.value=void 0):T.value=n.problems.map(K).join(`; `)}function D(e,t){w.value={locale:e,draft:t==null?``:String(t)},T.value=void 0}function O(e){return e.type!==`extract`&&e.type!==`format`}function k(e){R.value?.openInEditor({project:N.value,path:e.path,line:e.line,column:e.column})}return(e,n)=>(a(),m(`div`,ze,[p(`aside`,Be,[h(Se)]),p(`div`,Ve,[p(`header`,He,[h(g(z),{to:`/keys`,class:`btn-icon`,"aria-label":g(j)(`detail.back`)},{default:i(()=>[...n[4]||=[p(`span`,{class:`i-ph-arrow-left-duotone`},null,-1)]]),_:1},8,[`aria-label`]),p(`div`,Ue,[p(`span`,We,r(g(j)(`detail.label`)),1),p(`h1`,Ge,r(c.value),1)]),g(l)?.namespace?(a(),m(`span`,Ke,r(g(l).namespace),1)):S(``,!0)]),g(l)===null?(a(),m(`p`,qe,r(g(j)(`detail.notFound`)),1)):g(l)?(a(),m(b,{key:1},[h(G,{index:`01`,title:g(j)(`detail.values`)},{default:i(()=>[u.value.length?S(``,!0):(a(),m(`p`,Je,r(g(j)(`localeBar.noneShown`)),1)),(a(!0),m(b,null,o(u.value,e=>(a(),m(`div`,{key:e.locale,class:`grid grid-cols-[7rem_1fr_auto] items-start gap-4 border-b border-base px-4 py-3 last:border-b-0`,"data-locale":e.locale},[p(`span`,Xe,[h(B,{code:e.locale},null,8,[`code`]),y(` `+r(e.locale)+` `,1),e.locale===g(L)?.sourceLocale?(a(),m(`span`,Ze,r(g(j)(`overview.source`)),1)):S(``,!0),e.message?.outdated?(a(),m(`span`,{key:1,class:`badge border-current color-warn`,title:g(j)(`history.outdatedHint`)},r(g(j)(`history.outdated`)),9,Qe)):S(``,!0),e.thread?.state?(a(),m(`span`,{key:2,class:t([`badge gap-1 border-current`,g(X)[e.thread.state].color]),title:g(j)(g(X)[e.thread.state].label)},[p(`span`,{class:t(g(X)[e.thread.state].icon)},null,2),y(r(e.thread.comments.filter(e=>!e.resolved).length),1)],10,$e)):S(``,!0)]),w.value?.locale===e.locale?(a(),v(ke,{key:0,modelValue:w.value.draft,"onUpdate:modelValue":n[0]||=e=>w.value.draft=e,label:g(j)(`keys.editValue`,{key:c.value,locale:e.locale}),problem:T.value,onSave:E,onCancel:n[1]||=e=>w.value=void 0},null,8,[`modelValue`,`label`,`problem`])):(a(),m(`div`,{key:1,class:`grid min-w-0 gap-1`,title:g(R)?.capabilities.write?g(j)(`detail.edit`):void 0,onDblclick:t=>g(R)?.capabilities.write&&D(e.locale,e.message?.value)},[h(W,{value:e.message?.value,placeholders:e.message?.placeholders??[]},null,8,[`value`,`placeholders`]),e.message?.sourceThen===void 0?S(``,!0):(a(),m(`dl`,tt,[p(`dt`,$,r(g(j)(`history.sourceThen`)),1),p(`dd`,nt,[h(W,{value:e.message.sourceThen},null,8,[`value`])]),p(`dt`,rt,r(g(j)(`history.sourceNow`)),1),p(`dd`,null,[h(W,{value:C.value},null,8,[`value`])])]))],40,et)),p(`div`,it,[f.value?(a(),m(`button`,{key:0,type:`button`,class:t([`btn-icon h-6 w-6 text-sm`,d.value===e.locale&&`bg-hover color-base`]),"aria-label":g(j)(`review.add`),title:g(j)(`review.add`),"aria-expanded":d.value===e.locale,onClick:t=>d.value=d.value===e.locale?void 0:e.locale},[...n[5]||=[p(`span`,{class:`i-ph-chat-circle-text-duotone`},null,-1)]],10,at)):S(``,!0),e.locale===g(L)?.sourceLocale?S(``,!0):(a(),v(H,{key:1,text:g(ne)([{locale:e.locale,key:c.value}]),label:g(j)(`prompt.copy`),hint:g(j)(`prompt.hint`)},null,8,[`text`,`label`,`hint`])),e.message?(a(),v(V,{key:2,icon:`i-ph-file-text-duotone`,label:g(j)(`detail.file`)},{default:i(()=>[h(U,{path:e.message.path,line:e.message.line},null,8,[`path`,`line`])]),_:2},1032,[`label`])):S(``,!0),e.message?.changed?(a(),v(V,{key:3,icon:`i-ph-clock-counter-clockwise-duotone`,label:g(j)(`history.title`)},{default:i(()=>[h(re,{change:e.message.changed},null,8,[`change`])]),_:2},1032,[`label`])):S(``,!0)]),e.thread?.comments.length||d.value===e.locale?(a(),m(`div`,ot,[e.thread?.comments.length?(a(),v(se,{key:0,thread:e.thread,current:e.message?.value},null,8,[`thread`,`current`])):S(``,!0),d.value===e.locale?(a(),v(Re,{key:1,"review-key":c.value,locale:e.locale,current:e.message?.value,onClose:n[2]||=e=>d.value=void 0},null,8,[`review-key`,`locale`,`current`])):S(``,!0)])):S(``,!0)],8,Ye))),128)),_.value?(a(),m(`button`,{key:1,class:`btn-ghost h-9 w-full justify-start px-4`,onClick:n[3]||=(...e)=>g(P)&&g(P)(...e)},[n[6]||=p(`span`,{class:`i-ph-dots-three-duotone`},null,-1),y(` `+r(g(j)(`detail.showAllLocales`))+` (`+r(_.value)+`) `,1)])):S(``,!0)]),_:1},8,[`title`]),g(l).diagnostics.length?(a(),v(G,{key:0,index:`02`,title:g(j)(`detail.diagnostics`)},{default:i(()=>[(a(!0),m(b,null,o(g(l).diagnostics,(e,n)=>(a(),m(`div`,{key:n,class:`flex items-center gap-2 border-b border-base px-4 py-2 last:border-b-0`},[p(`span`,{class:t(e.severity===`error`?`i-ph-x-circle-duotone color-error`:`i-ph-warning-duotone color-warn`)},null,2),p(`span`,st,r(e.code),1),p(`span`,ct,r(e.message),1),g(R)?.capabilities.write?(a(!0),m(b,{key:0},o(e.fixes.filter(e=>e.ops.every(O)),e=>(a(),m(`button`,{key:e.title,class:`btn-outline h-7`,onClick:t=>g(q)(e.ops.filter(O))},r(e.title),9,lt))),128)):S(``,!0)]))),128))]),_:1},8,[`title`])):S(``,!0),h(G,{index:`03`,title:g(j)(`detail.usages`,{count:g(l).usages.length})},{default:i(()=>[g(l).usages.length?S(``,!0):(a(),m(`p`,ut,r(g(j)(`detail.noUsages`)),1)),(a(!0),m(b,null,o(g(l).usages,(e,t)=>(a(),m(`div`,{key:t,class:`grid gap-2 border-b border-base px-4 py-3 last:border-b-0`},[p(`div`,dt,[h(U,{path:e.path,line:e.line,column:e.column},null,8,[`path`,`line`,`column`]),e.possible?(a(),m(`span`,ft,r(g(j)(`detail.possible`)),1)):S(``,!0),n[8]||=p(`span`,{class:`flex-auto`},null,-1),g(R)?.capabilities.openInEditor?(a(),m(`button`,{key:1,class:`btn-ghost h-7`,onClick:t=>k(e)},[n[7]||=p(`span`,{class:`i-ph-arrow-square-out-duotone`},null,-1),y(` `+r(g(j)(`detail.openInEditor`)),1)],8,pt)):S(``,!0)]),h(ie,{usage:e},null,8,[`usage`])]))),128))]),_:1},8,[`title`])],64)):S(``,!0)])]))}});export{mt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,Ct as t,E as n,Et as r,H as i,M as a,P as o,Q as s,T as ee,Tt as c,U as l,_ as te,c as u,d,h as f,it as p,l as ne,m,r as h,s as g,u as _,wt as re,y as ie,z as v}from"./B4prFwj0.js";import{a as y,o as b,s as x}from"./DoHg1T7s.js";import{d as ae,u as oe}from"./BbIaocwP.js";import{D as se,S,h as ce,m as le,n as ue,t as C}from"./B-DdkvQu.js";import{n as de}from"#entry";import{t as fe}from"./D4MpZjss.js";import{t as w}from"./ExT4dgIR.js";import{a as T,o as pe,t as E}from"./BiTAHOW7.js";import{t as me}from"./C7ReGOzp.js";import{t as D}from"./BJYSGhlR.js";var he={class:`h-full flex flex-col`},ge={class:`shrink-0 flex flex-wrap items-center gap-3 border-b border-base px-4 py-2`},_e={class:`input w-80 flex items-center gap-2 focus-within:border-inverse`},ve=[`placeholder`,`aria-label`],ye=[`aria-label`],be={value:``},xe=[`value`],Se=[`aria-label`],Ce={value:``},we=[`value`],Te={class:`font-mono text-xs color-muted tabular-nums`},Ee={key:0,class:`shrink-0 flex items-center gap-2 border-b border-base px-4 py-1.5 color-warn`,role:`alert`},De={class:`color-base`},Oe=[`aria-label`,`aria-rowcount`],ke={class:`label flex items-center px-4`,role:`columnheader`},Ae={class:`label color-base`},je={key:0,class:`badge`},Me=[`aria-rowindex`,`data-key`],Ne=[`title`,`onClick`,`onDblclick`],Pe={class:`truncate`},Fe=[`title`],Ie=[`title`],Le=[`data-locale`,`onClick`,`onDblclick`],Re=[`aria-label`],ze=[`title`],Be=[`title`],Ve=[`title`],He={key:0,class:`p-4 color-muted`},Ue={class:`shrink-0 flex gap-4 border-t border-base px-4 py-1.5 font-mono text-[11px] color-muted`},We={key:0},O=32,k=te({__name:`index`,setup(te){let k=oe(),Ge=ae(),A=le((e,t)=>e.keys(t)),j=s(``),M=s(``),N=s(typeof k.query.missing==`string`?k.query.missing:``),P=s(!1),F=s(!1),I=s(k.query.outdated!==void 0),L=s(k.query.reviewed!==void 0),Ke=g(()=>(A.value?.rows??[]).some(e=>Object.keys(e.reviews).length>0)),R=s(`key`),qe=g(()=>[{value:`key`,label:S(`keys.sortKey`)},{value:`recent`,label:S(`keys.sortRecent`)}]),Je=g(()=>(A.value?.rows??[]).some(e=>e.changedAt!==void 0)),z=g(()=>ce.value.map(e=>e.code)),B=g(()=>[...new Set((A.value?.rows??[]).flatMap(e=>e.namespace??[]))].sort()),V=g(()=>{let e=j.value.trim(),t=(A.value?.rows??[]).filter(e=>(!M.value||e.namespace===M.value)&&(!N.value||!z.value.includes(N.value)||e.missing.includes(N.value))&&(!P.value||e.unused)&&(!F.value||e.diagnostics>0)&&(!I.value||e.outdated.some(e=>z.value.includes(e)))&&(!L.value||z.value.some(t=>e.reviews[t]!==void 0)));return e?t.map(t=>{let n=Object.values(t.values).map(t=>w(e,String(t))/2);return{row:t,score:Math.max(w(e,t.key),...n)}}).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.row):R.value===`recent`?[...t].sort((e,t)=>(t.changedAt??0)-(e.changedAt??0)):t}),{list:Ye,containerProps:H,wrapperProps:Xe,scrollTo:Ze}=se(V,{itemHeight:O,overscan:12}),U=s({row:0,col:0}),W=s(),G=s(),K=v(`searchInput`),q=v(`editor`);e(V,()=>{U.value={row:Math.min(U.value.row,Math.max(V.value.length-1,0)),col:U.value.col}});let J=g(()=>z.value.length?`minmax(16rem, 1.2fr) repeat(${z.value.length}, minmax(12rem, 1fr))`:`1fr`);function Y(e,t){let n={row:Math.max(0,Math.min(V.value.length-1,e)),col:Math.max(0,Math.min(z.value.length,t))};U.value=n;let r=H.ref.value;if(r){let e=n.row*O;(e<r.scrollTop||e+64>r.scrollTop+r.clientHeight)&&Ze(n.row)}}async function X(e,t){if(!C.value?.capabilities.write)return;let r=e.values[t];W.value={key:e.key,locale:t,draft:r==null?``:String(r)},await n(),q.value?.[0]?.focus()}async function Z(e=!1){let t=W.value;if(!t)return;W.value=void 0;let n=await pe(t.key,t.locale,t.draft,e);G.value=n.applied?void 0:{key:t.key,locale:t.locale,value:t.draft,message:n.problems.map(T).join(`; `)},H.ref.value?.focus()}function Qe(){W.value=void 0,H.ref.value?.focus()}async function $e(){let e=G.value;e&&(W.value={key:e.key,locale:e.locale,draft:e.value},await Z(!0))}function Q(e){Ge.push(`/keys/${encodeURIComponent(e.key)}`)}function $(){let e=V.value[U.value.row];if(!e)return;let t=z.value[U.value.col-1];t?X(e,t):Q(e)}let et={ArrowDown:()=>Y(U.value.row+1,U.value.col),ArrowUp:()=>Y(U.value.row-1,U.value.col),ArrowRight:()=>Y(U.value.row,U.value.col+1),ArrowLeft:()=>Y(U.value.row,U.value.col-1),PageDown:()=>Y(U.value.row+20,U.value.col),PageUp:()=>Y(U.value.row-20,U.value.col),Home:()=>Y(0,U.value.col),End:()=>Y(V.value.length-1,U.value.col),Enter:$,F2:$,o:()=>V.value[U.value.row]&&Q(V.value[U.value.row]),j:()=>Y(U.value.row+1,U.value.col),k:()=>Y(U.value.row-1,U.value.col),"/":()=>K.value?.focus()};function tt(e){if(W.value||e.metaKey||e.ctrlKey||e.altKey)return;let t=et[e.key];t&&(e.preventDefault(),t())}function nt(e){e.stopPropagation(),e.key===`Escape`?(e.preventDefault(),Qe()):(e.key===`Enter`||e.key===`Tab`)&&(e.preventDefault(),Z().then(()=>{e.key===`Tab`&&Y(U.value.row,U.value.col+1)}))}return(e,n)=>(a(),d(`div`,he,[u(`div`,ge,[u(`label`,_e,[n[13]||=u(`span`,{class:`i-ph-magnifying-glass-duotone color-faint`},null,-1),l(u(`input`,{ref_key:`searchInput`,ref:K,"onUpdate:modelValue":n[0]||=e=>j.value=e,class:`flex-auto bg-transparent outline-none`,placeholder:p(S)(`keys.search`),"aria-label":p(S)(`keys.search`),onKeydown:[n[1]||=x(e=>p(H).ref.value?.focus(),[`escape`]),n[2]||=x(e=>p(H).ref.value?.focus(),[`enter`])]},null,40,ve),[[b,j.value]]),n[14]||=u(`kbd`,{class:`badge`},`/`,-1)]),B.value.length?l((a(),d(`select`,{key:0,"onUpdate:modelValue":n[3]||=e=>M.value=e,class:`input text-xs`,"aria-label":p(S)(`keys.namespace`)},[u(`option`,be,r(p(S)(`keys.allNamespaces`)),1),(a(!0),d(h,null,o(B.value,e=>(a(),d(`option`,{key:e,value:e},r(e),9,xe))),128))],8,ye)),[[y,M.value]]):_(``,!0),l(u(`select`,{"onUpdate:modelValue":n[4]||=e=>N.value=e,class:`input text-xs`,"aria-label":p(S)(`keys.missingIn`)},[u(`option`,Ce,r(p(S)(`keys.anyLocale`)),1),(a(!0),d(h,null,o(z.value,e=>(a(),d(`option`,{key:e,value:e},r(p(S)(`keys.missingInLocale`,{locale:e})),9,we))),128))],8,Se),[[y,N.value]]),f(D,{modelValue:P.value,"onUpdate:modelValue":n[5]||=e=>P.value=e},{default:i(()=>[m(r(p(S)(`keys.unused`)),1)]),_:1},8,[`modelValue`]),f(D,{modelValue:F.value,"onUpdate:modelValue":n[6]||=e=>F.value=e},{default:i(()=>[m(r(p(S)(`keys.withDiagnostics`)),1)]),_:1},8,[`modelValue`]),Ke.value?(a(),ne(D,{key:1,modelValue:L.value,"onUpdate:modelValue":n[7]||=e=>L.value=e},{default:i(()=>[m(r(p(S)(`keys.reviewed`)),1)]),_:1},8,[`modelValue`])):_(``,!0),Je.value?(a(),d(h,{key:2},[f(D,{modelValue:I.value,"onUpdate:modelValue":n[8]||=e=>I.value=e},{default:i(()=>[m(r(p(S)(`keys.outdated`)),1)]),_:1},8,[`modelValue`]),f(me,{modelValue:R.value,"onUpdate:modelValue":n[9]||=e=>R.value=e,options:qe.value,label:p(S)(`keys.sort`)},null,8,[`modelValue`,`options`,`label`])],64)):_(``,!0),n[15]||=u(`div`,{class:`flex-auto`},null,-1),u(`span`,Te,r(p(S)(`keys.count`,{shown:V.value.length,total:p(A)?.rows.length??0})),1)]),G.value?(a(),d(`div`,Ee,[n[16]||=u(`span`,{class:`i-ph-warning-duotone`},null,-1),u(`span`,De,r(p(S)(`edit.rejected`,{key:G.value.key,locale:G.value.locale,message:G.value.message})),1),u(`button`,{class:`btn-outline h-7`,onClick:$e},r(p(S)(`edit.saveAnyway`)),1),u(`button`,{class:`btn-ghost h-7`,onClick:n[10]||=e=>G.value=void 0},r(p(S)(`edit.dismiss`)),1)])):_(``,!0),u(`div`,ee(p(H),{class:`flex-auto min-h-0 of-auto outline-none`,tabindex:`0`,role:`grid`,"aria-label":p(S)(`keys.grid`),"aria-rowcount":V.value.length,onKeydown:tt}),[u(`div`,{class:`sticky top-0 z-20 grid border-b border-strong bg-base`,style:c({gridTemplateColumns:J.value,height:`${O}px`}),role:`row`},[u(`div`,ke,r(p(S)(`keys.key`)),1),(a(!0),d(h,null,o(z.value,e=>(a(),d(`div`,{key:e,class:`flex items-center gap-2 border-l border-base px-3`,role:`columnheader`},[f(de,{code:e},null,8,[`code`]),u(`span`,Ae,r(e),1),e===p(ue)?.sourceLocale?(a(),d(`span`,je,r(p(S)(`overview.source`)),1)):_(``,!0)]))),128))],4),u(`div`,re(ie(p(Xe))),[(a(!0),d(h,null,o(p(Ye),({data:e,index:i})=>(a(),d(`div`,{key:e.key,class:t([`grid border-b border-base`,i===U.value.row?`bg-hover`:``]),style:c({gridTemplateColumns:J.value,height:`${O}px`}),role:`row`,"aria-rowindex":i+1,"data-key":e.key},[u(`div`,{class:t([`flex min-w-0 cursor-pointer items-center gap-1.5 px-4 font-mono text-xs`,i===U.value.row&&U.value.col===0?`outline outline-1 outline-[var(--x-fg)] -outline-offset-1`:``]),role:`gridcell`,title:e.key,onClick:e=>Y(i,0),onDblclick:t=>Q(e)},[u(`span`,Pe,r(e.key),1),e.unused?(a(),d(`span`,{key:0,class:`i-ph-ghost-duotone shrink-0 color-faint`,title:p(S)(`keys.unusedHint`)},null,8,Fe)):_(``,!0),e.diagnostics?(a(),d(`span`,{key:1,class:`badge shrink-0 border-current color-error`,title:p(S)(`keys.diagnosticsHint`)},r(e.diagnostics),9,Ie)):_(``,!0)],42,Ne),(a(!0),d(h,null,o(z.value,(r,o)=>(a(),d(`div`,{key:r,class:t([`flex min-w-0 items-center border-l border-base px-3`,i===U.value.row&&U.value.col===o+1?`outline outline-1 outline-[var(--x-fg)] -outline-offset-1`:``]),role:`gridcell`,"data-locale":r,onClick:e=>Y(i,o+1),onDblclick:t=>X(e,r)},[W.value&&W.value.key===e.key&&W.value.locale===r?l((a(),d(`input`,{key:0,ref_for:!0,ref_key:`editor`,ref:q,"onUpdate:modelValue":n[11]||=e=>W.value.draft=e,class:`w-full bg-transparent outline-none`,"aria-label":p(S)(`keys.editValue`,{key:e.key,locale:r}),onKeydown:nt,onBlur:n[12]||=e=>Z()},null,40,Re)),[[b,W.value.draft]]):(a(),d(h,{key:1},[u(`span`,{class:`truncate`,title:String(e.values[r]??``)},[f(fe,{value:e.values[r],inline:``},null,8,[`value`])],8,ze),e.reviews[r]?(a(),d(`span`,{key:0,class:t([`ml-auto shrink-0 pl-2`,p(E)[e.reviews[r]].color]),title:p(S)(p(E)[e.reviews[r]].label)},[u(`span`,{class:t([`block`,p(E)[e.reviews[r]].icon])},null,2)],10,Be)):_(``,!0),e.outdated.includes(r)?(a(),d(`span`,{key:1,class:t([`shrink-0 pl-2 color-warn`,e.reviews[r]?``:`ml-auto`]),title:p(S)(`history.outdatedHint`)},[...n[17]||=[u(`span`,{class:`i-ph-clock-counter-clockwise-duotone block`},null,-1)]],10,Ve)):_(``,!0)],64))],42,Le))),128))],14,Me))),128))],16),p(A)&&!V.value.length?(a(),d(`p`,He,r(p(S)(`keys.empty`)),1)):_(``,!0)],16,Oe),u(`div`,Ue,[u(`span`,null,r(p(S)(`keys.helpMove`)),1),p(C)?.capabilities.write?(a(),d(`span`,We,r(p(S)(`keys.helpEdit`)),1)):_(``,!0),u(`span`,null,r(p(S)(`keys.helpOpen`)),1),u(`span`,null,r(p(S)(`keys.helpSearch`)),1)])]))}});export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ct as e,F as t,M as n,R as r,U as i,_ as a,c as o,d as s}from"./B4prFwj0.js";import{i as c}from"./DoHg1T7s.js";var l={class:`inline-flex cursor-pointer items-center gap-2 text-xs select-none`},u=a({__name:`UiToggle`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(a){let u=r(a,`modelValue`);return(r,a)=>(n(),s(`label`,l,[i(o(`input`,{"onUpdate:modelValue":a[0]||=e=>u.value=e,type:`checkbox`,class:`peer sr-only`},null,512),[[c,u.value]]),o(`span`,{class:e([`relative h-4 w-7 border transition-colors peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-[var(--x-fg)]`,u.value?`border-inverse bg-inverse`:`border-strong bg-base`])},[o(`span`,{class:e([`absolute top-[2px] size-[10px] transition-all`,u.value?`left-[14px] bg-base`:`left-[2px] bg-inverse`])},null,2)],2),t(r.$slots,`default`)]))}});export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Et as e,M as t,_ as n,c as r,d as i,it as a,u as o}from"./B4prFwj0.js";import{C as s,S as c,_ as l}from"./
|
|
1
|
+
import{Et as e,M as t,_ as n,c as r,d as i,it as a,u as o}from"./B4prFwj0.js";import{C as s,S as c,_ as l}from"./B-DdkvQu.js";var u={class:`inline-flex min-w-0 items-center gap-1.5 text-xs color-muted`},d={key:0},f=[`datetime`,`title`],p=[`title`],m={key:3,class:`truncate`},h=n({__name:`ChangeInfo`,props:{change:{}},setup(n){return(h,g)=>(t(),i(`span`,u,[g[0]||=r(`span`,{class:`i-ph-clock-counter-clockwise-duotone shrink-0`},null,-1),n.change.at===null?(t(),i(`span`,d,e(a(c)(`history.local`)),1)):(t(),i(`time`,{key:1,datetime:new Date(n.change.at).toISOString(),title:new Date(n.change.at).toLocaleString(a(s))},e(a(l)(n.change.at)),9,f)),n.change.revision?(t(),i(`code`,{key:2,class:`font-mono`,title:n.change.revision},e(n.change.revision.slice(0,7)),9,p)):o(``,!0),n.change.author?(t(),i(`span`,m,e(n.change.author),1)):o(``,!0)]))}});export{h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,Ct as t,F as n,M as r,Q as i,_ as a,c as o,d as s,u as c,z as l}from"./B4prFwj0.js";import{s as u}from"./DoHg1T7s.js";import{T as d}from"./
|
|
1
|
+
import{B as e,Ct as t,F as n,M as r,Q as i,_ as a,c as o,d as s,u as c,z as l}from"./B4prFwj0.js";import{s as u}from"./DoHg1T7s.js";import{T as d}from"./B-DdkvQu.js";var f=[`aria-label`,`aria-expanded`],p={class:`border border-strong bg-base p-2 shadow-lg`},m=a({__name:`InfoPop`,props:{icon:{},label:{},align:{default:`right`},pinnable:{type:Boolean,default:!0}},emits:[`show`,`click`],setup(a,{emit:m}){let h=m,g=l(`root`),_=i(!1),v=i(!1);d(g,()=>v.value=!1),e(()=>_.value||v.value,e=>{e&&h(`show`)});function y(){a.pinnable?v.value=!v.value:h(`click`)}return(e,i)=>(r(),s(`span`,{ref_key:`root`,ref:g,class:`relative inline-flex`,onMouseenter:i[2]||=e=>_.value=!0,onMouseleave:i[3]||=e=>_.value=!1,onKeydown:i[4]||=u(e=>v.value=!1,[`escape`])},[n(e.$slots,`trigger`,{},()=>[o(`button`,{type:`button`,class:t([`btn-icon h-6 w-6 text-sm`,v.value&&`bg-hover color-base`]),"aria-label":a.label,"aria-expanded":_.value||v.value,onClick:y,onFocus:i[0]||=e=>_.value=!0,onBlur:i[1]||=e=>_.value=!1},[o(`span`,{class:t(a.icon)},null,2)],42,f)]),_.value||v.value?(r(),s(`div`,{key:0,class:t([`absolute top-full z-10 w-max max-w-96 pt-1`,a.align===`left`?`left-0`:`right-0`]),role:`tooltip`},[o(`div`,p,[n(e.$slots,`default`)])],2)):c(``,!0)],544))}});export{m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,c as t,t as n}from"./B-DdkvQu.js";function r(e,r=!1){return n.value.apply({project:t.value,ops:e,force:r})}function i(e,t,n,i=!1){return r([{type:`set`,key:e,locale:t,value:n}],i)}function a(t){return[t.missing.length?e(`edit.placeholdersMissing`,{names:t.missing.join(`, `)}):``,t.extra.length?e(`edit.placeholdersExtra`,{names:t.extra.join(`, `)}):``].filter(Boolean).join(`; `)}var o={"changes-requested":{label:`review.states.changesRequested`,icon:`i-ph-note-pencil-duotone`,color:`color-warn`},approved:{label:`review.states.approved`,icon:`i-ph-check-circle-duotone`,color:`color-ok`},"stale-approval":{label:`review.states.staleApproval`,icon:`i-ph-clock-counter-clockwise-duotone`,color:`color-warn`},suggested:{label:`review.states.suggested`,icon:`i-ph-lightbulb-duotone`,color:`color-info`},commented:{label:`review.states.commented`,icon:`i-ph-chat-circle-text-duotone`,color:`color-muted`}},s={comment:{label:`review.types.comment`,done:`review.done.comment`,icon:`i-ph-chat-circle-text-duotone`,color:`color-muted`},approve:{label:`review.types.approve`,done:`review.done.approve`,icon:`i-ph-check-circle-duotone`,color:`color-ok`},"request-change":{label:`review.types.requestChange`,done:`review.done.requestChange`,icon:`i-ph-note-pencil-duotone`,color:`color-warn`},suggestion:{label:`review.types.suggestion`,done:`review.done.suggestion`,icon:`i-ph-lightbulb-duotone`,color:`color-info`}},c=[`comment`,`approve`,`request-change`,`suggestion`];export{a,r as i,c as n,i as o,s as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ct as e,Et as t,H as n,L as ee,M as r,P as i,Tt as a,_ as te,c as o,d as s,h as c,it as l,l as u,m as d,r as f,s as p,u as m}from"./B4prFwj0.js";import{u as ne}from"./BbIaocwP.js";import{S as h,i as re,m as g,n as _,p as ie,v as ae,y as oe}from"./
|
|
1
|
+
import{Ct as e,Et as t,H as n,L as ee,M as r,P as i,Tt as a,_ as te,c as o,d as s,h as c,it as l,l as u,m as d,r as f,s as p,u as m}from"./B4prFwj0.js";import{u as ne}from"./BbIaocwP.js";import{S as h,i as re,m as g,n as _,p as ie,v as ae,y as oe}from"./B-DdkvQu.js";import{a as v,n as y}from"#entry";import{n as b,r as se}from"./CaGk4C9N.js";import{t as ce}from"./ztSLDBsK.js";import{t as x}from"./D4MpZjss.js";import{t as S}from"./DQNu8teu.js";var le={class:`grid gap-4 border-b border-base px-4 py-5`},C={class:`flex items-end gap-3`},w={class:`grid gap-1`},T={class:`label`},E={class:`flex items-center gap-3 font-mono text-2xl font-medium`},D={key:0,class:`pb-1 color-muted`},O={key:1,class:`badge mb-1.5`},k={key:0,class:`grid gap-1.5`},A={class:`h-2 flex border border-strong`},j={class:`font-mono text-xs color-muted tabular-nums`},M={key:1,class:`color-muted`},N={class:`truncate font-mono text-xs`},P={class:`truncate color-muted`},F={class:`truncate font-mono text-xs`},I={class:`truncate color-muted`},L={class:`flex min-w-0 items-center gap-2 font-mono text-xs`},ue={class:`truncate`},R={class:`truncate`},z={class:`truncate color-muted`},B={class:`font-mono text-xs color-muted`},V={key:0,class:`font-mono text-xs`},H={class:`flex-auto truncate`},U={key:4,class:`flex items-center gap-2 px-4 py-3 color-ok`},W=te({__name:`[locale]`,setup(te){let W=ne(),G=p(()=>String(W.params.locale)),K=p(()=>_.value?.locales.find(e=>e.code===G.value)),q=p(()=>G.value===_.value?.sourceLocale),J=g((e,t)=>e.keys(t)),de=g((e,t)=>e.analysis(t)),Y=p(()=>(J.value?.rows??[]).filter(e=>e.missing.includes(G.value)&&e.values[G.value]===void 0)),X=p(()=>(J.value?.rows??[]).filter(e=>e.missing.includes(G.value)&&e.values[G.value]!==void 0)),Z=p(()=>(J.value?.rows??[]).filter(e=>e.outdated.includes(G.value))),Q=p(()=>K.value&&K.value.total?K.value.outdated/K.value.total*100:0),$=p(()=>(de.value?.diagnostics??[]).filter(e=>e.locale===G.value&&(e.code===`placeholder-mismatch`||e.code===`invalid-syntax`)));function fe(){re(G.value)||ie(G.value)}return(te,p)=>(r(),u(ce,null,{default:n(()=>[o(`header`,le,[o(`div`,C,[o(`div`,w,[o(`span`,T,t(l(h)(`locale.label`)),1),o(`h1`,E,[c(y,{code:G.value},null,8,[`code`]),d(` `+t(G.value),1)])]),K.value?(r(),s(`span`,D,t(l(oe)(G.value)??K.value.displayName),1)):m(``,!0),q.value?(r(),s(`span`,O,t(l(h)(`overview.source`)),1)):m(``,!0),p[1]||=o(`span`,{class:`flex-auto`},null,-1),c(l(v),{to:{path:`/keys`,query:{missing:G.value}},class:`btn-outline`,onClick:fe},{default:n(()=>[p[0]||=o(`span`,{class:`i-ph-table-duotone`},null,-1),d(` `+t(l(h)(`locale.openInGrid`)),1)]),_:1},8,[`to`]),q.value?m(``,!0):(r(),u(se,{key:2,text:l(b)([{locale:G.value,stale:Z.value.length>0}]),label:Z.value.length?l(h)(`prompt.copyStale`):l(h)(`prompt.copy`),hint:Z.value.length?l(h)(`prompt.staleHint`):l(h)(`prompt.hint`)},null,8,[`text`,`label`,`hint`]))]),K.value?(r(),s(`div`,k,[o(`span`,A,[o(`span`,{class:`h-full bg-inverse`,style:a({width:`${Math.max(0,K.value.percent-Q.value)}%`})},null,4),o(`span`,{class:`h-full bg-[var(--x-warn)]`,style:a({width:`${Q.value}%`})},null,4)]),o(`span`,j,t(l(h)(`locale.progress`,{translated:K.value.translated,total:K.value.total,percent:l(ae)(K.value.percent)})),1)])):l(_)?(r(),s(`p`,M,t(l(h)(`locale.notFound`)),1)):m(``,!0)]),Y.value.length?(r(),u(S,{key:0,index:`01`,title:l(h)(`locale.missing`,{count:Y.value.length})},{default:n(()=>[(r(!0),s(f,null,i(Y.value,e=>(r(),u(l(v),{key:e.key,to:`/keys/${encodeURIComponent(e.key)}`,class:`focus-ring grid grid-cols-[minmax(0,20rem)_1fr] items-baseline gap-4 border-b border-base px-4 py-1.5 transition-colors last:border-b-0 hover:bg-hover`},{default:n(()=>[o(`span`,N,t(e.key),1),o(`span`,P,[c(x,{value:e.values[l(_)?.sourceLocale??``],inline:``},null,8,[`value`])])]),_:2},1032,[`to`]))),128))]),_:1},8,[`title`])):m(``,!0),X.value.length?(r(),u(S,{key:1,index:`02`,title:l(h)(`locale.empty`,{count:X.value.length})},{default:n(()=>[(r(!0),s(f,null,i(X.value,e=>(r(),u(l(v),{key:e.key,to:`/keys/${encodeURIComponent(e.key)}`,class:`focus-ring grid grid-cols-[minmax(0,20rem)_1fr] items-baseline gap-4 border-b border-base px-4 py-1.5 transition-colors last:border-b-0 hover:bg-hover`},{default:n(()=>[o(`span`,F,t(e.key),1),o(`span`,I,[c(x,{value:e.values[l(_)?.sourceLocale??``],inline:``},null,8,[`value`])])]),_:2},1032,[`to`]))),128))]),_:1},8,[`title`])):m(``,!0),Z.value.length?(r(),u(S,{key:2,index:`03`,title:l(h)(`locale.outdated`,{count:Z.value.length})},{default:n(()=>[(r(!0),s(f,null,i(Z.value,e=>(r(),u(l(v),{key:e.key,to:`/keys/${encodeURIComponent(e.key)}`,class:`focus-ring grid grid-cols-[minmax(0,20rem)_1fr_1fr] items-center gap-4 border-b border-base px-4 py-1.5 transition-colors last:border-b-0 hover:bg-hover`},{default:n(()=>[o(`span`,L,[p[2]||=o(`span`,{class:`i-ph-clock-counter-clockwise-duotone shrink-0 color-warn`},null,-1),o(`span`,ue,t(e.key),1)]),o(`span`,R,[c(x,{value:e.values[l(_)?.sourceLocale??``],inline:``},null,8,[`value`])]),o(`span`,z,[c(x,{value:e.values[G.value],inline:``},null,8,[`value`])])]),_:2},1032,[`to`]))),128))]),_:1},8,[`title`])):m(``,!0),$.value.length?(r(),u(S,{key:3,index:`04`,title:l(h)(`locale.problems`,{count:$.value.length})},{default:n(()=>[(r(!0),s(f,null,i($.value,(i,a)=>(r(),u(ee(i.key?l(v):`div`),{key:a,to:i.key?`/keys/${encodeURIComponent(i.key)}`:void 0,class:e([`flex items-center gap-2 border-b border-base px-4 py-1.5 last:border-b-0`,i.key&&`transition-colors hover:bg-hover`])},{default:n(()=>[o(`span`,{class:e(i.severity===`error`?`i-ph-x-circle-duotone color-error`:`i-ph-warning-duotone color-warn`)},null,2),o(`span`,B,t(i.code),1),i.key?(r(),s(`span`,V,t(i.key),1)):m(``,!0),o(`span`,H,t(i.message),1)]),_:2},1032,[`to`,`class`]))),128))]),_:1},8,[`title`])):m(``,!0),K.value&&l(J)&&!Y.value.length&&!X.value.length&&!Z.value.length&&!$.value.length?(r(),s(`p`,U,[p[3]||=o(`span`,{class:`i-ph-check-circle-duotone`},null,-1),d(` `+t(l(h)(`locale.complete`)),1)])):m(``,!0)]),_:1}))}});export{W as default};
|