@webx-ui/module-audit 0.4.6 → 0.5.0

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.
@@ -0,0 +1,1880 @@
1
+ import { defineComponent as U, computed as O, openBlock as t, createBlock as g, unref as e, withCtx as u, createVNode as $, createElementVNode as k, toDisplayString as d, createElementBlock as h, createCommentVNode as A, createTextVNode as f, Fragment as w, renderList as R, normalizeClass as le, ref as I, onBeforeUnmount as je, watch as Z, createSlots as Fe, useModel as Le, mergeModels as ce, defineAsyncComponent as D } from "vue";
2
+ import { useRouter as me } from "vue-router";
3
+ import { useAdmin as de, useTranslate as V, useErrorText as ye } from "@webx-ui/module-admin";
4
+ import { WxTooltip as te, WxLink as oe, WxBadge as j, WxText as C, WxIcon as ve, WxButton as B, WxAlert as X, WxDrawer as Ee, WxSkeleton as Ue, WxTabs as Me, WxTable as he, WxImage as Be, toast as ee, WxDialog as De, WxFormItem as pe, WxInput as Ve, WxTextarea as qe } from "@webx-ui/core";
5
+ function rs(i = {}) {
6
+ const n = i.path ?? "/audit", o = { base: n };
7
+ return {
8
+ id: "audit",
9
+ path: n,
10
+ routes: [
11
+ { path: n, name: "webx.audit", component: () => import("./AuditOverviewPage-gVpdBOAY.js"), props: o },
12
+ {
13
+ path: `${n}/issues`,
14
+ name: "webx.audit.issues",
15
+ component: () => import("./AuditIssuesPage-BjTPgAnD.js"),
16
+ props: o
17
+ },
18
+ {
19
+ path: `${n}/pages`,
20
+ name: "webx.audit.pages",
21
+ component: () => import("./AuditPagesPage-DNgZo-K-.js"),
22
+ props: o
23
+ },
24
+ {
25
+ path: `${n}/hosts`,
26
+ name: "webx.audit.hosts",
27
+ component: () => import("./AuditHostsPage-YFRORYHZ.js"),
28
+ props: o
29
+ },
30
+ {
31
+ path: `${n}/runs`,
32
+ name: "webx.audit.runs",
33
+ component: () => import("./AuditRunsPage-BbWsuATw.js"),
34
+ props: o
35
+ },
36
+ {
37
+ path: `${n}/settings`,
38
+ name: "webx.audit.settings",
39
+ component: () => import("./AuditSettingsPage-HwfdLU_s.js"),
40
+ props: o
41
+ }
42
+ ]
43
+ };
44
+ }
45
+ function ge(i) {
46
+ const n = {
47
+ search: i.search || void 0,
48
+ status: i.status || void 0,
49
+ indexable: i.indexable === null || i.indexable === void 0 ? void 0 : i.indexable ? 1 : 0,
50
+ check: i.check || void 0,
51
+ sort: i.sort || void 0,
52
+ page: i.page,
53
+ per_page: i.per_page
54
+ };
55
+ for (const o of i.filters ?? [])
56
+ n[`f[${o.field}]`] = o.value === void 0 || o.value === "" ? o.op : `${o.op}:${o.value}`;
57
+ return n;
58
+ }
59
+ function ke(i) {
60
+ const n = `${i.apiPath}/audit`, o = (a) => a.data, m = (a) => ({
61
+ check: a.check || void 0,
62
+ severity: a.severity || void 0,
63
+ group: a.group || void 0,
64
+ state: a.state || void 0,
65
+ page: a.page,
66
+ per_page: a.per_page
67
+ });
68
+ return {
69
+ latest: () => i.http.get(`${n}/runs/latest`).then(o),
70
+ run: (a) => i.http.get(`${n}/runs/${a}`).then(o),
71
+ runs: (a = {}) => i.http.get(`${n}/runs`, { query: a }).then((c) => ({ ...c.meta, data: c.data })),
72
+ start: (a, c) => i.http.post(`${n}/runs`, a === "urls" ? { scope: a, urls: c } : { scope: a }).then(o),
73
+ cancel: (a) => i.http.post(`${n}/runs/${a}/cancel`, {}).then(o),
74
+ clear: () => i.http.delete(`${n}/runs`).then((a) => a.data.runs),
75
+ checks: (a, c = {}) => i.http.get(`${n}/runs/${a}/checks`, { query: m(c) }).then(o),
76
+ issues: (a, c = {}) => i.http.get(`${n}/runs/${a}/issues`, { query: m(c) }).then((y) => ({ ...y.meta, data: y.data })),
77
+ pages: (a, c = {}) => i.http.get(`${n}/runs/${a}/pages`, { query: ge(c) }).then((y) => ({ ...y.meta, data: y.data })),
78
+ pagesFile: (a, c, y) => {
79
+ const b = new URLSearchParams();
80
+ for (const [_, P] of Object.entries({
81
+ ...ge(c),
82
+ page: void 0,
83
+ per_page: void 0
84
+ }))
85
+ P !== void 0 && b.set(_, String(P));
86
+ return b.set("columns", y.join(",")), `${n}/runs/${a}/pages/export?${b.toString()}`;
87
+ },
88
+ page: (a, c) => i.http.get(`${n}/runs/${a}/pages/${c}`).then(o),
89
+ links: (a, c, y = {}) => i.http.get(`${n}/runs/${a}/pages/${c}/links`, { query: y }).then((b) => ({ ...b.meta, data: b.data })),
90
+ resources: (a, c, y) => i.http.get(`${n}/runs/${a}/pages/${c}/resources`, { query: y }).then((b) => ({ ...b.meta, data: b.data })),
91
+ fixes: (a, c) => i.http.get(`${n}/runs/${a}/issues/${c}/fixes`).then(o),
92
+ fix: (a, c, y, b = !1) => i.http.post(`${n}/runs/${a}/issues/${c}/fixes/${encodeURIComponent(y)}`, {
93
+ dry_run: b
94
+ }).then(o),
95
+ pageFile: (a, c) => `${n}/runs/${a}/pages/${c}/export`,
96
+ compare: (a, c) => i.http.get(`${n}/runs/compare`, { query: { to: a, from: c ?? void 0 } }).then(o),
97
+ compareIssues: (a) => i.http.get(`${n}/runs/compare/issues`, {
98
+ query: { ...a, from: a.from ?? void 0, check: a.check || void 0 }
99
+ }).then((c) => ({ ...c.meta, data: c.data })),
100
+ hosts: (a = {}) => i.http.get(`${n}/hosts`, {
101
+ query: {
102
+ class: a.class || void 0,
103
+ search: a.search || void 0,
104
+ host: a.host || void 0
105
+ }
106
+ }).then(o),
107
+ ignores: () => i.http.get(`${n}/ignores`).then(o),
108
+ hide: (a) => i.http.post(`${n}/ignores`, a).then(o),
109
+ hidePreview: (a) => i.http.post(`${n}/ignores`, { ...a, dry_run: !0 }).then((c) => c.data.hidden),
110
+ unhide: (a) => i.http.delete(`${n}/ignores/${a}`).then(() => {
111
+ }),
112
+ settings: () => i.http.get(`${n}/settings`).then((a) => a.data.values),
113
+ saveSettings: (a) => i.http.put(`${n}/settings`, { values: a }).then((c) => c.data.values)
114
+ };
115
+ }
116
+ const Ge = {
117
+ module: {
118
+ title: "Audit"
119
+ },
120
+ page: {
121
+ overview: "Overview",
122
+ issues: "Findings",
123
+ settings: "Settings",
124
+ run: "Run the audit",
125
+ scope: "Scope",
126
+ "scope-full": "Full",
127
+ "scope-full-help": "Everything the audit can check.",
128
+ "scope-quick": "Quick",
129
+ "scope-quick-help": "The config, the host and the database — takes seconds.",
130
+ start: "Start",
131
+ started: "The audit has started.",
132
+ cancel: "Cancel the run",
133
+ never: "No audit has been run yet.",
134
+ "never-help": "Run the first one to see how the site looks to a visitor and to a search engine.",
135
+ health: "Health",
136
+ errors: "Errors",
137
+ warnings: "Warnings",
138
+ notices: "Notices",
139
+ new: "New",
140
+ fixed: "Fixed",
141
+ "health-pages": "Pages without errors: :clean of :pages",
142
+ "health-site": "Errors of the whole site: :count",
143
+ "health-warnings": "Checks with warnings: :count",
144
+ "health-help": "The share of pages without errors, minus 10 points for each error of the whole site and 2 for each check with warnings — the warnings take 20 at most.",
145
+ "last-run": "Last run",
146
+ "base-url": "Address",
147
+ "status-queued": "Waiting in the queue",
148
+ "status-running": "Running",
149
+ "status-done": "Done",
150
+ "status-failed": "Failed",
151
+ "status-cancelled": "Cancelled",
152
+ "stage-probes": "Config and host",
153
+ "stage-database": "Database",
154
+ "stage-crawl": "Pages",
155
+ "stage-analyse": "Analysis",
156
+ "last-failed": "The last run did not finish: :error",
157
+ "by-group": "By group",
158
+ "group-config": "Configuration",
159
+ "group-host": "Host and addresses",
160
+ "group-hosts": "Outgoing addresses",
161
+ "group-other": "Other",
162
+ sources: "Content searched",
163
+ "sources-missing": "Installed, but not searched:",
164
+ "sources-help": "Besides crawling the site, the audit reads the text modules keep in the database — drafts, hidden records and fields the template never prints — and looks there for absolute addresses, such as links to a development stand. Green: modules that hand their text over. Orange: modules installed here that do not yet. Their published pages are still crawled, but their drafts and hidden fields are not searched, and a fix button cannot reach them.",
165
+ "sources-help-label": "What this means",
166
+ "sync-queue": "The queue runs jobs inside the request (sync), so the panel cannot start a run. Run php artisan webx:audit:run from the terminal or cron.",
167
+ "already-running": "An audit is already running.",
168
+ check: "Check",
169
+ count: "Found",
170
+ severity: "Severity",
171
+ "severity-error": "Error",
172
+ "severity-warning": "Warning",
173
+ "severity-notice": "Notice",
174
+ "any-severity": "Any severity",
175
+ "any-group": "Any group",
176
+ "any-state": "New and persisting",
177
+ "state-new": "New",
178
+ "state-persisting": "Persisting",
179
+ address: "Address",
180
+ empty: "Nothing found.",
181
+ clean: "The last run found nothing.",
182
+ found: "What was found",
183
+ why: "Why it matters",
184
+ fix: "How to fix it",
185
+ explain: "What this check means",
186
+ "open-editor": "Open in the editor",
187
+ "fix-button": "Fix",
188
+ "fix-apply": "Apply",
189
+ "fix-applied": "Done. Run the audit again to see the finding go.",
190
+ "fix-none": "Nothing left to change: no fix can close this finding now.",
191
+ "fix-pressed": "Fixed — waiting for the next run",
192
+ "fix-changes": "Changes",
193
+ "fix-before": "Now",
194
+ "fix-after": "After",
195
+ yes: "Yes",
196
+ no: "No",
197
+ missing: "Missing",
198
+ pages: "Pages",
199
+ "pages-progress": "Pages crawled: :crawled of at most :limit",
200
+ "resources-progress": "Pictures, styles, scripts and external links checked: :checked of :total",
201
+ "pages-none": "No full run has crawled the site yet. Start a full audit to see every page.",
202
+ "pages-run": "Full run of :date",
203
+ "group-indexing": "Indexing",
204
+ "group-redirects": "Redirects",
205
+ "group-page": "Page",
206
+ "group-content": "Content and speed",
207
+ "group-links": "Links",
208
+ "group-images": "Pictures",
209
+ "group-a11y": "Accessibility",
210
+ "group-structure": "Structure",
211
+ columns: "Columns",
212
+ export: "Export CSV",
213
+ "search-url": "Search by address",
214
+ "any-status": "Any answer",
215
+ "status-none": "No answer",
216
+ "any-indexable": "Indexable or not",
217
+ "indexable-yes": "Indexable",
218
+ "indexable-no": "Not indexable",
219
+ "any-check": "With any findings or none",
220
+ "add-filter": "Add a filter",
221
+ "remove-filter": "Remove the filter",
222
+ "op-contains": "contains",
223
+ "op-eq": "is",
224
+ "op-empty": "is empty",
225
+ "op-filled": "is not empty",
226
+ "op-gt": "more than",
227
+ "op-lt": "less than",
228
+ "op-yes": "yes",
229
+ "op-no": "no",
230
+ value: "Value",
231
+ "field-url": "Address",
232
+ "field-status": "Code",
233
+ "field-final_status": "Final code",
234
+ "field-redirect_to": "Redirects to",
235
+ "field-source": "Found through",
236
+ "field-depth": "Depth",
237
+ "field-indexable": "Indexable",
238
+ "field-issues": "Findings",
239
+ "field-title": "Title",
240
+ "field-description": "Description",
241
+ "field-h1": "H1",
242
+ "field-canonical": "Canonical",
243
+ "field-robots_meta": "Meta robots",
244
+ "field-x_robots_tag": "X-Robots-Tag",
245
+ "field-lang": "Language",
246
+ "field-content_type": "Content type",
247
+ "field-bytes": "Size, bytes",
248
+ "field-ttfb_ms": "First byte, ms",
249
+ "field-total_ms": "Answer, ms",
250
+ "field-compression": "Compression",
251
+ "field-word_count": "Words",
252
+ "field-links_in": "Links in",
253
+ "field-links_out_internal": "Internal links out",
254
+ "field-links_out_external": "External links out",
255
+ "field-images": "Pictures",
256
+ "field-images_without_alt": "Pictures without alt",
257
+ "field-in_sitemap": "In the sitemap",
258
+ "field-in_registry": "In the registry",
259
+ "field-blocked_by_robots": "Closed in robots.txt",
260
+ "source-home": "Home page",
261
+ "source-sitemap": "Sitemap",
262
+ "source-registry": "Address registry",
263
+ "source-link": "Link",
264
+ "card-overview": "Overview",
265
+ "card-issues": "Problems",
266
+ "card-incoming": "Incoming",
267
+ "card-outgoing": "Outgoing",
268
+ "card-images": "Pictures",
269
+ "card-css": "CSS",
270
+ "card-js": "JS",
271
+ "card-microdata": "Structured data",
272
+ "card-headings": "Headings",
273
+ "no-headings": "The page has no headings.",
274
+ "headings-recheck": "The list of headings appears once the page is checked again.",
275
+ "heading-empty": "Empty heading",
276
+ "headings-hints": "Not the usual order",
277
+ "headings-fine": "The headings go in the usual order: one H1 first, each level one step below the one above.",
278
+ "headings-no-h1": "There is no H1. A page needs one main heading — search engines and screen readers start from it.",
279
+ "headings-many-h1": "More than one H1 — keep one, make the rest H2. H1 headings: :count",
280
+ "headings-h1-not-first": "The page starts with :level, not H1: the main heading should come before the rest.",
281
+ "headings-skipped": "Levels are skipped — go down one step at a time: after H2 comes H3, not H4. Places: :count",
282
+ "headings-empty": "Headings with no text — fill them in or make them ordinary text. Empty: :count",
283
+ "heading-missing": ":level is missing after :after",
284
+ "headings-summary-ok": "In order, headings: :count",
285
+ "headings-summary-bad": "Out of order, headings: :count",
286
+ "headings-open": "Open the map",
287
+ response: "Response",
288
+ headers: "Headers",
289
+ markup: "Markup",
290
+ "open-page": "Open the page",
291
+ "no-issues": "No problems on this page.",
292
+ "no-links": "No links.",
293
+ kind: "Kind",
294
+ anchor: "Anchor",
295
+ host: "Host",
296
+ size: "Size",
297
+ cache: "Cache",
298
+ alt: "Alt",
299
+ "not-checked": "Not checked",
300
+ "no-resources": "Nothing of this kind on the page.",
301
+ "no-json-ld": "The page has no structured data.",
302
+ "jsonld-block": "Block :number",
303
+ "jsonld-error": "Does not parse:",
304
+ "jsonld-required": "Required fields missing:",
305
+ "jsonld-recommended": "Recommended fields missing:",
306
+ "jsonld-complete": "Every field search engines ask for is there.",
307
+ "host-own": "Own",
308
+ "host-own_mirror": "Other mirror",
309
+ "host-dev": "Stand",
310
+ "host-external": "External",
311
+ error: "Error",
312
+ "source-list": "Recheck list",
313
+ hosts: "Outgoing",
314
+ runs: "Runs",
315
+ "scope-urls": "Recheck",
316
+ "urls-foreign": "None of these addresses is on the audited site.",
317
+ "state-hidden": "Hidden",
318
+ hide: "Hide",
319
+ "hide-title": "Hide this finding",
320
+ "hide-help": "Hidden findings stop counting, in this run and in every later one. Nothing is deleted: the hidden list shows them again.",
321
+ "hide-pattern": "Addresses",
322
+ "hide-pattern-help": "This address, or a mask of them: * is a stretch without a slash, ** one with slashes (/search/**). Empty hides every finding of the check.",
323
+ "hide-reason": "Why it is all right",
324
+ "hide-count": "Findings of the last run it would hide: :count",
325
+ "hidden-done": "Hidden.",
326
+ "hidden-reason": "Hidden: :reason",
327
+ "hidden-by": "Hidden by :who: :reason",
328
+ unhide: "Show again",
329
+ unhidden: "Shown again.",
330
+ recheck: "Recheck",
331
+ "recheck-running": "Rechecking the page…",
332
+ "recheck-fixed": "Fixed since the last full run: :count",
333
+ "recheck-new": "New since the last full run: :count",
334
+ "recheck-compare": "Compare the runs",
335
+ "export-page": "Export",
336
+ "runs-empty": "No runs yet.",
337
+ "run-id": "Run",
338
+ status: "Status",
339
+ "started-at": "Started",
340
+ "started-by": "Started by",
341
+ "by-schedule": "Schedule",
342
+ "by-mcp": "Agent",
343
+ "by-console": "Console",
344
+ "by-person": "Administrator",
345
+ compare: "Compare",
346
+ "compare-help": "Pick two runs: what the later one found that the earlier did not, what both found, and what is gone.",
347
+ clear: "Clear audit data",
348
+ "clear-title": "Clear all audit data?",
349
+ "clear-text": "Every run is deleted with everything it found: findings, crawled pages, snapshots, links and the history to compare against. This cannot be undone. Hiding rules and settings stay.",
350
+ "clear-confirm": "Delete everything",
351
+ "clear-cancel": "Keep",
352
+ cleared: "Audit data cleared.",
353
+ "clear-running": "An audit is running: cancel it or wait for it to finish, then clear.",
354
+ "compare-from": "Earlier run",
355
+ "compare-to": "Later run",
356
+ "compare-none": "Both runs found the same.",
357
+ "compare-scopes": "The runs differ in scope: only the checks the later run ran can count as fixed.",
358
+ "kind-new": "New",
359
+ "kind-persisting": "Persisting",
360
+ "kind-fixed": "Fixed",
361
+ "hosts-empty": "No run has seen a link or an address in the database yet.",
362
+ "search-host": "Search by host",
363
+ "any-class": "Any class",
364
+ links: "Links",
365
+ fields: "Fields in the database",
366
+ broken: "Broken",
367
+ "first-seen": "First seen",
368
+ "host-pages": "On pages",
369
+ "host-fields": "In the database",
370
+ record: "Record",
371
+ field: "Field",
372
+ unpublished: "Not published",
373
+ save: "Save",
374
+ saved: "Saved.",
375
+ dismiss: "Cancel",
376
+ "view-full": "View full size",
377
+ "view-pages": "By page",
378
+ "view-links": "By link",
379
+ "leads-to": "Leads to",
380
+ "change-slash": "Slash only",
381
+ "change-www": "www",
382
+ "change-https": "http → https",
383
+ "link-pages": "Pages: :count",
384
+ "link-show-all": "Show all",
385
+ "link-collapse": "Collapse",
386
+ "attrs-opener": "Opens in a new tab without noopener. Current browsers add it themselves; older ones let the opened page control this one.",
387
+ "section-answer": "Server answer",
388
+ "section-crawl": "Crawl",
389
+ "section-head": "Markup",
390
+ "section-sharing": "Preview and structured data",
391
+ "code-none": "No answer — the server did not respond in time or the connection failed (DNS, certificate, refused). Open the address in a browser.",
392
+ "code-200": "200 OK — the page opens normally.",
393
+ "code-201": "201 Created — the server created something; a link should not lead here.",
394
+ "code-204": "204 No Content — answered, but with an empty page.",
395
+ "code-206": "206 Partial Content — a part of the file was sent, as video and downloads do.",
396
+ "code-301": "301 Moved Permanently — the address has moved for good. Update the link to where it leads.",
397
+ "code-302": "302 Found — a temporary redirect. The target may change again; search engines keep the old address.",
398
+ "code-303": "303 See Other — sent elsewhere after a form or an action; a link should point at the result.",
399
+ "code-304": "304 Not Modified — the browser's copy is still current.",
400
+ "code-307": "307 Temporary Redirect — like 302: temporary, the old address stays the main one.",
401
+ "code-308": "308 Permanent Redirect — like 301: moved for good. Update the link.",
402
+ "code-400": "400 Bad Request — the server did not understand the request; often a broken address.",
403
+ "code-401": "401 Unauthorized — sign-in needed. Visitors without an account cannot open it.",
404
+ "code-403": "403 Forbidden — the server refused. Many sites answer robots this way: if it opens in a browser, the link is fine.",
405
+ "code-404": "404 Not Found — the page is gone. Fix or remove the link.",
406
+ "code-405": "405 Method Not Allowed — the address exists but does not answer this kind of request.",
407
+ "code-406": "406 Not Acceptable — the server would not answer in a form the robot asked for; check in a browser.",
408
+ "code-408": "408 Request Timeout — the server gave up waiting. Usually passes; recheck later.",
409
+ "code-410": "410 Gone — removed on purpose and not coming back. Remove the link.",
410
+ "code-415": "415 Unsupported Media Type — the server refused the format of the request.",
411
+ "code-429": "429 Too Many Requests — the server asked the robot to slow down. Not a broken page.",
412
+ "code-451": "451 Unavailable For Legal Reasons — blocked by law in the server's region.",
413
+ "code-500": "500 Internal Server Error — the site behind the link broke. Recheck later; if it stays, the link is dead.",
414
+ "code-502": "502 Bad Gateway — the server behind a proxy did not answer. Usually temporary.",
415
+ "code-503": "503 Service Unavailable — overloaded or under maintenance. Usually temporary.",
416
+ "code-504": "504 Gateway Timeout — the server behind a proxy answered too slowly. Usually temporary.",
417
+ "code-1xx": "An interim answer — the request is still being handled.",
418
+ "code-2xx": "A success — the address answered.",
419
+ "code-3xx": "A redirect — the address sends elsewhere. Better to link straight to where it leads.",
420
+ "code-4xx": "A client error — the address cannot be opened as it is: missing, closed or refused.",
421
+ "code-5xx": "A server error — the site behind the link failed. Often temporary; recheck later."
422
+ }
423
+ };
424
+ function Ke(i, n) {
425
+ let o, m;
426
+ try {
427
+ o = new URL(i), m = new URL(n, i);
428
+ } catch {
429
+ return [];
430
+ }
431
+ const a = [];
432
+ if (o.protocol === "http:" && m.protocol === "https:") a.push("https");
433
+ else if (o.protocol !== m.protocol) return [];
434
+ const c = (b) => b.replace(/^www\./, "");
435
+ if (o.host !== m.host) {
436
+ if (c(o.host) !== c(m.host)) return [];
437
+ a.push("www");
438
+ }
439
+ const y = (b) => b.replace(/\/+$/, "");
440
+ if (o.pathname !== m.pathname) {
441
+ if (y(o.pathname) !== y(m.pathname)) return [];
442
+ a.push("slash");
443
+ }
444
+ return o.search !== m.search || o.hash !== m.hash ? [] : a;
445
+ }
446
+ const ie = 14;
447
+ function Je(i) {
448
+ return i.length <= ie * 2 ? [i, ""] : [i.slice(0, -ie), i.slice(-ie)];
449
+ }
450
+ function Xe(i) {
451
+ const n = Number(i);
452
+ return n >= 500 || n === 0 ? "danger" : n >= 400 ? "warning" : n === 301 || n === 308 ? "info" : n >= 300 ? "warning" : "success";
453
+ }
454
+ const Qe = [
455
+ 200,
456
+ 201,
457
+ 204,
458
+ 206,
459
+ 301,
460
+ 302,
461
+ 303,
462
+ 304,
463
+ 307,
464
+ 308,
465
+ 400,
466
+ 401,
467
+ 403,
468
+ 404,
469
+ 405,
470
+ 406,
471
+ 408,
472
+ 410,
473
+ 415,
474
+ 429,
475
+ 451,
476
+ 500,
477
+ 502,
478
+ 503,
479
+ 504
480
+ ];
481
+ function Ye(i) {
482
+ return i ? Qe.includes(i) ? `code-${i}` : i >= 100 && i < 600 ? `code-${Math.floor(i / 100)}xx` : "code-none" : "code-none";
483
+ }
484
+ const Ze = { class: "wx-audit-address__head" }, et = {
485
+ key: 0,
486
+ class: "wx-audit-address__tail"
487
+ }, tt = { class: "wx-audit-address__full" }, st = /* @__PURE__ */ U({
488
+ __name: "AuditAddress",
489
+ props: {
490
+ href: {},
491
+ type: {},
492
+ strong: { type: Boolean }
493
+ },
494
+ setup(i) {
495
+ const n = i, o = O(() => Je(n.href));
496
+ return (m, a) => (t(), g(e(te), { "max-width": 560 }, {
497
+ content: u(() => [
498
+ k("span", tt, d(n.href), 1)
499
+ ]),
500
+ default: u(() => [
501
+ $(e(oe), {
502
+ href: n.href,
503
+ target: "_blank",
504
+ type: n.type,
505
+ weight: n.strong ? "medium" : void 0,
506
+ class: "wx-audit-address"
507
+ }, {
508
+ default: u(() => [
509
+ k("span", Ze, d(o.value[0]), 1),
510
+ o.value[1] ? (t(), h("span", et, d(o.value[1]), 1)) : A("", !0)
511
+ ]),
512
+ _: 1
513
+ }, 8, ["href", "type", "weight"])
514
+ ]),
515
+ _: 1
516
+ }));
517
+ }
518
+ }), q = (i, n) => {
519
+ const o = i.__vccOpts || i;
520
+ for (const [m, a] of n)
521
+ o[m] = a;
522
+ return o;
523
+ }, fe = /* @__PURE__ */ q(st, [["__scopeId", "data-v-38aa24fb"]]), _e = /* @__PURE__ */ new WeakSet();
524
+ function G() {
525
+ try {
526
+ const { i18n: i } = de();
527
+ _e.has(i) || (i.defaults("webx-audit", Ge), _e.add(i));
528
+ } catch {
529
+ }
530
+ }
531
+ const at = {
532
+ key: 0,
533
+ class: "wx-audit-attrs"
534
+ }, nt = /* @__PURE__ */ U({
535
+ __name: "AuditLinkAttrs",
536
+ props: {
537
+ rel: {},
538
+ target: {}
539
+ },
540
+ setup(i) {
541
+ const n = i;
542
+ G();
543
+ const o = V("webx-audit"), m = O(() => (n.rel ?? "").split(/\s+/).filter(Boolean)), a = O(
544
+ () => n.target?.toLowerCase() === "_blank" && !m.value.some((c) => c === "noopener" || c === "noreferrer")
545
+ );
546
+ return (c, y) => n.target || m.value.length ? (t(), h("span", at, [
547
+ n.target && a.value ? (t(), g(e(te), {
548
+ key: 0,
549
+ content: e(o)("page.attrs-opener"),
550
+ "max-width": 320
551
+ }, {
552
+ default: u(() => [
553
+ $(e(j), {
554
+ type: "warning",
555
+ variant: "outline",
556
+ size: "sm"
557
+ }, {
558
+ default: u(() => [
559
+ f(d(n.target), 1)
560
+ ]),
561
+ _: 1
562
+ })
563
+ ]),
564
+ _: 1
565
+ }, 8, ["content"])) : n.target ? (t(), g(e(j), {
566
+ key: 1,
567
+ variant: "outline",
568
+ size: "sm"
569
+ }, {
570
+ default: u(() => [
571
+ f(d(n.target), 1)
572
+ ]),
573
+ _: 1
574
+ })) : A("", !0),
575
+ (t(!0), h(w, null, R(m.value, (b) => (t(), g(e(j), {
576
+ key: b,
577
+ variant: "outline",
578
+ size: "sm"
579
+ }, {
580
+ default: u(() => [
581
+ f(d(b), 1)
582
+ ]),
583
+ _: 2
584
+ }, 1024))), 128))
585
+ ])) : A("", !0);
586
+ }
587
+ }), it = /* @__PURE__ */ q(nt, [["__scopeId", "data-v-ab753c1e"]]), J = /* @__PURE__ */ U({
588
+ __name: "AuditStatus",
589
+ props: {
590
+ code: {},
591
+ size: { default: "sm" }
592
+ },
593
+ setup(i) {
594
+ const n = i;
595
+ G();
596
+ const o = V("webx-audit"), m = O(() => n.code ? String(n.code) : o("page.status-none"));
597
+ return (a, c) => (t(), g(e(te), {
598
+ content: e(o)(`page.${e(Ye)(n.code)}`),
599
+ "max-width": 360
600
+ }, {
601
+ default: u(() => [
602
+ $(e(j), {
603
+ type: e(Xe)(n.code ?? 0),
604
+ size: n.size
605
+ }, {
606
+ default: u(() => [
607
+ f(d(m.value), 1)
608
+ ]),
609
+ _: 1
610
+ }, 8, ["type", "size"])
611
+ ]),
612
+ _: 1
613
+ }, 8, ["content"]));
614
+ }
615
+ }), rt = { class: "wx-audit-details" }, ot = {
616
+ key: 1,
617
+ class: "wx-audit-details__scroll"
618
+ }, lt = { class: "wx-audit-details__table" }, dt = {
619
+ key: 0,
620
+ class: "wx-audit-details__to"
621
+ }, ut = {
622
+ key: 7,
623
+ class: "wx-audit-details__code"
624
+ }, ct = /* @__PURE__ */ U({
625
+ __name: "AuditDetails",
626
+ props: {
627
+ details: {},
628
+ counted: { type: Boolean }
629
+ },
630
+ setup(i) {
631
+ const n = i, o = me();
632
+ G();
633
+ const m = V("webx-audit"), a = O(() => n.details.table?.columns ?? []), c = O(
634
+ () => a.value.some((x) => x.key === "url" && x.type === "url") && a.value.some((x) => x.key === "location" && x.type === "url")
635
+ );
636
+ function y(x) {
637
+ return c.value && x.key === "url";
638
+ }
639
+ function b(x) {
640
+ return c.value && x.key === "location";
641
+ }
642
+ function _(x, M) {
643
+ return x[M.key];
644
+ }
645
+ function P(x) {
646
+ return x == null ? "" : m(x ? "page.yes" : "page.no");
647
+ }
648
+ function z(x) {
649
+ return x == null ? "" : String(x);
650
+ }
651
+ function E(x) {
652
+ return Ke(z(x.url), z(x.location));
653
+ }
654
+ return (x, M) => (t(), h("div", rt, [
655
+ n.details.summary && !n.counted ? (t(), g(e(C), {
656
+ key: 0,
657
+ size: "sm"
658
+ }, {
659
+ default: u(() => [
660
+ f(d(n.details.summary), 1)
661
+ ]),
662
+ _: 1
663
+ })) : A("", !0),
664
+ n.details.table && n.details.table.rows.length ? (t(), h("div", ot, [
665
+ k("table", lt, [
666
+ k("colgroup", null, [
667
+ (t(!0), h(w, null, R(a.value, (s) => (t(), h("col", {
668
+ key: s.key,
669
+ class: le([
670
+ `wx-audit-details__col--${s.type}`,
671
+ `wx-audit-details__col--${s.key}`
672
+ ])
673
+ }, null, 2))), 128))
674
+ ]),
675
+ k("thead", null, [
676
+ k("tr", null, [
677
+ (t(!0), h(w, null, R(a.value, (s) => (t(), h("th", {
678
+ key: s.key
679
+ }, d(s.label), 1))), 128))
680
+ ])
681
+ ]),
682
+ k("tbody", null, [
683
+ (t(!0), h(w, null, R(n.details.table.rows, (s, L) => (t(), h("tr", { key: L }, [
684
+ (t(!0), h(w, null, R(a.value, (p) => (t(), h("td", {
685
+ key: p.key
686
+ }, [
687
+ b(p) && z(_(s, p)) ? (t(), h("span", dt, [
688
+ $(e(ve), {
689
+ name: "arrow-right",
690
+ size: "1em",
691
+ class: "wx-audit-details__arrow",
692
+ label: e(m)("page.leads-to")
693
+ }, null, 8, ["label"]),
694
+ $(fe, {
695
+ href: z(_(s, p)),
696
+ strong: ""
697
+ }, null, 8, ["href"]),
698
+ (t(!0), h(w, null, R(E(s), (N) => (t(), g(e(j), {
699
+ key: N,
700
+ type: "default",
701
+ size: "sm",
702
+ class: "wx-audit-details__change"
703
+ }, {
704
+ default: u(() => [
705
+ f(d(e(m)(`page.change-${N}`)), 1)
706
+ ]),
707
+ _: 2
708
+ }, 1024))), 128))
709
+ ])) : p.type === "url" && z(_(s, p)) ? (t(), g(fe, {
710
+ key: 1,
711
+ href: z(_(s, p)),
712
+ type: y(p) ? "muted" : void 0
713
+ }, null, 8, ["href", "type"])) : p.type === "status" && _(s, p) !== null ? (t(), g(J, {
714
+ key: 2,
715
+ code: Number(_(s, p))
716
+ }, null, 8, ["code"])) : p.type === "attrs" ? (t(), g(it, {
717
+ key: 3,
718
+ rel: z(s.rel),
719
+ target: z(s.target)
720
+ }, null, 8, ["rel", "target"])) : p.type === "bool" ? (t(), h(w, { key: 4 }, [
721
+ f(d(P(_(s, p))), 1)
722
+ ], 64)) : p.type === "missing" && !z(_(s, p)) ? (t(), g(e(C), {
723
+ key: 5,
724
+ size: "sm",
725
+ tone: "danger"
726
+ }, {
727
+ default: u(() => [
728
+ f(d(e(m)("page.missing")), 1)
729
+ ]),
730
+ _: 1
731
+ })) : p.type === "edit" && z(_(s, p)) ? (t(), g(e(B), {
732
+ key: 6,
733
+ size: "sm",
734
+ variant: "text",
735
+ icon: "edit",
736
+ onClick: (N) => e(o).push(z(_(s, p)))
737
+ }, {
738
+ default: u(() => [
739
+ f(d(e(m)("page.open-editor")), 1)
740
+ ]),
741
+ _: 1
742
+ }, 8, ["onClick"])) : p.type === "code" ? (t(), h("code", ut, d(z(_(s, p))), 1)) : (t(), h(w, { key: 8 }, [
743
+ f(d(z(_(s, p))), 1)
744
+ ], 64))
745
+ ]))), 128))
746
+ ]))), 128))
747
+ ])
748
+ ])
749
+ ])) : A("", !0)
750
+ ]));
751
+ }
752
+ }), ht = /* @__PURE__ */ q(ct, [["__scopeId", "data-v-8f3d8146"]]);
753
+ function pt(i) {
754
+ const n = [];
755
+ let o = 0;
756
+ for (const [m, a] of i) {
757
+ for (let c = o + 1; o > 0 && c < m; c++)
758
+ n.push({ level: c, text: "", missing: !0, after: o });
759
+ n.push({ level: m, text: a, missing: !1 }), o = m;
760
+ }
761
+ return n;
762
+ }
763
+ function be(i, n) {
764
+ if (!i.length) return [];
765
+ const o = i.filter(([y]) => y === 1).length, m = i.filter(
766
+ ([y], b) => b > 0 && y > i[b - 1][0] + 1
767
+ ).length, a = i.filter(([, y]) => y === "").length, c = [];
768
+ return o === 0 && c.push(n("page.headings-no-h1")), o > 1 && c.push(n("page.headings-many-h1", { count: o })), o > 0 && i[0][0] !== 1 && c.push(n("page.headings-h1-not-first", { level: `H${i[0][0]}` })), m > 0 && c.push(n("page.headings-skipped", { count: m })), a > 0 && c.push(n("page.headings-empty", { count: a })), c;
769
+ }
770
+ const gt = { class: "wx-audit-headings" }, ft = { class: "wx-audit-headings__hints" }, _t = { class: "wx-audit-headings__tree" }, mt = { class: "wx-audit-headings__gap" }, yt = {
771
+ key: 0,
772
+ class: "wx-audit-headings__text"
773
+ }, vt = /* @__PURE__ */ U({
774
+ __name: "AuditHeadings",
775
+ props: {
776
+ outline: {},
777
+ counts: {}
778
+ },
779
+ setup(i) {
780
+ const n = i;
781
+ G();
782
+ const o = V("webx-audit"), m = O(() => pt(n.outline ?? [])), a = O(() => be(n.outline ?? [], o)), c = O(() => Object.values(n.counts).reduce((y, b) => y + b, 0));
783
+ return (y, b) => (t(), h("div", gt, [
784
+ n.outline === null && c.value > 0 ? (t(), g(e(C), {
785
+ key: 0,
786
+ tone: "muted"
787
+ }, {
788
+ default: u(() => [
789
+ f(d(e(o)("page.headings-recheck")), 1)
790
+ ]),
791
+ _: 1
792
+ })) : m.value.length ? (t(), h(w, { key: 2 }, [
793
+ a.value.length ? (t(), g(e(X), {
794
+ key: 0,
795
+ type: "warning",
796
+ variant: "soft",
797
+ title: e(o)("page.headings-hints")
798
+ }, {
799
+ default: u(() => [
800
+ k("ul", ft, [
801
+ (t(!0), h(w, null, R(a.value, (_) => (t(), h("li", { key: _ }, d(_), 1))), 128))
802
+ ])
803
+ ]),
804
+ _: 1
805
+ }, 8, ["title"])) : (t(), g(e(X), {
806
+ key: 1,
807
+ type: "success",
808
+ variant: "soft",
809
+ title: e(o)("page.headings-fine")
810
+ }, null, 8, ["title"])),
811
+ k("ol", _t, [
812
+ (t(!0), h(w, null, R(m.value, (_, P) => (t(), h("li", {
813
+ key: P,
814
+ class: le(["wx-audit-headings__row", { "is-missing": _.missing }])
815
+ }, [
816
+ (t(!0), h(w, null, R(_.level - 1, (z) => (t(), h("span", {
817
+ key: z,
818
+ class: "wx-audit-headings__guide"
819
+ }))), 128)),
820
+ _.missing ? (t(), h(w, { key: 0 }, [
821
+ k("span", mt, "H" + d(_.level), 1),
822
+ $(e(C), {
823
+ size: "sm",
824
+ tone: "warning"
825
+ }, {
826
+ default: u(() => [
827
+ f(d(e(o)("page.heading-missing", { level: `H${_.level}`, after: `H${_.after}` })), 1)
828
+ ]),
829
+ _: 2
830
+ }, 1024)
831
+ ], 64)) : (t(), h(w, { key: 1 }, [
832
+ $(e(j), {
833
+ type: _.level === 1 ? "primary" : "info",
834
+ size: "sm"
835
+ }, {
836
+ default: u(() => [
837
+ f("H" + d(_.level), 1)
838
+ ]),
839
+ _: 2
840
+ }, 1032, ["type"]),
841
+ _.text ? (t(), h("span", yt, d(_.text), 1)) : (t(), g(e(C), {
842
+ key: 1,
843
+ size: "sm",
844
+ tone: "danger"
845
+ }, {
846
+ default: u(() => [
847
+ f(d(e(o)("page.heading-empty")), 1)
848
+ ]),
849
+ _: 1
850
+ }))
851
+ ], 64))
852
+ ], 2))), 128))
853
+ ])
854
+ ], 64)) : (t(), g(e(C), {
855
+ key: 1,
856
+ tone: "muted"
857
+ }, {
858
+ default: u(() => [
859
+ f(d(e(o)("page.no-headings")), 1)
860
+ ]),
861
+ _: 1
862
+ }))
863
+ ]));
864
+ }
865
+ }), kt = /* @__PURE__ */ q(vt, [["__scopeId", "data-v-8e5c5aed"]]);
866
+ function re(i) {
867
+ return i.checked && i.status !== null && i.status < 400 && i.error === null;
868
+ }
869
+ const bt = { class: "wx-audit-card__title" }, wt = { class: "wx-audit-card__url" }, xt = {
870
+ key: 0,
871
+ class: "wx-audit-card__extra"
872
+ }, $t = {
873
+ key: 2,
874
+ class: "wx-audit-card"
875
+ }, St = { class: "wx-audit-card__recheck" }, At = {
876
+ key: 0,
877
+ class: "wx-audit-card__overview"
878
+ }, Ct = { class: "wx-audit-card__tiles" }, zt = { class: "wx-audit-card__box-head" }, Tt = { class: "wx-audit-card__facts" }, Nt = { key: 0 }, Pt = {
879
+ key: 1,
880
+ class: "wx-audit-card__pairs"
881
+ }, Rt = { class: "wx-audit-card__key" }, Ot = {
882
+ key: 2,
883
+ class: "wx-audit-card__heading-fact"
884
+ }, Wt = {
885
+ key: 0,
886
+ class: "wx-audit-card__heading-hints"
887
+ }, Ht = {
888
+ key: 3,
889
+ class: "wx-audit-card__tags"
890
+ }, It = {
891
+ key: 0,
892
+ class: "wx-audit-card__box"
893
+ }, jt = { class: "wx-audit-card__box-head" }, Ft = { class: "wx-audit-card__facts" }, Lt = { class: "wx-audit-card__code" }, Et = { class: "wx-audit-card__code" }, Ut = {
894
+ key: 1,
895
+ class: "wx-audit-card__box wx-audit-card__headings"
896
+ }, Mt = {
897
+ key: 2,
898
+ class: "wx-audit-card__issues"
899
+ }, Bt = { class: "wx-audit-card__box-head wx-audit-card__issue-head" }, Dt = { class: "wx-audit-card__box-body" }, Vt = {
900
+ key: 0,
901
+ class: "wx-audit-card__picture"
902
+ }, qt = { class: "wx-audit-card__url" }, Gt = {
903
+ key: 1,
904
+ class: "wx-audit-card__url"
905
+ }, Kt = {
906
+ key: 4,
907
+ class: "wx-audit-card__issues"
908
+ }, Jt = { class: "wx-audit-card__issue-head" }, Xt = {
909
+ key: 1,
910
+ class: "wx-audit-card__source"
911
+ }, Qt = { class: "wx-audit-card__url" }, Yt = 2e3, Zt = /* @__PURE__ */ U({
912
+ __name: "AuditPageCard",
913
+ props: {
914
+ run: {},
915
+ base: {},
916
+ pageId: {},
917
+ titles: {}
918
+ },
919
+ emits: ["close"],
920
+ setup(i, { emit: n }) {
921
+ const o = i, m = n, a = de(), c = ke(a), y = me();
922
+ G();
923
+ const b = a.can("audit.run") || a.can("audit.manage"), _ = I(null), P = I(!1);
924
+ let z;
925
+ async function E() {
926
+ if (p.value) {
927
+ P.value = !0, _.value = null;
928
+ try {
929
+ x(await c.start("urls", [p.value.page.url]));
930
+ } catch (l) {
931
+ P.value = !1, ee.danger(L(l));
932
+ }
933
+ }
934
+ }
935
+ function x(l) {
936
+ if (clearTimeout(z), l.status === "queued" || l.status === "running") {
937
+ z = setTimeout(async () => {
938
+ try {
939
+ x(await c.run(l.id));
940
+ } catch (T) {
941
+ P.value = !1, ee.danger(L(T));
942
+ }
943
+ }, Yt);
944
+ return;
945
+ }
946
+ P.value = !1, _.value = l;
947
+ }
948
+ function M() {
949
+ _.value && o.base && y.push({ path: `${o.base}/runs`, query: { to: String(_.value.id) } });
950
+ }
951
+ je(() => clearTimeout(z));
952
+ const s = V("webx-audit"), L = ye(), p = I(null), N = I(null), S = I("overview"), F = I(null), se = I(!1), Q = I(null), ae = I(!1), we = ["images", "css", "js"], ue = O({
953
+ get: () => o.pageId !== null,
954
+ set: (l) => {
955
+ l || m("close");
956
+ }
957
+ }), xe = O(() => [
958
+ { value: "overview", label: s("page.card-overview") },
959
+ { value: "issues", label: s("page.card-issues"), badge: p.value?.counts.issues || void 0 },
960
+ {
961
+ value: "headings",
962
+ label: s("page.card-headings"),
963
+ badge: K.value?.length || void 0
964
+ },
965
+ { value: "in", label: s("page.card-incoming"), badge: p.value?.counts.incoming || void 0 },
966
+ { value: "out", label: s("page.card-outgoing"), badge: p.value?.counts.outgoing || void 0 },
967
+ { value: "images", label: s("page.card-images"), badge: p.value?.counts.images || void 0 },
968
+ { value: "css", label: s("page.card-css"), badge: p.value?.counts.css || void 0 },
969
+ { value: "js", label: s("page.card-js"), badge: p.value?.counts.js || void 0 },
970
+ {
971
+ value: "microdata",
972
+ label: s("page.card-microdata"),
973
+ badge: p.value?.counts.microdata || void 0
974
+ }
975
+ ]), K = O(() => {
976
+ const l = p.value?.page.facts.outline;
977
+ return Array.isArray(l) ? l : null;
978
+ }), Y = O(
979
+ () => we.includes(S.value) ? S.value : null
980
+ ), $e = {
981
+ error: "danger",
982
+ warning: "warning",
983
+ notice: "info"
984
+ }, Se = {
985
+ own: "success",
986
+ own_mirror: "warning",
987
+ dev: "danger",
988
+ external: "info"
989
+ }, Ae = O(() => [
990
+ { key: "url", label: s("page.address"), minWidth: 220 },
991
+ { key: "status", label: s("page.field-status"), width: 80 },
992
+ { key: "kind", label: s("page.kind"), width: 90 },
993
+ { key: "anchor", label: s("page.anchor"), minWidth: 140 },
994
+ { key: "host_class", label: s("page.host"), width: 120 }
995
+ ]), Ce = O(() => [
996
+ { key: "url", label: s("page.address"), minWidth: 220 },
997
+ { key: "status", label: s("page.field-status"), width: 80 },
998
+ { key: "bytes", label: s("page.size"), width: 110 },
999
+ ...Y.value === "images" ? [{ key: "alt", label: s("page.alt"), minWidth: 120 }] : [
1000
+ { key: "cache_control", label: s("page.cache"), minWidth: 120 },
1001
+ { key: "compression", label: s("page.field-compression"), width: 100 }
1002
+ ]
1003
+ ]);
1004
+ function ze(l) {
1005
+ try {
1006
+ return JSON.stringify(JSON.parse(l), null, 2);
1007
+ } catch {
1008
+ return l;
1009
+ }
1010
+ }
1011
+ function Te(l) {
1012
+ if (l.bytes === null) return "";
1013
+ const T = l.bytes / 1024, r = T >= 1024 ? `${(T / 1024).toFixed(1)} MB` : `${Math.round(T)} KB`;
1014
+ return l.width && l.height ? `${r} · ${l.width}×${l.height}` : r;
1015
+ }
1016
+ function Ne(l) {
1017
+ const T = l / 1024;
1018
+ return T >= 1024 ? `${(T / 1024).toFixed(1)} MB` : `${T.toFixed(1)} KB`;
1019
+ }
1020
+ const Pe = O(() => {
1021
+ const l = p.value?.page;
1022
+ return l ? [
1023
+ {
1024
+ label: s("page.field-status"),
1025
+ value: String(l.status ?? s("page.status-none")),
1026
+ status: l.status
1027
+ },
1028
+ l.bytes === null ? null : { label: s("page.size"), value: Ne(l.bytes) },
1029
+ l.ttfb_ms === null ? null : { label: s("page.field-ttfb_ms"), value: String(l.ttfb_ms) },
1030
+ l.total_ms === null ? null : { label: s("page.field-total_ms"), value: String(l.total_ms) },
1031
+ l.word_count === null ? null : { label: s("page.field-word_count"), value: String(l.word_count) },
1032
+ { label: s("page.field-links_in"), value: String(l.links_in) },
1033
+ { label: s("page.field-links_out_internal"), value: String(l.links_out_internal) },
1034
+ { label: s("page.field-links_out_external"), value: String(l.links_out_external) },
1035
+ { label: s("page.field-images"), value: String(l.images) },
1036
+ l.images_without_alt ? {
1037
+ label: s("page.field-images_without_alt"),
1038
+ value: String(l.images_without_alt),
1039
+ danger: !0
1040
+ } : null
1041
+ ].filter((r) => r !== null) : [];
1042
+ }), Re = O(() => {
1043
+ const l = p.value?.page;
1044
+ return l ? [
1045
+ [
1046
+ s("page.section-answer"),
1047
+ [
1048
+ [s("page.field-final_status"), l.redirect_to ? l.final_status : null],
1049
+ [s("page.field-redirect_to"), l.redirect_to],
1050
+ [s("page.error"), l.error],
1051
+ [s("page.field-content_type"), l.content_type],
1052
+ [s("page.field-compression"), l.compression]
1053
+ ]
1054
+ ],
1055
+ [
1056
+ s("page.section-crawl"),
1057
+ [
1058
+ [s("page.field-source"), s(`page.source-${l.source}`)],
1059
+ [s("page.field-depth"), l.depth],
1060
+ [s("page.field-indexable"), l.indexable ? s("page.yes") : s("page.no")],
1061
+ [s("page.field-blocked_by_robots"), l.blocked_by_robots ? s("page.yes") : null]
1062
+ ]
1063
+ ],
1064
+ [
1065
+ s("page.section-head"),
1066
+ [
1067
+ [s("page.field-title"), l.title],
1068
+ [s("page.field-description"), l.description],
1069
+ [s("page.field-h1"), l.h1.join(" · ") || null],
1070
+ [
1071
+ s("page.card-headings"),
1072
+ K.value?.length ? { headings: K.value.length, hints: be(K.value, s) } : null
1073
+ ],
1074
+ [s("page.field-canonical"), l.canonical],
1075
+ [s("page.field-robots_meta"), l.robots_meta],
1076
+ [s("page.field-x_robots_tag"), l.x_robots_tag],
1077
+ [s("page.field-lang"), l.lang],
1078
+ [
1079
+ "hreflang",
1080
+ l.hreflang.length ? { pairs: l.hreflang.map((r) => [r.lang, r.url]) } : null
1081
+ ]
1082
+ ]
1083
+ ],
1084
+ [
1085
+ s("page.section-sharing"),
1086
+ [
1087
+ [
1088
+ "Open Graph",
1089
+ Object.keys(l.og).length ? {
1090
+ pairs: Object.entries(l.og).map(([r, W]) => [`og:${r}`, String(W)])
1091
+ } : null
1092
+ ],
1093
+ [
1094
+ "Twitter",
1095
+ Object.keys(l.twitter).length ? {
1096
+ pairs: Object.entries(l.twitter).map(([r, W]) => [
1097
+ `twitter:${r}`,
1098
+ String(W)
1099
+ ])
1100
+ } : null
1101
+ ],
1102
+ [
1103
+ "JSON-LD",
1104
+ l.json_ld.length ? {
1105
+ tags: l.json_ld.flatMap((r) => r.types),
1106
+ error: l.json_ld.find((r) => r.error)?.error ?? null
1107
+ } : null
1108
+ ]
1109
+ ]
1110
+ ]
1111
+ ].map(([r, W]) => ({
1112
+ title: r,
1113
+ facts: W.filter(([, v]) => v != null && v !== "").map(
1114
+ ([v, H]) => [v, typeof H == "object" ? H : String(H)]
1115
+ )
1116
+ })).filter((r) => r.facts.length) : [];
1117
+ });
1118
+ async function Oe(l) {
1119
+ clearTimeout(z), P.value = !1, _.value = null, p.value = null, N.value = null, F.value = null, Q.value = null, S.value = "overview";
1120
+ try {
1121
+ p.value = await c.page(o.run, l);
1122
+ } catch (T) {
1123
+ N.value = L(T);
1124
+ }
1125
+ }
1126
+ async function We(l) {
1127
+ if (!(o.pageId === null || S.value !== "in" && S.value !== "out")) {
1128
+ se.value = !0;
1129
+ try {
1130
+ F.value = await c.links(o.run, o.pageId, {
1131
+ direction: S.value,
1132
+ page: l.page,
1133
+ per_page: l.perPage
1134
+ });
1135
+ } catch (T) {
1136
+ N.value = L(T);
1137
+ } finally {
1138
+ se.value = !1;
1139
+ }
1140
+ }
1141
+ }
1142
+ async function He(l) {
1143
+ const T = Y.value;
1144
+ if (!(o.pageId === null || T === null)) {
1145
+ ae.value = !0;
1146
+ try {
1147
+ Q.value = await c.resources(o.run, o.pageId, {
1148
+ tab: T,
1149
+ page: l.page,
1150
+ per_page: l.perPage
1151
+ });
1152
+ } catch (r) {
1153
+ N.value = L(r);
1154
+ } finally {
1155
+ ae.value = !1;
1156
+ }
1157
+ }
1158
+ }
1159
+ return Z(
1160
+ () => o.pageId,
1161
+ (l) => {
1162
+ l !== null && Oe(l);
1163
+ },
1164
+ { immediate: !0 }
1165
+ ), Z(S, () => {
1166
+ F.value = null, Q.value = null;
1167
+ }), (l, T) => (t(), g(e(Ee), {
1168
+ open: ue.value,
1169
+ "onUpdate:open": T[2] || (T[2] = (r) => ue.value = r),
1170
+ size: "min(1100px, 75vw)",
1171
+ "min-size": 480,
1172
+ resizable: "",
1173
+ persist: "webx-audit.page-card-wide"
1174
+ }, {
1175
+ title: u(() => [
1176
+ k("span", bt, [
1177
+ p.value ? (t(), g(J, {
1178
+ key: 0,
1179
+ code: p.value.page.status
1180
+ }, null, 8, ["code"])) : A("", !0),
1181
+ k("span", wt, d(p.value?.page.url ?? ""), 1)
1182
+ ])
1183
+ ]),
1184
+ extra: u(() => [
1185
+ p.value ? (t(), h("span", xt, [
1186
+ e(b) ? (t(), g(e(B), {
1187
+ key: 0,
1188
+ size: "sm",
1189
+ icon: "refresh",
1190
+ loading: P.value,
1191
+ onClick: E
1192
+ }, {
1193
+ default: u(() => [
1194
+ f(d(e(s)("page.recheck")), 1)
1195
+ ]),
1196
+ _: 1
1197
+ }, 8, ["loading"])) : A("", !0),
1198
+ $(e(B), {
1199
+ size: "sm",
1200
+ variant: "text",
1201
+ icon: "download",
1202
+ href: e(c).pageFile(o.run, p.value.page.id)
1203
+ }, {
1204
+ default: u(() => [
1205
+ f(d(e(s)("page.export-page")), 1)
1206
+ ]),
1207
+ _: 1
1208
+ }, 8, ["href"]),
1209
+ $(e(oe), {
1210
+ href: p.value.page.url,
1211
+ target: "_blank"
1212
+ }, {
1213
+ default: u(() => [
1214
+ f(d(e(s)("page.open-page")), 1)
1215
+ ]),
1216
+ _: 1
1217
+ }, 8, ["href"])
1218
+ ])) : A("", !0)
1219
+ ]),
1220
+ default: u(() => [
1221
+ N.value ? (t(), g(e(C), {
1222
+ key: 0,
1223
+ tone: "danger"
1224
+ }, {
1225
+ default: u(() => [
1226
+ f(d(N.value), 1)
1227
+ ]),
1228
+ _: 1
1229
+ })) : p.value ? (t(), h("div", $t, [
1230
+ P.value ? (t(), g(e(X), {
1231
+ key: 0,
1232
+ type: "info",
1233
+ description: e(s)("page.recheck-running")
1234
+ }, null, 8, ["description"])) : _.value && _.value.status === "done" && _.value.counts ? (t(), g(e(X), {
1235
+ key: 1,
1236
+ type: _.value.counts.new > 0 ? "warning" : "success"
1237
+ }, {
1238
+ default: u(() => [
1239
+ k("div", St, [
1240
+ k("span", null, d(e(s)("page.recheck-fixed", { count: _.value.counts.fixed })), 1),
1241
+ k("span", null, d(e(s)("page.recheck-new", { count: _.value.counts.new })), 1),
1242
+ o.base ? (t(), g(e(B), {
1243
+ key: 0,
1244
+ size: "sm",
1245
+ variant: "text",
1246
+ onClick: M
1247
+ }, {
1248
+ default: u(() => [
1249
+ f(d(e(s)("page.recheck-compare")), 1)
1250
+ ]),
1251
+ _: 1
1252
+ })) : A("", !0)
1253
+ ])
1254
+ ]),
1255
+ _: 1
1256
+ }, 8, ["type"])) : _.value ? (t(), g(e(X), {
1257
+ key: 2,
1258
+ type: "danger",
1259
+ description: _.value.error ?? e(s)(`page.status-${_.value.status}`)
1260
+ }, null, 8, ["description"])) : A("", !0),
1261
+ p.value.page.title ? (t(), g(e(C), {
1262
+ key: 3,
1263
+ weight: "semibold"
1264
+ }, {
1265
+ default: u(() => [
1266
+ f(d(p.value.page.title), 1)
1267
+ ]),
1268
+ _: 1
1269
+ })) : A("", !0),
1270
+ $(e(Me), {
1271
+ modelValue: S.value,
1272
+ "onUpdate:modelValue": T[1] || (T[1] = (r) => S.value = r),
1273
+ items: xe.value
1274
+ }, {
1275
+ default: u(() => [
1276
+ S.value === "overview" ? (t(), h("div", At, [
1277
+ k("div", Ct, [
1278
+ (t(!0), h(w, null, R(Pe.value, (r) => (t(), h("div", {
1279
+ key: r.label,
1280
+ class: "wx-audit-card__tile"
1281
+ }, [
1282
+ $(e(C), {
1283
+ size: "sm",
1284
+ tone: "muted"
1285
+ }, {
1286
+ default: u(() => [
1287
+ f(d(r.label), 1)
1288
+ ]),
1289
+ _: 2
1290
+ }, 1024),
1291
+ r.status !== void 0 ? (t(), g(J, {
1292
+ key: 0,
1293
+ code: r.status,
1294
+ size: "md"
1295
+ }, null, 8, ["code"])) : (t(), g(e(C), {
1296
+ key: 1,
1297
+ weight: "semibold",
1298
+ tone: r.danger ? "danger" : void 0,
1299
+ class: "wx-audit-card__number"
1300
+ }, {
1301
+ default: u(() => [
1302
+ f(d(r.value), 1)
1303
+ ]),
1304
+ _: 2
1305
+ }, 1032, ["tone"]))
1306
+ ]))), 128))
1307
+ ]),
1308
+ (t(!0), h(w, null, R(Re.value, (r) => (t(), h("section", {
1309
+ key: r.title,
1310
+ class: "wx-audit-card__box"
1311
+ }, [
1312
+ k("div", zt, d(r.title), 1),
1313
+ k("dl", Tt, [
1314
+ (t(!0), h(w, null, R(r.facts, ([W, v]) => (t(), h(w, { key: W }, [
1315
+ k("dt", null, d(W), 1),
1316
+ typeof v == "string" ? (t(), h("dd", Nt, d(v), 1)) : "pairs" in v ? (t(), h("dd", Pt, [
1317
+ (t(!0), h(w, null, R(v.pairs, ([H, ne], Ie) => (t(), h(w, { key: Ie }, [
1318
+ k("code", Rt, d(H), 1),
1319
+ k("span", null, d(ne), 1)
1320
+ ], 64))), 128))
1321
+ ])) : "headings" in v ? (t(), h("dd", Ot, [
1322
+ k("span", null, [
1323
+ $(e(C), {
1324
+ tone: v.hints.length ? "warning" : "success"
1325
+ }, {
1326
+ default: u(() => [
1327
+ f(d(v.hints.length ? e(s)("page.headings-summary-bad", { count: v.headings }) : e(s)("page.headings-summary-ok", { count: v.headings })), 1)
1328
+ ]),
1329
+ _: 2
1330
+ }, 1032, ["tone"]),
1331
+ $(e(oe), {
1332
+ as: "button",
1333
+ class: "wx-audit-card__heading-open",
1334
+ onClick: T[0] || (T[0] = (H) => S.value = "headings")
1335
+ }, {
1336
+ default: u(() => [
1337
+ f(d(e(s)("page.headings-open")), 1)
1338
+ ]),
1339
+ _: 1
1340
+ })
1341
+ ]),
1342
+ v.hints.length ? (t(), h("ul", Wt, [
1343
+ (t(!0), h(w, null, R(v.hints, (H) => (t(), h("li", { key: H }, d(H), 1))), 128))
1344
+ ])) : A("", !0)
1345
+ ])) : (t(), h("dd", Ht, [
1346
+ (t(!0), h(w, null, R(v.tags, (H, ne) => (t(), g(e(j), {
1347
+ key: ne,
1348
+ type: "info",
1349
+ size: "sm"
1350
+ }, {
1351
+ default: u(() => [
1352
+ f(d(H), 1)
1353
+ ]),
1354
+ _: 2
1355
+ }, 1024))), 128)),
1356
+ v.error ? (t(), g(e(C), {
1357
+ key: 0,
1358
+ size: "sm",
1359
+ tone: "danger"
1360
+ }, {
1361
+ default: u(() => [
1362
+ f(d(v.error), 1)
1363
+ ]),
1364
+ _: 2
1365
+ }, 1024)) : A("", !0)
1366
+ ]))
1367
+ ], 64))), 128))
1368
+ ])
1369
+ ]))), 128)),
1370
+ Object.keys(p.value.page.headers).length ? (t(), h("section", It, [
1371
+ k("div", jt, d(e(s)("page.headers")), 1),
1372
+ k("dl", Ft, [
1373
+ (t(!0), h(w, null, R(p.value.page.headers, (r, W) => (t(), h(w, { key: W }, [
1374
+ k("dt", Lt, d(W), 1),
1375
+ k("dd", Et, d(r), 1)
1376
+ ], 64))), 128))
1377
+ ])
1378
+ ])) : A("", !0)
1379
+ ])) : S.value === "headings" ? (t(), h("div", Ut, [
1380
+ $(kt, {
1381
+ outline: K.value,
1382
+ counts: p.value.page.headings
1383
+ }, null, 8, ["outline", "counts"])
1384
+ ])) : S.value === "issues" ? (t(), h("div", Mt, [
1385
+ p.value.issues.length ? A("", !0) : (t(), g(e(C), {
1386
+ key: 0,
1387
+ tone: "muted"
1388
+ }, {
1389
+ default: u(() => [
1390
+ f(d(e(s)("page.no-issues")), 1)
1391
+ ]),
1392
+ _: 1
1393
+ })),
1394
+ (t(!0), h(w, null, R(p.value.issues, (r) => (t(), h("div", {
1395
+ key: r.id,
1396
+ class: "wx-audit-card__box"
1397
+ }, [
1398
+ k("div", Bt, [
1399
+ $(e(j), {
1400
+ type: $e[r.severity],
1401
+ dot: ""
1402
+ }, {
1403
+ default: u(() => [
1404
+ f(d(e(s)(`page.severity-${r.severity}`)), 1)
1405
+ ]),
1406
+ _: 2
1407
+ }, 1032, ["type"]),
1408
+ $(e(C), {
1409
+ size: "sm",
1410
+ weight: "semibold"
1411
+ }, {
1412
+ default: u(() => [
1413
+ f(d(o.titles[r.check] ?? r.check), 1)
1414
+ ]),
1415
+ _: 2
1416
+ }, 1024),
1417
+ r.state === "new" ? (t(), g(e(j), {
1418
+ key: 0,
1419
+ type: "primary",
1420
+ size: "sm"
1421
+ }, {
1422
+ default: u(() => [
1423
+ f(d(e(s)("page.state-new")), 1)
1424
+ ]),
1425
+ _: 1
1426
+ })) : A("", !0),
1427
+ r.details.count != null && r.details.table ? (t(), g(e(te), {
1428
+ key: 1,
1429
+ content: r.details.summary ?? void 0,
1430
+ disabled: !r.details.summary
1431
+ }, {
1432
+ default: u(() => [
1433
+ $(e(j), {
1434
+ round: "",
1435
+ size: "sm"
1436
+ }, {
1437
+ default: u(() => [
1438
+ f(d(r.details.count), 1)
1439
+ ]),
1440
+ _: 2
1441
+ }, 1024)
1442
+ ]),
1443
+ _: 2
1444
+ }, 1032, ["content", "disabled"])) : A("", !0)
1445
+ ]),
1446
+ k("div", Dt, [
1447
+ $(ht, {
1448
+ details: r.details,
1449
+ counted: r.details.count != null && !!r.details.table
1450
+ }, null, 8, ["details", "counted"])
1451
+ ])
1452
+ ]))), 128))
1453
+ ])) : Y.value ? (t(), g(e(he), {
1454
+ key: `resources-${String(S.value)}`,
1455
+ data: Q.value,
1456
+ columns: Ce.value,
1457
+ "row-key": "id",
1458
+ flush: "",
1459
+ loading: ae.value,
1460
+ "per-page-options": [],
1461
+ "empty-text": e(s)("page.no-resources"),
1462
+ onStateChange: He
1463
+ }, {
1464
+ "cell-url": u(({ row: r }) => [
1465
+ Y.value === "images" ? (t(), h("span", Vt, [
1466
+ $(e(Be), {
1467
+ src: e(re)(r) ? r.url : void 0,
1468
+ alt: r.alt ?? "",
1469
+ width: 48,
1470
+ height: 48,
1471
+ fit: "cover",
1472
+ radius: "var(--wx-radius-sm)",
1473
+ preview: "",
1474
+ "preview-label": e(s)("page.view-full"),
1475
+ class: le(["wx-audit-card__thumb", { "is-unviewable": !e(re)(r) }])
1476
+ }, Fe({ _: 2 }, [
1477
+ e(re)(r) ? void 0 : {
1478
+ name: "placeholder",
1479
+ fn: u(() => [
1480
+ $(e(ve), { name: "image" })
1481
+ ]),
1482
+ key: "0"
1483
+ }
1484
+ ]), 1032, ["src", "alt", "preview-label", "class"]),
1485
+ k("span", qt, d(r.url), 1)
1486
+ ])) : (t(), h("span", Gt, d(r.url), 1)),
1487
+ r.location ? (t(), g(e(C), {
1488
+ key: 2,
1489
+ size: "sm",
1490
+ tone: "muted",
1491
+ class: "wx-audit-card__url"
1492
+ }, {
1493
+ default: u(() => [
1494
+ f(" → " + d(r.location), 1)
1495
+ ]),
1496
+ _: 2
1497
+ }, 1024)) : A("", !0),
1498
+ r.error ? (t(), g(e(C), {
1499
+ key: 3,
1500
+ size: "sm",
1501
+ tone: "danger"
1502
+ }, {
1503
+ default: u(() => [
1504
+ f(d(r.error), 1)
1505
+ ]),
1506
+ _: 2
1507
+ }, 1024)) : A("", !0)
1508
+ ]),
1509
+ "cell-status": u(({ row: r }) => [
1510
+ r.status !== null || r.checked ? (t(), g(J, {
1511
+ key: 0,
1512
+ code: r.status
1513
+ }, null, 8, ["code"])) : (t(), g(e(C), {
1514
+ key: 1,
1515
+ size: "sm",
1516
+ tone: "muted"
1517
+ }, {
1518
+ default: u(() => [
1519
+ f(d(e(s)("page.not-checked")), 1)
1520
+ ]),
1521
+ _: 1
1522
+ }))
1523
+ ]),
1524
+ "cell-bytes": u(({ row: r }) => [
1525
+ f(d(Te(r)), 1)
1526
+ ]),
1527
+ "cell-alt": u(({ row: r }) => [
1528
+ r.alt === null && r.kind === "img" ? (t(), g(e(C), {
1529
+ key: 0,
1530
+ size: "sm",
1531
+ tone: "danger"
1532
+ }, {
1533
+ default: u(() => [
1534
+ f(d(e(s)("page.missing")), 1)
1535
+ ]),
1536
+ _: 1
1537
+ })) : (t(), h(w, { key: 1 }, [
1538
+ f(d(r.alt ?? ""), 1)
1539
+ ], 64))
1540
+ ]),
1541
+ _: 1
1542
+ }, 8, ["data", "columns", "loading", "empty-text"])) : S.value === "microdata" ? (t(), h("div", Kt, [
1543
+ p.value.page.json_ld.length ? A("", !0) : (t(), g(e(C), {
1544
+ key: 0,
1545
+ tone: "muted"
1546
+ }, {
1547
+ default: u(() => [
1548
+ f(d(e(s)("page.no-json-ld")), 1)
1549
+ ]),
1550
+ _: 1
1551
+ })),
1552
+ (t(!0), h(w, null, R(p.value.page.json_ld, (r, W) => (t(), h("div", {
1553
+ key: W,
1554
+ class: "wx-audit-card__issue"
1555
+ }, [
1556
+ k("div", Jt, [
1557
+ $(e(C), {
1558
+ size: "sm",
1559
+ weight: "semibold"
1560
+ }, {
1561
+ default: u(() => [
1562
+ f(d(e(s)("page.jsonld-block", { number: W + 1 })), 1)
1563
+ ]),
1564
+ _: 2
1565
+ }, 1024),
1566
+ (t(!0), h(w, null, R(r.types, (v) => (t(), g(e(j), {
1567
+ key: v,
1568
+ size: "sm"
1569
+ }, {
1570
+ default: u(() => [
1571
+ f(d(v), 1)
1572
+ ]),
1573
+ _: 2
1574
+ }, 1024))), 128))
1575
+ ]),
1576
+ r.error ? (t(), g(e(C), {
1577
+ key: 0,
1578
+ size: "sm",
1579
+ tone: "danger"
1580
+ }, {
1581
+ default: u(() => [
1582
+ f(d(e(s)("page.jsonld-error")) + " " + d(r.error), 1)
1583
+ ]),
1584
+ _: 2
1585
+ }, 1024)) : A("", !0),
1586
+ (t(!0), h(w, null, R(r.items ?? [], (v, H) => (t(), h(w, { key: H }, [
1587
+ v.missing.length ? (t(), g(e(C), {
1588
+ key: 0,
1589
+ size: "sm",
1590
+ tone: "danger"
1591
+ }, {
1592
+ default: u(() => [
1593
+ f(d(v.type) + " — " + d(e(s)("page.jsonld-required")) + " " + d(v.missing.join(", ")), 1)
1594
+ ]),
1595
+ _: 2
1596
+ }, 1024)) : A("", !0),
1597
+ v.recommended.length ? (t(), g(e(C), {
1598
+ key: 1,
1599
+ size: "sm",
1600
+ tone: "muted"
1601
+ }, {
1602
+ default: u(() => [
1603
+ f(d(v.type) + " — " + d(e(s)("page.jsonld-recommended")) + " " + d(v.recommended.join(", ")), 1)
1604
+ ]),
1605
+ _: 2
1606
+ }, 1024)) : A("", !0),
1607
+ !v.missing.length && !v.recommended.length ? (t(), g(e(C), {
1608
+ key: 2,
1609
+ size: "sm",
1610
+ tone: "success"
1611
+ }, {
1612
+ default: u(() => [
1613
+ f(d(v.type) + " — " + d(e(s)("page.jsonld-complete")), 1)
1614
+ ]),
1615
+ _: 2
1616
+ }, 1024)) : A("", !0)
1617
+ ], 64))), 128)),
1618
+ r.source ? (t(), h("pre", Xt, d(ze(r.source)), 1)) : A("", !0)
1619
+ ]))), 128))
1620
+ ])) : (t(), g(e(he), {
1621
+ key: String(S.value),
1622
+ data: F.value,
1623
+ columns: Ae.value,
1624
+ "row-key": "id",
1625
+ flush: "",
1626
+ loading: se.value,
1627
+ "per-page-options": [],
1628
+ "empty-text": e(s)("page.no-links"),
1629
+ onStateChange: We
1630
+ }, {
1631
+ "cell-url": u(({ row: r }) => [
1632
+ k("span", Qt, d(r.url ?? "—"), 1)
1633
+ ]),
1634
+ "cell-status": u(({ row: r }) => [
1635
+ r.status !== null ? (t(), g(J, {
1636
+ key: 0,
1637
+ code: r.status
1638
+ }, null, 8, ["code"])) : A("", !0)
1639
+ ]),
1640
+ "cell-host_class": u(({ row: r }) => [
1641
+ r.host_class ? (t(), g(e(j), {
1642
+ key: 0,
1643
+ type: Se[r.host_class] ?? "info",
1644
+ size: "sm"
1645
+ }, {
1646
+ default: u(() => [
1647
+ f(d(e(s)(`page.host-${r.host_class}`)), 1)
1648
+ ]),
1649
+ _: 2
1650
+ }, 1032, ["type"])) : A("", !0)
1651
+ ]),
1652
+ _: 1
1653
+ }, 8, ["data", "columns", "loading", "empty-text"]))
1654
+ ]),
1655
+ _: 1
1656
+ }, 8, ["modelValue", "items"])
1657
+ ])) : (t(), g(e(Ue), {
1658
+ key: 1,
1659
+ rows: 6
1660
+ }))
1661
+ ]),
1662
+ _: 1
1663
+ }, 8, ["open"]));
1664
+ }
1665
+ }), os = /* @__PURE__ */ q(Zt, [["__scopeId", "data-v-b5c4ea4d"]]), es = { class: "wx-audit-hide" }, ts = /* @__PURE__ */ U({
1666
+ __name: "AuditHideDialog",
1667
+ props: /* @__PURE__ */ ce({
1668
+ issue: {},
1669
+ title: {}
1670
+ }, {
1671
+ open: { type: Boolean, default: !1 },
1672
+ openModifiers: {}
1673
+ }),
1674
+ emits: /* @__PURE__ */ ce(["hidden"], ["update:open"]),
1675
+ setup(i, { emit: n }) {
1676
+ const o = i, m = n, a = Le(i, "open"), c = ke(de());
1677
+ G();
1678
+ const y = V("webx-audit"), b = ye(), _ = I(""), P = I(""), z = I(null), E = I(!1);
1679
+ let x;
1680
+ function M(N) {
1681
+ if (!N) return "";
1682
+ try {
1683
+ const S = new URL(N);
1684
+ return S.pathname + S.search;
1685
+ } catch {
1686
+ return N;
1687
+ }
1688
+ }
1689
+ const s = O(() => P.value.trim() !== "");
1690
+ function L() {
1691
+ clearTimeout(x), x = setTimeout(async () => {
1692
+ try {
1693
+ z.value = await c.hidePreview({ check: o.issue.check, pattern: _.value });
1694
+ } catch {
1695
+ z.value = null;
1696
+ }
1697
+ }, 300);
1698
+ }
1699
+ async function p() {
1700
+ E.value = !0;
1701
+ try {
1702
+ const N = await c.hide({
1703
+ check: o.issue.check,
1704
+ pattern: _.value,
1705
+ reason: P.value
1706
+ });
1707
+ ee.success(y("page.hidden-done")), m("hidden", N), a.value = !1;
1708
+ } catch (N) {
1709
+ ee.danger(b(N));
1710
+ } finally {
1711
+ E.value = !1;
1712
+ }
1713
+ }
1714
+ return Z(
1715
+ [a, () => o.issue.id],
1716
+ ([N]) => {
1717
+ N && (_.value = M(o.issue.url), P.value = "", z.value = null, L());
1718
+ },
1719
+ { immediate: !0 }
1720
+ ), Z(_, () => {
1721
+ a.value && L();
1722
+ }), (N, S) => (t(), g(e(De), {
1723
+ open: a.value,
1724
+ "onUpdate:open": S[3] || (S[3] = (F) => a.value = F),
1725
+ title: e(y)("page.hide-title"),
1726
+ width: 560
1727
+ }, {
1728
+ footer: u(() => [
1729
+ $(e(B), {
1730
+ onClick: S[2] || (S[2] = (F) => a.value = !1)
1731
+ }, {
1732
+ default: u(() => [
1733
+ f(d(e(y)("page.dismiss")), 1)
1734
+ ]),
1735
+ _: 1
1736
+ }),
1737
+ $(e(B), {
1738
+ type: "primary",
1739
+ loading: E.value,
1740
+ disabled: !s.value,
1741
+ onClick: p
1742
+ }, {
1743
+ default: u(() => [
1744
+ f(d(e(y)("page.hide")), 1)
1745
+ ]),
1746
+ _: 1
1747
+ }, 8, ["loading", "disabled"])
1748
+ ]),
1749
+ default: u(() => [
1750
+ k("div", es, [
1751
+ $(e(C), { weight: "semibold" }, {
1752
+ default: u(() => [
1753
+ f(d(o.title), 1)
1754
+ ]),
1755
+ _: 1
1756
+ }),
1757
+ $(e(C), {
1758
+ size: "sm",
1759
+ tone: "muted"
1760
+ }, {
1761
+ default: u(() => [
1762
+ f(d(e(y)("page.hide-help")), 1)
1763
+ ]),
1764
+ _: 1
1765
+ }),
1766
+ $(e(pe), {
1767
+ label: e(y)("page.hide-pattern"),
1768
+ help: e(y)("page.hide-pattern-help")
1769
+ }, {
1770
+ default: u(() => [
1771
+ $(e(Ve), {
1772
+ modelValue: _.value,
1773
+ "onUpdate:modelValue": S[0] || (S[0] = (F) => _.value = F),
1774
+ placeholder: "/search/**"
1775
+ }, null, 8, ["modelValue"])
1776
+ ]),
1777
+ _: 1
1778
+ }, 8, ["label", "help"]),
1779
+ $(e(pe), {
1780
+ label: e(y)("page.hide-reason"),
1781
+ required: ""
1782
+ }, {
1783
+ default: u(() => [
1784
+ $(e(qe), {
1785
+ modelValue: P.value,
1786
+ "onUpdate:modelValue": S[1] || (S[1] = (F) => P.value = F),
1787
+ rows: 3
1788
+ }, null, 8, ["modelValue"])
1789
+ ]),
1790
+ _: 1
1791
+ }, 8, ["label"]),
1792
+ z.value !== null ? (t(), g(e(C), {
1793
+ key: 0,
1794
+ size: "sm",
1795
+ tone: "muted"
1796
+ }, {
1797
+ default: u(() => [
1798
+ f(d(e(y)("page.hide-count", { count: z.value })), 1)
1799
+ ]),
1800
+ _: 1
1801
+ })) : A("", !0)
1802
+ ])
1803
+ ]),
1804
+ _: 1
1805
+ }, 8, ["open", "title"]));
1806
+ }
1807
+ }), ls = /* @__PURE__ */ q(ts, [["__scopeId", "data-v-1db364c4"]]), ds = {
1808
+ url: "url",
1809
+ status: "status",
1810
+ final_status: "status",
1811
+ redirect_to: "url",
1812
+ source: "source",
1813
+ depth: "number",
1814
+ indexable: "bool",
1815
+ issues: "number",
1816
+ title: "text",
1817
+ description: "text",
1818
+ h1: "text",
1819
+ canonical: "url",
1820
+ robots_meta: "text",
1821
+ x_robots_tag: "text",
1822
+ lang: "text",
1823
+ content_type: "text",
1824
+ bytes: "number",
1825
+ ttfb_ms: "number",
1826
+ total_ms: "number",
1827
+ compression: "text",
1828
+ word_count: "number",
1829
+ links_in: "number",
1830
+ links_out_internal: "number",
1831
+ links_out_external: "number",
1832
+ images: "number",
1833
+ images_without_alt: "number",
1834
+ in_sitemap: "bool",
1835
+ in_registry: "bool",
1836
+ blocked_by_robots: "bool"
1837
+ }, us = [
1838
+ "url",
1839
+ "status",
1840
+ "indexable",
1841
+ "title",
1842
+ "word_count",
1843
+ "links_in",
1844
+ "issues"
1845
+ ], cs = ["h1"], hs = {
1846
+ url: ["contains", "eq", "empty", "filled"],
1847
+ text: ["contains", "eq", "empty", "filled"],
1848
+ number: ["gt", "lt", "eq", "empty"],
1849
+ status: ["eq", "gt", "lt", "empty"],
1850
+ bool: ["yes", "no"],
1851
+ source: ["eq"]
1852
+ }, ps = ["contains", "eq", "gt", "lt"], gs = ["home", "sitemap", "registry", "link"], fs = D(() => import("./AuditOverviewPage-gVpdBOAY.js")), _s = D(() => import("./AuditIssuesPage-BjTPgAnD.js")), ms = D(() => import("./AuditPagesPage-DNgZo-K-.js")), ys = D(() => import("./AuditHostsPage-YFRORYHZ.js")), vs = D(() => import("./AuditRunsPage-BbWsuATw.js")), ks = D(() => import("./AuditSettingsPage-HwfdLU_s.js"));
1853
+ export {
1854
+ fe as A,
1855
+ cs as C,
1856
+ us as D,
1857
+ hs as O,
1858
+ ds as P,
1859
+ gs as S,
1860
+ ps as W,
1861
+ q as _,
1862
+ it as a,
1863
+ J as b,
1864
+ ke as c,
1865
+ Ke as d,
1866
+ ht as e,
1867
+ ls as f,
1868
+ os as g,
1869
+ ys as h,
1870
+ _s as i,
1871
+ fs as j,
1872
+ ms as k,
1873
+ vs as l,
1874
+ ks as m,
1875
+ rs as n,
1876
+ Ge as o,
1877
+ ge as p,
1878
+ G as u
1879
+ };
1880
+ //# sourceMappingURL=index-BFYHJYU_.js.map