railwatch 0.6.0 → 0.6.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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +42 -26
  3. data/CHANGELOG.md +28 -0
  4. data/README.md +40 -29
  5. data/app/jobs/railwatch/rollup_job.rb +3 -1
  6. data/app/models/railwatch/ingest/rollup_absorber.rb +1 -1
  7. data/docs/ai-and-mcp.md +9 -3
  8. data/docs/configuration.md +68 -27
  9. data/docs/embedded.md +76 -43
  10. data/docs/faq.md +22 -10
  11. data/docs/getting-started.md +116 -41
  12. data/docs/records.md +13 -10
  13. data/docs/replacing-nightwatch.md +16 -14
  14. data/docs/replacing-sentry.md +19 -10
  15. data/docs/security.md +24 -3
  16. data/docs/self-hosting.md +9 -1
  17. data/docs/testing.md +14 -4
  18. data/docs/troubleshooting.md +62 -23
  19. data/lib/generators/railwatch/install/install_generator.rb +5 -4
  20. data/lib/generators/railwatch/install/templates/initializer.rb.tt +2 -2
  21. data/lib/railwatch/version.rb +1 -1
  22. data/llms.txt +21 -18
  23. data/public/railwatch/assets/{app-layout-2xAKndVD.js → app-layout-Zc0v-hYh.js} +1 -1
  24. data/public/railwatch/assets/{app-wordmark-Bt6XqURo.js → app-wordmark-BA_60AVb.js} +1 -1
  25. data/public/railwatch/assets/{appearance-DyCfeh9o.js → appearance-CcfP9tZ7.js} +1 -1
  26. data/public/railwatch/assets/application-BrN3Sz94.css +1 -0
  27. data/public/railwatch/assets/{arrow-up-EmePsTKP.js → arrow-up-CLQ-7heQ.js} +1 -1
  28. data/public/railwatch/assets/{auth-layout-BuwogWMZ.js → auth-layout-C05gEBIQ.js} +1 -1
  29. data/public/railwatch/assets/{badge-Dv7I-ebP.js → badge-DRae8XwK.js} +1 -1
  30. data/public/railwatch/assets/{braces-iZ7MEfYP.js → braces-rSYydpLY.js} +1 -1
  31. data/public/railwatch/assets/{card-DqdEEKcJ.js → card-DPjFKfen.js} +1 -1
  32. data/public/railwatch/assets/{chart-C4k7Ub9W.js → chart-DWh7l8yM.js} +1 -1
  33. data/public/railwatch/assets/{chart-hover-2yZG3w2u.js → chart-hover-CfoZUY4J.js} +1 -1
  34. data/public/railwatch/assets/{chart-panel-CONkZcn9.js → chart-panel-CC49WTQL.js} +1 -1
  35. data/public/railwatch/assets/{checkbox-DKbThbxr.js → checkbox-DPkLUiwM.js} +1 -1
  36. data/public/railwatch/assets/{code-CYahYQHZ.js → code-CLmYS6FU.js} +1 -1
  37. data/public/railwatch/assets/{copy-block-CbJum9s8.js → copy-block-CGcXxp8J.js} +1 -1
  38. data/public/railwatch/assets/{copy-id-JmvLfkmx.js → copy-id-vBYHQwxg.js} +1 -1
  39. data/public/railwatch/assets/{cursor-load-more-C1ylbqqL.js → cursor-load-more-Ddwxe5dZ.js} +1 -1
  40. data/public/railwatch/assets/{data-table-CVKR2wkq.js → data-table-CzKTEE-O.js} +1 -1
  41. data/public/railwatch/assets/{edit-BwSEVrTG.js → edit-B1kmWkzd.js} +1 -1
  42. data/public/railwatch/assets/{edit-BXF5oNYA.js → edit-D9cx4pbG.js} +1 -1
  43. data/public/railwatch/assets/{edit-D5BRDwLT.js → edit-yv6j9p-V.js} +1 -1
  44. data/public/railwatch/assets/{empty-state-Bn48Gplm.js → empty-state-CW4wclK_.js} +1 -1
  45. data/public/railwatch/assets/{env-layout-CKLL8Ds7.js → env-layout-Kz7wks1x.js} +1 -1
  46. data/public/railwatch/assets/{execution-path-DWovhgLi.js → execution-path-FAuIzOXB.js} +1 -1
  47. data/public/railwatch/assets/{filter-bar-xcbJC93z.js → filter-bar-CJDjWFib.js} +1 -1
  48. data/public/railwatch/assets/{flamegraph-BNbNIuKT.js → flamegraph-EaGkP2NT.js} +1 -1
  49. data/public/railwatch/assets/{frames-Bk39xfJG.js → frames-zZuIaNH9.js} +1 -1
  50. data/public/railwatch/assets/{google-sign-in-button-B5as2ps1.js → google-sign-in-button-2_zgbgVy.js} +1 -1
  51. data/public/railwatch/assets/{index-XjXcV-EO.js → index-B49SWz7K.js} +1 -1
  52. data/public/railwatch/assets/{index-B0xgzHuN.js → index-BHlY4wKe.js} +1 -1
  53. data/public/railwatch/assets/{index-CiaeS-n7.js → index-BZpPtyFY.js} +1 -1
  54. data/public/railwatch/assets/{index-BfitxVBv.js → index-BeVK6jCL.js} +1 -1
  55. data/public/railwatch/assets/{index-C-EwH4lO.js → index-BfbSo01U.js} +1 -1
  56. data/public/railwatch/assets/{index-CrA7jBTK.js → index-BfgncAv6.js} +1 -1
  57. data/public/railwatch/assets/{index-D0mKj3Hg.js → index-BhNszK1k.js} +1 -1
  58. data/public/railwatch/assets/{index-CDXlITyG.js → index-Bu01uWvw.js} +1 -1
  59. data/public/railwatch/assets/{index-w_skgMmK.js → index-C1s_hK3p.js} +1 -1
  60. data/public/railwatch/assets/{index-Zkt4W_CM.js → index-C8Cggnbw.js} +1 -1
  61. data/public/railwatch/assets/{index-BDVShWMs.js → index-CBip6V4z.js} +1 -1
  62. data/public/railwatch/assets/{index-DeLtMWou.js → index-CMJGss5R.js} +1 -1
  63. data/public/railwatch/assets/{index-LKgpCzoR.js → index-CRo3yK20.js} +1 -1
  64. data/public/railwatch/assets/{index-gCvuyG1l.js → index-CWB_p2J8.js} +1 -1
  65. data/public/railwatch/assets/{index-C8JIdb3_.js → index-CWHpndGc.js} +1 -1
  66. data/public/railwatch/assets/{index-CBFCtJAR.js → index-Ca_S4Sc3.js} +1 -1
  67. data/public/railwatch/assets/{index-o1xqGvLo.js → index-CanPDDOa.js} +1 -1
  68. data/public/railwatch/assets/{index-Bd4YpOIO.js → index-Cie90Yat.js} +1 -1
  69. data/public/railwatch/assets/{index-C_hQmVTP.js → index-CiepQ_pR.js} +1 -1
  70. data/public/railwatch/assets/{index-BRvRkfob.js → index-Cm1uCIGN.js} +1 -1
  71. data/public/railwatch/assets/{index-dpG-19ZN.js → index-CzitnnSC.js} +1 -1
  72. data/public/railwatch/assets/{index-Vj93BTR5.js → index-DEUfClv3.js} +1 -1
  73. data/public/railwatch/assets/index-DJKwo-mI.js +1 -0
  74. data/public/railwatch/assets/{index-cTzBycCg.js → index-DK6y0YHp.js} +1 -1
  75. data/public/railwatch/assets/{index-B-FXAo1w.js → index-DMNPpLH9.js} +1 -1
  76. data/public/railwatch/assets/{index-BeQw69GM.js → index-DZO1mSfX.js} +1 -1
  77. data/public/railwatch/assets/{index-BVWapDeB.js → index-Db5wj3M5.js} +1 -1
  78. data/public/railwatch/assets/{index-DV5MdmpY.js → index-Dcy5WktB.js} +1 -1
  79. data/public/railwatch/assets/{index-aPCZX-pW.js → index-DvG0-7Lx.js} +1 -1
  80. data/public/railwatch/assets/{index-Atp1FTgX.js → index-Dvj1wuka.js} +1 -1
  81. data/public/railwatch/assets/{index-COd9lT84.js → index-KyZX46qX.js} +1 -1
  82. data/public/railwatch/assets/{index-S0NVaLj9.js → index-Ze-KP-sl.js} +1 -1
  83. data/public/railwatch/assets/{index-DaE-1xhx.js → index-mhRbWLBM.js} +1 -1
  84. data/public/railwatch/assets/{index-DdVg9LKX.js → index-x099JL5f.js} +1 -1
  85. data/public/railwatch/assets/{index-CcennT28.js → index-x28zb_nf.js} +1 -1
  86. data/public/railwatch/assets/{inertia-CqnzqPVD.js → inertia-Cuyz2ZHO.js} +2 -2
  87. data/public/railwatch/assets/{input-error-ByT28UdP.js → input-error-hog6gGxg.js} +1 -1
  88. data/public/railwatch/assets/{json-viewer-Bnu9RsJL.js → json-viewer-DH2W9HXf.js} +1 -1
  89. data/public/railwatch/assets/{klass-nLiBV-Az.js → klass-DHbDelLk.js} +1 -1
  90. data/public/railwatch/assets/{label-1nSzpSB6.js → label-DdCBgiUn.js} +1 -1
  91. data/public/railwatch/assets/{layout-D7lE1Doo.js → layout-Cueyl7c5.js} +1 -1
  92. data/public/railwatch/assets/{live-dot-UdzOfzJb.js → live-dot-BZgYTYdt.js} +1 -1
  93. data/public/railwatch/assets/{nav-BRCgp2w3.js → nav-BSSGObDZ.js} +1 -1
  94. data/public/railwatch/assets/{new-COyDKOOb.js → new-B8FSb8Bl.js} +1 -1
  95. data/public/railwatch/assets/{new-Cd9zPNJ8.js → new-C39_v2Ll.js} +1 -1
  96. data/public/railwatch/assets/{new-vjRzERL3.js → new-DVOPwaC5.js} +1 -1
  97. data/public/railwatch/assets/{new-C60G72DR.js → new-Dd40nvJR.js} +1 -1
  98. data/public/railwatch/assets/{new-DMJGKjmH.js → new-SxnYe1SE.js} +1 -1
  99. data/public/railwatch/assets/{new-Omvf-c9s.js → new-eP5vKD3Y.js} +1 -1
  100. data/public/railwatch/assets/{onboarding-gUjJQc-6.js → onboarding-CUpZl5KB.js} +1 -1
  101. data/public/railwatch/assets/{origin-identity-M1YUPYS0.js → origin-identity-BYt2uiuo.js} +1 -1
  102. data/public/railwatch/assets/{percentile-picker-BxIVblBw.js → percentile-picker-CeQgllxD.js} +1 -1
  103. data/public/railwatch/assets/{relative-time-DQ4kjowZ.js → relative-time-D5UbF4oO.js} +1 -1
  104. data/public/railwatch/assets/{release-health-Cb1tMOOO.js → release-health-uP-GF3_V.js} +1 -1
  105. data/public/railwatch/assets/{route-BJkoEm7r.js → route-DQAY8JEr.js} +1 -1
  106. data/public/railwatch/assets/{segmented-C4oWE73o.js → segmented-BeIe4uqk.js} +1 -1
  107. data/public/railwatch/assets/{select-ocdQJdQo.js → select-2R16457Z.js} +1 -1
  108. data/public/railwatch/assets/{separator-Ct2UcZ2x.js → separator-D5I0UCB5.js} +1 -1
  109. data/public/railwatch/assets/series-chart-gnrzhmM6.js +1 -0
  110. data/public/railwatch/assets/show-2BkeNRUC.js +2 -0
  111. data/public/railwatch/assets/{show-BLJOyLb_.js → show-B0X1hRQH.js} +1 -1
  112. data/public/railwatch/assets/{show-C8TkpEgm.js → show-BKUV5l5q.js} +1 -1
  113. data/public/railwatch/assets/{show-BAjfddEn.js → show-BQJD_CsF.js} +1 -1
  114. data/public/railwatch/assets/{show-C6OiJ6Hr.js → show-BhmD6Sxp.js} +1 -1
  115. data/public/railwatch/assets/{show-CEhPVMMT.js → show-C3KcnVo2.js} +1 -1
  116. data/public/railwatch/assets/{show-CX_pab9S.js → show-C95cHd06.js} +1 -1
  117. data/public/railwatch/assets/{show-Bsu1rvnK.js → show-CdB4uVQS.js} +1 -1
  118. data/public/railwatch/assets/{show-yEOrk6Pt.js → show-CoCqcVIp.js} +1 -1
  119. data/public/railwatch/assets/{show-DDVsv-uS.js → show-D2LqjEsU.js} +1 -1
  120. data/public/railwatch/assets/{show-D6lgzL6n.js → show-DNpnKyTh.js} +1 -1
  121. data/public/railwatch/assets/{show-eKazflRI.js → show-DOlTxbig.js} +1 -1
  122. data/public/railwatch/assets/{show-Dwiq-8hA.js → show-DQCkttL8.js} +1 -1
  123. data/public/railwatch/assets/{show-CBFBiBY2.js → show-DcxesipC.js} +1 -1
  124. data/public/railwatch/assets/{show-BoVyMQS6.js → show-IGJoc_X0.js} +1 -1
  125. data/public/railwatch/assets/{show-gtwKsTsl.js → show-YsNpqbcI.js} +1 -1
  126. data/public/railwatch/assets/{show-B4bwI9x2.js → show-qNV6H8SH.js} +1 -1
  127. data/public/railwatch/assets/{sort-header-CPM6fhXv.js → sort-header-mEJUM3Av.js} +1 -1
  128. data/public/railwatch/assets/{sparkline-cell-CXCxXPWt.js → sparkline-cell-Dwg7awwh.js} +1 -1
  129. data/public/railwatch/assets/{stat-BNEfE8X1.js → stat-ZtxGU8lE.js} +1 -1
  130. data/public/railwatch/assets/{status-badge-D0aylrM5.js → status-badge-CH5P-Xkj.js} +1 -1
  131. data/public/railwatch/assets/{tenant-path-C4aM_cO0.js → tenant-path-CQoP-BeF.js} +1 -1
  132. data/public/railwatch/assets/{text-link-CP4lqUi6.js → text-link-DHJ8BXx5.js} +1 -1
  133. data/public/railwatch/assets/{textarea-DzJo2ds4.js → textarea-BeQtQyl5.js} +1 -1
  134. data/public/railwatch/assets/{timeline-BNcJ9PMc.js → timeline-CaKQVu48.js} +1 -1
  135. data/public/railwatch/assets/{transition-BX2M1iaq.js → transition-ksDpqhKJ.js} +1 -1
  136. data/public/railwatch/assets/{use-clipboard-C1ApSwzA.js → use-clipboard-DNefo-ky.js} +1 -1
  137. data/public/railwatch/assets/{use-live-DWwLg1Nj.js → use-live-DMTuhKfB.js} +1 -1
  138. data/public/railwatch/manifest.json +1286 -1286
  139. metadata +116 -116
  140. data/public/railwatch/assets/application-B7h1MIhi.css +0 -1
  141. data/public/railwatch/assets/index-DiQ4mqT_.js +0 -1
  142. data/public/railwatch/assets/series-chart-D6upsrSn.js +0 -1
  143. data/public/railwatch/assets/show-CV-lG2b6.js +0 -2
