shapewall 0.6.0 → 0.7.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 (127) hide show
  1. package/CHANGELOG.md +267 -0
  2. package/README.md +39 -2
  3. package/THIRD_PARTY.md +15 -0
  4. package/dist/agent/package-lock.json +594 -2
  5. package/dist/client/assets/{BoardChat-DdwBcb2N.js → BoardChat-Bv4UDOjO.js} +1 -1
  6. package/dist/client/assets/{BuzzDialog-DpUcnU6S.js → BuzzDialog-DwEAN6va.js} +1 -1
  7. package/dist/client/assets/{ChecksPanel-CngYV4yz.js → ChecksPanel-C6r_Tc9g.js} +1 -1
  8. package/dist/client/assets/{History-CD0saQA5.js → History-ajFROfWC.js} +1 -1
  9. package/dist/client/assets/{LocalSettings-MZy2baig.js → LocalSettings-BSbmmpbN.js} +1 -1
  10. package/dist/client/assets/{Management-CSvZ-SHO.js → Management-mo8uv2qG.js} +1 -1
  11. package/dist/client/assets/{QuickConnect-foLh2QUm.js → QuickConnect-DlaijESK.js} +1 -1
  12. package/dist/client/assets/{ShareDialog-DPWDftoL.js → ShareDialog-CdLdd6WQ.js} +1 -1
  13. package/dist/client/assets/{app-update-dialog-CtiXpTRD.js → app-update-dialog-BHVNR5Cp.js} +1 -1
  14. package/dist/client/assets/{circle-x-CteRBtXC.js → circle-x-D5MkDLJk.js} +1 -1
  15. package/dist/client/assets/index-B4AoX3ZW.css +2 -0
  16. package/dist/client/assets/index-CQeHY7en.js +37 -0
  17. package/dist/client/assets/{play-BjRNIGSf.js → play--xrZ7VCR.js} +1 -1
  18. package/dist/client/assets/{refresh-cw-r_tZiFfB.js → refresh-cw-B-npxKae.js} +1 -1
  19. package/dist/client/assets/{ui-zQpn-PdL.js → ui-2lMx-4bc.js} +2 -2
  20. package/dist/client/build-info.json +1 -1
  21. package/dist/client/index.html +3 -3
  22. package/dist/client/sw.js +2 -2
  23. package/dist/console/assets/LocalAccountsApp-C1sCag6a.js +1 -0
  24. package/dist/console/assets/LocalConsole-LXQmzRFT.js +2 -0
  25. package/dist/console/assets/LocalUsage-Br3Ddp7_.js +1 -0
  26. package/dist/console/assets/app-update-dialog-CVniDJKA.js +1 -0
  27. package/dist/console/assets/app-version-CTHwlY6g.js +1 -0
  28. package/dist/console/assets/console-CMNNLtFw.js +11 -0
  29. package/dist/console/assets/console-sMMn_Rwc.css +2 -0
  30. package/dist/console/assets/local-agents-DwYJ9cPb.js +6 -0
  31. package/dist/console/assets/minus-887msXez.js +1 -0
  32. package/dist/console/assets/tailnet--wXsG3uh.js +2 -0
  33. package/dist/console/assets/theme-CPfJOmcz.js +1 -0
  34. package/dist/console/assets/ui-DnyJhoQU.js +41 -0
  35. package/dist/console/assets/usage-C5CJHejQ.js +5 -0
  36. package/dist/console/assets/usage-CIPWnHaS.css +1 -0
  37. package/dist/console/assets/usage-DjmUlnXL.js +56 -0
  38. package/dist/console/build-info.json +1 -1
  39. package/dist/console/console.html +8 -2
  40. package/docs/agent-hardening.md +31 -17
  41. package/docs/agents.md +35 -0
  42. package/docs/architecture.md +10 -4
  43. package/docs/deployment.md +39 -17
  44. package/docs/design-system.md +56 -7
  45. package/docs/hosted.md +1004 -43
  46. package/docs/images/board-overview.png +0 -0
  47. package/docs/images/journeys.png +0 -0
  48. package/docs/images/live-comment.png +0 -0
  49. package/docs/images/phone-comment.png +0 -0
  50. package/docs/images/phone-overview.png +0 -0
  51. package/docs/images/variant.png +0 -0
  52. package/docs/where-to-run.md +82 -1
  53. package/package.json +6 -1
  54. package/src/agent/backends/acp.js +224 -26
  55. package/src/agent/routes.js +21 -0
  56. package/src/agent/usage-log.js +251 -0
  57. package/src/cli/args.js +24 -0
  58. package/src/cli/help.js +37 -2
  59. package/src/cli/init.js +2 -1
  60. package/src/cli/serve.js +20 -5
  61. package/src/cli.js +8 -0
  62. package/src/hosted/access-cli.js +99 -1
  63. package/src/hosted/activity-core.js +232 -0
  64. package/src/hosted/activity.js +375 -0
  65. package/src/hosted/admin.js +80 -13
  66. package/src/hosted/agent-approvals.js +2 -2
  67. package/src/hosted/agent-routes.js +3 -3
  68. package/src/hosted/agents.js +11 -4
  69. package/src/hosted/app.js +89 -7
  70. package/src/hosted/auth-routes.js +156 -15
  71. package/src/hosted/auth.js +123 -20
  72. package/src/hosted/board-routes.js +3 -3
  73. package/src/hosted/chat-frames.js +5 -15
  74. package/src/hosted/chat-permissions.js +12 -0
  75. package/src/hosted/chat-routes.js +8 -8
  76. package/src/hosted/chat-store.js +20 -3
  77. package/src/hosted/comment-files.js +5 -2
  78. package/src/hosted/console-routes.js +111 -34
  79. package/src/hosted/db.js +130 -0
  80. package/src/hosted/device-routes.js +25 -3
  81. package/src/hosted/device.js +23 -4
  82. package/src/hosted/guards.js +337 -27
  83. package/src/hosted/http.js +6 -3
  84. package/src/hosted/membership.js +13 -2
  85. package/src/hosted/operator-access.js +418 -0
  86. package/src/hosted/operator.js +106 -2
  87. package/src/hosted/ops-cli.js +238 -3
  88. package/src/hosted/pages.js +2 -0
  89. package/src/hosted/passkey-policy.js +75 -0
  90. package/src/hosted/permissions.js +14 -6
  91. package/src/hosted/presence.js +14 -2
  92. package/src/hosted/projects.js +2 -1
  93. package/src/hosted/public.js +4 -4
  94. package/src/hosted/ratelimit.js +6 -0
  95. package/src/hosted/retention.js +18 -2
  96. package/src/hosted/server.js +123 -11
  97. package/src/hosted/shares.js +2 -2
  98. package/src/hosted/step-up-settings.js +68 -0
  99. package/src/hosted/step-up.js +135 -0
  100. package/src/hosted/tailnet-identity.js +24 -0
  101. package/src/hosted/tailnet-routes.js +342 -0
  102. package/src/hosted/tailnet.js +220 -0
  103. package/src/hosted/tailscale.js +75 -9
  104. package/src/hosted/tenancy.js +48 -1
  105. package/src/hosted/token-api.js +2 -2
  106. package/src/hosted/tokens.js +9 -2
  107. package/src/hosted/usage-core.js +624 -0
  108. package/src/hosted/usage-layout.js +724 -0
  109. package/src/hosted/usage-routes.js +375 -0
  110. package/src/hosted/usage-shape.js +256 -0
  111. package/src/hosted/usage.js +641 -0
  112. package/src/remote/agent-connect.js +37 -1
  113. package/src/remote/agent-link.js +2 -0
  114. package/src/remote/login.js +33 -8
  115. package/src/remote/share.js +1 -1
  116. package/src/remote/tailnet-cli.js +547 -0
  117. package/src/server/app.js +15 -0
  118. package/src/server/pairing-routes.js +34 -5
  119. package/src/server/tailscale.js +97 -4
  120. package/src/tailnet-proof.js +766 -0
  121. package/dist/client/assets/index-Cxz1UVcV.css +0 -2
  122. package/dist/client/assets/index-uUZVBYUS.js +0 -37
  123. package/dist/console/assets/LocalAccountsApp-DIdy1KnN.js +0 -1
  124. package/dist/console/assets/LocalConsole-DfcQztF-.js +0 -1
  125. package/dist/console/assets/app-update-dialog-ttl9lF5A.js +0 -1
  126. package/dist/console/assets/console-OqAjD0kV.js +0 -55
  127. package/dist/console/assets/console-kvjrAArQ.css +0 -2
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,A as n,B as r,Cn as i,D as a,E as o,F as s,H as c,I as l,Jt as u,L as d,Lt as f,M as p,Mt as m,N as h,Nt as g,O as _,P as v,Q as y,R as b,S as x,Sn as S,T as C,Tn as w,Ut as T,V as E,Zt as ee,_ as D,_n as O,b as te,bn as k,bt as A,c as j,ct as M,d as N,et as P,ft as F,g as I,gt as ne,ht as L,k as R,ln as re,mt as ie,p as z,r as B,t as V,tt as H,u as ae,vn as oe,w as U,wt as se,x as ce,xn as le,y as ue,yn as W,yt as de}from"./ui-zQpn-PdL.js";import{$ as fe,A as pe,B as me,C as he,D as ge,E as _e,G as ve,H as ye,I as G,J as be,K as xe,L as Se,M as Ce,N as we,O as Te,P as Ee,Q as De,S as Oe,T as ke,U as Ae,W as K,Y as je,Z as Me,_t as Ne,a as Pe,b as Fe,c as Ie,ct as Le,d as Re,dt as ze,et as Be,f as Ve,ft as He,g as Ue,gt as q,j as We,k as Ge,l as Ke,lt as qe,m as Je,mt as Ye,nt as Xe,p as Ze,pt as Qe,q as J,rt as $e,st as Y,u as et,ut as tt,v as nt,vt as X,w as rt,x as it,y as at,yt as ot,z as st}from"./index-uUZVBYUS.js";import{c as ct,l as lt,o as ut,r as dt,s as ft,t as pt,u as Z}from"./QuickConnect-foLh2QUm.js";import{n as mt,t as ht}from"./circle-x-CteRBtXC.js";import{t as gt}from"./refresh-cw-r_tZiFfB.js";import{t as _t}from"./play-BjRNIGSf.js";var vt={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`]};vt.node;var yt=S(vt),bt={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`}]]};bt.node;var xt=S(bt),St={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};St.node;var Ct=S(St),wt={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`}]]};wt.node;var Tt=S(wt),Et={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`}]]};Et.node;var Dt=S(Et),Ot={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`]};Ot.node;var kt=S(Ot),At={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};At.node;var jt=S(At),Mt={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};Mt.node;var Nt=S(Mt),Pt={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`}]]};Pt.node;var Ft=S(Pt),It={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`}]]};It.node;var Lt=S(It),Rt={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`}]]};Rt.node;var zt=S(Rt),Bt={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`]};Bt.node;var Vt=S(Bt),Ht={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`}]]};Ht.node;var Ut=S(Ht),Wt={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`}]]};Wt.node;var Gt=S(Wt),Kt={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`]};Kt.node;var qt=S(Kt),Jt={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Jt.node;var Yt=S(Jt),Xt={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`}]]};Xt.node;var Zt=S(Xt),Qt={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`}]]};Qt.node;var $t=S(Qt),en={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`}]]};en.node;var tn=S(en),nn={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`}]]};nn.node;var rn=S(nn),an={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`}]]};an.node;var on=S(an),sn={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`}]]};sn.node;var cn=S(sn),ln={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`}]]};ln.node;var un=S(ln),dn={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`]};dn.node;var fn=S(dn),pn={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`]};pn.node;var mn=S(pn),hn={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`}]]};hn.node;var gn=S(hn),_n={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`}]]};_n.node;var vn=S(_n),yn={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`}]]};yn.node;var bn=S(yn),xn={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`}]]};xn.node;var Sn=S(xn),Cn={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`}]]};Cn.node;var wn=S(Cn),Tn={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`}]]};Tn.node;var En=S(Tn),Dn=new Set([`agent_auth`,`agent_start`,`agent_not_found`]),On=e=>Dn.has(e?.code),Q=e(w(),1),kn=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(` `)),An=new Set([`sh`,`bash`,`zsh`,`shell`,`console`,`py`,`python`,`rb`,`ruby`,`yaml`,`yml`,`toml`,`ini`,`conf`,`dockerfile`,`make`,`makefile`,`r`,`perl`,`pl`,`nginx`,`caddyfile`]),jn=new Set([`html`,`htm`,`xml`,`svg`,`vue`,`svelte`,`jsx`,`tsx`,`astro`]),Mn=new Set([`diff`,`patch`]),Nn=new Set([`sql`,`psql`,`sqlite`,`mysql`]),Pn={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`},Fn=e=>{let t=String(e||``).toLowerCase();return t?Pn[t]||t.slice(0,24):`Code`},In=4e4;function Ln(e,t){let n=String(e||``),r=String(t||``).toLowerCase();if(!n||n.length>In||[`txt`,`text`,`plaintext`].includes(r))return[{type:`plain`,text:n}];if(Mn.has(r))return n.split(`
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,A as n,B as r,Cn as i,D as a,E as o,F as s,H as c,I as l,Jt as u,L as d,Lt as f,M as p,Mt as m,N as h,Nt as g,O as _,P as v,Q as y,R as b,S as x,Sn as S,T as C,Tn as w,Ut as T,V as E,Zt as ee,_ as D,_n as O,b as te,bn as k,bt as A,c as j,ct as M,d as N,et as P,ft as F,g as I,gt as ne,ht as L,k as R,ln as re,mt as ie,p as z,r as B,t as V,tt as H,u as ae,vn as oe,w as U,wt as se,x as ce,xn as le,y as ue,yn as W,yt as de}from"./ui-2lMx-4bc.js";import{$ as fe,A as pe,B as me,C as he,D as ge,E as _e,G as ve,H as ye,I as G,J as be,K as xe,L as Se,M as Ce,N as we,O as Te,P as Ee,Q as De,S as Oe,T as ke,U as Ae,W as K,Y as je,Z as Me,_t as Ne,a as Pe,b as Fe,c as Ie,ct as Le,d as Re,dt as ze,et as Be,f as Ve,ft as He,g as Ue,gt as q,j as We,k as Ge,l as Ke,lt as qe,m as Je,mt as Ye,nt as Xe,p as Ze,pt as Qe,q as J,rt as $e,st as Y,u as et,ut as tt,v as nt,vt as X,w as rt,x as it,y as at,yt as ot,z as st}from"./index-CQeHY7en.js";import{c as ct,l as lt,o as ut,r as dt,s as ft,t as pt,u as Z}from"./QuickConnect-DlaijESK.js";import{n as mt,t as ht}from"./circle-x-D5MkDLJk.js";import{t as gt}from"./refresh-cw-B-npxKae.js";import{t as _t}from"./play--xrZ7VCR.js";var vt={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`]};vt.node;var yt=S(vt),bt={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`}]]};bt.node;var xt=S(bt),St={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};St.node;var Ct=S(St),wt={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`}]]};wt.node;var Tt=S(wt),Et={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`}]]};Et.node;var Dt=S(Et),Ot={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`]};Ot.node;var kt=S(Ot),At={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};At.node;var jt=S(At),Mt={name:`cloud-upload`,size:24,node:[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]],aliases:[`upload-cloud`]};Mt.node;var Nt=S(Mt),Pt={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`}]]};Pt.node;var Ft=S(Pt),It={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`}]]};It.node;var Lt=S(It),Rt={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`}]]};Rt.node;var zt=S(Rt),Bt={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`]};Bt.node;var Vt=S(Bt),Ht={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`}]]};Ht.node;var Ut=S(Ht),Wt={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`}]]};Wt.node;var Gt=S(Wt),Kt={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`]};Kt.node;var qt=S(Kt),Jt={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Jt.node;var Yt=S(Jt),Xt={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`}]]};Xt.node;var Zt=S(Xt),Qt={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`}]]};Qt.node;var $t=S(Qt),en={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`}]]};en.node;var tn=S(en),nn={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`}]]};nn.node;var rn=S(nn),an={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`}]]};an.node;var on=S(an),sn={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`}]]};sn.node;var cn=S(sn),ln={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`}]]};ln.node;var un=S(ln),dn={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`]};dn.node;var fn=S(dn),pn={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`]};pn.node;var mn=S(pn),hn={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`}]]};hn.node;var gn=S(hn),_n={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`}]]};_n.node;var vn=S(_n),yn={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`}]]};yn.node;var bn=S(yn),xn={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`}]]};xn.node;var Sn=S(xn),Cn={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`}]]};Cn.node;var wn=S(Cn),Tn={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`}]]};Tn.node;var En=S(Tn),Dn=new Set([`agent_auth`,`agent_start`,`agent_not_found`]),On=e=>Dn.has(e?.code),Q=e(w(),1),kn=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(` `)),An=new Set([`sh`,`bash`,`zsh`,`shell`,`console`,`py`,`python`,`rb`,`ruby`,`yaml`,`yml`,`toml`,`ini`,`conf`,`dockerfile`,`make`,`makefile`,`r`,`perl`,`pl`,`nginx`,`caddyfile`]),jn=new Set([`html`,`htm`,`xml`,`svg`,`vue`,`svelte`,`jsx`,`tsx`,`astro`]),Mn=new Set([`diff`,`patch`]),Nn=new Set([`sql`,`psql`,`sqlite`,`mysql`]),Pn={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`},Fn=e=>{let t=String(e||``).toLowerCase();return t?Pn[t]||t.slice(0,24):`Code`},In=4e4;function Ln(e,t){let n=String(e||``),r=String(t||``).toLowerCase();if(!n||n.length>In||[`txt`,`text`,`plaintext`].includes(r))return[{type:`plain`,text:n}];if(Mn.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=An.has(r),a=Nn.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]|\\.)*'?|`+"`(?:[^`\\\\]|\\\\.)*`?",jn.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`,...jn.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=kn.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 $=i(),Rn={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 zn(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 Bn({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)(()=>Ln(t,e),[t,e]),c=async()=>{let e=await zn(t);a(e?`ok`:`failed`),window.clearTimeout(o.current),o.current=window.setTimeout(()=>a(null),1600)},l=Fn(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:m(`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:l}),(0,$.jsxs)(r,{variant:`ghost`,size:n?`touch`:`xs`,className:m(`shrink-0 gap-1 font-normal text-muted`,n&&`min-w-11`),onClick:c,"aria-label":i===`ok`?`Copied ${l} code`:`Copy ${l} code`,"data-sw-chat-code-copy":i||`ready`,children:[i===`ok`?(0,$.jsx)(k,{size:12,className:`text-ok`,"aria-hidden":`true`}):(0,$.jsx)(Z,{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":`${l} code`,children:(0,$.jsx)(`code`,{className:`inline-block min-w-full`,children:s.map((e,t)=>e.line?(0,$.jsx)(`span`,{className:m(`-mx-2.5 block px-2.5`,Rn[e.type]),children:e.text||` `},t):e.type===`plain`?e.text:(0,$.jsx)(`span`,{className:Rn[e.type],children:e.text},t))})})]})}var Vn=/\[\[([a-z]+):([^\]\n]{1,120})\]\]/g;function Hn(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 Un(e,t=null){return String(e||``).replace(Vn,(e,n,r)=>t&&t(n,r)||Hn(n,r))}function Wn(e,t=null){return Un(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 Gn=/\[\[(comment|page|journey|check):([A-Za-z0-9][A-Za-z0-9:_./-]{0,119})\]\]/,Kn=e=>{let t=String(e||``).trim();return t.startsWith(`/`)?t.length>1?t.replace(/\/+$/,``):`/`:null};function qn({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=>Kn(e.path)).map(e=>[Kn(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 Jn(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(Kn(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(Kn(r));return n?{kind:t,id:n.id,target:n,count:e.checks.get(n.id)||0}:null}return null}function Yn(e,t){if(!e)return null;let n=String(t||``).trim();if(!n||n.length>160)return null;let r=Gn.exec(n);if(r&&r[0]===n)return Jn(e,r[1],r[2]);if(/^#\d{1,9}$/.test(n))return Jn(e,`comment`,n);if(n.startsWith(`/`))return n===`/`?null:Jn(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 Xn(e,t){let n=Kn(t);if(!e||!n||n===`/`)return null;let r=e.pagesByPath.get(n);return r?{kind:`page`,id:r.id,target:r}:null}function Zn(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(Jn(e,`comment`,r),`thread`);for(let t of n?.attachments||[]){let n=t.source;n&&(n.kind===`element`&&n.commentId?o(Jn(e,`comment`,n.commentId),`attached`):o(Jn(e,`page`,n.pageId),`attached`))}for(let n of t?.refs?.comments||[])o(Jn(e,`comment`,n),`read`);for(let n of t?.refs?.pages||[])o(Jn(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(Jn(e,`comment`,t[1]),`read`);return i.slice(0,12)}function Qn(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 $n=(e,t)=>e===`comment`&&/^\d+$/.test(t)?`#${t}`:t;function er(e,t,n){let r=Jn(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 tr=(e,t=null)=>Un(e,t?(e,n)=>er(t,e,n):null),nr=(e,t=null)=>Wn(e,t?(e,n)=>er(t,e,n):null);function rr(e,t=48){let n=String(e||``).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-1)}…`:n}var ir=(0,Q.createContext)(null),ar=()=>(0,Q.useContext)(ir),or={comment:De,page:ze,journey:J,check:tt},sr=450,cr={resolved:{tone:`ok`,text:`Resolved`},"needs-human":{tone:`warn`,text:`Needs a person`},done:{tone:`accent`,text:`Agent done`},"branch-ready":{tone:`warn`,text:`Fix ready on branch`}};function lr({item:e,refs:t}){if(e.kind===`comment`){let n=e.target,r=n.status===`resolved`?cr.resolved:cr[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)(H,{tone:r.tone,className:`ml-auto`,children:r.text}):null]}),(0,$.jsx)(`p`,{className:`line-clamp-4 text-ui break-words text-fg`,children:rr(re(n),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 ur={comment:`Open comment`,page:`Go to page`,journey:`Open journey`,check:`Open checks for`};function dr({item:e,children:t,className:n}){let r=ar(),[i,s]=(0,Q.useState)(!1),c=(0,Q.useRef)({timer:0,long:!1});if(!r?.onNavigate)return(0,$.jsx)(`span`,{className:n,children:t??Qn(e)});let l=or[e.kind],u=t??Qn(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)},sr))},p=()=>window.clearTimeout(c.current.timer),h=(0,$.jsxs)(`button`,{type:`button`,className:m(`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":`${ur[e.kind]} ${e.kind===`comment`?`#${e.target.id}`:Qn(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)(ue,{open:i,onOpenChange:s,children:[(0,$.jsx)(te,{asChild:!0,children:h}),(0,$.jsx)(ce,{className:`w-64 p-2.5`,side:`top`,onOpenAutoFocus:e=>e.preventDefault(),children:(0,$.jsx)(lr,{item:e,refs:r})})]}):(0,$.jsxs)(C,{open:i,onOpenChange:s,children:[(0,$.jsx)(a,{asChild:!0,children:h}),(0,$.jsx)(o,{className:`w-64 p-2.5`,side:`top`,children:(0,$.jsx)(lr,{item:e,refs:r})})]})}function fr({reply:e,request:t,commentId:n,text:r}){let i=ar(),a=(0,Q.useMemo)(()=>{if(!i?.index)return[];let a=String(r||``);return Zn(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)(dr,{item:e},`${e.kind}:${e.id}`))]})}function pr(e){try{let t=new URL(e);return[`http:`,`https:`,`mailto:`].includes(t.protocol)?t.href:null}catch{return null}}var mr=/(`+)([^`]|[^`][\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 hr(e,t=`i`,n=null){let r=[],i=0,a=0;for(let o of e.matchAll(mr)){o.index>i&&r.push(e.slice(i,o.index));let s=`${t}-${a++}`,c=e=>n?Yn(n,e):null;if(o[2]!==void 0){let e=c(o[2]);r.push(e?(0,$.jsx)(dr,{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)(dr,{item:e,children:o[3]??o[4]},s):(0,$.jsx)(`strong`,{children:hr(o[3]??o[4],s,n)},s))}else if(o[5]!==void 0)r.push((0,$.jsx)(`del`,{children:hr(o[5],s,n)},s));else if(o[6]!==void 0||o[7]!==void 0)r.push((0,$.jsx)(`em`,{children:hr(o[6]??o[7],s,n)},s));else if(o[8]!==void 0){let e=pr(o[9]);r.push(e?(0,$.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:`text-accent underline underline-offset-2`,children:hr(o[8],s)},s):(0,$.jsx)(Q.Fragment,{children:o[0]},s))}else if(o[10]!==void 0){let e=pr(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=Jn(n,o[11],o[12]);r.push(e?(0,$.jsx)(dr,{item:e},s):$n(o[11],o[12]))}else if(o[13]!==void 0){let e=Jn(n,`comment`,o[13]);r.push(e?(0,$.jsx)(dr,{item:e},s):o[0])}else if(o[14]!==void 0){let e=Xn(n,o[14]);r.push(e?(0,$.jsx)(dr,{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 gr=e=>/^\s*\|.*\|\s*$/.test(e),_r=e=>/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/.test(e),vr=e=>e.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim());function yr(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{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,R as r,Tn as i,_ as a,c as o,d as s,g as c,p as l,r as u,tn as d,u as f}from"./ui-zQpn-PdL.js";var p=e(i(),1);async function m(e,t,n={}){let r=await fetch(`api/buzz/boards/${encodeURIComponent(e)}/${t}`,{method:`POST`,credentials:`same-origin`,cache:`no-store`,headers:{"Content-Type":`application/json`,...d()},body:JSON.stringify(n)}),i=await r.json();if(!r.ok){let e=Error(i.error?.message||`The private Buzz gateway is unavailable.`);throw e.status=r.status,e.code=i.error?.code,e}return i}var h=12e3,g=e=>new TextEncoder().encode(e).length;function _(e,t){return!t&&e.status>=400&&e.status<500&&[`invalid_request`,`json_required`,`bad_origin`,`not_found`,`project_denied`,`target_denied`,`rate_limited`,`bridge_busy`,`bad_host`].includes(e.code)}var v=n();function y({open:e,onClose:n,boardId:i}){let[d,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(`codex`),[S,C]=(0,p.useState)(``),[w,T]=(0,p.useState)([]),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),P=d?.agents.find(e=>e.id===b),F=g(S),I=F>h;(0,p.useEffect)(()=>{if(!e)return;let t=!0;return m(i,`view`).then(e=>{t&&(y(e),k(null))}).catch(e=>{t&&k(e.message)}),()=>{t=!1}},[e,i]);async function L(){D(!0),k(null);try{let e=await m(i,`feed`);T(e.events),y(t=>({...t,receipts:e.receipts})),A&&N(e.receipts.find(e=>e.requestId===A.requestId)||M)}catch(e){k(e.message)}finally{D(!1)}}async function R(){if(!S.trim()&&!A)return;if(!A&&I){k(`This request is too long. Shorten it before sending.`);return}let e=!!A,t=A||{requestId:crypto.randomUUID(),target:b,text:S};j(t),D(!0),k(null);try{let e=await m(i,`dispatch`,t);N(e.receipt),y(n=>({...n,receipts:[...(n?.receipts||[]).filter(e=>e.requestId!==t.requestId),e.receipt]}))}catch(n){_(n,e)?(j(null),k(`${n.message} Nothing was sent. Edit the request and try again.`)):k(`${n.message} It may have been sent. Check Recent requests below before sending again. (request ${t.requestId})`)}finally{D(!1)}}let z=e=>d?.agents.find(t=>t.pubkey===e)?.name||`Owner`;return(0,v.jsx)(r,{open:e,onClose:E?()=>{}:n,title:`Existing Buzz conversation`,size:`md`,children:(0,v.jsxs)(`div`,{className:`space-y-4 p-5 text-sm`,"data-sw-buzz-dialog":!0,children:[(0,v.jsxs)(`p`,{className:`text-muted`,children:[`This posts to your shared Buzz channel `,d?`#${d.channel.name} `:``,`with your existing agents and sessions, so it can steer work already in progress. Replies are not tied to a Shapewall comment and don’t prove a fix is done.`]}),(0,v.jsx)(`p`,{className:`text-muted`,children:`After an agent changes source, recapture the board and check the result yourself. There is no Stop control here, and your Buzz permissions still apply.`}),O?(0,v.jsx)(`p`,{role:`alert`,className:`break-words text-bad`,children:O}):null,!d&&!O?(0,v.jsxs)(`p`,{children:[(0,v.jsx)(o,{}),` Loading private connection...`]}):null,d?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1`,children:[(0,v.jsx)(`label`,{htmlFor:`sw-buzz-agent`,className:`block font-medium`,children:`Existing agent`}),(0,v.jsxs)(f,{value:b,onValueChange:x,disabled:E||!!A,children:[(0,v.jsx)(c,{id:`sw-buzz-agent`,size:`touch`,className:`w-full`,"data-sw-buzz-agent":!0,children:(0,v.jsx)(a,{})}),(0,v.jsx)(s,{children:d.agents.map(e=>(0,v.jsx)(l,{value:e.id,children:e.name},e.id))})]})]}),P?(0,v.jsxs)(`div`,{className:`space-y-1 text-xs text-muted`,children:[(0,v.jsxs)(`p`,{children:[`Sends as `,P.name,`.`]}),(0,v.jsxs)(`details`,{children:[(0,v.jsx)(`summary`,{className:`cursor-pointer`,children:`Technical details`}),(0,v.jsxs)(`div`,{className:`mt-2 space-y-1 break-words`,children:[(0,v.jsxs)(`p`,{children:[`Target: `,P.name,` (`,(0,v.jsx)(`code`,{children:P.pubkey}),`). Transport signer: `,P.signer.name,` (`,(0,v.jsx)(`code`,{children:P.signer.pubkey}),`), using its existing owner-attested Buzz identity. The signed envelope identifies this as owner-supplied Shapewall text; the signer did not compose it.`]}),(0,v.jsxs)(`p`,{children:[`Source folder for this board: `,(0,v.jsx)(`code`,{children:d.sourceRoot}),`. It does not change or sandbox the agent’s working directory. Emails, code and mentions are sent as JSON escapes in the envelope.`]})]})]})]}):null,(0,v.jsxs)(`label`,{className:`block space-y-1 font-medium`,children:[`Request for the shared channel`,(0,v.jsx)(u,{rows:5,value:S,onChange:e=>C(e.target.value),disabled:E||!!A,maxLength:12e3,"aria-invalid":I||void 0,placeholder:`Describe the source change you want this existing agent to make.`})]}),I?(0,v.jsxs)(`p`,{role:`alert`,className:`text-bad`,children:[`This request uses `,F.toLocaleString(),` bytes; the limit is `,h.toLocaleString(),`. Shorten it before sending.`]}):null,(0,v.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Only `,P?.name||`the selected agent`,` is notified. Your text and this board’s source folder are sent to your private Buzz server.`]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,v.jsx)(t,{size:`touch`,variant:`default`,onClick:R,disabled:E||!A&&(!S.trim()||I),children:E?`Working...`:A?`Check this request receipt`:`Send to Buzz`}),(0,v.jsx)(t,{size:`touch`,onClick:L,disabled:E,children:`Refresh shared conversation`}),M?(0,v.jsx)(t,{size:`touch`,onClick:()=>{j(null),N(null),C(``)},disabled:E,children:`New request`}):null]}),(0,v.jsxs)(`section`,{"aria-label":`Recent requests`,className:`space-y-2`,children:[d.receipts?.length?(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted`,children:`Recent requests`}):null,(d.receipts||[]).slice(-5).reverse().map(e=>(0,v.jsxs)(`article`,{className:`space-y-1 rounded border border-line p-3`,"data-sw-buzz-receipt":e.status,children:[(0,v.jsx)(`p`,{className:`font-medium`,children:e.status===`sent`?`Sent to Buzz`:e.status===`not_sent`?`Not sent`:`Delivery unknown`}),(0,v.jsx)(`p`,{className:`text-xs text-muted`,children:e.message}),(0,v.jsxs)(`p`,{className:`break-all text-xs`,children:[`Request: `,e.requestId,e.eventId?` · Signed event: ${e.eventId}`:``]}),(0,v.jsxs)(`details`,{children:[(0,v.jsx)(`summary`,{className:`cursor-pointer text-xs`,children:`Exact transmitted envelope`}),(0,v.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words text-xs [overflow-wrap:anywhere]`,children:e.envelope})]})]},e.requestId))]}),(0,v.jsxs)(`section`,{"aria-label":`Verified shared Buzz messages`,className:`space-y-3`,children:[(0,v.jsx)(`p`,{className:`text-xs text-muted`,children:`Manual refresh shows a bounded recent view of signed owner and mapped-agent messages. It is not complete history or a per-request response stream.`}),w.map(e=>(0,v.jsxs)(`article`,{className:`rounded border border-line p-3`,"data-sw-buzz-event":!0,children:[(0,v.jsxs)(`p`,{className:`text-xs font-medium`,children:[z(e.pubkey),` · signature verified · `,new Date(e.createdAt*1e3).toLocaleString()]}),(0,v.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words font-sans text-sm [overflow-wrap:anywhere]`,children:e.content}),(0,v.jsxs)(`p`,{className:`mt-2 break-all text-xs text-faint`,children:[`Event: `,e.id]})]},e.id))]})]}):null]})})}export{y as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,R as r,Tn as i,_ as a,c as o,d as s,g as c,p as l,r as u,tn as d,u as f}from"./ui-2lMx-4bc.js";var p=e(i(),1);async function m(e,t,n={}){let r=await fetch(`api/buzz/boards/${encodeURIComponent(e)}/${t}`,{method:`POST`,credentials:`same-origin`,cache:`no-store`,headers:{"Content-Type":`application/json`,...d()},body:JSON.stringify(n)}),i=await r.json();if(!r.ok){let e=Error(i.error?.message||`The private Buzz gateway is unavailable.`);throw e.status=r.status,e.code=i.error?.code,e}return i}var h=12e3,g=e=>new TextEncoder().encode(e).length;function _(e,t){return!t&&e.status>=400&&e.status<500&&[`invalid_request`,`json_required`,`bad_origin`,`not_found`,`project_denied`,`target_denied`,`rate_limited`,`bridge_busy`,`bad_host`].includes(e.code)}var v=n();function y({open:e,onClose:n,boardId:i}){let[d,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(`codex`),[S,C]=(0,p.useState)(``),[w,T]=(0,p.useState)([]),[E,D]=(0,p.useState)(!1),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(null),[M,N]=(0,p.useState)(null),P=d?.agents.find(e=>e.id===b),F=g(S),I=F>h;(0,p.useEffect)(()=>{if(!e)return;let t=!0;return m(i,`view`).then(e=>{t&&(y(e),k(null))}).catch(e=>{t&&k(e.message)}),()=>{t=!1}},[e,i]);async function L(){D(!0),k(null);try{let e=await m(i,`feed`);T(e.events),y(t=>({...t,receipts:e.receipts})),A&&N(e.receipts.find(e=>e.requestId===A.requestId)||M)}catch(e){k(e.message)}finally{D(!1)}}async function R(){if(!S.trim()&&!A)return;if(!A&&I){k(`This request is too long. Shorten it before sending.`);return}let e=!!A,t=A||{requestId:crypto.randomUUID(),target:b,text:S};j(t),D(!0),k(null);try{let e=await m(i,`dispatch`,t);N(e.receipt),y(n=>({...n,receipts:[...(n?.receipts||[]).filter(e=>e.requestId!==t.requestId),e.receipt]}))}catch(n){_(n,e)?(j(null),k(`${n.message} Nothing was sent. Edit the request and try again.`)):k(`${n.message} It may have been sent. Check Recent requests below before sending again. (request ${t.requestId})`)}finally{D(!1)}}let z=e=>d?.agents.find(t=>t.pubkey===e)?.name||`Owner`;return(0,v.jsx)(r,{open:e,onClose:E?()=>{}:n,title:`Existing Buzz conversation`,size:`md`,children:(0,v.jsxs)(`div`,{className:`space-y-4 p-5 text-sm`,"data-sw-buzz-dialog":!0,children:[(0,v.jsxs)(`p`,{className:`text-muted`,children:[`This posts to your shared Buzz channel `,d?`#${d.channel.name} `:``,`with your existing agents and sessions, so it can steer work already in progress. Replies are not tied to a Shapewall comment and don’t prove a fix is done.`]}),(0,v.jsx)(`p`,{className:`text-muted`,children:`After an agent changes source, recapture the board and check the result yourself. There is no Stop control here, and your Buzz permissions still apply.`}),O?(0,v.jsx)(`p`,{role:`alert`,className:`break-words text-bad`,children:O}):null,!d&&!O?(0,v.jsxs)(`p`,{children:[(0,v.jsx)(o,{}),` Loading private connection...`]}):null,d?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`space-y-1`,children:[(0,v.jsx)(`label`,{htmlFor:`sw-buzz-agent`,className:`block font-medium`,children:`Existing agent`}),(0,v.jsxs)(f,{value:b,onValueChange:x,disabled:E||!!A,children:[(0,v.jsx)(c,{id:`sw-buzz-agent`,size:`touch`,className:`w-full`,"data-sw-buzz-agent":!0,children:(0,v.jsx)(a,{})}),(0,v.jsx)(s,{children:d.agents.map(e=>(0,v.jsx)(l,{value:e.id,children:e.name},e.id))})]})]}),P?(0,v.jsxs)(`div`,{className:`space-y-1 text-xs text-muted`,children:[(0,v.jsxs)(`p`,{children:[`Sends as `,P.name,`.`]}),(0,v.jsxs)(`details`,{children:[(0,v.jsx)(`summary`,{className:`cursor-pointer`,children:`Technical details`}),(0,v.jsxs)(`div`,{className:`mt-2 space-y-1 break-words`,children:[(0,v.jsxs)(`p`,{children:[`Target: `,P.name,` (`,(0,v.jsx)(`code`,{children:P.pubkey}),`). Transport signer: `,P.signer.name,` (`,(0,v.jsx)(`code`,{children:P.signer.pubkey}),`), using its existing owner-attested Buzz identity. The signed envelope identifies this as owner-supplied Shapewall text; the signer did not compose it.`]}),(0,v.jsxs)(`p`,{children:[`Source folder for this board: `,(0,v.jsx)(`code`,{children:d.sourceRoot}),`. It does not change or sandbox the agent’s working directory. Emails, code and mentions are sent as JSON escapes in the envelope.`]})]})]})]}):null,(0,v.jsxs)(`label`,{className:`block space-y-1 font-medium`,children:[`Request for the shared channel`,(0,v.jsx)(u,{rows:5,value:S,onChange:e=>C(e.target.value),disabled:E||!!A,maxLength:12e3,"aria-invalid":I||void 0,placeholder:`Describe the source change you want this existing agent to make.`})]}),I?(0,v.jsxs)(`p`,{role:`alert`,className:`text-bad`,children:[`This request uses `,F.toLocaleString(),` bytes; the limit is `,h.toLocaleString(),`. Shorten it before sending.`]}):null,(0,v.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Only `,P?.name||`the selected agent`,` is notified. Your text and this board’s source folder are sent to your private Buzz server.`]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,v.jsx)(t,{size:`touch`,variant:`default`,onClick:R,disabled:E||!A&&(!S.trim()||I),children:E?`Working...`:A?`Check this request receipt`:`Send to Buzz`}),(0,v.jsx)(t,{size:`touch`,onClick:L,disabled:E,children:`Refresh shared conversation`}),M?(0,v.jsx)(t,{size:`touch`,onClick:()=>{j(null),N(null),C(``)},disabled:E,children:`New request`}):null]}),(0,v.jsxs)(`section`,{"aria-label":`Recent requests`,className:`space-y-2`,children:[d.receipts?.length?(0,v.jsx)(`h3`,{className:`text-xs font-medium text-muted`,children:`Recent requests`}):null,(d.receipts||[]).slice(-5).reverse().map(e=>(0,v.jsxs)(`article`,{className:`space-y-1 rounded border border-line p-3`,"data-sw-buzz-receipt":e.status,children:[(0,v.jsx)(`p`,{className:`font-medium`,children:e.status===`sent`?`Sent to Buzz`:e.status===`not_sent`?`Not sent`:`Delivery unknown`}),(0,v.jsx)(`p`,{className:`text-xs text-muted`,children:e.message}),(0,v.jsxs)(`p`,{className:`break-all text-xs`,children:[`Request: `,e.requestId,e.eventId?` · Signed event: ${e.eventId}`:``]}),(0,v.jsxs)(`details`,{children:[(0,v.jsx)(`summary`,{className:`cursor-pointer text-xs`,children:`Exact transmitted envelope`}),(0,v.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words text-xs [overflow-wrap:anywhere]`,children:e.envelope})]})]},e.requestId))]}),(0,v.jsxs)(`section`,{"aria-label":`Verified shared Buzz messages`,className:`space-y-3`,children:[(0,v.jsx)(`p`,{className:`text-xs text-muted`,children:`Manual refresh shows a bounded recent view of signed owner and mapped-agent messages. It is not complete history or a per-request response stream.`}),w.map(e=>(0,v.jsxs)(`article`,{className:`rounded border border-line p-3`,"data-sw-buzz-event":!0,children:[(0,v.jsxs)(`p`,{className:`text-xs font-medium`,children:[z(e.pubkey),` · signature verified · `,new Date(e.createdAt*1e3).toLocaleString()]}),(0,v.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words font-sans text-sm [overflow-wrap:anywhere]`,children:e.content}),(0,v.jsxs)(`p`,{className:`mt-2 break-all text-xs text-faint`,children:[`Event: `,e.id]})]},e.id))]})]}):null]})})}export{y as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,Mt as r,Sn as i,Tn as a,V as o,_ as s,_n as c,a as l,c as u,d,g as f,i as p,n as m,o as h,p as g,s as _,t as v,tt as y,u as b,xn as ee,yn as te}from"./ui-zQpn-PdL.js";import{$ as x,B as S,R as C,W as w,Y as ne,at as T,et as E,it as D,j as re,ot as ie,t as ae,ut as oe}from"./index-uUZVBYUS.js";import{t as se}from"./refresh-cw-r_tZiFfB.js";import{n as O,t as k}from"./circle-x-CteRBtXC.js";import{t as A}from"./play-BjRNIGSf.js";var j={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`}]]};j.node;var M=i(j),N={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`}]]};N.node;var P=i(N),F={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`}]]};F.node;var I=i(F),L={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`}]]};L.node;var R=i(L),z=e(a(),1),ce={" ":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},B={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(B,{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 V={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(V,{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 le(e){return ce[e]===void 0?B[e]===void 0?V[e]===void 0?/[0-9]/.test(e)?556:e.codePointAt(0)>=11904?1e3:/\p{Lu}/u.test(e)?700:560:V[e]:B[e]:ce[e]}function ue(e,t){let n=0;for(let t of String(e||``))n+=le(t);return n*t/1e3}var H=Object.freeze({titleFont:20,titlePixels:580,titleMinChars:10,descriptionFont:14,descriptionPixels:920,descriptionMinChars:50}),de=e=>String(e||``).replace(/\s+/g,` `).trim();function fe(e,{size:t,pixels:n}){let r=de(e);if(ue(r,t)<=n)return{text:r,cut:!1};let i=n-ue(` ...`,t),a=0,o=0;for(let e of r){let n=a+le(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 U=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.`}}),pe={error:0,warning:1,tip:2};function W(e){let t=e?.category===`seo`?U[e.id]:null;return t?t.level===`tip`?`advisory`:`warning`:e?.severity}Object.freeze(Object.keys(U));function G(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=>de(e).toLowerCase();function he({views:e=[],pages:t=[],snapshots:n={},privatePages:r=[]}={}){let i=new Set(r),a=t.map(t=>{let r=G(e,t.id,`playwright`,e=>e.profile.seo),a=r||G(e,t.id,`playwright`),o=G(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=U[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:de(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,...U[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)=>pe[e.level]-pe[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=>W(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=W(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=n(),Ne={reliability:w,performance:P,accessibility:I,seo:R};function Pe({score:e,size:t=36,label:n}){let i=(t-5)/2,a=2*Math.PI*i;return(0,Q.jsxs)(`span`,{className:r(`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:i,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`3.5`}),e===null?null:(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r:i,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeDasharray:`${a*e/100} ${a}`})]}),(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 i=Ne[e.id],a=e.warnings,o=t===e.id;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>n(e.id),"data-sw-checks-tile":e.id,className:r(`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`,o?`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)(i,{size:13,"aria-hidden":`true`}),e.label]}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-[15px] leading-5 font-semibold`,children:a?(0,Q.jsxs)(`span`,{className:e.id===`reliability`?`text-bad`:`text-warn`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:a}),` 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:k,tone:`text-bad`,label:`Blocks search or sharing`},warning:{icon:C,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,z.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)(R,{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,z.useState)(`all`),f=(0,z.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)(v,{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,i=e.pages?Math.round(n/Math.max(1,e.pages)*100):0,a=e.duplicateTitles+e.duplicateDescriptions,o=[[`Missing titles`,e.missingTitles,e.missingTitles?`bad`:`ok`],[`Missing descriptions`,e.missingDescriptions,e.missingDescriptions?`warn`:`ok`],[`Duplicate titles or descriptions`,a,a?`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:`${i}%`}}),(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:o.map(([e,n,i])=>(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:r(`size-1.5 shrink-0 rounded-full`,i===`ok`?`bg-ok`:i===`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)(y,{tone:`neutral`,children:`Private`}):t===`ready`?(0,Q.jsx)(y,{tone:`ok`,children:`No issues`}):t===`blocked`?(0,Q.jsx)(y,{tone:`bad`,children:`Not indexable`}):t===`work`?(0,Q.jsxs)(y,{tone:e.errors?`bad`:`warn`,children:[e.errors+e.warnings,` to fix`]}):t===`failed`?(0,Q.jsx)(y,{tone:`bad`,children:`Check failed`}):(0,Q.jsx)(y,{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)(y,{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)(M,{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)(p,{defaultValue:`search`,className:`px-3`,children:[(0,Q.jsxs)(h,{variant:`underline`,"aria-label":`${e.title} preview`,children:[(0,Q.jsx)(_,{value:`search`,children:`Google result`}),(0,Q.jsx)(_,{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)(O,{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)(R,{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)(R,{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,i=ge(We(e,t)),a=n.social.siteName||i.site,o=n.title?fe(n.title,{size:H.titleFont,pixels:H.titlePixels}):null,s=n.description?fe(n.description,{size:H.descriptionFont,pixels:H.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:(a||`?`).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:a||`Unknown site`}),(0,Q.jsxs)(`p`,{className:`truncate text-[#4d5156] [:root[data-mode=dark]_&]:text-[#bdc1c6] text-[11.5px]`,children:[i.origin,i.path.length?` › ${i.path.join(` › `)}`:``]})]})]}),(0,Q.jsx)(`p`,{className:r(`mt-2 font-[Arial,Helvetica,sans-serif] text-[#1a0dab] [:root[data-mode=dark]_&]:text-[#99c3ff] line-clamp-2 text-[18px] leading-6`,!o&&`italic opacity-70`),"data-sw-seo-serp-title":`true`,children:o?o.text:`No title: Google writes one from the page`}),(0,Q.jsx)(`p`,{className:r(`mt-1 font-[Arial,Helvetica,sans-serif] text-[#474747] [:root[data-mode=dark]_&]:text-[#bfbfbf] text-ui`,!s&&`italic`),"data-sw-seo-serp-description":`true`,children:s?s.text:`No description: Google picks text from the page, often a menu or banner.`}),o?.cut||s?.cut?(0,Q.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted`,children:[`Cut where Google’s desktop result is likely to cut it (`,o?.cut?`title`:``,o?.cut&&s?.cut?` and `:``,s?.cut?`description`:``,`).`]}):null]})}function Ke({row:e,page:t}){let{snapshot:n}=e,i=ge(We(e,t)),a=n.social.title||n.title,o=n.social.description||n.description,s=[!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)(ie,{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:i.site||`unknown site`}),(0,Q.jsx)(`p`,{className:r(`line-clamp-2 text-sm leading-5 font-semibold`,!a&&`text-muted italic`),children:a||`No title`}),o?(0,Q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-4 text-muted`,children:o}):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}`:``,s.length?` · using the ${s.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:i}){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:r(`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||i?(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)(x,{size:14,"aria-hidden":`true`}),` Comment`]}):null,i?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:i,"data-sw-seo-fix-agent":e.id,children:[(0,Q.jsx)(ee,{size:14,"aria-hidden":`true`}),` Fix with agent`]}):null]}):null]})}function Je({control:e,pages:n,pageId:i,tab:a}){let[o,s]=(0,z.useState)(!1),[c,l]=(0,z.useState)(i?`page`:`all`),[d,f]=(0,z.useState)(!0);if(!e||e.loading)return null;let{run:p}=e,h=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 ${h(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)(S,{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)(E,{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=c===`page`&&i?n.filter(e=>e.id===i):n,_=g.reduce((e,t)=>e+(t.viewports?.length||1),0),y=g.filter(t=>e.privatePages.includes(t.id)).length,b=p&&p.state!==`running`?p:null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-checks-run":`true`,children:[b&&!o?(0,Q.jsx)(Ye,{run:b}):null,e.error?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:e.error}):null,o?(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:[i?(0,Q.jsx)(v,{label:`Pages to check`,value:c,onChange:l,variant:`underline`,options:[{id:`page`,label:h(i)},{id:`all`,label:`All ${n.length} pages`}]}):null,(0,Q.jsxs)(m,{pressed:d,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":d?`on`:`off`,children:[(0,Q.jsx)(`span`,{className:r(`grid size-4 shrink-0 place-items-center rounded border`,d?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`),"aria-hidden":`true`,children:d?(0,Q.jsx)(O,{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.`,y?` ${y} private page${y===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:()=>s(!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:c===`page`&&i?[i]:null,seo:d})&&s(!1)},"data-sw-checks-run-start":`true`,children:[e.starting?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(A,{size:14,"aria-hidden":`true`}),` Start checks`]})]})]}):(0,Q.jsxs)(t,{size:`xs`,variant:a===`seo`?`default`:`secondary`,className:`h-11 w-full lg:h-8`,onClick:()=>{l(i?`page`:`all`),f(e.seoDefault!==!1),s(!0)},"data-sw-checks-run-open":`true`,children:[(0,Q.jsx)(A,{size:14,"aria-hidden":`true`}),` `,b?`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`?O:t===`warn`?C:k;return(0,Q.jsxs)(`p`,{className:r(`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:r(`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:i,...a}){let[o,s]=(0,z.useState)(n),c=(0,z.useId)();return(0,Q.jsxs)(`div`,{className:r(`text-xs`,i),...a,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":o,"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)(te,{size:14,className:r(`shrink-0 transition-transform`,o?`rotate-0`:`-rotate-90`),"aria-hidden":`true`}),e]}),o?(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,z.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)(b,{value:a.key,onValueChange:i,children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`History page and runner`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:n.map(e=>(0,Q.jsxs)(g,{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,z.useState)(null),[r,i]=(0,z.useState)(`none`),[a,o]=(0,z.useState)(!1),c=e.history,l=c.find(e=>e.id===t)||e.report,u=c.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:[c.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)(b,{value:l.id,onValueChange:e=>{n(e),i(`none`)},children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`After report`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:c.map(e=>(0,Q.jsx)(g,{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)(b,{value:r,onValueChange:i,children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`Before report`,children:(0,Q.jsx)(s,{placeholder:`Choose a baseline`})}),(0,Q.jsxs)(d,{children:[(0,Q.jsx)(g,{value:`none`,children:`Choose a baseline`}),c.filter(e=>e.id!==l.id).map(e=>(0,Q.jsx)(g,{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:W(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)(m,{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)(O,{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)(C,{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)(T,{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:i,onDraft:a,canComment:o,onSeo:s}){let{finding:c}=e,l=e.severity===`warning`,u=l?e.category===`reliability`?k:C:T;return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-line bg-surface p-2.5 shadow-card`,"data-sw-check-finding":c.id,"data-sw-check-issue":e.key,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(u,{size:16,className:r(`mt-0.5 shrink-0`,l?e.category===`reliability`?`text-bad`:`text-warn`:`text-muted`),"aria-label":l?`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)(y,{tone:`neutral`,shape:`tag`,children:e.category})]}),(0,Q.jsx)(`h4`,{className:`text-sm leading-5 font-medium`,children:c.title}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:c.observation}),(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:c.nextAction})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[e.category===`seo`&&s?(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>s(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:()=>i(e.pageId,e.viewports[0]),children:`View page`}),o&&e.canvasCapture?(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:()=>a(e.view,e.report,c),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)(y,{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)(y,{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,i]=(0,z.useState)(`lcp`),a=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),o=e=>e.run?.report.metrics.largestContentfulPaintMs??-1,s=e=>e.run?.report.metrics.lighthouseLabScore??101;return a.sort((e,t)=>n===`lcp`?o(t)-o(e):s(e)-s(t)),(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-performance":`true`,children:[(0,Q.jsx)(v,{label:`Performance order`,value:n,onChange:i,variant:`underline`,options:[{id:`lcp`,label:`Slowest LCP first`},{id:`score`,label:`Lowest score first`}]}),a.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)(P,{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.`})]}),a.map(({view:e,run:n,load:i})=>{let a=n?.report,o=a?.metrics||{},s=t.find(t=>t.id===e.pageId)?.title||e.pageId,c=a?ct(a):[];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:a?o.lighthouseLabScore??null:null,size:40,label:a?`Lighthouse score ${o.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:s}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[X(e.viewport),n?.state===`stale`?` · stale`:``,i?` · load ${Z(`loadMs`,i.report.metrics.loadMs??null)}`:``]})]})]}),a?(0,Q.jsx)(`dl`,{className:`grid grid-cols-3 gap-2`,children:lt.map(([e,t,n,i])=>(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:r(`text-sm font-semibold tabular`,ut(o[e],n,i)),children:Z(e,o[e]??null)})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`No Lighthouse audit for this view yet.`}),c.length?(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Recorded performance budgets`,children:c.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:r(`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:r(`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,z.useRef)(null),[t,n]=(0,z.useState)({start:!1,end:!1}),r=(0,z.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,z.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:n,loading:r,pages:i,pageId:a,viewport:u,onSelect:m,onClose:y,onRefresh:ee,onEnvironment:te,onView:x,onDraft:S,canComment:C,command:w,local:ne,tab:T=`issues`,onTab:E=()=>{},seo:D=null,run:ie=null}){let[O,k]=(0,z.useState)(`all`),[A,j]=(0,z.useState)(`all`),M=(0,z.useMemo)(()=>Se((e?.views||[]).filter(e=>(!a||e.pageId===a)&&(!u||e.viewport===u)&&(O===`all`||e.viewport===O))),[e,a,u,O]),N=(0,z.useMemo)(()=>Ee(M),[M]),P=(0,z.useMemo)(()=>he({views:M,pages:i.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:D?.snapshots||{},privatePages:D?.privatePages||[]}).summary,[M,i,D]),F=(0,z.useMemo)(()=>ke(M,N).map(e=>e.id===`seo`?{...e,warnings:P.errors+P.warnings,advisories:P.tips,unchecked:!P.checked}:e),[M,N,P]),I=[...new Set((e?.views||[]).map(e=>e.viewport))],L=pt();(0,z.useEffect)(()=>{let e=L.ref.current,t=e?.querySelector(`[data-sw-checks-tab="${T}"]`);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:ae()})},[T,L.ref]);let R=i.find(e=>e.id===a),ce=e=>{if(e===`seo`)return E(`seo`);j(t=>t===e&&T===`issues`?`all`:e),E(`issues`)},B=(e,t,{fix:n})=>S({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}`}),V=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)(re,{icon:oe,title:`Checks`,onClose:y,closeLabel:`Close checks`,children:(0,Q.jsx)(o,{className:`ml-auto`,label:`Refresh checks`,onClick:ee,children:(0,Q.jsx)(se,{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:[R?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 max-w-full lg:h-7`,onClick:()=>m(null,null),children:[(0,Q.jsxs)(`span`,{className:`truncate`,children:[`This page: `,R.title]}),(0,Q.jsx)(c,{size:13,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Show all pages`})]}):null,e?.environments?.length>1&&te?(0,Q.jsxs)(b,{value:e.environment,onValueChange:te,children:[(0,Q.jsx)(f,{className:`h-11 min-w-0 flex-1 lg:h-7`,"aria-label":`Checks environment`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:e.environments.map(e=>(0,Q.jsxs)(g,{value:e.id,children:[e.id,e.captured?` · canvas capture`:` · diagnostics`]},e.id))})]}):null,I.length>1?(0,Q.jsx)(v,{label:`Checks screen size`,value:O,onChange:k,variant:`underline`,className:`w-full basis-full`,options:[{id:`all`,label:`All`},...I.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:ee,children:(0,Q.jsx)(se,{size:15})})]}),r?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted`,children:`Loading checks…`}):null,n?(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:F,active:T===`seo`?`seo`:A,onPick:ce}):null,(0,Q.jsx)(Je,{control:ie,pages:i,pageId:a,tab:T}),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`,V?` · ${V}`:``]}):null]}),(0,Q.jsxs)(p,{value:T,onValueChange:E,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)(h,{variant:`underline`,ref:L.ref,onScroll:L.measure,style:L.style,"aria-label":`Checks view`,"data-sw-checks-tabs-more":L.edges.start&&L.edges.end?`both`:L.edges.end?`end`:L.edges.start?`start`:`none`,children:ft.map(([e,t])=>(0,Q.jsxs)(_,{value:e,"data-sw-checks-tab":e,children:[t,e===`issues`&&N.some(e=>e.severity===`warning`)?(0,Q.jsx)(`span`,{className:`ml-1 text-faint tabular`,children:N.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:N,pages:i,category:A,onCategory:j,onView:x,onDraft:S,canComment:C,onSeo:e=>{E(`seo`),e&&e!==a&&m(e,null)}})}),(0,Q.jsx)(l,{value:`pages`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(at,{views:M,pages:i,onView:x})}),(0,Q.jsx)(l,{value:`seo`,children:(0,Q.jsx)(ze,{data:e,seo:D,pages:i,pageId:a,local:ne,canComment:C,canFix:!0,onIssue:B,onView:x,command:w})}),(0,Q.jsx)(l,{value:`performance`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(dt,{views:M,pages:i})}),(0,Q.jsx)(l,{value:`history`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(Qe,{views:M,pages:i})})]})]}),(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:ie?.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.`}),w?(0,Q.jsx)(`code`,{className:`block rounded bg-surface-2 p-2 break-all text-fg`,children:w}):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{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,Mt as r,Sn as i,Tn as a,V as o,_ as s,_n as c,a as l,c as u,d,g as f,i as p,n as m,o as h,p as g,s as _,t as v,tt as y,u as b,xn as ee,yn as te}from"./ui-2lMx-4bc.js";import{$ as x,B as S,R as C,W as w,Y as ne,at as T,et as E,it as D,j as re,ot as ie,t as ae,ut as oe}from"./index-CQeHY7en.js";import{t as se}from"./refresh-cw-B-npxKae.js";import{n as O,t as k}from"./circle-x-D5MkDLJk.js";import{t as A}from"./play--xrZ7VCR.js";var j={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`}]]};j.node;var M=i(j),N={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`}]]};N.node;var P=i(N),F={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`}]]};F.node;var I=i(F),L={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`}]]};L.node;var R=i(L),z=e(a(),1),ce={" ":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},B={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(B,{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 V={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(V,{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 le(e){return ce[e]===void 0?B[e]===void 0?V[e]===void 0?/[0-9]/.test(e)?556:e.codePointAt(0)>=11904?1e3:/\p{Lu}/u.test(e)?700:560:V[e]:B[e]:ce[e]}function ue(e,t){let n=0;for(let t of String(e||``))n+=le(t);return n*t/1e3}var H=Object.freeze({titleFont:20,titlePixels:580,titleMinChars:10,descriptionFont:14,descriptionPixels:920,descriptionMinChars:50}),de=e=>String(e||``).replace(/\s+/g,` `).trim();function fe(e,{size:t,pixels:n}){let r=de(e);if(ue(r,t)<=n)return{text:r,cut:!1};let i=n-ue(` ...`,t),a=0,o=0;for(let e of r){let n=a+le(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 U=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.`}}),pe={error:0,warning:1,tip:2};function W(e){let t=e?.category===`seo`?U[e.id]:null;return t?t.level===`tip`?`advisory`:`warning`:e?.severity}Object.freeze(Object.keys(U));function G(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=>de(e).toLowerCase();function he({views:e=[],pages:t=[],snapshots:n={},privatePages:r=[]}={}){let i=new Set(r),a=t.map(t=>{let r=G(e,t.id,`playwright`,e=>e.profile.seo),a=r||G(e,t.id,`playwright`),o=G(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=U[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:de(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,...U[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)=>pe[e.level]-pe[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=>W(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=W(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=n(),Ne={reliability:w,performance:P,accessibility:I,seo:R};function Pe({score:e,size:t=36,label:n}){let i=(t-5)/2,a=2*Math.PI*i;return(0,Q.jsxs)(`span`,{className:r(`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:i,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`3.5`}),e===null?null:(0,Q.jsx)(`circle`,{cx:t/2,cy:t/2,r:i,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeDasharray:`${a*e/100} ${a}`})]}),(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 i=Ne[e.id],a=e.warnings,o=t===e.id;return(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>n(e.id),"data-sw-checks-tile":e.id,className:r(`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`,o?`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)(i,{size:13,"aria-hidden":`true`}),e.label]}),(0,Q.jsx)(`span`,{className:`mt-0.5 block text-[15px] leading-5 font-semibold`,children:a?(0,Q.jsxs)(`span`,{className:e.id===`reliability`?`text-bad`:`text-warn`,children:[(0,Q.jsx)(`span`,{className:`tabular`,children:a}),` 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:k,tone:`text-bad`,label:`Blocks search or sharing`},warning:{icon:C,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,z.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)(R,{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,z.useState)(`all`),f=(0,z.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)(v,{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,i=e.pages?Math.round(n/Math.max(1,e.pages)*100):0,a=e.duplicateTitles+e.duplicateDescriptions,o=[[`Missing titles`,e.missingTitles,e.missingTitles?`bad`:`ok`],[`Missing descriptions`,e.missingDescriptions,e.missingDescriptions?`warn`:`ok`],[`Duplicate titles or descriptions`,a,a?`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:`${i}%`}}),(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:o.map(([e,n,i])=>(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:r(`size-1.5 shrink-0 rounded-full`,i===`ok`?`bg-ok`:i===`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)(y,{tone:`neutral`,children:`Private`}):t===`ready`?(0,Q.jsx)(y,{tone:`ok`,children:`No issues`}):t===`blocked`?(0,Q.jsx)(y,{tone:`bad`,children:`Not indexable`}):t===`work`?(0,Q.jsxs)(y,{tone:e.errors?`bad`:`warn`,children:[e.errors+e.warnings,` to fix`]}):t===`failed`?(0,Q.jsx)(y,{tone:`bad`,children:`Check failed`}):(0,Q.jsx)(y,{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)(y,{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)(M,{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)(p,{defaultValue:`search`,className:`px-3`,children:[(0,Q.jsxs)(h,{variant:`underline`,"aria-label":`${e.title} preview`,children:[(0,Q.jsx)(_,{value:`search`,children:`Google result`}),(0,Q.jsx)(_,{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)(O,{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)(R,{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)(R,{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,i=ge(We(e,t)),a=n.social.siteName||i.site,o=n.title?fe(n.title,{size:H.titleFont,pixels:H.titlePixels}):null,s=n.description?fe(n.description,{size:H.descriptionFont,pixels:H.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:(a||`?`).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:a||`Unknown site`}),(0,Q.jsxs)(`p`,{className:`truncate text-[#4d5156] [:root[data-mode=dark]_&]:text-[#bdc1c6] text-[11.5px]`,children:[i.origin,i.path.length?` › ${i.path.join(` › `)}`:``]})]})]}),(0,Q.jsx)(`p`,{className:r(`mt-2 font-[Arial,Helvetica,sans-serif] text-[#1a0dab] [:root[data-mode=dark]_&]:text-[#99c3ff] line-clamp-2 text-[18px] leading-6`,!o&&`italic opacity-70`),"data-sw-seo-serp-title":`true`,children:o?o.text:`No title: Google writes one from the page`}),(0,Q.jsx)(`p`,{className:r(`mt-1 font-[Arial,Helvetica,sans-serif] text-[#474747] [:root[data-mode=dark]_&]:text-[#bfbfbf] text-ui`,!s&&`italic`),"data-sw-seo-serp-description":`true`,children:s?s.text:`No description: Google picks text from the page, often a menu or banner.`}),o?.cut||s?.cut?(0,Q.jsxs)(`p`,{className:`mt-2 text-[11px] text-muted`,children:[`Cut where Google’s desktop result is likely to cut it (`,o?.cut?`title`:``,o?.cut&&s?.cut?` and `:``,s?.cut?`description`:``,`).`]}):null]})}function Ke({row:e,page:t}){let{snapshot:n}=e,i=ge(We(e,t)),a=n.social.title||n.title,o=n.social.description||n.description,s=[!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)(ie,{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:i.site||`unknown site`}),(0,Q.jsx)(`p`,{className:r(`line-clamp-2 text-sm leading-5 font-semibold`,!a&&`text-muted italic`),children:a||`No title`}),o?(0,Q.jsx)(`p`,{className:`line-clamp-2 text-xs leading-4 text-muted`,children:o}):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}`:``,s.length?` · using the ${s.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:i}){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:r(`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||i?(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)(x,{size:14,"aria-hidden":`true`}),` Comment`]}):null,i?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:i,"data-sw-seo-fix-agent":e.id,children:[(0,Q.jsx)(ee,{size:14,"aria-hidden":`true`}),` Fix with agent`]}):null]}):null]})}function Je({control:e,pages:n,pageId:i,tab:a}){let[o,s]=(0,z.useState)(!1),[c,l]=(0,z.useState)(i?`page`:`all`),[d,f]=(0,z.useState)(!0);if(!e||e.loading)return null;let{run:p}=e,h=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 ${h(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)(S,{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)(E,{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=c===`page`&&i?n.filter(e=>e.id===i):n,_=g.reduce((e,t)=>e+(t.viewports?.length||1),0),y=g.filter(t=>e.privatePages.includes(t.id)).length,b=p&&p.state!==`running`?p:null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,"data-sw-checks-run":`true`,children:[b&&!o?(0,Q.jsx)(Ye,{run:b}):null,e.error?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-bad`,children:e.error}):null,o?(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:[i?(0,Q.jsx)(v,{label:`Pages to check`,value:c,onChange:l,variant:`underline`,options:[{id:`page`,label:h(i)},{id:`all`,label:`All ${n.length} pages`}]}):null,(0,Q.jsxs)(m,{pressed:d,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":d?`on`:`off`,children:[(0,Q.jsx)(`span`,{className:r(`grid size-4 shrink-0 place-items-center rounded border`,d?`border-accent bg-accent text-accent-fg`:`border-line bg-surface`),"aria-hidden":`true`,children:d?(0,Q.jsx)(O,{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.`,y?` ${y} private page${y===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:()=>s(!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:c===`page`&&i?[i]:null,seo:d})&&s(!1)},"data-sw-checks-run-start":`true`,children:[e.starting?(0,Q.jsx)(u,{size:13}):(0,Q.jsx)(A,{size:14,"aria-hidden":`true`}),` Start checks`]})]})]}):(0,Q.jsxs)(t,{size:`xs`,variant:a===`seo`?`default`:`secondary`,className:`h-11 w-full lg:h-8`,onClick:()=>{l(i?`page`:`all`),f(e.seoDefault!==!1),s(!0)},"data-sw-checks-run-open":`true`,children:[(0,Q.jsx)(A,{size:14,"aria-hidden":`true`}),` `,b?`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`?O:t===`warn`?C:k;return(0,Q.jsxs)(`p`,{className:r(`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:r(`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:i,...a}){let[o,s]=(0,z.useState)(n),c=(0,z.useId)();return(0,Q.jsxs)(`div`,{className:r(`text-xs`,i),...a,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":o,"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)(te,{size:14,className:r(`shrink-0 transition-transform`,o?`rotate-0`:`-rotate-90`),"aria-hidden":`true`}),e]}),o?(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,z.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)(b,{value:a.key,onValueChange:i,children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`History page and runner`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:n.map(e=>(0,Q.jsxs)(g,{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,z.useState)(null),[r,i]=(0,z.useState)(`none`),[a,o]=(0,z.useState)(!1),c=e.history,l=c.find(e=>e.id===t)||e.report,u=c.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:[c.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)(b,{value:l.id,onValueChange:e=>{n(e),i(`none`)},children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`After report`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:c.map(e=>(0,Q.jsx)(g,{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)(b,{value:r,onValueChange:i,children:[(0,Q.jsx)(f,{className:`h-11 w-full lg:h-8`,"aria-label":`Before report`,children:(0,Q.jsx)(s,{placeholder:`Choose a baseline`})}),(0,Q.jsxs)(d,{children:[(0,Q.jsx)(g,{value:`none`,children:`Choose a baseline`}),c.filter(e=>e.id!==l.id).map(e=>(0,Q.jsx)(g,{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:W(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)(m,{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)(O,{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)(C,{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)(T,{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:i,onDraft:a,canComment:o,onSeo:s}){let{finding:c}=e,l=e.severity===`warning`,u=l?e.category===`reliability`?k:C:T;return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-line bg-surface p-2.5 shadow-card`,"data-sw-check-finding":c.id,"data-sw-check-issue":e.key,children:[(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(u,{size:16,className:r(`mt-0.5 shrink-0`,l?e.category===`reliability`?`text-bad`:`text-warn`:`text-muted`),"aria-label":l?`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)(y,{tone:`neutral`,shape:`tag`,children:e.category})]}),(0,Q.jsx)(`h4`,{className:`text-sm leading-5 font-medium`,children:c.title}),(0,Q.jsx)(`p`,{className:`text-xs leading-4 text-muted`,children:c.observation}),(0,Q.jsx)(`p`,{className:`text-xs leading-4`,children:c.nextAction})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:[e.category===`seo`&&s?(0,Q.jsx)(t,{size:`xs`,variant:`ghost`,className:`h-11 lg:h-7`,onClick:()=>s(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:()=>i(e.pageId,e.viewports[0]),children:`View page`}),o&&e.canvasCapture?(0,Q.jsx)(t,{size:`xs`,variant:`secondary`,className:`h-11 lg:h-7`,onClick:()=>a(e.view,e.report,c),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)(y,{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)(y,{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,i]=(0,z.useState)(`lcp`),a=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),o=e=>e.run?.report.metrics.largestContentfulPaintMs??-1,s=e=>e.run?.report.metrics.lighthouseLabScore??101;return a.sort((e,t)=>n===`lcp`?o(t)-o(e):s(e)-s(t)),(0,Q.jsxs)(`div`,{className:`space-y-3`,"data-sw-checks-performance":`true`,children:[(0,Q.jsx)(v,{label:`Performance order`,value:n,onChange:i,variant:`underline`,options:[{id:`lcp`,label:`Slowest LCP first`},{id:`score`,label:`Lowest score first`}]}),a.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)(P,{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.`})]}),a.map(({view:e,run:n,load:i})=>{let a=n?.report,o=a?.metrics||{},s=t.find(t=>t.id===e.pageId)?.title||e.pageId,c=a?ct(a):[];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:a?o.lighthouseLabScore??null:null,size:40,label:a?`Lighthouse score ${o.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:s}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted`,children:[X(e.viewport),n?.state===`stale`?` · stale`:``,i?` · load ${Z(`loadMs`,i.report.metrics.loadMs??null)}`:``]})]})]}),a?(0,Q.jsx)(`dl`,{className:`grid grid-cols-3 gap-2`,children:lt.map(([e,t,n,i])=>(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:r(`text-sm font-semibold tabular`,ut(o[e],n,i)),children:Z(e,o[e]??null)})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-muted`,children:`No Lighthouse audit for this view yet.`}),c.length?(0,Q.jsx)(`ul`,{className:`space-y-1.5`,"aria-label":`Recorded performance budgets`,children:c.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:r(`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:r(`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,z.useRef)(null),[t,n]=(0,z.useState)({start:!1,end:!1}),r=(0,z.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,z.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:n,loading:r,pages:i,pageId:a,viewport:u,onSelect:m,onClose:y,onRefresh:ee,onEnvironment:te,onView:x,onDraft:S,canComment:C,command:w,local:ne,tab:T=`issues`,onTab:E=()=>{},seo:D=null,run:ie=null}){let[O,k]=(0,z.useState)(`all`),[A,j]=(0,z.useState)(`all`),M=(0,z.useMemo)(()=>Se((e?.views||[]).filter(e=>(!a||e.pageId===a)&&(!u||e.viewport===u)&&(O===`all`||e.viewport===O))),[e,a,u,O]),N=(0,z.useMemo)(()=>Ee(M),[M]),P=(0,z.useMemo)(()=>he({views:M,pages:i.map(e=>({id:e.id,title:e.title,url:e.url})),snapshots:D?.snapshots||{},privatePages:D?.privatePages||[]}).summary,[M,i,D]),F=(0,z.useMemo)(()=>ke(M,N).map(e=>e.id===`seo`?{...e,warnings:P.errors+P.warnings,advisories:P.tips,unchecked:!P.checked}:e),[M,N,P]),I=[...new Set((e?.views||[]).map(e=>e.viewport))],L=pt();(0,z.useEffect)(()=>{let e=L.ref.current,t=e?.querySelector(`[data-sw-checks-tab="${T}"]`);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:ae()})},[T,L.ref]);let R=i.find(e=>e.id===a),ce=e=>{if(e===`seo`)return E(`seo`);j(t=>t===e&&T===`issues`?`all`:e),E(`issues`)},B=(e,t,{fix:n})=>S({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}`}),V=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)(re,{icon:oe,title:`Checks`,onClose:y,closeLabel:`Close checks`,children:(0,Q.jsx)(o,{className:`ml-auto`,label:`Refresh checks`,onClick:ee,children:(0,Q.jsx)(se,{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:[R?(0,Q.jsxs)(t,{size:`xs`,variant:`secondary`,className:`h-11 max-w-full lg:h-7`,onClick:()=>m(null,null),children:[(0,Q.jsxs)(`span`,{className:`truncate`,children:[`This page: `,R.title]}),(0,Q.jsx)(c,{size:13,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Show all pages`})]}):null,e?.environments?.length>1&&te?(0,Q.jsxs)(b,{value:e.environment,onValueChange:te,children:[(0,Q.jsx)(f,{className:`h-11 min-w-0 flex-1 lg:h-7`,"aria-label":`Checks environment`,children:(0,Q.jsx)(s,{})}),(0,Q.jsx)(d,{children:e.environments.map(e=>(0,Q.jsxs)(g,{value:e.id,children:[e.id,e.captured?` · canvas capture`:` · diagnostics`]},e.id))})]}):null,I.length>1?(0,Q.jsx)(v,{label:`Checks screen size`,value:O,onChange:k,variant:`underline`,className:`w-full basis-full`,options:[{id:`all`,label:`All`},...I.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:ee,children:(0,Q.jsx)(se,{size:15})})]}),r?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted`,children:`Loading checks…`}):null,n?(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:F,active:T===`seo`?`seo`:A,onPick:ce}):null,(0,Q.jsx)(Je,{control:ie,pages:i,pageId:a,tab:T}),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`,V?` · ${V}`:``]}):null]}),(0,Q.jsxs)(p,{value:T,onValueChange:E,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)(h,{variant:`underline`,ref:L.ref,onScroll:L.measure,style:L.style,"aria-label":`Checks view`,"data-sw-checks-tabs-more":L.edges.start&&L.edges.end?`both`:L.edges.end?`end`:L.edges.start?`start`:`none`,children:ft.map(([e,t])=>(0,Q.jsxs)(_,{value:e,"data-sw-checks-tab":e,children:[t,e===`issues`&&N.some(e=>e.severity===`warning`)?(0,Q.jsx)(`span`,{className:`ml-1 text-faint tabular`,children:N.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:N,pages:i,category:A,onCategory:j,onView:x,onDraft:S,canComment:C,onSeo:e=>{E(`seo`),e&&e!==a&&m(e,null)}})}),(0,Q.jsx)(l,{value:`pages`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(at,{views:M,pages:i,onView:x})}),(0,Q.jsx)(l,{value:`seo`,children:(0,Q.jsx)(ze,{data:e,seo:D,pages:i,pageId:a,local:ne,canComment:C,canFix:!0,onIssue:B,onView:x,command:w})}),(0,Q.jsx)(l,{value:`performance`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(dt,{views:M,pages:i})}),(0,Q.jsx)(l,{value:`history`,className:`sw-gutter-pad p-3`,children:(0,Q.jsx)(Qe,{views:M,pages:i})})]})]}),(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:ie?.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.`}),w?(0,Q.jsx)(`code`,{className:`block rounded bg-surface-2 p-2 break-all text-fg`,children:w}):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{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,Lt as r,Mt as i,Nt as a,O as o,R as s,Tn as c,ln as l,n as u,nt as d,t as f,tt as p}from"./ui-zQpn-PdL.js";import{F as m,Q as h,V as g,Y as _,_ as v,ht as y,t as b,tt as x}from"./index-uUZVBYUS.js";var S=e(c(),1);function C(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(!w(e)||!w(t)||n&&!w(n)||h&&!w(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)se(n,r,e,s);return 0}let[b,x,S]=c,[C,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&&(T(e,o,s,r,i,_,v)||T(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,C,E,D)),M&&(M[a]=1,N<0&&(N=s),P=s),j++)}else n&&!m&&se(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 w(e){return ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1}function T(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=oe(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:E(a,y,b,r,i)&&E(o,y,b,r,i)||E(a,x,S,r,i)&&E(o,x,S,r,i)}function E(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 D=new Float64Array(257);for(let e=0;e<256;e++){let t=e/255;D[e]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}D[256]=D[255];var 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),I=new Float64Array(256);for(let e=0;e<256;e++){let t=D[e];O[e]=.4122214708*t,j[e]=.2119034982*t,P[e]=.0883024619*t,k[e]=.5363325363*t,M[e]=.6806995451*t,F[e]=.2817188376*t,A[e]=.0514459929*t,N[e]=.1073969566*t,I[e]=.6299787005*t}function L(e){let t=e|0;return D[t]+(D[t+1]-D[t])*(e-t)}var R=4096,z=new Float64Array(4098);for(let e=0;e<=4097;e++)z[e]=Math.cbrt(e/R);var B=8;function V(e){let t=e*R,n=t|0;return n<B?Math.cbrt(e):z[n]+(z[n+1]-z[n])*(t-n)}var H=20,U=4096,W=new Uint32Array(U),G=new Float64Array(U*4),ee=.206,te=.03,K=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)>>>H,l=s+1,u=c*4,d,f,p,m;W[c]===l?(d=G[u],f=G[u+1],p=G[u+2],m=G[u+3]):(d=V(O[e]+k[t]+A[n]),f=V(j[e]+M[t]+N[n]),p=V(P[e]+F[t]+I[n]),m=q(d,f,p),W[c]=l,G[u]=d,G[u+1]=f,G[u+2]=p,G[u+3]=m);let h=r<<16|i<<8|a,g=Math.imul(h,2654435761)>>>H,_=h+1,v=g*4,y,b,x,S;return W[g]===_?(y=G[v],b=G[v+1],x=G[v+2],S=G[v+3]):(y=V(O[r]+k[i]+A[a]),b=V(j[r]+M[i]+N[a]),x=V(P[r]+F[i]+I[a]),S=q(y,b,x),W[g]=_,G[v]=y,G[v+1]=b,G[v+2]=x,G[v+3]=S),ae(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=L(e),h=L(t),g=L(n),_=L(i),v=L(a),y=L(o),b=V(.4122214708*m+.5363325363*h+.0514459929*g),x=V(.2119034982*m+.6806995451*h+.1073969566*g),S=V(.0883024619*m+.2817188376*h+.6299787005*g),C=V(.4122214708*_+.5363325363*v+.0514459929*y),w=V(.2119034982*_+.6806995451*v+.1073969566*y),T=V(.0883024619*_+.2817188376*v+.6299787005*y);return ae(q(b,x,S)-q(C,w,T),b-C,x-w,S-T,u)}function ae(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=K*r-ee;return .5*(i+Math.sqrt(i*i+4*te*K*r))}function oe(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 se(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 ce=.1,Y=[239,68,68];function le(e,t,{threshold:n=ce}={}){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=C(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 ue=6,X=new Map;async function de(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 fe({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 pe(e,t){let n=`${e}\n${t}`;if(!X.has(n)){let r=Promise.all([de(e),de(t)]).then(async([e,t])=>{let n=le(e,t);return{percent:n.percent,changed:n.changed,url:n.changed?await fe(n):null}});for(r.catch(()=>X.delete(n)),X.set(n,r);X.size>ue;){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 me(e,t,n=!0){let r=n&&e&&t?`${e}\n${t}`:null,[i,a]=(0,S.useState)({key:null,status:`idle`});return(0,S.useEffect)(()=>{if(!r)return;let n=!0;return pe(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(r(e)).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`Unknown time`}function he(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 ge(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 _e(e){let t=e.status===`ok`&&e.changed?e.url:null,[n,r]=(0,S.useState)({url:null,at:null});return(0,S.useEffect)(()=>{if(!t)return;let e=!0;return ge(t).then(n=>e&&r({url:t,at:n})),()=>{e=!1}},[t]),t&&n.url===t?n.at:null}function ve(e,t){e&&t!==null&&e.scrollTo({top:Math.max(0,t*e.scrollHeight-48),behavior:b()})}var ye={phone:`max-w-[400px]`,tablet:`max-w-[600px]`};function be({label:e,entry:t,urlFor:n,page:r,viewport:o,diff:s=null,onImageError:c,paneRef:l,onScroll:u}){return(0,Z.jsxs)(`figure`,{className:i(`mx-auto w-full min-w-0 flex-1`,ye[o]),"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),` · `,a(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} ${o}, ${t.current?`current capture`:`captured ${Q(t.at)}`}`,className:`block w-full select-none`,draggable:!1,onError:c}),s?.url?(0,Z.jsx)(`img`,{src:s.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 xe=[{id:`split`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{size:13,"aria-hidden":`true`}),` Side by side`]})},{id:`slider`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g,{size:13,"aria-hidden":`true`}),` Slider`]})}],Se=[{id:`before`,label:`Earlier`},{id:`after`,label:`Current`},{id:`slider`,label:`Slider`}];function Ce({open:e,onClose:n,page:r,viewport:a,data:c,comments:g,urlFor:y,onPickComment:b,touch:C,onImageError:w}){let T=(0,S.useMemo)(()=>r?m({pageId:r.id,viewport:a,manifest:c?.manifest,captures:c?.captures,versions:c?.versions}):[],[c?.captures,c?.manifest,c?.versions,r,a]),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(C?`before`:`split`),A=`${r?.id}|${a}`,j=E?.key===A?E.version:null,M=T.find(e=>e.current)||T[0]||null,N=T.find(e=>e.version===j)||T.find(e=>e!==M)||null,[P,F]=(0,S.useState)(!0),I=me(N?y(N,!1):null,M?y(M,!1):null,P&&N!==M),L=_e(I);(0,S.useEffect)(()=>{e&&I.status===`error`&&w?.()},[I.status,w,e]);let R=e=>(g||[]).filter(t=>t.captureVersion===e),z=(0,S.useRef)({before:null,after:null,slider:null}),B=(0,S.useRef)(!1),V=(e,t)=>()=>{if(B.current)return;let n=z.current[e],r=z.current[t];n&&r&&(B.current=!0,r.scrollTop=n.scrollTop,window.requestAnimationFrame(()=>{B.current=!1}))},H=()=>{for(let e of Object.values(z.current))ve(e,L)},U=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(L===null||U.current===`${A}|${N?.version}|${L}`)return;U.current=`${A}|${N?.version}|${L}`;let e=window.setTimeout(()=>{for(let e of Object.values(z.current))ve(e,L)},150);return()=>window.clearTimeout(e)},[N?.version,L,A]);let W=P&&I.status===`ok`?I:null,G=O===`slider`;return(0,Z.jsx)(s,{open:e,onClose:n,title:r?`History: ${r.title}`:`History`,description:r?`${a} · ${T.length} capture${T.length===1?``:`s`} kept`:``,size:`lg`,children:(0,Z.jsx)(`div`,{className:`space-y-3 p-4`,"data-sw-history":A,children:T.length<2?(0,Z.jsx)(o,{icon:_,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:T.map((e,t)=>{let n=R(e.version).length,r=N?.version===e.version;return(0,Z.jsx)(`li`,{className:`shrink-0`,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:e.current,onClick:()=>D({key:A,version:e.version}),"aria-pressed":r,className:i(`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:y(e,!0),alt:``,className:`block w-full`,draggable:!1,loading:`lazy`,onError:w}),e.current?(0,Z.jsx)(p,{tone:`solid`,className:`absolute top-1 left-1 shadow-card`,children:`Current`}):r?(0,Z.jsx)(p,{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 ${T.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)(h,{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)(f,{label:`Compare`,large:C,value:O,onChange:k,className:C?`w-full`:``,itemClassName:`inline-flex items-center justify-center gap-1.5`,options:C?Se:xe}),(0,Z.jsx)(u,{size:C?`touch`:`sm`,pressed:P,onPressedChange:F,"data-sw-history-diff":P?`on`:`off`,children:`Highlight changes`}),P?(0,Z.jsx)(`span`,{className:`text-xs text-muted tabular`,role:`status`,"data-sw-history-diff-status":I.status,children:he(I)}):null,P&&L!==null?(0,Z.jsxs)(t,{size:C?`touch`:`sm`,variant:`ghost`,onClick:H,"data-sw-history-jump":`true`,children:[(0,Z.jsx)(x,{size:13,"aria-hidden":`true`}),` Jump to the change`]}):null]}),G&&N&&M?(0,Z.jsxs)(`figure`,{className:i(`mx-auto w-full min-w-0`,ye[a]),"data-sw-history-slider":`true`,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 text-[11px] text-faint`,children:[`Earlier `,Q(N.at),` on the left, current on the right. Drag the divider.`]}),(0,Z.jsx)(`div`,{ref:e=>{z.current.slider=e},className:`max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:(0,Z.jsx)(v,{label:`Earlier and current capture`,beforeLabel:`Earlier`,afterLabel:`Current`,before:(0,Z.jsx)(`img`,{src:y(N,!1),alt:`${r.title} ${a}, captured ${Q(N.at)}`,className:`block w-full select-none`,draggable:!1,onError:w}),after:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:y(M,!1),alt:`${r.title} ${a}, current capture`,className:`block w-full select-none`,draggable:!1,onError:w}),W?.url?(0,Z.jsx)(`img`,{src:W.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:[N&&(!C||O===`before`)?(0,Z.jsx)(be,{label:`Earlier`,entry:N,urlFor:y,page:r.title,viewport:a,onImageError:w,paneRef:e=>{z.current.before=e},onScroll:V(`before`,`after`)}):null,M&&(!C||O===`after`)?(0,Z.jsx)(be,{label:`Current`,entry:M,urlFor:y,page:r.title,viewport:a,diff:W,onImageError:w,paneRef:e=>{z.current.after=e},onScroll:V(`after`,`before`)}):null]}),N&&R(N.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:R(N.version).map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>b(e),className:i(`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`,C?`h-11`:`h-7`),"data-sw-history-comment":e.id,children:[(0,Z.jsx)(d,{className:e.status===`resolved`?`bg-ok text-ok-fg`:`bg-accent text-accent-fg`,children:e.id}),(0,Z.jsx)(`span`,{className:`truncate`,children:l(e)})]})},e.id))})]}):null]})})})}export{Ce as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,Lt as r,Mt as i,Nt as a,O as o,R as s,Tn as c,ln as l,n as u,nt as d,t as f,tt as p}from"./ui-2lMx-4bc.js";import{F as m,Q as h,V as g,Y as _,_ as v,ht as y,t as b,tt as x}from"./index-CQeHY7en.js";var S=e(c(),1);function C(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(!w(e)||!w(t)||n&&!w(n)||h&&!w(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)se(n,r,e,s);return 0}let[b,x,S]=c,[C,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&&(T(e,o,s,r,i,_,v)||T(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,C,E,D)),M&&(M[a]=1,N<0&&(N=s),P=s),j++)}else n&&!m&&se(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 w(e){return ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1}function T(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=oe(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:E(a,y,b,r,i)&&E(o,y,b,r,i)||E(a,x,S,r,i)&&E(o,x,S,r,i)}function E(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 D=new Float64Array(257);for(let e=0;e<256;e++){let t=e/255;D[e]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}D[256]=D[255];var 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),I=new Float64Array(256);for(let e=0;e<256;e++){let t=D[e];O[e]=.4122214708*t,j[e]=.2119034982*t,P[e]=.0883024619*t,k[e]=.5363325363*t,M[e]=.6806995451*t,F[e]=.2817188376*t,A[e]=.0514459929*t,N[e]=.1073969566*t,I[e]=.6299787005*t}function L(e){let t=e|0;return D[t]+(D[t+1]-D[t])*(e-t)}var R=4096,z=new Float64Array(4098);for(let e=0;e<=4097;e++)z[e]=Math.cbrt(e/R);var B=8;function V(e){let t=e*R,n=t|0;return n<B?Math.cbrt(e):z[n]+(z[n+1]-z[n])*(t-n)}var H=20,U=4096,W=new Uint32Array(U),G=new Float64Array(U*4),ee=.206,te=.03,K=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)>>>H,l=s+1,u=c*4,d,f,p,m;W[c]===l?(d=G[u],f=G[u+1],p=G[u+2],m=G[u+3]):(d=V(O[e]+k[t]+A[n]),f=V(j[e]+M[t]+N[n]),p=V(P[e]+F[t]+I[n]),m=q(d,f,p),W[c]=l,G[u]=d,G[u+1]=f,G[u+2]=p,G[u+3]=m);let h=r<<16|i<<8|a,g=Math.imul(h,2654435761)>>>H,_=h+1,v=g*4,y,b,x,S;return W[g]===_?(y=G[v],b=G[v+1],x=G[v+2],S=G[v+3]):(y=V(O[r]+k[i]+A[a]),b=V(j[r]+M[i]+N[a]),x=V(P[r]+F[i]+I[a]),S=q(y,b,x),W[g]=_,G[v]=y,G[v+1]=b,G[v+2]=x,G[v+3]=S),ae(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=L(e),h=L(t),g=L(n),_=L(i),v=L(a),y=L(o),b=V(.4122214708*m+.5363325363*h+.0514459929*g),x=V(.2119034982*m+.6806995451*h+.1073969566*g),S=V(.0883024619*m+.2817188376*h+.6299787005*g),C=V(.4122214708*_+.5363325363*v+.0514459929*y),w=V(.2119034982*_+.6806995451*v+.1073969566*y),T=V(.0883024619*_+.2817188376*v+.6299787005*y);return ae(q(b,x,S)-q(C,w,T),b-C,x-w,S-T,u)}function ae(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=K*r-ee;return .5*(i+Math.sqrt(i*i+4*te*K*r))}function oe(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 se(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 ce=.1,Y=[239,68,68];function le(e,t,{threshold:n=ce}={}){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=C(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 ue=6,X=new Map;async function de(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 fe({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 pe(e,t){let n=`${e}\n${t}`;if(!X.has(n)){let r=Promise.all([de(e),de(t)]).then(async([e,t])=>{let n=le(e,t);return{percent:n.percent,changed:n.changed,url:n.changed?await fe(n):null}});for(r.catch(()=>X.delete(n)),X.set(n,r);X.size>ue;){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 me(e,t,n=!0){let r=n&&e&&t?`${e}\n${t}`:null,[i,a]=(0,S.useState)({key:null,status:`idle`});return(0,S.useEffect)(()=>{if(!r)return;let n=!0;return pe(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(r(e)).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`Unknown time`}function he(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 ge(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 _e(e){let t=e.status===`ok`&&e.changed?e.url:null,[n,r]=(0,S.useState)({url:null,at:null});return(0,S.useEffect)(()=>{if(!t)return;let e=!0;return ge(t).then(n=>e&&r({url:t,at:n})),()=>{e=!1}},[t]),t&&n.url===t?n.at:null}function ve(e,t){e&&t!==null&&e.scrollTo({top:Math.max(0,t*e.scrollHeight-48),behavior:b()})}var ye={phone:`max-w-[400px]`,tablet:`max-w-[600px]`};function be({label:e,entry:t,urlFor:n,page:r,viewport:o,diff:s=null,onImageError:c,paneRef:l,onScroll:u}){return(0,Z.jsxs)(`figure`,{className:i(`mx-auto w-full min-w-0 flex-1`,ye[o]),"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),` · `,a(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} ${o}, ${t.current?`current capture`:`captured ${Q(t.at)}`}`,className:`block w-full select-none`,draggable:!1,onError:c}),s?.url?(0,Z.jsx)(`img`,{src:s.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 xe=[{id:`split`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{size:13,"aria-hidden":`true`}),` Side by side`]})},{id:`slider`,label:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g,{size:13,"aria-hidden":`true`}),` Slider`]})}],Se=[{id:`before`,label:`Earlier`},{id:`after`,label:`Current`},{id:`slider`,label:`Slider`}];function Ce({open:e,onClose:n,page:r,viewport:a,data:c,comments:g,urlFor:y,onPickComment:b,touch:C,onImageError:w}){let T=(0,S.useMemo)(()=>r?m({pageId:r.id,viewport:a,manifest:c?.manifest,captures:c?.captures,versions:c?.versions}):[],[c?.captures,c?.manifest,c?.versions,r,a]),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(C?`before`:`split`),A=`${r?.id}|${a}`,j=E?.key===A?E.version:null,M=T.find(e=>e.current)||T[0]||null,N=T.find(e=>e.version===j)||T.find(e=>e!==M)||null,[P,F]=(0,S.useState)(!0),I=me(N?y(N,!1):null,M?y(M,!1):null,P&&N!==M),L=_e(I);(0,S.useEffect)(()=>{e&&I.status===`error`&&w?.()},[I.status,w,e]);let R=e=>(g||[]).filter(t=>t.captureVersion===e),z=(0,S.useRef)({before:null,after:null,slider:null}),B=(0,S.useRef)(!1),V=(e,t)=>()=>{if(B.current)return;let n=z.current[e],r=z.current[t];n&&r&&(B.current=!0,r.scrollTop=n.scrollTop,window.requestAnimationFrame(()=>{B.current=!1}))},H=()=>{for(let e of Object.values(z.current))ve(e,L)},U=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(L===null||U.current===`${A}|${N?.version}|${L}`)return;U.current=`${A}|${N?.version}|${L}`;let e=window.setTimeout(()=>{for(let e of Object.values(z.current))ve(e,L)},150);return()=>window.clearTimeout(e)},[N?.version,L,A]);let W=P&&I.status===`ok`?I:null,G=O===`slider`;return(0,Z.jsx)(s,{open:e,onClose:n,title:r?`History: ${r.title}`:`History`,description:r?`${a} · ${T.length} capture${T.length===1?``:`s`} kept`:``,size:`lg`,children:(0,Z.jsx)(`div`,{className:`space-y-3 p-4`,"data-sw-history":A,children:T.length<2?(0,Z.jsx)(o,{icon:_,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:T.map((e,t)=>{let n=R(e.version).length,r=N?.version===e.version;return(0,Z.jsx)(`li`,{className:`shrink-0`,children:(0,Z.jsxs)(`button`,{type:`button`,disabled:e.current,onClick:()=>D({key:A,version:e.version}),"aria-pressed":r,className:i(`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:y(e,!0),alt:``,className:`block w-full`,draggable:!1,loading:`lazy`,onError:w}),e.current?(0,Z.jsx)(p,{tone:`solid`,className:`absolute top-1 left-1 shadow-card`,children:`Current`}):r?(0,Z.jsx)(p,{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 ${T.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)(h,{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)(f,{label:`Compare`,large:C,value:O,onChange:k,className:C?`w-full`:``,itemClassName:`inline-flex items-center justify-center gap-1.5`,options:C?Se:xe}),(0,Z.jsx)(u,{size:C?`touch`:`sm`,pressed:P,onPressedChange:F,"data-sw-history-diff":P?`on`:`off`,children:`Highlight changes`}),P?(0,Z.jsx)(`span`,{className:`text-xs text-muted tabular`,role:`status`,"data-sw-history-diff-status":I.status,children:he(I)}):null,P&&L!==null?(0,Z.jsxs)(t,{size:C?`touch`:`sm`,variant:`ghost`,onClick:H,"data-sw-history-jump":`true`,children:[(0,Z.jsx)(x,{size:13,"aria-hidden":`true`}),` Jump to the change`]}):null]}),G&&N&&M?(0,Z.jsxs)(`figure`,{className:i(`mx-auto w-full min-w-0`,ye[a]),"data-sw-history-slider":`true`,children:[(0,Z.jsxs)(`figcaption`,{className:`mb-1.5 text-[11px] text-faint`,children:[`Earlier `,Q(N.at),` on the left, current on the right. Drag the divider.`]}),(0,Z.jsx)(`div`,{ref:e=>{z.current.slider=e},className:`max-h-[52dvh] overflow-y-auto rounded-md border border-line bg-surface-2`,children:(0,Z.jsx)(v,{label:`Earlier and current capture`,beforeLabel:`Earlier`,afterLabel:`Current`,before:(0,Z.jsx)(`img`,{src:y(N,!1),alt:`${r.title} ${a}, captured ${Q(N.at)}`,className:`block w-full select-none`,draggable:!1,onError:w}),after:(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(`img`,{src:y(M,!1),alt:`${r.title} ${a}, current capture`,className:`block w-full select-none`,draggable:!1,onError:w}),W?.url?(0,Z.jsx)(`img`,{src:W.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:[N&&(!C||O===`before`)?(0,Z.jsx)(be,{label:`Earlier`,entry:N,urlFor:y,page:r.title,viewport:a,onImageError:w,paneRef:e=>{z.current.before=e},onScroll:V(`before`,`after`)}):null,M&&(!C||O===`after`)?(0,Z.jsx)(be,{label:`Current`,entry:M,urlFor:y,page:r.title,viewport:a,diff:W,onImageError:w,paneRef:e=>{z.current.after=e},onScroll:V(`after`,`before`)}):null]}),N&&R(N.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:R(N.version).map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>b(e),className:i(`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`,C?`h-11`:`h-7`),"data-sw-history-comment":e.id,children:[(0,Z.jsx)(d,{className:e.status===`resolved`?`bg-ok text-ok-fg`:`bg-accent text-accent-fg`,children:e.id}),(0,Z.jsx)(`span`,{className:`truncate`,children:l(e)})]})},e.id))})]}):null]})})})}export{Ce as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,R as r,Tn as i,a,i as o,o as s,s as c,t as l}from"./ui-zQpn-PdL.js";import{i as u,n as d,r as f}from"./index-uUZVBYUS.js";import{i as p,o as m}from"./QuickConnect-foLh2QUm.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{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{B as t,Cn as n,R as r,Tn as i,a,i as o,o as s,s as c,t as l}from"./ui-2lMx-4bc.js";import{i as u,n as d,r as f}from"./index-CQeHY7en.js";import{i as p,o as m}from"./QuickConnect-DlaijESK.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-foLh2QUm.js";import{Cn as t,zt as n}from"./ui-zQpn-PdL.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-DlaijESK.js";import{Cn as t,zt as n}from"./ui-2lMx-4bc.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};