shapewall 0.3.0 → 0.3.1

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.
Files changed (24) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/agent/package-lock.json +2 -2
  3. package/dist/client/assets/{BoardChat-CupOxioV.js → BoardChat-V1BCXdDB.js} +1 -1
  4. package/dist/client/assets/{ChecksPanel-BqrS02Ih.js → ChecksPanel-Cm22bCdQ.js} +1 -1
  5. package/dist/client/assets/{History-CQG3NQOC.js → History-U0bD1BjA.js} +1 -1
  6. package/dist/client/assets/{LocalSettings-CSNMhNyV.js → LocalSettings-DOSuW7VC.js} +1 -1
  7. package/dist/client/assets/{Management-CJVNAqAW.js → Management-BFcKFdbp.js} +1 -1
  8. package/dist/client/assets/{QuickConnect-B-4pUgXH.js → QuickConnect-DyfPSWbV.js} +1 -1
  9. package/dist/client/assets/{app-update-dialog-rhaw0MRk.js → app-update-dialog-DH2Mgby8.js} +1 -1
  10. package/dist/client/assets/{index-DKOCIQiq.js → index-C9S7HL_o.js} +3 -3
  11. package/dist/client/build-info.json +1 -1
  12. package/dist/client/index.html +1 -1
  13. package/dist/client/sw.js +2 -2
  14. package/dist/console/assets/{LocalAccountsApp-DOKZI6Lt.js → LocalAccountsApp-lJjkhUcH.js} +1 -1
  15. package/dist/console/assets/{LocalConsole-DXzldLW9.js → LocalConsole-BZHqYKnt.js} +1 -1
  16. package/dist/console/assets/{app-update-dialog-CrqIMEwN.js → app-update-dialog-DCM9sYE3.js} +1 -1
  17. package/dist/console/assets/{console-76WovHlh.js → console-C2LsvEco.js} +3 -3
  18. package/dist/console/build-info.json +1 -1
  19. package/dist/console/console.html +1 -1
  20. package/docs/pull-requests.md +3 -2
  21. package/package.json +1 -1
  22. package/src/agent/starter/worktree.js +32 -4
  23. package/src/ci/workflow.js +14 -3
  24. package/src/cli/init.js +8 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4