@@ -1 +1 @@
1
- import{c as N,j as s,r as v,C as z,L as ae,M as ue,N as pe,u as fe,H as xe}from"./inertia-CqnzqPVD.js";import{C as oe,a as ie,b as ge}from"./card-DqdEEKcJ.js";import{D as be,a as je,b as ye,c as we,L as ve,B as Ne}from"./live-dot-UdzOfzJb.js";import{R as Se,M as _e,a as ke}from"./nav-BRCgp2w3.js";import{B as ne}from"./app-wordmark-Bt6XqURo.js";import{H as Ce,a as Ee,b as $e}from"./copy-DaQMJWoT.js";import{S as Ae}from"./empty-state-Bn48Gplm.js";import{S as J,a as Re}from"./stat-BNEfE8X1.js";import{I as Te}from"./status-badge-D0aylrM5.js";import{T as Ie}from"./timeline-BNcJ9PMc.js";import{C as Le}from"./index-C-EwH4lO.js";import"./index-BDVShWMs.js";import"./use-live-DWwLg1Nj.js";import"./arrow-up-EmePsTKP.js";import"./badge-Dv7I-ebP.js";import"./format-B9SDkrWj.js";const Me='claude mcp add railwatch --transport http https://railwatch.rebulk.com/mcp --header "Authorization: Bearer $RAILWATCH_MCP_TOKEN"';function Pe(){const e=N.c(4);let t,o,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"text-primary mb-2 font-mono text-[11px] tracking-[0.2em] uppercase",children:"MCP"}),o=s.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Works with your AI assistant"}),n=s.jsx("p",{className:"text-muted-foreground mt-2",children:"Railwatch speaks MCP, so Claude Code, Cursor, VS Code, and Zed can read your production data directly — issues, slow routes, query plans, stack profiles, logs, deploys. It ships prompts too: point one at an issue key and it pulls the occurrence, the timeline around it, and the deploy it started after. Writes are attributed to you, so a comment or a status change an assistant makes is signed in the issue's activity feed."}),e[0]=t,e[1]=o,e[2]=n):(t=e[0],o=e[1],n=e[2]);let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("section",{className:"mx-auto max-w-2xl px-6 pb-16 text-center",children:[t,o,n,s.jsx(oe,{className:"mt-6 text-left",children:s.jsxs(ie,{children:[s.jsx("p",{className:"text-muted-foreground font-mono text-sm",children:"# one line, then ask it what broke today"}),s.jsx("p",{className:"mt-1 font-mono text-sm break-all",children:Me})]})})]}),e[3]=a):a=e[3],a}const De=[{title:"Requests",description:"Every route's throughput, latency percentiles, and status codes, down to a single request's waterfall.",image:"requests",alt:"The Requests page: throughput and latency charts over a table of every route with its 2xx, 4xx, 5xx counts, error rate, and p95"},{title:"Jobs & scheduled tasks",description:"Queue depth, retries, and run history for Active Job and your recurring tasks.",image:"jobs",alt:"The Jobs page: attempts per hour split into processed and failed, a queue table with average wait, and the most recent runs"},{title:"Queries & N+1s",description:"Slow queries and N+1 patterns grouped by source location, not buried in a log line.",image:"queries",alt:"The Queries page: two N+1 patterns with a suggested fix and the source line, above every SQL shape ranked by count and p95"},{title:"Exceptions → Issues",description:"Exceptions are grouped into Issues that track occurrences, assignees, and status over time.",image:"issues",alt:"An issue page: a resolved NoMethodError with the raising line of source highlighted, its breadcrumbs, and the alerts it sent"},{title:"Inertia visits",description:"Page-by-page render and payload size, so a slow visit is obvious before support tickets show up.",image:"visits",alt:"The Inertia visits page: p75 web vitals, visits per hour, and a table of components with visit count, LCP, INP, and p95"},{title:"Deploy comparison",description:"Every chart is annotated with deploys, so a regression points straight at the change that caused it.",image:"deploys",alt:"A deploy page: the commits it shipped, its crash-free rate, and request p95, error rate, and job failures for the hour before and after"},{title:"Alerts",description:"Threshold and issue alerts delivered where your team already works.",image:"alerts",alt:"The Alerts page: new, resolved, and threshold alerts delivered to Slack and email, newest first"},{title:"MCP / API",description:"A JSON-RPC MCP endpoint and a token-authenticated API, so your AI assistant can query production directly.",image:"mcp",alt:"A request page with its Copy as Markdown button: the same timeline an assistant reads over MCP"}];function Oe(){const e=N.c(9),[t,o]=v.useState(null);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:De.map(l=>{const{title:m,description:f,image:h,alt:g}=l;return s.jsxs("div",{className:"bg-card flex flex-col overflow-hidden rounded-lg border",children:[s.jsx("button",{type:"button",onClick:()=>o(l),className:"group relative aspect-[4/3] w-full cursor-zoom-in overflow-hidden border-b bg-[#020618] text-left","aria-label":`Open a full screenshot of ${m}`,children:s.jsx("img",{src:`/marketing/${h}.webp`,alt:g,loading:"lazy",width:1200,height:900,className:"h-full w-full object-cover object-top transition-transform duration-500 ease-out group-hover:scale-[1.03] motion-reduce:transition-none"})}),s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:m}),s.jsx("p",{className:"text-muted-foreground text-[13px] leading-snug",children:f})]})]},m)})}),e[0]=n):n=e[0];const a=t!==null;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=l=>!l&&o(null),e[1]=c):c=e[1];let i;e[2]!==t?(i=t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"border-b px-5 py-3",children:[s.jsx(be,{className:"text-base",children:t.title}),s.jsx(je,{children:t.description})]}),s.jsx("img",{src:`/marketing/${t.image}-full.webp`,alt:t.alt,width:1920,height:1200,className:"block max-h-[calc(92vh-4.5rem)] w-full object-contain object-top"})]}),e[2]=t,e[3]=i):i=e[3];let d;e[4]!==i?(d=s.jsx(ye,{className:"bg-background max-h-[92vh] w-[min(96vw,1400px)] gap-0 overflow-hidden p-0 sm:max-w-none",children:i}),e[4]=i,e[5]=d):d=e[5];let r;return e[6]!==a||e[7]!==d?(r=s.jsxs("section",{className:"mx-auto max-w-5xl px-6 pb-16",children:[n,s.jsx(we,{open:a,onOpenChange:c,children:d})]}),e[6]=a,e[7]=d,e[8]=r):r=e[8],r}const de=v.createContext("departed"),me=()=>v.useContext(de),qe=[["approaching",100],["braking",2300],["held",3300],["caution",6400],["clear",7200],["departed",8300]],ze=3200,Fe=1800,He={arriving:"clear",approaching:"clear",braking:"clear",held:"stop",caution:"caution",clear:"clear",departed:"clear"};function he(){const[e]=v.useState(Be);return e}function Be(){return typeof window<"u"&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}function We(){const e=he(),[t,o]=v.useState(e?"arriving":"departed");return v.useEffect(()=>{if(!e)return;const n=qe.map(([a,c])=>setTimeout(()=>o(a),c));return()=>n.forEach(clearTimeout)},[]),{stage:t,animated:e}}const Ge=72,le=13.5,re=112,Ue=14;function Je(e,t,o,n){let a=0,[c,i]=e;for(let d=1;d<=64;d++){const r=d/64,l=1-r,m=l*l*l*e[0]+3*l*l*r*t[0]+3*l*r*r*o[0]+r*r*r*n[0],f=l*l*l*e[1]+3*l*l*r*t[1]+3*l*r*r*o[1]+r*r*r*n[1];a+=Math.hypot(m-c,f-i),c=m,i=f}return a}function Qe(e){const t=e.querySelector("h1"),o=e.querySelector("[data-hero-strip]");if(!t||!o)return null;const n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),c=o.getBoundingClientRect(),i=n.width,d=n.height,r=i<768,l=i/2,m=r?10:Math.max(16,l-520),f=c.top-n.top+60,h=Ge,g=l+(r?120:220),u=[l-(r?30:60),a.top-n.top+a.height+4],b=[m,f-h],x=b[1]-u[1],y=[u[0]-x*.55,u[1]+x*.32],p=[m,b[1]-x*.42],w=Je(u,y,p,b),j=Math.PI*h/2,S=g-Ue-re/2,_=w+j+(S-(m+h)),C=w+j+(i+re+40-(m+h));return{w:i,h:d,p0:u,c1:y,c2:p,p3:b,xL:m,yL:f,r:h,cx:l,xSignal:g,yFadeTop:u[1],yFadeFull:u[1]+x*.7,stop:_,total:C}}function Q(e,t){const[o,n]=e.p0,a=e.r+t,c=t;return[`M ${o+c*.5} ${n-c*.85}`,`C ${e.c1[0]+c*.5} ${e.c1[1]-c*.85}, ${e.c2[0]-t} ${e.c2[1]}, ${e.p3[0]-t} ${e.p3[1]}`,`A ${a} ${a} 0 0 0 ${e.xL+e.r} ${e.yL+t}`,`L ${e.w+re+40} ${e.yL+t}`].join(" ")}const K=[{at:-41,w:30},{at:-4,w:34},{at:37,w:38}],Ke=K.length-1,Ve=1;function Xe(e){const t=N.c(14),{index:o,held:n,style:a}=e,c=K[o],i=-c.w/2;let d;t[0]!==c.w||t[1]!==i?(d=s.jsx("rect",{x:i,y:"-7",width:c.w,height:"14",rx:"3",fill:"currentColor"}),t[0]=c.w,t[1]=i,t[2]=d):d=t[2];let r;t[3]!==c.w||t[4]!==o?(r=o===Ke&&s.jsx("rect",{x:c.w/2-6,y:"-4",width:"4",height:"8",rx:"1",className:"text-primary",fill:"currentColor"}),t[3]=c.w,t[4]=o,t[5]=r):r=t[5];let l;t[6]!==n||t[7]!==o?(l=o===Ve&&s.jsx("rect",{x:"-5",y:"-25",width:"10",height:"10",transform:"rotate(45 0 -20)",className:z("transition-opacity duration-300",n?"opacity-100":"opacity-0"),fill:"rgb(239 68 68)"}),t[6]=n,t[7]=o,t[8]=l):l=t[8];let m;return t[9]!==a||t[10]!==d||t[11]!==r||t[12]!==l?(m=s.jsxs("g",{className:"text-foreground/85",style:a,children:[d,r,l]}),t[9]=a,t[10]=d,t[11]=r,t[12]=l,t[13]=m):m=t[13],m}function Ye(e){const t=N.c(3),{children:o}=e,{stage:n}=We();let a;return t[0]!==o||t[1]!==n?(a=s.jsx(de.Provider,{value:n,children:o}),t[0]=o,t[1]=n,t[2]=a):a=t[2],a}function Ze(e){const t=N.c(21),{children:o}=e,n=v.useRef(null),[a,c]=v.useState(null),i=me(),d=he(),r=v.useId();let l,m;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const p=n.current;if(!p)return;const w=()=>c(Qe(p));w();const j=new ResizeObserver(w);return j.observe(p),()=>j.disconnect()},m=[],t[0]=l,t[1]=m):(l=t[0],m=t[1]),v.useEffect(l,m);const f=i==="held";let h,g,u;if(t[2]!==d||t[3]!==f||t[4]!==a||t[5]!==r||t[6]!==i){let p;if(a)e:switch(i){case"arriving":{p={distance:0};break e}case"approaching":case"braking":case"held":case"caution":{p={distance:a.stop,transition:`offset-distance ${ze}ms cubic-bezier(.45,.05,.25,1)`};break e}case"clear":{p={distance:a.stop+120,transition:"offset-distance 900ms ease-in-out"};break e}case"departed":p={distance:a.total,transition:`offset-distance ${Fe}ms cubic-bezier(.4,0,.8,.6)`}}const w=j=>a&&p?{offsetPath:`path("${Q(a,0)}")`,offsetRotate:"auto",offsetDistance:`${p.distance+K[j].at}px`,transition:p.transition}:void 0;h=n,g="relative overflow-hidden",u=a&&s.jsxs("svg",{"aria-hidden":!0,className:"text-foreground/30 pointer-events-none absolute inset-0 z-0 h-full w-full [mask-image:linear-gradient(to_right,black_86%,transparent)]",width:a.w,height:a.h,viewBox:`0 0 ${a.w} ${a.h}`,children:[s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:`${r}-fade`,gradientUnits:"userSpaceOnUse",x1:"0",y1:a.yFadeTop,x2:"0",y2:a.yFadeFull,children:[s.jsx("stop",{offset:"0",stopColor:"white",stopOpacity:"0"}),s.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"1"})]}),s.jsx("mask",{id:r,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:a.w,height:a.h,children:s.jsx("rect",{width:a.w,height:a.h,fill:`url(#${r}-fade)`})})]}),s.jsxs("g",{mask:`url(#${r})`,children:[s.jsx("path",{d:Q(a,0),fill:"none",stroke:"currentColor",strokeWidth:"30",strokeDasharray:"4 18"}),s.jsx("path",{d:Q(a,le/2),fill:"none",stroke:"currentColor",strokeWidth:"2.5"}),s.jsx("path",{d:Q(a,-le/2),fill:"none",stroke:"currentColor",strokeWidth:"2.5"}),d&&K.map((j,S)=>s.jsx(Xe,{index:S,held:f,style:w(S)},S))]})]}),t[2]=d,t[3]=f,t[4]=a,t[5]=r,t[6]=i,t[7]=h,t[8]=g,t[9]=u}else h=t[7],g=t[8],u=t[9];let b;t[10]!==o?(b=s.jsx("div",{className:"relative z-10",children:o}),t[10]=o,t[11]=b):b=t[11];let x;t[12]!==a||t[13]!==i?(x=a&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"pointer-events-none absolute z-10 h-0 w-0",style:{left:a.xSignal,top:a.yL},"aria-hidden":!0,children:s.jsx(Ae,{aspect:He[i],className:"left-0 md:left-0"})})}),t[12]=a,t[13]=i,t[14]=x):x=t[14];let y;return t[15]!==h||t[16]!==g||t[17]!==u||t[18]!==b||t[19]!==x?(y=s.jsxs("div",{ref:h,className:g,children:[u,b,x]}),t[15]=h,t[16]=g,t[17]=u,t[18]=b,t[19]=x,t[20]=y):y=t[20],y}function et(e){const t=N.c(11),{signedIn:o}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("p",{className:"text-primary mb-5 flex items-baseline justify-center gap-3 font-mono text-[11px] tracking-[0.2em] uppercase",children:["Built by",s.jsx("a",{href:"https://rebulk.com",className:"text-foreground hover:text-primary transition-colors",children:s.jsx(Se,{className:"h-2.5 w-auto"})})]}),t[0]=n):n=t[0];let a,c;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("h1",{className:"text-5xl font-black tracking-tight text-balance sm:text-6xl",children:[Ce,s.jsx("span",{className:"text-primary",children:Ee})]}),c=s.jsx("p",{className:"text-muted-foreground mx-auto mt-5 max-w-xl text-lg text-balance",children:$e}),t[1]=a,t[2]=c):(a=t[1],c=t[2]);let i;t[3]!==o?(i=o?s.jsx(ne,{asChild:!0,size:"lg",children:s.jsx(ae,{href:"/dashboard",children:"Open dashboard"})}):s.jsx(ne,{asChild:!0,size:"lg",children:s.jsx(ae,{href:ue(),children:"Get started"})}),t[3]=o,t[4]=i):i=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ne,{asChild:!0,variant:"outline",size:"lg",children:s.jsx(ae,{href:pe(),children:"Read the docs"})}),t[5]=d):d=t[5];let r;t[6]!==i?(r=s.jsxs("div",{className:"mt-8 flex items-center justify-center gap-3",children:[i,d]}),t[6]=i,t[7]=r):r=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"mt-6 h-32","data-hero-strip":!0}),t[8]=l):l=t[8];let m;return t[9]!==r?(m=s.jsx(Ze,{children:s.jsxs("section",{className:"relative mx-auto max-w-3xl px-6 pt-14 pb-0 text-center",children:[n,a,c,r,l]})}),t[9]=r,t[10]=m):m=t[10],m}const tt=[{comment:"# 1. add the gem",lines:["bundle add railwatch"]},{comment:"# 2. initializer, routes, Kamal hook, browser client, matchers",lines:["bin/rails generate railwatch:install --prompt-token --kamal-secrets"]},{comment:"# 3. check every piece is wired up",lines:["bin/rails railwatch:doctor"]},{comment:"# 4. connect your editor's assistant",lines:["bin/rails railwatch:mcp"]}];function st(){const e=N.c(4);let t,o,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"text-primary mb-2 font-mono text-[11px] tracking-[0.2em] uppercase",children:"Install"}),o=s.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Five-minute install"}),n=s.jsx("p",{className:"text-muted-foreground mt-2",children:"One gem, one generator, no dashboard to build. The generator finishes by running the doctor, so you see a ✓ or a ✗ per check before you deploy."}),e[0]=t,e[1]=o,e[2]=n):(t=e[0],o=e[1],n=e[2]);let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("section",{className:"mx-auto max-w-2xl px-6 pb-16 text-center",children:[t,o,n,s.jsx(oe,{className:"mt-6 text-left",children:s.jsx(ie,{className:"space-y-1 font-mono text-sm",children:tt.map(at)})})]}),e[3]=a):a=e[3],a}function at(e,t){return s.jsxs("div",{className:t>0?"pt-3":void 0,children:[s.jsx("p",{className:"text-muted-foreground",children:e.comment}),e.lines.map(nt)]},e.comment)}function nt(e){return s.jsx("p",{className:"break-all",children:e},e)}const ce=[{type:"query",id:1,offset:2,duration:4.2,label:"SELECT users",stage:"action",sql:'SELECT "users".* FROM "users" WHERE "users"."id" = ?'},{type:"cache_event",id:2,offset:8,duration:.4,label:"read widgets/42",stage:"action",detail:{op:"read",key:"widgets/42"}},{type:"query",id:3,offset:11,duration:12.8,label:"SELECT widgets",stage:"action",sql:'SELECT "widgets".* FROM "widgets" WHERE "widgets"."account_id" = ?'},{type:"outgoing_request",id:4,offset:26,duration:40.1,label:"GET api.stripe.com",stage:"action",detail:{method:"GET",url:"https://api.stripe.com/v1/charges",status:200}},{type:"view_render",id:5,offset:68,duration:6.5,label:"widgets/index.html.erb",stage:"render"},{type:"enqueued_job",id:6,offset:70,duration:null,label:"WidgetSyncJob",stage:"render"}],rt={type:"exception",id:7,offset:66.4,duration:null,label:"NoMethodError: undefined method `total' for nil",stage:"action",source:"app/controllers/widgets_controller.rb:31"};function ot(){const e=N.c(68),t=me(),o=t==="braking"||t==="held",n=t==="held";let a;e[0]!==n?(a=n?[...ce,rt]:ce,e[0]=n,e[1]=a):a=e[1];const c=a,i=t==="held"?"new":t==="caution"||t==="clear"?"resolved":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=new Date().toISOString(),e[2]=d):d=e[2];let r;e[3]!==o?(r=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(ve,{lastSeenAt:d,erroring:o}),"storefront · production"]}),e[3]=o,e[4]=r):r=e[4];const l=n?"bg-danger/15 text-danger":"bg-live/15 text-live";let m;e[5]!==l?(m=z("rounded px-1.5 py-0.5 font-semibold transition-colors duration-500",l),e[5]=l,e[6]=m):m=e[6];const f=n?"500":"200";let h;e[7]!==m||e[8]!==f?(h=s.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 font-mono text-xs",children:["GET /widgets",s.jsx("span",{className:m,children:f})]}),e[7]=m,e[8]=f,e[9]=h):h=e[9];const g=i?"translate-x-0":"translate-x-[calc(100%+2px)]";let u;e[10]!==g?(u=z("bg-popover absolute right-0 flex items-center gap-2 border-l px-3 text-xs shadow-[-12px_0_16px_-8px_rgba(0,0,0,.5)] transition-transform duration-500 ease-out motion-reduce:transition-none","max-md:bottom-2.5 max-md:gap-1.5 max-md:rounded-l-md max-md:border-y max-md:px-2.5 max-md:py-1.5 max-md:text-[11px] md:inset-y-0",g),e[10]=g,e[11]=u):u=e[11];const b=i==="resolved"?"bg-live/15 text-live":"bg-danger/15 text-danger";let x;e[12]!==b?(x=z("flex size-6 shrink-0 items-center justify-center rounded-full",b),e[12]=b,e[13]=x):x=e[13];let y;e[14]!==i?(y=i==="resolved"?s.jsx(Le,{className:"size-3.5"}):s.jsx(Ne,{className:"size-3.5"}),e[14]=i,e[15]=y):y=e[15];let p;e[16]!==x||e[17]!==y?(p=s.jsx("span",{className:x,children:y}),e[16]=x,e[17]=y,e[18]=p):p=e[18];const w=i==="resolved"?"SF-142 resolved":"New issue SF-142";let j;e[19]!==w?(j=s.jsx("span",{className:"block leading-tight font-medium",children:w}),e[19]=w,e[20]=j):j=e[20];const S=i==="resolved"?"Slack #storefront-alerts · just now":"Sent to Slack #storefront-alerts";let _;e[21]!==S?(_=s.jsx("span",{className:"max-md:hidden",children:S}),e[21]=S,e[22]=_):_=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("span",{className:"md:hidden",children:"Slack #storefront-alerts"}),e[23]=C):C=e[23];let E;e[24]!==_?(E=s.jsxs("span",{className:"text-muted-foreground block leading-tight",children:[_,C]}),e[24]=_,e[25]=E):E=e[25];let $;e[26]!==j||e[27]!==E?($=s.jsxs("span",{className:"min-w-0",children:[j,E]}),e[26]=j,e[27]=E,e[28]=$):$=e[28];let A;e[29]!==p||e[30]!==$||e[31]!==u?(A=s.jsxs("div",{"aria-live":"polite",className:u,children:[p,$]}),e[29]=p,e[30]=$,e[31]=u,e[32]=A):A=e[32];let R;e[33]!==r||e[34]!==A||e[35]!==h?(R=s.jsxs(ge,{className:"relative flex-row items-center justify-between overflow-hidden border-b pb-6 max-md:flex-wrap max-md:gap-y-3",children:[r,h,A]}),e[33]=r,e[34]=A,e[35]=h,e[36]=R):R=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(J,{label:"p50 latency",value:"42ms",hint:"last 24h"}),e[37]=F):F=e[37];const V=n?"2.1%":"0.4%",X=n?"destructive":"success",Y=n?"3 of 143 requests":"last 24h";let T;e[38]!==V||e[39]!==X||e[40]!==Y?(T=s.jsx(J,{label:"error rate",value:V,tone:X,hint:Y}),e[38]=V,e[39]=X,e[40]=Y,e[41]=T):T=e[41];let H;e[42]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(J,{label:"requests/min",value:"1.2k"}),e[42]=H):H=e[42];const Z=n?"1":"0",ee=n?"destructive":"success";let I;e[43]!==Z||e[44]!==ee?(I=s.jsx(J,{label:"open issues",value:Z,tone:ee}),e[43]=Z,e[44]=ee,e[45]=I):I=e[45];let L;e[46]!==T||e[47]!==I?(L=s.jsxs(Re,{children:[F,T,H,I]}),e[46]=T,e[47]=I,e[48]=L):L=e[48];const te=n?"border-danger/40 bg-danger/5":"bg-muted/30";let M;e[49]!==te?(M=z("flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-xs transition-colors duration-500",te),e[49]=te,e[50]=M):M=e[50];let B;e[51]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{className:"shrink-0 font-mono font-semibold",children:"SF-142"}),s.jsx("span",{className:"truncate",children:"NoMethodError in WidgetsController#index"})]}),e[51]=B):B=e[51];let W;e[52]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("span",{className:"hidden sm:inline",children:"3 events"}),e[52]=W):W=e[52];const se=n?"open":"resolved";let P;e[53]!==se?(P=s.jsxs("div",{className:"text-muted-foreground flex shrink-0 items-center gap-3 font-mono",children:[W,s.jsx(Te,{status:se})]}),e[53]=se,e[54]=P):P=e[54];let D;e[55]!==M||e[56]!==P?(D=s.jsxs("div",{className:M,children:[B,P]}),e[55]=M,e[56]=P,e[57]=D):D=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G={action:66,render:24},e[58]=G):G=e[58];let O;e[59]!==c?(O=s.jsx(Ie,{entries:c,total:90,stages:G}),e[59]=c,e[60]=O):O=e[60];let q;e[61]!==L||e[62]!==D||e[63]!==O?(q=s.jsxs(ie,{className:"grid gap-6",children:[L,D,O]}),e[61]=L,e[62]=D,e[63]=O,e[64]=q):q=e[64];let U;return e[65]!==R||e[66]!==q?(U=s.jsx("section",{className:"relative z-20 mx-auto -mt-8 max-w-5xl px-6 pb-16 md:-mt-4",children:s.jsxs(oe,{className:"overflow-hidden",children:[R,q]})}),e[65]=R,e[66]=q,e[67]=U):U=e[67],U}const it=110;function k(e){const t=N.c(8),{step:o,className:n,children:a}=e,c=o===void 0?0:o;let i;t[0]!==n?(i=z("motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-2 motion-safe:fill-mode-both motion-safe:duration-700 motion-safe:ease-out",n),t[0]=n,t[1]=i):i=t[1];const d=`${c*it}ms`;let r;t[2]!==d?(r={animationDelay:d},t[2]=d,t[3]=r):r=t[3];let l;return t[4]!==a||t[5]!==i||t[6]!==r?(l=s.jsx("div",{className:i,style:r,children:a}),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7],l}function St(){const e=N.c(15),{auth:t}=fe().props,o=!!t.user;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xe,{title:"Railwatch — monitoring for Rails apps"}),e[0]=n):n=e[0];let a;e[1]!==o?(a=s.jsx(k,{step:0,children:s.jsx(_e,{signedIn:o})}),e[1]=o,e[2]=a):a=e[2];let c;e[3]!==o?(c=s.jsx(k,{step:1,children:s.jsx(et,{signedIn:o})}),e[3]=o,e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(k,{step:2,children:s.jsx(ot,{})}),e[5]=i):i=e[5];let d;e[6]!==c?(d=s.jsxs(Ye,{children:[c,i]}),e[6]=c,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(k,{step:3,children:s.jsx(Oe,{})}),e[8]=r):r=e[8];let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(k,{step:4,children:s.jsx(Pe,{})}),e[9]=l):l=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(k,{step:4,children:s.jsx(st,{})}),e[10]=m):m=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(k,{step:5,children:s.jsx(ke,{})}),e[11]=f):f=e[11];let h;return e[12]!==a||e[13]!==d?(h=s.jsxs(s.Fragment,{children:[n,s.jsxs("div",{className:"dark bg-background text-foreground min-h-screen",children:[a,d,r,l,m,f]})]}),e[12]=a,e[13]=d,e[14]=h):h=e[14],h}export{St as default};
1
+ import{c as N,j as s,r as v,C as z,L as ae,M as ue,N as pe,u as fe,H as xe}from"./inertia-Cuyz2ZHO.js";import{C as oe,a as ie,b as ge}from"./card-DPjFKfen.js";import{D as be,a as je,b as ye,c as we,L as ve,B as Ne}from"./live-dot-BZgYTYdt.js";import{R as Se,M as _e,a as ke}from"./nav-BSSGObDZ.js";import{B as ne}from"./app-wordmark-BA_60AVb.js";import{H as Ce,a as Ee,b as $e}from"./copy-DaQMJWoT.js";import{S as Ae}from"./empty-state-CW4wclK_.js";import{S as J,a as Re}from"./stat-ZtxGU8lE.js";import{I as Te}from"./status-badge-CH5P-Xkj.js";import{T as Ie}from"./timeline-CaKQVu48.js";import{C as Le}from"./index-BfbSo01U.js";import"./index-CBip6V4z.js";import"./use-live-DMTuhKfB.js";import"./arrow-up-CLQ-7heQ.js";import"./badge-DRae8XwK.js";import"./format-B9SDkrWj.js";const Me='claude mcp add railwatch --transport http https://railwatch.rebulk.com/mcp --header "Authorization: Bearer $RAILWATCH_MCP_TOKEN"';function Pe(){const e=N.c(4);let t,o,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"text-primary mb-2 font-mono text-[11px] tracking-[0.2em] uppercase",children:"MCP"}),o=s.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Works with your AI assistant"}),n=s.jsx("p",{className:"text-muted-foreground mt-2",children:"Railwatch speaks MCP, so Claude Code, Cursor, VS Code, and Zed can read your production data directly — issues, slow routes, query plans, stack profiles, logs, deploys. It ships prompts too: point one at an issue key and it pulls the occurrence, the timeline around it, and the deploy it started after. Writes are attributed to you, so a comment or a status change an assistant makes is signed in the issue's activity feed."}),e[0]=t,e[1]=o,e[2]=n):(t=e[0],o=e[1],n=e[2]);let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("section",{className:"mx-auto max-w-2xl px-6 pb-16 text-center",children:[t,o,n,s.jsx(oe,{className:"mt-6 text-left",children:s.jsxs(ie,{children:[s.jsx("p",{className:"text-muted-foreground font-mono text-sm",children:"# one line, then ask it what broke today"}),s.jsx("p",{className:"mt-1 font-mono text-sm break-all",children:Me})]})})]}),e[3]=a):a=e[3],a}const De=[{title:"Requests",description:"Every route's throughput, latency percentiles, and status codes, down to a single request's waterfall.",image:"requests",alt:"The Requests page: throughput and latency charts over a table of every route with its 2xx, 4xx, 5xx counts, error rate, and p95"},{title:"Jobs & scheduled tasks",description:"Queue depth, retries, and run history for Active Job and your recurring tasks.",image:"jobs",alt:"The Jobs page: attempts per hour split into processed and failed, a queue table with average wait, and the most recent runs"},{title:"Queries & N+1s",description:"Slow queries and N+1 patterns grouped by source location, not buried in a log line.",image:"queries",alt:"The Queries page: two N+1 patterns with a suggested fix and the source line, above every SQL shape ranked by count and p95"},{title:"Exceptions → Issues",description:"Exceptions are grouped into Issues that track occurrences, assignees, and status over time.",image:"issues",alt:"An issue page: a resolved NoMethodError with the raising line of source highlighted, its breadcrumbs, and the alerts it sent"},{title:"Inertia visits",description:"Page-by-page render and payload size, so a slow visit is obvious before support tickets show up.",image:"visits",alt:"The Inertia visits page: p75 web vitals, visits per hour, and a table of components with visit count, LCP, INP, and p95"},{title:"Deploy comparison",description:"Every chart is annotated with deploys, so a regression points straight at the change that caused it.",image:"deploys",alt:"A deploy page: the commits it shipped, its crash-free rate, and request p95, error rate, and job failures for the hour before and after"},{title:"Alerts",description:"Threshold and issue alerts delivered where your team already works.",image:"alerts",alt:"The Alerts page: new, resolved, and threshold alerts delivered to Slack and email, newest first"},{title:"MCP / API",description:"A JSON-RPC MCP endpoint and a token-authenticated API, so your AI assistant can query production directly.",image:"mcp",alt:"A request page with its Copy as Markdown button: the same timeline an assistant reads over MCP"}];function Oe(){const e=N.c(9),[t,o]=v.useState(null);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",children:De.map(l=>{const{title:m,description:f,image:h,alt:g}=l;return s.jsxs("div",{className:"bg-card flex flex-col overflow-hidden rounded-lg border",children:[s.jsx("button",{type:"button",onClick:()=>o(l),className:"group relative aspect-[4/3] w-full cursor-zoom-in overflow-hidden border-b bg-[#020618] text-left","aria-label":`Open a full screenshot of ${m}`,children:s.jsx("img",{src:`/marketing/${h}.webp`,alt:g,loading:"lazy",width:1200,height:900,className:"h-full w-full object-cover object-top transition-transform duration-500 ease-out group-hover:scale-[1.03] motion-reduce:transition-none"})}),s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:m}),s.jsx("p",{className:"text-muted-foreground text-[13px] leading-snug",children:f})]})]},m)})}),e[0]=n):n=e[0];const a=t!==null;let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=l=>!l&&o(null),e[1]=c):c=e[1];let i;e[2]!==t?(i=t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"border-b px-5 py-3",children:[s.jsx(be,{className:"text-base",children:t.title}),s.jsx(je,{children:t.description})]}),s.jsx("img",{src:`/marketing/${t.image}-full.webp`,alt:t.alt,width:1920,height:1200,className:"block max-h-[calc(92vh-4.5rem)] w-full object-contain object-top"})]}),e[2]=t,e[3]=i):i=e[3];let d;e[4]!==i?(d=s.jsx(ye,{className:"bg-background max-h-[92vh] w-[min(96vw,1400px)] gap-0 overflow-hidden p-0 sm:max-w-none",children:i}),e[4]=i,e[5]=d):d=e[5];let r;return e[6]!==a||e[7]!==d?(r=s.jsxs("section",{className:"mx-auto max-w-5xl px-6 pb-16",children:[n,s.jsx(we,{open:a,onOpenChange:c,children:d})]}),e[6]=a,e[7]=d,e[8]=r):r=e[8],r}const de=v.createContext("departed"),me=()=>v.useContext(de),qe=[["approaching",100],["braking",2300],["held",3300],["caution",6400],["clear",7200],["departed",8300]],ze=3200,Fe=1800,He={arriving:"clear",approaching:"clear",braking:"clear",held:"stop",caution:"caution",clear:"clear",departed:"clear"};function he(){const[e]=v.useState(Be);return e}function Be(){return typeof window<"u"&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches}function We(){const e=he(),[t,o]=v.useState(e?"arriving":"departed");return v.useEffect(()=>{if(!e)return;const n=qe.map(([a,c])=>setTimeout(()=>o(a),c));return()=>n.forEach(clearTimeout)},[]),{stage:t,animated:e}}const Ge=72,le=13.5,re=112,Ue=14;function Je(e,t,o,n){let a=0,[c,i]=e;for(let d=1;d<=64;d++){const r=d/64,l=1-r,m=l*l*l*e[0]+3*l*l*r*t[0]+3*l*r*r*o[0]+r*r*r*n[0],f=l*l*l*e[1]+3*l*l*r*t[1]+3*l*r*r*o[1]+r*r*r*n[1];a+=Math.hypot(m-c,f-i),c=m,i=f}return a}function Qe(e){const t=e.querySelector("h1"),o=e.querySelector("[data-hero-strip]");if(!t||!o)return null;const n=e.getBoundingClientRect(),a=t.getBoundingClientRect(),c=o.getBoundingClientRect(),i=n.width,d=n.height,r=i<768,l=i/2,m=r?10:Math.max(16,l-520),f=c.top-n.top+60,h=Ge,g=l+(r?120:220),u=[l-(r?30:60),a.top-n.top+a.height+4],b=[m,f-h],x=b[1]-u[1],y=[u[0]-x*.55,u[1]+x*.32],p=[m,b[1]-x*.42],w=Je(u,y,p,b),j=Math.PI*h/2,S=g-Ue-re/2,_=w+j+(S-(m+h)),C=w+j+(i+re+40-(m+h));return{w:i,h:d,p0:u,c1:y,c2:p,p3:b,xL:m,yL:f,r:h,cx:l,xSignal:g,yFadeTop:u[1],yFadeFull:u[1]+x*.7,stop:_,total:C}}function Q(e,t){const[o,n]=e.p0,a=e.r+t,c=t;return[`M ${o+c*.5} ${n-c*.85}`,`C ${e.c1[0]+c*.5} ${e.c1[1]-c*.85}, ${e.c2[0]-t} ${e.c2[1]}, ${e.p3[0]-t} ${e.p3[1]}`,`A ${a} ${a} 0 0 0 ${e.xL+e.r} ${e.yL+t}`,`L ${e.w+re+40} ${e.yL+t}`].join(" ")}const K=[{at:-41,w:30},{at:-4,w:34},{at:37,w:38}],Ke=K.length-1,Ve=1;function Xe(e){const t=N.c(14),{index:o,held:n,style:a}=e,c=K[o],i=-c.w/2;let d;t[0]!==c.w||t[1]!==i?(d=s.jsx("rect",{x:i,y:"-7",width:c.w,height:"14",rx:"3",fill:"currentColor"}),t[0]=c.w,t[1]=i,t[2]=d):d=t[2];let r;t[3]!==c.w||t[4]!==o?(r=o===Ke&&s.jsx("rect",{x:c.w/2-6,y:"-4",width:"4",height:"8",rx:"1",className:"text-primary",fill:"currentColor"}),t[3]=c.w,t[4]=o,t[5]=r):r=t[5];let l;t[6]!==n||t[7]!==o?(l=o===Ve&&s.jsx("rect",{x:"-5",y:"-25",width:"10",height:"10",transform:"rotate(45 0 -20)",className:z("transition-opacity duration-300",n?"opacity-100":"opacity-0"),fill:"rgb(239 68 68)"}),t[6]=n,t[7]=o,t[8]=l):l=t[8];let m;return t[9]!==a||t[10]!==d||t[11]!==r||t[12]!==l?(m=s.jsxs("g",{className:"text-foreground/85",style:a,children:[d,r,l]}),t[9]=a,t[10]=d,t[11]=r,t[12]=l,t[13]=m):m=t[13],m}function Ye(e){const t=N.c(3),{children:o}=e,{stage:n}=We();let a;return t[0]!==o||t[1]!==n?(a=s.jsx(de.Provider,{value:n,children:o}),t[0]=o,t[1]=n,t[2]=a):a=t[2],a}function Ze(e){const t=N.c(21),{children:o}=e,n=v.useRef(null),[a,c]=v.useState(null),i=me(),d=he(),r=v.useId();let l,m;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{const p=n.current;if(!p)return;const w=()=>c(Qe(p));w();const j=new ResizeObserver(w);return j.observe(p),()=>j.disconnect()},m=[],t[0]=l,t[1]=m):(l=t[0],m=t[1]),v.useEffect(l,m);const f=i==="held";let h,g,u;if(t[2]!==d||t[3]!==f||t[4]!==a||t[5]!==r||t[6]!==i){let p;if(a)e:switch(i){case"arriving":{p={distance:0};break e}case"approaching":case"braking":case"held":case"caution":{p={distance:a.stop,transition:`offset-distance ${ze}ms cubic-bezier(.45,.05,.25,1)`};break e}case"clear":{p={distance:a.stop+120,transition:"offset-distance 900ms ease-in-out"};break e}case"departed":p={distance:a.total,transition:`offset-distance ${Fe}ms cubic-bezier(.4,0,.8,.6)`}}const w=j=>a&&p?{offsetPath:`path("${Q(a,0)}")`,offsetRotate:"auto",offsetDistance:`${p.distance+K[j].at}px`,transition:p.transition}:void 0;h=n,g="relative overflow-hidden",u=a&&s.jsxs("svg",{"aria-hidden":!0,className:"text-foreground/30 pointer-events-none absolute inset-0 z-0 h-full w-full [mask-image:linear-gradient(to_right,black_86%,transparent)]",width:a.w,height:a.h,viewBox:`0 0 ${a.w} ${a.h}`,children:[s.jsxs("defs",{children:[s.jsxs("linearGradient",{id:`${r}-fade`,gradientUnits:"userSpaceOnUse",x1:"0",y1:a.yFadeTop,x2:"0",y2:a.yFadeFull,children:[s.jsx("stop",{offset:"0",stopColor:"white",stopOpacity:"0"}),s.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"1"})]}),s.jsx("mask",{id:r,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:a.w,height:a.h,children:s.jsx("rect",{width:a.w,height:a.h,fill:`url(#${r}-fade)`})})]}),s.jsxs("g",{mask:`url(#${r})`,children:[s.jsx("path",{d:Q(a,0),fill:"none",stroke:"currentColor",strokeWidth:"30",strokeDasharray:"4 18"}),s.jsx("path",{d:Q(a,le/2),fill:"none",stroke:"currentColor",strokeWidth:"2.5"}),s.jsx("path",{d:Q(a,-le/2),fill:"none",stroke:"currentColor",strokeWidth:"2.5"}),d&&K.map((j,S)=>s.jsx(Xe,{index:S,held:f,style:w(S)},S))]})]}),t[2]=d,t[3]=f,t[4]=a,t[5]=r,t[6]=i,t[7]=h,t[8]=g,t[9]=u}else h=t[7],g=t[8],u=t[9];let b;t[10]!==o?(b=s.jsx("div",{className:"relative z-10",children:o}),t[10]=o,t[11]=b):b=t[11];let x;t[12]!==a||t[13]!==i?(x=a&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"pointer-events-none absolute z-10 h-0 w-0",style:{left:a.xSignal,top:a.yL},"aria-hidden":!0,children:s.jsx(Ae,{aspect:He[i],className:"left-0 md:left-0"})})}),t[12]=a,t[13]=i,t[14]=x):x=t[14];let y;return t[15]!==h||t[16]!==g||t[17]!==u||t[18]!==b||t[19]!==x?(y=s.jsxs("div",{ref:h,className:g,children:[u,b,x]}),t[15]=h,t[16]=g,t[17]=u,t[18]=b,t[19]=x,t[20]=y):y=t[20],y}function et(e){const t=N.c(11),{signedIn:o}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("p",{className:"text-primary mb-5 flex items-baseline justify-center gap-3 font-mono text-[11px] tracking-[0.2em] uppercase",children:["Built by",s.jsx("a",{href:"https://rebulk.com",className:"text-foreground hover:text-primary transition-colors",children:s.jsx(Se,{className:"h-2.5 w-auto"})})]}),t[0]=n):n=t[0];let a,c;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("h1",{className:"text-5xl font-black tracking-tight text-balance sm:text-6xl",children:[Ce,s.jsx("span",{className:"text-primary",children:Ee})]}),c=s.jsx("p",{className:"text-muted-foreground mx-auto mt-5 max-w-xl text-lg text-balance",children:$e}),t[1]=a,t[2]=c):(a=t[1],c=t[2]);let i;t[3]!==o?(i=o?s.jsx(ne,{asChild:!0,size:"lg",children:s.jsx(ae,{href:"/dashboard",children:"Open dashboard"})}):s.jsx(ne,{asChild:!0,size:"lg",children:s.jsx(ae,{href:ue(),children:"Get started"})}),t[3]=o,t[4]=i):i=t[4];let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(ne,{asChild:!0,variant:"outline",size:"lg",children:s.jsx(ae,{href:pe(),children:"Read the docs"})}),t[5]=d):d=t[5];let r;t[6]!==i?(r=s.jsxs("div",{className:"mt-8 flex items-center justify-center gap-3",children:[i,d]}),t[6]=i,t[7]=r):r=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"mt-6 h-32","data-hero-strip":!0}),t[8]=l):l=t[8];let m;return t[9]!==r?(m=s.jsx(Ze,{children:s.jsxs("section",{className:"relative mx-auto max-w-3xl px-6 pt-14 pb-0 text-center",children:[n,a,c,r,l]})}),t[9]=r,t[10]=m):m=t[10],m}const tt=[{comment:"# 1. add the gem",lines:["bundle add railwatch"]},{comment:"# 2. initializer, routes, Kamal hook, browser client, matchers",lines:["bin/rails generate railwatch:install --prompt-token --kamal-secrets"]},{comment:"# 3. check every piece is wired up",lines:["bin/rails railwatch:doctor"]},{comment:"# 4. connect your editor's assistant",lines:["bin/rails railwatch:mcp"]}];function st(){const e=N.c(4);let t,o,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("p",{className:"text-primary mb-2 font-mono text-[11px] tracking-[0.2em] uppercase",children:"Install"}),o=s.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"Five-minute install"}),n=s.jsx("p",{className:"text-muted-foreground mt-2",children:"One gem, one generator, no dashboard to build. The generator finishes by running the doctor, so you see a ✓ or a ✗ per check before you deploy."}),e[0]=t,e[1]=o,e[2]=n):(t=e[0],o=e[1],n=e[2]);let a;return e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("section",{className:"mx-auto max-w-2xl px-6 pb-16 text-center",children:[t,o,n,s.jsx(oe,{className:"mt-6 text-left",children:s.jsx(ie,{className:"space-y-1 font-mono text-sm",children:tt.map(at)})})]}),e[3]=a):a=e[3],a}function at(e,t){return s.jsxs("div",{className:t>0?"pt-3":void 0,children:[s.jsx("p",{className:"text-muted-foreground",children:e.comment}),e.lines.map(nt)]},e.comment)}function nt(e){return s.jsx("p",{className:"break-all",children:e},e)}const ce=[{type:"query",id:1,offset:2,duration:4.2,label:"SELECT users",stage:"action",sql:'SELECT "users".* FROM "users" WHERE "users"."id" = ?'},{type:"cache_event",id:2,offset:8,duration:.4,label:"read widgets/42",stage:"action",detail:{op:"read",key:"widgets/42"}},{type:"query",id:3,offset:11,duration:12.8,label:"SELECT widgets",stage:"action",sql:'SELECT "widgets".* FROM "widgets" WHERE "widgets"."account_id" = ?'},{type:"outgoing_request",id:4,offset:26,duration:40.1,label:"GET api.stripe.com",stage:"action",detail:{method:"GET",url:"https://api.stripe.com/v1/charges",status:200}},{type:"view_render",id:5,offset:68,duration:6.5,label:"widgets/index.html.erb",stage:"render"},{type:"enqueued_job",id:6,offset:70,duration:null,label:"WidgetSyncJob",stage:"render"}],rt={type:"exception",id:7,offset:66.4,duration:null,label:"NoMethodError: undefined method `total' for nil",stage:"action",source:"app/controllers/widgets_controller.rb:31"};function ot(){const e=N.c(68),t=me(),o=t==="braking"||t==="held",n=t==="held";let a;e[0]!==n?(a=n?[...ce,rt]:ce,e[0]=n,e[1]=a):a=e[1];const c=a,i=t==="held"?"new":t==="caution"||t==="clear"?"resolved":null;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=new Date().toISOString(),e[2]=d):d=e[2];let r;e[3]!==o?(r=s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(ve,{lastSeenAt:d,erroring:o}),"storefront · production"]}),e[3]=o,e[4]=r):r=e[4];const l=n?"bg-danger/15 text-danger":"bg-live/15 text-live";let m;e[5]!==l?(m=z("rounded px-1.5 py-0.5 font-semibold transition-colors duration-500",l),e[5]=l,e[6]=m):m=e[6];const f=n?"500":"200";let h;e[7]!==m||e[8]!==f?(h=s.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 font-mono text-xs",children:["GET /widgets",s.jsx("span",{className:m,children:f})]}),e[7]=m,e[8]=f,e[9]=h):h=e[9];const g=i?"translate-x-0":"translate-x-[calc(100%+2px)]";let u;e[10]!==g?(u=z("bg-popover absolute right-0 flex items-center gap-2 border-l px-3 text-xs shadow-[-12px_0_16px_-8px_rgba(0,0,0,.5)] transition-transform duration-500 ease-out motion-reduce:transition-none","max-md:bottom-2.5 max-md:gap-1.5 max-md:rounded-l-md max-md:border-y max-md:px-2.5 max-md:py-1.5 max-md:text-[11px] md:inset-y-0",g),e[10]=g,e[11]=u):u=e[11];const b=i==="resolved"?"bg-live/15 text-live":"bg-danger/15 text-danger";let x;e[12]!==b?(x=z("flex size-6 shrink-0 items-center justify-center rounded-full",b),e[12]=b,e[13]=x):x=e[13];let y;e[14]!==i?(y=i==="resolved"?s.jsx(Le,{className:"size-3.5"}):s.jsx(Ne,{className:"size-3.5"}),e[14]=i,e[15]=y):y=e[15];let p;e[16]!==x||e[17]!==y?(p=s.jsx("span",{className:x,children:y}),e[16]=x,e[17]=y,e[18]=p):p=e[18];const w=i==="resolved"?"SF-142 resolved":"New issue SF-142";let j;e[19]!==w?(j=s.jsx("span",{className:"block leading-tight font-medium",children:w}),e[19]=w,e[20]=j):j=e[20];const S=i==="resolved"?"Slack #storefront-alerts · just now":"Sent to Slack #storefront-alerts";let _;e[21]!==S?(_=s.jsx("span",{className:"max-md:hidden",children:S}),e[21]=S,e[22]=_):_=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("span",{className:"md:hidden",children:"Slack #storefront-alerts"}),e[23]=C):C=e[23];let E;e[24]!==_?(E=s.jsxs("span",{className:"text-muted-foreground block leading-tight",children:[_,C]}),e[24]=_,e[25]=E):E=e[25];let $;e[26]!==j||e[27]!==E?($=s.jsxs("span",{className:"min-w-0",children:[j,E]}),e[26]=j,e[27]=E,e[28]=$):$=e[28];let A;e[29]!==p||e[30]!==$||e[31]!==u?(A=s.jsxs("div",{"aria-live":"polite",className:u,children:[p,$]}),e[29]=p,e[30]=$,e[31]=u,e[32]=A):A=e[32];let R;e[33]!==r||e[34]!==A||e[35]!==h?(R=s.jsxs(ge,{className:"relative flex-row items-center justify-between overflow-hidden border-b pb-6 max-md:flex-wrap max-md:gap-y-3",children:[r,h,A]}),e[33]=r,e[34]=A,e[35]=h,e[36]=R):R=e[36];let F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(J,{label:"p50 latency",value:"42ms",hint:"last 24h"}),e[37]=F):F=e[37];const V=n?"2.1%":"0.4%",X=n?"destructive":"success",Y=n?"3 of 143 requests":"last 24h";let T;e[38]!==V||e[39]!==X||e[40]!==Y?(T=s.jsx(J,{label:"error rate",value:V,tone:X,hint:Y}),e[38]=V,e[39]=X,e[40]=Y,e[41]=T):T=e[41];let H;e[42]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(J,{label:"requests/min",value:"1.2k"}),e[42]=H):H=e[42];const Z=n?"1":"0",ee=n?"destructive":"success";let I;e[43]!==Z||e[44]!==ee?(I=s.jsx(J,{label:"open issues",value:Z,tone:ee}),e[43]=Z,e[44]=ee,e[45]=I):I=e[45];let L;e[46]!==T||e[47]!==I?(L=s.jsxs(Re,{children:[F,T,H,I]}),e[46]=T,e[47]=I,e[48]=L):L=e[48];const te=n?"border-danger/40 bg-danger/5":"bg-muted/30";let M;e[49]!==te?(M=z("flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-xs transition-colors duration-500",te),e[49]=te,e[50]=M):M=e[50];let B;e[51]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("span",{className:"shrink-0 font-mono font-semibold",children:"SF-142"}),s.jsx("span",{className:"truncate",children:"NoMethodError in WidgetsController#index"})]}),e[51]=B):B=e[51];let W;e[52]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("span",{className:"hidden sm:inline",children:"3 events"}),e[52]=W):W=e[52];const se=n?"open":"resolved";let P;e[53]!==se?(P=s.jsxs("div",{className:"text-muted-foreground flex shrink-0 items-center gap-3 font-mono",children:[W,s.jsx(Te,{status:se})]}),e[53]=se,e[54]=P):P=e[54];let D;e[55]!==M||e[56]!==P?(D=s.jsxs("div",{className:M,children:[B,P]}),e[55]=M,e[56]=P,e[57]=D):D=e[57];let G;e[58]===Symbol.for("react.memo_cache_sentinel")?(G={action:66,render:24},e[58]=G):G=e[58];let O;e[59]!==c?(O=s.jsx(Ie,{entries:c,total:90,stages:G}),e[59]=c,e[60]=O):O=e[60];let q;e[61]!==L||e[62]!==D||e[63]!==O?(q=s.jsxs(ie,{className:"grid gap-6",children:[L,D,O]}),e[61]=L,e[62]=D,e[63]=O,e[64]=q):q=e[64];let U;return e[65]!==R||e[66]!==q?(U=s.jsx("section",{className:"relative z-20 mx-auto -mt-8 max-w-5xl px-6 pb-16 md:-mt-4",children:s.jsxs(oe,{className:"overflow-hidden",children:[R,q]})}),e[65]=R,e[66]=q,e[67]=U):U=e[67],U}const it=110;function k(e){const t=N.c(8),{step:o,className:n,children:a}=e,c=o===void 0?0:o;let i;t[0]!==n?(i=z("motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-2 motion-safe:fill-mode-both motion-safe:duration-700 motion-safe:ease-out",n),t[0]=n,t[1]=i):i=t[1];const d=`${c*it}ms`;let r;t[2]!==d?(r={animationDelay:d},t[2]=d,t[3]=r):r=t[3];let l;return t[4]!==a||t[5]!==i||t[6]!==r?(l=s.jsx("div",{className:i,style:r,children:a}),t[4]=a,t[5]=i,t[6]=r,t[7]=l):l=t[7],l}function St(){const e=N.c(15),{auth:t}=fe().props,o=!!t.user;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(xe,{title:"Railwatch — monitoring for Rails apps"}),e[0]=n):n=e[0];let a;e[1]!==o?(a=s.jsx(k,{step:0,children:s.jsx(_e,{signedIn:o})}),e[1]=o,e[2]=a):a=e[2];let c;e[3]!==o?(c=s.jsx(k,{step:1,children:s.jsx(et,{signedIn:o})}),e[3]=o,e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(k,{step:2,children:s.jsx(ot,{})}),e[5]=i):i=e[5];let d;e[6]!==c?(d=s.jsxs(Ye,{children:[c,i]}),e[6]=c,e[7]=d):d=e[7];let r;e[8]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(k,{step:3,children:s.jsx(Oe,{})}),e[8]=r):r=e[8];let l;e[9]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(k,{step:4,children:s.jsx(Pe,{})}),e[9]=l):l=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(k,{step:4,children:s.jsx(st,{})}),e[10]=m):m=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(k,{step:5,children:s.jsx(ke,{})}),e[11]=f):f=e[11];let h;return e[12]!==a||e[13]!==d?(h=s.jsxs(s.Fragment,{children:[n,s.jsxs("div",{className:"dark bg-background text-foreground min-h-screen",children:[a,d,r,l,m,f]})]}),e[12]=a,e[13]=d,e[14]=h):h=e[14],h}export{St as default};
@@ -1 +1 @@
1
- import{c as te,u as se,j as s,e as Q,am as X}from"./inertia-CqnzqPVD.js";import{V as re,D as ie}from"./chart-panel-CONkZcn9.js";import{D as Z}from"./data-table-CVKR2wkq.js";import{E as le}from"./empty-state-Bn48Gplm.js";import{F as ne}from"./filter-bar-xcbJC93z.js";import{E as oe,P as ae}from"./env-layout-CKLL8Ds7.js";import{u as ce,P as me}from"./percentile-picker-BxIVblBw.js";import{S as G}from"./sort-header-CPM6fhXv.js";import{S as ue}from"./sparkline-cell-CXCxXPWt.js";import{a as de,S as pe}from"./stat-BNEfE8X1.js";import{S as fe}from"./status-badge-D0aylrM5.js";import{c as ee,m as o,p as he,w as xe,b as ge}from"./format-B9SDkrWj.js";import{Y as be}from"./app-layout-2xAKndVD.js";import"./series-chart-D6upsrSn.js";import"./chart-hover-2yZG3w2u.js";import"./chart-C4k7Ub9W.js";import"./badge-Dv7I-ebP.js";import"./app-wordmark-Bt6XqURo.js";import"./use-live-DWwLg1Nj.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./segmented-C4oWE73o.js";import"./label-1nSzpSB6.js";import"./arrow-up-EmePsTKP.js";import"./checkbox-DKbThbxr.js";const ye=["lcp","cls","inp","ttfb"],je={lcp:"LCP",cls:"CLS",inp:"INP",ttfb:"TTFB"},ve={good:"success","needs-improvement":"warning",poor:"destructive"},_e=(t,e)=>t==="cls"?e.toFixed(2):o(e),Se=t=>[t.lcp===null?null:`LCP ${o(t.lcp)}`,t.inp===null?null:`INP ${o(t.inp)}`,t.cls===null?null:`CLS ${t.cls.toFixed(2)}`].filter(e=>e!==null).join(" · ");function dt(t){const e=te.c(80),{environment:J,window:a}=se().props,{percentile:r}=ce(),c=J.application_id,m=J.id;let M;e[0]!==c||e[1]!==m||e[2]!==t.dir||e[3]!==t.sort||e[4]!==a?(M=l=>Q.visit(X(c,m,{window:a,sort:l,dir:t.sort===l&&t.dir==="desc"?"asc":"desc"}),{preserveState:!0}),e[0]=c,e[1]=m,e[2]=t.dir,e[3]=t.sort,e[4]=a,e[5]=M):M=e[5];const i=M;let u,d,n,p;if(e[6]!==t.vitals){const l=ye.filter(L=>t.vitals[L]);u=oe,d="Visits",e[11]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{title:"Inertia visits",description:"Page-load timing measured in the browser: from router start to finish, per component, with prop payload size.",actions:s.jsx(me,{})}),e[11]=n):n=e[11],p=l.length>0?s.jsx(de,{children:l.map(L=>{const K=t.vitals[L];return s.jsx(pe,{label:je[L],value:_e(L,K.value),tone:ve[K.rating],hint:`${K.rating} · p75 of ${ee(K.samples)}`},L)})}):s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Web vitals are reported by the browser client from the initial page load; update app/frontend/lib/railwatch.ts from"," ",s.jsx("span",{className:"font-mono",children:"bin/rails generate railwatch:install"}),"."]}),e[6]=t.vitals,e[7]=u,e[8]=d,e[9]=n,e[10]=p}else u=e[7],d=e[8],n=e[9],p=e[10];let f;e[12]!==t.series?(f=s.jsx(re,{legend:"outcome",label:"Visits",seriesLabel:"Visits",data:t.series}),e[12]=t.series,e[13]=f):f=e[13];let h;e[14]!==t.series||e[15]!==r?(h=s.jsx(ie,{label:"Duration",data:t.series,percentile:r}),e[14]=t.series,e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let E,O,D;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(le,{icon:be,title:"No visits yet",description:"Call startRailwatch() from your Inertia entrypoint to track page visits."}),O={key:"c",header:"Component",cell:Ie},D={key:"trend",hideOnMobile:!0,header:"Trend",cell:Fe},e[20]=E,e[21]=O,e[22]=D):(E=e[20],O=e[21],D=e[22]);const W=t.sort==="count",H=t.dir==="asc"?"asc":"desc";let g;e[23]!==i?(g=()=>i("count"),e[23]=i,e[24]=g):g=e[24];let b;e[25]!==W||e[26]!==H||e[27]!==g?(b={key:"n",header:s.jsx(G,{label:"Visits",active:W,dir:H,onClick:g}),align:"right",cell:$e},e[25]=W,e[26]=H,e[27]=g,e[28]=b):b=e[28];let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T={key:"e",hideOnMobile:!0,header:"Errors",align:"right",cell:Te},e[29]=T):T=e[29];const U=t.sort==="avg",z=t.dir==="asc"?"asc":"desc";let y;e[30]!==i?(y=()=>i("avg"),e[30]=i,e[31]=y):y=e[31];let j;e[32]!==U||e[33]!==z||e[34]!==y?(j={key:"avg",hideOnMobile:!0,header:s.jsx(G,{label:"Avg",active:U,dir:z,onClick:y}),align:"right",cell:De},e[32]=U,e[33]=z,e[34]=y,e[35]=j):j=e[35];let $,F;e[36]===Symbol.for("react.memo_cache_sentinel")?($={key:"lcp",hideOnMobile:!0,header:"LCP",align:"right",cell:Oe},F={key:"inp",hideOnMobile:!0,header:"INP",align:"right",cell:Ee},e[36]=$,e[37]=F):($=e[36],F=e[37]);const A=t.sort===r,Y=t.dir==="asc"?"asc":"desc";let v;e[38]!==r||e[39]!==i?(v=()=>i(r),e[38]=r,e[39]=i,e[40]=v):v=e[40];let _;e[41]!==r||e[42]!==A||e[43]!==Y||e[44]!==v?(_=s.jsx(G,{label:r,active:A,dir:Y,onClick:v}),e[41]=r,e[42]=A,e[43]=Y,e[44]=v,e[45]=_):_=e[45];let S;e[46]!==r?(S=l=>s.jsx("span",{className:"font-semibold",children:o(l[r])}),e[46]=r,e[47]=S):S=e[47];let k;e[48]!==r||e[49]!==_||e[50]!==S?(k={key:r,header:_,align:"right",cell:S},e[48]=r,e[49]=_,e[50]=S,e[51]=k):k=e[51];let P;e[52]!==b||e[53]!==j||e[54]!==k?(P=[O,D,b,T,j,$,F,k],e[52]=b,e[53]=j,e[54]=k,e[55]=P):P=e[55];let w;e[56]!==t.components||e[57]!==P?(w=s.jsx(Z,{rows:t.components,rowKey:Re,empty:E,columns:P}),e[56]=t.components,e[57]=P,e[58]=w):w=e[58];let I;e[59]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[59]=I):I=e[59];let R;e[60]===Symbol.for("react.memo_cache_sentinel")?(R=[{key:"component",label:"Component"}],e[60]=R):R=e[60];let C;e[61]!==c||e[62]!==m||e[63]!==a?(C=l=>Q.visit(X(c,m,{window:a,q:l||void 0}),{preserveState:!0}),e[61]=c,e[62]=m,e[63]=a,e[64]=C):C=e[64];let N;e[65]!==t.q||e[66]!==C?(N=s.jsx(ne,{value:t.q,fields:R,onChange:C,placeholder:"component:Widgets/Show"}),e[65]=t.q,e[66]=C,e[67]=N):N=e[67];let q;e[68]===Symbol.for("react.memo_cache_sentinel")?(q=[{key:"when",header:"When",cell:Le},{key:"st",header:"",cell:Ve},{key:"c",header:"Component",cell:Ne},{key:"u",hideOnMobile:!0,header:"URL",cell:Ce},{key:"v",hideOnMobile:!0,header:"Vitals",cell:we},{key:"b",hideOnMobile:!0,header:"Props",align:"right",cell:Pe},{key:"d",header:"Duration",align:"right",cell:ke}],e[68]=q):q=e[68];let V;e[69]!==t.recent?(V=s.jsx(Z,{rows:t.recent,rowKey:Me,columns:q}),e[69]=t.recent,e[70]=V):V=e[70];let B;return e[71]!==u||e[72]!==d||e[73]!==n||e[74]!==w||e[75]!==p||e[76]!==N||e[77]!==V||e[78]!==x?(B=s.jsxs(u,{title:d,children:[n,p,x,w,I,N,V]}),e[71]=u,e[72]=d,e[73]=n,e[74]=w,e[75]=p,e[76]=N,e[77]=V,e[78]=x,e[79]=B):B=e[79],B}function ke(t){return o(t.duration)}function Pe(t){return ge(t.props_bytes)}function we(t){return s.jsx("span",{className:"text-muted-foreground font-mono text-[11px] tabular-nums",children:Se(t)})}function Ce(t){return s.jsxs("span",{className:"font-mono text-xs",children:[t.method.toUpperCase()," ",t.url]})}function Ne(t){return s.jsxs("span",{className:"font-mono text-xs",children:[t.component,t.partial&&s.jsxs("span",{className:"text-muted-foreground",children:[" ","(partial: ",t.only.join(", "),")"]})]})}function Ve(t){return s.jsx(fe,{label:t.status,outcome:t.status==="error"?"failed":t.status==="success"?"processed":void 0})}function Le(t){return s.jsx("span",{className:"text-xs",children:xe(t.occurred_at)})}function Me(t){return t.id}function Ee(t){return o(t.inp)}function Oe(t){return o(t.lcp)}function De(t){return o(t.avg)}function Te(t){return he(t.errors,t.count)}function $e(t){return ee(t.count)}function Fe(t){return s.jsx(ue,{data:t.sparkline})}function Ie(t){return s.jsx("span",{className:"font-mono text-xs",children:t.name})}function Re(t){return t.group_hash}export{dt as default};
1
+ import{c as te,u as se,j as s,e as Q,am as X}from"./inertia-Cuyz2ZHO.js";import{V as re,D as ie}from"./chart-panel-CC49WTQL.js";import{D as Z}from"./data-table-CzKTEE-O.js";import{E as le}from"./empty-state-CW4wclK_.js";import{F as ne}from"./filter-bar-CJDjWFib.js";import{E as oe,P as ae}from"./env-layout-Kz7wks1x.js";import{u as ce,P as me}from"./percentile-picker-CeQgllxD.js";import{S as G}from"./sort-header-mEJUM3Av.js";import{S as ue}from"./sparkline-cell-Dwg7awwh.js";import{a as de,S as pe}from"./stat-ZtxGU8lE.js";import{S as fe}from"./status-badge-CH5P-Xkj.js";import{c as ee,m as o,p as he,w as xe,b as ge}from"./format-B9SDkrWj.js";import{Y as be}from"./app-layout-Zc0v-hYh.js";import"./series-chart-gnrzhmM6.js";import"./chart-hover-CfoZUY4J.js";import"./chart-DWh7l8yM.js";import"./badge-DRae8XwK.js";import"./app-wordmark-BA_60AVb.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./arrow-up-CLQ-7heQ.js";import"./checkbox-DPkLUiwM.js";const ye=["lcp","cls","inp","ttfb"],je={lcp:"LCP",cls:"CLS",inp:"INP",ttfb:"TTFB"},ve={good:"success","needs-improvement":"warning",poor:"destructive"},_e=(t,e)=>t==="cls"?e.toFixed(2):o(e),Se=t=>[t.lcp===null?null:`LCP ${o(t.lcp)}`,t.inp===null?null:`INP ${o(t.inp)}`,t.cls===null?null:`CLS ${t.cls.toFixed(2)}`].filter(e=>e!==null).join(" · ");function dt(t){const e=te.c(80),{environment:J,window:a}=se().props,{percentile:r}=ce(),c=J.application_id,m=J.id;let M;e[0]!==c||e[1]!==m||e[2]!==t.dir||e[3]!==t.sort||e[4]!==a?(M=l=>Q.visit(X(c,m,{window:a,sort:l,dir:t.sort===l&&t.dir==="desc"?"asc":"desc"}),{preserveState:!0}),e[0]=c,e[1]=m,e[2]=t.dir,e[3]=t.sort,e[4]=a,e[5]=M):M=e[5];const i=M;let u,d,n,p;if(e[6]!==t.vitals){const l=ye.filter(L=>t.vitals[L]);u=oe,d="Visits",e[11]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ae,{title:"Inertia visits",description:"Page-load timing measured in the browser: from router start to finish, per component, with prop payload size.",actions:s.jsx(me,{})}),e[11]=n):n=e[11],p=l.length>0?s.jsx(de,{children:l.map(L=>{const K=t.vitals[L];return s.jsx(pe,{label:je[L],value:_e(L,K.value),tone:ve[K.rating],hint:`${K.rating} · p75 of ${ee(K.samples)}`},L)})}):s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Web vitals are reported by the browser client from the initial page load; update app/frontend/lib/railwatch.ts from"," ",s.jsx("span",{className:"font-mono",children:"bin/rails generate railwatch:install"}),"."]}),e[6]=t.vitals,e[7]=u,e[8]=d,e[9]=n,e[10]=p}else u=e[7],d=e[8],n=e[9],p=e[10];let f;e[12]!==t.series?(f=s.jsx(re,{legend:"outcome",label:"Visits",seriesLabel:"Visits",data:t.series}),e[12]=t.series,e[13]=f):f=e[13];let h;e[14]!==t.series||e[15]!==r?(h=s.jsx(ie,{label:"Duration",data:t.series,percentile:r}),e[14]=t.series,e[15]=r,e[16]=h):h=e[16];let x;e[17]!==f||e[18]!==h?(x=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[f,h]}),e[17]=f,e[18]=h,e[19]=x):x=e[19];let E,O,D;e[20]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(le,{icon:be,title:"No visits yet",description:"Call startRailwatch() from your Inertia entrypoint to track page visits."}),O={key:"c",header:"Component",cell:Ie},D={key:"trend",hideOnMobile:!0,header:"Trend",cell:Fe},e[20]=E,e[21]=O,e[22]=D):(E=e[20],O=e[21],D=e[22]);const W=t.sort==="count",H=t.dir==="asc"?"asc":"desc";let g;e[23]!==i?(g=()=>i("count"),e[23]=i,e[24]=g):g=e[24];let b;e[25]!==W||e[26]!==H||e[27]!==g?(b={key:"n",header:s.jsx(G,{label:"Visits",active:W,dir:H,onClick:g}),align:"right",cell:$e},e[25]=W,e[26]=H,e[27]=g,e[28]=b):b=e[28];let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T={key:"e",hideOnMobile:!0,header:"Errors",align:"right",cell:Te},e[29]=T):T=e[29];const U=t.sort==="avg",z=t.dir==="asc"?"asc":"desc";let y;e[30]!==i?(y=()=>i("avg"),e[30]=i,e[31]=y):y=e[31];let j;e[32]!==U||e[33]!==z||e[34]!==y?(j={key:"avg",hideOnMobile:!0,header:s.jsx(G,{label:"Avg",active:U,dir:z,onClick:y}),align:"right",cell:De},e[32]=U,e[33]=z,e[34]=y,e[35]=j):j=e[35];let $,F;e[36]===Symbol.for("react.memo_cache_sentinel")?($={key:"lcp",hideOnMobile:!0,header:"LCP",align:"right",cell:Oe},F={key:"inp",hideOnMobile:!0,header:"INP",align:"right",cell:Ee},e[36]=$,e[37]=F):($=e[36],F=e[37]);const A=t.sort===r,Y=t.dir==="asc"?"asc":"desc";let v;e[38]!==r||e[39]!==i?(v=()=>i(r),e[38]=r,e[39]=i,e[40]=v):v=e[40];let _;e[41]!==r||e[42]!==A||e[43]!==Y||e[44]!==v?(_=s.jsx(G,{label:r,active:A,dir:Y,onClick:v}),e[41]=r,e[42]=A,e[43]=Y,e[44]=v,e[45]=_):_=e[45];let S;e[46]!==r?(S=l=>s.jsx("span",{className:"font-semibold",children:o(l[r])}),e[46]=r,e[47]=S):S=e[47];let k;e[48]!==r||e[49]!==_||e[50]!==S?(k={key:r,header:_,align:"right",cell:S},e[48]=r,e[49]=_,e[50]=S,e[51]=k):k=e[51];let P;e[52]!==b||e[53]!==j||e[54]!==k?(P=[O,D,b,T,j,$,F,k],e[52]=b,e[53]=j,e[54]=k,e[55]=P):P=e[55];let w;e[56]!==t.components||e[57]!==P?(w=s.jsx(Z,{rows:t.components,rowKey:Re,empty:E,columns:P}),e[56]=t.components,e[57]=P,e[58]=w):w=e[58];let I;e[59]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[59]=I):I=e[59];let R;e[60]===Symbol.for("react.memo_cache_sentinel")?(R=[{key:"component",label:"Component"}],e[60]=R):R=e[60];let C;e[61]!==c||e[62]!==m||e[63]!==a?(C=l=>Q.visit(X(c,m,{window:a,q:l||void 0}),{preserveState:!0}),e[61]=c,e[62]=m,e[63]=a,e[64]=C):C=e[64];let N;e[65]!==t.q||e[66]!==C?(N=s.jsx(ne,{value:t.q,fields:R,onChange:C,placeholder:"component:Widgets/Show"}),e[65]=t.q,e[66]=C,e[67]=N):N=e[67];let q;e[68]===Symbol.for("react.memo_cache_sentinel")?(q=[{key:"when",header:"When",cell:Le},{key:"st",header:"",cell:Ve},{key:"c",header:"Component",cell:Ne},{key:"u",hideOnMobile:!0,header:"URL",cell:Ce},{key:"v",hideOnMobile:!0,header:"Vitals",cell:we},{key:"b",hideOnMobile:!0,header:"Props",align:"right",cell:Pe},{key:"d",header:"Duration",align:"right",cell:ke}],e[68]=q):q=e[68];let V;e[69]!==t.recent?(V=s.jsx(Z,{rows:t.recent,rowKey:Me,columns:q}),e[69]=t.recent,e[70]=V):V=e[70];let B;return e[71]!==u||e[72]!==d||e[73]!==n||e[74]!==w||e[75]!==p||e[76]!==N||e[77]!==V||e[78]!==x?(B=s.jsxs(u,{title:d,children:[n,p,x,w,I,N,V]}),e[71]=u,e[72]=d,e[73]=n,e[74]=w,e[75]=p,e[76]=N,e[77]=V,e[78]=x,e[79]=B):B=e[79],B}function ke(t){return o(t.duration)}function Pe(t){return ge(t.props_bytes)}function we(t){return s.jsx("span",{className:"text-muted-foreground font-mono text-[11px] tabular-nums",children:Se(t)})}function Ce(t){return s.jsxs("span",{className:"font-mono text-xs",children:[t.method.toUpperCase()," ",t.url]})}function Ne(t){return s.jsxs("span",{className:"font-mono text-xs",children:[t.component,t.partial&&s.jsxs("span",{className:"text-muted-foreground",children:[" ","(partial: ",t.only.join(", "),")"]})]})}function Ve(t){return s.jsx(fe,{label:t.status,outcome:t.status==="error"?"failed":t.status==="success"?"processed":void 0})}function Le(t){return s.jsx("span",{className:"text-xs",children:xe(t.occurred_at)})}function Me(t){return t.id}function Ee(t){return o(t.inp)}function Oe(t){return o(t.lcp)}function De(t){return o(t.avg)}function Te(t){return he(t.errors,t.count)}function $e(t){return ee(t.count)}function Fe(t){return s.jsx(ue,{data:t.sparkline})}function Ie(t){return s.jsx("span",{className:"font-mono text-xs",children:t.name})}function Re(t){return t.group_hash}export{dt as default};
@@ -0,0 +1 @@
1
+ import{c as Je,u as Ce,j as l,X as je,K as Ee,Y as Ae,e as fe,L as Me}from"./inertia-Cuyz2ZHO.js";import{C as Te}from"./chart-hover-CfoZUY4J.js";import{V as Ie}from"./chart-panel-CC49WTQL.js";import{C as Fe}from"./cursor-load-more-Ddwxe5dZ.js";import{D as xe}from"./data-table-CzKTEE-O.js";import{E as ke}from"./empty-state-CW4wclK_.js";import{F as Ke}from"./filter-bar-CJDjWFib.js";import{O as ve}from"./origin-identity-BYt2uiuo.js";import{P as He,E as Le}from"./env-layout-Kz7wks1x.js";import{u as De,P as Re}from"./percentile-picker-CeQgllxD.js";import{S as Be,W as we}from"./app-layout-Zc0v-hYh.js";import{S as Qe}from"./sparkline-cell-Dwg7awwh.js";import{S as ge}from"./status-badge-CH5P-Xkj.js";import{C as Se,a as qe,b as Ne,c as Oe}from"./card-DPjFKfen.js";import{m as he,c as Pe,w as Ve,p as We}from"./format-B9SDkrWj.js";import"./series-chart-gnrzhmM6.js";import"./chart-DWh7l8yM.js";import"./app-wordmark-BA_60AVb.js";import"./badge-DRae8XwK.js";import"./tenant-path-CQoP-BeF.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./checkbox-DPkLUiwM.js";function Ht(t){const e=Je.c(114),{environment:_e,window:s,range:n}=Ce().props,{percentile:c}=De(),r=_e.application_id,i=_e.id;let C;e[0]!==n?.from||e[1]!==n?.to||e[2]!==s?(C=s==="custom"?{from:n?.from,to:n?.to}:{window:s},e[0]=n?.from,e[1]=n?.to,e[2]=s,e[3]=C):C=e[3];const a=C;let E;e[4]!==n||e[5]!==a?(E=n?{from:n.from,to:n.to}:a,e[4]=n,e[5]=a,e[6]=E):E=e[6];const pe=E;let A;e[7]!==r||e[8]!==pe||e[9]!==i||e[10]!==t.pagination.limit||e[11]!==t.q?(A=o=>je(r,i,{...pe,q:t.q||void 0,cursor:o,limit:t.pagination.limit}),e[7]=r,e[8]=pe,e[9]=i,e[10]=t.pagination.limit,e[11]=t.q,e[12]=A):A=e[12];const be=A;let M;e[13]!==r||e[14]!==i?(M=o=>Ee(r,i,o.execution_id),e[13]=r,e[14]=i,e[15]=M):M=e[15];const J=M;let T;e[16]!==r||e[17]!==i||e[18]!==t.q||e[19]!==a?(T=o=>Ae(r,i,o.group_hash,{...a,q:t.q||void 0}),e[16]=r,e[17]=i,e[18]=t.q,e[19]=a,e[20]=T):T=e[20];const m=T;let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=l.jsx(He,{title:"Jobs",description:"Active Job attempts by class and queue, with queue latency and failures.",actions:l.jsxs(l.Fragment,{children:[l.jsx(Be,{page:"jobs"}),l.jsx(Re,{})]})}),e[21]=I):I=e[21];let u;e[22]!==t.deploys||e[23]!==t.series?(u=l.jsx(Ie,{legend:"job",label:"Job attempts",seriesLabel:"Attempts",data:t.series,deploys:t.deploys}),e[22]=t.deploys,e[23]=t.series,e[24]=u):u=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=l.jsx(Ne,{children:l.jsx(Oe,{children:"Queues"})}),e[25]=F):F=e[25];let K;e[26]===Symbol.for("react.memo_cache_sentinel")?(K=[{key:"q",header:"Queue",cell:mt},{key:"n",header:"Attempts",align:"right",cell:ct},{key:"lat",hideOnMobile:!0,header:"Avg wait",align:"right",cell:at},{key:"f",header:"Failed",align:"right",cell:st}],e[26]=K):K=e[26];let d;e[27]!==t.queues?(d=l.jsxs(Se,{className:"lg:col-span-1",children:[F,l.jsx(qe,{children:l.jsx(xe,{rows:t.queues,rowKey:ut,columns:K})})]}),e[27]=t.queues,e[28]=d):d=e[28];let H;e[29]===Symbol.for("react.memo_cache_sentinel")?(H=l.jsx(Ne,{children:l.jsx(Oe,{children:"Recent runs"})}),e[29]=H):H=e[29];let L,D,R,B,Q;e[30]===Symbol.for("react.memo_cache_sentinel")?(L={key:"after",label:"After"},D={key:"before",label:"Before"},R={key:"user",label:"User"},B={key:"tenant",label:"Tenant"},Q={key:"deploy",label:"Deploy"},e[30]=L,e[31]=D,e[32]=R,e[33]=B,e[34]=Q):(L=e[30],D=e[31],R=e[32],B=e[33],Q=e[34]);let V,W,U,X;e[35]===Symbol.for("react.memo_cache_sentinel")?(V={key:"kind",label:"Execution kind",options:["job"]},W={key:"queue",label:"Queue"},U={key:"class",label:"Job class"},X={key:"job_id",label:"Job ID"},e[35]=V,e[36]=W,e[37]=U,e[38]=X):(V=e[35],W=e[36],U=e[37],X=e[38]);let Y;e[39]===Symbol.for("react.memo_cache_sentinel")?(Y=[L,D,R,B,Q,V,W,U,X,{key:"outcome",label:"Outcome",options:["processed","failed"]}],e[39]=Y):Y=e[39];let f;e[40]!==r||e[41]!==i||e[42]!==a?(f=o=>fe.visit(je(r,i,{...a,q:o||void 0}),{only:["recent","pagination","q"],preserveState:!0,reset:["recent"]}),e[40]=r,e[41]=i,e[42]=a,e[43]=f):f=e[43];let h;e[44]!==t.q||e[45]!==f?(h=l.jsx(Ke,{value:t.q,fields:Y,onChange:f,placeholder:"queue:default outcome:failed"}),e[44]=t.q,e[45]=f,e[46]=h):h=e[46];let $;e[47]===Symbol.for("react.memo_cache_sentinel")?($=l.jsx(ke,{icon:we,title:"No job runs in this window",description:"Job classes appear here once Active Job executions are reported."}),e[47]=$):$=e[47];let p,b;e[48]!==J?(p=o=>fe.visit(J(o)),b={onOpen:(o,ye)=>ye?.newTab?globalThis.window.open(J(o),"_blank"):fe.visit(J(o))},e[48]=J,e[49]=p,e[50]=b):(p=e[49],b=e[50]);let z,G,Z,ee;e[51]===Symbol.for("react.memo_cache_sentinel")?(z={key:"when",header:"When",cell:it},G={key:"name",header:"Job",grow:!0,cell:rt},Z={key:"st",header:"Outcome",cell:ot},ee={key:"att",hideOnMobile:!0,header:"Attempt",align:"right",cell:lt},e[51]=z,e[52]=G,e[53]=Z,e[54]=ee):(z=e[51],G=e[52],Z=e[53],ee=e[54]);let y;e[55]!==r||e[56]!==i||e[57]!==n||e[58]!==s?(y={key:"user",className:"hidden 2xl:table-cell",header:"Origin user",cell:o=>l.jsx(ve,{...o,applicationId:r,environmentId:i,kind:"user",range:n,window:s})},e[55]=r,e[56]=i,e[57]=n,e[58]=s,e[59]=y):y=e[59];let x;e[60]!==r||e[61]!==i||e[62]!==n||e[63]!==s?(x={key:"tenant",className:"hidden 2xl:table-cell",header:"Origin tenant",cell:o=>l.jsx(ve,{...o,applicationId:r,environmentId:i,kind:"tenant",range:n,window:s})},e[60]=r,e[61]=i,e[62]=n,e[63]=s,e[64]=x):x=e[64];let te;e[65]===Symbol.for("react.memo_cache_sentinel")?(te={key:"ex",hideOnMobile:!0,header:"Exception",className:"max-w-48",cell:tt},e[65]=te):te=e[65];let g;e[66]!==y||e[67]!==x?(g=[z,G,Z,ee,y,x,te],e[66]=y,e[67]=x,e[68]=g):g=e[68];let _;e[69]!==t.recent||e[70]!==p||e[71]!==b||e[72]!==g?(_=l.jsx(xe,{rows:t.recent,rowKey:nt,empty:$,onRowClick:p,keyboardNav:b,columns:g}),e[69]=t.recent,e[70]=p,e[71]=b,e[72]=g,e[73]=_):_=e[73];let le;e[74]===Symbol.for("react.memo_cache_sentinel")?(le=["recent","pagination"],e[74]=le):le=e[74];let j;e[75]!==t.pagination||e[76]!==be?(j=l.jsx(Fe,{meta:t.pagination,href:be,only:le}),e[75]=t.pagination,e[76]=be,e[77]=j):j=e[77];let k;e[78]!==h||e[79]!==_||e[80]!==j?(k=l.jsxs(Se,{className:"lg:col-span-2",children:[H,l.jsxs(qe,{className:"space-y-3",children:[h,_,j]})]}),e[78]=h,e[79]=_,e[80]=j,e[81]=k):k=e[81];let v;e[82]!==k||e[83]!==d?(v=l.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[d,k]}),e[82]=k,e[83]=d,e[84]=v):v=e[84];let oe;e[85]===Symbol.for("react.memo_cache_sentinel")?(oe=l.jsx(ke,{icon:we,title:"No job attempts in this window",description:"Individual job executions appear here as they run."}),e[85]=oe):oe=e[85];let w;e[86]!==m?(w={onOpen:(o,ye)=>ye?.newTab?globalThis.window.open(m(o),"_blank"):fe.visit(m(o))},e[86]=m,e[87]=w):w=e[87];let S;e[88]!==m?(S={key:"name",header:"Job",grow:!0,cell:o=>l.jsx(Me,{className:"font-mono text-xs hover:underline",href:m(o),children:o.name})},e[88]=m,e[89]=S):S=e[89];let re,ie,ne,se,ae;e[90]===Symbol.for("react.memo_cache_sentinel")?(re={key:"trend",hideOnMobile:!0,header:"Trend",cell:Ge},ie={key:"n",header:"Attempts",align:"right",cell:ze},ne={key:"f",header:"Failed",align:"right",cell:$e},se={key:"fr",hideOnMobile:!0,header:"Failure %",align:"right",cell:Ye},ae={key:"avg",hideOnMobile:!0,header:"Avg",align:"right",cell:Xe},e[90]=re,e[91]=ie,e[92]=ne,e[93]=se,e[94]=ae):(re=e[90],ie=e[91],ne=e[92],se=e[93],ae=e[94]);let q;e[95]!==c?(q=o=>l.jsx("span",{className:"font-semibold",children:he(o[c])}),e[95]=c,e[96]=q):q=e[96];let N;e[97]!==c||e[98]!==q?(N={key:c,header:c,align:"right",cell:q},e[97]=c,e[98]=q,e[99]=N):N=e[99];let ce;e[100]===Symbol.for("react.memo_cache_sentinel")?(ce={key:"max",hideOnMobile:!0,header:"Max",align:"right",cell:Ue},e[100]=ce):ce=e[100];let O;e[101]!==S||e[102]!==N?(O=[S,re,ie,ne,se,ae,N,ce],e[101]=S,e[102]=N,e[103]=O):O=e[103];let P;e[104]!==t.classes||e[105]!==w||e[106]!==O?(P=l.jsx(xe,{rows:t.classes,rowKey:et,empty:oe,hoverKey:Ze,keyboardNav:w,columns:O}),e[104]=t.classes,e[105]=w,e[106]=O,e[107]=P):P=e[107];let me;e[108]===Symbol.for("react.memo_cache_sentinel")?(me=l.jsx(ge,{outcome:"processed"}),e[108]=me):me=e[108];let ue;e[109]===Symbol.for("react.memo_cache_sentinel")?(ue=l.jsxs("p",{className:"text-muted-foreground text-xs",children:[me," processed ·"," ",l.jsx(ge,{outcome:"failed"})," failed"]}),e[109]=ue):ue=e[109];let de;return e[110]!==v||e[111]!==P||e[112]!==u?(de=l.jsx(Le,{title:"Jobs",children:l.jsxs(Te,{children:[I,u,v,P,ue]})}),e[110]=v,e[111]=P,e[112]=u,e[113]=de):de=e[113],de}function Ue(t){return he(t.max)}function Xe(t){return he(t.avg)}function Ye(t){return We(t.errors,t.count)}function $e(t){return l.jsx("span",{className:t.errors?"text-destructive":"",children:t.errors})}function ze(t){return Pe(t.count)}function Ge(t){return l.jsx(Qe,{data:t.sparkline,hoverKey:t.group_hash})}function Ze(t){return t.group_hash}function et(t){return t.group_hash}function tt(t){return l.jsx("span",{className:"text-destructive block truncate text-xs",children:t.exception_preview})}function lt(t){return t.attempt}function ot(t){return l.jsx(ge,{outcome:t.outcome})}function rt(t){return l.jsx("span",{className:"font-mono text-xs",children:t.name})}function it(t){return l.jsx("span",{className:"text-xs",children:Ve(t.occurred_at)})}function nt(t){return t.execution_id}function st(t){return t.failed}function at(t){return he(t.avg_latency)}function ct(t){return Pe(t.count)}function mt(t){return l.jsx("span",{className:"font-mono text-xs",children:t.queue})}function ut(t){return t.queue??"-"}export{Ht as default};
@@ -1 +1 @@
1
- import{c as p,u,j as s,H as x,L as f,a7 as h,aI as j}from"./inertia-CqnzqPVD.js";import{H as g,S as v}from"./layout-D7lE1Doo.js";import{B as y}from"./badge-Dv7I-ebP.js";import{B as S}from"./app-wordmark-Bt6XqURo.js";import{A as N}from"./app-layout-2xAKndVD.js";import"./separator-Ct2UcZ2x.js";import"./index-BDVShWMs.js";import"./live-dot-UdzOfzJb.js";import"./index-C-EwH4lO.js";import"./checkbox-DKbThbxr.js";import"./label-1nSzpSB6.js";const d=[{title:"Sessions",href:j()}];function R(m){const e=p.c(9),{sessions:n}=m,{auth:a}=u().props;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{title:d[d.length-1].title}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(g,{title:"Sessions",description:"Manage your active sessions across devices"}),e[1]=l):l=e[1];let i;if(e[2]!==a||e[3]!==n){let c;e[5]!==a?(c=t=>s.jsx("div",{className:"flex flex-col space-y-2 rounded-lg border p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"font-medium",children:[t.user_agent,t.id===a.session.id&&s.jsx(y,{variant:"secondary",className:"ml-2",children:"Current"})]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["IP: ",t.ip_address]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Active since:"," ",new Date(t.created_at).toLocaleString()]})]}),t.id!==a.session.id&&s.jsx(S,{variant:"destructive",asChild:!0,children:s.jsx(f,{method:"delete",href:h({id:t.id}),as:"button",children:"Log out"})})]})},t.id),e[5]=a,e[6]=c):c=e[6],i=n.map(c),e[2]=a,e[3]=n,e[4]=i}else i=e[4];let o;return e[7]!==i?(o=s.jsxs(N,{breadcrumbs:d,children:[r,s.jsx(v,{children:s.jsxs("div",{className:"space-y-6",children:[l,s.jsx("div",{className:"space-y-4",children:i})]})})]}),e[7]=i,e[8]=o):o=e[8],o}export{R as default};
1
+ import{c as p,u,j as s,H as x,L as f,a7 as h,aI as j}from"./inertia-Cuyz2ZHO.js";import{H as g,S as v}from"./layout-Cueyl7c5.js";import{B as y}from"./badge-DRae8XwK.js";import{B as S}from"./app-wordmark-BA_60AVb.js";import{A as N}from"./app-layout-Zc0v-hYh.js";import"./separator-D5I0UCB5.js";import"./index-CBip6V4z.js";import"./live-dot-BZgYTYdt.js";import"./index-BfbSo01U.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";const d=[{title:"Sessions",href:j()}];function R(m){const e=p.c(9),{sessions:n}=m,{auth:a}=u().props;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(x,{title:d[d.length-1].title}),e[0]=r):r=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(g,{title:"Sessions",description:"Manage your active sessions across devices"}),e[1]=l):l=e[1];let i;if(e[2]!==a||e[3]!==n){let c;e[5]!==a?(c=t=>s.jsx("div",{className:"flex flex-col space-y-2 rounded-lg border p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:"font-medium",children:[t.user_agent,t.id===a.session.id&&s.jsx(y,{variant:"secondary",className:"ml-2",children:"Current"})]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["IP: ",t.ip_address]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Active since:"," ",new Date(t.created_at).toLocaleString()]})]}),t.id!==a.session.id&&s.jsx(S,{variant:"destructive",asChild:!0,children:s.jsx(f,{method:"delete",href:h({id:t.id}),as:"button",children:"Log out"})})]})},t.id),e[5]=a,e[6]=c):c=e[6],i=n.map(c),e[2]=a,e[3]=n,e[4]=i}else i=e[4];let o;return e[7]!==i?(o=s.jsxs(N,{breadcrumbs:d,children:[r,s.jsx(v,{children:s.jsxs("div",{className:"space-y-6",children:[l,s.jsx("div",{className:"space-y-4",children:i})]})})]}),e[7]=i,e[8]=o):o=e[8],o}export{R as default};
@@ -1 +1 @@
1
- import{c as ye,u as Se,j as s,e as ve,af as ge,aZ as je,L as _e}from"./inertia-CqnzqPVD.js";import{V as ke,D as we}from"./chart-panel-CONkZcn9.js";import{D as Pe}from"./data-table-CVKR2wkq.js";import{E as Ce}from"./empty-state-Bn48Gplm.js";import{F as qe}from"./filter-bar-xcbJC93z.js";import{P as Ee,E as Ne}from"./env-layout-CKLL8Ds7.js";import{u as De,P as Me}from"./percentile-picker-BxIVblBw.js";import{S as V}from"./sort-header-CPM6fhXv.js";import{S as Be}from"./sparkline-cell-CXCxXPWt.js";import{S as X,a as Fe}from"./stat-BNEfE8X1.js";import{c as Y,m as H}from"./format-B9SDkrWj.js";import{B as Le}from"./braces-iZ7MEfYP.js";import"./series-chart-D6upsrSn.js";import"./chart-hover-2yZG3w2u.js";import"./chart-C4k7Ub9W.js";import"./badge-Dv7I-ebP.js";import"./app-wordmark-Bt6XqURo.js";import"./app-layout-2xAKndVD.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./checkbox-DKbThbxr.js";import"./label-1nSzpSB6.js";import"./use-live-DWwLg1Nj.js";import"./segmented-C4oWE73o.js";import"./arrow-up-EmePsTKP.js";function xt(t){const e=ye.c(115),{environment:be,window:a}=Se().props,{percentile:c}=De(),l=be.application_id,n=be.id,o=t.summary.current;let $;e[0]!==l||e[1]!==n||e[2]!==t.dir||e[3]!==t.q||e[4]!==t.sort||e[5]!==a?($=i=>ve.visit(ge(l,n,{window:a,q:t.q||void 0,sort:i,dir:t.sort===i&&t.dir==="desc"?"asc":"desc"}),{preserveState:!0}),e[0]=l,e[1]=n,e[2]=t.dir,e[3]=t.q,e[4]=t.sort,e[5]=a,e[6]=$):$=e[6];const r=$;let W;e[7]!==l||e[8]!==n||e[9]!==a?(W=i=>je(l,n,i,{window:a}),e[7]=l,e[8]=n,e[9]=a,e[10]=W):W=e[10];const m=W;let Z;e[11]!==m?(Z=(i,xe)=>xe?.newTab?globalThis.window.open(m(i),"_blank"):ve.visit(m(i)),e[11]=m,e[12]=Z):Z=e[12];const ee=Z;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ee,{title:"Spans",description:"Custom spans your app recorded with Railwatch.span, grouped by name.",actions:s.jsx(Me,{})}),e[13]=z):z=e[13];let d;e[14]!==o.count?(d=Y(o.count),e[14]=o.count,e[15]=d):d=e[15];let u;e[16]!==o.count||e[17]!==t.summary.previous.count?(u={current:o.count,previous:t.summary.previous.count,goodDirection:"up"},e[16]=o.count,e[17]=t.summary.previous.count,e[18]=u):u=e[18];let f;e[19]!==d||e[20]!==u?(f=s.jsx(X,{label:"Spans",value:d,delta:u,deltaCaption:"vs previous period"}),e[19]=d,e[20]=u,e[21]=f):f=e[21];let p;e[22]!==o.errors?(p=Y(o.errors),e[22]=o.errors,e[23]=p):p=e[23];const te=o.errors?"destructive":void 0;let h;e[24]!==p||e[25]!==te?(h=s.jsx(X,{label:"Failed",value:p,tone:te}),e[24]=p,e[25]=te,e[26]=h):h=e[26];const se=o[c]/1e3;let x;e[27]!==se?(x=H(se,2),e[27]=se,e[28]=x):x=e[28];const re=o.avg/1e3;let A;e[29]!==re?(A=H(re,2),e[29]=re,e[30]=A):A=e[30];const ie=`avg ${A}`;let v;e[31]!==c||e[32]!==x||e[33]!==ie?(v=s.jsx(X,{label:c,value:x,hint:ie}),e[31]=c,e[32]=x,e[33]=ie,e[34]=v):v=e[34];const oe=o.max/1e3;let b;e[35]!==oe?(b=H(oe,2),e[35]=oe,e[36]=b):b=e[36];let g;e[37]!==b?(g=s.jsx(X,{label:"Max",value:b}),e[37]=b,e[38]=g):g=e[38];let y;e[39]!==v||e[40]!==g||e[41]!==f||e[42]!==h?(y=s.jsxs(Fe,{children:[f,h,v,g]}),e[39]=v,e[40]=g,e[41]=f,e[42]=h,e[43]=y):y=e[43];let S;e[44]!==t.series?(S=s.jsx(ke,{legend:"outcome",label:"Spans",seriesLabel:"Spans",data:t.series}),e[44]=t.series,e[45]=S):S=e[45];let j;e[46]!==t.series||e[47]!==c?(j=s.jsx(we,{label:"Duration",data:t.series,percentile:c}),e[46]=t.series,e[47]=c,e[48]=j):j=e[48];let _;e[49]!==S||e[50]!==j?(_=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S,j]}),e[49]=S,e[50]=j,e[51]=_):_=e[51];let G;e[52]===Symbol.for("react.memo_cache_sentinel")?(G={key:"name",label:"Name"},e[52]=G):G=e[52];let I;e[53]===Symbol.for("react.memo_cache_sentinel")?(I=[G,{key:"status",label:"Status",options:["failed"]}],e[53]=I):I=e[53];let k;e[54]!==l||e[55]!==n||e[56]!==t.dir||e[57]!==t.sort||e[58]!==a?(k=i=>ve.visit(ge(l,n,{window:a,q:i||void 0,sort:t.sort,dir:t.dir}),{preserveState:!0}),e[54]=l,e[55]=n,e[56]=t.dir,e[57]=t.sort,e[58]=a,e[59]=k):k=e[59];let w;e[60]!==t.q||e[61]!==k?(w=s.jsx(qe,{value:t.q,fields:I,onChange:k,placeholder:"name:geocode status:failed"}),e[60]=t.q,e[61]=k,e[62]=w):w=e[62];let J;e[63]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ce,{icon:Le,title:"No spans in this window",description:"Wrap any code in Railwatch.span('name') { } and it shows up here."}),e[63]=J):J=e[63];let P;e[64]!==ee?(P={onOpen:(i,xe)=>ee(i.group_hash,xe)},e[64]=ee,e[65]=P):P=e[65];let C;e[66]!==m?(C={key:"name",header:"Span",grow:!0,cell:i=>s.jsx(_e,{href:m(i.group_hash),className:"truncate font-mono text-xs hover:underline",children:i.name})},e[66]=m,e[67]=C):C=e[67];let Q;e[68]===Symbol.for("react.memo_cache_sentinel")?(Q={key:"trend",hideOnMobile:!0,header:"Trend",cell:Ve},e[68]=Q):Q=e[68];const ae=t.sort==="count",le=t.dir==="asc"?"asc":"desc";let q;e[69]!==r?(q=()=>r("count"),e[69]=r,e[70]=q):q=e[70];let E;e[71]!==ae||e[72]!==le||e[73]!==q?(E={key:"n",header:s.jsx(V,{label:"Count",active:ae,dir:le,onClick:q}),align:"right",cell:He},e[71]=ae,e[72]=le,e[73]=q,e[74]=E):E=e[74];const ne=t.sort==="errors",ce=t.dir==="asc"?"asc":"desc";let N;e[75]!==r?(N=()=>r("errors"),e[75]=r,e[76]=N):N=e[76];let D;e[77]!==ne||e[78]!==ce||e[79]!==N?(D={key:"failed",header:s.jsx(V,{label:"Failed",active:ne,dir:ce,onClick:N}),align:"right",cell:Ke},e[77]=ne,e[78]=ce,e[79]=N,e[80]=D):D=e[80];const me=t.sort==="p50",de=t.dir==="asc"?"asc":"desc";let M;e[81]!==r?(M=()=>r("p50"),e[81]=r,e[82]=M):M=e[82];let B;e[83]!==me||e[84]!==de||e[85]!==M?(B={key:"p50",hideOnMobile:!0,header:s.jsx(V,{label:"p50",active:me,dir:de,onClick:M}),align:"right",cell:Te},e[83]=me,e[84]=de,e[85]=M,e[86]=B):B=e[86];const ue=t.sort==="p95",fe=t.dir==="asc"?"asc":"desc";let F;e[87]!==r?(F=()=>r("p95"),e[87]=r,e[88]=F):F=e[88];let L;e[89]!==ue||e[90]!==fe||e[91]!==F?(L={key:"p95",header:s.jsx(V,{label:"p95",active:ue,dir:fe,onClick:F}),align:"right",cell:Re},e[89]=ue,e[90]=fe,e[91]=F,e[92]=L):L=e[92];const pe=t.sort==="max",he=t.dir==="asc"?"asc":"desc";let O;e[93]!==r?(O=()=>r("max"),e[93]=r,e[94]=O):O=e[94];let R;e[95]!==pe||e[96]!==he||e[97]!==O?(R={key:"max",hideOnMobile:!0,header:s.jsx(V,{label:"Max",active:pe,dir:he,onClick:O}),align:"right",cell:Oe},e[95]=pe,e[96]=he,e[97]=O,e[98]=R):R=e[98];let T;e[99]!==C||e[100]!==E||e[101]!==D||e[102]!==B||e[103]!==L||e[104]!==R?(T=[C,Q,E,D,B,L,R],e[99]=C,e[100]=E,e[101]=D,e[102]=B,e[103]=L,e[104]=R,e[105]=T):T=e[105];let K;e[106]!==t.spans||e[107]!==P||e[108]!==T?(K=s.jsx(Pe,{rows:t.spans,rowKey:We,empty:J,hoverKey:$e,keyboardNav:P,columns:T}),e[106]=t.spans,e[107]=P,e[108]=T,e[109]=K):K=e[109];let U;return e[110]!==y||e[111]!==_||e[112]!==w||e[113]!==K?(U=s.jsxs(Ne,{title:"Spans",children:[z,y,_,w,K]}),e[110]=y,e[111]=_,e[112]=w,e[113]=K,e[114]=U):U=e[114],U}function Oe(t){return H(t.max,2)}function Re(t){return s.jsx("span",{className:"font-semibold",children:H(t.p95,2)})}function Te(t){return H(t.p50,2)}function Ke(t){return s.jsx("span",{className:t.errors?"text-danger font-semibold":"",children:Y(t.errors)})}function He(t){return Y(t.count)}function Ve(t){return s.jsx(Be,{data:t.sparkline,hoverKey:t.group_hash})}function $e(t){return t.group_hash}function We(t){return t.group_hash}export{xt as default};
1
+ import{c as ye,u as Se,j as s,e as ve,af as ge,aZ as je,L as _e}from"./inertia-Cuyz2ZHO.js";import{V as ke,D as we}from"./chart-panel-CC49WTQL.js";import{D as Pe}from"./data-table-CzKTEE-O.js";import{E as Ce}from"./empty-state-CW4wclK_.js";import{F as qe}from"./filter-bar-CJDjWFib.js";import{P as Ee,E as Ne}from"./env-layout-Kz7wks1x.js";import{u as De,P as Me}from"./percentile-picker-CeQgllxD.js";import{S as V}from"./sort-header-mEJUM3Av.js";import{S as Be}from"./sparkline-cell-Dwg7awwh.js";import{S as X,a as Fe}from"./stat-ZtxGU8lE.js";import{c as Y,m as H}from"./format-B9SDkrWj.js";import{B as Le}from"./braces-rSYydpLY.js";import"./series-chart-gnrzhmM6.js";import"./chart-hover-CfoZUY4J.js";import"./chart-DWh7l8yM.js";import"./badge-DRae8XwK.js";import"./app-wordmark-BA_60AVb.js";import"./app-layout-Zc0v-hYh.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";import"./use-live-DMTuhKfB.js";import"./segmented-BeIe4uqk.js";import"./arrow-up-CLQ-7heQ.js";function xt(t){const e=ye.c(115),{environment:be,window:a}=Se().props,{percentile:c}=De(),l=be.application_id,n=be.id,o=t.summary.current;let $;e[0]!==l||e[1]!==n||e[2]!==t.dir||e[3]!==t.q||e[4]!==t.sort||e[5]!==a?($=i=>ve.visit(ge(l,n,{window:a,q:t.q||void 0,sort:i,dir:t.sort===i&&t.dir==="desc"?"asc":"desc"}),{preserveState:!0}),e[0]=l,e[1]=n,e[2]=t.dir,e[3]=t.q,e[4]=t.sort,e[5]=a,e[6]=$):$=e[6];const r=$;let W;e[7]!==l||e[8]!==n||e[9]!==a?(W=i=>je(l,n,i,{window:a}),e[7]=l,e[8]=n,e[9]=a,e[10]=W):W=e[10];const m=W;let Z;e[11]!==m?(Z=(i,xe)=>xe?.newTab?globalThis.window.open(m(i),"_blank"):ve.visit(m(i)),e[11]=m,e[12]=Z):Z=e[12];const ee=Z;let z;e[13]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ee,{title:"Spans",description:"Custom spans your app recorded with Railwatch.span, grouped by name.",actions:s.jsx(Me,{})}),e[13]=z):z=e[13];let d;e[14]!==o.count?(d=Y(o.count),e[14]=o.count,e[15]=d):d=e[15];let u;e[16]!==o.count||e[17]!==t.summary.previous.count?(u={current:o.count,previous:t.summary.previous.count,goodDirection:"up"},e[16]=o.count,e[17]=t.summary.previous.count,e[18]=u):u=e[18];let f;e[19]!==d||e[20]!==u?(f=s.jsx(X,{label:"Spans",value:d,delta:u,deltaCaption:"vs previous period"}),e[19]=d,e[20]=u,e[21]=f):f=e[21];let p;e[22]!==o.errors?(p=Y(o.errors),e[22]=o.errors,e[23]=p):p=e[23];const te=o.errors?"destructive":void 0;let h;e[24]!==p||e[25]!==te?(h=s.jsx(X,{label:"Failed",value:p,tone:te}),e[24]=p,e[25]=te,e[26]=h):h=e[26];const se=o[c]/1e3;let x;e[27]!==se?(x=H(se,2),e[27]=se,e[28]=x):x=e[28];const re=o.avg/1e3;let A;e[29]!==re?(A=H(re,2),e[29]=re,e[30]=A):A=e[30];const ie=`avg ${A}`;let v;e[31]!==c||e[32]!==x||e[33]!==ie?(v=s.jsx(X,{label:c,value:x,hint:ie}),e[31]=c,e[32]=x,e[33]=ie,e[34]=v):v=e[34];const oe=o.max/1e3;let b;e[35]!==oe?(b=H(oe,2),e[35]=oe,e[36]=b):b=e[36];let g;e[37]!==b?(g=s.jsx(X,{label:"Max",value:b}),e[37]=b,e[38]=g):g=e[38];let y;e[39]!==v||e[40]!==g||e[41]!==f||e[42]!==h?(y=s.jsxs(Fe,{children:[f,h,v,g]}),e[39]=v,e[40]=g,e[41]=f,e[42]=h,e[43]=y):y=e[43];let S;e[44]!==t.series?(S=s.jsx(ke,{legend:"outcome",label:"Spans",seriesLabel:"Spans",data:t.series}),e[44]=t.series,e[45]=S):S=e[45];let j;e[46]!==t.series||e[47]!==c?(j=s.jsx(we,{label:"Duration",data:t.series,percentile:c}),e[46]=t.series,e[47]=c,e[48]=j):j=e[48];let _;e[49]!==S||e[50]!==j?(_=s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[S,j]}),e[49]=S,e[50]=j,e[51]=_):_=e[51];let G;e[52]===Symbol.for("react.memo_cache_sentinel")?(G={key:"name",label:"Name"},e[52]=G):G=e[52];let I;e[53]===Symbol.for("react.memo_cache_sentinel")?(I=[G,{key:"status",label:"Status",options:["failed"]}],e[53]=I):I=e[53];let k;e[54]!==l||e[55]!==n||e[56]!==t.dir||e[57]!==t.sort||e[58]!==a?(k=i=>ve.visit(ge(l,n,{window:a,q:i||void 0,sort:t.sort,dir:t.dir}),{preserveState:!0}),e[54]=l,e[55]=n,e[56]=t.dir,e[57]=t.sort,e[58]=a,e[59]=k):k=e[59];let w;e[60]!==t.q||e[61]!==k?(w=s.jsx(qe,{value:t.q,fields:I,onChange:k,placeholder:"name:geocode status:failed"}),e[60]=t.q,e[61]=k,e[62]=w):w=e[62];let J;e[63]===Symbol.for("react.memo_cache_sentinel")?(J=s.jsx(Ce,{icon:Le,title:"No spans in this window",description:"Wrap any code in Railwatch.span('name') { } and it shows up here."}),e[63]=J):J=e[63];let P;e[64]!==ee?(P={onOpen:(i,xe)=>ee(i.group_hash,xe)},e[64]=ee,e[65]=P):P=e[65];let C;e[66]!==m?(C={key:"name",header:"Span",grow:!0,cell:i=>s.jsx(_e,{href:m(i.group_hash),className:"truncate font-mono text-xs hover:underline",children:i.name})},e[66]=m,e[67]=C):C=e[67];let Q;e[68]===Symbol.for("react.memo_cache_sentinel")?(Q={key:"trend",hideOnMobile:!0,header:"Trend",cell:Ve},e[68]=Q):Q=e[68];const ae=t.sort==="count",le=t.dir==="asc"?"asc":"desc";let q;e[69]!==r?(q=()=>r("count"),e[69]=r,e[70]=q):q=e[70];let E;e[71]!==ae||e[72]!==le||e[73]!==q?(E={key:"n",header:s.jsx(V,{label:"Count",active:ae,dir:le,onClick:q}),align:"right",cell:He},e[71]=ae,e[72]=le,e[73]=q,e[74]=E):E=e[74];const ne=t.sort==="errors",ce=t.dir==="asc"?"asc":"desc";let N;e[75]!==r?(N=()=>r("errors"),e[75]=r,e[76]=N):N=e[76];let D;e[77]!==ne||e[78]!==ce||e[79]!==N?(D={key:"failed",header:s.jsx(V,{label:"Failed",active:ne,dir:ce,onClick:N}),align:"right",cell:Ke},e[77]=ne,e[78]=ce,e[79]=N,e[80]=D):D=e[80];const me=t.sort==="p50",de=t.dir==="asc"?"asc":"desc";let M;e[81]!==r?(M=()=>r("p50"),e[81]=r,e[82]=M):M=e[82];let B;e[83]!==me||e[84]!==de||e[85]!==M?(B={key:"p50",hideOnMobile:!0,header:s.jsx(V,{label:"p50",active:me,dir:de,onClick:M}),align:"right",cell:Te},e[83]=me,e[84]=de,e[85]=M,e[86]=B):B=e[86];const ue=t.sort==="p95",fe=t.dir==="asc"?"asc":"desc";let F;e[87]!==r?(F=()=>r("p95"),e[87]=r,e[88]=F):F=e[88];let L;e[89]!==ue||e[90]!==fe||e[91]!==F?(L={key:"p95",header:s.jsx(V,{label:"p95",active:ue,dir:fe,onClick:F}),align:"right",cell:Re},e[89]=ue,e[90]=fe,e[91]=F,e[92]=L):L=e[92];const pe=t.sort==="max",he=t.dir==="asc"?"asc":"desc";let O;e[93]!==r?(O=()=>r("max"),e[93]=r,e[94]=O):O=e[94];let R;e[95]!==pe||e[96]!==he||e[97]!==O?(R={key:"max",hideOnMobile:!0,header:s.jsx(V,{label:"Max",active:pe,dir:he,onClick:O}),align:"right",cell:Oe},e[95]=pe,e[96]=he,e[97]=O,e[98]=R):R=e[98];let T;e[99]!==C||e[100]!==E||e[101]!==D||e[102]!==B||e[103]!==L||e[104]!==R?(T=[C,Q,E,D,B,L,R],e[99]=C,e[100]=E,e[101]=D,e[102]=B,e[103]=L,e[104]=R,e[105]=T):T=e[105];let K;e[106]!==t.spans||e[107]!==P||e[108]!==T?(K=s.jsx(Pe,{rows:t.spans,rowKey:We,empty:J,hoverKey:$e,keyboardNav:P,columns:T}),e[106]=t.spans,e[107]=P,e[108]=T,e[109]=K):K=e[109];let U;return e[110]!==y||e[111]!==_||e[112]!==w||e[113]!==K?(U=s.jsxs(Ne,{title:"Spans",children:[z,y,_,w,K]}),e[110]=y,e[111]=_,e[112]=w,e[113]=K,e[114]=U):U=e[114],U}function Oe(t){return H(t.max,2)}function Re(t){return s.jsx("span",{className:"font-semibold",children:H(t.p95,2)})}function Te(t){return H(t.p50,2)}function Ke(t){return s.jsx("span",{className:t.errors?"text-danger font-semibold":"",children:Y(t.errors)})}function He(t){return Y(t.count)}function Ve(t){return s.jsx(Be,{data:t.sparkline,hoverKey:t.group_hash})}function $e(t){return t.group_hash}function We(t){return t.group_hash}export{xt as default};
@@ -1 +1 @@
1
- import{u as F,r as M,j as s,L as w,J as Q,e as S,t as T,ae as O,c as L}from"./inertia-CqnzqPVD.js";import{S as _}from"./code-CYahYQHZ.js";import{C as R}from"./cursor-load-more-C1ylbqqL.js";import{D as q}from"./data-table-CVKR2wkq.js";import{E as z}from"./empty-state-Bn48Gplm.js";import{F as B}from"./filter-bar-xcbJC93z.js";import{u as K,E as $,P as A}from"./env-layout-CKLL8Ds7.js";import{u as H,P as I}from"./percentile-picker-BxIVblBw.js";import{S as k}from"./sort-header-CPM6fhXv.js";import{S as J}from"./sparkline-cell-CXCxXPWt.js";import{a as U,S as C}from"./stat-BNEfE8X1.js";import{B as W}from"./app-wordmark-Bt6XqURo.js";import{C as G,b as V,c as X,a as Y}from"./card-DqdEEKcJ.js";import{u as Z,C as ee}from"./use-clipboard-C1ApSwzA.js";import{c as E,m as f}from"./format-B9SDkrWj.js";import{C as se,a as oe,Q as re}from"./app-layout-2xAKndVD.js";import{C as te}from"./index-C-EwH4lO.js";import"./chart-hover-2yZG3w2u.js";import"./badge-Dv7I-ebP.js";import"./use-live-DWwLg1Nj.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./segmented-C4oWE73o.js";import"./label-1nSzpSB6.js";import"./arrow-up-EmePsTKP.js";import"./series-chart-D6upsrSn.js";import"./chart-C4k7Ub9W.js";import"./checkbox-DKbThbxr.js";const ae=1500;function ie(r){const o=L.c(20),{suggestion:a}=r,[,d]=Z(),[u,v]=M.useState(!1);let m;o[0]!==d||o[1]!==a.code?(m=()=>{d(a.code).then(g=>{g&&(v(!0),window.setTimeout(()=>v(!1),ae))})},o[0]=d,o[1]=a.code,o[2]=m):m=o[2];const y=m;let n;o[3]!==a.code?(n=s.jsx("pre",{className:"overflow-x-auto font-mono text-xs whitespace-pre-wrap",children:a.code}),o[3]=a.code,o[4]=n):n=o[4];let l;o[5]!==y?(l=g=>{g.stopPropagation(),y()},o[5]=y,o[6]=l):l=o[6];let c;o[7]!==u?(c=u?s.jsx(te,{className:"size-3 text-emerald-500"}):s.jsx(ee,{className:"size-3 opacity-60"}),o[7]=u,o[8]=c):c=o[8];let h;o[9]!==l||o[10]!==c?(h=s.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 shrink-0 gap-1 px-1.5 text-xs",onClick:l,children:[c,"Copy"]}),o[9]=l,o[10]=c,o[11]=h):h=o[11];let p;o[12]!==n||o[13]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n,h]}),o[12]=n,o[13]=h,o[14]=p):p=o[14];let t;o[15]!==a.explanation?(t=s.jsx("p",{className:"text-muted-foreground text-xs whitespace-normal",children:a.explanation}),o[15]=a.explanation,o[16]=t):t=o[16];let x;return o[17]!==p||o[18]!==t?(x=s.jsxs("div",{className:"border-warning/40 bg-muted/40 mt-2 space-y-2 rounded-lg border p-2",children:[p,t]}),o[17]=p,o[18]=t,o[19]=x):x=o[19],x}function Fe(r){const{environment:o,window:a,range:d}=F().props,{percentile:u}=H(),{label:v}=K(),[m,y]=M.useState(null),n=o.application_id,l=o.id,c=a==="custom"?{from:d?.from,to:d?.to}:{window:a},h=d?{from:d.from,to:d.to}:c,p=(e,i=r.q)=>O(n,l,{...e?h:c,q:i||void 0,cursor:e,limit:r.pagination.limit,sort:r.sort,dir:r.dir}),t=r.summary.current,x=r.summary.previous,g=a==="custom"?"vs previous period":`vs previous ${v}`,D=r.n_plus_ones.filter(e=>e.suggestion).length,P=e=>{e.suggestion&&y(i=>i===e.group_hash?null:e.group_hash)},b=e=>S.visit(O(n,l,{...c,q:r.q||void 0,sort:e,dir:r.sort===e&&r.dir==="desc"?"asc":"desc"}),{preserveState:!0}),j=e=>Q(n,l,e,c),N=(e,i)=>i?.newTab?globalThis.window.open(j(e),"_blank"):S.visit(j(e));return s.jsxs($,{title:"Queries",children:[s.jsx(A,{title:"Queries",description:"Every SQL shape your app ran, grouped by normalized statement.",actions:s.jsx(I,{})}),s.jsxs(U,{children:[s.jsx(C,{label:"Queries",value:E(t.count),delta:{current:t.count,previous:x.count,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"N+1 groups",value:E(r.n_plus_ones.length),tone:r.n_plus_ones.length>0?"warning":void 0,hint:r.n_plus_ones.length>0?`${D} with a suggested fix`:void 0}),s.jsx(C,{label:"Avg",value:f(t.avg/1e3,2),delta:{current:t.avg,previous:x.avg,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"p95",value:f(t.p95/1e3,2),hint:`p99 ${f(t.p99/1e3,2)}`,delta:{current:t.p95,previous:x.p95,goodDirection:"down"},deltaCaption:g})]}),r.n_plus_ones.length>0&&s.jsxs(G,{className:"border-amber-500/40",children:[s.jsx(V,{children:s.jsx(X,{children:"N+1 queries detected"})}),s.jsx(Y,{children:s.jsx(q,{rows:r.n_plus_ones,rowKey:e=>e.group_hash,onRowClick:P,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query shape",grow:!0,cell:e=>s.jsxs(s.Fragment,{children:[s.jsx(w,{href:Q(n,l,e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})}),m===e.group_hash&&e.suggestion&&s.jsx(ie,{suggestion:e.suggestion})]})},{key:"fix",header:"Fix",cell:e=>e.suggestion?s.jsxs("button",{type:"button","aria-expanded":m===e.group_hash,"aria-label":`Suggested fix: ${e.suggestion.code}`,onClick:i=>{i.stopPropagation(),P(e)},className:"border-warning/50 text-warning hover:bg-warning/10 inline-flex items-center gap-0.5 rounded-md border py-0.5 pr-1.5 pl-0.5 font-mono text-[11px] uppercase",children:[m===e.group_hash?s.jsx(se,{className:"size-3"}):s.jsx(oe,{className:"size-3"}),"Fix"]}):null},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"occ",header:"Executions affected",align:"right",cell:e=>e.occurrences},{key:"mx",hideOnMobile:!0,header:"Max repeats",align:"right",cell:e=>e.max_count}]})})]}),s.jsx(q,{rows:r.queries,rowKey:e=>e.group_hash,empty:s.jsx(z,{icon:re,title:"No queries in this window",description:"SQL queries executed by your app appear here as they're reported."}),hoverKey:e=>e.group_hash,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.name})})},{key:"trend",hideOnMobile:!0,header:"Trend",cell:e=>s.jsx(J,{data:e.sparkline,hoverKey:e.group_hash})},{key:"n",header:s.jsx(k,{label:"Count",active:r.sort==="count",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("count")}),align:"right",cell:e=>E(e.count)},{key:"avg",hideOnMobile:!0,header:s.jsx(k,{label:"Avg",active:r.sort==="avg",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("avg")}),align:"right",cell:e=>f(e.avg,2)},{key:u,header:s.jsx(k,{label:u,active:r.sort===u,dir:r.dir==="asc"?"asc":"desc",onClick:()=>b(u)}),align:"right",cell:e=>s.jsx("span",{className:"font-semibold",children:f(e[u],2)})},{key:"max",hideOnMobile:!0,header:s.jsx(k,{label:"Max",active:r.sort==="max",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("max")}),align:"right",cell:e=>f(e.max,2)}]}),s.jsx("h2",{className:"text-sm font-semibold",children:"Slowest individual queries"}),s.jsx(B,{value:r.q,fields:[{key:"after",label:"After"},{key:"before",label:"Before"},{key:"user",label:"User"},{key:"tenant",label:"Tenant"},{key:"deploy",label:"Deploy"},{key:"source",label:"Source"},{key:"kind",label:"Execution kind",options:["request","job","scheduled_task","command"]},{key:"connection",label:"Connection"},{key:"role",label:"Role"},{key:"adapter",label:"Adapter"}],onChange:e=>S.visit(p(void 0,e),{only:["slowest","pagination","q"],preserveState:!0,reset:["slowest"]}),placeholder:"connection:primary role:reading source:app/models"}),s.jsx(q,{rows:r.slowest,rowKey:e=>e.id,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"SQL",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})})},{key:"exe",hideOnMobile:!0,header:"In",cell:e=>e.execution_id?s.jsx(w,{className:"font-mono text-xs hover:underline",href:T(n,l,e.execution_id),children:e.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"d",header:"Duration",align:"right",cell:e=>f(e.duration,2)}]}),s.jsx(R,{meta:r.pagination,href:p,only:["slowest","pagination"]})]})}export{Fe as default};
1
+ import{u as F,r as M,j as s,L as w,J as Q,e as S,t as T,ae as O,c as L}from"./inertia-Cuyz2ZHO.js";import{S as _}from"./code-CLmYS6FU.js";import{C as R}from"./cursor-load-more-Ddwxe5dZ.js";import{D as q}from"./data-table-CzKTEE-O.js";import{E as z}from"./empty-state-CW4wclK_.js";import{F as B}from"./filter-bar-CJDjWFib.js";import{u as K,E as $,P as A}from"./env-layout-Kz7wks1x.js";import{u as H,P as I}from"./percentile-picker-CeQgllxD.js";import{S as k}from"./sort-header-mEJUM3Av.js";import{S as J}from"./sparkline-cell-Dwg7awwh.js";import{a as U,S as C}from"./stat-ZtxGU8lE.js";import{B as W}from"./app-wordmark-BA_60AVb.js";import{C as G,b as V,c as X,a as Y}from"./card-DPjFKfen.js";import{u as Z,C as ee}from"./use-clipboard-DNefo-ky.js";import{c as E,m as f}from"./format-B9SDkrWj.js";import{C as se,a as oe,Q as re}from"./app-layout-Zc0v-hYh.js";import{C as te}from"./index-BfbSo01U.js";import"./chart-hover-CfoZUY4J.js";import"./badge-DRae8XwK.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./arrow-up-CLQ-7heQ.js";import"./series-chart-gnrzhmM6.js";import"./chart-DWh7l8yM.js";import"./checkbox-DPkLUiwM.js";const ae=1500;function ie(r){const o=L.c(20),{suggestion:a}=r,[,d]=Z(),[u,v]=M.useState(!1);let m;o[0]!==d||o[1]!==a.code?(m=()=>{d(a.code).then(g=>{g&&(v(!0),window.setTimeout(()=>v(!1),ae))})},o[0]=d,o[1]=a.code,o[2]=m):m=o[2];const y=m;let n;o[3]!==a.code?(n=s.jsx("pre",{className:"overflow-x-auto font-mono text-xs whitespace-pre-wrap",children:a.code}),o[3]=a.code,o[4]=n):n=o[4];let l;o[5]!==y?(l=g=>{g.stopPropagation(),y()},o[5]=y,o[6]=l):l=o[6];let c;o[7]!==u?(c=u?s.jsx(te,{className:"size-3 text-emerald-500"}):s.jsx(ee,{className:"size-3 opacity-60"}),o[7]=u,o[8]=c):c=o[8];let h;o[9]!==l||o[10]!==c?(h=s.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 shrink-0 gap-1 px-1.5 text-xs",onClick:l,children:[c,"Copy"]}),o[9]=l,o[10]=c,o[11]=h):h=o[11];let p;o[12]!==n||o[13]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n,h]}),o[12]=n,o[13]=h,o[14]=p):p=o[14];let t;o[15]!==a.explanation?(t=s.jsx("p",{className:"text-muted-foreground text-xs whitespace-normal",children:a.explanation}),o[15]=a.explanation,o[16]=t):t=o[16];let x;return o[17]!==p||o[18]!==t?(x=s.jsxs("div",{className:"border-warning/40 bg-muted/40 mt-2 space-y-2 rounded-lg border p-2",children:[p,t]}),o[17]=p,o[18]=t,o[19]=x):x=o[19],x}function Fe(r){const{environment:o,window:a,range:d}=F().props,{percentile:u}=H(),{label:v}=K(),[m,y]=M.useState(null),n=o.application_id,l=o.id,c=a==="custom"?{from:d?.from,to:d?.to}:{window:a},h=d?{from:d.from,to:d.to}:c,p=(e,i=r.q)=>O(n,l,{...e?h:c,q:i||void 0,cursor:e,limit:r.pagination.limit,sort:r.sort,dir:r.dir}),t=r.summary.current,x=r.summary.previous,g=a==="custom"?"vs previous period":`vs previous ${v}`,D=r.n_plus_ones.filter(e=>e.suggestion).length,P=e=>{e.suggestion&&y(i=>i===e.group_hash?null:e.group_hash)},b=e=>S.visit(O(n,l,{...c,q:r.q||void 0,sort:e,dir:r.sort===e&&r.dir==="desc"?"asc":"desc"}),{preserveState:!0}),j=e=>Q(n,l,e,c),N=(e,i)=>i?.newTab?globalThis.window.open(j(e),"_blank"):S.visit(j(e));return s.jsxs($,{title:"Queries",children:[s.jsx(A,{title:"Queries",description:"Every SQL shape your app ran, grouped by normalized statement.",actions:s.jsx(I,{})}),s.jsxs(U,{children:[s.jsx(C,{label:"Queries",value:E(t.count),delta:{current:t.count,previous:x.count,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"N+1 groups",value:E(r.n_plus_ones.length),tone:r.n_plus_ones.length>0?"warning":void 0,hint:r.n_plus_ones.length>0?`${D} with a suggested fix`:void 0}),s.jsx(C,{label:"Avg",value:f(t.avg/1e3,2),delta:{current:t.avg,previous:x.avg,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"p95",value:f(t.p95/1e3,2),hint:`p99 ${f(t.p99/1e3,2)}`,delta:{current:t.p95,previous:x.p95,goodDirection:"down"},deltaCaption:g})]}),r.n_plus_ones.length>0&&s.jsxs(G,{className:"border-amber-500/40",children:[s.jsx(V,{children:s.jsx(X,{children:"N+1 queries detected"})}),s.jsx(Y,{children:s.jsx(q,{rows:r.n_plus_ones,rowKey:e=>e.group_hash,onRowClick:P,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query shape",grow:!0,cell:e=>s.jsxs(s.Fragment,{children:[s.jsx(w,{href:Q(n,l,e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})}),m===e.group_hash&&e.suggestion&&s.jsx(ie,{suggestion:e.suggestion})]})},{key:"fix",header:"Fix",cell:e=>e.suggestion?s.jsxs("button",{type:"button","aria-expanded":m===e.group_hash,"aria-label":`Suggested fix: ${e.suggestion.code}`,onClick:i=>{i.stopPropagation(),P(e)},className:"border-warning/50 text-warning hover:bg-warning/10 inline-flex items-center gap-0.5 rounded-md border py-0.5 pr-1.5 pl-0.5 font-mono text-[11px] uppercase",children:[m===e.group_hash?s.jsx(se,{className:"size-3"}):s.jsx(oe,{className:"size-3"}),"Fix"]}):null},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"occ",header:"Executions affected",align:"right",cell:e=>e.occurrences},{key:"mx",hideOnMobile:!0,header:"Max repeats",align:"right",cell:e=>e.max_count}]})})]}),s.jsx(q,{rows:r.queries,rowKey:e=>e.group_hash,empty:s.jsx(z,{icon:re,title:"No queries in this window",description:"SQL queries executed by your app appear here as they're reported."}),hoverKey:e=>e.group_hash,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.name})})},{key:"trend",hideOnMobile:!0,header:"Trend",cell:e=>s.jsx(J,{data:e.sparkline,hoverKey:e.group_hash})},{key:"n",header:s.jsx(k,{label:"Count",active:r.sort==="count",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("count")}),align:"right",cell:e=>E(e.count)},{key:"avg",hideOnMobile:!0,header:s.jsx(k,{label:"Avg",active:r.sort==="avg",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("avg")}),align:"right",cell:e=>f(e.avg,2)},{key:u,header:s.jsx(k,{label:u,active:r.sort===u,dir:r.dir==="asc"?"asc":"desc",onClick:()=>b(u)}),align:"right",cell:e=>s.jsx("span",{className:"font-semibold",children:f(e[u],2)})},{key:"max",hideOnMobile:!0,header:s.jsx(k,{label:"Max",active:r.sort==="max",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("max")}),align:"right",cell:e=>f(e.max,2)}]}),s.jsx("h2",{className:"text-sm font-semibold",children:"Slowest individual queries"}),s.jsx(B,{value:r.q,fields:[{key:"after",label:"After"},{key:"before",label:"Before"},{key:"user",label:"User"},{key:"tenant",label:"Tenant"},{key:"deploy",label:"Deploy"},{key:"source",label:"Source"},{key:"kind",label:"Execution kind",options:["request","job","scheduled_task","command"]},{key:"connection",label:"Connection"},{key:"role",label:"Role"},{key:"adapter",label:"Adapter"}],onChange:e=>S.visit(p(void 0,e),{only:["slowest","pagination","q"],preserveState:!0,reset:["slowest"]}),placeholder:"connection:primary role:reading source:app/models"}),s.jsx(q,{rows:r.slowest,rowKey:e=>e.id,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"SQL",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})})},{key:"exe",hideOnMobile:!0,header:"In",cell:e=>e.execution_id?s.jsx(w,{className:"font-mono text-xs hover:underline",href:T(n,l,e.execution_id),children:e.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"d",header:"Duration",align:"right",cell:e=>f(e.duration,2)}]}),s.jsx(R,{meta:r.pagination,href:p,only:["slowest","pagination"]})]})}export{Fe as default};
@@ -1 +1 @@
1
- import{c as D,u as A,au as I,j as s,F as M,aR as G,H,e as p,aS as B,aT as L,aU as $,aV as K}from"./inertia-CqnzqPVD.js";import{G as O}from"./google-sign-in-button-B5as2ps1.js";import{I as k}from"./input-error-ByT28UdP.js";import{D as T}from"./data-table-CVKR2wkq.js";import{B as z}from"./badge-Dv7I-ebP.js";import{B as x}from"./app-wordmark-Bt6XqURo.js";import{C as P,b as S,c as F,a as R}from"./card-DqdEEKcJ.js";import{L as N,I as E}from"./label-1nSzpSB6.js";import{A as q}from"./app-layout-2xAKndVD.js";import{a as U}from"./format-B9SDkrWj.js";import"./separator-Ct2UcZ2x.js";import"./index-BDVShWMs.js";import"./chart-hover-2yZG3w2u.js";import"./empty-state-Bn48Gplm.js";import"./live-dot-UdzOfzJb.js";import"./index-C-EwH4lO.js";import"./checkbox-DKbThbxr.js";function ve(t){const e=D.c(31),{account:a,auth:n}=A().props;let f,j;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[{title:"Members",href:I()}],j=s.jsx(H,{title:"Members"}),e[0]=f,e[1]=j):(f=e[0],j=e[1]);let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Members"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"People who can see this account's applications and issues."})]}),e[2]=g):g=e[2];let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(S,{children:s.jsx(F,{className:"text-sm",children:"Add member"})}),e[3]=w):w=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=I(),e[4]=b):b=e[4];let i;e[5]!==t.roles?(i=s.jsxs(P,{className:"max-w-lg",children:[w,s.jsx(R,{children:s.jsx(M,{method:"post",action:b,className:"flex flex-wrap items-end gap-3",resetOnSuccess:!0,children:r=>{const{errors:u,processing:C}=r;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid flex-1 gap-1",children:[s.jsx(N,{htmlFor:"email",children:"Email"}),s.jsx(E,{id:"email",name:"email",type:"email",required:!0}),s.jsx(k,{messages:u.email})]}),s.jsxs("div",{className:"grid gap-1",children:[s.jsx(N,{htmlFor:"role",children:"Role"}),s.jsx("select",{id:"role",name:"role",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:t.roles.filter(ne).map(re)})]}),s.jsx(x,{disabled:C,children:"Invite"})]})}})})]}),e[5]=t.roles,e[6]=i):i=e[6];let l;e[7]!==t.invitations?(l=t.invitations.length>0&&s.jsxs(P,{children:[s.jsx(S,{children:s.jsx(F,{children:"Pending invitations"})}),s.jsx(R,{children:s.jsx(T,{rows:t.invitations,rowKey:te,columns:[{key:"e",header:"Email",cell:se},{key:"r",header:"Role",cell:ee},{key:"x",header:"Expires",cell:Z},{key:"a",header:"",align:"right",cell:X}]})})]}),e[7]=t.invitations,e[8]=l):l=e[8];let _,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(_={key:"n",header:"Name",cell:J},v={key:"e",header:"Email",cell:Y},e[9]=_,e[10]=v):(_=e[9],v=e[10]);let o;e[11]!==t.roles?(o={key:"r",header:"Role",cell:r=>r.role==="owner"?s.jsx(z,{variant:"outline",children:"owner"}):s.jsx("select",{value:r.role,"aria-label":`Role for ${r.name}`,onChange:u=>p.patch(B(r.id),{role:u.target.value}),className:"border-input bg-background h-7 rounded-md border px-2 text-xs",children:t.roles.filter(W).map(V)})},e[11]=t.roles,e[12]=o):o=e[12];let c;e[13]!==t.ownership.can_transfer||e[14]!==t.ownership.current_user_id?(c={key:"x",header:"",align:"right",cell:r=>s.jsxs("span",{className:"flex justify-end gap-1",children:[t.ownership.can_transfer&&r.user_id!==t.ownership.current_user_id&&s.jsx(x,{size:"sm",variant:"outline",onClick:()=>{window.confirm(`Transfer ownership to ${r.name}? Your role will become admin.`)&&p.post(L(r.id))},children:"Transfer ownership"}),r.role!=="owner"&&s.jsx(x,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>p.delete(B(r.id)),children:"Remove"})]})},e[13]=t.ownership.can_transfer,e[14]=t.ownership.current_user_id,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==o?(d=[_,v,o,c],e[16]=c,e[17]=o,e[18]=d):d=e[18];let m;e[19]!==t.members||e[20]!==d?(m=s.jsx(T,{rows:t.members,rowKey:Q,columns:d}),e[19]=t.members,e[20]=d,e[21]=m):m=e[21];let h;e[22]!==a||e[23]!==n||e[24]!==t.ownership.can_delete_account?(h=t.ownership.can_delete_account&&a&&s.jsxs(P,{className:"border-destructive/30 max-w-lg",children:[s.jsx(S,{children:s.jsx(F,{className:"text-destructive text-sm",children:"Delete account"})}),s.jsxs(R,{className:"space-y-4",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Permanently deletes ",a.name,", its applications, ingest tokens, alerts, and telemetry databases. This cannot be undone."]}),n.user.provider&&!n.session.recently_authenticated&&s.jsx(O,{label:"Confirm with Google",reauthenticateFor:"account",separated:!1}),s.jsx(M,{method:"delete",action:G(a.id),className:"grid gap-3",children:r=>{const{errors:u,processing:C}=r;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-1",children:[s.jsxs(N,{htmlFor:"account-deletion-confirmation",children:["Enter ",a.name," to confirm"]}),s.jsx(E,{id:"account-deletion-confirmation",name:"confirmation",autoComplete:"off"}),s.jsx(k,{messages:u.confirmation})]}),!n.user.provider&&s.jsxs("div",{className:"grid gap-1",children:[s.jsx(N,{htmlFor:"account-password-challenge",children:"Current password"}),s.jsx(E,{id:"account-password-challenge",type:"password",name:"password_challenge",autoComplete:"current-password"}),s.jsx(k,{messages:u.password_challenge})]}),s.jsx(x,{variant:"destructive",className:"w-fit",disabled:C||!!n.user.provider&&!n.session.recently_authenticated,children:"Delete account and telemetry"})]})}})]})]}),e[22]=a,e[23]=n,e[24]=t.ownership.can_delete_account,e[25]=h):h=e[25];let y;return e[26]!==m||e[27]!==h||e[28]!==i||e[29]!==l?(y=s.jsxs(q,{breadcrumbs:f,children:[j,s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[g,i,l,m,h]})]}),e[26]=m,e[27]=h,e[28]=i,e[29]=l,e[30]=y):y=e[30],y}function V(t){return s.jsx("option",{value:t,children:t},t)}function W(t){return t!=="owner"}function Y(t){return s.jsx("span",{className:"font-mono text-xs",children:t.email})}function J(t){return t.name}function Q(t){return t.id}function X(t){return s.jsxs("span",{className:"flex justify-end gap-1",children:[s.jsx(x,{size:"sm",variant:"ghost",onClick:()=>p.post($(t.id)),children:"Resend"}),s.jsx(x,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>p.delete(K(t.id)),children:"Withdraw"})]})}function Z(t){return s.jsx("span",{className:"text-muted-foreground text-xs",children:U(t.expires_at)})}function ee(t){return s.jsx(z,{variant:"outline",children:t.role})}function se(t){return s.jsx("span",{className:"font-mono text-xs",children:t.email})}function te(t){return t.id}function re(t){return s.jsx("option",{value:t,children:t},t)}function ne(t){return t!=="owner"}export{ve as default};
1
+ import{c as D,u as A,au as I,j as s,F as M,aR as G,H,e as p,aS as B,aT as L,aU as $,aV as K}from"./inertia-Cuyz2ZHO.js";import{G as O}from"./google-sign-in-button-2_zgbgVy.js";import{I as k}from"./input-error-hog6gGxg.js";import{D as T}from"./data-table-CzKTEE-O.js";import{B as z}from"./badge-DRae8XwK.js";import{B as x}from"./app-wordmark-BA_60AVb.js";import{C as P,b as S,c as F,a as R}from"./card-DPjFKfen.js";import{L as N,I as E}from"./label-DdCBgiUn.js";import{A as q}from"./app-layout-Zc0v-hYh.js";import{a as U}from"./format-B9SDkrWj.js";import"./separator-D5I0UCB5.js";import"./index-CBip6V4z.js";import"./chart-hover-CfoZUY4J.js";import"./empty-state-CW4wclK_.js";import"./live-dot-BZgYTYdt.js";import"./index-BfbSo01U.js";import"./checkbox-DPkLUiwM.js";function ve(t){const e=D.c(31),{account:a,auth:n}=A().props;let f,j;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[{title:"Members",href:I()}],j=s.jsx(H,{title:"Members"}),e[0]=f,e[1]=j):(f=e[0],j=e[1]);let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Members"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"People who can see this account's applications and issues."})]}),e[2]=g):g=e[2];let w;e[3]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(S,{children:s.jsx(F,{className:"text-sm",children:"Add member"})}),e[3]=w):w=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=I(),e[4]=b):b=e[4];let i;e[5]!==t.roles?(i=s.jsxs(P,{className:"max-w-lg",children:[w,s.jsx(R,{children:s.jsx(M,{method:"post",action:b,className:"flex flex-wrap items-end gap-3",resetOnSuccess:!0,children:r=>{const{errors:u,processing:C}=r;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid flex-1 gap-1",children:[s.jsx(N,{htmlFor:"email",children:"Email"}),s.jsx(E,{id:"email",name:"email",type:"email",required:!0}),s.jsx(k,{messages:u.email})]}),s.jsxs("div",{className:"grid gap-1",children:[s.jsx(N,{htmlFor:"role",children:"Role"}),s.jsx("select",{id:"role",name:"role",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:t.roles.filter(ne).map(re)})]}),s.jsx(x,{disabled:C,children:"Invite"})]})}})})]}),e[5]=t.roles,e[6]=i):i=e[6];let l;e[7]!==t.invitations?(l=t.invitations.length>0&&s.jsxs(P,{children:[s.jsx(S,{children:s.jsx(F,{children:"Pending invitations"})}),s.jsx(R,{children:s.jsx(T,{rows:t.invitations,rowKey:te,columns:[{key:"e",header:"Email",cell:se},{key:"r",header:"Role",cell:ee},{key:"x",header:"Expires",cell:Z},{key:"a",header:"",align:"right",cell:X}]})})]}),e[7]=t.invitations,e[8]=l):l=e[8];let _,v;e[9]===Symbol.for("react.memo_cache_sentinel")?(_={key:"n",header:"Name",cell:J},v={key:"e",header:"Email",cell:Y},e[9]=_,e[10]=v):(_=e[9],v=e[10]);let o;e[11]!==t.roles?(o={key:"r",header:"Role",cell:r=>r.role==="owner"?s.jsx(z,{variant:"outline",children:"owner"}):s.jsx("select",{value:r.role,"aria-label":`Role for ${r.name}`,onChange:u=>p.patch(B(r.id),{role:u.target.value}),className:"border-input bg-background h-7 rounded-md border px-2 text-xs",children:t.roles.filter(W).map(V)})},e[11]=t.roles,e[12]=o):o=e[12];let c;e[13]!==t.ownership.can_transfer||e[14]!==t.ownership.current_user_id?(c={key:"x",header:"",align:"right",cell:r=>s.jsxs("span",{className:"flex justify-end gap-1",children:[t.ownership.can_transfer&&r.user_id!==t.ownership.current_user_id&&s.jsx(x,{size:"sm",variant:"outline",onClick:()=>{window.confirm(`Transfer ownership to ${r.name}? Your role will become admin.`)&&p.post(L(r.id))},children:"Transfer ownership"}),r.role!=="owner"&&s.jsx(x,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>p.delete(B(r.id)),children:"Remove"})]})},e[13]=t.ownership.can_transfer,e[14]=t.ownership.current_user_id,e[15]=c):c=e[15];let d;e[16]!==c||e[17]!==o?(d=[_,v,o,c],e[16]=c,e[17]=o,e[18]=d):d=e[18];let m;e[19]!==t.members||e[20]!==d?(m=s.jsx(T,{rows:t.members,rowKey:Q,columns:d}),e[19]=t.members,e[20]=d,e[21]=m):m=e[21];let h;e[22]!==a||e[23]!==n||e[24]!==t.ownership.can_delete_account?(h=t.ownership.can_delete_account&&a&&s.jsxs(P,{className:"border-destructive/30 max-w-lg",children:[s.jsx(S,{children:s.jsx(F,{className:"text-destructive text-sm",children:"Delete account"})}),s.jsxs(R,{className:"space-y-4",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Permanently deletes ",a.name,", its applications, ingest tokens, alerts, and telemetry databases. This cannot be undone."]}),n.user.provider&&!n.session.recently_authenticated&&s.jsx(O,{label:"Confirm with Google",reauthenticateFor:"account",separated:!1}),s.jsx(M,{method:"delete",action:G(a.id),className:"grid gap-3",children:r=>{const{errors:u,processing:C}=r;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-1",children:[s.jsxs(N,{htmlFor:"account-deletion-confirmation",children:["Enter ",a.name," to confirm"]}),s.jsx(E,{id:"account-deletion-confirmation",name:"confirmation",autoComplete:"off"}),s.jsx(k,{messages:u.confirmation})]}),!n.user.provider&&s.jsxs("div",{className:"grid gap-1",children:[s.jsx(N,{htmlFor:"account-password-challenge",children:"Current password"}),s.jsx(E,{id:"account-password-challenge",type:"password",name:"password_challenge",autoComplete:"current-password"}),s.jsx(k,{messages:u.password_challenge})]}),s.jsx(x,{variant:"destructive",className:"w-fit",disabled:C||!!n.user.provider&&!n.session.recently_authenticated,children:"Delete account and telemetry"})]})}})]})]}),e[22]=a,e[23]=n,e[24]=t.ownership.can_delete_account,e[25]=h):h=e[25];let y;return e[26]!==m||e[27]!==h||e[28]!==i||e[29]!==l?(y=s.jsxs(q,{breadcrumbs:f,children:[j,s.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[g,i,l,m,h]})]}),e[26]=m,e[27]=h,e[28]=i,e[29]=l,e[30]=y):y=e[30],y}function V(t){return s.jsx("option",{value:t,children:t},t)}function W(t){return t!=="owner"}function Y(t){return s.jsx("span",{className:"font-mono text-xs",children:t.email})}function J(t){return t.name}function Q(t){return t.id}function X(t){return s.jsxs("span",{className:"flex justify-end gap-1",children:[s.jsx(x,{size:"sm",variant:"ghost",onClick:()=>p.post($(t.id)),children:"Resend"}),s.jsx(x,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>p.delete(K(t.id)),children:"Withdraw"})]})}function Z(t){return s.jsx("span",{className:"text-muted-foreground text-xs",children:U(t.expires_at)})}function ee(t){return s.jsx(z,{variant:"outline",children:t.role})}function se(t){return s.jsx("span",{className:"font-mono text-xs",children:t.email})}function te(t){return t.id}function re(t){return s.jsx("option",{value:t,children:t},t)}function ne(t){return t!=="owner"}export{ve as default};
@@ -1 +1 @@
1
- import{c as G,r as D,at as T,aL as J,j as t,H as V,F as z,e as o,aM as Y,aN as R,aO as Z,aP as ee,aQ as te}from"./inertia-CqnzqPVD.js";import{I as O}from"./input-error-ByT28UdP.js";import{D as E}from"./data-table-CVKR2wkq.js";import{R as se}from"./relative-time-DQ4kjowZ.js";import{B as K}from"./badge-Dv7I-ebP.js";import{B as i}from"./app-wordmark-Bt6XqURo.js";import{b as H,c as B,C as M,a as W}from"./card-DqdEEKcJ.js";import{C as U}from"./checkbox-DKbThbxr.js";import{L as r,I as l}from"./label-1nSzpSB6.js";import{A as ne}from"./app-layout-2xAKndVD.js";import"./chart-hover-2yZG3w2u.js";import"./empty-state-Bn48Gplm.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./format-B9SDkrWj.js";const re={slack:"Slack hook id — incoming webhooks do not expose their channel"},$={slack:{key:"webhook_url",label:"New Slack incoming webhook URL"},webhook:{key:"secret",label:"New signing secret"},linear:{key:"api_key",label:"New Linear API key"}};function ie(e){const s=$[e.kind];if(!s)return;const n=window.prompt(s.label)?.trim();n&&o.patch(R(e.id),{enabled:!0,settings:{[s.key]:n}})}const Q={new_issue:"New issue",regressed_issue:"Regressed or reopened issue",resolved_issue:"Issue resolved",ignored_issue:"Issue ignored",assigned_issue:"Issue assigned",threshold:"Threshold exceeded",quota:"Quota reached"};function ae(e,s){const n=e.filters??{};return[...(s[e.application_id]??[]).filter(a=>(n.environment_ids??[]).includes(a.id)).map(a=>a.name),...n.kinds??[],n.min_priority?`>= ${n.min_priority}`:null,n.title_pattern].filter(Boolean).join(" · ")}function Ke(e){const s=G.c(40),[n,q]=D.useState("slack"),[a,X]=D.useState(e.application_options[0]?.id);let j,f;s[0]===Symbol.for("react.memo_cache_sentinel")?(j=[{title:"Integrations",href:T()}],f=t.jsx(V,{title:"Integrations"}),s[0]=j,s[1]=f):(j=s[0],f=s[1]);let _;s[2]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold",children:"Integrations and alerts"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"Where alerts go, and which events trigger them per application."})]}),s[2]=_):_=s[2];let b;s[3]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add integration"})}),s[3]=b):b=s[3];let k;s[4]===Symbol.for("react.memo_cache_sentinel")?(k=T(),s[4]=k):k=s[4];let d;s[5]!==n||s[6]!==e.kinds||s[7]!==e.linear_oauth_enabled?(d=t.jsxs(M,{children:[b,t.jsx(W,{children:t.jsx(z,{method:"post",action:k,className:"space-y-3",resetOnSuccess:!0,children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"kind",children:"Kind"}),t.jsx("select",{id:"kind",name:"kind",value:n,onChange:P=>q(P.target.value),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.kinds.map(Ce)})]}),!(n==="linear"&&e.linear_oauth_enabled)&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"name",children:"Name"}),t.jsx(l,{id:"name",name:"name",required:!0,placeholder:"#alerts"}),t.jsx(O,{messages:L.name})]}),n==="email"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"to",children:"Send to"}),t.jsx(l,{id:"to",name:"settings[to]",type:"email",required:!0})]}),n==="slack"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"webhook_url",children:"Incoming webhook URL"}),t.jsx(l,{id:"webhook_url",name:"settings[webhook_url]",type:"url",required:!0,placeholder:"https://hooks.slack.com/services/…"})]}),n==="webhook"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"url",children:"URL"}),t.jsx(l,{id:"url",name:"settings[url]",type:"url",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"secret",children:"Signing secret (optional)"}),t.jsx(l,{id:"secret",name:"settings[secret]"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Sent as X-Railwatch-Signature: sha256=HMAC(body)."})]})]}),n==="linear"&&e.linear_oauth_enabled&&t.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm",children:"Linear uses OAuth to discover your workspace and teams. Connect your workspace, then select a team."}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Railwatch names the integration from the Linear workspace."})]}),n==="linear"&&!e.linear_oauth_enabled&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"api_key",children:"API key"}),t.jsx(l,{id:"api_key",name:"settings[api_key]",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"team_id",children:"Team ID"}),t.jsx(l,{id:"team_id",name:"settings[team_id]",required:!0})]})]}),t.jsx(O,{messages:L.settings}),n==="linear"&&e.linear_oauth_enabled?t.jsx(i,{type:"button",onClick:Se,children:"Connect Linear workspace"}):t.jsx(i,{disabled:A,children:"Add"})]})}})})]}),s[5]=n,s[6]=e.kinds,s[7]=e.linear_oauth_enabled,s[8]=d):d=s[8];let v;s[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add alert rule"})}),s[9]=v):v=s[9];let y;s[10]===Symbol.for("react.memo_cache_sentinel")?(y=J(),s[10]=y):y=s[10];let c;s[11]!==a||s[12]!==e.application_options||s[13]!==e.environment_options||s[14]!==e.events||s[15]!==e.integrations||s[16]!==e.issue_kinds||s[17]!==e.priorities?(c=t.jsxs(M,{children:[v,t.jsx(W,{children:t.jsx(z,{method:"post",action:y,className:"space-y-3",children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"application_id",children:"Application"}),t.jsx("select",{id:"application_id",name:"application_id",value:a??"",onChange:P=>X(Number(P.target.value)),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.application_options.map(we)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"event",children:"When"}),t.jsx("select",{id:"event",name:"event",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.events.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"integration_id",children:"Notify"}),t.jsx("select",{id:"integration_id",name:"integration_id",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.integrations.map(ye)})]}),t.jsxs("div",{className:"space-y-3 border-t pt-3",children:[t.jsx("p",{className:"label-caps",children:"Only notify when (optional)"}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Environments"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:(e.environment_options[a??0]??[]).map(ve)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Issue kinds"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:e.issue_kinds.map(ke)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"min_priority",children:"Minimum priority"}),t.jsxs("select",{id:"min_priority",name:"filters[min_priority]",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"",children:"any"}),e.priorities.map(be)]})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"title_pattern",children:"Title matches"}),t.jsx(l,{id:"title_pattern",name:"filters[title_pattern]",placeholder:"timeout, or /Redis.*timeout/"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Case-insensitive substring, or a regular expression when wrapped in slashes."})]})]}),t.jsx(O,{messages:L.event}),t.jsx(i,{disabled:A||e.integrations.length===0,children:"Add rule"})]})}})})]}),s[11]=a,s[12]=e.application_options,s[13]=e.environment_options,s[14]=e.events,s[15]=e.integrations,s[16]=e.issue_kinds,s[17]=e.priorities,s[18]=c):c=s[18];let m;s[19]!==d||s[20]!==c?(m=t.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d,c]}),s[19]=d,s[20]=c,s[21]=m):m=s[21];let N;s[22]===Symbol.for("react.memo_cache_sentinel")?(N=[{key:"n",header:"Integration",cell:fe},{key:"k",header:"Kind",cell:je},{key:"s",header:"Destination",cell:ge},{key:"d",header:"Health",hideOnMobile:!0,cell:xe},{key:"e",header:"",cell:pe},{key:"x",header:"",align:"right",cell:he}],s[22]=N):N=s[22];let h;s[23]!==e.integrations?(h=t.jsx(E,{rows:e.integrations,rowKey:_e,empty:"No integrations yet.",columns:N}),s[23]=e.integrations,s[24]=h):h=s[24];let w,S,C;s[25]===Symbol.for("react.memo_cache_sentinel")?(w={key:"a",header:"Application",cell:ce},S={key:"e",header:"When",cell:de},C={key:"i",header:"Notify",cell:oe},s[25]=w,s[26]=S,s[27]=C):(w=s[25],S=s[26],C=s[27]);let u;s[28]!==e.environment_options?(u={key:"f",header:"Only when",hideOnMobile:!0,cell:g=>t.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:ae(g,e.environment_options)||"—"})},s[28]=e.environment_options,s[29]=u):u=s[29];let I;s[30]===Symbol.for("react.memo_cache_sentinel")?(I={key:"x",header:"",align:"right",cell:le},s[30]=I):I=s[30];let p;s[31]!==u?(p=[w,S,C,u,I],s[31]=u,s[32]=p):p=s[32];let x;s[33]!==e.alert_rules||s[34]!==p?(x=t.jsx(E,{rows:e.alert_rules,rowKey:me,empty:"No alert rules yet.",columns:p}),s[33]=e.alert_rules,s[34]=p,s[35]=x):x=s[35];let F;return s[36]!==h||s[37]!==x||s[38]!==m?(F=t.jsxs(ne,{breadcrumbs:j,children:[f,t.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[_,m,h,x]})]}),s[36]=h,s[37]=x,s[38]=m,s[39]=F):F=s[39],F}function le(e){return t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(te(e.id)),children:"Remove"})}function oe(e){return e.integration}function de(e){return Q[e.event]??e.event}function ce(e){return e.application}function me(e){return e.id}function he(e){return t.jsxs("span",{className:"flex flex-wrap justify-end gap-1",children:[e.kind==="linear"&&(e.settings.team_options?.length??0)>0&&t.jsxs("select",{"aria-label":`Linear team for ${e.name}`,value:e.settings.team_id??"",onChange:s=>o.patch(R(e.id),{enabled:!0,settings:{team_id:s.target.value}}),className:"border-input h-8 rounded-md border bg-transparent px-2 text-xs",children:[t.jsx("option",{value:"",children:"Select team…"}),e.settings.team_options?.map(ue)]}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.post(Z(e.id),{},{preserveScroll:!0}),children:"Send test"}),$[e.kind]&&!(e.kind==="linear"&&e.settings.oauth)&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>ie(e),children:"Rotate"}),e.kind==="linear"&&e.settings.oauth&&e.settings.credential&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.delete(ee(e.id)),children:"Disconnect"}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.patch(R(e.id),{enabled:!e.enabled}),children:e.enabled?"Disable":"Enable"}),t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(R(e.id)),children:"Remove"})]})}function ue(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id)}function pe(e){return e.enabled?null:t.jsx(K,{variant:"secondary",children:"disabled"})}function xe(e){return t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"text-muted-foreground text-xs",children:[e.kind==="linear"?"Last sync ":"Last delivery ",t.jsx(se,{iso:e.kind==="linear"?e.last_synced_at:e.last_delivered_at})]}),e.kind==="linear"&&e.webhook_health&&t.jsxs("span",{className:"text-muted-foreground text-xs",children:["Webhooks: ",e.webhook_health.pending," pending ·"," ",e.webhook_health.failed," failed"]}),e.last_error&&t.jsx("span",{className:"text-destructive max-w-64 truncate text-xs",title:e.last_error,children:e.last_error})]})}function ge(e){return t.jsx("span",{className:"font-mono text-xs",title:re[e.kind],children:e.destination??"—"})}function je(e){return t.jsx(K,{variant:"outline",children:e.kind})}function fe(e){return t.jsx("span",{className:"font-medium",children:e.name})}function _e(e){return e.id}function be(e){return t.jsx("option",{value:e,children:e},e)}function ke(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[kinds][]",value:e}),e]},e)}function ve(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[environment_ids][]",value:String(e.id)}),e.name]},e.id)}function ye(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.kind,")"]},e.id)}function Ne(e){return t.jsx("option",{value:e,children:Q[e]??e},e)}function we(e){return t.jsx("option",{value:e.id,children:e.name},e.id)}function Se(){return o.post(Y())}function Ce(e){return t.jsx("option",{value:e,children:e},e)}export{Ke as default};
1
+ import{c as G,r as D,at as T,aL as J,j as t,H as V,F as z,e as o,aM as Y,aN as R,aO as Z,aP as ee,aQ as te}from"./inertia-Cuyz2ZHO.js";import{I as O}from"./input-error-hog6gGxg.js";import{D as E}from"./data-table-CzKTEE-O.js";import{R as se}from"./relative-time-D5UbF4oO.js";import{B as K}from"./badge-DRae8XwK.js";import{B as i}from"./app-wordmark-BA_60AVb.js";import{b as H,c as B,C as M,a as W}from"./card-DPjFKfen.js";import{C as U}from"./checkbox-DPkLUiwM.js";import{L as r,I as l}from"./label-DdCBgiUn.js";import{A as ne}from"./app-layout-Zc0v-hYh.js";import"./chart-hover-CfoZUY4J.js";import"./empty-state-CW4wclK_.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./format-B9SDkrWj.js";const re={slack:"Slack hook id — incoming webhooks do not expose their channel"},$={slack:{key:"webhook_url",label:"New Slack incoming webhook URL"},webhook:{key:"secret",label:"New signing secret"},linear:{key:"api_key",label:"New Linear API key"}};function ie(e){const s=$[e.kind];if(!s)return;const n=window.prompt(s.label)?.trim();n&&o.patch(R(e.id),{enabled:!0,settings:{[s.key]:n}})}const Q={new_issue:"New issue",regressed_issue:"Regressed or reopened issue",resolved_issue:"Issue resolved",ignored_issue:"Issue ignored",assigned_issue:"Issue assigned",threshold:"Threshold exceeded",quota:"Quota reached"};function ae(e,s){const n=e.filters??{};return[...(s[e.application_id]??[]).filter(a=>(n.environment_ids??[]).includes(a.id)).map(a=>a.name),...n.kinds??[],n.min_priority?`>= ${n.min_priority}`:null,n.title_pattern].filter(Boolean).join(" · ")}function Ke(e){const s=G.c(40),[n,q]=D.useState("slack"),[a,X]=D.useState(e.application_options[0]?.id);let j,f;s[0]===Symbol.for("react.memo_cache_sentinel")?(j=[{title:"Integrations",href:T()}],f=t.jsx(V,{title:"Integrations"}),s[0]=j,s[1]=f):(j=s[0],f=s[1]);let _;s[2]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold",children:"Integrations and alerts"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"Where alerts go, and which events trigger them per application."})]}),s[2]=_):_=s[2];let b;s[3]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add integration"})}),s[3]=b):b=s[3];let k;s[4]===Symbol.for("react.memo_cache_sentinel")?(k=T(),s[4]=k):k=s[4];let d;s[5]!==n||s[6]!==e.kinds||s[7]!==e.linear_oauth_enabled?(d=t.jsxs(M,{children:[b,t.jsx(W,{children:t.jsx(z,{method:"post",action:k,className:"space-y-3",resetOnSuccess:!0,children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"kind",children:"Kind"}),t.jsx("select",{id:"kind",name:"kind",value:n,onChange:P=>q(P.target.value),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.kinds.map(Ce)})]}),!(n==="linear"&&e.linear_oauth_enabled)&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"name",children:"Name"}),t.jsx(l,{id:"name",name:"name",required:!0,placeholder:"#alerts"}),t.jsx(O,{messages:L.name})]}),n==="email"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"to",children:"Send to"}),t.jsx(l,{id:"to",name:"settings[to]",type:"email",required:!0})]}),n==="slack"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"webhook_url",children:"Incoming webhook URL"}),t.jsx(l,{id:"webhook_url",name:"settings[webhook_url]",type:"url",required:!0,placeholder:"https://hooks.slack.com/services/…"})]}),n==="webhook"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"url",children:"URL"}),t.jsx(l,{id:"url",name:"settings[url]",type:"url",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"secret",children:"Signing secret (optional)"}),t.jsx(l,{id:"secret",name:"settings[secret]"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Sent as X-Railwatch-Signature: sha256=HMAC(body)."})]})]}),n==="linear"&&e.linear_oauth_enabled&&t.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm",children:"Linear uses OAuth to discover your workspace and teams. Connect your workspace, then select a team."}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Railwatch names the integration from the Linear workspace."})]}),n==="linear"&&!e.linear_oauth_enabled&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"api_key",children:"API key"}),t.jsx(l,{id:"api_key",name:"settings[api_key]",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"team_id",children:"Team ID"}),t.jsx(l,{id:"team_id",name:"settings[team_id]",required:!0})]})]}),t.jsx(O,{messages:L.settings}),n==="linear"&&e.linear_oauth_enabled?t.jsx(i,{type:"button",onClick:Se,children:"Connect Linear workspace"}):t.jsx(i,{disabled:A,children:"Add"})]})}})})]}),s[5]=n,s[6]=e.kinds,s[7]=e.linear_oauth_enabled,s[8]=d):d=s[8];let v;s[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add alert rule"})}),s[9]=v):v=s[9];let y;s[10]===Symbol.for("react.memo_cache_sentinel")?(y=J(),s[10]=y):y=s[10];let c;s[11]!==a||s[12]!==e.application_options||s[13]!==e.environment_options||s[14]!==e.events||s[15]!==e.integrations||s[16]!==e.issue_kinds||s[17]!==e.priorities?(c=t.jsxs(M,{children:[v,t.jsx(W,{children:t.jsx(z,{method:"post",action:y,className:"space-y-3",children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"application_id",children:"Application"}),t.jsx("select",{id:"application_id",name:"application_id",value:a??"",onChange:P=>X(Number(P.target.value)),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.application_options.map(we)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"event",children:"When"}),t.jsx("select",{id:"event",name:"event",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.events.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"integration_id",children:"Notify"}),t.jsx("select",{id:"integration_id",name:"integration_id",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.integrations.map(ye)})]}),t.jsxs("div",{className:"space-y-3 border-t pt-3",children:[t.jsx("p",{className:"label-caps",children:"Only notify when (optional)"}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Environments"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:(e.environment_options[a??0]??[]).map(ve)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Issue kinds"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:e.issue_kinds.map(ke)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"min_priority",children:"Minimum priority"}),t.jsxs("select",{id:"min_priority",name:"filters[min_priority]",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"",children:"any"}),e.priorities.map(be)]})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"title_pattern",children:"Title matches"}),t.jsx(l,{id:"title_pattern",name:"filters[title_pattern]",placeholder:"timeout, or /Redis.*timeout/"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Case-insensitive substring, or a regular expression when wrapped in slashes."})]})]}),t.jsx(O,{messages:L.event}),t.jsx(i,{disabled:A||e.integrations.length===0,children:"Add rule"})]})}})})]}),s[11]=a,s[12]=e.application_options,s[13]=e.environment_options,s[14]=e.events,s[15]=e.integrations,s[16]=e.issue_kinds,s[17]=e.priorities,s[18]=c):c=s[18];let m;s[19]!==d||s[20]!==c?(m=t.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d,c]}),s[19]=d,s[20]=c,s[21]=m):m=s[21];let N;s[22]===Symbol.for("react.memo_cache_sentinel")?(N=[{key:"n",header:"Integration",cell:fe},{key:"k",header:"Kind",cell:je},{key:"s",header:"Destination",cell:ge},{key:"d",header:"Health",hideOnMobile:!0,cell:xe},{key:"e",header:"",cell:pe},{key:"x",header:"",align:"right",cell:he}],s[22]=N):N=s[22];let h;s[23]!==e.integrations?(h=t.jsx(E,{rows:e.integrations,rowKey:_e,empty:"No integrations yet.",columns:N}),s[23]=e.integrations,s[24]=h):h=s[24];let w,S,C;s[25]===Symbol.for("react.memo_cache_sentinel")?(w={key:"a",header:"Application",cell:ce},S={key:"e",header:"When",cell:de},C={key:"i",header:"Notify",cell:oe},s[25]=w,s[26]=S,s[27]=C):(w=s[25],S=s[26],C=s[27]);let u;s[28]!==e.environment_options?(u={key:"f",header:"Only when",hideOnMobile:!0,cell:g=>t.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:ae(g,e.environment_options)||"—"})},s[28]=e.environment_options,s[29]=u):u=s[29];let I;s[30]===Symbol.for("react.memo_cache_sentinel")?(I={key:"x",header:"",align:"right",cell:le},s[30]=I):I=s[30];let p;s[31]!==u?(p=[w,S,C,u,I],s[31]=u,s[32]=p):p=s[32];let x;s[33]!==e.alert_rules||s[34]!==p?(x=t.jsx(E,{rows:e.alert_rules,rowKey:me,empty:"No alert rules yet.",columns:p}),s[33]=e.alert_rules,s[34]=p,s[35]=x):x=s[35];let F;return s[36]!==h||s[37]!==x||s[38]!==m?(F=t.jsxs(ne,{breadcrumbs:j,children:[f,t.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[_,m,h,x]})]}),s[36]=h,s[37]=x,s[38]=m,s[39]=F):F=s[39],F}function le(e){return t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(te(e.id)),children:"Remove"})}function oe(e){return e.integration}function de(e){return Q[e.event]??e.event}function ce(e){return e.application}function me(e){return e.id}function he(e){return t.jsxs("span",{className:"flex flex-wrap justify-end gap-1",children:[e.kind==="linear"&&(e.settings.team_options?.length??0)>0&&t.jsxs("select",{"aria-label":`Linear team for ${e.name}`,value:e.settings.team_id??"",onChange:s=>o.patch(R(e.id),{enabled:!0,settings:{team_id:s.target.value}}),className:"border-input h-8 rounded-md border bg-transparent px-2 text-xs",children:[t.jsx("option",{value:"",children:"Select team…"}),e.settings.team_options?.map(ue)]}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.post(Z(e.id),{},{preserveScroll:!0}),children:"Send test"}),$[e.kind]&&!(e.kind==="linear"&&e.settings.oauth)&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>ie(e),children:"Rotate"}),e.kind==="linear"&&e.settings.oauth&&e.settings.credential&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.delete(ee(e.id)),children:"Disconnect"}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.patch(R(e.id),{enabled:!e.enabled}),children:e.enabled?"Disable":"Enable"}),t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(R(e.id)),children:"Remove"})]})}function ue(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id)}function pe(e){return e.enabled?null:t.jsx(K,{variant:"secondary",children:"disabled"})}function xe(e){return t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"text-muted-foreground text-xs",children:[e.kind==="linear"?"Last sync ":"Last delivery ",t.jsx(se,{iso:e.kind==="linear"?e.last_synced_at:e.last_delivered_at})]}),e.kind==="linear"&&e.webhook_health&&t.jsxs("span",{className:"text-muted-foreground text-xs",children:["Webhooks: ",e.webhook_health.pending," pending ·"," ",e.webhook_health.failed," failed"]}),e.last_error&&t.jsx("span",{className:"text-destructive max-w-64 truncate text-xs",title:e.last_error,children:e.last_error})]})}function ge(e){return t.jsx("span",{className:"font-mono text-xs",title:re[e.kind],children:e.destination??"—"})}function je(e){return t.jsx(K,{variant:"outline",children:e.kind})}function fe(e){return t.jsx("span",{className:"font-medium",children:e.name})}function _e(e){return e.id}function be(e){return t.jsx("option",{value:e,children:e},e)}function ke(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[kinds][]",value:e}),e]},e)}function ve(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[environment_ids][]",value:String(e.id)}),e.name]},e.id)}function ye(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.kind,")"]},e.id)}function Ne(e){return t.jsx("option",{value:e,children:Q[e]??e},e)}function we(e){return t.jsx("option",{value:e.id,children:e.name},e.id)}function Se(){return o.post(Y())}function Ce(e){return t.jsx("option",{value:e,children:e},e)}export{Ke as default};
@@ -1 +1 @@
1
- import{c as D,x as L,j as t,H as O,L as S,g as q,e as k,m as B,o as R,i as z,h as H}from"./inertia-CqnzqPVD.js";import{D as M}from"./data-table-CVKR2wkq.js";import{E as T}from"./empty-state-Bn48Gplm.js";import{L as $}from"./live-dot-UdzOfzJb.js";import{S as I}from"./sparkline-cell-CXCxXPWt.js";import{S as b,a as F}from"./stat-BNEfE8X1.js";import{B as C}from"./badge-Dv7I-ebP.js";import{B as E}from"./app-wordmark-Bt6XqURo.js";import{C as y,a as N,b as A,c as K}from"./card-DqdEEKcJ.js";import{O as U,A as W,P as G}from"./app-layout-2xAKndVD.js";import{c as w,a as P}from"./format-B9SDkrWj.js";import"./chart-hover-2yZG3w2u.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./series-chart-D6upsrSn.js";import"./chart-C4k7Ub9W.js";import"./use-live-DWwLg1Nj.js";import"./arrow-up-EmePsTKP.js";import"./checkbox-DKbThbxr.js";import"./label-1nSzpSB6.js";function Ne(s){const e=D.c(32);let d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[{title:"Dashboard",href:L()}],u=t.jsx(O,{title:"Dashboard"}),e[0]=d,e[1]=u):(d=e[0],u=e[1]);let i;e[2]!==s.overview_apps.length?(i=t.jsx(b,{label:"Applications",value:s.overview_apps.length}),e[2]=s.overview_apps.length,e[3]=i):i=e[3];const g=s.recent_issues.length?"destructive":"success";let a;e[4]!==s.recent_issues.length||e[5]!==g?(a=t.jsx(b,{label:"Open issues",value:s.recent_issues.length,tone:g}),e[4]=s.recent_issues.length,e[5]=g,e[6]=a):a=e[6];let r;e[7]!==s.usage.events_this_month?(r=w(s.usage.events_this_month),e[7]=s.usage.events_this_month,e[8]=r):r=e[8];let h;e[9]!==s.usage.quota?(h=w(s.usage.quota),e[9]=s.usage.quota,e[10]=h):h=e[10];const v=`of ${h} on ${s.usage.plan}`;let n;e[11]!==r||e[12]!==v?(n=t.jsx(b,{label:"Events this month",value:r,hint:v}),e[11]=r,e[12]=v,e[13]=n):n=e[13];let l;e[14]!==i||e[15]!==a||e[16]!==n?(l=t.jsxs(F,{children:[i,a,n]}),e[14]=i,e[15]=a,e[16]=n,e[17]=l):l=e[17];let o;e[18]!==s.overview_apps?(o=s.overview_apps.map(te),e[18]=s.overview_apps,e[19]=o):o=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(y,{className:"border-dashed",children:t.jsx(N,{className:"flex h-full items-center justify-center pt-6",children:t.jsx(E,{variant:"outline",onClick:se,children:"Add application"})})}),e[20]=x):x=e[20];let c;e[21]!==o?(c=t.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:[o,x]}),e[21]=o,e[22]=c):c=e[22];let f;e[23]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(A,{children:t.jsx(K,{children:"Recent open issues"})}),e[23]=f):f=e[23];let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(T,{icon:U,title:"No open issues",description:"Issues are opened when a request, job, or exception starts repeating."}),e[24]=p):p=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=[{key:"k",header:"Issue",cell:Y},{key:"t",header:"Title",cell:X},{key:"w",hideOnMobile:!0,header:"Where",cell:V},{key:"n",hideOnMobile:!0,header:"Events",align:"right",cell:Q},{key:"l",header:"Last",align:"right",cell:J}],e[25]=_):_=e[25];let m;e[26]!==s.recent_issues?(m=t.jsxs(y,{children:[f,t.jsx(N,{children:t.jsx(M,{rows:s.recent_issues,rowKey:ee,empty:p,onRowClick:Z,columns:_})})]}),e[26]=s.recent_issues,e[27]=m):m=e[27];let j;return e[28]!==c||e[29]!==m||e[30]!==l?(j=t.jsxs(W,{breadcrumbs:d,children:[u,t.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-3 md:gap-5 md:px-6 md:pt-2 md:pb-6",children:[l,c,m]})]}),e[28]=c,e[29]=m,e[30]=l,e[31]=j):j=e[31],j}function J(s){return P(s.last_seen_at)}function Q(s){return w(s.occurrences)}function V(s){return t.jsxs("span",{className:"text-xs",children:[s.application," · ",s.environment]})}function X(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function Y(s){return t.jsx("span",{className:"font-mono text-xs font-semibold",children:s.key})}function Z(s){return k.visit(z(s.id))}function ee(s){return s.id}function se(){return k.visit(H())}function te(s){return t.jsxs(y,{children:[t.jsxs(A,{className:"flex-row items-center justify-between",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"bg-muted flex size-8 shrink-0 items-center justify-center rounded-md font-mono text-xs font-semibold",children:s.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(S,{className:"block truncate text-sm font-semibold hover:underline",href:q(s.id),children:s.name}),t.jsx("div",{className:"label-caps",children:s.issue_prefix})]})]}),t.jsxs(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>k.visit(B(s.id)),children:[t.jsx(G,{className:"size-3"}),"Environment"]})]}),t.jsx(N,{className:"space-y-2",children:s.environments.map(e=>t.jsxs(S,{href:R(s.id,e.id),className:"hover:bg-muted flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:[t.jsxs("span",{className:"flex flex-1 items-center gap-2",children:[t.jsx($,{lastSeenAt:e.paused?null:e.last_seen_at,thresholdMs:6e5}),e.name]}),t.jsx(I,{data:e.request_sparkline}),t.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.error_rate>0&&t.jsxs(C,{variant:"destructive",children:[(e.error_rate*100).toFixed(1),"% err"]}),e.open_issues>0&&t.jsx(C,{variant:"destructive",children:e.open_issues}),e.last_seen_at?P(e.last_seen_at):"no data"]})]},e.id))})]},s.id)}export{Ne as default};
1
+ import{c as D,x as L,j as t,H as O,L as S,g as q,e as k,m as B,o as R,i as z,h as H}from"./inertia-Cuyz2ZHO.js";import{D as M}from"./data-table-CzKTEE-O.js";import{E as T}from"./empty-state-CW4wclK_.js";import{L as $}from"./live-dot-BZgYTYdt.js";import{S as I}from"./sparkline-cell-Dwg7awwh.js";import{S as b,a as F}from"./stat-ZtxGU8lE.js";import{B as C}from"./badge-DRae8XwK.js";import{B as E}from"./app-wordmark-BA_60AVb.js";import{C as y,a as N,b as A,c as K}from"./card-DPjFKfen.js";import{O as U,A as W,P as G}from"./app-layout-Zc0v-hYh.js";import{c as w,a as P}from"./format-B9SDkrWj.js";import"./chart-hover-CfoZUY4J.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./series-chart-gnrzhmM6.js";import"./chart-DWh7l8yM.js";import"./use-live-DMTuhKfB.js";import"./arrow-up-CLQ-7heQ.js";import"./checkbox-DPkLUiwM.js";import"./label-DdCBgiUn.js";function Ne(s){const e=D.c(32);let d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[{title:"Dashboard",href:L()}],u=t.jsx(O,{title:"Dashboard"}),e[0]=d,e[1]=u):(d=e[0],u=e[1]);let i;e[2]!==s.overview_apps.length?(i=t.jsx(b,{label:"Applications",value:s.overview_apps.length}),e[2]=s.overview_apps.length,e[3]=i):i=e[3];const g=s.recent_issues.length?"destructive":"success";let a;e[4]!==s.recent_issues.length||e[5]!==g?(a=t.jsx(b,{label:"Open issues",value:s.recent_issues.length,tone:g}),e[4]=s.recent_issues.length,e[5]=g,e[6]=a):a=e[6];let r;e[7]!==s.usage.events_this_month?(r=w(s.usage.events_this_month),e[7]=s.usage.events_this_month,e[8]=r):r=e[8];let h;e[9]!==s.usage.quota?(h=w(s.usage.quota),e[9]=s.usage.quota,e[10]=h):h=e[10];const v=`of ${h} on ${s.usage.plan}`;let n;e[11]!==r||e[12]!==v?(n=t.jsx(b,{label:"Events this month",value:r,hint:v}),e[11]=r,e[12]=v,e[13]=n):n=e[13];let l;e[14]!==i||e[15]!==a||e[16]!==n?(l=t.jsxs(F,{children:[i,a,n]}),e[14]=i,e[15]=a,e[16]=n,e[17]=l):l=e[17];let o;e[18]!==s.overview_apps?(o=s.overview_apps.map(te),e[18]=s.overview_apps,e[19]=o):o=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(y,{className:"border-dashed",children:t.jsx(N,{className:"flex h-full items-center justify-center pt-6",children:t.jsx(E,{variant:"outline",onClick:se,children:"Add application"})})}),e[20]=x):x=e[20];let c;e[21]!==o?(c=t.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:[o,x]}),e[21]=o,e[22]=c):c=e[22];let f;e[23]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(A,{children:t.jsx(K,{children:"Recent open issues"})}),e[23]=f):f=e[23];let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(T,{icon:U,title:"No open issues",description:"Issues are opened when a request, job, or exception starts repeating."}),e[24]=p):p=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=[{key:"k",header:"Issue",cell:Y},{key:"t",header:"Title",cell:X},{key:"w",hideOnMobile:!0,header:"Where",cell:V},{key:"n",hideOnMobile:!0,header:"Events",align:"right",cell:Q},{key:"l",header:"Last",align:"right",cell:J}],e[25]=_):_=e[25];let m;e[26]!==s.recent_issues?(m=t.jsxs(y,{children:[f,t.jsx(N,{children:t.jsx(M,{rows:s.recent_issues,rowKey:ee,empty:p,onRowClick:Z,columns:_})})]}),e[26]=s.recent_issues,e[27]=m):m=e[27];let j;return e[28]!==c||e[29]!==m||e[30]!==l?(j=t.jsxs(W,{breadcrumbs:d,children:[u,t.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-3 md:gap-5 md:px-6 md:pt-2 md:pb-6",children:[l,c,m]})]}),e[28]=c,e[29]=m,e[30]=l,e[31]=j):j=e[31],j}function J(s){return P(s.last_seen_at)}function Q(s){return w(s.occurrences)}function V(s){return t.jsxs("span",{className:"text-xs",children:[s.application," · ",s.environment]})}function X(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function Y(s){return t.jsx("span",{className:"font-mono text-xs font-semibold",children:s.key})}function Z(s){return k.visit(z(s.id))}function ee(s){return s.id}function se(){return k.visit(H())}function te(s){return t.jsxs(y,{children:[t.jsxs(A,{className:"flex-row items-center justify-between",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"bg-muted flex size-8 shrink-0 items-center justify-center rounded-md font-mono text-xs font-semibold",children:s.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(S,{className:"block truncate text-sm font-semibold hover:underline",href:q(s.id),children:s.name}),t.jsx("div",{className:"label-caps",children:s.issue_prefix})]})]}),t.jsxs(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>k.visit(B(s.id)),children:[t.jsx(G,{className:"size-3"}),"Environment"]})]}),t.jsx(N,{className:"space-y-2",children:s.environments.map(e=>t.jsxs(S,{href:R(s.id,e.id),className:"hover:bg-muted flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:[t.jsxs("span",{className:"flex flex-1 items-center gap-2",children:[t.jsx($,{lastSeenAt:e.paused?null:e.last_seen_at,thresholdMs:6e5}),e.name]}),t.jsx(I,{data:e.request_sparkline}),t.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.error_rate>0&&t.jsxs(C,{variant:"destructive",children:[(e.error_rate*100).toFixed(1),"% err"]}),e.open_issues>0&&t.jsx(C,{variant:"destructive",children:e.open_issues}),e.last_seen_at?P(e.last_seen_at):"no data"]})]},e.id))})]},s.id)}export{Ne as default};
@@ -1 +1 @@
1
- import{B as ae,c as F,u as he,j as l,t as pe,e as le,Z as fe,L as xe,C as ge,r as re}from"./inertia-CqnzqPVD.js";import{V as se,D as ne}from"./chart-panel-CONkZcn9.js";import{D as ee}from"./data-table-CVKR2wkq.js";import{E as ie}from"./empty-state-Bn48Gplm.js";import{F as _e}from"./filter-bar-xcbJC93z.js";import{P as ke,E as je}from"./env-layout-CKLL8Ds7.js";import{S as ce}from"./sparkline-cell-CXCxXPWt.js";import{S as ye}from"./status-badge-D0aylrM5.js";import{c as p,u as de,p as te,m as q,w as be}from"./format-B9SDkrWj.js";import{p as me,C as Ne,a as we}from"./app-layout-2xAKndVD.js";import"./series-chart-D6upsrSn.js";import"./chart-hover-2yZG3w2u.js";import"./chart-C4k7Ub9W.js";import"./badge-Dv7I-ebP.js";import"./app-wordmark-Bt6XqURo.js";import"./use-live-DWwLg1Nj.js";import"./live-dot-UdzOfzJb.js";import"./index-BDVShWMs.js";import"./index-C-EwH4lO.js";import"./segmented-C4oWE73o.js";import"./label-1nSzpSB6.js";import"./checkbox-DKbThbxr.js";const ve=[["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"}]],Me=ae("paperclip",ve);const Se=[["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"}]],Oe=ae("scissors",Se),oe=l.jsx(ie,{icon:me,title:"No model calls in this window",description:"Chats, embeddings, and other model calls your app makes through RubyLLM appear here, with the request or job that made them."}),Ce=l.jsx(ie,{icon:me,title:"No tool calls in this window",description:"Tools your models invoke appear here, timed separately from the calls that asked for them."});function Le(t){const e=F.c(7),{reason:s}=t;if(!s||s==="stop"||s==="tool_calls")return null;const a=s==="max_tokens"||s==="content_filter"?"text-destructive":"text-muted-foreground";let n;e[0]!==a?(n=ge("ml-2 inline-flex items-center gap-1 text-xs",a),e[0]=a,e[1]=n):n=e[1];const r=s==="max_tokens"?"The answer was cut off at the output token limit":`Model stopped: ${s}`;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(Oe,{className:"size-3"}),e[2]=i):i=e[2];let c;return e[3]!==s||e[4]!==n||e[5]!==r?(c=l.jsxs("span",{className:n,title:r,children:[i,s]}),e[3]=s,e[4]=n,e[5]=r,e[6]=c):c=e[6],c}function Te(t){const e=F.c(4),{call:s}=t;if(!s.attachments)return null;const o=s.attachment_names??`${s.attachments} file(s): ${s.attachment_types}`;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(Me,{className:"size-3"}),e[0]=a):a=e[0];const n=s.attachment_types??s.attachments;let r;return e[1]!==o||e[2]!==n?(r=l.jsxs("span",{className:"text-muted-foreground ml-2 inline-flex items-center gap-1 text-xs",title:o,children:[a,n]}),e[1]=o,e[2]=n,e[3]=r):r=e[3],r}function Fe(t){const e=F.c(19),{call:s}=t,[o,a]=re.useState(!1),{prompt:n,completion:r,params:i,provider_request_id:c,tools:f}=s;if(!(n!==null||r!==null||c!==null||f!==null||i!==null&&Object.keys(i).length>0)){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("span",{className:"text-muted-foreground",children:"–"}),e[0]=g):g=e[0],g}const _=o?Ne:we;let d;e[1]!==o?(d=()=>a(!o),e[1]=o,e[2]=d):d=e[2];let m;e[3]!==_?(m=l.jsx(_,{className:"size-3"}),e[3]=_,e[4]=m):m=e[4];let u;e[5]!==o||e[6]!==d||e[7]!==m?(u=l.jsxs("button",{type:"button",onClick:d,"aria-expanded":o,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[m,"Detail"]}),e[5]=o,e[6]=d,e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==c||e[14]!==f?(h=o&&l.jsxs("div",{className:"w-[70vw] max-w-[36rem] space-y-2 text-left",children:[l.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[c&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"provider id"}),l.jsx("dd",{className:"break-all",children:c})]}),f&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"tools"}),l.jsx("dd",{className:"break-all",children:f})]}),i&&Object.entries(i).map(qe)]}),[["Prompt",n],["Completion",r]].map($e)]}),e[9]=r,e[10]=o,e[11]=i,e[12]=n,e[13]=c,e[14]=f,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=l.jsxs("div",{className:"flex flex-col items-end gap-1",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function $e(t){const[e,s]=t;return s?l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-[10px] tracking-wide uppercase",children:e}),l.jsx("pre",{className:"bg-muted max-h-64 overflow-auto rounded p-2 font-mono text-[10px] break-all whitespace-pre-wrap",children:s})]},e):null}function qe(t){const[e,s]=t;return l.jsxs(re.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:e}),l.jsx("dd",{className:"break-all",children:typeof s=="string"||typeof s=="number"?s:JSON.stringify(s)})]},e)}function ue(t){const e=F.c(9),{cost:s,unpriced:o}=t;if(s===null){let i;return e[0]!==o?(i=o>0?l.jsx("span",{className:"text-muted-foreground",title:"No registry pricing",children:"unpriced"}):l.jsx("span",{className:"text-muted-foreground",title:"Nothing here has a price",children:"–"}),e[0]=o,e[1]=i):i=e[1],i}let a;e[2]!==s?(a=de(s),e[2]=s,e[3]=a):a=e[3];let n;e[4]!==o?(n=o>0&&l.jsxs("span",{className:"text-muted-foreground ml-1 text-xs font-normal",title:`${o} call${o===1?"":"s"} had no registry pricing and are not in this total`,children:["+",p(o)," unpriced"]}),e[4]=o,e[5]=n):n=e[5];let r;return e[6]!==a||e[7]!==n?(r=l.jsxs("span",{className:"font-semibold",children:[a,n]}),e[6]=a,e[7]=n,e[8]=r):r=e[8],r}function $(t){const e=F.c(7),{label:s,children:o}=t;let a;e[0]!==s?(a=l.jsx("div",{className:"text-muted-foreground text-xs",children:s}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==o?(n=l.jsx("div",{className:"truncate text-lg",children:o}),e[2]=o,e[3]=n):n=e[3];let r;return e[4]!==a||e[5]!==n?(r=l.jsxs("div",{className:"min-w-0",children:[a,n]}),e[4]=a,e[5]=n,e[6]=r):r=e[6],r}function Ft(t){const e=F.c(79),{environment:s,window:o}=he().props,a=s.application_id,n=s.id;let r;e[0]!==a||e[1]!==n?(r=k=>k.execution_id?pe(a,n,k.execution_id):null,e[0]=a,e[1]=n,e[2]=r):r=e[2];const i=r;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(ke,{title:"LLM",description:"Model calls and tool invocations through RubyLLM, by model and by the request or job that made them."}),e[3]=c):c=e[3];let f;e[4]!==t.totals.count?(f=p(t.totals.count),e[4]=t.totals.count,e[5]=f):f=e[5];let j;e[6]!==f?(j=l.jsx($,{label:"Model calls",children:f}),e[6]=f,e[7]=j):j=e[7];let _;e[8]!==t.totals.tool_count?(_=p(t.totals.tool_count),e[8]=t.totals.tool_count,e[9]=_):_=e[9];let d;e[10]!==_?(d=l.jsx($,{label:"Tool calls",children:_}),e[10]=_,e[11]=d):d=e[11];let m;e[12]!==t.totals.cost||e[13]!==t.totals.unpriced?(m=l.jsx($,{label:"Spend",children:l.jsx(ue,{cost:t.totals.cost,unpriced:t.totals.unpriced})}),e[12]=t.totals.cost,e[13]=t.totals.unpriced,e[14]=m):m=e[14];let u;e[15]!==t.totals.input_tokens?(u=p(t.totals.input_tokens),e[15]=t.totals.input_tokens,e[16]=u):u=e[16];let h;e[17]!==u?(h=l.jsx($,{label:"Tokens in",children:u}),e[17]=u,e[18]=h):h=e[18];let x;e[19]!==t.totals.output_tokens?(x=p(t.totals.output_tokens),e[19]=t.totals.output_tokens,e[20]=x):x=e[20];let g;e[21]!==x?(g=l.jsx($,{label:"Tokens out",children:x}),e[21]=x,e[22]=g):g=e[22];let y;e[23]!==g||e[24]!==j||e[25]!==d||e[26]!==m||e[27]!==h?(y=l.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-5",children:[j,d,m,h,g]}),e[23]=g,e[24]=j,e[25]=d,e[26]=m,e[27]=h,e[28]=y):y=e[28];let b;e[29]!==t.series?(b=l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(se,{legend:"request",label:"Model calls",seriesLabel:"Calls",data:t.series}),l.jsx(ne,{label:"Model latency",data:t.series,percentile:"p95"})]}),e[29]=t.series,e[30]=b):b=e[30];let N;e[31]!==t.tool_series||e[32]!==t.totals.tool_count?(N=t.totals.tool_count>0&&l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(se,{legend:"request",label:"Tool calls",seriesLabel:"Calls",data:t.tool_series}),l.jsx(ne,{label:"Tool latency",data:t.tool_series,percentile:"p95"})]}),e[31]=t.tool_series,e[32]=t.totals.tool_count,e[33]=N):N=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=[{key:"m",header:"Model",cell:it},{key:"trend",hideOnMobile:!0,header:"Trend",cell:rt},{key:"n",header:"Calls",align:"right",cell:at},{key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:ot},{key:"cut",hideOnMobile:!0,header:"Cut off",align:"right",cell:nt},{key:"att",hideOnMobile:!0,header:"With files",align:"right",cell:st},{key:"in",hideOnMobile:!0,header:"Tokens in",align:"right",cell:lt},{key:"out",hideOnMobile:!0,header:"Tokens out",align:"right",cell:tt},{key:"cached",hideOnMobile:!0,header:"Cached",align:"right",cell:et},{key:"p95",hideOnMobile:!0,header:"p95",align:"right",cell:Ye},{key:"cost",header:"Spend",align:"right",cell:Xe}],e[34]=D):D=e[34];let w;e[35]!==t.models?(w=l.jsx(ee,{rows:t.models,rowKey:ct,empty:oe,columns:D}),e[35]=t.models,e[36]=w):w=e[36];let v;e[37]!==t.tools?(v=t.tools.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Tools"}),l.jsx(ee,{rows:t.tools,rowKey:Ue,empty:Ce,columns:[{key:"t",header:"Tool",cell:Qe},{key:"trend",hideOnMobile:!0,header:"Trend",cell:Ge},{key:"n",header:"Calls",align:"right",cell:Ze},{key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:Je},{key:"avg",hideOnMobile:!0,header:"Avg",align:"right",cell:He},{key:"p95",header:"p95",align:"right",cell:Ve},{key:"max",hideOnMobile:!0,header:"Max",align:"right",cell:Ie}]})]}),e[37]=t.tools,e[38]=v):v=e[38];let E;e[39]===Symbol.for("react.memo_cache_sentinel")?(E=l.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[39]=E):E=e[39];let P,R;e[40]===Symbol.for("react.memo_cache_sentinel")?(P={key:"model",label:"Model"},R={key:"provider",label:"Provider"},e[40]=P,e[41]=R):(P=e[40],R=e[41]);let W,z;e[42]===Symbol.for("react.memo_cache_sentinel")?(W={key:"operation",label:"Operation",options:["chat","tool","embedding","image","speech","transcription","moderation","rerank","ocr"]},z={key:"workflow",label:"Workflow"},e[42]=W,e[43]=z):(W=e[42],z=e[43]);let A;e[44]===Symbol.for("react.memo_cache_sentinel")?(A={key:"finish",label:"Finish",options:["stop","max_tokens","tool_calls","content_filter"]},e[44]=A):A=e[44];let B;e[45]===Symbol.for("react.memo_cache_sentinel")?(B=[P,R,W,z,A,{key:"attachments",label:"Files",options:["any","image","pdf","audio","video"]}],e[45]=B):B=e[45];let M;e[46]!==a||e[47]!==n||e[48]!==o?(M=k=>le.visit(fe(a,n,{window:o,q:k||void 0}),{preserveState:!0}),e[46]=a,e[47]=n,e[48]=o,e[49]=M):M=e[49];let S;e[50]!==t.q||e[51]!==M?(S=l.jsx(_e,{value:t.q,fields:B,onChange:M,placeholder:"model:claude-opus-5 operation:chat"}),e[50]=t.q,e[51]=M,e[52]=S):S=e[52];let O;e[53]!==i?(O={onOpen:(k,X)=>{const Y=i(k);Y&&(X?.newTab?globalThis.window.open(Y,"_blank"):le.visit(Y))}},e[53]=i,e[54]=O):O=e[54];let K,I,V,H,J,Z,G;e[55]===Symbol.for("react.memo_cache_sentinel")?(K={key:"when",header:"When",cell:Be},I={key:"st",header:"Status",cell:Ae},V={key:"what",header:"Call",cell:ze},H={key:"wf",hideOnMobile:!0,header:"Workflow",cell:We},J={key:"tok",hideOnMobile:!0,header:"Tokens",align:"right",cell:Re},Z={key:"d",header:"Duration",align:"right",cell:Pe},G={key:"cost",header:"Cost",align:"right",cell:Ee},e[55]=K,e[56]=I,e[57]=V,e[58]=H,e[59]=J,e[60]=Z,e[61]=G):(K=e[55],I=e[56],V=e[57],H=e[58],J=e[59],Z=e[60],G=e[61]);let C;e[62]!==i?(C={key:"in",hideOnMobile:!0,header:"In",cell:k=>{const X=i(k);return X?l.jsx(xe,{className:"font-mono text-xs hover:underline",href:X,children:k.execution_preview}):null}},e[62]=i,e[63]=C):C=e[63];let Q;e[64]===Symbol.for("react.memo_cache_sentinel")?(Q={key:"content",header:"Detail",align:"right",cell:De},e[64]=Q):Q=e[64];let L;e[65]!==C?(L=[K,I,V,H,J,Z,G,C,Q],e[65]=C,e[66]=L):L=e[66];let T;e[67]!==t.recent||e[68]!==O||e[69]!==L?(T=l.jsx(ee,{rows:t.recent,rowKey:Ke,empty:oe,keyboardNav:O,columns:L}),e[67]=t.recent,e[68]=O,e[69]=L,e[70]=T):T=e[70];let U;return e[71]!==y||e[72]!==b||e[73]!==N||e[74]!==w||e[75]!==v||e[76]!==S||e[77]!==T?(U=l.jsxs(je,{title:"LLM",children:[c,y,b,N,w,v,E,S,T]}),e[71]=y,e[72]=b,e[73]=N,e[74]=w,e[75]=v,e[76]=S,e[77]=T,e[78]=U):U=e[78],U}function De(t){return l.jsx(Fe,{call:t})}function Ee(t){return t.cost===null&&t.operation!=="tool"?l.jsx("span",{className:"text-muted-foreground",title:"No registry pricing",children:"unpriced"}):de(t.cost)}function Pe(t){return q(t.duration)}function Re(t){return t.input_tokens===null&&t.output_tokens===null?l.jsx("span",{className:"text-muted-foreground",children:"–"}):l.jsxs("span",{className:"font-mono text-xs",children:[p(t.input_tokens??0)," / ",p(t.output_tokens??0)]})}function We(t){return t.workflow_name?l.jsxs("span",{className:"text-xs",children:[t.workflow_name,t.workflow_step_name&&l.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.workflow_step_name]})]}):null}function ze(t){return l.jsxs("span",{className:"font-mono text-xs",children:[t.operation==="tool"?t.tool_name:l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-muted-foreground",children:[t.provider,"/"]}),l.jsx("span",{className:"font-semibold",children:t.model})]}),t.error&&l.jsx("span",{className:"text-destructive ml-2",children:t.error}),l.jsx(Le,{reason:t.finish_reason}),l.jsx(Te,{call:t})]})}function Ae(t){return l.jsx(ye,{status:null,label:t.status==="failed"?"error":t.operation,outcome:t.status==="failed"?"failed":void 0})}function Be(t){return l.jsx("span",{className:"text-xs",children:be(t.occurred_at)})}function Ke(t){return t.id}function Ie(t){return q(t.max)}function Ve(t){return l.jsx("span",{className:"font-semibold",children:q(t.p95)})}function He(t){return q(t.avg)}function Je(t){return l.jsx("span",{className:t.errors?"text-destructive":"",children:te(t.errors,t.count)})}function Ze(t){return p(t.count)}function Ge(t){return l.jsx(ce,{data:t.sparkline})}function Qe(t){return l.jsx("span",{className:"font-mono text-xs",children:t.name})}function Ue(t){return t.group_hash}function Xe(t){return l.jsx(ue,{cost:t.cost,unpriced:t.unpriced})}function Ye(t){return q(t.p95)}function et(t){return p(t.cache_read_tokens)}function tt(t){return p(t.output_tokens)}function lt(t){return p(t.input_tokens)}function st(t){return t.with_attachments?p(t.with_attachments):l.jsx("span",{className:"text-muted-foreground",children:"–"})}function nt(t){return t.truncated?l.jsx("span",{className:"text-destructive",title:"Answers stopped at the output token limit",children:te(t.truncated,t.count)}):l.jsx("span",{className:"text-muted-foreground",children:"–"})}function ot(t){return l.jsx("span",{className:t.errors?"text-destructive":"",children:te(t.errors,t.count)})}function at(t){return p(t.count)}function rt(t){return l.jsx(ce,{data:t.sparkline})}function it(t){return l.jsx("span",{className:"font-mono text-xs",children:t.name})}function ct(t){return t.group_hash}export{Ft as default};
1
+ import{B as ae,c as F,u as he,j as l,t as fe,e as le,Z as pe,L as xe,C as ge,r as re}from"./inertia-Cuyz2ZHO.js";import{V as se,D as ne}from"./chart-panel-CC49WTQL.js";import{D as ee}from"./data-table-CzKTEE-O.js";import{E as ie}from"./empty-state-CW4wclK_.js";import{F as _e}from"./filter-bar-CJDjWFib.js";import{P as ke,E as je}from"./env-layout-Kz7wks1x.js";import{S as ce}from"./sparkline-cell-Dwg7awwh.js";import{S as ye}from"./status-badge-CH5P-Xkj.js";import{c as f,u as de,p as te,m as D,w as be}from"./format-B9SDkrWj.js";import{p as me,C as Ne,a as we}from"./app-layout-Zc0v-hYh.js";import"./series-chart-gnrzhmM6.js";import"./chart-hover-CfoZUY4J.js";import"./chart-DWh7l8yM.js";import"./badge-DRae8XwK.js";import"./app-wordmark-BA_60AVb.js";import"./use-live-DMTuhKfB.js";import"./live-dot-BZgYTYdt.js";import"./index-CBip6V4z.js";import"./index-BfbSo01U.js";import"./segmented-BeIe4uqk.js";import"./label-DdCBgiUn.js";import"./checkbox-DPkLUiwM.js";const ve=[["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"}]],Me=ae("paperclip",ve);const Se=[["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"}]],Oe=ae("scissors",Se),oe=l.jsx(ie,{icon:me,title:"No model calls in this window",description:"Chats, embeddings, and other model calls your app makes through RubyLLM appear here, with the request or job that made them."}),Ce=l.jsx(ie,{icon:me,title:"No tool calls in this window",description:"Tools your models invoke appear here, timed separately from the calls that asked for them."});function Le(t){const e=F.c(7),{reason:s}=t;if(!s||s==="stop"||s==="tool_calls")return null;const a=s==="max_tokens"||s==="content_filter"?"text-destructive":"text-muted-foreground";let n;e[0]!==a?(n=ge("ml-2 inline-flex items-center gap-1 text-xs",a),e[0]=a,e[1]=n):n=e[1];const r=s==="max_tokens"?"The answer was cut off at the output token limit":`Model stopped: ${s}`;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=l.jsx(Oe,{className:"size-3"}),e[2]=i):i=e[2];let c;return e[3]!==s||e[4]!==n||e[5]!==r?(c=l.jsxs("span",{className:n,title:r,children:[i,s]}),e[3]=s,e[4]=n,e[5]=r,e[6]=c):c=e[6],c}function Te(t){const e=F.c(4),{call:s}=t;if(!s.attachments)return null;const o=s.attachment_names??`${s.attachments} file(s): ${s.attachment_types}`;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(Me,{className:"size-3"}),e[0]=a):a=e[0];const n=s.attachment_types??s.attachments;let r;return e[1]!==o||e[2]!==n?(r=l.jsxs("span",{className:"text-muted-foreground ml-2 inline-flex items-center gap-1 text-xs",title:o,children:[a,n]}),e[1]=o,e[2]=n,e[3]=r):r=e[3],r}function Fe(t){const e=F.c(19),{call:s}=t,[o,a]=re.useState(!1),{prompt:n,completion:r,params:i,provider_request_id:c,tools:p}=s;if(!(n!==null||r!==null||c!==null||p!==null||i!==null&&Object.keys(i).length>0)){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=l.jsx("span",{className:"text-muted-foreground",children:"–"}),e[0]=g):g=e[0],g}const _=o?Ne:we;let d;e[1]!==o?(d=()=>a(!o),e[1]=o,e[2]=d):d=e[2];let m;e[3]!==_?(m=l.jsx(_,{className:"size-3"}),e[3]=_,e[4]=m):m=e[4];let u;e[5]!==o||e[6]!==d||e[7]!==m?(u=l.jsxs("button",{type:"button",onClick:d,"aria-expanded":o,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1",children:[m,"Detail"]}),e[5]=o,e[6]=d,e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==i||e[12]!==n||e[13]!==c||e[14]!==p?(h=o&&l.jsxs("div",{className:"w-[70vw] max-w-[36rem] space-y-2 text-left",children:[l.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[10px]",children:[c&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"provider id"}),l.jsx("dd",{className:"break-all",children:c})]}),p&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:"tools"}),l.jsx("dd",{className:"break-all",children:p})]}),i&&Object.entries(i).map(De)]}),[["Prompt",n],["Completion",r]].map($e)]}),e[9]=r,e[10]=o,e[11]=i,e[12]=n,e[13]=c,e[14]=p,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=l.jsxs("div",{className:"flex flex-col items-end gap-1",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function $e(t){const[e,s]=t;return s?l.jsxs("div",{children:[l.jsx("div",{className:"text-muted-foreground text-[10px] tracking-wide uppercase",children:e}),l.jsx("pre",{className:"bg-muted max-h-64 overflow-auto rounded p-2 font-mono text-[10px] break-all whitespace-pre-wrap",children:s})]},e):null}function De(t){const[e,s]=t;return l.jsxs(re.Fragment,{children:[l.jsx("dt",{className:"text-muted-foreground",children:e}),l.jsx("dd",{className:"break-all",children:typeof s=="string"||typeof s=="number"?s:JSON.stringify(s)})]},e)}function ue(t){const e=F.c(9),{cost:s,unpriced:o}=t;if(s===null){let i;return e[0]!==o?(i=o>0?l.jsx("span",{className:"text-muted-foreground",title:"No registry pricing",children:"unpriced"}):l.jsx("span",{className:"text-muted-foreground",title:"Nothing here has a price",children:"–"}),e[0]=o,e[1]=i):i=e[1],i}let a;e[2]!==s?(a=de(s),e[2]=s,e[3]=a):a=e[3];let n;e[4]!==o?(n=o>0&&l.jsxs("span",{className:"text-muted-foreground ml-1 text-xs font-normal",title:`${o} call${o===1?"":"s"} had no registry pricing and are not in this total`,children:["+",f(o)," unpriced"]}),e[4]=o,e[5]=n):n=e[5];let r;return e[6]!==a||e[7]!==n?(r=l.jsxs("span",{className:"font-semibold",children:[a,n]}),e[6]=a,e[7]=n,e[8]=r):r=e[8],r}function $(t){const e=F.c(7),{label:s,children:o}=t;let a;e[0]!==s?(a=l.jsx("div",{className:"text-muted-foreground text-xs",children:s}),e[0]=s,e[1]=a):a=e[1];let n;e[2]!==o?(n=l.jsx("div",{className:"truncate text-lg",children:o}),e[2]=o,e[3]=n):n=e[3];let r;return e[4]!==a||e[5]!==n?(r=l.jsxs("div",{className:"min-w-0",children:[a,n]}),e[4]=a,e[5]=n,e[6]=r):r=e[6],r}function Ft(t){const e=F.c(79),{environment:s,window:o}=he().props,a=s.application_id,n=s.id;let r;e[0]!==a||e[1]!==n?(r=k=>k.execution_id?fe(a,n,k.execution_id):null,e[0]=a,e[1]=n,e[2]=r):r=e[2];const i=r;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=l.jsx(ke,{title:"LLM",description:"Model calls and tool invocations through RubyLLM, by model and by the request or job that made them."}),e[3]=c):c=e[3];let p;e[4]!==t.totals.count?(p=f(t.totals.count),e[4]=t.totals.count,e[5]=p):p=e[5];let j;e[6]!==p?(j=l.jsx($,{label:"Model calls",children:p}),e[6]=p,e[7]=j):j=e[7];let _;e[8]!==t.totals.tool_count?(_=f(t.totals.tool_count),e[8]=t.totals.tool_count,e[9]=_):_=e[9];let d;e[10]!==_?(d=l.jsx($,{label:"Tool calls",children:_}),e[10]=_,e[11]=d):d=e[11];let m;e[12]!==t.totals.cost||e[13]!==t.totals.unpriced?(m=l.jsx($,{label:"Spend",children:l.jsx(ue,{cost:t.totals.cost,unpriced:t.totals.unpriced})}),e[12]=t.totals.cost,e[13]=t.totals.unpriced,e[14]=m):m=e[14];let u;e[15]!==t.totals.input_tokens?(u=f(t.totals.input_tokens),e[15]=t.totals.input_tokens,e[16]=u):u=e[16];let h;e[17]!==u?(h=l.jsx($,{label:"Tokens in",children:u}),e[17]=u,e[18]=h):h=e[18];let x;e[19]!==t.totals.output_tokens?(x=f(t.totals.output_tokens),e[19]=t.totals.output_tokens,e[20]=x):x=e[20];let g;e[21]!==x?(g=l.jsx($,{label:"Tokens out",children:x}),e[21]=x,e[22]=g):g=e[22];let y;e[23]!==g||e[24]!==j||e[25]!==d||e[26]!==m||e[27]!==h?(y=l.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-5",children:[j,d,m,h,g]}),e[23]=g,e[24]=j,e[25]=d,e[26]=m,e[27]=h,e[28]=y):y=e[28];let b;e[29]!==t.series?(b=l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(se,{legend:"outcome",label:"Model calls",seriesLabel:"Calls",data:t.series}),l.jsx(ne,{label:"Model latency",data:t.series,percentile:"p95"})]}),e[29]=t.series,e[30]=b):b=e[30];let N;e[31]!==t.tool_series||e[32]!==t.totals.tool_count?(N=t.totals.tool_count>0&&l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(se,{legend:"outcome",label:"Tool calls",seriesLabel:"Calls",data:t.tool_series}),l.jsx(ne,{label:"Tool latency",data:t.tool_series,percentile:"p95"})]}),e[31]=t.tool_series,e[32]=t.totals.tool_count,e[33]=N):N=e[33];let E;e[34]===Symbol.for("react.memo_cache_sentinel")?(E=[{key:"m",header:"Model",cell:it},{key:"trend",hideOnMobile:!0,header:"Trend",cell:rt},{key:"n",header:"Calls",align:"right",cell:at},{key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:ot},{key:"cut",hideOnMobile:!0,header:"Cut off",align:"right",cell:nt},{key:"att",hideOnMobile:!0,header:"With files",align:"right",cell:st},{key:"in",hideOnMobile:!0,header:"Tokens in",align:"right",cell:lt},{key:"out",hideOnMobile:!0,header:"Tokens out",align:"right",cell:tt},{key:"cached",hideOnMobile:!0,header:"Cached",align:"right",cell:et},{key:"p95",hideOnMobile:!0,header:"p95",align:"right",cell:Ye},{key:"cost",header:"Spend",align:"right",cell:Xe}],e[34]=E):E=e[34];let w;e[35]!==t.models?(w=l.jsx(ee,{rows:t.models,rowKey:ct,empty:oe,columns:E}),e[35]=t.models,e[36]=w):w=e[36];let v;e[37]!==t.tools?(v=t.tools.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h2",{className:"text-sm font-semibold",children:"Tools"}),l.jsx(ee,{rows:t.tools,rowKey:Ue,empty:Ce,columns:[{key:"t",header:"Tool",cell:Qe},{key:"trend",hideOnMobile:!0,header:"Trend",cell:Ge},{key:"n",header:"Calls",align:"right",cell:Ze},{key:"f",hideOnMobile:!0,header:"Failed",align:"right",cell:Je},{key:"avg",hideOnMobile:!0,header:"Avg",align:"right",cell:He},{key:"p95",header:"p95",align:"right",cell:Ve},{key:"max",hideOnMobile:!0,header:"Max",align:"right",cell:Ie}]})]}),e[37]=t.tools,e[38]=v):v=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=l.jsx("h2",{className:"text-sm font-semibold",children:"Recent"}),e[39]=P):P=e[39];let q,R;e[40]===Symbol.for("react.memo_cache_sentinel")?(q={key:"model",label:"Model"},R={key:"provider",label:"Provider"},e[40]=q,e[41]=R):(q=e[40],R=e[41]);let W,z;e[42]===Symbol.for("react.memo_cache_sentinel")?(W={key:"operation",label:"Operation",options:["chat","tool","embedding","image","speech","transcription","moderation","rerank","ocr"]},z={key:"workflow",label:"Workflow"},e[42]=W,e[43]=z):(W=e[42],z=e[43]);let A;e[44]===Symbol.for("react.memo_cache_sentinel")?(A={key:"finish",label:"Finish",options:["stop","max_tokens","tool_calls","content_filter"]},e[44]=A):A=e[44];let B;e[45]===Symbol.for("react.memo_cache_sentinel")?(B=[q,R,W,z,A,{key:"attachments",label:"Files",options:["any","image","pdf","audio","video"]}],e[45]=B):B=e[45];let M;e[46]!==a||e[47]!==n||e[48]!==o?(M=k=>le.visit(pe(a,n,{window:o,q:k||void 0}),{preserveState:!0}),e[46]=a,e[47]=n,e[48]=o,e[49]=M):M=e[49];let S;e[50]!==t.q||e[51]!==M?(S=l.jsx(_e,{value:t.q,fields:B,onChange:M,placeholder:"model:claude-opus-5 operation:chat"}),e[50]=t.q,e[51]=M,e[52]=S):S=e[52];let O;e[53]!==i?(O={onOpen:(k,X)=>{const Y=i(k);Y&&(X?.newTab?globalThis.window.open(Y,"_blank"):le.visit(Y))}},e[53]=i,e[54]=O):O=e[54];let K,I,V,H,J,Z,G;e[55]===Symbol.for("react.memo_cache_sentinel")?(K={key:"when",header:"When",cell:Be},I={key:"st",header:"Status",cell:Ae},V={key:"what",header:"Call",grow:!0,cell:ze},H={key:"wf",hideOnMobile:!0,header:"Workflow",cell:We},J={key:"tok",hideOnMobile:!0,header:"Tokens",align:"right",cell:Re},Z={key:"d",header:"Duration",align:"right",cell:qe},G={key:"cost",header:"Cost",align:"right",cell:Pe},e[55]=K,e[56]=I,e[57]=V,e[58]=H,e[59]=J,e[60]=Z,e[61]=G):(K=e[55],I=e[56],V=e[57],H=e[58],J=e[59],Z=e[60],G=e[61]);let C;e[62]!==i?(C={key:"in",hideOnMobile:!0,header:"In",cell:k=>{const X=i(k);return X?l.jsx(xe,{className:"font-mono text-xs hover:underline",href:X,children:k.execution_preview}):null}},e[62]=i,e[63]=C):C=e[63];let Q;e[64]===Symbol.for("react.memo_cache_sentinel")?(Q={key:"content",header:"Detail",align:"right",cell:Ee},e[64]=Q):Q=e[64];let L;e[65]!==C?(L=[K,I,V,H,J,Z,G,C,Q],e[65]=C,e[66]=L):L=e[66];let T;e[67]!==t.recent||e[68]!==O||e[69]!==L?(T=l.jsx(ee,{rows:t.recent,rowKey:Ke,empty:oe,keyboardNav:O,columns:L}),e[67]=t.recent,e[68]=O,e[69]=L,e[70]=T):T=e[70];let U;return e[71]!==y||e[72]!==b||e[73]!==N||e[74]!==w||e[75]!==v||e[76]!==S||e[77]!==T?(U=l.jsxs(je,{title:"LLM",children:[c,y,b,N,w,v,P,S,T]}),e[71]=y,e[72]=b,e[73]=N,e[74]=w,e[75]=v,e[76]=S,e[77]=T,e[78]=U):U=e[78],U}function Ee(t){return l.jsx(Fe,{call:t})}function Pe(t){return t.cost===null&&t.operation!=="tool"&&t.status!=="failed"?l.jsx("span",{className:"text-muted-foreground",title:"No registry pricing",children:"unpriced"}):de(t.cost)}function qe(t){return D(t.duration)}function Re(t){return t.input_tokens===null&&t.output_tokens===null?l.jsx("span",{className:"text-muted-foreground",children:"–"}):l.jsxs("span",{className:"font-mono text-xs",children:[f(t.input_tokens??0)," / ",f(t.output_tokens??0)]})}function We(t){return t.workflow_name?l.jsxs("span",{className:"text-xs",children:[t.workflow_name,t.workflow_step_name&&l.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.workflow_step_name]})]}):null}function ze(t){return l.jsxs("span",{className:"font-mono text-xs",children:[t.operation==="tool"?t.tool_name:l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"text-muted-foreground",children:[t.provider,"/"]}),l.jsx("span",{className:"font-semibold",children:t.model})]}),t.error&&l.jsx("span",{className:"text-destructive ml-2",children:t.error}),l.jsx(Le,{reason:t.finish_reason}),l.jsx(Te,{call:t})]})}function Ae(t){return l.jsx(ye,{status:null,label:t.status==="failed"?"error":t.operation,outcome:t.status==="failed"?"failed":void 0})}function Be(t){return l.jsx("span",{className:"text-xs",children:be(t.occurred_at)})}function Ke(t){return t.id}function Ie(t){return D(t.max)}function Ve(t){return l.jsx("span",{className:"font-semibold",children:D(t.p95)})}function He(t){return D(t.avg)}function Je(t){return l.jsx("span",{className:t.errors?"text-destructive":"",children:te(t.errors,t.count)})}function Ze(t){return f(t.count)}function Ge(t){return l.jsx(ce,{data:t.sparkline})}function Qe(t){return l.jsx("span",{className:"font-mono text-xs",children:t.name})}function Ue(t){return t.group_hash}function Xe(t){return l.jsx(ue,{cost:t.cost,unpriced:t.unpriced})}function Ye(t){return D(t.p95)}function et(t){return f(t.cache_read_tokens)}function tt(t){return f(t.output_tokens)}function lt(t){return f(t.input_tokens)}function st(t){return t.with_attachments?f(t.with_attachments):l.jsx("span",{className:"text-muted-foreground",children:"–"})}function nt(t){return t.truncated?l.jsx("span",{className:"text-destructive",title:"Answers stopped at the output token limit",children:te(t.truncated,t.count)}):l.jsx("span",{className:"text-muted-foreground",children:"–"})}function ot(t){return l.jsx("span",{className:t.errors?"text-destructive":"",children:te(t.errors,t.count)})}function at(t){return f(t.count)}function rt(t){return l.jsx(ce,{data:t.sparkline})}function it(t){return l.jsx("span",{className:"font-mono text-xs",children:t.name})}function ct(t){return t.group_hash}export{Ft as default};