4
  and the project uses [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## 0.3.1 - 2026-11-10
7
+
8
+ - Starter agent: the push of the agent's branch no longer follows settings in the repository's Git config that would run another
9
+ program. The transport is limited to https, http, ssh and local paths (no `ext::` or other remote helpers, whatever
10
+ `protocol.*.allow` says), `remote.<name>.receivepack` is ignored, and the push is never signed. Your credential helper and ssh setup
11
+ are still used: that is how the push reaches your remote.
12
+ - `shapewall init --ci` gives the comment job `contents: write` when the config has `"ci": { "images": "branch" }`, so the images
13
+ branch can be pushed. Before, the generated workflow always had `contents: read` and the comment fell back to links.
14
+
6
15
  ## 0.3.0 - 2026-11-10
7
16
 
8
17
  - Agent works on a branch: an option, off by default, that runs an ACP agent's fixes and chat turns in a copy of your checkout and
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "shapewall",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "shapewall",
9
- "version": "0.3.0",
9
+ "version": "0.3.1",
10
10
  "license": "Apache-2.0 AND FSL-1.1-ALv2",
11
11
  "dependencies": {
12
12
  "@agentclientprotocol/sdk": "2.4.0",
@@ -1,4 +1,4 @@
1
- import{$ as e,$t as t,A as n,B as r,D as i,Dt as a,E as o,F as s,Gt as c,H as l,Ht as u,I as d,Jt as f,Kt as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,T as S,Ut as C,V as w,Wt as T,Xt as E,_ as D,b as O,c as k,ct as A,d as j,et as M,g as N,k as P,lt as F,p as I,pt as ee,qt as L,r as R,t as z,tt as B,u as V,w as te,wt as H,x as U,y as W,yt as ne}from"./ui-Cg4TTrec.js";import{$ as re,A as ie,B as ae,C as oe,Ct as se,D as ce,E as le,F as ue,G,H as de,I as fe,J as pe,K,L as me,M as he,N as ge,O as _e,P as ve,Q as ye,R as be,St as xe,T as Se,U as Ce,X as we,Y as Te,Z as Ee,_ as q,_t as De,at as Oe,b as ke,c as Ae,ct as je,d as Me,et as Ne,f as Pe,ft as Fe,g as Ie,gt as Le,h as Re,ht as ze,it as Be,j as Ve,k as He,l as Ue,mt as We,nt as Ge,p as Ke,pt as qe,rt as J,s as Je,st as Y,u as Ye,v as Xe,vt as X,wt as Ze,xt as Z,y as Qe,yt as $e,z as et}from"./index-DKOCIQiq.js";import{c as tt,l as nt,o as rt,r as it,s as at,t as ot,u as st}from"./QuickConnect-B-4pUgXH.js";import{n as ct,t as lt}from"./circle-x-PRxj7kPi.js";import{n as ut,t as dt}from"./shield-check-DuPBJ6H_.js";import{t as ft}from"./refresh-cw-aeOBDuGQ.js";var pt={name:`archive-arrow-up`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]],aliases:[`archive-restore`]};pt.node;var mt=L(pt),ht={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};ht.node;var gt=L(ht),_t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};_t.node;var vt=L(_t),yt={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};yt.node;var bt=L(yt),xt={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};xt.node;var St=L(xt),Ct={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ct.node;var wt=L(Ct),Tt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Tt.node;var Et=L(Tt),Dt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Dt.node;var Ot=L(Dt),kt={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};kt.node;var At=L(kt),jt={name:`file-minus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}]]};jt.node;var Mt=L(jt),Nt={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Nt.node;var Pt=L(Nt),Ft={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Ft.node;var It=L(Ft),Lt={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Lt.node;var Rt=L(Lt),zt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};zt.node;var Bt=L(zt),Vt={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Vt.node;var Ht=L(Vt),Ut={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};Ut.node;var Wt=L(Ut),Gt={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};Gt.node;var Kt=L(Gt),qt={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};qt.node;var Jt=L(qt),Yt={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Yt.node;var Xt=L(Yt),Zt={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};Zt.node;var Qt=L(Zt),$t={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};$t.node;var en=L($t),tn={name:`square-dashed-mouse-pointer`,size:24,node:[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]],aliases:[`mouse-pointer-square-dashed`]};tn.node;var nn=L(tn),rn={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};rn.node;var an=L(rn),on={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};on.node;var sn=L(on),cn={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};cn.node;var ln=L(cn),un={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};un.node;var dn=L(un),fn={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};fn.node;var pn=L(fn),mn={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};mn.node;var hn=L(mn),gn={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};gn.node;var _n=L(gn),vn=new Set([`agent_auth`,`agent_start`,`agent_not_found`]),yn=e=>vn.has(e?.code),Q=t(E(),1),bn=new Set(`abstract and as async await break case catch class const continue def default defer del do elif else enum except export extends false finally fn for from func function go if impl import in instanceof interface is lambda let loop match mod mut new nil none not null of or package pass private protected pub public raise return self static struct super switch then this throw true try type typeof undefined use var void where while with yield fi done esac echo local readonly select insert update delete create table into values set drop alter and important`.split(` `)),xn=new Set([`sh`,`bash`,`zsh`,`shell`,`console`,`py`,`python`,`rb`,`ruby`,`yaml`,`yml`,`toml`,`ini`,`conf`,`dockerfile`,`make`,`makefile`,`r`,`perl`,`pl`,`nginx`,`caddyfile`]),Sn=new Set([`html`,`htm`,`xml`,`svg`,`vue`,`svelte`,`jsx`,`tsx`,`astro`]),Cn=new Set([`diff`,`patch`]),wn=new Set([`sql`,`psql`,`sqlite`,`mysql`]),Tn={js:`JavaScript`,javascript:`JavaScript`,mjs:`JavaScript`,cjs:`JavaScript`,jsx:`JSX`,ts:`TypeScript`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,html:`HTML`,css:`CSS`,scss:`SCSS`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,shell:`Shell`,console:`Terminal`,py:`Python`,python:`Python`,rb:`Ruby`,ruby:`Ruby`,go:`Go`,rs:`Rust`,rust:`Rust`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,md:`Markdown`,markdown:`Markdown`,sql:`SQL`,diff:`Diff`,patch:`Diff`,xml:`XML`,svg:`SVG`,vue:`Vue`,svelte:`Svelte`,php:`PHP`,java:`Java`,kt:`Kotlin`,kotlin:`Kotlin`,swift:`Swift`,c:`C`,cpp:`C++`,cs:`C#`,dockerfile:`Dockerfile`,txt:`Text`,text:`Text`,plaintext:`Text`},En=e=>{let t=String(e||``).toLowerCase();return t?Tn[t]||t.slice(0,24):`Code`},Dn=4e4;function On(e,t){let n=String(e||``),r=String(t||``).toLowerCase();if(!n||n.length>Dn||[`txt`,`text`,`plaintext`].includes(r))return[{type:`plain`,text:n}];if(Cn.has(r))return n.split(`
1
+ import{$ as e,$t as t,A as n,B as r,D as i,Dt as a,E as o,F as s,Gt as c,H as l,Ht as u,I as d,Jt as f,Kt as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,T as S,Ut as C,V as w,Wt as T,Xt as E,_ as D,b as O,c as k,ct as A,d as j,et as M,g as N,k as P,lt as F,p as I,pt as ee,qt as L,r as R,t as z,tt as B,u as V,w as te,wt as H,x as U,y as W,yt as ne}from"./ui-Cg4TTrec.js";import{$ as re,A as ie,B as ae,C as oe,Ct as se,D as ce,E as le,F as ue,G,H as de,I as fe,J as pe,K,L as me,M as he,N as ge,O as _e,P as ve,Q as ye,R as be,St as xe,T as Se,U as Ce,X as we,Y as Te,Z as Ee,_ as q,_t as De,at as Oe,b as ke,c as Ae,ct as je,d as Me,et as Ne,f as Pe,ft as Fe,g as Ie,gt as Le,h as Re,ht as ze,it as Be,j as Ve,k as He,l as Ue,mt as We,nt as Ge,p as Ke,pt as qe,rt as J,s as Je,st as Y,u as Ye,v as Xe,vt as X,wt as Ze,xt as Z,y as Qe,yt as $e,z as et}from"./index-C9S7HL_o.js";import{c as tt,l as nt,o as rt,r as it,s as at,t as ot,u as st}from"./QuickConnect-DyfPSWbV.js";import{n as ct,t as lt}from"./circle-x-PRxj7kPi.js";import{n as ut,t as dt}from"./shield-check-DuPBJ6H_.js";import{t as ft}from"./refresh-cw-aeOBDuGQ.js";var pt={name:`archive-arrow-up`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]],aliases:[`archive-restore`]};pt.node;var mt=L(pt),ht={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};ht.node;var gt=L(ht),_t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};_t.node;var vt=L(_t),yt={name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]};yt.node;var bt=L(yt),xt={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};xt.node;var St=L(xt),Ct={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Ct.node;var wt=L(Ct),Tt={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Tt.node;var Et=L(Tt),Dt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Dt.node;var Ot=L(Dt),kt={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};kt.node;var At=L(kt),jt={name:`file-minus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}]]};jt.node;var Mt=L(jt),Nt={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Nt.node;var Pt=L(Nt),Ft={name:`file-plus`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Ft.node;var It=L(Ft),Lt={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};Lt.node;var Rt=L(Lt),zt={name:`git-commit-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]],aliases:[`git-commit`]};zt.node;var Bt=L(zt),Vt={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Vt.node;var Ht=L(Vt),Ut={name:`mic`,size:24,node:[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]};Ut.node;var Wt=L(Ut),Gt={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};Gt.node;var Kt=L(Gt),qt={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};qt.node;var Jt=L(qt),Yt={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Yt.node;var Xt=L(Yt),Zt={name:`scissors`,size:24,node:[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]};Zt.node;var Qt=L(Zt),$t={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};$t.node;var en=L($t),tn={name:`square-dashed-mouse-pointer`,size:24,node:[[`path`,{d:`M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z`,key:`xwnzip`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h2`,key:`1qve2z`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v2`,key:`p14lih`}],[`path`,{d:`M3 14v1`,key:`vnatye`}]],aliases:[`mouse-pointer-square-dashed`]};tn.node;var nn=L(tn),rn={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};rn.node;var an=L(rn),on={name:`thumbs-down`,size:24,node:[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]};on.node;var sn=L(on),cn={name:`thumbs-up`,size:24,node:[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]};cn.node;var ln=L(cn),un={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};un.node;var dn=L(un),fn={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};fn.node;var pn=L(fn),mn={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};mn.node;var hn=L(mn),gn={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};gn.node;var _n=L(gn),vn=new Set([`agent_auth`,`agent_start`,`agent_not_found`]),yn=e=>vn.has(e?.code),Q=t(E(),1),bn=new Set(`abstract and as async await break case catch class const continue def default defer del do elif else enum except export extends false finally fn for from func function go if impl import in instanceof interface is lambda let loop match mod mut new nil none not null of or package pass private protected pub public raise return self static struct super switch then this throw true try type typeof undefined use var void where while with yield fi done esac echo local readonly select insert update delete create table into values set drop alter and important`.split(` `)),xn=new Set([`sh`,`bash`,`zsh`,`shell`,`console`,`py`,`python`,`rb`,`ruby`,`yaml`,`yml`,`toml`,`ini`,`conf`,`dockerfile`,`make`,`makefile`,`r`,`perl`,`pl`,`nginx`,`caddyfile`]),Sn=new Set([`html`,`htm`,`xml`,`svg`,`vue`,`svelte`,`jsx`,`tsx`,`astro`]),Cn=new Set([`diff`,`patch`]),wn=new Set([`sql`,`psql`,`sqlite`,`mysql`]),Tn={js:`JavaScript`,javascript:`JavaScript`,mjs:`JavaScript`,cjs:`JavaScript`,jsx:`JSX`,ts:`TypeScript`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,html:`HTML`,css:`CSS`,scss:`SCSS`,sh:`Shell`,bash:`Bash`,zsh:`Zsh`,shell:`Shell`,console:`Terminal`,py:`Python`,python:`Python`,rb:`Ruby`,ruby:`Ruby`,go:`Go`,rs:`Rust`,rust:`Rust`,yaml:`YAML`,yml:`YAML`,toml:`TOML`,md:`Markdown`,markdown:`Markdown`,sql:`SQL`,diff:`Diff`,patch:`Diff`,xml:`XML`,svg:`SVG`,vue:`Vue`,svelte:`Svelte`,php:`PHP`,java:`Java`,kt:`Kotlin`,kotlin:`Kotlin`,swift:`Swift`,c:`C`,cpp:`C++`,cs:`C#`,dockerfile:`Dockerfile`,txt:`Text`,text:`Text`,plaintext:`Text`},En=e=>{let t=String(e||``).toLowerCase();return t?Tn[t]||t.slice(0,24):`Code`},Dn=4e4;function On(e,t){let n=String(e||``),r=String(t||``).toLowerCase();if(!n||n.length>Dn||[`txt`,`text`,`plaintext`].includes(r))return[{type:`plain`,text:n}];if(Cn.has(r))return n.split(`
2
2
  `).map(e=>({line:!0,type:/^\+(?!\+\+)/.test(e)?`add`:/^-(?!--)/.test(e)?`del`:/^(@@|\+\+\+|---|diff |index )/.test(e)?`meta`:`plain`,text:e}));let i=xn.has(r),a=wn.has(r),o=[String.raw`\/\*[\s\S]*?(?:\*\/|$)`,String.raw`<!--[\s\S]*?(?:-->|$)`,i?String.raw`(?<![\w$&])#(?![!{]).*`:String.raw`(?<![:\w])\/\/.*`,a?String.raw`--.*`:null,String.raw`"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`+"`(?:[^`\\\\]|\\\\.)*`?",Sn.has(r)?String.raw`<\/?[A-Za-z][\w:.-]*|\/?>`:null,String.raw`\b(?:0x[\da-fA-F]+|\d[\d_]*(?:\.\d+)?(?:e[+-]?\d+)?)\b|#[\da-fA-F]{3,8}\b`,String.raw`[A-Za-z_$][\w$]*`].filter(Boolean),s=new RegExp(o.map(e=>`(${e})`).join(`|`),`g`),c=[`comment`,`comment`,`comment`,...a?[`comment`]:[],`string`,...Sn.has(r)?[`tag`]:[],`number`,`word`],l=[],u=0,d=(e,t)=>{if(!t)return;let n=l.at(-1);n&&n.type===e?n.text+=t:l.push({type:e,text:t})};for(let e of n.matchAll(s)){if(!e[0])continue;d(`plain`,n.slice(u,e.index));let t=c[e.slice(1).findIndex(e=>e!==void 0)];t===`word`&&(t=bn.has(a?e[0].toLowerCase():e[0])?`keyword`:`plain`),d(t,e[0]),u=e.index+e[0].length}return d(`plain`,n.slice(u)),l}var $=f(),kn={comment:`text-faint italic`,string:`text-ok`,number:`text-warn`,keyword:`text-accent font-medium`,tag:`text-accent`,add:`bg-ok/10 text-fg`,del:`bg-bad/10 text-fg`,meta:`text-faint`};async function An(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:-1000px;opacity:0`,document.body.append(t),t.select();let n;try{n=document.execCommand(`copy`)}catch{n=!1}return t.remove(),n}}function jn({lang:e,text:t,touch:n=!1}){let[i,a]=(0,Q.useState)(null),o=(0,Q.useRef)(0);(0,Q.useEffect)(()=>()=>window.clearTimeout(o.current),[]);let s=(0,Q.useMemo)(()=>On(t,e),[t,e]),l=async()=>{let e=await An(t);a(e?`ok`:`failed`),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(null),1600)},u=En(e);return(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-line bg-sunken`,"data-sw-chat-code":e||`code`,"data-lang":e||void 0,children:[(0,$.jsxs)(`div`,{className:A(`flex items-center gap-2 border-b border-line pr-1 pl-2.5`,n?`h-11`:`h-7`),children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-caption text-muted`,"data-sw-chat-code-lang":`true`,children:u}),(0,$.jsxs)(r,{variant:`ghost`,size:n?`touch`:`xs`,className:A(`shrink-0 gap-1 font-normal text-muted`,n&&`min-w-11`),onClick:l,"aria-label":i===`ok`?`Copied ${u} code`:`Copy ${u} code`,"data-sw-chat-code-copy":i||`ready`,children:[i===`ok`?(0,$.jsx)(c,{size:12,className:`text-ok`,"aria-hidden":`true`}):(0,$.jsx)(st,{size:12,"aria-hidden":`true`}),i===`ok`?`Copied`:i===`failed`?`Copy failed`:`Copy`]}),(0,$.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:i===`ok`?`Copied to the clipboard`:i===`failed`?`Could not copy`:``})]}),(0,$.jsx)(`pre`,{className:`overflow-x-auto p-2.5 font-mono text-[12px] leading-5 whitespace-pre`,tabIndex:0,"aria-label":`${u} code`,children:(0,$.jsx)(`code`,{className:`inline-block min-w-full`,children:s.map((e,t)=>e.line?(0,$.jsx)(`span`,{className:A(`-mx-2.5 block px-2.5`,kn[e.type]),children:e.text||` `},t):e.type===`plain`?e.text:(0,$.jsx)(`span`,{className:kn[e.type],children:e.text},t))})})]})}var Mn=/\[\[([a-z]+):([^\]\n]{1,120})\]\]/g;function Nn(e,t){let n=String(t||``).trim();return e===`comment`?/^#?\d{1,9}$/.test(n)?`comment #${n.replace(/^#/,``)}`:`comment ${n}`:e===`page`?`${n} page`:e===`journey`?`${n} journey`:e===`check`?`checks for ${n}`:n}function Pn(e,t=null){return String(e||``).replace(Mn,(e,n,r)=>t&&t(n,r)||Nn(n,r))}function Fn(e,t=null){return Pn(e,t).replace(/^[^[\]]{0,120}\]\]/,``).replace(/\[\[[^\]]{0,120}$/,``).replace(/```[^\n]*\n?/g,``).replace(/!\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[([^\]]+)\]\([^)]*\)/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/`/g,``).replace(/(\*\*|__)(.+?)\1/g,`$2`).replace(/(^|[\s(])[*_]([^*_\s][^*_]*?)[*_](?=[\s).,;:!?]|$)/g,`$1$2`).replace(/\*\*|__/g,``).replace(/~~(.+?)~~/g,`$1`).replace(/^[ \t]{0,3}#{1,6}[ \t]+/gm,``).replace(/^[ \t]{0,3}>[ \t]?/gm,``).replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+/gm,``).replace(/^[ \t]*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*$/gm,``).replace(/[ \t]*\|[ \t]*/g,` `).replace(/[ \t]+/g,` `).trim()}var In=/\[\[(comment|page|journey|check):([A-Za-z0-9][A-Za-z0-9:_./-]{0,119})\]\]/,Ln=e=>{let t=String(e||``).trim();return t.startsWith(`/`)?t.length>1?t.replace(/\/+$/,``):`/`:null};function Rn({comments:e=[],pages:t=[],journeys:n=[],checks:r=null}={}){let i=new Map;for(let e of t){let t=String(e.title||``).toLowerCase();i.set(t,(i.get(t)||0)+1)}let a=new Map;for(let e of n){let t=String(e.name||``).toLowerCase();a.set(t,a.has(t)?null:e)}return{comments:new Map(e.map(e=>[Number(e.id),e])),pages:new Map(t.map(e=>[e.id,e])),pagesByPath:new Map(t.filter(e=>Ln(e.path)).map(e=>[Ln(e.path),e])),pagesByTitle:new Map(t.filter(e=>e.title&&i.get(e.title.toLowerCase())===1).map(e=>[e.title.toLowerCase(),e])),journeys:new Map(n.map(e=>[e.id,e])),journeysByName:new Map([...a].filter(([,e])=>e)),checks:r}}function zn(e,t,n){if(!e)return null;let r=String(n||``);if(t===`comment`){let n=/^#?(\d{1,9})$/.exec(r),i=n?e.comments.get(Number(n[1])):null;return i?{kind:t,id:i.id,target:i}:null}if(t===`page`){let n=e.pages.get(r)||e.pagesByPath.get(Ln(r));return n?{kind:t,id:n.id,target:n}:null}if(t===`journey`){let n=e.journeys.get(r);return n?{kind:t,id:n.id,target:n}:null}if(t===`check`){if(!e.checks)return null;let n=e.pages.get(r)||e.pagesByPath.get(Ln(r));return n?{kind:t,id:n.id,target:n,count:e.checks.get(n.id)||0}:null}return null}function Bn(e,t){if(!e)return null;let n=String(t||``).trim();if(!n||n.length>160)return null;let r=In.exec(n);if(r&&r[0]===n)return zn(e,r[1],r[2]);if(/^#\d{1,9}$/.test(n))return zn(e,`comment`,n);if(n.startsWith(`/`))return n===`/`?null:zn(e,`page`,n);let i=n.toLowerCase(),a=e.pages.get(n)||e.pagesByTitle.get(i);if(a)return{kind:`page`,id:a.id,target:a};let o=e.journeysByName.get(i);return o?{kind:`journey`,id:o.id,target:o}:null}function Vn(e,t){let n=Ln(t);if(!e||!n||n===`/`)return null;let r=e.pagesByPath.get(n);return r?{kind:`page`,id:r.id,target:r}:null}function Hn(e,{reply:t,request:n,commentId:r=null}={}){if(!e)return[];let i=[],a=new Set,o=(e,t)=>{if(!e)return;let n=`${e.kind}:${e.id}`;a.has(n)||(a.add(n),i.push({...e,via:t}))};r&&o(zn(e,`comment`,r),`thread`);for(let t of n?.attachments||[]){let n=t.source;n&&(n.kind===`element`&&n.commentId?o(zn(e,`comment`,n.commentId),`attached`):o(zn(e,`page`,n.pageId),`attached`))}for(let n of t?.refs?.comments||[])o(zn(e,`comment`,n),`read`);for(let n of t?.refs?.pages||[])o(zn(e,`page`,n),`read`);for(let n of t?.cards||[])if(n.kind===`tool`)for(let t of String(n.label||``).matchAll(/#(\d{1,9})\b/g))o(zn(e,`comment`,t[1]),`read`);return i.slice(0,12)}function Un(e){return e.kind===`comment`?`#${e.target.id}`:e.kind===`page`?e.target.title||e.target.path||e.id:e.kind===`journey`?e.target.name||e.id:e.kind===`check`?`Checks: ${e.target.title||e.id}`:e.id}var Wn=(e,t)=>e===`comment`&&/^\d+$/.test(t)?`#${t}`:t;function Gn(e,t,n){let r=zn(e,t,n);return r?t===`comment`?`comment #${r.target.id}`:t===`page`?r.target.title?`${r.target.title} page`:null:t===`journey`?r.target.name?`${r.target.name} journey`:null:t===`check`&&r.target.title?`checks for ${r.target.title}`:null:null}var Kn=(e,t=null)=>Pn(e,t?(e,n)=>Gn(t,e,n):null),qn=(e,t=null)=>Fn(e,t?(e,n)=>Gn(t,e,n):null);function Jn(e,t=48){let n=String(e||``).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}var Yn=(0,Q.createContext)(null),Xn=()=>(0,Q.useContext)(Yn),Zn={comment:J,page:Le,journey:ye,check:ze},Qn=450,$n={resolved:{tone:`ok`,text:`Resolved`},"needs-human":{tone:`warn`,text:`Needs a person`},done:{tone:`accent`,text:`Agent done`},"branch-ready":{tone:`accent`,text:`Fix ready on branch`}};function er({item:e,refs:t}){if(e.kind===`comment`){let n=e.target,r=n.status===`resolved`?$n.resolved:$n[n.agentStatus]||null,i=t.index.pages.get(n.pageId);return(0,$.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-ref-preview":`comment`,children:[(0,$.jsxs)(`p`,{className:`flex items-center gap-1.5 text-caption text-muted`,children:[(0,$.jsxs)(`span`,{className:`font-semibold text-fg`,children:[`#`,n.id]}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:n.author||`Comment`}),r?(0,$.jsx)(B,{tone:r.tone,className:`ml-auto`,children:r.text}):null]}),(0,$.jsx)(`p`,{className:`line-clamp-4 text-ui break-words text-fg`,children:Jn(n.body,200)}),i?(0,$.jsxs)(`p`,{className:`truncate text-caption text-muted`,children:[i.title,` · `,n.viewport]}):null]})}if(e.kind===`journey`)return(0,$.jsxs)(`div`,{className:`space-y-1`,"data-sw-ref-preview":`journey`,children:[(0,$.jsx)(`p`,{className:`text-ui font-semibold text-fg`,children:e.target.name}),(0,$.jsxs)(`p`,{className:`text-caption text-muted`,children:[`Journey`,e.target.steps?.length?` · ${e.target.steps.length} steps`:``]})]});let n=e.target,r=t.thumbFor?.(n.id);return(0,$.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-ref-preview":e.kind,children:[r?(0,$.jsx)(`img`,{src:r,alt:``,className:`h-28 w-full rounded-md bg-sunken object-cover object-top shadow-thumb`,loading:`lazy`,"data-sw-ref-thumb":`true`}):null,(0,$.jsxs)(`p`,{className:`flex items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-ui font-semibold text-fg`,children:n.title}),n.path?(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-caption text-muted`,children:n.path}):null]}),e.kind===`check`?(0,$.jsx)(`p`,{className:`text-caption text-muted`,children:e.count?`${e.count} check${e.count===1?``:`s`} to look at`:`No open checks on this page`}):null]})}var tr={comment:`Open comment`,page:`Go to page`,journey:`Open journey`,check:`Open checks for`};function nr({item:e,children:t,className:n}){let r=Xn(),[a,s]=(0,Q.useState)(!1),c=(0,Q.useRef)({timer:0,long:!1});if(!r?.onNavigate)return(0,$.jsx)(`span`,{className:n,children:t??Un(e)});let l=Zn[e.kind],u=t??Un(e),d=t=>{c.current.long?(c.current.long=!1,t.preventDefault()):(s(!1),r.onNavigate(e))},f=e=>{e.pointerType!==`mouse`&&(c.current.long=!1,window.clearTimeout(c.current.timer),c.current.timer=window.setTimeout(()=>{c.current.long=!0,s(!0)},Qn))},p=()=>window.clearTimeout(c.current.timer),m=(0,$.jsxs)(`button`,{type:`button`,className:A(`mx-px inline-flex max-w-full items-center gap-1 rounded-md border border-line bg-surface-2 px-1.5 align-baseline text-[0.92em] leading-[1.45] font-medium text-fg`,`transition-colors duration-(--motion-fast) ease-standard hover:border-accent/60 hover:bg-accent/10 focus-visible:ring-2 focus-visible:ring-accent focus-visible:outline-none`,r.touch&&`relative after:absolute after:-inset-y-3.5 after:left-1/2 after:w-[max(calc(100%+0.5rem),2.75rem)] after:-translate-x-1/2 after:content-[""]`,n),"aria-label":`${tr[e.kind]} ${e.kind===`comment`?`#${e.target.id}`:Un(e).replace(/^Checks: /,``)}`,onClick:d,onPointerDown:f,onPointerUp:p,onPointerLeave:p,onPointerCancel:p,onContextMenu:e=>r.touch&&e.preventDefault(),"data-sw-ref":e.kind,"data-sw-ref-id":String(e.id),children:[(0,$.jsx)(l,{size:11,className:`shrink-0 text-muted`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:u})]});return r.touch?(0,$.jsxs)(W,{open:a,onOpenChange:s,children:[(0,$.jsx)(O,{asChild:!0,children:m}),(0,$.jsx)(U,{className:`w-64 p-2.5`,side:`top`,onOpenAutoFocus:e=>e.preventDefault(),children:(0,$.jsx)(er,{item:e,refs:r})})]}):(0,$.jsxs)(S,{open:a,onOpenChange:s,children:[(0,$.jsx)(i,{asChild:!0,children:m}),(0,$.jsx)(o,{className:`w-64 p-2.5`,side:`top`,children:(0,$.jsx)(er,{item:e,refs:r})})]})}function rr({reply:e,request:t,commentId:n,text:r}){let i=Xn(),a=(0,Q.useMemo)(()=>{if(!i?.index)return[];let a=String(r||``);return Hn(i.index,{reply:e,request:t}).filter(e=>!(e.kind===`comment`?e.id===n||RegExp(`#${e.id}\\b|\\[\\[comment:${e.id}\\]\\]`).test(a):a.includes(`[[page:${e.id}]]`)))},[i?.index,e,t,n,r]);return!a.length||!i?.onNavigate?null:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-caption text-muted`,"data-sw-chat-used-refs":a.length,children:[(0,$.jsx)(`span`,{className:`mr-0.5`,children:`Used`}),a.map(e=>(0,$.jsx)(nr,{item:e},`${e.kind}:${e.id}`))]})}function ir(e){try{let t=new URL(e);return[`http:`,`https:`,`mailto:`].includes(t.protocol)?t.href:null}catch{return null}}var ar=/(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)|\*\*([^*]+?)\*\*|__([^_]+?)__|~~([^~]+?)~~|\*([^*\s][^*]*?)\*|(?<![\w])_([^_\s][^_]*?)_(?![\w])|\[([^\]]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])|\[\[(comment|page|journey|check):([A-Za-z0-9][A-Za-z0-9:_./-]{0,119})\]\]|(?<![\w&#/])#(\d{1,9})\b|(?<![\w/.:~-])(\/[A-Za-z0-9](?:[\w\-./]*[\w/])?)/g;function or(e,t=`i`,n=null){let r=[],i=0,a=0;for(let o of e.matchAll(ar)){o.index>i&&r.push(e.slice(i,o.index));let s=`${t}-${a++}`,c=e=>n?Bn(n,e):null;if(o[2]!==void 0){let e=c(o[2]);r.push(e?(0,$.jsx)(nr,{item:e,className:`font-mono`,children:o[2]},s):(0,$.jsx)(`code`,{className:`rounded bg-surface-2 px-1 py-px font-mono text-[0.9em]`,children:o[2]},s))}else if(o[3]!==void 0||o[4]!==void 0){let e=c(o[3]??o[4]);r.push(e?(0,$.jsx)(nr,{item:e,children:o[3]??o[4]},s):(0,$.jsx)(`strong`,{children:or(o[3]??o[4],s,n)},s))}else if(o[5]!==void 0)r.push((0,$.jsx)(`del`,{children:or(o[5],s,n)},s));else if(o[6]!==void 0||o[7]!==void 0)r.push((0,$.jsx)(`em`,{children:or(o[6]??o[7],s,n)},s));else if(o[8]!==void 0){let e=ir(o[9]);r.push(e?(0,$.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline underline-offset-2`,children:or(o[8],s)},s):(0,$.jsx)(Q.Fragment,{children:o[0]},s))}else if(o[10]!==void 0){let e=ir(o[10]);r.push(e?(0,$.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`break-all text-accent underline underline-offset-2`,children:o[10]},s):o[10])}else if(o[11]!==void 0){let e=zn(n,o[11],o[12]);r.push(e?(0,$.jsx)(nr,{item:e},s):Wn(o[11],o[12]))}else if(o[13]!==void 0){let e=zn(n,`comment`,o[13]);r.push(e?(0,$.jsx)(nr,{item:e},s):o[0])}else if(o[14]!==void 0){let e=Vn(n,o[14]);r.push(e?(0,$.jsx)(nr,{item:e,className:`font-mono`,children:o[14]},s):o[0])}i=o.index+o[0].length}return i<e.length&&r.push(e.slice(i)),r}var sr=e=>/^\s*\|.*\|\s*$/.test(e),cr=e=>/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/.test(e),lr=e=>e.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim());function ur(e){let t=String(e||``).replace(/\r\n/g,`
3
3
  `).split(`
4
4
  `),n=[],r=0;for(;r<t.length;){let e=t[r],i=/^\s*(```|~~~)\s*([\w+.-]*)/.exec(e);if(i){let e=[];for(r+=1;r<t.length&&!t[r].trim().startsWith(i[1]);)e.push(t[r++]);r+=1,n.push({type:`code`,lang:i[2],text:e.join(`
@@ -1 +1 @@
1
- import{$t as e,B as t,Ht as n,Jt as r,Kt as i,V as a,Wt as o,Xt as s,_ as c,a as l,c as u,ct as d,d as f,g as p,i as m,n as h,o as g,p as _,qt as v,s as y,t as b,tt as x,u as S}from"./ui-Cg4TTrec.js";import{K as C,L as ee,W as w,at as te,dt as T,et as ne,ht as re,it as E,lt as D,t as ie,ut as O}from"./index-DKOCIQiq.js";import{t as ae}from"./refresh-cw-aeOBDuGQ.js";import{n as k,t as A}from"./shield-check-DuPBJ6H_.js";import{n as j,t as M}from"./circle-x-PRxj7kPi.js";var N={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};N.node;var P=v(N),F={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};F.node;var I=v(F),oe={name:`person-standing`,size:24,node:[[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`path`,{d:`m9 20 3-6 3 6`,key:`se2kox`}],[`path`,{d:`m6 8 6 2 6-2`,key:`4o3us4`}],[`path`,{d:`M12 10v4`,key:`1kjpxc`}]]};oe.node;var L=v(oe),R={name:`search-check`,size:24,node:[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};R.node;var z=v(R),B=e(s(),1),se={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,"[":278,"]":278,_:556,"|":260,"–":556,"—":1e3,"·":278,"…":1e3,"’":222,"‘":222,"“":333,"”":333},V={A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833};Object.assign(V,{N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611});var H={a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833};Object.assign(H,{n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500});function ce(e){return se[e]===void 0?V[e]===void 0?H[e]===void 0?/[0-9]/.test(e)?556:e.codePointAt(0)>=11904?1e3:/\p{Lu}/u.test(e)?700:560:H[e]:V[e]:se[e]}function le(e,t){let n=0;for(let t of String(e||``))n+=ce(t);return n*t/1e3}var U=Object.freeze({titleFont:20,titlePixels:580,titleMinChars:10,descriptionFont:14,descriptionPixels:920,descriptionMinChars:50}),ue=e=>String(e||``).replace(/\s+/g,` `).trim();function de(e,{size:t,pixels:n}){let r=ue(e);if(le(r,t)<=n)return{text:r,cut:!1};let i=n-le(` ...`,t),a=0,o=0;for(let e of r){let n=a+ce(e)*t/1e3;if(n>i)break;a=n,o+=e.length}let s=r.slice(0,o),c=s.lastIndexOf(` `);return c>o*.6&&(s=s.slice(0,c)),{text:`${s.replace(/[\s,.;:–—-]+$/,``)} ...`,cut:!0}}var W=Object.freeze({"search-noindex":{level:`error`,group:`indexing`,label:`Asks search engines not to index it`,explain:`A robots "noindex" tag or header tells Google to leave this page out of search results.`,fix:`Remove the noindex robots meta tag or X-Robots-Tag header if this page should be found. If it is meant to stay private, mark the page private in the Shapewall config.`},"robots-crawl-blocked":{level:`error`,group:`indexing`,label:`Blocked by robots.txt`,explain:`The site’s robots.txt rules stop Googlebot from crawling this address, so Google can’t read its content.`,fix:`Change the Disallow rule in robots.txt that matches this path, or add a more specific Allow rule for it.`},"robots-unavailable":{level:`tip`,group:`indexing`,label:`Crawl rules could not be read`,explain:`robots.txt redirected, timed out or was too large, so crawl permission is unknown.`,fix:`Serve robots.txt directly from the site root with a 200 or 404 response.`},"missing-title":{level:`error`,group:`title`,label:`No page title`,explain:`Without a <title>, Google writes its own headline for the result, usually from text on the page.`,fix:`Add a unique <title> that says what the page is, with the brand at the end.`},"seo-title-long":{level:`tip`,group:`title`,label:`Title will be cut off`,explain:`Google shows about 580 pixels of a title (roughly 55 to 60 characters). The rest is replaced with an ellipsis.`,fix:`Put the important words first and shorten the title so it fits.`},"seo-title-short":{level:`tip`,group:`title`,label:`Title is very short`,explain:`A very short title gives searchers little reason to pick this result.`,fix:`Describe the page in a few more words, for example the product or topic and the brand.`},"duplicate-title":{level:`warning`,group:`title`,label:`Same title as another page`,explain:`Several pages share this title, so searchers can’t tell them apart and Google may pick the wrong one.`,fix:`Give each page its own title that names what is different about it.`},"seo-description":{level:`warning`,group:`description`,label:`No meta description`,explain:`Without a description, Google picks a snippet from the page text, which is often a menu or a cookie banner.`,fix:`Add <meta name="description"> with one or two sentences (about 120 to 155 characters) that sell the page.`},"seo-description-long":{level:`tip`,group:`description`,label:`Description will be cut off`,explain:`Google shows about 920 pixels of a description (roughly 150 to 160 characters) on desktop and less on phones.`,fix:`Keep the key message in the first 120 characters.`},"seo-description-short":{level:`tip`,group:`description`,label:`Description is very short`,explain:`A short description leaves room Google may fill with page text instead.`,fix:`Write one or two full sentences about what the visitor gets on this page.`},"duplicate-description":{level:`warning`,group:`description`,label:`Same description as another page`,explain:`Repeated descriptions make results look identical and tell searchers nothing about this page.`,fix:`Write a description for this page that is specific to it.`},"seo-canonical":{level:`warning`,group:`canonical`,label:`No canonical URL`,explain:`A canonical link tells search engines which address is the real one when the page is reachable at several (with tracking parameters, trailing slashes or www).`,fix:`Add <link rel="canonical" href="..."> with the page’s full preferred address.`},"canonical-invalid":{level:`warning`,group:`canonical`,label:`Canonical URL is not a full address`,explain:`The canonical link is relative or not http(s). Search engines may ignore it.`,fix:`Use an absolute https:// address in the canonical link.`},"canonical-elsewhere":{level:`error`,group:`canonical`,label:`Canonical points to another page`,explain:`The canonical link names a different address, which tells Google to show that page instead of this one.`,fix:`Point the canonical link at this page’s own address, unless this really is a copy of the other page.`},"seo-ogtitle":{level:`warning`,group:`social`,label:`No social title`,explain:`Without og:title, Slack, LinkedIn, iMessage and others guess a headline for shared links.`,fix:`Add <meta property="og:title"> with the headline you want in link previews.`},"seo-ogdescription":{level:`tip`,group:`social`,label:`No social description`,explain:`Link previews show og:description under the headline. Without it they show nothing or random text.`,fix:`Add <meta property="og:description"> with one short sentence.`},"seo-ogimage":{level:`warning`,group:`social`,label:`No social image`,explain:`Shared links without og:image show as a plain text line and get far fewer clicks.`,fix:`Add <meta property="og:image"> with an absolute URL to a 1200 × 630 image.`},"social-image-failed":{level:`error`,group:`social`,label:`Social image is broken`,explain:`The og:image address returned an error or isn’t a valid image, so previews show a blank box.`,fix:`Fix the og:image URL so it returns a PNG, JPEG or WebP image with a 200 response.`},"social-image-invalid":{level:`warning`,group:`social`,label:`Social image URL is not a full address`,explain:`og:image must be an absolute http(s) URL. Most platforms ignore relative paths.`,fix:`Use the full https:// address of the image.`},"social-image-unavailable":{level:`tip`,group:`social`,label:`Social image could not be verified`,explain:`The image is on another domain, redirected or is in a format Shapewall can’t decode, so its preview is not shown here.`,fix:`Nothing is necessarily wrong. Check a preview with the platform’s own debugger if in doubt.`},"social-image-dimensions":{level:`tip`,group:`social`,label:`Image size differs from its tags`,explain:`og:image:width and og:image:height don’t match the actual image, which can make previews crop or load late.`,fix:`Update the declared width and height to the real image size, or remove them.`}}),fe={error:0,warning:1,tip:2};function G(e){let t=e?.category===`seo`?W[e.id]:null;return t?t.level===`tip`?`advisory`:`warning`:e?.severity}Object.freeze(Object.keys(W));function pe(e,t,n,r=()=>!0){let i=null;for(let a of e){if(a.pageId!==t)continue;let e=a.runs?.length?a.runs:a.report?[{runner:a.report.profile.runner,state:a.state,report:a.report}]:[];for(let t of e){let e=t.report;e&&(t.runner||e.profile.runner)===n&&r(e)&&(!i||e.auditedAt>i.report.auditedAt||e.auditedAt===i.report.auditedAt&&e.viewport.name===`desktop`)&&(i={report:e,stale:t.state===`stale`})}}return i}var me=e=>ue(e).toLowerCase();function he({views:e=[],pages:t=[],snapshots:n={},privatePages:r=[]}={}){let i=new Set(r),a=t.map(t=>{let r=pe(e,t.id,`playwright`,e=>e.profile.seo),a=r||pe(e,t.id,`playwright`),o=pe(e,t.id,`lighthouse`,e=>Number.isFinite(e.metrics?.lighthouseSeoLabScore)),s=r?.report||null,c=s&&n[s.id]||null,l=i.has(t.id)||!!s?.findings.some(e=>e.id===`seo-private-expected`),u={pageId:t.id,title:t.title||t.id,url:t.url||null,status:l?`private`:a?s?s.state===`failed`?`failed`:`checked`:`no-seo`:`not-run`,stale:!!r?.stale,report:s,snapshot:c,lighthouseSeo:o?o.report.metrics.lighthouseSeoLabScore:null,issues:[]};if(u.status===`checked`)for(let e of s.findings){let t=W[e.id];!t||e.id.startsWith(`duplicate-`)&&c||u.issues.push({id:e.id,...t,observation:e.observation,finding:e})}return u}),o={title:[],description:[]};for(let e of[`title`,`description`]){let t=new Map;for(let n of a){if(n.status!==`checked`||!n.snapshot)continue;let r=me(n.snapshot[e]);r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}for(let[,n]of t)if(!(n.length<2)){o[e].push({value:ue(n[0].snapshot[e]),pageIds:n.map(e=>e.pageId)});for(let t of n){let r=n.filter(e=>e!==t).map(e=>e.title),i=`duplicate-${e}`;t.issues.push({id:i,...W[i],observation:`Also used on ${r.slice(0,3).join(`, `)}${r.length>3?` and ${r.length-3} more`:``}.`,finding:null,others:n.filter(e=>e!==t).map(e=>e.pageId)})}}}for(let e of[`title`,`description`])if(!o[e].length){let t=a.filter(t=>t.issues.some(t=>t.id===`duplicate-${e}`)).map(e=>e.pageId);t.length>1&&o[e].push({value:null,pageIds:t})}for(let e of a)e.issues.sort((e,t)=>fe[e.level]-fe[t.level]),e.errors=e.issues.filter(e=>e.level===`error`).length,e.warnings=e.issues.filter(e=>e.level===`warning`).length,e.tips=e.issues.filter(e=>e.level===`tip`).length,e.indexable=e.status===`checked`?!e.issues.some(e=>[`search-noindex`,`robots-crawl-blocked`,`canonical-elsewhere`].includes(e.id)):null;let s=a.filter(e=>e.status===`checked`),c=(e,...t)=>e.issues.some(e=>t.includes(e.id)),l=a.map(e=>e.lighthouseSeo).filter(e=>Number.isFinite(e));return{rows:a,summary:{pages:a.filter(e=>e.status!==`private`).length,checked:s.length,private:a.filter(e=>e.status===`private`).length,notChecked:a.filter(e=>[`not-run`,`no-seo`,`failed`].includes(e.status)).length,indexable:s.filter(e=>e.indexable).length,notIndexable:s.filter(e=>e.indexable===!1).length,missingTitles:s.filter(e=>c(e,`missing-title`)).length,missingDescriptions:s.filter(e=>c(e,`seo-description`)).length,duplicateTitles:o.title.reduce((e,t)=>e+t.pageIds.length,0),duplicateDescriptions:o.description.reduce((e,t)=>e+t.pageIds.length,0),socialImageProblems:s.filter(e=>c(e,`seo-ogimage`,`social-image-failed`,`social-image-invalid`)).length,canonicalIssues:s.filter(e=>c(e,`seo-canonical`,`canonical-invalid`,`canonical-elsewhere`)).length,robotsIssues:s.filter(e=>c(e,`search-noindex`,`robots-crawl-blocked`,`robots-unavailable`)).length,errors:s.reduce((e,t)=>e+t.errors,0),warnings:s.reduce((e,t)=>e+t.warnings,0),tips:s.reduce((e,t)=>e+t.tips,0),lighthouseSeo:l.length?{min:Math.min(...l),average:Math.round(l.reduce((e,t)=>e+t,0)/l.length),count:l.length}:null},duplicates:o}}function ge(e){try{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean).map(e=>{try{return decodeURIComponent(e)}catch{return e}});return{site:t.hostname.replace(/^www\./,``),origin:`${t.protocol}//${t.host}`,path:n}}catch{return{site:``,origin:``,path:[]}}}var _e=e=>JSON.stringify(e,(e,t)=>t&&typeof t==`object`&&!Array.isArray(t)?Object.fromEntries(Object.keys(t).sort().map(e=>[e,t[e]])):t),ve=(e,t)=>_e(e)===_e(t),K=e=>[`complete`,`partial`].includes(e.state),ye=e=>typeof e==`number`&&Number.isFinite(e);function be(e,t,{allowBuildChange:n=!1}={}){let r=[],i=e.profile,a=t.profile;for(let[n,i,a]of[[`page or environment`,[e.boardId,e.pageId,e.environment],[t.boardId,t.pageId,t.environment]],[`viewport`,e.viewport,t.viewport],[`observation window`,e.completeness.window,t.completeness.window],[`network coverage`,e.completeness.network,t.completeness.network],[`service worker state`,e.completeness.serviceWorker,t.completeness.serviceWorker]])ve(i,a)||r.push(`Different ${n}.`);let o=i.sourceBuild!==a.sourceBuild,s=o&&n&&!!(i.sourceBuild&&a.sourceBuild),c=[...new Set([...Object.keys(i),...Object.keys(a)])];for(let e of c)e===`sourceBuild`&&s||ve(i[e],a[e])||r.push(`Different ${e.replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}.`);for(let e of[`browser`,`device`,`throttling`])i[e]&&a[e]||r.push(`Missing ${e} conditions in an older report.`);i.authRole!==`configured`&&a.authRole!==`configured`||i.authStateHash&&a.authStateHash||r.push(`Missing authentication state evidence.`),K(e)&&K(t)||r.push(`A run has no usable measurements.`);let l=r.length===0,u=[...new Set([...Object.keys(e.metrics),...Object.keys(t.metrics)])].map(n=>{let r=K(e)&&ye(e.metrics[n])?e.metrics[n]:null,i=K(t)&&ye(t.metrics[n])?t.metrics[n]:null,a=l&&r!==null&&i!==null?i-r:null,o=n.endsWith(`Ms`)?50:n.endsWith(`Bytes`)?1024:n===`cumulativeLayoutShift`?.01:1,s=a!==null&&(Math.abs(a)<o||Math.abs(a)<Math.abs(r)*.05);return{key:n,before:r,after:i,delta:a,percent:a===null||r===0?null:a/r*100,change:a===null?`unknown`:a===0?`unchanged`:s?`small`:a>0?`increased`:`decreased`}}),d=!ve(e.budgets,t.budgets),f=l&&e.state===`complete`&&t.state===`complete`&&!d,p=new Set(e.findings.map(e=>e.id)),m=new Set(t.findings.map(e=>e.id));return{comparable:l,reasons:r,buildChanged:o,declaredBuildChange:s,budgetsChanged:d,metrics:u,findingsComparable:f,added:f?t.findings.filter(e=>!p.has(e.id)):[],removed:f?e.findings.filter(e=>!m.has(e.id)):[],retained:f?t.findings.filter(e=>p.has(e.id)):[],changed:f?t.findings.filter(t=>{let n=e.findings.find(e=>e.id===t.id);return n&&(n.severity!==t.severity||n.title!==t.title)}):[]}}var q=e=>e.runs?.length?e.runs:e.report?[{report:e.report,state:e.state}]:[],xe=e=>q(e).reduce((e,t)=>e+t.report.findings.filter(e=>G(e)===`warning`).length,0),J=(e,t)=>e.state===t||q(e).some(e=>e.state===t||e.report.state===t);function Se(e,t=`problems`){let n=e=>{let t=q(e).find(e=>e.report.profile.runner===`lighthouse`),n=t?.report.metrics.largestContentfulPaintMs;return t&&K(t.report)&&ye(n)?n:-1},r=e=>J(e,`failed`)||J(e,`unsupported`)?4:xe(e)?3:J(e,`stale`)?2:+!!J(e,`partial`);return[...e].sort((e,i)=>(t===`lcp`?n(i)-n(e):r(i)-r(e)||xe(i)-xe(e))||e.pageId.localeCompare(i.pageId)||e.viewport.localeCompare(i.viewport))}var Y=[{id:`reliability`,label:`Reliability`,match:[`reliability`,`semantics`]},{id:`performance`,label:`Performance`,match:[`performance`]},{id:`accessibility`,label:`Accessibility`,match:[`accessibility`]},{id:`seo`,label:`SEO`,match:[`seo`]}],Ce=e=>Y.find(t=>t.match.includes(e.category))?.id||`reliability`,we={playwright:`Load and page basics`,lighthouse:`Lighthouse lab navigation`,"playwright-flow":`Explicit flow`,axe:`Accessibility snapshot`},Te={"not-run":`Not checked`,stale:`Stale`,failed:`Failed`,unsupported:`Unsupported`,partial:`Partial`,complete:`Complete`},X=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ee(e,t=!0){let n=new Map;for(let r of e)for(let e of q(r))if(e.state!==`stale`&&e.report)for(let i of e.report.findings){let a=`${r.pageId}|${e.report.profile.runner}|${i.id}`,o=n.get(a),s=G(i);o?(o.viewports.includes(r.viewport)||o.viewports.push(r.viewport),s===`warning`&&(o.severity=`warning`)):n.set(a,{key:a,pageId:r.pageId,viewports:[r.viewport],view:r,report:e.report,finding:i,severity:s,category:Ce(i),canvasCapture:t&&r.canvasCapture!==!1})}return[...n.values()].sort((e,t)=>(e.severity===`warning`?0:1)-(t.severity===`warning`?0:1)||Y.findIndex(t=>t.id===e.category)-Y.findIndex(e=>e.id===t.category)||e.pageId.localeCompare(t.pageId))}var De=e=>{let t=e.filter(e=>typeof e==`number`&&Number.isFinite(e)).sort((e,t)=>e-t);if(!t.length)return null;let n=Math.floor(t.length/2);return Math.round(t.length%2?t[n]:(t[n-1]+t[n])/2)};function Oe(e,t){return e.map(e=>q(e).find(e=>e.report?.profile.runner===`lighthouse`&&e.state!==`stale`)).filter(e=>e&&[`complete`,`partial`].includes(e.report.state)).map(e=>e.report.metrics[t])}function ke(e,t){return Y.map(n=>{let r=t.filter(e=>e.category===n.id);return{...n,warnings:r.filter(e=>e.severity===`warning`).length,advisories:r.filter(e=>e.severity===`advisory`).length,score:n.id===`performance`?De(Oe(e,`lighthouseLabScore`)):n.id===`seo`?De(Oe(e,`lighthouseSeoLabScore`)):null}})}function Ae(e){return e==null?`Unknown`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)} s`:`${Math.round(e)} ms`}function je(e){return e==null?`Unknown`:e<1024?`${Math.round(e)} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Z(e,t){return t==null?`Unknown`:/Ms$/.test(e)?Ae(t):/Bytes$/.test(e)?je(t):e===`cumulativeLayoutShift`?t.toFixed(3).replace(/0+$/,``).replace(/\.$/,``):String(Math.round(t*100)/100)}var Me=e=>[`socialImageWidth`,`socialImageHeight`].includes(e)?`Declared social image ${e.endsWith(`Width`)?`width`:`height`}`:e===`robotsAllowed`?`Robots access (1 allowed, 0 blocked)`:e===`lighthouseLabScore`?`Lighthouse lab score (0-100)`:e===`lighthouseSeoLabScore`?`Lighthouse SEO lab score (0-100)`:X(e.replace(/Ms$/,``).replace(/Bytes$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase().trim()),Q=r(),Ne={reliability:A,performance:I,accessibility:L,seo:z};function Pe({score:e,size:t=36,label:n}){let r=(t-5)/2,i=2*Math.PI*r;return(0,Q.jsxs)(`span`,{className:d(`relative inline-grid shrink-0 place-items-center`,e===null?`text-faint`:e>=90?`text-ok`:e>=50?`text-warn`:`text-bad`),style:{width:t,height:t},children:[(0,Q.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:`-rotate-90`,"aria-hidden":`true`,children:[(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`3.5`}),e===null?null:(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeDasharray:`${i*e/100} ${i}`})]}),(0,Q.jsx)(`span`,{className:`absolute text-[11px] font-semibold text-fg tabular`,"aria-label":n,children:e===null?`--`:e})]})}function Fe({totals:e,active:t,onPick:n}){return(0,Q.jsx)(`div`,{className:`grid auto-rows-fr grid-cols-2 gap-2`,"data-sw-checks-summary":`true`,children:e.map(e=>{let r=Ne[e.id],i=e.warnings,a=t===e.id;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>n(e.id),"data-sw-checks-tile":e.id,className:d(`flex min-h-16 items-center gap-2.5 rounded-lg border bg-surface px-2.5 py-2 text-left shadow-card transition-colors outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,a?`border-accent bg-accent/5`:`border-line`),children:[(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-medium text-muted`,children:[(0,Q.jsx)(r,{size:13,"aria-hidden":`true`}),e.label]}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-[15px] leading-5 font-semibold`,children:i?(0,Q.jsxs)(`span`,{className:e.id===`reliability`?`text-bad`:`text-warn`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:i}),` to fix`]}):e.unchecked?(0,Q.jsx)(`span`,{className:`text-muted`,children:`Not checked`}):(0,Q.jsx)(`span`,{className:`text-ok`,children:`No issues`})}),e.advisories?(0,Q.jsxs)(`span`,{className:`block text-[11px] text-muted`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:e.advisories}),` `,e.advisories===1?`note`:`notes`]}):null]}),e.id===`performance`||e.id===`seo`?(0,Q.jsx)(Pe,{score:e.score,label:e.score===null?`No Lighthouse score`:`Lighthouse ${e.label} ${e.score}`}):null]},e.id)})})}function Ie(e,t=Date.now()){let n=Math.max(0,(t-Date.parse(e))/1e3);return Number.isFinite(n)?n<60?`just now`:n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:new Date(e).toLocaleDateString():``}var Le={error:{icon:M,tone:`text-bad`,label:`Blocks search or sharing`},warning:{icon:w,tone:`text-warn`,label:`Should fix`},tip:{icon:D,tone:`text-accent`,label:`Tip`}},$=e=>e.status===`checked`?e.indexable===!1?`blocked`:e.errors||e.warnings?`work`:`ready`:e.status;function Re({command:e,local:n}){let[r,i]=(0,B.useState)(!1);return(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl border border-dashed border-line p-3`,"data-sw-seo-not-checked":`true`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,Q.jsx)(z,{size:16,className:`text-accent`,"aria-hidden":`true`}),`SEO hasn’t been checked yet`]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:n?`Use Run checks above with Include SEO, set "checks": { "seo": true } in the config, or run:`:`Run this where the site is configured, then push the board with --include-checks:`}),(0,Q.jsxs)(`div`,{className:`flex items-stretch gap-1.5`,children:[(0,Q.jsx)(`code`,{className:`min-w-0 flex-1 rounded bg-surface-2 p-2 text-xs break-all`,children:e}),(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-auto`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>i(!0),()=>i(!1))},children:r?`Copied`:`Copy`})]})]})}function ze({data:e,seo:t,pages:n,pageId:r,local:i,canComment:a,onView:o,onIssue:s,canFix:c,command:l}){let[u,d]=(0,B.useState)(`all`),f=(0,B.useMemo)(()=>he({views:e?.views||[],pages:n.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:t?.snapshots||{},privatePages:t?.privatePages||[]}),[e,t,n]),{summary:p}=f,m=f.rows.filter(e=>!r||e.pageId===r),h={all:m.length,work:m.filter(e=>[`work`,`blocked`].includes($(e))).length,ready:m.filter(e=>$(e)===`ready`).length,private:m.filter(e=>e.status===`private`).length},g={blocked:0,work:1,failed:2,"no-seo":3,"not-run":4,ready:5,private:6},_=m.filter(e=>{let t=$(e);return u===`all`||(u===`work`?[`work`,`blocked`].includes(t):u===`ready`?t===`ready`:t===u)}).sort((e,t)=>g[$(e)]-g[$(t)]||t.errors-e.errors||t.warnings-e.warnings);return(0,Q.jsxs)(`div`,{className:`sw-gutter-pad space-y-4 p-3 text-sm`,"data-sw-seo-view":`true`,children:[!p.checked&&l?(0,Q.jsx)(Re,{command:l,local:i}):null,!r&&p.checked?(0,Q.jsx)(Be,{summary:p}):null,(0,Q.jsx)(b,{label:`SEO pages`,value:u,onChange:d,variant:`underline`,options:[{id:`all`,label:`All`,count:h.all},{id:`work`,label:`Needs work`,count:h.work},{id:`ready`,label:`No issues`,count:h.ready},...h.private?[{id:`private`,label:`Private`,count:h.private}]:[]]}),_.length?null:(0,Q.jsx)(`p`,{className:`py-6 text-center text-xs text-muted`,children:`No pages match this filter.`}),_.map(e=>(0,Q.jsx)(He,{row:e,page:n.find(t=>t.id===e.pageId),local:i,canComment:a,canFix:c,onView:o,onIssue:s},e.pageId))]})}function Be({summary:e}){let{checked:t,indexable:n}=e,r=e.pages?Math.round(n/Math.max(1,e.pages)*100):0,i=e.duplicateTitles+e.duplicateDescriptions,a=[[`Missing titles`,e.missingTitles,e.missingTitles?`bad`:`ok`],[`Missing descriptions`,e.missingDescriptions,e.missingDescriptions?`warn`:`ok`],[`Duplicate titles or descriptions`,i,i?`warn`:`ok`],[`Social image problems`,e.socialImageProblems,e.socialImageProblems?`warn`:`ok`],[`Canonical issues`,e.canonicalIssues,e.canonicalIssues?`warn`:`ok`],[`Robots and indexing`,e.robotsIssues,e.robotsIssues?`bad`:`ok`]];return(0,Q.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-line bg-surface p-3 shadow-card`,"data-sw-seo-summary":`true`,children:[(0,Q.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted`,children:`Indexable`}),(0,Q.jsxs)(`p`,{className:`mt-0.5 text-2xl leading-none font-semibold tracking-tight`,children:[(0,Q.jsx)(`span`,{className:`tabular`,"data-sw-seo-indexable":n,children:n}),(0,Q.jsxs)(`span`,{className:`text-base font-medium text-muted`,children:[` of `,e.pages,` pages`]})]})]}),(0,Q.jsxs)(`div`,{className:`text-right`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted`,children:`Lighthouse SEO`}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-2xl leading-none font-semibold tracking-tight tabular`,"data-sw-seo-lighthouse":`true`,children:e.lighthouseSeo?e.lighthouseSeo.average:`--`})]})]}),(0,Q.jsxs)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-surface-2`,role:`img`,"aria-label":`${n} of ${e.pages} public pages are indexable`,children:[(0,Q.jsx)(`span`,{className:`bg-ok`,style:{width:`${r}%`}}),(0,Q.jsx)(`span`,{className:`bg-bad`,style:{width:`${e.pages?e.notIndexable/e.pages*100:0}%`}})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[t,` of `,e.pages,` public pages checked`,e.notIndexable?` · ${e.notIndexable} kept out of search`:``,e.private?` · ${e.private} private, not meant for search`:``,e.lighthouseSeo?` · Lighthouse lowest ${e.lighthouseSeo.min}`:` · No Lighthouse SEO score yet (shapewall audit --seo)`]}),(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 gap-2`,children:a.map(([e,n,r])=>(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-2 px-2.5 py-2`,"data-sw-seo-tile":e,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-[11px] leading-4 text-muted`,children:[(0,Q.jsx)(`span`,{className:d(`size-1.5 shrink-0 rounded-full`,r===`ok`?`bg-ok`:r===`bad`?`bg-bad`:`bg-warn`),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`min-w-0`,children:e})]}),(0,Q.jsx)(`dd`,{className:`mt-0.5 text-lg leading-6 font-semibold tabular`,children:t?n:`--`})]},e))})]})}function Ve({row:e}){let t=$(e);return t===`private`?(0,Q.jsx)(x,{tone:`neutral`,children:`Private`}):t===`ready`?(0,Q.jsx)(x,{tone:`ok`,children:`No issues`}):t===`blocked`?(0,Q.jsx)(x,{tone:`bad`,children:`Not indexable`}):t===`work`?(0,Q.jsxs)(x,{tone:e.errors?`bad`:`warn`,children:[e.errors+e.warnings,` to fix`]}):t===`failed`?(0,Q.jsx)(x,{tone:`bad`,children:`Check failed`}):(0,Q.jsx)(x,{tone:`neutral`,children:`Not checked`})}function He({row:e,page:n,local:r,canComment:i,canFix:a,onView:o,onIssue:s}){let c=e.report?.viewport.name||n?.viewports?.[0]||`desktop`,u=n?.path||`/`;return(0,Q.jsxs)(`article`,{className:`overflow-hidden rounded-xl border border-line bg-surface shadow-card`,"data-sw-seo-page":e.pageId,"data-sw-seo-status":$(e),children:[(0,Q.jsxs)(`header`,{className:`flex items-start gap-2 px-3 pt-3 pb-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.title}),(0,Q.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted`,children:u})]}),e.lighthouseSeo===null?null:(0,Q.jsxs)(x,{tone:e.lighthouseSeo>=90?`ok`:e.lighthouseSeo>=50?`warn`:`bad`,className:`tabular`,children:[`SEO `,e.lighthouseSeo]}),(0,Q.jsx)(Ve,{row:e})]}),e.status===`private`?(0,Q.jsxs)(`div`,{className:`mx-3 mb-3 flex gap-2 rounded-lg bg-surface-2 p-2.5 text-xs text-muted`,children:[(0,Q.jsx)(P,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`Private, not meant for search. Search checks are skipped because this page is configured as not indexable.`})]}):e.status===`checked`?(0,Q.jsxs)(Q.Fragment,{children:[e.stale?(0,Q.jsx)(`p`,{className:`mx-3 mb-2 text-xs text-warn`,children:`The page or its settings changed since this check. Run checks again.`}):null,(0,Q.jsxs)(m,{defaultValue:`search`,className:`px-3`,children:[(0,Q.jsxs)(g,{variant:`underline`,"aria-label":`${e.title} preview`,children:[(0,Q.jsx)(y,{value:`search`,children:`Google result`}),(0,Q.jsx)(y,{value:`social`,children:`Share card`})]}),(0,Q.jsx)(l,{value:`search`,className:`pt-2`,children:e.snapshot?(0,Q.jsx)(Ge,{row:e,page:n}):(0,Q.jsx)(Ue,{local:r})}),(0,Q.jsx)(l,{value:`social`,className:`pt-2`,children:e.snapshot?(0,Q.jsx)(Ke,{row:e,page:n}):(0,Q.jsx)(Ue,{local:r})})]}),(0,Q.jsx)(`div`,{className:`space-y-2 p-3`,children:e.issues.length?(0,Q.jsx)(`ul`,{className:`space-y-2`,"aria-label":`${e.title} SEO issues`,children:e.issues.map(t=>(0,Q.jsx)(qe,{issue:t,onComment:i?()=>s(e,t,{fix:!1}):null,onFix:i&&a?()=>s(e,t,{fix:!0}):null},t.id))}):(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-ok/10 p-2.5 text-xs`,"data-sw-seo-clean":`true`,children:[(0,Q.jsx)(j,{size:15,className:`shrink-0 text-ok`,"aria-hidden":`true`}),`Nothing to fix in the checks that ran.`]})})]}):(0,Q.jsxs)(`div`,{className:`mx-3 mb-3 flex gap-2 rounded-lg bg-surface-2 p-2.5 text-xs text-muted`,children:[(0,Q.jsx)(z,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:e.status===`failed`?`The last SEO check of this page could not finish. Run checks again.`:e.status===`no-seo`?`Checked without SEO. Run checks with Include SEO to see its search result and share card.`:`Not checked yet. Run checks with Include SEO to see how this page shows in search.`})]}),(0,Q.jsxs)(`footer`,{className:`flex items-center gap-2 border-t border-line bg-surface-2/50 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-muted`,children:e.report?`Checked ${Ie(e.report.auditedAt)} · ${c}`:`No SEO check yet`}),(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>o(e.pageId,c),children:`View page`})]})]})}function Ue({local:e}){return(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,children:[(0,Q.jsx)(z,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:e?`No preview for this check. Run checks with Include SEO to see the search result and share card.`:`Previews stay on the installation that ran the checks. The issues below came with the board.`})]})}function We(e,t){return!e.issues.some(e=>e.id===`canonical-elsewhere`)&&e.snapshot.canonical||t?.url||e.snapshot.url||``}function Ge({row:e,page:t}){let{snapshot:n}=e,r=ge(We(e,t)),i=n.social.siteName||r.site,a=n.title?de(n.title,{size:U.titleFont,pixels:U.titlePixels}):null,o=n.description?de(n.description,{size:U.descriptionFont,pixels:U.descriptionPixels}):null;return(0,Q.jsxs)(`figure`,{className:`rounded-lg border border-line bg-surface p-3`,"data-sw-seo-serp":e.pageId,children:[(0,Q.jsx)(`figcaption`,{className:`sr-only`,children:`Approximate Google desktop result`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Q.jsx)(`span`,{className:`grid bg-[#e8eaed] text-[#202124] [:root[data-mode=dark]_&]:bg-[#3c4043] [:root[data-mode=dark]_&]:text-[#dadce0] size-7 shrink-0 place-items-center rounded-full text-xs font-semibold uppercase`,"aria-hidden":`true`,children:(i||`?`).slice(0,1)}),(0,Q.jsxs)(`div`,{className:`min-w-0 leading-tight`,children:[(0,Q.jsx)(`p`,{className:`truncate text-[#202124] [:root[data-mode=dark]_&]:text-[#dadce0] text-[13px]`,children:i||`Unknown site`}),(0,Q.jsxs)(`p`,{className:`truncate text-[#4d5156] [:root[data-mode=dark]_&]:text-[#bdc1c6] text-[11.5px]`,children:[r.origin,r.path.length?` › ${r.path.join(` › `)}`:``]})]})]}),(0,Q.jsx)(`p`,{className:d(`mt-2 font-[Arial,Helvetica,sans-serif] text-[#1a0dab] [:root[data-mode=dark]_&]:text-[#99c3ff] line-clamp-2 text-[18px] leading-6`,!a&&`italic opacity-70`),"data-sw-seo-serp-title":`true`,children:a?a.text:`No title: Google writes one from the page`}),(0,Q.jsx)(`p`,{className:d(`mt-1 font-[Arial,Helvetica,sans-serif] text-[#474747] [:root[data-mode=dark]_&]:text-[#bfbfbf] text-ui`,!o&&`italic`),"data-sw-seo-serp-description":`true`,children:o?o.text:`No description: Google picks text from the page, often a menu or banner.`}),a?.cut||o?.cut?(0,Q.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted`,children:[`Cut where Google’s desktop result is likely to cut it (`,a?.cut?`title`:``,a?.cut&&o?.cut?` and `:``,o?.cut?`description`:``,`).`]}):null]})}function Ke({row:e,page:t}){let{snapshot:n}=e,r=ge(We(e,t)),i=n.social.title||n.title,a=n.social.description||n.description,o=[!n.social.title&&n.title?`page title`:null,!n.social.description&&n.description?`meta description`:null].filter(Boolean);return(0,Q.jsxs)(`figure`,{"data-sw-seo-social":e.pageId,children:[(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-line bg-surface`,children:[n.image?(0,Q.jsx)(`img`,{src:n.image.dataUrl,alt:`Share image for ${e.title}`,className:`aspect-[1200/630] w-full bg-surface-2 object-cover`,"data-sw-seo-social-image":`true`}):(0,Q.jsx)(`div`,{className:`grid aspect-[1200/630] w-full place-items-center bg-surface-2 text-muted`,children:(0,Q.jsxs)(`span`,{className:`flex flex-col items-center gap-1.5 text-xs`,children:[(0,Q.jsx)(T,{size:20,"aria-hidden":`true`}),n.social.image?`Image not previewed here`:`No share image`]})}),(0,Q.jsxs)(`div`,{className:`space-y-0.5 border-t border-line px-3 py-2.5`,children:[(0,Q.jsx)(`p`,{className:`truncate text-[11px] tracking-wide text-muted uppercase`,children:r.site||`unknown site`}),(0,Q.jsx)(`p`,{className:d(`line-clamp-2 text-sm leading-5 font-semibold`,!i&&`text-muted italic`),children:i||`No title`}),a?(0,Q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-4 text-muted`,children:a}):null]})]}),(0,Q.jsxs)(`figcaption`,{className:`mt-1.5 text-[11px] text-muted`,children:[`Large link preview as most apps show it`,n.social.card?` · twitter:card ${n.social.card}`:``,o.length?` · using the ${o.join(` and `)}`:``,n.social.image&&!n.image?` · the image is on another site or could not be decoded`:``,`.`]})]})}function qe({issue:e,onComment:n,onFix:r}){let a=Le[e.level],o=a.icon;return(0,Q.jsxs)(`li`,{className:`rounded-lg border border-line p-2.5`,"data-sw-seo-issue":e.id,"data-sw-seo-level":e.level,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(o,{size:16,className:d(`mt-0.5 shrink-0`,a.tone),"aria-label":a.label,role:`img`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm leading-5 font-medium`,children:e.label}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:e.explain}),e.id.startsWith(`duplicate-`)&&e.observation?(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:e.observation}):null,(0,Q.jsxs)(`p`,{className:`text-xs leading-4`,children:[(0,Q.jsx)(`span`,{className:`font-semibold`,children:`How to fix: `}),e.fix]})]})]}),n||r?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[n?(0,Q.jsxs)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:n,"data-sw-seo-comment":e.id,children:[(0,Q.jsx)(E,{size:14,"aria-hidden":`true`}),` Comment`]}):null,r?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:r,"data-sw-seo-fix-agent":e.id,children:[(0,Q.jsx)(i,{size:14,"aria-hidden":`true`}),` Fix with agent`]}):null]}):null]})}function Je({control:e,pages:n,pageId:r,tab:i}){let[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(r?`page`:`all`),[l,f]=(0,B.useState)(!0);if(!e||e.loading)return null;let{run:p}=e,m=e=>n.find(t=>t.id===e)?.title||e;if(p?.state===`running`){let n=p.total?Math.round(p.done/p.total*100):0;return(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-accent/40 bg-accent/5 p-3`,"data-sw-checks-run-progress":`true`,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-accent`,children:(0,Q.jsx)(u,{size:14})}),(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate font-medium`,children:p.stopping?`Stopping…`:p.current?`Checking ${m(p.current.pageId)} · ${p.current.viewport}`:`Starting the browser…`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted tabular`,children:[p.done,` of `,p.total]}),e.canRun&&e.stop?(0,Q.jsxs)(t,{size:`xs`,variant:`ghost`,className:`h-11 px-2 lg:h-7`,disabled:e.stopping||p.stopping,onClick:e.stop,"data-sw-checks-run-stop":`true`,children:[e.stopping||p.stopping?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(C,{size:12,"aria-hidden":`true`}),` Stop`]}):null]}),(0,Q.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,role:`progressbar`,"aria-label":`Checks progress`,"aria-valuemin":0,"aria-valuemax":p.total,"aria-valuenow":p.done,children:(0,Q.jsx)(`span`,{className:`block h-full rounded-full bg-accent transition-[width] duration-(--motion-slow)`,style:{width:`${Math.max(4,n)}%`}})}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[p.seo?`Page checks with SEO`:`Page checks`,` · one page at a time, reusing configured sign-in and page actions.`]})]})}if(!e.canRun)return(0,Q.jsxs)(`p`,{className:`flex gap-2 text-xs text-muted`,"data-sw-checks-run-locked":`true`,children:[(0,Q.jsx)(te,{size:14,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{children:e.reason||`Run checks in the installation terminal.`})]});let g=s===`page`&&r?n.filter(e=>e.id===r):n,_=g.reduce((e,t)=>e+(t.viewports?.length||1),0),v=g.filter(t=>e.privatePages.includes(t.id)).length,y=p&&p.state!==`running`?p:null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-checks-run":`true`,children:[y&&!a?(0,Q.jsx)(Ye,{run:y}):null,e.error?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:e.error}):null,a?(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line bg-surface-2/60 p-3`,"data-sw-checks-run-options":`true`,children:[r?(0,Q.jsx)(b,{label:`Pages to check`,value:s,onChange:c,variant:`underline`,options:[{id:`page`,label:m(r)},{id:`all`,label:`All ${n.length} pages`}]}):null,(0,Q.jsxs)(h,{pressed:l,onPressedChange:f,size:`touch`,className:`h-auto min-h-11 w-full justify-start gap-2.5 py-2 text-left whitespace-normal lg:min-h-9`,"data-sw-checks-run-seo":l?`on`:`off`,children:[(0,Q.jsx)(`span`,{className:d(`grid size-4 shrink-0 place-items-center rounded border`,l?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`),"aria-hidden":`true`,children:l?(0,Q.jsx)(j,{size:12,strokeWidth:3}):null}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:`Include SEO`}),(0,Q.jsxs)(`span`,{className:`block text-xs font-normal text-muted`,children:[`Titles, descriptions, robots, canonical and share images on public pages.`,v?` ${v} private page${v===1?` is`:`s are`} skipped.`:``]})]})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[_,` page view`,_===1?``:`s`,`, checked one at a time against the original site. Configured sign-in and page actions run again, so use test accounts for pages that change data.`]}),_>e.limit?(0,Q.jsxs)(`p`,{className:`text-xs text-bad`,children:[`A run from the board checks at most `,e.limit,` page views. Pick one page or use the terminal.`]}):null,(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-8`,onClick:()=>o(!1),children:`Cancel`}),(0,Q.jsxs)(t,{size:`xs`,variant:`default`,className:`h-11 px-3 lg:h-8`,disabled:e.starting||_>e.limit,onClick:async()=>{await e.start({pages:s===`page`&&r?[r]:null,seo:l})&&o(!1)},"data-sw-checks-run-start":`true`,children:[e.starting?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(k,{size:14,"aria-hidden":`true`}),` Start checks`]})]})]}):(0,Q.jsxs)(t,{size:`xs`,variant:i===`seo`?`default`:`secondary`,className:`h-11 w-full lg:h-8`,onClick:()=>{c(r?`page`:`all`),f(e.seoDefault!==!1),o(!0)},"data-sw-checks-run-open":`true`,children:[(0,Q.jsx)(k,{size:14,"aria-hidden":`true`}),` `,y?`Run checks again`:`Run checks`]})]})}function Ye({run:e}){let t=e.state===`complete`?`ok`:e.state===`partial`||e.state===`stopped`?`warn`:`bad`,n=t===`ok`?j:t===`warn`?w:M;return(0,Q.jsxs)(`p`,{className:d(`flex items-start gap-2 rounded-lg px-2.5 py-2 text-xs`,t===`ok`?`bg-ok/10`:t===`warn`?`bg-warn/15`:`bg-bad/10`),"data-sw-checks-run-result":e.state,role:`status`,children:[(0,Q.jsx)(n,{size:15,className:d(`mt-px shrink-0`,t===`ok`?`text-ok`:t===`warn`?`text-warn`:`text-bad`),"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[e.message,e.finishedAt?(0,Q.jsxs)(`span`,{className:`text-muted`,children:[` · `,Ie(e.finishedAt)]}):null]})]})}function Xe({label:e,children:t,defaultOpen:n=!1,className:r,...i}){let[a,s]=(0,B.useState)(n),c=(0,B.useId)();return(0,Q.jsxs)(`div`,{className:d(`text-xs`,r),...i,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":c,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-1.5 rounded-md text-left font-medium text-muted outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent lg:min-h-7`,children:[(0,Q.jsx)(o,{size:14,className:d(`shrink-0 transition-transform`,a?`rotate-0`:`-rotate-90`),"aria-hidden":`true`}),e]}),a?(0,Q.jsx)(`div`,{id:c,className:`pt-1 pb-1`,children:t}):null]})}var Ze=e=>`${new Date(e.auditedAt).toLocaleString()} · ${e.state} · ${e.profile.sourceBuild?`build ${e.profile.sourceBuild.slice(0,8)}`:`build undeclared`} · ${e.id.slice(-4)}`;function Qe({views:e,pages:t}){let n=e.flatMap(e=>q(e).filter(e=>(e.history?.length||0)>1).map(t=>({key:`${e.pageId}|${e.viewport}|${t.report.profile.runner}`,view:e,run:t}))),[r,i]=(0,B.useState)(null),a=n.find(e=>e.key===r)||n[0];if(!a)return(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,"data-sw-checks-history":`true`,children:[(0,Q.jsx)(ne,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`No page has two retained reports from the same runner yet. Run checks again to compare before and after.`})]});let o=e=>t.find(t=>t.id===e)?.title||e;return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-history":`true`,children:[(0,Q.jsxs)(S,{value:a.key,onValueChange:i,children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`History page and runner`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:n.map(e=>(0,Q.jsxs)(_,{value:e.key,children:[o(e.view.pageId),` · `,X(e.view.viewport),` · `,we[e.run.report.profile.runner]||e.run.report.profile.runner]},e.key))})]}),(0,Q.jsx)($e,{run:a.run},a.key)]})}function $e({run:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(`none`),[a,o]=(0,B.useState)(!1),s=e.history,l=s.find(e=>e.id===t)||e.report,u=s.find(e=>e.id===r&&e.id!==l.id);return(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line bg-surface p-3 shadow-card text-xs`,"data-sw-check-report":l.id,children:[(0,Q.jsxs)(`p`,{className:`text-muted`,children:[s.length,` retained reports for this runner and device. Screenshots may have expired.`]}),(0,Q.jsxs)(`label`,{className:`block space-y-1`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`After`}),(0,Q.jsxs)(S,{value:l.id,onValueChange:e=>{n(e),i(`none`)},children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`After report`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:s.map(e=>(0,Q.jsx)(_,{value:e.id,children:Ze(e)},e.id))})]})]}),(0,Q.jsxs)(`label`,{className:`block space-y-1`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`Before`}),(0,Q.jsxs)(S,{value:r,onValueChange:i,children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`Before report`,children:(0,Q.jsx)(c,{placeholder:`Choose a baseline`})}),(0,Q.jsxs)(f,{children:[(0,Q.jsx)(_,{value:`none`,children:`Choose a baseline`}),s.filter(e=>e.id!==l.id).map(e=>(0,Q.jsx)(_,{value:e.id,children:Ze(e)},e.id))]})]})]}),l.id===e.report.id?null:(0,Q.jsx)(`p`,{className:`font-medium`,children:`Historical report; current page state is not verified.`}),l.findings.length?(0,Q.jsx)(`ul`,{className:`space-y-1`,children:l.findings.map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(`span`,{className:G(e)===`warning`?`text-warn`:`text-muted`,"aria-hidden":`true`,children:`•`}),(0,Q.jsx)(`span`,{children:e.title})]},e.id))}):(0,Q.jsx)(`p`,{className:`text-muted`,children:`No findings in this report.`}),u?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{pressed:a,onPressedChange:o,size:`touch`,className:`h-auto min-h-11 w-full justify-start py-2 text-left whitespace-normal`,children:`Allow declared build as the changed variable`}),(0,Q.jsx)(et,{before:u,after:l,allowBuildChange:a})]}):null]})}function et({before:e,after:t,allowBuildChange:n}){let r=be(e,t,{allowBuildChange:n});return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-check-comparison":`true`,"aria-live":`polite`,children:[(0,Q.jsx)(`p`,{className:`font-semibold`,children:`Before → After`}),r.comparable?(0,Q.jsxs)(`p`,{className:`text-muted`,children:[r.declaredBuildChange?`Declared build changed; all other recorded conditions match.`:`Recorded measurement conditions match.`,` `,`Repeat the same profile before calling a change a regression.`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{children:`These reports cannot be compared under the selected conditions.`}),(0,Q.jsx)(`ul`,{className:`list-disc pl-4 text-muted`,children:r.reasons.map(e=>(0,Q.jsx)(`li`,{children:e},e))})]}),(0,Q.jsx)(`div`,{className:`space-y-1.5`,children:r.metrics.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded-md bg-surface-2 px-2 py-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:Me(e.key)}),(0,Q.jsxs)(`span`,{className:`tabular`,children:[Z(e.key,e.before),` → `,Z(e.key,e.after)]}),(0,Q.jsx)(`span`,{className:`text-muted tabular`,children:e.delta===null?`unknown`:`${e.delta>0?`+`:``}${Math.round(e.delta*100)/100}${e.change===`small`?` (small)`:``}`})]},e.key))}),r.findingsComparable?(0,Q.jsxs)(`p`,{children:[`Findings: `,r.added.length,` newly observed · `,r.removed.length,` no longer observed · `,r.retained.length,` `,`still observed.`]}):(0,Q.jsxs)(`p`,{className:`text-muted`,children:[`Finding changes are unknown:`,` `,r.budgetsChanged?`recorded budget policy changed.`:`both reports must be complete and comparable.`]})]})}function tt({issues:e,pages:n,category:r,onCategory:i,onView:a,onDraft:o,canComment:s,onSeo:c}){let l=e.filter(e=>r===`all`||e.category===r),u=l.filter(e=>e.severity===`warning`),d=l.filter(e=>e.severity!==`warning`),f=e=>n.find(t=>t.id===e)?.title||e;return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-issues":`true`,children:[r===`all`?null:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`min-w-0 flex-1 text-muted`,children:[`Showing `,(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:Y.find(e=>e.id===r)?.label}),` only`]}),(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>i(`all`),"data-sw-checks-show-all":`true`,children:`Show all`})]}),l.length?null:(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-ok/10 p-3 text-xs`,children:[(0,Q.jsx)(j,{size:15,className:`shrink-0 text-ok`,"aria-hidden":`true`}),`No findings in the checks that ran`,r===`all`?``:` for ${Y.find(e=>e.id===r)?.label}`,`. Pages that were not checked are listed under Pages.`]}),u.length?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Needs attention`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold`,children:[(0,Q.jsx)(w,{size:14,className:`text-warn`,"aria-hidden":`true`}),`Needs attention `,(0,Q.jsx)(`span`,{className:`font-normal text-muted tabular`,children:u.length})]}),u.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))]}):null,d.length?u.length?(0,Q.jsx)(Xe,{label:`Notes (${d.length})`,"data-sw-checks-notes":`true`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:d.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))})}):(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Notes`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold`,children:[(0,Q.jsx)(O,{size:14,className:`text-muted`,"aria-hidden":`true`}),`Notes `,(0,Q.jsx)(`span`,{className:`font-normal text-muted tabular`,children:d.length})]}),d.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))]}):null]})}function nt({issue:e,title:n,onView:r,onDraft:i,canComment:a,onSeo:o}){let{finding:s}=e,c=e.severity===`warning`,l=c?e.category===`reliability`?M:w:O;return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-line bg-surface p-2.5 shadow-card`,"data-sw-check-finding":s.id,"data-sw-check-issue":e.key,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(l,{size:16,className:d(`mt-0.5 shrink-0`,c?e.category===`reliability`?`text-bad`:`text-warn`:`text-muted`),"aria-label":c?`Needs attention`:`Note`,role:`img`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[11px] text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(`span`,{children:e.viewports.map(X).join(`, `)}),(0,Q.jsx)(x,{tone:`neutral`,shape:`tag`,children:e.category})]}),(0,Q.jsx)(`h4`,{className:`text-sm leading-5 font-medium`,children:s.title}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:s.observation}),(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:s.nextAction})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[e.category===`seo`&&o?(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>o(e.pageId),children:`See in SEO`}):null,(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,disabled:!e.canvasCapture,onClick:()=>r(e.pageId,e.viewports[0]),children:`View page`}),a&&e.canvasCapture?(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:()=>i(e.view,e.report,s),children:`Create comment`}):null]})]})}var rt=e=>e===`complete`?`ok`:e===`failed`||e===`unsupported`?`bad`:e===`not-run`?`neutral`:`warn`;function it(e){let t=e.metrics;return e.profile.runner===`lighthouse`&&t.lighthouseLabScore!==void 0?`Score ${t.lighthouseLabScore??`--`} · LCP ${Z(`largestContentfulPaintMs`,t.largestContentfulPaintMs??null)}`:e.profile.runner===`axe`?`${t.violationRules??`--`} rules failing · ${t.scannedElements??`--`} elements`:e.profile.runner===`playwright-flow`?`${t.completedSteps??`--`} of ${t.configuredSteps??`--`} steps · ${Z(`flowDurationMs`,t.flowDurationMs??null)}`:`Load ${Z(`loadMs`,t.loadMs??null)} · ${t.requestCount??`--`} requests`}function at({views:e,pages:n,onView:r}){return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-pages":`true`,children:[e.length?null:(0,Q.jsx)(`p`,{className:`py-6 text-center text-xs text-muted`,children:`No pages match this filter.`}),e.map(e=>{let i=n.find(t=>t.id===e.pageId)?.title||e.pageId,a=q(e);return(0,Q.jsxs)(`article`,{className:`space-y-2 rounded-lg border border-line bg-surface p-3 shadow-card`,"data-sw-checks-view":`${e.pageId}|${e.viewport}`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start gap-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:i}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:X(e.viewport)})]}),(0,Q.jsx)(x,{tone:rt(e.state),children:Te[e.state]||e.state})]}),e.canvasCapture===!1?(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Diagnostics only: this environment is not the canvas capture, so pins are off.`}):null,e.state===`stale`?(0,Q.jsx)(`p`,{className:`text-xs text-warn`,children:`The page or its settings changed since this run. Run checks again before relying on it.`}):null,a.length?null:(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Not checked yet for this screen size. This does not mean it passed.`}),a.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-line rounded-md border border-line`,children:a.map(e=>{let t=e.report,n=t.profile.runner,r=e.state||t.state;return(0,Q.jsxs)(`li`,{className:`space-y-1 px-2.5 py-2`,"data-sw-check-report":t.id,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:we[n]||n}),(0,Q.jsx)(x,{tone:rt(r),children:Te[r]||r})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted tabular`,children:[it(t),e.actionable?` · ${e.actionable} to fix`:``]}),(0,Q.jsx)(Xe,{label:`Technical details`,children:(0,Q.jsx)(ot,{report:t})})]},n)})}):null,(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(t,{disabled:e.canvasCapture===!1,size:`xs`,className:`h-11 lg:h-7`,variant:`secondary`,onClick:()=>r(e.pageId,e.viewport),children:`View page`})})]},`${e.pageId}-${e.viewport}`)})]})}function ot({report:e}){let t=e.profile,n=[...Object.entries(e.metrics).map(([e,t])=>[Me(e),Z(e,t)]),[`Viewport`,`${e.viewport.width} × ${e.viewport.height}`],[`Environment`,t.sourceEnvironment||e.environment],[`Checked`,new Date(e.auditedAt).toLocaleString()],[`Runner`,`${t.runner} ${t.version}`],[`Cache`,t.cache],[`Sign-in`,t.authRole===`configured`?`Configured`:`Anonymous`],[`Build`,t.sourceBuild?`${t.production} · ${t.sourceBuild.slice(0,8)}`:`${t.production} · undeclared`],[`Network`,e.completeness.network],[`Service worker`,e.completeness.serviceWorker===null?`Unknown`:e.completeness.serviceWorker?`Controlled`:`Not controlled`],...t.browser?[[`Browser`,t.browser.version]]:[],...t.throttling?[[`Throttling`,`${t.throttling.method} · ${t.throttling.rttMs??`?`} ms · ${t.throttling.throughputKbps??`?`} Kbps · CPU ${t.throttling.cpuSlowdownMultiplier??`?`}×`]]:[],[`SEO checks`,t.seo?`On`:`Off`],[`Report`,e.id],[`Capture`,e.captureVersion||`Unassociated`]];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`dl`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1`,children:n.map(([e,t])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`break-words text-muted`,children:e}),(0,Q.jsx)(`dd`,{className:`max-w-48 truncate text-right tabular`,children:t})]},e))}),e.completeness.limitations.length?(0,Q.jsx)(`ul`,{className:`list-disc space-y-0.5 pl-4 text-muted`,children:e.completeness.limitations.map((e,t)=>(0,Q.jsx)(`li`,{children:e},t))}):null]})}var st=Object.freeze({ttfbMs:`Time to first byte (ms)`,loadMs:`Load (ms)`,domContentLoadedMs:`DOM content loaded (ms)`,documentTransferBytes:`Document transfer (bytes)`,resourceTransferBytes:`Resource transfer (bytes)`,resourceDecodedBytes:`Decoded resources (bytes)`,requestCount:`Requests`,largestContentfulPaintMs:`Largest contentful paint (ms)`,firstContentfulPaintMs:`First contentful paint (ms)`,totalBlockingTimeMs:`Total blocking time (ms)`,cumulativeLayoutShift:`Cumulative layout shift`,transferredResourceBytes:`Transferred resources (bytes)`,observedRequests:`Observed requests`,speedIndexMs:`Speed index (ms)`});function ct(e){return Object.entries(e.budgets?.thresholds||{}).map(([t,n])=>{let r=e.metrics[t],i=[`complete`,`partial`].includes(e.state)&&typeof r==`number`&&Number.isFinite(r)?r:null;return{metric:t,limit:n,value:i,state:i===null?`unknown`:i>n?`over`:`within`}})}var lt=[[`largestContentfulPaintMs`,`LCP`,2500,4e3],[`totalBlockingTimeMs`,`TBT`,200,600],[`cumulativeLayoutShift`,`CLS`,.1,.25]],ut=(e,t,n)=>e==null?`text-faint`:e<=t?`text-ok`:e<=n?`text-warn`:`text-bad`;function dt({views:e,pages:t}){let[n,r]=(0,B.useState)(`lcp`),i=e.map(e=>({view:e,run:q(e).find(e=>e.report?.profile.runner===`lighthouse`),load:q(e).find(e=>e.report?.profile.runner===`playwright`)})).filter(e=>e.run||e.load),a=e=>e.run?.report.metrics.largestContentfulPaintMs??-1,o=e=>e.run?.report.metrics.lighthouseLabScore??101;return i.sort((e,t)=>n===`lcp`?a(t)-a(e):o(e)-o(t)),(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-performance":`true`,children:[(0,Q.jsx)(b,{label:`Performance order`,value:n,onChange:r,variant:`underline`,options:[{id:`lcp`,label:`Slowest LCP first`},{id:`score`,label:`Lowest score first`}]}),i.length?null:(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,children:[(0,Q.jsx)(I,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`No performance runs yet. Lighthouse lab audits run with shapewall audit; page checks record load times.`})]}),i.map(({view:e,run:n,load:r})=>{let i=n?.report,a=i?.metrics||{},o=t.find(t=>t.id===e.pageId)?.title||e.pageId,s=i?ct(i):[];return(0,Q.jsxs)(`article`,{className:`space-y-2.5 rounded-lg border border-line bg-surface p-3 shadow-card`,"data-sw-checks-perf":`${e.pageId}|${e.viewport}`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center gap-2.5`,children:[(0,Q.jsx)(Pe,{score:i?a.lighthouseLabScore??null:null,size:40,label:i?`Lighthouse score ${a.lighthouseLabScore??`unknown`}`:`No Lighthouse run`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:o}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[X(e.viewport),n?.state===`stale`?` · stale`:``,r?` · load ${Z(`loadMs`,r.report.metrics.loadMs??null)}`:``]})]})]}),i?(0,Q.jsx)(`dl`,{className:`grid grid-cols-3 gap-2`,children:lt.map(([e,t,n,r])=>(0,Q.jsxs)(`div`,{className:`rounded-md bg-surface-2 px-2 py-1.5`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted`,children:t}),(0,Q.jsx)(`dd`,{className:d(`text-sm font-semibold tabular`,ut(a[e],n,r)),children:Z(e,a[e]??null)})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`No Lighthouse audit for this view yet.`}),s.length?(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Recorded performance budgets`,children:s.map(e=>{let t=e.value===null?0:Math.min(1,e.value/Math.max(e.limit,1e-9));return(0,Q.jsxs)(`li`,{className:`text-xs`,"data-sw-checks-budget":e.state,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 text-muted`,children:st[e.metric]}),(0,Q.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap tabular`,children:[Z(e.metric,e.value),` / `,Z(e.metric,e.limit)]}),(0,Q.jsx)(`span`,{className:d(`shrink-0 font-medium whitespace-nowrap`,e.state===`over`?`text-bad`:e.state===`within`?`text-ok`:`text-muted`),children:e.state===`over`?`Over budget`:e.state===`within`?`Within budget`:`Not measured`})]}),(0,Q.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,Q.jsx)(`span`,{className:d(`block h-full rounded-full`,e.state===`over`?`bg-bad`:`bg-ok`),style:{width:`${e.state===`over`?100:t*100}%`}})})]},e.metric)})}):null]},`${e.pageId}|${e.viewport}`)}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Lab measurements on this machine, not real-user data. Scores are never blended across pages.`})]})}var ft=[[`issues`,`Issues`],[`pages`,`Pages`],[`seo`,`SEO`],[`performance`,`Performance`],[`history`,`History`]];function pt(){let e=(0,B.useRef)(null),[t,n]=(0,B.useState)({start:!1,end:!1}),r=(0,B.useCallback)(()=>{let t=e.current;if(!t)return;let r=t.scrollLeft>1,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;n(e=>e.start===r&&e.end===i?e:{start:r,end:i})},[]);(0,B.useLayoutEffect)(()=>{if(r(),typeof ResizeObserver>`u`||!e.current)return;let t=new ResizeObserver(r);return t.observe(e.current),()=>t.disconnect()},[r]);let i=t.start||t.end?`linear-gradient(to right, ${t.start?`transparent, #000 2rem`:`#000, #000`}, ${t.end?`#000 calc(100% - 2rem), transparent`:`#000`})`:void 0;return{ref:e,edges:t,measure:r,style:i?{maskImage:i,WebkitMaskImage:i}:void 0}}function mt({data:e,error:r,loading:i,pages:o,pageId:s,viewport:u,onSelect:d,onClose:h,onRefresh:v,onEnvironment:x,onView:C,onDraft:w,canComment:te,command:T,local:ne,tab:E=`issues`,onTab:D=()=>{},seo:O=null,run:k=null}){let[A,j]=(0,B.useState)(`all`),[M,N]=(0,B.useState)(`all`),P=(0,B.useMemo)(()=>Se((e?.views||[]).filter(e=>(!s||e.pageId===s)&&(!u||e.viewport===u)&&(A===`all`||e.viewport===A))),[e,s,u,A]),F=(0,B.useMemo)(()=>Ee(P),[P]),I=(0,B.useMemo)(()=>he({views:P,pages:o.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:O?.snapshots||{},privatePages:O?.privatePages||[]}).summary,[P,o,O]),oe=(0,B.useMemo)(()=>ke(P,F).map(e=>e.id===`seo`?{...e,warnings:I.errors+I.warnings,advisories:I.tips,unchecked:!I.checked}:e),[P,F,I]),L=[...new Set((e?.views||[]).map(e=>e.viewport))],R=pt();(0,B.useEffect)(()=>{let e=R.ref.current,t=e?.querySelector(`[data-sw-checks-tab="${E}"]`);if(!e||!t||e.scrollWidth<=e.clientWidth)return;let n=t.offsetLeft-e.offsetLeft,r=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,n+t.offsetWidth/2-e.clientWidth/2));Math.abs(r-e.scrollLeft)>1&&e.scrollTo({left:r,behavior:ie()})},[E,R.ref]);let z=o.find(e=>e.id===s),se=e=>{if(e===`seo`)return D(`seo`);N(t=>t===e&&E===`issues`?`all`:e),D(`issues`)},V=(e,t,{fix:n})=>w({pageId:e.pageId,viewport:e.report.viewport.name},e.report,{title:n?`@agent please fix on this page: ${t.label}`:t.label,observation:`${t.explain}${t.id.startsWith(`duplicate-`)&&t.observation?` ${t.observation}`:``}`,nextAction:`How to fix: ${t.fix}`}),H=e?.demo?`Fictional demo reports; no live audit was run.`:e?.imported?`Imported with the board; sign-in and page state can’t be verified here.`:null;return(0,Q.jsxs)(`section`,{className:`flex flex-col lg:min-h-0 lg:flex-1`,"data-sw-checks-panel":`true`,children:[(0,Q.jsx)(`header`,{className:`hidden border-b border-line lg:block`,children:(0,Q.jsx)(ee,{icon:re,title:`Checks`,onClose:h,closeLabel:`Close checks`,children:(0,Q.jsx)(a,{className:`ml-auto`,label:`Refresh checks`,onClick:v,children:(0,Q.jsx)(ae,{size:15,"aria-hidden":`true`})})})}),(0,Q.jsxs)(`div`,{className:`lg:relative lg:min-h-0 lg:flex-1 lg:overflow-y-auto lg:overscroll-contain`,"data-sw-checks-results":`true`,children:[(0,Q.jsxs)(`div`,{className:`sw-gutter-pad space-y-3 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[z?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 max-w-full lg:h-7`,onClick:()=>d(null,null),children:[(0,Q.jsxs)(`span`,{className:`truncate`,children:[`This page: `,z.title]}),(0,Q.jsx)(n,{size:13,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Show all pages`})]}):null,e?.environments?.length>1&&x?(0,Q.jsxs)(S,{value:e.environment,onValueChange:x,children:[(0,Q.jsx)(p,{className:`h-11 min-w-0 flex-1 lg:h-7`,"aria-label":`Checks environment`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:e.environments.map(e=>(0,Q.jsxs)(_,{value:e.id,children:[e.id,e.captured?` · canvas capture`:` · diagnostics`]},e.id))})]}):null,L.length>1?(0,Q.jsx)(b,{label:`Checks screen size`,value:A,onChange:j,variant:`underline`,className:`w-full basis-full`,options:[{id:`all`,label:`All`},...L.map(e=>({id:e,label:X(e)}))]}):null,(0,Q.jsx)(t,{"data-autofocus":!0,size:`icon`,variant:`ghost`,className:`lg:hidden`,"aria-label":`Refresh checks`,onClick:v,children:(0,Q.jsx)(ae,{size:15})})]}),i?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted`,children:`Loading checks…`}):null,r?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:`Checks are unavailable for this view. Refresh or check access to this board.`}):null,e?(0,Q.jsx)(Fe,{totals:oe,active:E===`seo`?`seo`:M,onPick:se}):null,(0,Q.jsx)(Je,{control:k,pages:o,pageId:s,tab:E}),e?(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,"data-sw-checks-coverage":`true`,children:[e.checked,` of `,e.total,` page/device views checked`,H?` · ${H}`:``]}):null]}),(0,Q.jsxs)(m,{value:E,onValueChange:D,children:[(0,Q.jsx)(`div`,{className:`sw-gutter-pad sticky top-0 z-10 border-t border-line bg-surface px-3`,children:(0,Q.jsx)(g,{variant:`underline`,ref:R.ref,onScroll:R.measure,style:R.style,"aria-label":`Checks view`,"data-sw-checks-tabs-more":R.edges.start&&R.edges.end?`both`:R.edges.end?`end`:R.edges.start?`start`:`none`,children:ft.map(([e,t])=>(0,Q.jsxs)(y,{value:e,"data-sw-checks-tab":e,children:[t,e===`issues`&&F.some(e=>e.severity===`warning`)?(0,Q.jsx)(`span`,{className:`ml-1 text-faint tabular`,children:F.filter(e=>e.severity===`warning`).length}):null]},e))})}),(0,Q.jsx)(l,{value:`issues`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(tt,{issues:F,pages:o,category:M,onCategory:N,onView:C,onDraft:w,canComment:te,onSeo:e=>{D(`seo`),e&&e!==s&&d(e,null)}})}),(0,Q.jsx)(l,{value:`pages`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(at,{views:P,pages:o,onView:C})}),(0,Q.jsx)(l,{value:`seo`,children:(0,Q.jsx)(ze,{data:e,seo:O,pages:o,pageId:s,local:ne,canComment:te,canFix:!0,onIssue:V,onView:C,command:T})}),(0,Q.jsx)(l,{value:`performance`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(dt,{views:P,pages:o})}),(0,Q.jsx)(l,{value:`history`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(Qe,{views:P,pages:o})})]})]}),(0,Q.jsxs)(`footer`,{className:`space-y-1 border-t border-line px-3 py-2 text-xs text-muted`,children:[ne?(0,Q.jsxs)(Xe,{label:k?.canRun?`Run from the terminal instead`:`Run checks from the terminal`,children:[(0,Q.jsx)(`p`,{className:`mb-1.5`,children:`Runs reuse configured sign-in and replay page actions, one page at a time.`}),T?(0,Q.jsx)(`code`,{className:`block rounded bg-surface-2 p-2 break-all text-fg`,children:T}):null]}):(0,Q.jsx)(`p`,{children:`Checks run on your computer or in CI and are sent with the board.`}),(0,Q.jsx)(`p`,{children:`Findings never send work to an agent automatically.`})]})]})}export{mt as default};
1
+ import{$t as e,B as t,Ht as n,Jt as r,Kt as i,V as a,Wt as o,Xt as s,_ as c,a as l,c as u,ct as d,d as f,g as p,i as m,n as h,o as g,p as _,qt as v,s as y,t as b,tt as x,u as S}from"./ui-Cg4TTrec.js";import{K as C,L as ee,W as w,at as te,dt as T,et as ne,ht as re,it as E,lt as D,t as ie,ut as O}from"./index-C9S7HL_o.js";import{t as ae}from"./refresh-cw-aeOBDuGQ.js";import{n as k,t as A}from"./shield-check-DuPBJ6H_.js";import{n as j,t as M}from"./circle-x-PRxj7kPi.js";var N={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};N.node;var P=v(N),F={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};F.node;var I=v(F),oe={name:`person-standing`,size:24,node:[[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`path`,{d:`m9 20 3-6 3 6`,key:`se2kox`}],[`path`,{d:`m6 8 6 2 6-2`,key:`4o3us4`}],[`path`,{d:`M12 10v4`,key:`1kjpxc`}]]};oe.node;var L=v(oe),R={name:`search-check`,size:24,node:[[`path`,{d:`m8 11 2 2 4-4`,key:`1sed1v`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]};R.node;var z=v(R),B=e(s(),1),se={" ":278,"!":278,'"':355,"#":556,$:556,"%":889,"&":667,"'":191,"(":333,")":333,"*":389,"+":584,",":278,"-":333,".":278,"/":278,":":278,";":278,"<":584,"=":584,">":584,"?":556,"@":1015,"[":278,"]":278,_:556,"|":260,"–":556,"—":1e3,"·":278,"…":1e3,"’":222,"‘":222,"“":333,"”":333},V={A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833};Object.assign(V,{N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611});var H={a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833};Object.assign(H,{n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500});function ce(e){return se[e]===void 0?V[e]===void 0?H[e]===void 0?/[0-9]/.test(e)?556:e.codePointAt(0)>=11904?1e3:/\p{Lu}/u.test(e)?700:560:H[e]:V[e]:se[e]}function le(e,t){let n=0;for(let t of String(e||``))n+=ce(t);return n*t/1e3}var U=Object.freeze({titleFont:20,titlePixels:580,titleMinChars:10,descriptionFont:14,descriptionPixels:920,descriptionMinChars:50}),ue=e=>String(e||``).replace(/\s+/g,` `).trim();function de(e,{size:t,pixels:n}){let r=ue(e);if(le(r,t)<=n)return{text:r,cut:!1};let i=n-le(` ...`,t),a=0,o=0;for(let e of r){let n=a+ce(e)*t/1e3;if(n>i)break;a=n,o+=e.length}let s=r.slice(0,o),c=s.lastIndexOf(` `);return c>o*.6&&(s=s.slice(0,c)),{text:`${s.replace(/[\s,.;:–—-]+$/,``)} ...`,cut:!0}}var W=Object.freeze({"search-noindex":{level:`error`,group:`indexing`,label:`Asks search engines not to index it`,explain:`A robots "noindex" tag or header tells Google to leave this page out of search results.`,fix:`Remove the noindex robots meta tag or X-Robots-Tag header if this page should be found. If it is meant to stay private, mark the page private in the Shapewall config.`},"robots-crawl-blocked":{level:`error`,group:`indexing`,label:`Blocked by robots.txt`,explain:`The site’s robots.txt rules stop Googlebot from crawling this address, so Google can’t read its content.`,fix:`Change the Disallow rule in robots.txt that matches this path, or add a more specific Allow rule for it.`},"robots-unavailable":{level:`tip`,group:`indexing`,label:`Crawl rules could not be read`,explain:`robots.txt redirected, timed out or was too large, so crawl permission is unknown.`,fix:`Serve robots.txt directly from the site root with a 200 or 404 response.`},"missing-title":{level:`error`,group:`title`,label:`No page title`,explain:`Without a <title>, Google writes its own headline for the result, usually from text on the page.`,fix:`Add a unique <title> that says what the page is, with the brand at the end.`},"seo-title-long":{level:`tip`,group:`title`,label:`Title will be cut off`,explain:`Google shows about 580 pixels of a title (roughly 55 to 60 characters). The rest is replaced with an ellipsis.`,fix:`Put the important words first and shorten the title so it fits.`},"seo-title-short":{level:`tip`,group:`title`,label:`Title is very short`,explain:`A very short title gives searchers little reason to pick this result.`,fix:`Describe the page in a few more words, for example the product or topic and the brand.`},"duplicate-title":{level:`warning`,group:`title`,label:`Same title as another page`,explain:`Several pages share this title, so searchers can’t tell them apart and Google may pick the wrong one.`,fix:`Give each page its own title that names what is different about it.`},"seo-description":{level:`warning`,group:`description`,label:`No meta description`,explain:`Without a description, Google picks a snippet from the page text, which is often a menu or a cookie banner.`,fix:`Add <meta name="description"> with one or two sentences (about 120 to 155 characters) that sell the page.`},"seo-description-long":{level:`tip`,group:`description`,label:`Description will be cut off`,explain:`Google shows about 920 pixels of a description (roughly 150 to 160 characters) on desktop and less on phones.`,fix:`Keep the key message in the first 120 characters.`},"seo-description-short":{level:`tip`,group:`description`,label:`Description is very short`,explain:`A short description leaves room Google may fill with page text instead.`,fix:`Write one or two full sentences about what the visitor gets on this page.`},"duplicate-description":{level:`warning`,group:`description`,label:`Same description as another page`,explain:`Repeated descriptions make results look identical and tell searchers nothing about this page.`,fix:`Write a description for this page that is specific to it.`},"seo-canonical":{level:`warning`,group:`canonical`,label:`No canonical URL`,explain:`A canonical link tells search engines which address is the real one when the page is reachable at several (with tracking parameters, trailing slashes or www).`,fix:`Add <link rel="canonical" href="..."> with the page’s full preferred address.`},"canonical-invalid":{level:`warning`,group:`canonical`,label:`Canonical URL is not a full address`,explain:`The canonical link is relative or not http(s). Search engines may ignore it.`,fix:`Use an absolute https:// address in the canonical link.`},"canonical-elsewhere":{level:`error`,group:`canonical`,label:`Canonical points to another page`,explain:`The canonical link names a different address, which tells Google to show that page instead of this one.`,fix:`Point the canonical link at this page’s own address, unless this really is a copy of the other page.`},"seo-ogtitle":{level:`warning`,group:`social`,label:`No social title`,explain:`Without og:title, Slack, LinkedIn, iMessage and others guess a headline for shared links.`,fix:`Add <meta property="og:title"> with the headline you want in link previews.`},"seo-ogdescription":{level:`tip`,group:`social`,label:`No social description`,explain:`Link previews show og:description under the headline. Without it they show nothing or random text.`,fix:`Add <meta property="og:description"> with one short sentence.`},"seo-ogimage":{level:`warning`,group:`social`,label:`No social image`,explain:`Shared links without og:image show as a plain text line and get far fewer clicks.`,fix:`Add <meta property="og:image"> with an absolute URL to a 1200 × 630 image.`},"social-image-failed":{level:`error`,group:`social`,label:`Social image is broken`,explain:`The og:image address returned an error or isn’t a valid image, so previews show a blank box.`,fix:`Fix the og:image URL so it returns a PNG, JPEG or WebP image with a 200 response.`},"social-image-invalid":{level:`warning`,group:`social`,label:`Social image URL is not a full address`,explain:`og:image must be an absolute http(s) URL. Most platforms ignore relative paths.`,fix:`Use the full https:// address of the image.`},"social-image-unavailable":{level:`tip`,group:`social`,label:`Social image could not be verified`,explain:`The image is on another domain, redirected or is in a format Shapewall can’t decode, so its preview is not shown here.`,fix:`Nothing is necessarily wrong. Check a preview with the platform’s own debugger if in doubt.`},"social-image-dimensions":{level:`tip`,group:`social`,label:`Image size differs from its tags`,explain:`og:image:width and og:image:height don’t match the actual image, which can make previews crop or load late.`,fix:`Update the declared width and height to the real image size, or remove them.`}}),fe={error:0,warning:1,tip:2};function G(e){let t=e?.category===`seo`?W[e.id]:null;return t?t.level===`tip`?`advisory`:`warning`:e?.severity}Object.freeze(Object.keys(W));function pe(e,t,n,r=()=>!0){let i=null;for(let a of e){if(a.pageId!==t)continue;let e=a.runs?.length?a.runs:a.report?[{runner:a.report.profile.runner,state:a.state,report:a.report}]:[];for(let t of e){let e=t.report;e&&(t.runner||e.profile.runner)===n&&r(e)&&(!i||e.auditedAt>i.report.auditedAt||e.auditedAt===i.report.auditedAt&&e.viewport.name===`desktop`)&&(i={report:e,stale:t.state===`stale`})}}return i}var me=e=>ue(e).toLowerCase();function he({views:e=[],pages:t=[],snapshots:n={},privatePages:r=[]}={}){let i=new Set(r),a=t.map(t=>{let r=pe(e,t.id,`playwright`,e=>e.profile.seo),a=r||pe(e,t.id,`playwright`),o=pe(e,t.id,`lighthouse`,e=>Number.isFinite(e.metrics?.lighthouseSeoLabScore)),s=r?.report||null,c=s&&n[s.id]||null,l=i.has(t.id)||!!s?.findings.some(e=>e.id===`seo-private-expected`),u={pageId:t.id,title:t.title||t.id,url:t.url||null,status:l?`private`:a?s?s.state===`failed`?`failed`:`checked`:`no-seo`:`not-run`,stale:!!r?.stale,report:s,snapshot:c,lighthouseSeo:o?o.report.metrics.lighthouseSeoLabScore:null,issues:[]};if(u.status===`checked`)for(let e of s.findings){let t=W[e.id];!t||e.id.startsWith(`duplicate-`)&&c||u.issues.push({id:e.id,...t,observation:e.observation,finding:e})}return u}),o={title:[],description:[]};for(let e of[`title`,`description`]){let t=new Map;for(let n of a){if(n.status!==`checked`||!n.snapshot)continue;let r=me(n.snapshot[e]);r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}for(let[,n]of t)if(!(n.length<2)){o[e].push({value:ue(n[0].snapshot[e]),pageIds:n.map(e=>e.pageId)});for(let t of n){let r=n.filter(e=>e!==t).map(e=>e.title),i=`duplicate-${e}`;t.issues.push({id:i,...W[i],observation:`Also used on ${r.slice(0,3).join(`, `)}${r.length>3?` and ${r.length-3} more`:``}.`,finding:null,others:n.filter(e=>e!==t).map(e=>e.pageId)})}}}for(let e of[`title`,`description`])if(!o[e].length){let t=a.filter(t=>t.issues.some(t=>t.id===`duplicate-${e}`)).map(e=>e.pageId);t.length>1&&o[e].push({value:null,pageIds:t})}for(let e of a)e.issues.sort((e,t)=>fe[e.level]-fe[t.level]),e.errors=e.issues.filter(e=>e.level===`error`).length,e.warnings=e.issues.filter(e=>e.level===`warning`).length,e.tips=e.issues.filter(e=>e.level===`tip`).length,e.indexable=e.status===`checked`?!e.issues.some(e=>[`search-noindex`,`robots-crawl-blocked`,`canonical-elsewhere`].includes(e.id)):null;let s=a.filter(e=>e.status===`checked`),c=(e,...t)=>e.issues.some(e=>t.includes(e.id)),l=a.map(e=>e.lighthouseSeo).filter(e=>Number.isFinite(e));return{rows:a,summary:{pages:a.filter(e=>e.status!==`private`).length,checked:s.length,private:a.filter(e=>e.status===`private`).length,notChecked:a.filter(e=>[`not-run`,`no-seo`,`failed`].includes(e.status)).length,indexable:s.filter(e=>e.indexable).length,notIndexable:s.filter(e=>e.indexable===!1).length,missingTitles:s.filter(e=>c(e,`missing-title`)).length,missingDescriptions:s.filter(e=>c(e,`seo-description`)).length,duplicateTitles:o.title.reduce((e,t)=>e+t.pageIds.length,0),duplicateDescriptions:o.description.reduce((e,t)=>e+t.pageIds.length,0),socialImageProblems:s.filter(e=>c(e,`seo-ogimage`,`social-image-failed`,`social-image-invalid`)).length,canonicalIssues:s.filter(e=>c(e,`seo-canonical`,`canonical-invalid`,`canonical-elsewhere`)).length,robotsIssues:s.filter(e=>c(e,`search-noindex`,`robots-crawl-blocked`,`robots-unavailable`)).length,errors:s.reduce((e,t)=>e+t.errors,0),warnings:s.reduce((e,t)=>e+t.warnings,0),tips:s.reduce((e,t)=>e+t.tips,0),lighthouseSeo:l.length?{min:Math.min(...l),average:Math.round(l.reduce((e,t)=>e+t,0)/l.length),count:l.length}:null},duplicates:o}}function ge(e){try{let t=new URL(e),n=t.pathname.split(`/`).filter(Boolean).map(e=>{try{return decodeURIComponent(e)}catch{return e}});return{site:t.hostname.replace(/^www\./,``),origin:`${t.protocol}//${t.host}`,path:n}}catch{return{site:``,origin:``,path:[]}}}var _e=e=>JSON.stringify(e,(e,t)=>t&&typeof t==`object`&&!Array.isArray(t)?Object.fromEntries(Object.keys(t).sort().map(e=>[e,t[e]])):t),ve=(e,t)=>_e(e)===_e(t),K=e=>[`complete`,`partial`].includes(e.state),ye=e=>typeof e==`number`&&Number.isFinite(e);function be(e,t,{allowBuildChange:n=!1}={}){let r=[],i=e.profile,a=t.profile;for(let[n,i,a]of[[`page or environment`,[e.boardId,e.pageId,e.environment],[t.boardId,t.pageId,t.environment]],[`viewport`,e.viewport,t.viewport],[`observation window`,e.completeness.window,t.completeness.window],[`network coverage`,e.completeness.network,t.completeness.network],[`service worker state`,e.completeness.serviceWorker,t.completeness.serviceWorker]])ve(i,a)||r.push(`Different ${n}.`);let o=i.sourceBuild!==a.sourceBuild,s=o&&n&&!!(i.sourceBuild&&a.sourceBuild),c=[...new Set([...Object.keys(i),...Object.keys(a)])];for(let e of c)e===`sourceBuild`&&s||ve(i[e],a[e])||r.push(`Different ${e.replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase()}.`);for(let e of[`browser`,`device`,`throttling`])i[e]&&a[e]||r.push(`Missing ${e} conditions in an older report.`);i.authRole!==`configured`&&a.authRole!==`configured`||i.authStateHash&&a.authStateHash||r.push(`Missing authentication state evidence.`),K(e)&&K(t)||r.push(`A run has no usable measurements.`);let l=r.length===0,u=[...new Set([...Object.keys(e.metrics),...Object.keys(t.metrics)])].map(n=>{let r=K(e)&&ye(e.metrics[n])?e.metrics[n]:null,i=K(t)&&ye(t.metrics[n])?t.metrics[n]:null,a=l&&r!==null&&i!==null?i-r:null,o=n.endsWith(`Ms`)?50:n.endsWith(`Bytes`)?1024:n===`cumulativeLayoutShift`?.01:1,s=a!==null&&(Math.abs(a)<o||Math.abs(a)<Math.abs(r)*.05);return{key:n,before:r,after:i,delta:a,percent:a===null||r===0?null:a/r*100,change:a===null?`unknown`:a===0?`unchanged`:s?`small`:a>0?`increased`:`decreased`}}),d=!ve(e.budgets,t.budgets),f=l&&e.state===`complete`&&t.state===`complete`&&!d,p=new Set(e.findings.map(e=>e.id)),m=new Set(t.findings.map(e=>e.id));return{comparable:l,reasons:r,buildChanged:o,declaredBuildChange:s,budgetsChanged:d,metrics:u,findingsComparable:f,added:f?t.findings.filter(e=>!p.has(e.id)):[],removed:f?e.findings.filter(e=>!m.has(e.id)):[],retained:f?t.findings.filter(e=>p.has(e.id)):[],changed:f?t.findings.filter(t=>{let n=e.findings.find(e=>e.id===t.id);return n&&(n.severity!==t.severity||n.title!==t.title)}):[]}}var q=e=>e.runs?.length?e.runs:e.report?[{report:e.report,state:e.state}]:[],xe=e=>q(e).reduce((e,t)=>e+t.report.findings.filter(e=>G(e)===`warning`).length,0),J=(e,t)=>e.state===t||q(e).some(e=>e.state===t||e.report.state===t);function Se(e,t=`problems`){let n=e=>{let t=q(e).find(e=>e.report.profile.runner===`lighthouse`),n=t?.report.metrics.largestContentfulPaintMs;return t&&K(t.report)&&ye(n)?n:-1},r=e=>J(e,`failed`)||J(e,`unsupported`)?4:xe(e)?3:J(e,`stale`)?2:+!!J(e,`partial`);return[...e].sort((e,i)=>(t===`lcp`?n(i)-n(e):r(i)-r(e)||xe(i)-xe(e))||e.pageId.localeCompare(i.pageId)||e.viewport.localeCompare(i.viewport))}var Y=[{id:`reliability`,label:`Reliability`,match:[`reliability`,`semantics`]},{id:`performance`,label:`Performance`,match:[`performance`]},{id:`accessibility`,label:`Accessibility`,match:[`accessibility`]},{id:`seo`,label:`SEO`,match:[`seo`]}],Ce=e=>Y.find(t=>t.match.includes(e.category))?.id||`reliability`,we={playwright:`Load and page basics`,lighthouse:`Lighthouse lab navigation`,"playwright-flow":`Explicit flow`,axe:`Accessibility snapshot`},Te={"not-run":`Not checked`,stale:`Stale`,failed:`Failed`,unsupported:`Unsupported`,partial:`Partial`,complete:`Complete`},X=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ee(e,t=!0){let n=new Map;for(let r of e)for(let e of q(r))if(e.state!==`stale`&&e.report)for(let i of e.report.findings){let a=`${r.pageId}|${e.report.profile.runner}|${i.id}`,o=n.get(a),s=G(i);o?(o.viewports.includes(r.viewport)||o.viewports.push(r.viewport),s===`warning`&&(o.severity=`warning`)):n.set(a,{key:a,pageId:r.pageId,viewports:[r.viewport],view:r,report:e.report,finding:i,severity:s,category:Ce(i),canvasCapture:t&&r.canvasCapture!==!1})}return[...n.values()].sort((e,t)=>(e.severity===`warning`?0:1)-(t.severity===`warning`?0:1)||Y.findIndex(t=>t.id===e.category)-Y.findIndex(e=>e.id===t.category)||e.pageId.localeCompare(t.pageId))}var De=e=>{let t=e.filter(e=>typeof e==`number`&&Number.isFinite(e)).sort((e,t)=>e-t);if(!t.length)return null;let n=Math.floor(t.length/2);return Math.round(t.length%2?t[n]:(t[n-1]+t[n])/2)};function Oe(e,t){return e.map(e=>q(e).find(e=>e.report?.profile.runner===`lighthouse`&&e.state!==`stale`)).filter(e=>e&&[`complete`,`partial`].includes(e.report.state)).map(e=>e.report.metrics[t])}function ke(e,t){return Y.map(n=>{let r=t.filter(e=>e.category===n.id);return{...n,warnings:r.filter(e=>e.severity===`warning`).length,advisories:r.filter(e=>e.severity===`advisory`).length,score:n.id===`performance`?De(Oe(e,`lighthouseLabScore`)):n.id===`seo`?De(Oe(e,`lighthouseSeoLabScore`)):null}})}function Ae(e){return e==null?`Unknown`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)} s`:`${Math.round(e)} ms`}function je(e){return e==null?`Unknown`:e<1024?`${Math.round(e)} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Z(e,t){return t==null?`Unknown`:/Ms$/.test(e)?Ae(t):/Bytes$/.test(e)?je(t):e===`cumulativeLayoutShift`?t.toFixed(3).replace(/0+$/,``).replace(/\.$/,``):String(Math.round(t*100)/100)}var Me=e=>[`socialImageWidth`,`socialImageHeight`].includes(e)?`Declared social image ${e.endsWith(`Width`)?`width`:`height`}`:e===`robotsAllowed`?`Robots access (1 allowed, 0 blocked)`:e===`lighthouseLabScore`?`Lighthouse lab score (0-100)`:e===`lighthouseSeoLabScore`?`Lighthouse SEO lab score (0-100)`:X(e.replace(/Ms$/,``).replace(/Bytes$/,``).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase().trim()),Q=r(),Ne={reliability:A,performance:I,accessibility:L,seo:z};function Pe({score:e,size:t=36,label:n}){let r=(t-5)/2,i=2*Math.PI*r;return(0,Q.jsxs)(`span`,{className:d(`relative inline-grid shrink-0 place-items-center`,e===null?`text-faint`:e>=90?`text-ok`:e>=50?`text-warn`:`text-bad`),style:{width:t,height:t},children:[(0,Q.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:`-rotate-90`,"aria-hidden":`true`,children:[(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`3.5`}),e===null?null:(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeDasharray:`${i*e/100} ${i}`})]}),(0,Q.jsx)(`span`,{className:`absolute text-[11px] font-semibold text-fg tabular`,"aria-label":n,children:e===null?`--`:e})]})}function Fe({totals:e,active:t,onPick:n}){return(0,Q.jsx)(`div`,{className:`grid auto-rows-fr grid-cols-2 gap-2`,"data-sw-checks-summary":`true`,children:e.map(e=>{let r=Ne[e.id],i=e.warnings,a=t===e.id;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":a,onClick:()=>n(e.id),"data-sw-checks-tile":e.id,className:d(`flex min-h-16 items-center gap-2.5 rounded-lg border bg-surface px-2.5 py-2 text-left shadow-card transition-colors outline-none hover:bg-surface-2 focus-visible:outline-2 focus-visible:outline-accent`,a?`border-accent bg-accent/5`:`border-line`),children:[(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[11px] font-medium text-muted`,children:[(0,Q.jsx)(r,{size:13,"aria-hidden":`true`}),e.label]}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-[15px] leading-5 font-semibold`,children:i?(0,Q.jsxs)(`span`,{className:e.id===`reliability`?`text-bad`:`text-warn`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:i}),` to fix`]}):e.unchecked?(0,Q.jsx)(`span`,{className:`text-muted`,children:`Not checked`}):(0,Q.jsx)(`span`,{className:`text-ok`,children:`No issues`})}),e.advisories?(0,Q.jsxs)(`span`,{className:`block text-[11px] text-muted`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:e.advisories}),` `,e.advisories===1?`note`:`notes`]}):null]}),e.id===`performance`||e.id===`seo`?(0,Q.jsx)(Pe,{score:e.score,label:e.score===null?`No Lighthouse score`:`Lighthouse ${e.label} ${e.score}`}):null]},e.id)})})}function Ie(e,t=Date.now()){let n=Math.max(0,(t-Date.parse(e))/1e3);return Number.isFinite(n)?n<60?`just now`:n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:new Date(e).toLocaleDateString():``}var Le={error:{icon:M,tone:`text-bad`,label:`Blocks search or sharing`},warning:{icon:w,tone:`text-warn`,label:`Should fix`},tip:{icon:D,tone:`text-accent`,label:`Tip`}},$=e=>e.status===`checked`?e.indexable===!1?`blocked`:e.errors||e.warnings?`work`:`ready`:e.status;function Re({command:e,local:n}){let[r,i]=(0,B.useState)(!1);return(0,Q.jsxs)(`section`,{className:`space-y-2 rounded-xl border border-dashed border-line p-3`,"data-sw-seo-not-checked":`true`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,Q.jsx)(z,{size:16,className:`text-accent`,"aria-hidden":`true`}),`SEO hasn’t been checked yet`]}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:n?`Use Run checks above with Include SEO, set "checks": { "seo": true } in the config, or run:`:`Run this where the site is configured, then push the board with --include-checks:`}),(0,Q.jsxs)(`div`,{className:`flex items-stretch gap-1.5`,children:[(0,Q.jsx)(`code`,{className:`min-w-0 flex-1 rounded bg-surface-2 p-2 text-xs break-all`,children:e}),(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-auto`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>i(!0),()=>i(!1))},children:r?`Copied`:`Copy`})]})]})}function ze({data:e,seo:t,pages:n,pageId:r,local:i,canComment:a,onView:o,onIssue:s,canFix:c,command:l}){let[u,d]=(0,B.useState)(`all`),f=(0,B.useMemo)(()=>he({views:e?.views||[],pages:n.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:t?.snapshots||{},privatePages:t?.privatePages||[]}),[e,t,n]),{summary:p}=f,m=f.rows.filter(e=>!r||e.pageId===r),h={all:m.length,work:m.filter(e=>[`work`,`blocked`].includes($(e))).length,ready:m.filter(e=>$(e)===`ready`).length,private:m.filter(e=>e.status===`private`).length},g={blocked:0,work:1,failed:2,"no-seo":3,"not-run":4,ready:5,private:6},_=m.filter(e=>{let t=$(e);return u===`all`||(u===`work`?[`work`,`blocked`].includes(t):u===`ready`?t===`ready`:t===u)}).sort((e,t)=>g[$(e)]-g[$(t)]||t.errors-e.errors||t.warnings-e.warnings);return(0,Q.jsxs)(`div`,{className:`sw-gutter-pad space-y-4 p-3 text-sm`,"data-sw-seo-view":`true`,children:[!p.checked&&l?(0,Q.jsx)(Re,{command:l,local:i}):null,!r&&p.checked?(0,Q.jsx)(Be,{summary:p}):null,(0,Q.jsx)(b,{label:`SEO pages`,value:u,onChange:d,variant:`underline`,options:[{id:`all`,label:`All`,count:h.all},{id:`work`,label:`Needs work`,count:h.work},{id:`ready`,label:`No issues`,count:h.ready},...h.private?[{id:`private`,label:`Private`,count:h.private}]:[]]}),_.length?null:(0,Q.jsx)(`p`,{className:`py-6 text-center text-xs text-muted`,children:`No pages match this filter.`}),_.map(e=>(0,Q.jsx)(He,{row:e,page:n.find(t=>t.id===e.pageId),local:i,canComment:a,canFix:c,onView:o,onIssue:s},e.pageId))]})}function Be({summary:e}){let{checked:t,indexable:n}=e,r=e.pages?Math.round(n/Math.max(1,e.pages)*100):0,i=e.duplicateTitles+e.duplicateDescriptions,a=[[`Missing titles`,e.missingTitles,e.missingTitles?`bad`:`ok`],[`Missing descriptions`,e.missingDescriptions,e.missingDescriptions?`warn`:`ok`],[`Duplicate titles or descriptions`,i,i?`warn`:`ok`],[`Social image problems`,e.socialImageProblems,e.socialImageProblems?`warn`:`ok`],[`Canonical issues`,e.canonicalIssues,e.canonicalIssues?`warn`:`ok`],[`Robots and indexing`,e.robotsIssues,e.robotsIssues?`bad`:`ok`]];return(0,Q.jsxs)(`section`,{className:`space-y-3 rounded-xl border border-line bg-surface p-3 shadow-card`,"data-sw-seo-summary":`true`,children:[(0,Q.jsxs)(`div`,{className:`flex items-end gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted`,children:`Indexable`}),(0,Q.jsxs)(`p`,{className:`mt-0.5 text-2xl leading-none font-semibold tracking-tight`,children:[(0,Q.jsx)(`span`,{className:`tabular`,"data-sw-seo-indexable":n,children:n}),(0,Q.jsxs)(`span`,{className:`text-base font-medium text-muted`,children:[` of `,e.pages,` pages`]})]})]}),(0,Q.jsxs)(`div`,{className:`text-right`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted`,children:`Lighthouse SEO`}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-2xl leading-none font-semibold tracking-tight tabular`,"data-sw-seo-lighthouse":`true`,children:e.lighthouseSeo?e.lighthouseSeo.average:`--`})]})]}),(0,Q.jsxs)(`div`,{className:`flex h-2 overflow-hidden rounded-full bg-surface-2`,role:`img`,"aria-label":`${n} of ${e.pages} public pages are indexable`,children:[(0,Q.jsx)(`span`,{className:`bg-ok`,style:{width:`${r}%`}}),(0,Q.jsx)(`span`,{className:`bg-bad`,style:{width:`${e.pages?e.notIndexable/e.pages*100:0}%`}})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[t,` of `,e.pages,` public pages checked`,e.notIndexable?` · ${e.notIndexable} kept out of search`:``,e.private?` · ${e.private} private, not meant for search`:``,e.lighthouseSeo?` · Lighthouse lowest ${e.lighthouseSeo.min}`:` · No Lighthouse SEO score yet (shapewall audit --seo)`]}),(0,Q.jsx)(`dl`,{className:`grid grid-cols-2 gap-2`,children:a.map(([e,n,r])=>(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-2 px-2.5 py-2`,"data-sw-seo-tile":e,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-[11px] leading-4 text-muted`,children:[(0,Q.jsx)(`span`,{className:d(`size-1.5 shrink-0 rounded-full`,r===`ok`?`bg-ok`:r===`bad`?`bg-bad`:`bg-warn`),"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`min-w-0`,children:e})]}),(0,Q.jsx)(`dd`,{className:`mt-0.5 text-lg leading-6 font-semibold tabular`,children:t?n:`--`})]},e))})]})}function Ve({row:e}){let t=$(e);return t===`private`?(0,Q.jsx)(x,{tone:`neutral`,children:`Private`}):t===`ready`?(0,Q.jsx)(x,{tone:`ok`,children:`No issues`}):t===`blocked`?(0,Q.jsx)(x,{tone:`bad`,children:`Not indexable`}):t===`work`?(0,Q.jsxs)(x,{tone:e.errors?`bad`:`warn`,children:[e.errors+e.warnings,` to fix`]}):t===`failed`?(0,Q.jsx)(x,{tone:`bad`,children:`Check failed`}):(0,Q.jsx)(x,{tone:`neutral`,children:`Not checked`})}function He({row:e,page:n,local:r,canComment:i,canFix:a,onView:o,onIssue:s}){let c=e.report?.viewport.name||n?.viewports?.[0]||`desktop`,u=n?.path||`/`;return(0,Q.jsxs)(`article`,{className:`overflow-hidden rounded-xl border border-line bg-surface shadow-card`,"data-sw-seo-page":e.pageId,"data-sw-seo-status":$(e),children:[(0,Q.jsxs)(`header`,{className:`flex items-start gap-2 px-3 pt-3 pb-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.title}),(0,Q.jsx)(`p`,{className:`truncate font-mono text-[11px] text-muted`,children:u})]}),e.lighthouseSeo===null?null:(0,Q.jsxs)(x,{tone:e.lighthouseSeo>=90?`ok`:e.lighthouseSeo>=50?`warn`:`bad`,className:`tabular`,children:[`SEO `,e.lighthouseSeo]}),(0,Q.jsx)(Ve,{row:e})]}),e.status===`private`?(0,Q.jsxs)(`div`,{className:`mx-3 mb-3 flex gap-2 rounded-lg bg-surface-2 p-2.5 text-xs text-muted`,children:[(0,Q.jsx)(P,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`Private, not meant for search. Search checks are skipped because this page is configured as not indexable.`})]}):e.status===`checked`?(0,Q.jsxs)(Q.Fragment,{children:[e.stale?(0,Q.jsx)(`p`,{className:`mx-3 mb-2 text-xs text-warn`,children:`The page or its settings changed since this check. Run checks again.`}):null,(0,Q.jsxs)(m,{defaultValue:`search`,className:`px-3`,children:[(0,Q.jsxs)(g,{variant:`underline`,"aria-label":`${e.title} preview`,children:[(0,Q.jsx)(y,{value:`search`,children:`Google result`}),(0,Q.jsx)(y,{value:`social`,children:`Share card`})]}),(0,Q.jsx)(l,{value:`search`,className:`pt-2`,children:e.snapshot?(0,Q.jsx)(Ge,{row:e,page:n}):(0,Q.jsx)(Ue,{local:r})}),(0,Q.jsx)(l,{value:`social`,className:`pt-2`,children:e.snapshot?(0,Q.jsx)(Ke,{row:e,page:n}):(0,Q.jsx)(Ue,{local:r})})]}),(0,Q.jsx)(`div`,{className:`space-y-2 p-3`,children:e.issues.length?(0,Q.jsx)(`ul`,{className:`space-y-2`,"aria-label":`${e.title} SEO issues`,children:e.issues.map(t=>(0,Q.jsx)(qe,{issue:t,onComment:i?()=>s(e,t,{fix:!1}):null,onFix:i&&a?()=>s(e,t,{fix:!0}):null},t.id))}):(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-ok/10 p-2.5 text-xs`,"data-sw-seo-clean":`true`,children:[(0,Q.jsx)(j,{size:15,className:`shrink-0 text-ok`,"aria-hidden":`true`}),`Nothing to fix in the checks that ran.`]})})]}):(0,Q.jsxs)(`div`,{className:`mx-3 mb-3 flex gap-2 rounded-lg bg-surface-2 p-2.5 text-xs text-muted`,children:[(0,Q.jsx)(z,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:e.status===`failed`?`The last SEO check of this page could not finish. Run checks again.`:e.status===`no-seo`?`Checked without SEO. Run checks with Include SEO to see its search result and share card.`:`Not checked yet. Run checks with Include SEO to see how this page shows in search.`})]}),(0,Q.jsxs)(`footer`,{className:`flex items-center gap-2 border-t border-line bg-surface-2/50 px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-[11px] text-muted`,children:e.report?`Checked ${Ie(e.report.auditedAt)} · ${c}`:`No SEO check yet`}),(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>o(e.pageId,c),children:`View page`})]})]})}function Ue({local:e}){return(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,children:[(0,Q.jsx)(z,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:e?`No preview for this check. Run checks with Include SEO to see the search result and share card.`:`Previews stay on the installation that ran the checks. The issues below came with the board.`})]})}function We(e,t){return!e.issues.some(e=>e.id===`canonical-elsewhere`)&&e.snapshot.canonical||t?.url||e.snapshot.url||``}function Ge({row:e,page:t}){let{snapshot:n}=e,r=ge(We(e,t)),i=n.social.siteName||r.site,a=n.title?de(n.title,{size:U.titleFont,pixels:U.titlePixels}):null,o=n.description?de(n.description,{size:U.descriptionFont,pixels:U.descriptionPixels}):null;return(0,Q.jsxs)(`figure`,{className:`rounded-lg border border-line bg-surface p-3`,"data-sw-seo-serp":e.pageId,children:[(0,Q.jsx)(`figcaption`,{className:`sr-only`,children:`Approximate Google desktop result`}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,Q.jsx)(`span`,{className:`grid bg-[#e8eaed] text-[#202124] [:root[data-mode=dark]_&]:bg-[#3c4043] [:root[data-mode=dark]_&]:text-[#dadce0] size-7 shrink-0 place-items-center rounded-full text-xs font-semibold uppercase`,"aria-hidden":`true`,children:(i||`?`).slice(0,1)}),(0,Q.jsxs)(`div`,{className:`min-w-0 leading-tight`,children:[(0,Q.jsx)(`p`,{className:`truncate text-[#202124] [:root[data-mode=dark]_&]:text-[#dadce0] text-[13px]`,children:i||`Unknown site`}),(0,Q.jsxs)(`p`,{className:`truncate text-[#4d5156] [:root[data-mode=dark]_&]:text-[#bdc1c6] text-[11.5px]`,children:[r.origin,r.path.length?` › ${r.path.join(` › `)}`:``]})]})]}),(0,Q.jsx)(`p`,{className:d(`mt-2 font-[Arial,Helvetica,sans-serif] text-[#1a0dab] [:root[data-mode=dark]_&]:text-[#99c3ff] line-clamp-2 text-[18px] leading-6`,!a&&`italic opacity-70`),"data-sw-seo-serp-title":`true`,children:a?a.text:`No title: Google writes one from the page`}),(0,Q.jsx)(`p`,{className:d(`mt-1 font-[Arial,Helvetica,sans-serif] text-[#474747] [:root[data-mode=dark]_&]:text-[#bfbfbf] text-ui`,!o&&`italic`),"data-sw-seo-serp-description":`true`,children:o?o.text:`No description: Google picks text from the page, often a menu or banner.`}),a?.cut||o?.cut?(0,Q.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted`,children:[`Cut where Google’s desktop result is likely to cut it (`,a?.cut?`title`:``,a?.cut&&o?.cut?` and `:``,o?.cut?`description`:``,`).`]}):null]})}function Ke({row:e,page:t}){let{snapshot:n}=e,r=ge(We(e,t)),i=n.social.title||n.title,a=n.social.description||n.description,o=[!n.social.title&&n.title?`page title`:null,!n.social.description&&n.description?`meta description`:null].filter(Boolean);return(0,Q.jsxs)(`figure`,{"data-sw-seo-social":e.pageId,children:[(0,Q.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-line bg-surface`,children:[n.image?(0,Q.jsx)(`img`,{src:n.image.dataUrl,alt:`Share image for ${e.title}`,className:`aspect-[1200/630] w-full bg-surface-2 object-cover`,"data-sw-seo-social-image":`true`}):(0,Q.jsx)(`div`,{className:`grid aspect-[1200/630] w-full place-items-center bg-surface-2 text-muted`,children:(0,Q.jsxs)(`span`,{className:`flex flex-col items-center gap-1.5 text-xs`,children:[(0,Q.jsx)(T,{size:20,"aria-hidden":`true`}),n.social.image?`Image not previewed here`:`No share image`]})}),(0,Q.jsxs)(`div`,{className:`space-y-0.5 border-t border-line px-3 py-2.5`,children:[(0,Q.jsx)(`p`,{className:`truncate text-[11px] tracking-wide text-muted uppercase`,children:r.site||`unknown site`}),(0,Q.jsx)(`p`,{className:d(`line-clamp-2 text-sm leading-5 font-semibold`,!i&&`text-muted italic`),children:i||`No title`}),a?(0,Q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-4 text-muted`,children:a}):null]})]}),(0,Q.jsxs)(`figcaption`,{className:`mt-1.5 text-[11px] text-muted`,children:[`Large link preview as most apps show it`,n.social.card?` · twitter:card ${n.social.card}`:``,o.length?` · using the ${o.join(` and `)}`:``,n.social.image&&!n.image?` · the image is on another site or could not be decoded`:``,`.`]})]})}function qe({issue:e,onComment:n,onFix:r}){let a=Le[e.level],o=a.icon;return(0,Q.jsxs)(`li`,{className:`rounded-lg border border-line p-2.5`,"data-sw-seo-issue":e.id,"data-sw-seo-level":e.level,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(o,{size:16,className:d(`mt-0.5 shrink-0`,a.tone),"aria-label":a.label,role:`img`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm leading-5 font-medium`,children:e.label}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:e.explain}),e.id.startsWith(`duplicate-`)&&e.observation?(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:e.observation}):null,(0,Q.jsxs)(`p`,{className:`text-xs leading-4`,children:[(0,Q.jsx)(`span`,{className:`font-semibold`,children:`How to fix: `}),e.fix]})]})]}),n||r?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[n?(0,Q.jsxs)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:n,"data-sw-seo-comment":e.id,children:[(0,Q.jsx)(E,{size:14,"aria-hidden":`true`}),` Comment`]}):null,r?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:r,"data-sw-seo-fix-agent":e.id,children:[(0,Q.jsx)(i,{size:14,"aria-hidden":`true`}),` Fix with agent`]}):null]}):null]})}function Je({control:e,pages:n,pageId:r,tab:i}){let[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(r?`page`:`all`),[l,f]=(0,B.useState)(!0);if(!e||e.loading)return null;let{run:p}=e,m=e=>n.find(t=>t.id===e)?.title||e;if(p?.state===`running`){let n=p.total?Math.round(p.done/p.total*100):0;return(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-accent/40 bg-accent/5 p-3`,"data-sw-checks-run-progress":`true`,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`text-accent`,children:(0,Q.jsx)(u,{size:14})}),(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate font-medium`,children:p.stopping?`Stopping…`:p.current?`Checking ${m(p.current.pageId)} · ${p.current.viewport}`:`Starting the browser…`}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted tabular`,children:[p.done,` of `,p.total]}),e.canRun&&e.stop?(0,Q.jsxs)(t,{size:`xs`,variant:`ghost`,className:`h-11 px-2 lg:h-7`,disabled:e.stopping||p.stopping,onClick:e.stop,"data-sw-checks-run-stop":`true`,children:[e.stopping||p.stopping?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(C,{size:12,"aria-hidden":`true`}),` Stop`]}):null]}),(0,Q.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-surface-2`,role:`progressbar`,"aria-label":`Checks progress`,"aria-valuemin":0,"aria-valuemax":p.total,"aria-valuenow":p.done,children:(0,Q.jsx)(`span`,{className:`block h-full rounded-full bg-accent transition-[width] duration-(--motion-slow)`,style:{width:`${Math.max(4,n)}%`}})}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[p.seo?`Page checks with SEO`:`Page checks`,` · one page at a time, reusing configured sign-in and page actions.`]})]})}if(!e.canRun)return(0,Q.jsxs)(`p`,{className:`flex gap-2 text-xs text-muted`,"data-sw-checks-run-locked":`true`,children:[(0,Q.jsx)(te,{size:14,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{children:e.reason||`Run checks in the installation terminal.`})]});let g=s===`page`&&r?n.filter(e=>e.id===r):n,_=g.reduce((e,t)=>e+(t.viewports?.length||1),0),v=g.filter(t=>e.privatePages.includes(t.id)).length,y=p&&p.state!==`running`?p:null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-checks-run":`true`,children:[y&&!a?(0,Q.jsx)(Ye,{run:y}):null,e.error?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:e.error}):null,a?(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line bg-surface-2/60 p-3`,"data-sw-checks-run-options":`true`,children:[r?(0,Q.jsx)(b,{label:`Pages to check`,value:s,onChange:c,variant:`underline`,options:[{id:`page`,label:m(r)},{id:`all`,label:`All ${n.length} pages`}]}):null,(0,Q.jsxs)(h,{pressed:l,onPressedChange:f,size:`touch`,className:`h-auto min-h-11 w-full justify-start gap-2.5 py-2 text-left whitespace-normal lg:min-h-9`,"data-sw-checks-run-seo":l?`on`:`off`,children:[(0,Q.jsx)(`span`,{className:d(`grid size-4 shrink-0 place-items-center rounded border`,l?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`),"aria-hidden":`true`,children:l?(0,Q.jsx)(j,{size:12,strokeWidth:3}):null}),(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:`Include SEO`}),(0,Q.jsxs)(`span`,{className:`block text-xs font-normal text-muted`,children:[`Titles, descriptions, robots, canonical and share images on public pages.`,v?` ${v} private page${v===1?` is`:`s are`} skipped.`:``]})]})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[_,` page view`,_===1?``:`s`,`, checked one at a time against the original site. Configured sign-in and page actions run again, so use test accounts for pages that change data.`]}),_>e.limit?(0,Q.jsxs)(`p`,{className:`text-xs text-bad`,children:[`A run from the board checks at most `,e.limit,` page views. Pick one page or use the terminal.`]}):null,(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-8`,onClick:()=>o(!1),children:`Cancel`}),(0,Q.jsxs)(t,{size:`xs`,variant:`default`,className:`h-11 px-3 lg:h-8`,disabled:e.starting||_>e.limit,onClick:async()=>{await e.start({pages:s===`page`&&r?[r]:null,seo:l})&&o(!1)},"data-sw-checks-run-start":`true`,children:[e.starting?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(k,{size:14,"aria-hidden":`true`}),` Start checks`]})]})]}):(0,Q.jsxs)(t,{size:`xs`,variant:i===`seo`?`default`:`secondary`,className:`h-11 w-full lg:h-8`,onClick:()=>{c(r?`page`:`all`),f(e.seoDefault!==!1),o(!0)},"data-sw-checks-run-open":`true`,children:[(0,Q.jsx)(k,{size:14,"aria-hidden":`true`}),` `,y?`Run checks again`:`Run checks`]})]})}function Ye({run:e}){let t=e.state===`complete`?`ok`:e.state===`partial`||e.state===`stopped`?`warn`:`bad`,n=t===`ok`?j:t===`warn`?w:M;return(0,Q.jsxs)(`p`,{className:d(`flex items-start gap-2 rounded-lg px-2.5 py-2 text-xs`,t===`ok`?`bg-ok/10`:t===`warn`?`bg-warn/15`:`bg-bad/10`),"data-sw-checks-run-result":e.state,role:`status`,children:[(0,Q.jsx)(n,{size:15,className:d(`mt-px shrink-0`,t===`ok`?`text-ok`:t===`warn`?`text-warn`:`text-bad`),"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[e.message,e.finishedAt?(0,Q.jsxs)(`span`,{className:`text-muted`,children:[` · `,Ie(e.finishedAt)]}):null]})]})}function Xe({label:e,children:t,defaultOpen:n=!1,className:r,...i}){let[a,s]=(0,B.useState)(n),c=(0,B.useId)();return(0,Q.jsxs)(`div`,{className:d(`text-xs`,r),...i,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-controls":c,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-1.5 rounded-md text-left font-medium text-muted outline-none hover:text-fg focus-visible:outline-2 focus-visible:outline-accent lg:min-h-7`,children:[(0,Q.jsx)(o,{size:14,className:d(`shrink-0 transition-transform`,a?`rotate-0`:`-rotate-90`),"aria-hidden":`true`}),e]}),a?(0,Q.jsx)(`div`,{id:c,className:`pt-1 pb-1`,children:t}):null]})}var Ze=e=>`${new Date(e.auditedAt).toLocaleString()} · ${e.state} · ${e.profile.sourceBuild?`build ${e.profile.sourceBuild.slice(0,8)}`:`build undeclared`} · ${e.id.slice(-4)}`;function Qe({views:e,pages:t}){let n=e.flatMap(e=>q(e).filter(e=>(e.history?.length||0)>1).map(t=>({key:`${e.pageId}|${e.viewport}|${t.report.profile.runner}`,view:e,run:t}))),[r,i]=(0,B.useState)(null),a=n.find(e=>e.key===r)||n[0];if(!a)return(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,"data-sw-checks-history":`true`,children:[(0,Q.jsx)(ne,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`No page has two retained reports from the same runner yet. Run checks again to compare before and after.`})]});let o=e=>t.find(t=>t.id===e)?.title||e;return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-history":`true`,children:[(0,Q.jsxs)(S,{value:a.key,onValueChange:i,children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`History page and runner`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:n.map(e=>(0,Q.jsxs)(_,{value:e.key,children:[o(e.view.pageId),` · `,X(e.view.viewport),` · `,we[e.run.report.profile.runner]||e.run.report.profile.runner]},e.key))})]}),(0,Q.jsx)($e,{run:a.run},a.key)]})}function $e({run:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(`none`),[a,o]=(0,B.useState)(!1),s=e.history,l=s.find(e=>e.id===t)||e.report,u=s.find(e=>e.id===r&&e.id!==l.id);return(0,Q.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-line bg-surface p-3 shadow-card text-xs`,"data-sw-check-report":l.id,children:[(0,Q.jsxs)(`p`,{className:`text-muted`,children:[s.length,` retained reports for this runner and device. Screenshots may have expired.`]}),(0,Q.jsxs)(`label`,{className:`block space-y-1`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`After`}),(0,Q.jsxs)(S,{value:l.id,onValueChange:e=>{n(e),i(`none`)},children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`After report`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:s.map(e=>(0,Q.jsx)(_,{value:e.id,children:Ze(e)},e.id))})]})]}),(0,Q.jsxs)(`label`,{className:`block space-y-1`,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:`Before`}),(0,Q.jsxs)(S,{value:r,onValueChange:i,children:[(0,Q.jsx)(p,{className:`h-11 w-full lg:h-8`,"aria-label":`Before report`,children:(0,Q.jsx)(c,{placeholder:`Choose a baseline`})}),(0,Q.jsxs)(f,{children:[(0,Q.jsx)(_,{value:`none`,children:`Choose a baseline`}),s.filter(e=>e.id!==l.id).map(e=>(0,Q.jsx)(_,{value:e.id,children:Ze(e)},e.id))]})]})]}),l.id===e.report.id?null:(0,Q.jsx)(`p`,{className:`font-medium`,children:`Historical report; current page state is not verified.`}),l.findings.length?(0,Q.jsx)(`ul`,{className:`space-y-1`,children:l.findings.map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(`span`,{className:G(e)===`warning`?`text-warn`:`text-muted`,"aria-hidden":`true`,children:`•`}),(0,Q.jsx)(`span`,{children:e.title})]},e.id))}):(0,Q.jsx)(`p`,{className:`text-muted`,children:`No findings in this report.`}),u?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{pressed:a,onPressedChange:o,size:`touch`,className:`h-auto min-h-11 w-full justify-start py-2 text-left whitespace-normal`,children:`Allow declared build as the changed variable`}),(0,Q.jsx)(et,{before:u,after:l,allowBuildChange:a})]}):null]})}function et({before:e,after:t,allowBuildChange:n}){let r=be(e,t,{allowBuildChange:n});return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-check-comparison":`true`,"aria-live":`polite`,children:[(0,Q.jsx)(`p`,{className:`font-semibold`,children:`Before → After`}),r.comparable?(0,Q.jsxs)(`p`,{className:`text-muted`,children:[r.declaredBuildChange?`Declared build changed; all other recorded conditions match.`:`Recorded measurement conditions match.`,` `,`Repeat the same profile before calling a change a regression.`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{children:`These reports cannot be compared under the selected conditions.`}),(0,Q.jsx)(`ul`,{className:`list-disc pl-4 text-muted`,children:r.reasons.map(e=>(0,Q.jsx)(`li`,{children:e},e))})]}),(0,Q.jsx)(`div`,{className:`space-y-1.5`,children:r.metrics.map(e=>(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-2 rounded-md bg-surface-2 px-2 py-1.5`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:Me(e.key)}),(0,Q.jsxs)(`span`,{className:`tabular`,children:[Z(e.key,e.before),` → `,Z(e.key,e.after)]}),(0,Q.jsx)(`span`,{className:`text-muted tabular`,children:e.delta===null?`unknown`:`${e.delta>0?`+`:``}${Math.round(e.delta*100)/100}${e.change===`small`?` (small)`:``}`})]},e.key))}),r.findingsComparable?(0,Q.jsxs)(`p`,{children:[`Findings: `,r.added.length,` newly observed · `,r.removed.length,` no longer observed · `,r.retained.length,` `,`still observed.`]}):(0,Q.jsxs)(`p`,{className:`text-muted`,children:[`Finding changes are unknown:`,` `,r.budgetsChanged?`recorded budget policy changed.`:`both reports must be complete and comparable.`]})]})}function tt({issues:e,pages:n,category:r,onCategory:i,onView:a,onDraft:o,canComment:s,onSeo:c}){let l=e.filter(e=>r===`all`||e.category===r),u=l.filter(e=>e.severity===`warning`),d=l.filter(e=>e.severity!==`warning`),f=e=>n.find(t=>t.id===e)?.title||e;return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-issues":`true`,children:[r===`all`?null:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsxs)(`p`,{className:`min-w-0 flex-1 text-muted`,children:[`Showing `,(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:Y.find(e=>e.id===r)?.label}),` only`]}),(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>i(`all`),"data-sw-checks-show-all":`true`,children:`Show all`})]}),l.length?null:(0,Q.jsxs)(`p`,{className:`flex items-center gap-2 rounded-lg bg-ok/10 p-3 text-xs`,children:[(0,Q.jsx)(j,{size:15,className:`shrink-0 text-ok`,"aria-hidden":`true`}),`No findings in the checks that ran`,r===`all`?``:` for ${Y.find(e=>e.id===r)?.label}`,`. Pages that were not checked are listed under Pages.`]}),u.length?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Needs attention`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold`,children:[(0,Q.jsx)(w,{size:14,className:`text-warn`,"aria-hidden":`true`}),`Needs attention `,(0,Q.jsx)(`span`,{className:`font-normal text-muted tabular`,children:u.length})]}),u.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))]}):null,d.length?u.length?(0,Q.jsx)(Xe,{label:`Notes (${d.length})`,"data-sw-checks-notes":`true`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:d.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))})}):(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-label":`Notes`,children:[(0,Q.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold`,children:[(0,Q.jsx)(O,{size:14,className:`text-muted`,"aria-hidden":`true`}),`Notes `,(0,Q.jsx)(`span`,{className:`font-normal text-muted tabular`,children:d.length})]}),d.map(e=>(0,Q.jsx)(nt,{issue:e,title:f(e.pageId),onView:a,onDraft:o,canComment:s,onSeo:c},e.key))]}):null]})}function nt({issue:e,title:n,onView:r,onDraft:i,canComment:a,onSeo:o}){let{finding:s}=e,c=e.severity===`warning`,l=c?e.category===`reliability`?M:w:O;return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-line bg-surface p-2.5 shadow-card`,"data-sw-check-finding":s.id,"data-sw-check-issue":e.key,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(l,{size:16,className:d(`mt-0.5 shrink-0`,c?e.category===`reliability`?`text-bad`:`text-warn`:`text-muted`),"aria-label":c?`Needs attention`:`Note`,role:`img`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[11px] text-muted`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,Q.jsx)(`span`,{children:e.viewports.map(X).join(`, `)}),(0,Q.jsx)(x,{tone:`neutral`,shape:`tag`,children:e.category})]}),(0,Q.jsx)(`h4`,{className:`text-sm leading-5 font-medium`,children:s.title}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:s.observation}),(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:s.nextAction})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[e.category===`seo`&&o?(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>o(e.pageId),children:`See in SEO`}):null,(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,disabled:!e.canvasCapture,onClick:()=>r(e.pageId,e.viewports[0]),children:`View page`}),a&&e.canvasCapture?(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:()=>i(e.view,e.report,s),children:`Create comment`}):null]})]})}var rt=e=>e===`complete`?`ok`:e===`failed`||e===`unsupported`?`bad`:e===`not-run`?`neutral`:`warn`;function it(e){let t=e.metrics;return e.profile.runner===`lighthouse`&&t.lighthouseLabScore!==void 0?`Score ${t.lighthouseLabScore??`--`} · LCP ${Z(`largestContentfulPaintMs`,t.largestContentfulPaintMs??null)}`:e.profile.runner===`axe`?`${t.violationRules??`--`} rules failing · ${t.scannedElements??`--`} elements`:e.profile.runner===`playwright-flow`?`${t.completedSteps??`--`} of ${t.configuredSteps??`--`} steps · ${Z(`flowDurationMs`,t.flowDurationMs??null)}`:`Load ${Z(`loadMs`,t.loadMs??null)} · ${t.requestCount??`--`} requests`}function at({views:e,pages:n,onView:r}){return(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-pages":`true`,children:[e.length?null:(0,Q.jsx)(`p`,{className:`py-6 text-center text-xs text-muted`,children:`No pages match this filter.`}),e.map(e=>{let i=n.find(t=>t.id===e.pageId)?.title||e.pageId,a=q(e);return(0,Q.jsxs)(`article`,{className:`space-y-2 rounded-lg border border-line bg-surface p-3 shadow-card`,"data-sw-checks-view":`${e.pageId}|${e.viewport}`,children:[(0,Q.jsxs)(`header`,{className:`flex items-start gap-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:i}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:X(e.viewport)})]}),(0,Q.jsx)(x,{tone:rt(e.state),children:Te[e.state]||e.state})]}),e.canvasCapture===!1?(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Diagnostics only: this environment is not the canvas capture, so pins are off.`}):null,e.state===`stale`?(0,Q.jsx)(`p`,{className:`text-xs text-warn`,children:`The page or its settings changed since this run. Run checks again before relying on it.`}):null,a.length?null:(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Not checked yet for this screen size. This does not mean it passed.`}),a.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-line rounded-md border border-line`,children:a.map(e=>{let t=e.report,n=t.profile.runner,r=e.state||t.state;return(0,Q.jsxs)(`li`,{className:`space-y-1 px-2.5 py-2`,"data-sw-check-report":t.id,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-xs font-medium`,children:we[n]||n}),(0,Q.jsx)(x,{tone:rt(r),children:Te[r]||r})]}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted tabular`,children:[it(t),e.actionable?` · ${e.actionable} to fix`:``]}),(0,Q.jsx)(Xe,{label:`Technical details`,children:(0,Q.jsx)(ot,{report:t})})]},n)})}):null,(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(t,{disabled:e.canvasCapture===!1,size:`xs`,className:`h-11 lg:h-7`,variant:`secondary`,onClick:()=>r(e.pageId,e.viewport),children:`View page`})})]},`${e.pageId}-${e.viewport}`)})]})}function ot({report:e}){let t=e.profile,n=[...Object.entries(e.metrics).map(([e,t])=>[Me(e),Z(e,t)]),[`Viewport`,`${e.viewport.width} × ${e.viewport.height}`],[`Environment`,t.sourceEnvironment||e.environment],[`Checked`,new Date(e.auditedAt).toLocaleString()],[`Runner`,`${t.runner} ${t.version}`],[`Cache`,t.cache],[`Sign-in`,t.authRole===`configured`?`Configured`:`Anonymous`],[`Build`,t.sourceBuild?`${t.production} · ${t.sourceBuild.slice(0,8)}`:`${t.production} · undeclared`],[`Network`,e.completeness.network],[`Service worker`,e.completeness.serviceWorker===null?`Unknown`:e.completeness.serviceWorker?`Controlled`:`Not controlled`],...t.browser?[[`Browser`,t.browser.version]]:[],...t.throttling?[[`Throttling`,`${t.throttling.method} · ${t.throttling.rttMs??`?`} ms · ${t.throttling.throughputKbps??`?`} Kbps · CPU ${t.throttling.cpuSlowdownMultiplier??`?`}×`]]:[],[`SEO checks`,t.seo?`On`:`Off`],[`Report`,e.id],[`Capture`,e.captureVersion||`Unassociated`]];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`dl`,{className:`grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1`,children:n.map(([e,t])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`break-words text-muted`,children:e}),(0,Q.jsx)(`dd`,{className:`max-w-48 truncate text-right tabular`,children:t})]},e))}),e.completeness.limitations.length?(0,Q.jsx)(`ul`,{className:`list-disc space-y-0.5 pl-4 text-muted`,children:e.completeness.limitations.map((e,t)=>(0,Q.jsx)(`li`,{children:e},t))}):null]})}var st=Object.freeze({ttfbMs:`Time to first byte (ms)`,loadMs:`Load (ms)`,domContentLoadedMs:`DOM content loaded (ms)`,documentTransferBytes:`Document transfer (bytes)`,resourceTransferBytes:`Resource transfer (bytes)`,resourceDecodedBytes:`Decoded resources (bytes)`,requestCount:`Requests`,largestContentfulPaintMs:`Largest contentful paint (ms)`,firstContentfulPaintMs:`First contentful paint (ms)`,totalBlockingTimeMs:`Total blocking time (ms)`,cumulativeLayoutShift:`Cumulative layout shift`,transferredResourceBytes:`Transferred resources (bytes)`,observedRequests:`Observed requests`,speedIndexMs:`Speed index (ms)`});function ct(e){return Object.entries(e.budgets?.thresholds||{}).map(([t,n])=>{let r=e.metrics[t],i=[`complete`,`partial`].includes(e.state)&&typeof r==`number`&&Number.isFinite(r)?r:null;return{metric:t,limit:n,value:i,state:i===null?`unknown`:i>n?`over`:`within`}})}var lt=[[`largestContentfulPaintMs`,`LCP`,2500,4e3],[`totalBlockingTimeMs`,`TBT`,200,600],[`cumulativeLayoutShift`,`CLS`,.1,.25]],ut=(e,t,n)=>e==null?`text-faint`:e<=t?`text-ok`:e<=n?`text-warn`:`text-bad`;function dt({views:e,pages:t}){let[n,r]=(0,B.useState)(`lcp`),i=e.map(e=>({view:e,run:q(e).find(e=>e.report?.profile.runner===`lighthouse`),load:q(e).find(e=>e.report?.profile.runner===`playwright`)})).filter(e=>e.run||e.load),a=e=>e.run?.report.metrics.largestContentfulPaintMs??-1,o=e=>e.run?.report.metrics.lighthouseLabScore??101;return i.sort((e,t)=>n===`lcp`?a(t)-a(e):o(e)-o(t)),(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-performance":`true`,children:[(0,Q.jsx)(b,{label:`Performance order`,value:n,onChange:r,variant:`underline`,options:[{id:`lcp`,label:`Slowest LCP first`},{id:`score`,label:`Lowest score first`}]}),i.length?null:(0,Q.jsxs)(`div`,{className:`flex gap-2 rounded-lg border border-dashed border-line p-3 text-xs text-muted`,children:[(0,Q.jsx)(I,{size:15,className:`mt-px shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{children:`No performance runs yet. Lighthouse lab audits run with shapewall audit; page checks record load times.`})]}),i.map(({view:e,run:n,load:r})=>{let i=n?.report,a=i?.metrics||{},o=t.find(t=>t.id===e.pageId)?.title||e.pageId,s=i?ct(i):[];return(0,Q.jsxs)(`article`,{className:`space-y-2.5 rounded-lg border border-line bg-surface p-3 shadow-card`,"data-sw-checks-perf":`${e.pageId}|${e.viewport}`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center gap-2.5`,children:[(0,Q.jsx)(Pe,{score:i?a.lighthouseLabScore??null:null,size:40,label:i?`Lighthouse score ${a.lighthouseLabScore??`unknown`}`:`No Lighthouse run`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:o}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[X(e.viewport),n?.state===`stale`?` · stale`:``,r?` · load ${Z(`loadMs`,r.report.metrics.loadMs??null)}`:``]})]})]}),i?(0,Q.jsx)(`dl`,{className:`grid grid-cols-3 gap-2`,children:lt.map(([e,t,n,r])=>(0,Q.jsxs)(`div`,{className:`rounded-md bg-surface-2 px-2 py-1.5`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted`,children:t}),(0,Q.jsx)(`dd`,{className:d(`text-sm font-semibold tabular`,ut(a[e],n,r)),children:Z(e,a[e]??null)})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`No Lighthouse audit for this view yet.`}),s.length?(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Recorded performance budgets`,children:s.map(e=>{let t=e.value===null?0:Math.min(1,e.value/Math.max(e.limit,1e-9));return(0,Q.jsxs)(`li`,{className:`text-xs`,"data-sw-checks-budget":e.state,children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 text-muted`,children:st[e.metric]}),(0,Q.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap tabular`,children:[Z(e.metric,e.value),` / `,Z(e.metric,e.limit)]}),(0,Q.jsx)(`span`,{className:d(`shrink-0 font-medium whitespace-nowrap`,e.state===`over`?`text-bad`:e.state===`within`?`text-ok`:`text-muted`),children:e.state===`over`?`Over budget`:e.state===`within`?`Within budget`:`Not measured`})]}),(0,Q.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-surface-2`,children:(0,Q.jsx)(`span`,{className:d(`block h-full rounded-full`,e.state===`over`?`bg-bad`:`bg-ok`),style:{width:`${e.state===`over`?100:t*100}%`}})})]},e.metric)})}):null]},`${e.pageId}|${e.viewport}`)}),(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`Lab measurements on this machine, not real-user data. Scores are never blended across pages.`})]})}var ft=[[`issues`,`Issues`],[`pages`,`Pages`],[`seo`,`SEO`],[`performance`,`Performance`],[`history`,`History`]];function pt(){let e=(0,B.useRef)(null),[t,n]=(0,B.useState)({start:!1,end:!1}),r=(0,B.useCallback)(()=>{let t=e.current;if(!t)return;let r=t.scrollLeft>1,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;n(e=>e.start===r&&e.end===i?e:{start:r,end:i})},[]);(0,B.useLayoutEffect)(()=>{if(r(),typeof ResizeObserver>`u`||!e.current)return;let t=new ResizeObserver(r);return t.observe(e.current),()=>t.disconnect()},[r]);let i=t.start||t.end?`linear-gradient(to right, ${t.start?`transparent, #000 2rem`:`#000, #000`}, ${t.end?`#000 calc(100% - 2rem), transparent`:`#000`})`:void 0;return{ref:e,edges:t,measure:r,style:i?{maskImage:i,WebkitMaskImage:i}:void 0}}function mt({data:e,error:r,loading:i,pages:o,pageId:s,viewport:u,onSelect:d,onClose:h,onRefresh:v,onEnvironment:x,onView:C,onDraft:w,canComment:te,command:T,local:ne,tab:E=`issues`,onTab:D=()=>{},seo:O=null,run:k=null}){let[A,j]=(0,B.useState)(`all`),[M,N]=(0,B.useState)(`all`),P=(0,B.useMemo)(()=>Se((e?.views||[]).filter(e=>(!s||e.pageId===s)&&(!u||e.viewport===u)&&(A===`all`||e.viewport===A))),[e,s,u,A]),F=(0,B.useMemo)(()=>Ee(P),[P]),I=(0,B.useMemo)(()=>he({views:P,pages:o.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:O?.snapshots||{},privatePages:O?.privatePages||[]}).summary,[P,o,O]),oe=(0,B.useMemo)(()=>ke(P,F).map(e=>e.id===`seo`?{...e,warnings:I.errors+I.warnings,advisories:I.tips,unchecked:!I.checked}:e),[P,F,I]),L=[...new Set((e?.views||[]).map(e=>e.viewport))],R=pt();(0,B.useEffect)(()=>{let e=R.ref.current,t=e?.querySelector(`[data-sw-checks-tab="${E}"]`);if(!e||!t||e.scrollWidth<=e.clientWidth)return;let n=t.offsetLeft-e.offsetLeft,r=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,n+t.offsetWidth/2-e.clientWidth/2));Math.abs(r-e.scrollLeft)>1&&e.scrollTo({left:r,behavior:ie()})},[E,R.ref]);let z=o.find(e=>e.id===s),se=e=>{if(e===`seo`)return D(`seo`);N(t=>t===e&&E===`issues`?`all`:e),D(`issues`)},V=(e,t,{fix:n})=>w({pageId:e.pageId,viewport:e.report.viewport.name},e.report,{title:n?`@agent please fix on this page: ${t.label}`:t.label,observation:`${t.explain}${t.id.startsWith(`duplicate-`)&&t.observation?` ${t.observation}`:``}`,nextAction:`How to fix: ${t.fix}`}),H=e?.demo?`Fictional demo reports; no live audit was run.`:e?.imported?`Imported with the board; sign-in and page state can’t be verified here.`:null;return(0,Q.jsxs)(`section`,{className:`flex flex-col lg:min-h-0 lg:flex-1`,"data-sw-checks-panel":`true`,children:[(0,Q.jsx)(`header`,{className:`hidden border-b border-line lg:block`,children:(0,Q.jsx)(ee,{icon:re,title:`Checks`,onClose:h,closeLabel:`Close checks`,children:(0,Q.jsx)(a,{className:`ml-auto`,label:`Refresh checks`,onClick:v,children:(0,Q.jsx)(ae,{size:15,"aria-hidden":`true`})})})}),(0,Q.jsxs)(`div`,{className:`lg:relative lg:min-h-0 lg:flex-1 lg:overflow-y-auto lg:overscroll-contain`,"data-sw-checks-results":`true`,children:[(0,Q.jsxs)(`div`,{className:`sw-gutter-pad space-y-3 p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[z?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 max-w-full lg:h-7`,onClick:()=>d(null,null),children:[(0,Q.jsxs)(`span`,{className:`truncate`,children:[`This page: `,z.title]}),(0,Q.jsx)(n,{size:13,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Show all pages`})]}):null,e?.environments?.length>1&&x?(0,Q.jsxs)(S,{value:e.environment,onValueChange:x,children:[(0,Q.jsx)(p,{className:`h-11 min-w-0 flex-1 lg:h-7`,"aria-label":`Checks environment`,children:(0,Q.jsx)(c,{})}),(0,Q.jsx)(f,{children:e.environments.map(e=>(0,Q.jsxs)(_,{value:e.id,children:[e.id,e.captured?` · canvas capture`:` · diagnostics`]},e.id))})]}):null,L.length>1?(0,Q.jsx)(b,{label:`Checks screen size`,value:A,onChange:j,variant:`underline`,className:`w-full basis-full`,options:[{id:`all`,label:`All`},...L.map(e=>({id:e,label:X(e)}))]}):null,(0,Q.jsx)(t,{"data-autofocus":!0,size:`icon`,variant:`ghost`,className:`lg:hidden`,"aria-label":`Refresh checks`,onClick:v,children:(0,Q.jsx)(ae,{size:15})})]}),i?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted`,children:`Loading checks…`}):null,r?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:`Checks are unavailable for this view. Refresh or check access to this board.`}):null,e?(0,Q.jsx)(Fe,{totals:oe,active:E===`seo`?`seo`:M,onPick:se}):null,(0,Q.jsx)(Je,{control:k,pages:o,pageId:s,tab:E}),e?(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,"data-sw-checks-coverage":`true`,children:[e.checked,` of `,e.total,` page/device views checked`,H?` · ${H}`:``]}):null]}),(0,Q.jsxs)(m,{value:E,onValueChange:D,children:[(0,Q.jsx)(`div`,{className:`sw-gutter-pad sticky top-0 z-10 border-t border-line bg-surface px-3`,children:(0,Q.jsx)(g,{variant:`underline`,ref:R.ref,onScroll:R.measure,style:R.style,"aria-label":`Checks view`,"data-sw-checks-tabs-more":R.edges.start&&R.edges.end?`both`:R.edges.end?`end`:R.edges.start?`start`:`none`,children:ft.map(([e,t])=>(0,Q.jsxs)(y,{value:e,"data-sw-checks-tab":e,children:[t,e===`issues`&&F.some(e=>e.severity===`warning`)?(0,Q.jsx)(`span`,{className:`ml-1 text-faint tabular`,children:F.filter(e=>e.severity===`warning`).length}):null]},e))})}),(0,Q.jsx)(l,{value:`issues`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(tt,{issues:F,pages:o,category:M,onCategory:N,onView:C,onDraft:w,canComment:te,onSeo:e=>{D(`seo`),e&&e!==s&&d(e,null)}})}),(0,Q.jsx)(l,{value:`pages`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(at,{views:P,pages:o,onView:C})}),(0,Q.jsx)(l,{value:`seo`,children:(0,Q.jsx)(ze,{data:e,seo:O,pages:o,pageId:s,local:ne,canComment:te,canFix:!0,onIssue:V,onView:C,command:T})}),(0,Q.jsx)(l,{value:`performance`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(dt,{views:P,pages:o})}),(0,Q.jsx)(l,{value:`history`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(Qe,{views:P,pages:o})})]})]}),(0,Q.jsxs)(`footer`,{className:`space-y-1 border-t border-line px-3 py-2 text-xs text-muted`,children:[ne?(0,Q.jsxs)(Xe,{label:k?.canRun?`Run from the terminal instead`:`Run checks from the terminal`,children:[(0,Q.jsx)(`p`,{className:`mb-1.5`,children:`Runs reuse configured sign-in and replay page actions, one page at a time.`}),T?(0,Q.jsx)(`code`,{className:`block rounded bg-surface-2 p-2 break-all text-fg`,children:T}):null]}):(0,Q.jsx)(`p`,{children:`Checks run on your computer or in CI and are sent with the board.`}),(0,Q.jsx)(`p`,{children:`Findings never send work to an agent automatically.`})]})]})}export{mt as default};
@@ -1 +1 @@
1
- import{$t as e,B as t,Jt as n,O as r,R as i,Xt as a,ct as o,lt as s,n as c,nt as l,pt as u,t as d,tt as f}from"./ui-Cg4TTrec.js";import{V as p,bt as m,et as h,ot as g,q as _,rt as v,t as y,w as b}from"./index-DKOCIQiq.js";var x=e(a(),1);function S(e,t,n,r,i,a={}){let{threshold:o=.1,alpha:s=.1,aaColor:c=[255,255,0],diffColor:l=[255,0,0],checkerboard:u=!0,windowSize:d=1/0,includeAA:f,diffColorAlt:p,diffMask:m,ignoreMask:h}=a;if(!C(e)||!C(t)||n&&!C(n)||h&&!C(h))throw Error(`Image data: Uint8Array, Uint8ClampedArray or Buffer expected.`);if(e.length!==t.length||n&&n.length!==e.length)throw Error(`Image sizes do not match. Image 1 size: ${e.length}, image 2 size: ${t.length}`);let g=r*i;if(e.length!==g*4)throw Error(`Image data size does not match width/height. Expecting ${g*4}. Got ${e.length}`);if(h&&h.length!==g)throw Error(`Ignore mask size does not match image width/height. Expecting ${g}. Got ${h.length}`);let _=new Uint32Array(e.buffer,e.byteOffset,g),v=new Uint32Array(t.buffer,t.byteOffset,g),y=!0;for(let e=0;e<g;e++)if(_[e]!==v[e]&&(!h||!h[e])){y=!1;break}if(y){if(n&&!m)for(let t=0,r=0;t<g;t++,r+=4)oe(n,r,e,s);return 0}let[b,x,S]=c,[T,E,D]=l,[O,k,A]=p||l,j=0,M=Number.isFinite(d)?new Uint8Array(g):null,N=-1,P=0;for(let a=0,c=0;a<g;a++,c+=4){let l=_[a]===v[a]||h&&h[a]?0:ne(e,t,c,u,o);if(l){let o=a%r,s=a/r|0;!f&&(w(e,o,s,r,i,_,v)||w(t,o,s,r,i,v,_))?(n&&!m&&J(n,c,b,x,S),M&&(M[a]=2)):(n&&(l<0?J(n,c,O,k,A):J(n,c,T,E,D)),M&&(M[a]=1,N<0&&(N=s),P=s),j++)}else n&&!m&&oe(n,c,e,s)}if(!M||!j)return j;let F=Math.min(Math.max(Math.floor(d),1),r,i),I=new Uint16Array(r),L=0,R=0,z=Math.min(i-1,P+F-1);for(let e=N;e<=z;e++){let t=e*r,n=e-F;if(n>=0){let e=n*r;for(let n=0;n<r;n++){let r=(M[t+n]&1)-(M[e+n]&1);I[n]+=r,R+=r}}else{for(let e=0;e<r;e++){let n=M[t+e]&1;I[e]+=n,R+=n}if(e<F-1)continue}if(R<=L)continue;let i=0;for(let e=0;e<F-1;e++)i+=I[e];for(let e=F-1;e<r;e++)i+=I[e],i>L&&(L=i),i-=I[e-F+1]}return L}function C(e){return ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1}function w(e,t,n,r,i,a,o){let s=t>0?t-1:0,c=n>0?n-1:0,l=t<r-1?t+1:r-1,u=n<i-1?n+1:i-1,d=(n*r+t)*4,f=e[d],p=e[d+1],m=e[d+2],h=e[d+3],g=+(t===s||t===l||n===c||n===u),_=0,v=0,y=0,b=0,x=0,S=0,C=r*4;for(let i=s;i<=l;i++){let a=(c*r+i)*4;for(let r=c;r<=u;r++,a+=C){if(i===t&&r===n)continue;let o=ae(e,a,f,p,m,h);if(o===0){if(g++,g>2)return!1}else o<_?(_=o,y=i,b=r):o>v&&(v=o,x=i,S=r)}}return _===0||v===0?!1:T(a,y,b,r,i)&&T(o,y,b,r,i)||T(a,x,S,r,i)&&T(o,x,S,r,i)}function T(e,t,n,r,i){let a=n*r+t,o=e[a];if(t>0&&t<r-1&&n>0&&n<i-1)return+(o===e[a-r-1])+ +(o===e[a-1])+ +(o===e[a+r-1])+ +(o===e[a-r])+ +(o===e[a+r])+ +(o===e[a-r+1])+ +(o===e[a+1])+ +(o===e[a+r+1])>2;let s=t>0?t-1:0,c=n>0?n-1:0,l=t<r-1?t+1:r-1,u=n<i-1?n+1:i-1,d=+(t===s||t===l||n===c||n===u);for(let i=s;i<=l;i++){let a=c*r+i;for(let s=c;s<=u;s++,a+=r)if((i!==t||s!==n)&&(d+=+(o===e[a]),d>2))return!0}return!1}var E=new Float64Array(257);for(let e=0;e<256;e++){let t=e/255;E[e]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}E[256]=E[255];var D=new Float64Array(256),O=new Float64Array(256),k=new Float64Array(256),A=new Float64Array(256),j=new Float64Array(256),M=new Float64Array(256),N=new Float64Array(256),P=new Float64Array(256),F=new Float64Array(256);for(let e=0;e<256;e++){let t=E[e];D[e]=.4122214708*t,A[e]=.2119034982*t,N[e]=.0883024619*t,O[e]=.5363325363*t,j[e]=.6806995451*t,P[e]=.2817188376*t,k[e]=.0514459929*t,M[e]=.1073969566*t,F[e]=.6299787005*t}function I(e){let t=e|0;return E[t]+(E[t+1]-E[t])*(e-t)}var L=4096,R=new Float64Array(4098);for(let e=0;e<=4097;e++)R[e]=Math.cbrt(e/L);var z=8;function B(e){let t=e*L,n=t|0;return n<z?Math.cbrt(e):R[n]+(R[n+1]-R[n])*(t-n)}var V=20,H=4096,U=new Uint32Array(H),W=new Float64Array(H*4),ee=.206,te=.03,G=1.206/1.03;function ne(e,t,n,r,i){let a=e[n],o=e[n+1],s=e[n+2],c=e[n+3],l=t[n],u=t[n+1],d=t[n+2],f=t[n+3];return c===255&&f===255?re(a,o,s,l,u,d,i):ie(a,o,s,c,l,u,d,f,n,r,i)}function re(e,t,n,r,i,a,o){let s=e<<16|t<<8|n,c=Math.imul(s,2654435761)>>>V,l=s+1,u=c*4,d,f,p,m;U[c]===l?(d=W[u],f=W[u+1],p=W[u+2],m=W[u+3]):(d=B(D[e]+O[t]+k[n]),f=B(A[e]+j[t]+M[n]),p=B(N[e]+P[t]+F[n]),m=q(d,f,p),U[c]=l,W[u]=d,W[u+1]=f,W[u+2]=p,W[u+3]=m);let h=r<<16|i<<8|a,g=Math.imul(h,2654435761)>>>V,_=h+1,v=g*4,y,b,x,S;return U[g]===_?(y=W[v],b=W[v+1],x=W[v+2],S=W[v+3]):(y=B(D[r]+O[i]+k[a]),b=B(A[r]+j[i]+M[a]),x=B(N[r]+P[i]+F[a]),S=q(y,b,x),U[g]=_,W[v]=y,W[v+1]=b,W[v+2]=x,W[v+3]=S),K(m-S,d-y,f-b,p-x,o)}function ie(e,t,n,r,i,a,o,s,c,l,u){let d=255,f=255,p=255;if(l){let e=Math.imul(c>>2,2654435761);d=48+159*(e>>>31),f=48+159*(e>>>30&1),p=48+159*(e>>>29&1)}e=(e*r+d*(255-r))/255,t=(t*r+f*(255-r))/255,n=(n*r+p*(255-r))/255,i=(i*s+d*(255-s))/255,a=(a*s+f*(255-s))/255,o=(o*s+p*(255-s))/255;let m=I(e),h=I(t),g=I(n),_=I(i),v=I(a),y=I(o),b=B(.4122214708*m+.5363325363*h+.0514459929*g),x=B(.2119034982*m+.6806995451*h+.1073969566*g),S=B(.0883024619*m+.2817188376*h+.6299787005*g),C=B(.4122214708*_+.5363325363*v+.0514459929*y),w=B(.2119034982*_+.6806995451*v+.1073969566*y),T=B(.0883024619*_+.2817188376*v+.6299787005*y);return K(q(b,x,S)-q(C,w,T),b-C,x-w,S-T,u)}function K(e,t,n,r,i){let a=i-Math.abs(e);if(a>=0){let e=1.9779984951*t-2.428592205*n+.4505937099*r,i=.0259040371*t+.7827717662*n-.808675766*r;if(e*e+i*i<=a*a)return 0}return e>0?-1:1}function q(e,t,n){let r=.2104542553*e+.793617785*t-.0040720468*n,i=G*r-ee;return .5*(i+Math.sqrt(i*i+4*te*G*r))}function ae(e,t,n,r,i,a){let o=e[t],s=e[t+1],c=e[t+2],l=e[t+3],u=n-o,d=r-s,f=i-c,p=a-l;if(!u&&!d&&!f&&!p)return 0;if(a<255||l<255){u=(n*a-o*l-255*p)/255,d=(r*a-s*l-255*p)/255,f=(i*a-c*l-255*p)/255;let e=u*.29889531+d*.58662247+f*.11448223;return e===0&&p?p/2:e}return u*.29889531+d*.58662247+f*.11448223}function J(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=i,e[t+3]=255}function oe(e,t,n,r){let i=255+(n[t]*.29889531+n[t+1]*.58662247+n[t+2]*.11448223-255)*r*n[t+3]/255;J(e,t,i,i,i)}var se=.1,Y=[239,68,68];function ce(e,t,{threshold:n=se}={}){let r=Math.max(e.width,t.width),i=Math.max(e.height,t.height),a={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)},o=e=>{if(e.width===a.width&&e.height===a.height)return e.data;let t=new Uint8Array(a.width*a.height*4);for(let n=0;n<a.height;n+=1)t.set(e.data.subarray(n*e.width*4,(n*e.width+a.width)*4),n*a.width*4);return t},s=new Uint8Array(r*i*4),c=new Uint8Array(a.width*a.height*4),l=S(o(e),o(t),c,a.width,a.height,{threshold:n,diffMask:!0,diffColor:Y,alpha:0});for(let e=0;e<a.height;e+=1)s.set(c.subarray(e*a.width*4,(e+1)*a.width*4),e*r*4);for(let e=0;e<i;e+=1)for(let t=e<a.height?a.width:0;t<r;t+=1){let n=(e*r+t)*4;s[n]=Y[0],s[n+1]=Y[1],s[n+2]=Y[2],s[n+3]=255,l+=1}let u=r*i;return{width:r,height:i,changed:l,total:u,percent:u?Math.round(l/u*1e4)/100:0,data:s}}var le=6,X=new Map;async function ue(e){let t=new Image;t.decoding=`async`,t.src=e,await t.decode();let n=document.createElement(`canvas`);n.width=t.naturalWidth,n.height=t.naturalHeight;let r=n.getContext(`2d`,{willReadFrequently:!0});return r.drawImage(t,0,0),r.getImageData(0,0,n.width,n.height)}async function de({width:e,height:t,data:n}){let r=document.createElement(`canvas`);r.width=e,r.height=t,r.getContext(`2d`).putImageData(new ImageData(new Uint8ClampedArray(n.buffer),e,t),0,0);let i=await new Promise(e=>r.toBlob(e,`image/png`));if(!i)throw Error(`Could not draw the diff.`);return URL.createObjectURL(i)}function fe(e,t){let n=`${e}\n${t}`;if(!X.has(n)){let r=Promise.all([ue(e),ue(t)]).then(async([e,t])=>{let n=ce(e,t);return{percent:n.percent,changed:n.changed,url:n.changed?await de(n):null}});for(r.catch(()=>X.delete(n)),X.set(n,r);X.size>le;){let[e,t]=X.entries().next().value;X.delete(e),t.then(e=>e.url&&URL.revokeObjectURL(e.url)).catch(()=>{})}}return X.get(n)}function pe(e,t,n=!0){let r=n&&e&&t?`${e}\n${t}`:null,[i,a]=(0,x.useState)({key:null,status:`idle`});return(0,x.useEffect)(()=>{if(!r)return;let n=!0;return fe(e,t).then(e=>n&&a({key:r,status:`ok`,...e}),()=>n&&a({key:r,status:`error`})),()=>{n=!1}},[t,e,r]),r?i.key===r?i:{status:`loading`}:{status:`idle`}}var Z=n();function Q(e){return e?new Date(u(e)).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`Unknown time`}function me(e){return e.status===`loading`?`Finding changes…`:e.status===`error`?`Could not compare these captures.`:e.status===`ok`?e.changed?`${e.percent}% changed`:`No pixel changes`:``}var $=new Map;function he(e){if(!$.has(e)){let t=(async()=>{let t=new Image;t.src=e,await t.decode();let n=Math.min(160,t.naturalWidth),r=Math.max(1,Math.round(t.naturalHeight*n/t.naturalWidth)),i=document.createElement(`canvas`);i.width=n,i.height=r;let a=i.getContext(`2d`,{willReadFrequently:!0});a.drawImage(t,0,0,n,r);let{data:o}=a.getImageData(0,0,n,r);for(let e=0;e<r;e+=1)for(let t=0;t<n;t+=1)if(o[(e*n+t)*4+3]>0)return e/r;return null})().catch(()=>null);$.set(e,t)}return $.get(e)}function ge(e){let t=e.status===`ok`&&e.changed?e.url:null,[n,r]=(0,x.useState)({url:null,at:null});return(0,x.useEffect)(()=>{if(!t)return;let e=!0;return he(t).then(n=>e&&r({url:t,at:n})),()=>{e=!1}},[t]),t&&n.url===t?n.at:null}function _e(e,t){e&&t!==null&&e.scrollTo({top:Math.max(0,t*e.scrollHeight-48),behavior:y()})}var ve={phone:`max-w-[400px]`,tablet:`max-w-[600px]`};function ye({label:e,entry:t,urlFor:n,page:r,viewport:i,diff:a=null,onImageError:c,paneRef:l,onScroll:u}){return(0,Z.jsxs)(`figure`,{className:o(`mx-auto w-full min-w-0 flex-1`,ve[i]),"data-sw-history-side":t.version,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 flex items-baseline gap-1.5 text-[11px] font-medium tracking-wide text-faint uppercase`,children:[e,(0,Z.jsxs)(`span`,{className:`truncate font-normal tracking-normal normal-case`,children:[t.current?`current capture`:Q(t.at),` · `,s(t.at)]})]}),(0,Z.jsxs)(`div`,{ref:l,onScroll:u,className:`relative max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:[(0,Z.jsx)(`img`,{src:n(t,!1),alt:`${r} ${i}, ${t.current?`current capture`:`captured ${Q(t.at)}`}`,className:`block w-full select-none`,draggable:!1,onError:c}),a?.url?(0,Z.jsx)(`img`,{src:a.url,alt:``,draggable:!1,className:`pointer-events-none absolute inset-x-0 top-0 block w-full opacity-80 select-none`,"data-sw-history-diff-overlay":`true`}):null]})]})}var be=[{id:`split`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(m,{size:13,"aria-hidden":`true`}),` Side by side`]})},{id:`slider`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{size:13,"aria-hidden":`true`}),` Slider`]})}],xe=[{id:`before`,label:`Earlier`},{id:`after`,label:`Current`},{id:`slider`,label:`Slider`}];function Se({open:e,onClose:n,page:a,viewport:s,data:u,comments:m,urlFor:_,onPickComment:y,touch:S,onImageError:C}){let w=(0,x.useMemo)(()=>a?p({pageId:a.id,viewport:s,manifest:u?.manifest,captures:u?.captures,versions:u?.versions}):[],[u?.captures,u?.manifest,u?.versions,a,s]),[T,E]=(0,x.useState)(null),[D,O]=(0,x.useState)(S?`before`:`split`),k=`${a?.id}|${s}`,A=T?.key===k?T.version:null,j=w.find(e=>e.current)||w[0]||null,M=w.find(e=>e.version===A)||w.find(e=>e!==j)||null,[N,P]=(0,x.useState)(!0),F=pe(M?_(M,!1):null,j?_(j,!1):null,N&&M!==j),I=ge(F);(0,x.useEffect)(()=>{e&&F.status===`error`&&C?.()},[F.status,C,e]);let L=e=>(m||[]).filter(t=>t.captureVersion===e),R=(0,x.useRef)({before:null,after:null,slider:null}),z=(0,x.useRef)(!1),B=(e,t)=>()=>{if(z.current)return;let n=R.current[e],r=R.current[t];n&&r&&(z.current=!0,r.scrollTop=n.scrollTop,window.requestAnimationFrame(()=>{z.current=!1}))},V=()=>{for(let e of Object.values(R.current))_e(e,I)},H=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(I===null||H.current===`${k}|${M?.version}|${I}`)return;H.current=`${k}|${M?.version}|${I}`;let e=window.setTimeout(()=>{for(let e of Object.values(R.current))_e(e,I)},150);return()=>window.clearTimeout(e)},[M?.version,I,k]);let U=N&&F.status===`ok`?F:null,W=D===`slider`;return(0,Z.jsx)(i,{open:e,onClose:n,title:a?`History: ${a.title}`:`History`,description:a?`${s} · ${w.length} capture${w.length===1?``:`s`} kept`:``,size:`lg`,children:(0,Z.jsx)(`div`,{className:`space-y-3 p-4`,"data-sw-history":k,children:w.length<2?(0,Z.jsx)(r,{icon:h,title:`No earlier captures yet`,children:`Each recapture keeps the previous shot, so the changes to this page show up here.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`ol`,{className:`flex gap-2.5 overflow-x-auto pb-1`,"aria-label":`Captures, newest first`,"data-sw-history-strip":`true`,children:w.map((e,t)=>{let n=L(e.version).length,r=M?.version===e.version;return(0,Z.jsx)(`li`,{className:`shrink-0`,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:e.current,onClick:()=>E({key:k,version:e.version}),"aria-pressed":r,className:o(`group block w-36 rounded-lg border bg-surface p-1.5 text-left transition-colors disabled:cursor-default`,r?`border-accent ring-2 ring-accent/30`:e.current?`border-line`:`border-line hover:border-faint hover:bg-surface-2`),"data-sw-history-version":e.version,children:[(0,Z.jsxs)(`span`,{className:`relative block h-24 overflow-hidden rounded bg-surface-2`,children:[(0,Z.jsx)(`img`,{src:_(e,!0),alt:``,className:`block w-full`,draggable:!1,loading:`lazy`,onError:C}),e.current?(0,Z.jsx)(f,{tone:`solid`,className:`absolute top-1 left-1 shadow-card`,children:`Current`}):r?(0,Z.jsx)(f,{tone:`accent`,className:`absolute top-1 left-1 bg-surface shadow-card`,children:`Comparing`}):null]}),(0,Z.jsxs)(`span`,{className:`mt-1.5 flex items-center gap-1 px-0.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] font-medium text-fg`,children:e.current?`Current`:`Version ${w.length-t}`}),n?(0,Z.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-0.5 text-[11px] text-accent tabular`,children:[(0,Z.jsx)(v,{size:11,"aria-hidden":`true`}),` `,n]}):null]}),(0,Z.jsx)(`span`,{className:`block truncate px-0.5 text-[11px] text-faint`,children:Q(e.at)})]})},e.version)})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(d,{label:`Compare`,large:S,value:D,onChange:O,className:S?`w-full`:``,itemClassName:`inline-flex items-center justify-center gap-1.5`,options:S?xe:be}),(0,Z.jsx)(c,{size:S?`touch`:`sm`,pressed:N,onPressedChange:P,"data-sw-history-diff":N?`on`:`off`,children:`Highlight changes`}),N?(0,Z.jsx)(`span`,{className:`text-xs text-muted tabular`,role:`status`,"data-sw-history-diff-status":F.status,children:me(F)}):null,N&&I!==null?(0,Z.jsxs)(t,{size:S?`touch`:`sm`,variant:`ghost`,onClick:V,"data-sw-history-jump":`true`,children:[(0,Z.jsx)(g,{size:13,"aria-hidden":`true`}),` Jump to the change`]}):null]}),W&&M&&j?(0,Z.jsxs)(`figure`,{className:o(`mx-auto w-full min-w-0`,ve[s]),"data-sw-history-slider":`true`,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 text-[11px] text-faint`,children:[`Earlier `,Q(M.at),` on the left, current on the right. Drag the divider.`]}),(0,Z.jsx)(`div`,{ref:e=>{R.current.slider=e},className:`max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:(0,Z.jsx)(b,{label:`Earlier and current capture`,beforeLabel:`Earlier`,afterLabel:`Current`,before:(0,Z.jsx)(`img`,{src:_(M,!1),alt:`${a.title} ${s}, captured ${Q(M.at)}`,className:`block w-full select-none`,draggable:!1,onError:C}),after:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:_(j,!1),alt:`${a.title} ${s}, current capture`,className:`block w-full select-none`,draggable:!1,onError:C}),U?.url?(0,Z.jsx)(`img`,{src:U.url,alt:``,draggable:!1,className:`pointer-events-none absolute inset-x-0 top-0 block w-full opacity-80 select-none`,"data-sw-history-diff-overlay":`true`}):null]})})})]}):(0,Z.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[M&&(!S||D===`before`)?(0,Z.jsx)(ye,{label:`Earlier`,entry:M,urlFor:_,page:a.title,viewport:s,onImageError:C,paneRef:e=>{R.current.before=e},onScroll:B(`before`,`after`)}):null,j&&(!S||D===`after`)?(0,Z.jsx)(ye,{label:`Current`,entry:j,urlFor:_,page:a.title,viewport:s,diff:U,onImageError:C,paneRef:e=>{R.current.after=e},onScroll:B(`after`,`before`)}):null]}),M&&L(M.version).length?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`mb-1.5 text-xs font-medium text-muted`,children:`Comments made on the earlier capture`}),(0,Z.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:L(M.version).map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>y(e),className:o(`inline-flex max-w-72 items-center gap-1.5 rounded-full border border-line px-2 text-xs text-fg transition-colors hover:bg-surface-2`,S?`h-11`:`h-7`),"data-sw-history-comment":e.id,children:[(0,Z.jsx)(l,{className:e.status===`resolved`?`bg-ok text-ok-fg`:`bg-accent text-accent-fg`,children:e.id}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.body})]})},e.id))})]}):null]})})})}export{Se as default};
1
+ import{$t as e,B as t,Jt as n,O as r,R as i,Xt as a,ct as o,lt as s,n as c,nt as l,pt as u,t as d,tt as f}from"./ui-Cg4TTrec.js";import{V as p,bt as m,et as h,ot as g,q as _,rt as v,t as y,w as b}from"./index-C9S7HL_o.js";var x=e(a(),1);function S(e,t,n,r,i,a={}){let{threshold:o=.1,alpha:s=.1,aaColor:c=[255,255,0],diffColor:l=[255,0,0],checkerboard:u=!0,windowSize:d=1/0,includeAA:f,diffColorAlt:p,diffMask:m,ignoreMask:h}=a;if(!C(e)||!C(t)||n&&!C(n)||h&&!C(h))throw Error(`Image data: Uint8Array, Uint8ClampedArray or Buffer expected.`);if(e.length!==t.length||n&&n.length!==e.length)throw Error(`Image sizes do not match. Image 1 size: ${e.length}, image 2 size: ${t.length}`);let g=r*i;if(e.length!==g*4)throw Error(`Image data size does not match width/height. Expecting ${g*4}. Got ${e.length}`);if(h&&h.length!==g)throw Error(`Ignore mask size does not match image width/height. Expecting ${g}. Got ${h.length}`);let _=new Uint32Array(e.buffer,e.byteOffset,g),v=new Uint32Array(t.buffer,t.byteOffset,g),y=!0;for(let e=0;e<g;e++)if(_[e]!==v[e]&&(!h||!h[e])){y=!1;break}if(y){if(n&&!m)for(let t=0,r=0;t<g;t++,r+=4)oe(n,r,e,s);return 0}let[b,x,S]=c,[T,E,D]=l,[O,k,A]=p||l,j=0,M=Number.isFinite(d)?new Uint8Array(g):null,N=-1,P=0;for(let a=0,c=0;a<g;a++,c+=4){let l=_[a]===v[a]||h&&h[a]?0:ne(e,t,c,u,o);if(l){let o=a%r,s=a/r|0;!f&&(w(e,o,s,r,i,_,v)||w(t,o,s,r,i,v,_))?(n&&!m&&J(n,c,b,x,S),M&&(M[a]=2)):(n&&(l<0?J(n,c,O,k,A):J(n,c,T,E,D)),M&&(M[a]=1,N<0&&(N=s),P=s),j++)}else n&&!m&&oe(n,c,e,s)}if(!M||!j)return j;let F=Math.min(Math.max(Math.floor(d),1),r,i),I=new Uint16Array(r),L=0,R=0,z=Math.min(i-1,P+F-1);for(let e=N;e<=z;e++){let t=e*r,n=e-F;if(n>=0){let e=n*r;for(let n=0;n<r;n++){let r=(M[t+n]&1)-(M[e+n]&1);I[n]+=r,R+=r}}else{for(let e=0;e<r;e++){let n=M[t+e]&1;I[e]+=n,R+=n}if(e<F-1)continue}if(R<=L)continue;let i=0;for(let e=0;e<F-1;e++)i+=I[e];for(let e=F-1;e<r;e++)i+=I[e],i>L&&(L=i),i-=I[e-F+1]}return L}function C(e){return ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1}function w(e,t,n,r,i,a,o){let s=t>0?t-1:0,c=n>0?n-1:0,l=t<r-1?t+1:r-1,u=n<i-1?n+1:i-1,d=(n*r+t)*4,f=e[d],p=e[d+1],m=e[d+2],h=e[d+3],g=+(t===s||t===l||n===c||n===u),_=0,v=0,y=0,b=0,x=0,S=0,C=r*4;for(let i=s;i<=l;i++){let a=(c*r+i)*4;for(let r=c;r<=u;r++,a+=C){if(i===t&&r===n)continue;let o=ae(e,a,f,p,m,h);if(o===0){if(g++,g>2)return!1}else o<_?(_=o,y=i,b=r):o>v&&(v=o,x=i,S=r)}}return _===0||v===0?!1:T(a,y,b,r,i)&&T(o,y,b,r,i)||T(a,x,S,r,i)&&T(o,x,S,r,i)}function T(e,t,n,r,i){let a=n*r+t,o=e[a];if(t>0&&t<r-1&&n>0&&n<i-1)return+(o===e[a-r-1])+ +(o===e[a-1])+ +(o===e[a+r-1])+ +(o===e[a-r])+ +(o===e[a+r])+ +(o===e[a-r+1])+ +(o===e[a+1])+ +(o===e[a+r+1])>2;let s=t>0?t-1:0,c=n>0?n-1:0,l=t<r-1?t+1:r-1,u=n<i-1?n+1:i-1,d=+(t===s||t===l||n===c||n===u);for(let i=s;i<=l;i++){let a=c*r+i;for(let s=c;s<=u;s++,a+=r)if((i!==t||s!==n)&&(d+=+(o===e[a]),d>2))return!0}return!1}var E=new Float64Array(257);for(let e=0;e<256;e++){let t=e/255;E[e]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}E[256]=E[255];var D=new Float64Array(256),O=new Float64Array(256),k=new Float64Array(256),A=new Float64Array(256),j=new Float64Array(256),M=new Float64Array(256),N=new Float64Array(256),P=new Float64Array(256),F=new Float64Array(256);for(let e=0;e<256;e++){let t=E[e];D[e]=.4122214708*t,A[e]=.2119034982*t,N[e]=.0883024619*t,O[e]=.5363325363*t,j[e]=.6806995451*t,P[e]=.2817188376*t,k[e]=.0514459929*t,M[e]=.1073969566*t,F[e]=.6299787005*t}function I(e){let t=e|0;return E[t]+(E[t+1]-E[t])*(e-t)}var L=4096,R=new Float64Array(4098);for(let e=0;e<=4097;e++)R[e]=Math.cbrt(e/L);var z=8;function B(e){let t=e*L,n=t|0;return n<z?Math.cbrt(e):R[n]+(R[n+1]-R[n])*(t-n)}var V=20,H=4096,U=new Uint32Array(H),W=new Float64Array(H*4),ee=.206,te=.03,G=1.206/1.03;function ne(e,t,n,r,i){let a=e[n],o=e[n+1],s=e[n+2],c=e[n+3],l=t[n],u=t[n+1],d=t[n+2],f=t[n+3];return c===255&&f===255?re(a,o,s,l,u,d,i):ie(a,o,s,c,l,u,d,f,n,r,i)}function re(e,t,n,r,i,a,o){let s=e<<16|t<<8|n,c=Math.imul(s,2654435761)>>>V,l=s+1,u=c*4,d,f,p,m;U[c]===l?(d=W[u],f=W[u+1],p=W[u+2],m=W[u+3]):(d=B(D[e]+O[t]+k[n]),f=B(A[e]+j[t]+M[n]),p=B(N[e]+P[t]+F[n]),m=q(d,f,p),U[c]=l,W[u]=d,W[u+1]=f,W[u+2]=p,W[u+3]=m);let h=r<<16|i<<8|a,g=Math.imul(h,2654435761)>>>V,_=h+1,v=g*4,y,b,x,S;return U[g]===_?(y=W[v],b=W[v+1],x=W[v+2],S=W[v+3]):(y=B(D[r]+O[i]+k[a]),b=B(A[r]+j[i]+M[a]),x=B(N[r]+P[i]+F[a]),S=q(y,b,x),U[g]=_,W[v]=y,W[v+1]=b,W[v+2]=x,W[v+3]=S),K(m-S,d-y,f-b,p-x,o)}function ie(e,t,n,r,i,a,o,s,c,l,u){let d=255,f=255,p=255;if(l){let e=Math.imul(c>>2,2654435761);d=48+159*(e>>>31),f=48+159*(e>>>30&1),p=48+159*(e>>>29&1)}e=(e*r+d*(255-r))/255,t=(t*r+f*(255-r))/255,n=(n*r+p*(255-r))/255,i=(i*s+d*(255-s))/255,a=(a*s+f*(255-s))/255,o=(o*s+p*(255-s))/255;let m=I(e),h=I(t),g=I(n),_=I(i),v=I(a),y=I(o),b=B(.4122214708*m+.5363325363*h+.0514459929*g),x=B(.2119034982*m+.6806995451*h+.1073969566*g),S=B(.0883024619*m+.2817188376*h+.6299787005*g),C=B(.4122214708*_+.5363325363*v+.0514459929*y),w=B(.2119034982*_+.6806995451*v+.1073969566*y),T=B(.0883024619*_+.2817188376*v+.6299787005*y);return K(q(b,x,S)-q(C,w,T),b-C,x-w,S-T,u)}function K(e,t,n,r,i){let a=i-Math.abs(e);if(a>=0){let e=1.9779984951*t-2.428592205*n+.4505937099*r,i=.0259040371*t+.7827717662*n-.808675766*r;if(e*e+i*i<=a*a)return 0}return e>0?-1:1}function q(e,t,n){let r=.2104542553*e+.793617785*t-.0040720468*n,i=G*r-ee;return .5*(i+Math.sqrt(i*i+4*te*G*r))}function ae(e,t,n,r,i,a){let o=e[t],s=e[t+1],c=e[t+2],l=e[t+3],u=n-o,d=r-s,f=i-c,p=a-l;if(!u&&!d&&!f&&!p)return 0;if(a<255||l<255){u=(n*a-o*l-255*p)/255,d=(r*a-s*l-255*p)/255,f=(i*a-c*l-255*p)/255;let e=u*.29889531+d*.58662247+f*.11448223;return e===0&&p?p/2:e}return u*.29889531+d*.58662247+f*.11448223}function J(e,t,n,r,i){e[t]=n,e[t+1]=r,e[t+2]=i,e[t+3]=255}function oe(e,t,n,r){let i=255+(n[t]*.29889531+n[t+1]*.58662247+n[t+2]*.11448223-255)*r*n[t+3]/255;J(e,t,i,i,i)}var se=.1,Y=[239,68,68];function ce(e,t,{threshold:n=se}={}){let r=Math.max(e.width,t.width),i=Math.max(e.height,t.height),a={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)},o=e=>{if(e.width===a.width&&e.height===a.height)return e.data;let t=new Uint8Array(a.width*a.height*4);for(let n=0;n<a.height;n+=1)t.set(e.data.subarray(n*e.width*4,(n*e.width+a.width)*4),n*a.width*4);return t},s=new Uint8Array(r*i*4),c=new Uint8Array(a.width*a.height*4),l=S(o(e),o(t),c,a.width,a.height,{threshold:n,diffMask:!0,diffColor:Y,alpha:0});for(let e=0;e<a.height;e+=1)s.set(c.subarray(e*a.width*4,(e+1)*a.width*4),e*r*4);for(let e=0;e<i;e+=1)for(let t=e<a.height?a.width:0;t<r;t+=1){let n=(e*r+t)*4;s[n]=Y[0],s[n+1]=Y[1],s[n+2]=Y[2],s[n+3]=255,l+=1}let u=r*i;return{width:r,height:i,changed:l,total:u,percent:u?Math.round(l/u*1e4)/100:0,data:s}}var le=6,X=new Map;async function ue(e){let t=new Image;t.decoding=`async`,t.src=e,await t.decode();let n=document.createElement(`canvas`);n.width=t.naturalWidth,n.height=t.naturalHeight;let r=n.getContext(`2d`,{willReadFrequently:!0});return r.drawImage(t,0,0),r.getImageData(0,0,n.width,n.height)}async function de({width:e,height:t,data:n}){let r=document.createElement(`canvas`);r.width=e,r.height=t,r.getContext(`2d`).putImageData(new ImageData(new Uint8ClampedArray(n.buffer),e,t),0,0);let i=await new Promise(e=>r.toBlob(e,`image/png`));if(!i)throw Error(`Could not draw the diff.`);return URL.createObjectURL(i)}function fe(e,t){let n=`${e}\n${t}`;if(!X.has(n)){let r=Promise.all([ue(e),ue(t)]).then(async([e,t])=>{let n=ce(e,t);return{percent:n.percent,changed:n.changed,url:n.changed?await de(n):null}});for(r.catch(()=>X.delete(n)),X.set(n,r);X.size>le;){let[e,t]=X.entries().next().value;X.delete(e),t.then(e=>e.url&&URL.revokeObjectURL(e.url)).catch(()=>{})}}return X.get(n)}function pe(e,t,n=!0){let r=n&&e&&t?`${e}\n${t}`:null,[i,a]=(0,x.useState)({key:null,status:`idle`});return(0,x.useEffect)(()=>{if(!r)return;let n=!0;return fe(e,t).then(e=>n&&a({key:r,status:`ok`,...e}),()=>n&&a({key:r,status:`error`})),()=>{n=!1}},[t,e,r]),r?i.key===r?i:{status:`loading`}:{status:`idle`}}var Z=n();function Q(e){return e?new Date(u(e)).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`Unknown time`}function me(e){return e.status===`loading`?`Finding changes…`:e.status===`error`?`Could not compare these captures.`:e.status===`ok`?e.changed?`${e.percent}% changed`:`No pixel changes`:``}var $=new Map;function he(e){if(!$.has(e)){let t=(async()=>{let t=new Image;t.src=e,await t.decode();let n=Math.min(160,t.naturalWidth),r=Math.max(1,Math.round(t.naturalHeight*n/t.naturalWidth)),i=document.createElement(`canvas`);i.width=n,i.height=r;let a=i.getContext(`2d`,{willReadFrequently:!0});a.drawImage(t,0,0,n,r);let{data:o}=a.getImageData(0,0,n,r);for(let e=0;e<r;e+=1)for(let t=0;t<n;t+=1)if(o[(e*n+t)*4+3]>0)return e/r;return null})().catch(()=>null);$.set(e,t)}return $.get(e)}function ge(e){let t=e.status===`ok`&&e.changed?e.url:null,[n,r]=(0,x.useState)({url:null,at:null});return(0,x.useEffect)(()=>{if(!t)return;let e=!0;return he(t).then(n=>e&&r({url:t,at:n})),()=>{e=!1}},[t]),t&&n.url===t?n.at:null}function _e(e,t){e&&t!==null&&e.scrollTo({top:Math.max(0,t*e.scrollHeight-48),behavior:y()})}var ve={phone:`max-w-[400px]`,tablet:`max-w-[600px]`};function ye({label:e,entry:t,urlFor:n,page:r,viewport:i,diff:a=null,onImageError:c,paneRef:l,onScroll:u}){return(0,Z.jsxs)(`figure`,{className:o(`mx-auto w-full min-w-0 flex-1`,ve[i]),"data-sw-history-side":t.version,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 flex items-baseline gap-1.5 text-[11px] font-medium tracking-wide text-faint uppercase`,children:[e,(0,Z.jsxs)(`span`,{className:`truncate font-normal tracking-normal normal-case`,children:[t.current?`current capture`:Q(t.at),` · `,s(t.at)]})]}),(0,Z.jsxs)(`div`,{ref:l,onScroll:u,className:`relative max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:[(0,Z.jsx)(`img`,{src:n(t,!1),alt:`${r} ${i}, ${t.current?`current capture`:`captured ${Q(t.at)}`}`,className:`block w-full select-none`,draggable:!1,onError:c}),a?.url?(0,Z.jsx)(`img`,{src:a.url,alt:``,draggable:!1,className:`pointer-events-none absolute inset-x-0 top-0 block w-full opacity-80 select-none`,"data-sw-history-diff-overlay":`true`}):null]})]})}var be=[{id:`split`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(m,{size:13,"aria-hidden":`true`}),` Side by side`]})},{id:`slider`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_,{size:13,"aria-hidden":`true`}),` Slider`]})}],xe=[{id:`before`,label:`Earlier`},{id:`after`,label:`Current`},{id:`slider`,label:`Slider`}];function Se({open:e,onClose:n,page:a,viewport:s,data:u,comments:m,urlFor:_,onPickComment:y,touch:S,onImageError:C}){let w=(0,x.useMemo)(()=>a?p({pageId:a.id,viewport:s,manifest:u?.manifest,captures:u?.captures,versions:u?.versions}):[],[u?.captures,u?.manifest,u?.versions,a,s]),[T,E]=(0,x.useState)(null),[D,O]=(0,x.useState)(S?`before`:`split`),k=`${a?.id}|${s}`,A=T?.key===k?T.version:null,j=w.find(e=>e.current)||w[0]||null,M=w.find(e=>e.version===A)||w.find(e=>e!==j)||null,[N,P]=(0,x.useState)(!0),F=pe(M?_(M,!1):null,j?_(j,!1):null,N&&M!==j),I=ge(F);(0,x.useEffect)(()=>{e&&F.status===`error`&&C?.()},[F.status,C,e]);let L=e=>(m||[]).filter(t=>t.captureVersion===e),R=(0,x.useRef)({before:null,after:null,slider:null}),z=(0,x.useRef)(!1),B=(e,t)=>()=>{if(z.current)return;let n=R.current[e],r=R.current[t];n&&r&&(z.current=!0,r.scrollTop=n.scrollTop,window.requestAnimationFrame(()=>{z.current=!1}))},V=()=>{for(let e of Object.values(R.current))_e(e,I)},H=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(I===null||H.current===`${k}|${M?.version}|${I}`)return;H.current=`${k}|${M?.version}|${I}`;let e=window.setTimeout(()=>{for(let e of Object.values(R.current))_e(e,I)},150);return()=>window.clearTimeout(e)},[M?.version,I,k]);let U=N&&F.status===`ok`?F:null,W=D===`slider`;return(0,Z.jsx)(i,{open:e,onClose:n,title:a?`History: ${a.title}`:`History`,description:a?`${s} · ${w.length} capture${w.length===1?``:`s`} kept`:``,size:`lg`,children:(0,Z.jsx)(`div`,{className:`space-y-3 p-4`,"data-sw-history":k,children:w.length<2?(0,Z.jsx)(r,{icon:h,title:`No earlier captures yet`,children:`Each recapture keeps the previous shot, so the changes to this page show up here.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`ol`,{className:`flex gap-2.5 overflow-x-auto pb-1`,"aria-label":`Captures, newest first`,"data-sw-history-strip":`true`,children:w.map((e,t)=>{let n=L(e.version).length,r=M?.version===e.version;return(0,Z.jsx)(`li`,{className:`shrink-0`,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:e.current,onClick:()=>E({key:k,version:e.version}),"aria-pressed":r,className:o(`group block w-36 rounded-lg border bg-surface p-1.5 text-left transition-colors disabled:cursor-default`,r?`border-accent ring-2 ring-accent/30`:e.current?`border-line`:`border-line hover:border-faint hover:bg-surface-2`),"data-sw-history-version":e.version,children:[(0,Z.jsxs)(`span`,{className:`relative block h-24 overflow-hidden rounded bg-surface-2`,children:[(0,Z.jsx)(`img`,{src:_(e,!0),alt:``,className:`block w-full`,draggable:!1,loading:`lazy`,onError:C}),e.current?(0,Z.jsx)(f,{tone:`solid`,className:`absolute top-1 left-1 shadow-card`,children:`Current`}):r?(0,Z.jsx)(f,{tone:`accent`,className:`absolute top-1 left-1 bg-surface shadow-card`,children:`Comparing`}):null]}),(0,Z.jsxs)(`span`,{className:`mt-1.5 flex items-center gap-1 px-0.5`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] font-medium text-fg`,children:e.current?`Current`:`Version ${w.length-t}`}),n?(0,Z.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-0.5 text-[11px] text-accent tabular`,children:[(0,Z.jsx)(v,{size:11,"aria-hidden":`true`}),` `,n]}):null]}),(0,Z.jsx)(`span`,{className:`block truncate px-0.5 text-[11px] text-faint`,children:Q(e.at)})]})},e.version)})}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(d,{label:`Compare`,large:S,value:D,onChange:O,className:S?`w-full`:``,itemClassName:`inline-flex items-center justify-center gap-1.5`,options:S?xe:be}),(0,Z.jsx)(c,{size:S?`touch`:`sm`,pressed:N,onPressedChange:P,"data-sw-history-diff":N?`on`:`off`,children:`Highlight changes`}),N?(0,Z.jsx)(`span`,{className:`text-xs text-muted tabular`,role:`status`,"data-sw-history-diff-status":F.status,children:me(F)}):null,N&&I!==null?(0,Z.jsxs)(t,{size:S?`touch`:`sm`,variant:`ghost`,onClick:V,"data-sw-history-jump":`true`,children:[(0,Z.jsx)(g,{size:13,"aria-hidden":`true`}),` Jump to the change`]}):null]}),W&&M&&j?(0,Z.jsxs)(`figure`,{className:o(`mx-auto w-full min-w-0`,ve[s]),"data-sw-history-slider":`true`,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 text-[11px] text-faint`,children:[`Earlier `,Q(M.at),` on the left, current on the right. Drag the divider.`]}),(0,Z.jsx)(`div`,{ref:e=>{R.current.slider=e},className:`max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:(0,Z.jsx)(b,{label:`Earlier and current capture`,beforeLabel:`Earlier`,afterLabel:`Current`,before:(0,Z.jsx)(`img`,{src:_(M,!1),alt:`${a.title} ${s}, captured ${Q(M.at)}`,className:`block w-full select-none`,draggable:!1,onError:C}),after:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:_(j,!1),alt:`${a.title} ${s}, current capture`,className:`block w-full select-none`,draggable:!1,onError:C}),U?.url?(0,Z.jsx)(`img`,{src:U.url,alt:``,draggable:!1,className:`pointer-events-none absolute inset-x-0 top-0 block w-full opacity-80 select-none`,"data-sw-history-diff-overlay":`true`}):null]})})})]}):(0,Z.jsxs)(`div`,{className:`flex justify-center gap-3`,children:[M&&(!S||D===`before`)?(0,Z.jsx)(ye,{label:`Earlier`,entry:M,urlFor:_,page:a.title,viewport:s,onImageError:C,paneRef:e=>{R.current.before=e},onScroll:B(`before`,`after`)}):null,j&&(!S||D===`after`)?(0,Z.jsx)(ye,{label:`Current`,entry:j,urlFor:_,page:a.title,viewport:s,diff:U,onImageError:C,paneRef:e=>{R.current.after=e},onScroll:B(`after`,`before`)}):null]}),M&&L(M.version).length?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`mb-1.5 text-xs font-medium text-muted`,children:`Comments made on the earlier capture`}),(0,Z.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:L(M.version).map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>y(e),className:o(`inline-flex max-w-72 items-center gap-1.5 rounded-full border border-line px-2 text-xs text-fg transition-colors hover:bg-surface-2`,S?`h-11`:`h-7`),"data-sw-history-comment":e.id,children:[(0,Z.jsx)(l,{className:e.status===`resolved`?`bg-ok text-ok-fg`:`bg-accent text-accent-fg`,children:e.id}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.body})]})},e.id))})]}):null]})})})}export{Se as default};
@@ -1 +1 @@
1
- import{$t as e,B as t,Jt as n,R as r,Xt as i,a,i as o,o as s,s as c,t as l}from"./ui-Cg4TTrec.js";import{i as u,n as d,r as f}from"./index-DKOCIQiq.js";import{i as p,o as m}from"./QuickConnect-B-4pUgXH.js";var h=e(i(),1),g=n();function _({open:e,onClose:t,info:n,boardCount:i,onSaved:a,onOpenUpdates:o,touch:s}){let c=(0,h.useRef)(!1),[l,u]=(0,h.useState)(!1);return(0,g.jsx)(r,{open:e,onClose:t,sticky:l,onCloseAutoFocus:e=>{e.preventDefault(),c.current||document.querySelector(`[data-sw-profile-menu]`)?.focus()},title:`Settings`,size:`md`,children:(0,g.jsx)(v,{info:n,boardCount:i,onSaved:a,touch:s,onDirtyChange:u,onOpenUpdates:()=>{c.current=!0,o()}})})}function v({info:e,boardCount:t,onSaved:n,onOpenUpdates:r,touch:i,onDirtyChange:l}){return(0,g.jsxs)(o,{defaultValue:`general`,className:`p-5`,children:[(0,g.jsxs)(s,{className:`mb-5 max-w-72`,"aria-label":`Settings`,children:[(0,g.jsx)(c,{value:`general`,large:i,"data-sw-settings-tab":`general`,children:`General`}),(0,g.jsx)(c,{value:`agent`,large:i,"data-sw-settings-tab":`agent`,children:`Agent`})]}),(0,g.jsx)(a,{value:`general`,children:(0,g.jsx)(y,{info:e,boardCount:t,touch:i,onOpenUpdates:r})}),(0,g.jsx)(a,{value:`agent`,children:(0,g.jsx)(b,{info:e,onSaved:n,touch:i,onDirtyChange:l})})]})}function y({info:e,boardCount:n,touch:r,onOpenUpdates:i}){let[a,o]=u();return(0,g.jsxs)(`div`,{className:`space-y-6`,"data-sw-settings":`general`,children:[(0,g.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`sw-general-appearance`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{id:`sw-general-appearance`,className:`text-sm font-semibold text-fg`,children:`Appearance`}),(0,g.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Saved in this browser and shared with your other Shapewall tabs.`})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-mode":!0,children:[(0,g.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Mode`}),(0,g.jsx)(l,{value:a.mode,onChange:e=>o({mode:e}),options:d,label:`Appearance mode`,large:r})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-theme":!0,children:[(0,g.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Theme`}),(0,g.jsx)(l,{value:a.theme,onChange:e=>o({theme:e}),options:f,label:`Appearance theme`,large:r,className:`grid grid-cols-2 sm:flex`})]})]}),(0,g.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`sw-general-installation`,children:[(0,g.jsx)(`h2`,{id:`sw-general-installation`,className:`text-sm font-semibold text-fg`,children:`This installation`}),(0,g.jsxs)(`dl`,{className:`space-y-1 text-xs`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-x-4 gap-y-1`,children:[(0,g.jsx)(`dt`,{className:`text-muted`,children:`Name`}),(0,g.jsx)(`dd`,{className:`min-w-0 break-words text-fg`,children:e?.title||`Shapewall`})]}),(0,g.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,g.jsx)(`dt`,{className:`text-muted`,children:`Boards`}),(0,g.jsx)(`dd`,{className:`text-fg`,children:n})]})]}),(0,g.jsx)(t,{size:r?`touch`:`md`,className:`mt-2`,onClick:i,"data-sw-settings-updates":!0,children:`About & Updates`})]})]})}function b({info:e,onSaved:t,touch:n,onDirtyChange:r,agentsHome:i=!1}){return e?.agent?.settingsEditable||e?.agent?.settingsReadonly?(0,g.jsx)(p,{onSaved:t,touch:n,buzz:!!e?.buzzAvailable,onDirtyChange:r,agents:i?`none`:`link`}):(0,g.jsxs)(`div`,{className:`space-y-2 text-sm`,"data-sw-settings-agent-unavailable":!0,children:[(0,g.jsx)(`h2`,{className:`font-semibold text-fg`,children:`Agent settings`}),(0,g.jsx)(`p`,{className:`text-muted`,children:e?.agent?.settingsLocked?(0,g.jsx)(m,{}):e?.agent?`Agent settings are managed on the computer serving this installation.`:`Agent chat is not enabled for this installation. Ask the installer to enable it if you want to connect an agent.`})]})}export{b as AgentDetails,y as GeneralSettings,v as LocalSettingsContent,_ as default};
1
+ import{$t as e,B as t,Jt as n,R as r,Xt as i,a,i as o,o as s,s as c,t as l}from"./ui-Cg4TTrec.js";import{i as u,n as d,r as f}from"./index-C9S7HL_o.js";import{i as p,o as m}from"./QuickConnect-DyfPSWbV.js";var h=e(i(),1),g=n();function _({open:e,onClose:t,info:n,boardCount:i,onSaved:a,onOpenUpdates:o,touch:s}){let c=(0,h.useRef)(!1),[l,u]=(0,h.useState)(!1);return(0,g.jsx)(r,{open:e,onClose:t,sticky:l,onCloseAutoFocus:e=>{e.preventDefault(),c.current||document.querySelector(`[data-sw-profile-menu]`)?.focus()},title:`Settings`,size:`md`,children:(0,g.jsx)(v,{info:n,boardCount:i,onSaved:a,touch:s,onDirtyChange:u,onOpenUpdates:()=>{c.current=!0,o()}})})}function v({info:e,boardCount:t,onSaved:n,onOpenUpdates:r,touch:i,onDirtyChange:l}){return(0,g.jsxs)(o,{defaultValue:`general`,className:`p-5`,children:[(0,g.jsxs)(s,{className:`mb-5 max-w-72`,"aria-label":`Settings`,children:[(0,g.jsx)(c,{value:`general`,large:i,"data-sw-settings-tab":`general`,children:`General`}),(0,g.jsx)(c,{value:`agent`,large:i,"data-sw-settings-tab":`agent`,children:`Agent`})]}),(0,g.jsx)(a,{value:`general`,children:(0,g.jsx)(y,{info:e,boardCount:t,touch:i,onOpenUpdates:r})}),(0,g.jsx)(a,{value:`agent`,children:(0,g.jsx)(b,{info:e,onSaved:n,touch:i,onDirtyChange:l})})]})}function y({info:e,boardCount:n,touch:r,onOpenUpdates:i}){let[a,o]=u();return(0,g.jsxs)(`div`,{className:`space-y-6`,"data-sw-settings":`general`,children:[(0,g.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":`sw-general-appearance`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{id:`sw-general-appearance`,className:`text-sm font-semibold text-fg`,children:`Appearance`}),(0,g.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Saved in this browser and shared with your other Shapewall tabs.`})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-mode":!0,children:[(0,g.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Mode`}),(0,g.jsx)(l,{value:a.mode,onChange:e=>o({mode:e}),options:d,label:`Appearance mode`,large:r})]}),(0,g.jsxs)(`div`,{className:`space-y-1.5`,"data-sw-settings-theme":!0,children:[(0,g.jsx)(`p`,{className:`text-xs font-medium text-fg`,children:`Theme`}),(0,g.jsx)(l,{value:a.theme,onChange:e=>o({theme:e}),options:f,label:`Appearance theme`,large:r,className:`grid grid-cols-2 sm:flex`})]})]}),(0,g.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`sw-general-installation`,children:[(0,g.jsx)(`h2`,{id:`sw-general-installation`,className:`text-sm font-semibold text-fg`,children:`This installation`}),(0,g.jsxs)(`dl`,{className:`space-y-1 text-xs`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-x-4 gap-y-1`,children:[(0,g.jsx)(`dt`,{className:`text-muted`,children:`Name`}),(0,g.jsx)(`dd`,{className:`min-w-0 break-words text-fg`,children:e?.title||`Shapewall`})]}),(0,g.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,g.jsx)(`dt`,{className:`text-muted`,children:`Boards`}),(0,g.jsx)(`dd`,{className:`text-fg`,children:n})]})]}),(0,g.jsx)(t,{size:r?`touch`:`md`,className:`mt-2`,onClick:i,"data-sw-settings-updates":!0,children:`About & Updates`})]})]})}function b({info:e,onSaved:t,touch:n,onDirtyChange:r,agentsHome:i=!1}){return e?.agent?.settingsEditable||e?.agent?.settingsReadonly?(0,g.jsx)(p,{onSaved:t,touch:n,buzz:!!e?.buzzAvailable,onDirtyChange:r,agents:i?`none`:`link`}):(0,g.jsxs)(`div`,{className:`space-y-2 text-sm`,"data-sw-settings-agent-unavailable":!0,children:[(0,g.jsx)(`h2`,{className:`font-semibold text-fg`,children:`Agent settings`}),(0,g.jsx)(`p`,{className:`text-muted`,children:e?.agent?.settingsLocked?(0,g.jsx)(m,{}):e?.agent?`Agent settings are managed on the computer serving this installation.`:`Agent chat is not enabled for this installation. Ask the installer to enable it if you want to connect an agent.`})]})}export{b as AgentDetails,y as GeneralSettings,v as LocalSettingsContent,_ as default};
@@ -1 +1 @@
1
- import{i as e}from"./QuickConnect-B-4pUgXH.js";import{Jt as t,ht as n}from"./ui-Cg4TTrec.js";var r=t();function i(){let t=n(`(max-width: 600px)`);return(0,r.jsxs)(`main`,{className:`mx-auto max-w-3xl space-y-5 p-4 sm:p-6`,"data-sw-agent-management":!0,children:[(0,r.jsxs)(`header`,{className:`space-y-2`,children:[(0,r.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Shapewall agent settings`}),(0,r.jsx)(`p`,{className:`text-sm text-muted`,children:`This temporary window changes the agent for this source project. Stop active agent turns before changing connections. Your account-protected board stays separate. Close this server with Ctrl-C when finished.`})]}),(0,r.jsx)(e,{touch:t})]})}export{i as default};
1
+ import{i as e}from"./QuickConnect-DyfPSWbV.js";import{Jt as t,ht as n}from"./ui-Cg4TTrec.js";var r=t();function i(){let t=n(`(max-width: 600px)`);return(0,r.jsxs)(`main`,{className:`mx-auto max-w-3xl space-y-5 p-4 sm:p-6`,"data-sw-agent-management":!0,children:[(0,r.jsxs)(`header`,{className:`space-y-2`,children:[(0,r.jsx)(`h1`,{className:`text-xl font-semibold text-fg`,children:`Shapewall agent settings`}),(0,r.jsx)(`p`,{className:`text-sm text-muted`,children:`This temporary window changes the agent for this source project. Stop active agent turns before changing connections. Your account-protected board stays separate. Close this server with Ctrl-C when finished.`})]}),(0,r.jsx)(e,{touch:t})]})}export{i as default};