@mavea/mavea 1.0.13 → 1.0.14

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 (163) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +4 -3
  3. package/dist/.vite/manifest.json +587 -605
  4. package/dist/assets/{AppCommandPalette-D_g8-7C0.js → AppCommandPalette-D5nd3VO_.js} +1 -1
  5. package/dist/assets/{BlockEmpty-Ddhgr5pu.js → BlockEmpty-BZn5ETuL.js} +1 -1
  6. package/dist/assets/{BriefingPlayer-D-QhLgXI.js → BriefingPlayer-JnrrvxYE.js} +1 -1
  7. package/dist/assets/{CanvasSkeleton-BIiOmCMG.js → CanvasSkeleton-D00MzkIV.js} +2 -2
  8. package/dist/assets/{CheckLogRail-ZrDqyjQ7.js → CheckLogRail--9iHharq.js} +1 -1
  9. package/dist/assets/{CodeOutput-D7sVg1Nr.js → CodeOutput-408gGn9V.js} +1 -1
  10. package/dist/assets/{CommandPalette-DNa2q8E_.js → CommandPalette-BIUG6Sn7.js} +1 -1
  11. package/dist/assets/{CourseLessonReader-BIpGjcJk.js → CourseLessonReader-Yp2qEsDx.js} +2 -2
  12. package/dist/assets/{CourseRail-CQaotzN0.js → CourseRail-BVvnoWBR.js} +1 -1
  13. package/dist/assets/{CoursesApp-q3kZJmu1.js → CoursesApp-0N_F1p_u.js} +2 -2
  14. package/dist/assets/{CrossExamPanel-BIJslibV.js → CrossExamPanel-CocJ_GxK.js} +1 -1
  15. package/dist/assets/{DashPresent-DGSE0vYM.js → DashPresent-G8Actzx7.js} +1 -1
  16. package/dist/assets/{DashboardDetail-BpaLNg8R.js → DashboardDetail-BpSe8wBT.js} +2 -2
  17. package/dist/assets/DashboardLoopRuntime-CHPDkO3Y.js +1 -0
  18. package/dist/assets/{DashboardOverview-8x3OxX2i.js → DashboardOverview-Cdhy4x4b.js} +1 -1
  19. package/dist/assets/{DashboardSettings-f_zxcs5j.js → DashboardSettings-ChPkh0t4.js} +1 -1
  20. package/dist/assets/DashboardsApp-mp-V3d1i.js +2 -0
  21. package/dist/assets/{DeepZoomApp-E7bDmzuL.js → DeepZoomApp-mZHk132w.js} +1 -1
  22. package/dist/assets/{DelegatePanel-_9RZiLHM.css → DelegatePanel-Cf85-0qE.css} +1 -1
  23. package/dist/assets/DelegatePanel-Dtl0oHaA.js +33 -0
  24. package/dist/assets/{DemoGallery-DDzX8Z7I.js → DemoGallery-By2LV_U_.js} +1 -1
  25. package/dist/assets/{DropSelect-BMZYAX6q.js → DropSelect-CeCNaut0.js} +1 -1
  26. package/dist/assets/{ExportModal-CTMJaU1l.js → ExportModal-CZ1-Vihb.js} +2 -2
  27. package/dist/assets/{ExtractionPreview-C9wq7CrK.js → ExtractionPreview-CRkYnwCo.js} +1 -1
  28. package/dist/assets/{FlagshipCTA-DPNSflKv.js → FlagshipCTA-DNtUnl0n.js} +1 -1
  29. package/dist/assets/{FlagshipCommandPalette-55zqyPFm.js → FlagshipCommandPalette-DpP8joXb.js} +1 -1
  30. package/dist/assets/{FlagshipShowcase-BWpoPWOn.js → FlagshipShowcase-CoOezhT-.js} +1 -1
  31. package/dist/assets/{FlashcardsApp-apCj3I17.js → FlashcardsApp-REEdMdKG.js} +1 -1
  32. package/dist/assets/{ForecastPanel-CMRD-UKn.js → ForecastPanel-CpR32hwb.js} +1 -1
  33. package/dist/assets/{GalleryApp-CcsbirLT.js → GalleryApp-DJZRHjMH.js} +1 -1
  34. package/dist/assets/{HonestByDesign-DU4qmc61.js → HonestByDesign-CiOj_fA7.js} +1 -1
  35. package/dist/assets/{HowItWorks-CkZXftN-.js → HowItWorks-Ch2CgkVd.js} +1 -1
  36. package/dist/assets/{LegalApp-BmZpqH-6.js → LegalApp-BisEJynn.js} +1 -1
  37. package/dist/assets/{LegalMarkdownDocument-CcbAfubz.js → LegalMarkdownDocument-B7Yj_aRR.js} +1 -1
  38. package/dist/assets/{LegalPageShell-raMATqhx.js → LegalPageShell-k9e22JlP.js} +1 -1
  39. package/dist/assets/{LeverPanel-DVUgGcYW.js → LeverPanel-CXSDqinv.js} +1 -1
  40. package/dist/assets/{Library-D725dNcx.js → Library-CmpF6gOU.js} +1 -1
  41. package/dist/assets/{LibraryOverlay-D7PzQIpH.js → LibraryOverlay-BErgFYxu.js} +1 -1
  42. package/dist/assets/LiveApp-DZ7t3P1O.js +61 -0
  43. package/dist/assets/LiveApp-Dj_6EQuL.css +1 -0
  44. package/dist/assets/LiveSettings-BY5E3Ka8.js +6 -0
  45. package/dist/assets/{MindMapViewerDrawer-CIMuABKE.js → MindMapViewerDrawer-Bc_qHdm9.js} +1 -1
  46. package/dist/assets/MindShape-DGOmKwov.css +1 -0
  47. package/dist/assets/{MindShape-0KPrv0CF.js → MindShape-ULBAjrfD.js} +1 -1
  48. package/dist/assets/{PinToDashboard-ML4NFCAU.js → PinToDashboard-WgEX4YoY.js} +1 -1
  49. package/dist/assets/{PlanReview-CbJ_7Ld1.js → PlanReview-Dd3sxa_o.js} +1 -1
  50. package/dist/assets/{Presence-B_zDfiE7.js → Presence-DgzicbeF.js} +1 -1
  51. package/dist/assets/{PresentationDeck-Tm3PUdh5.js → PresentationDeck-Cx26X-wh.js} +1 -1
  52. package/dist/assets/{PrismApp-Bc-6PO_P.js → PrismApp-FPqASfhZ.js} +2 -2
  53. package/dist/assets/{PrismAskController-OwqFx5Pk.js → PrismAskController-Ds1tSE9S.js} +1 -1
  54. package/dist/assets/{PrismBriefingPlayer-Bu_ZxYdh.js → PrismBriefingPlayer-BzqCK6JP.js} +2 -2
  55. package/dist/assets/{PrismOverlay-UTsJ8R5d.js → PrismOverlay-Cq3DBJ-N.js} +4 -4
  56. package/dist/assets/{PrivacyApp-BLXan6dm.js → PrivacyApp-B8PGc-x5.js} +1 -1
  57. package/dist/assets/{Recap-5rYrcMCC.js → Recap-RwhzouRe.js} +1 -1
  58. package/dist/assets/{ReelJelly-Dg3XGB0c.js → ReelJelly-B2JQsaRI.js} +1 -1
  59. package/dist/assets/{ReplayCard-wMIMlorH.js → ReplayCard-DUBvQLBt.js} +2 -2
  60. package/dist/assets/{ReplayOverlay-BomkTonB.js → ReplayOverlay-CzUFHdjK.js} +1 -1
  61. package/dist/assets/{RewindOverlay-Izf89nG9.js → RewindOverlay-CMx_cVxX.js} +1 -1
  62. package/dist/assets/{RippleApp-8QSIEjTX.js → RippleApp-B186b8KW.js} +2 -2
  63. package/dist/assets/{RippleAskController-Cd86GrKs.js → RippleAskController-BA_kGOmL.js} +1 -1
  64. package/dist/assets/{RippleOverlay-SCrXZTqz.js → RippleOverlay-CkbkIgzC.js} +2 -2
  65. package/dist/assets/{SeeDontRead-Bp8qsF20.js → SeeDontRead-BZ4xFEKE.js} +1 -1
  66. package/dist/assets/{ShareModal-C-sD-aia.js → ShareModal-DNpc-U9U.js} +1 -1
  67. package/dist/assets/{ShipCascade-Cq_I4c_v.js → ShipCascade-BmTE193h.js} +1 -1
  68. package/dist/assets/{ShipCourse-CzsJyMnT.js → ShipCourse-K2vnS3Sw.js} +1 -1
  69. package/dist/assets/{ShipHotspots-OMjPhQWP.js → ShipHotspots-DILwqPxh.js} +1 -1
  70. package/dist/assets/{ShipIncident-Cqn6ZmKz.js → ShipIncident-DXXciEP7.js} +1 -1
  71. package/dist/assets/{ShipMigration-5_ZWn7K9.js → ShipMigration-rhBm0Tre.js} +1 -1
  72. package/dist/assets/{ShipOnboarding-Yr8oKgmQ.js → ShipOnboarding-9KCVVAkX.js} +1 -1
  73. package/dist/assets/{ShipRead-Bnw7mnv3.js → ShipRead-CMe1DNik.js} +1 -1
  74. package/dist/assets/{ShipRollout-ECsDrqAd.js → ShipRollout-BA4x-btU.js} +1 -1
  75. package/dist/assets/{ShipSuggestions-C6oDw2F8.js → ShipSuggestions-Jm45jfFl.js} +1 -1
  76. package/dist/assets/{ShipWorkspace-BT6gZrqd.js → ShipWorkspace--x-q6Ly3.js} +1 -1
  77. package/dist/assets/{SignatureLoop-D7sibSnc.js → SignatureLoop-B_cHyXgU.js} +1 -1
  78. package/dist/assets/{SynthesisApp-B768x2r_.js → SynthesisApp-CvR_8g1C.js} +2 -2
  79. package/dist/assets/{SynthesisOverlay-Ds0MhZLQ.js → SynthesisOverlay-DFFD69hf.js} +1 -1
  80. package/dist/assets/{TermsApp-Da8FeMj3.js → TermsApp-BxLgLSna.js} +1 -1
  81. package/dist/assets/{TopicCanvas-D64O3lvD.js → TopicCanvas-CKvJb_8Y.js} +2 -2
  82. package/dist/assets/{TopicCanvas-D2Nax9II.css → TopicCanvas-uRuHi99s.css} +1 -1
  83. package/dist/assets/{TourPrism-CTf1G-Vv.js → TourPrism-bqOmSZ9T.js} +1 -1
  84. package/dist/assets/{TrackerTile-DeujTCk-.js → TrackerTile-BuAVmOyi.js} +2 -2
  85. package/dist/assets/{TwoSurfaces-kyK2yqm0.js → TwoSurfaces-CjtKXWJr.js} +1 -1
  86. package/dist/assets/{UnderstoodPanel-Dgwk_Cuj.js → UnderstoodPanel-BWFbpk9o.js} +1 -1
  87. package/dist/assets/{WhyMachineOverlay-C4eQC0lg.js → WhyMachineOverlay-D6pGEE78.js} +1 -1
  88. package/dist/assets/{WowFeatures-CaBZ5WPM.js → WowFeatures-CLx5VoKn.js} +1 -1
  89. package/dist/assets/{ZoomDeck-DnCtbhx1.js → ZoomDeck-R6MLUt4Z.js} +1 -1
  90. package/dist/assets/{alternateFinishes-FSV_gA1A.js → alternateFinishes-C8DBTwo_.js} +1 -1
  91. package/dist/assets/{annotationAuto-x_dV8z65.js → annotationAuto-ofVcqRve.js} +1 -1
  92. package/dist/assets/{annotationReel-SeXzv0P-.js → annotationReel-CdAmTPlv.js} +1 -1
  93. package/dist/assets/{backup-0zODkqi-.js → backup-TgoSxdwf.js} +1 -1
  94. package/dist/assets/canvas-BrUiUI9Q.js +1 -0
  95. package/dist/assets/{catalog-Car_1ocN.js → catalog-BrmxA4bP.js} +1 -1
  96. package/dist/assets/{dashboardEvents-BqcPN-K8.js → dashboardEvents-DT6ye9n7.js} +1 -1
  97. package/dist/assets/{dist-BTg4yEWr.js → dist-COAFD72d.js} +1 -1
  98. package/dist/assets/{fit-I3tuibfX.js → fit-BtKObM5Q.js} +1 -1
  99. package/dist/assets/{generateLive-Dk24OxVt.js → generateLive-BvE3kOrf.js} +1 -1
  100. package/dist/assets/gesture-Bouqjr3g.js +2 -0
  101. package/dist/assets/{index-CWqRe4-B.js → index-DOpl5xzv.js} +3 -3
  102. package/dist/assets/{jspdf.es.min-wkD3BzGZ.js → jspdf.es.min-DSMzCXtv.js} +1 -1
  103. package/dist/assets/{kokoro-B-3GqktX.js → kokoro-B-MNB16v.js} +1 -1
  104. package/dist/assets/{lib-CwruVYU_.js → lib-BLt1wpw2.js} +1 -1
  105. package/dist/assets/{liveSchema-CCpVMy0H.js → liveSchema-DbjsSolX.js} +2 -2
  106. package/dist/assets/{motion-CURfDtdH.js → motion-DKmdzFji.js} +1 -1
  107. package/dist/assets/{notes-BG5QP-Dj.js → notes-D_uDKcr5.js} +1 -1
  108. package/dist/assets/{pdf-x4qTBJIZ.js → pdf-uUFiTOYW.js} +1 -1
  109. package/dist/assets/{penStrokes-9Q_l7NTt.js → penStrokes-DlHnO9xE.js} +1 -1
  110. package/dist/assets/{perfProbe-BFwfpxJt.js → perfProbe-DIAQR2bi.js} +1 -1
  111. package/dist/assets/{pin-DRN5H7py.js → pin-DoSzEmTm.js} +1 -1
  112. package/dist/assets/{portal-BYHo9LOD.js → portal-4sKB1Tgc.js} +1 -1
  113. package/dist/assets/{pptxgen.es-DGywGiaX.js → pptxgen.es-BVKKMlmO.js} +1 -1
  114. package/dist/assets/{prewarm-CQNCE4Uq.js → prewarm-D31Si_08.js} +1 -1
  115. package/dist/assets/{quietHours-CKjQ2pGY.js → quietHours-sfkvrkJv.js} +1 -1
  116. package/dist/assets/registry--yZ1HduK.js +1 -0
  117. package/dist/assets/{registry-CfTTYQrE.js → registry-B3RfPAd6.js} +1 -1
  118. package/dist/assets/{registry-DBsjgIxw.js → registry-B3u3--Kv.js} +1 -1
  119. package/dist/assets/{registry-DFmFBfRz.js → registry-BOS6AdnB.js} +1 -1
  120. package/dist/assets/{registry-Dw42uggW.js → registry-BWzoIPXp.js} +1 -1
  121. package/dist/assets/{registry-CNr6L-3z.js → registry-Bj8q4igW.js} +1 -1
  122. package/dist/assets/{registry-_T6pLDPG.js → registry-BnSnMnyk.js} +2 -2
  123. package/dist/assets/{registry-aUZZeh27.js → registry-BpccSYOo.js} +1 -1
  124. package/dist/assets/{registry-BueBIP-N.js → registry-C4KB6Ls0.js} +1 -1
  125. package/dist/assets/{registry-cPmSqaRu.js → registry-CAZ7ubmd.js} +1 -1
  126. package/dist/assets/{registry-1BWL6SXY.js → registry-CYnKlcEy.js} +1 -1
  127. package/dist/assets/{registry-BZQeYzgv.js → registry-Chzw1Udo.js} +1 -1
  128. package/dist/assets/{registry-DrqQbf_n.js → registry-CkXIaQmB.js} +1 -1
  129. package/dist/assets/{registry-BklPTZre.js → registry-CrKVDfq8.js} +1 -1
  130. package/dist/assets/registry-D5oMqeSa.js +1 -0
  131. package/dist/assets/{registry-9S6KiKjR.js → registry-DOsiT4_6.js} +1 -1
  132. package/dist/assets/{registry-Bl3NkU-0.js → registry-DsjrEa0W.js} +1 -1
  133. package/dist/assets/{registry-Bc6_RQ8l.js → registry-DssqYPgu.js} +1 -1
  134. package/dist/assets/{registry-CqfjqOX5.js → registry-DxtkIiAV.js} +2 -2
  135. package/dist/assets/{registry-Bpx4VBWb.js → registry-DzNYBJ_a.js} +1 -1
  136. package/dist/assets/{registry-GLjcQX0n.js → registry-NdA9xh9G.js} +1 -1
  137. package/dist/assets/{registry-D84Bs-bD.js → registry-VRtsyPV7.js} +1 -1
  138. package/dist/assets/{registry-DEgW3zel.js → registry-d3dHoriR.js} +1 -1
  139. package/dist/assets/{registry-BpBiRe-o.js → registry-fLKnCnS5.js} +1 -1
  140. package/dist/assets/{relate-yq30L3hZ.js → relate-BG7aZWOq.js} +1 -1
  141. package/dist/assets/{shikiHighlight-BgZoQAHs.js → shikiHighlight-D9nfk5pW.js} +1 -1
  142. package/dist/assets/{useDashboardLoop-mGmJwv27.js → useDashboardLoop-CJ0M7ZXf.js} +3 -3
  143. package/dist/assets/{useLiveConfig-vMyjo2gV.js → useLiveConfig-DIvKKKpP.js} +1 -1
  144. package/dist/assets/{useSpatialCanvas-CEXy6ZC2.js → useSpatialCanvas-L0r29F7F.js} +1 -1
  145. package/dist/assets/{useSpotlightWalk-B9XJ6OLK.js → useSpotlightWalk-oyvTWe20.js} +1 -1
  146. package/dist/assets/{useSrsCards-Vc6B2_he.js → useSrsCards-BLNBqRe7.js} +1 -1
  147. package/dist/assets/{useStudy-6QnY-Fw_.js → useStudy-hvN-iGz0.js} +1 -1
  148. package/dist/assets/{useZoomGesture-BONUz5cE.js → useZoomGesture-Dl_Cfmxm.js} +1 -1
  149. package/dist/index.html +1 -1
  150. package/package.json +1 -1
  151. package/dist/assets/DashboardLoopRuntime-14yzj-xx.js +0 -1
  152. package/dist/assets/DashboardsApp-mvMbGmp0.js +0 -2
  153. package/dist/assets/DelegatePanel-pwRk9pFf.js +0 -26
  154. package/dist/assets/LiveApp-B8Jw1Q0h.js +0 -61
  155. package/dist/assets/LiveApp-DQhDk2ma.css +0 -1
  156. package/dist/assets/LiveSettings-BQ06gZB7.js +0 -6
  157. package/dist/assets/MindShape-Bel2yDqO.css +0 -1
  158. package/dist/assets/RehearsalPanel-BCU615wg.css +0 -1
  159. package/dist/assets/RehearsalPanel-CM4466Os.js +0 -6
  160. package/dist/assets/canvas-uhcwigAL.js +0 -1
  161. package/dist/assets/gesture-DabMpPcq.js +0 -2
  162. package/dist/assets/registry-BffpZK5w.js +0 -1
  163. package/dist/assets/registry-Z3TIPbYJ.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-CURfDtdH.js";import{o as a}from"./useStudy-6QnY-Fw_.js";import{C as o}from"./dashboardEvents-BqcPN-K8.js";import{n as s,o as c,r as l}from"./CheckLogRail-ZrDqyjQ7.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=t(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DOpl5xzv.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-DKmdzFji.js";import{o as a}from"./useStudy-hvN-iGz0.js";import{C as o}from"./dashboardEvents-DT6ye9n7.js";import{n as s,o as c,r as l}from"./CheckLogRail--9iHharq.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=t(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-SCrXZTqz.js","assets/index-CWqRe4-B.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-CEXy6ZC2.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-vMyjo2gV.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-B-3GqktX.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-CWqRe4-B.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-SCrXZTqz.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-vMyjo2gV.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([17,2,1,3,4,5,6,18,19,20,14])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-B-3GqktX.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([21,2,1,3,4,5,6,22]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-CkbkIgzC.js","assets/index-DOpl5xzv.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-L0r29F7F.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-DIvKKKpP.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-B-MNB16v.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-DOpl5xzv.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-CkbkIgzC.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-DIvKKKpP.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([17,2,1,3,4,5,6,18,19,20,14])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-B-MNB16v.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([21,2,1,3,4,5,6,22]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./providers-wzm7E8Pa.js";import{r as i}from"./githubBrowser-DywfDeYx.js";import{t as a}from"./json-B0N3XRZU.js";import{n as o}from"./verbatim-CBMzUDlf.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=n(),u=t(),d={full:{label:`grounded in the repo`,token:`var(--insight)`},partial:{label:`partly grounded`,token:`var(--warning)`},none:{label:`not covered by what Ripple has read`,token:`var(--text-muted)`}},f={newgrad:[`Explain this repo like I’m new`,`Where should I start reading?`],working:[`What’s the blast radius of this change?`,`What would I need to know to review this?`],principal:[`What’s the crux here?`,`What would a principal push back on?`]};function p(e){let t=e.file?e.file.split(`/`).pop()??e.file:`source`;return e.unpinned?`${t} · unverified`:t}function m(e){let t=(0,l.c)(26),{open:n,onClose:r,turns:i,busy:a,onAsk:o,altitude:m,hasModel:g,seed:_,repo:v,gitRef:y,focusFile:b}=e,[x,S]=(0,c.useState)(``),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{let e=C.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=T):T=t[0];let E;t[1]===i?E=t[2]:(E=[i],t[1]=i,t[2]=E),(0,c.useEffect)(T,E);let D,O;t[3]===_?(D=t[4],O=t[5]):(D=()=>{_&&(S(_.text),w.current?.focus())},O=[_],t[3]=_,t[4]=D,t[5]=O),(0,c.useEffect)(D,O);let k;t[6]!==a||t[7]!==x||t[8]!==o?(k=e=>{let t=(e??x).trim();!t||a||(o(t),S(``))},t[6]=a,t[7]=x,t[8]=o,t[9]=k):k=t[9];let A=k,j=h;if(!n)return null;let M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,u.jsxs)(`span`,{className:`ripple-ask-title`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-spark`,"aria-hidden":`true`}),`Ask`]}),t[10]=M):M=t[10];let N;t[11]===r?N=t[12]:(N=(0,u.jsxs)(`header`,{className:`ripple-ask-head`,children:[M,(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-min`,onClick:r,"aria-label":`Collapse the ask rail`,children:`✕`})]}),t[11]=r,t[12]=N);let P;t[13]!==m||t[14]!==a||t[15]!==x||t[16]!==b||t[17]!==y||t[18]!==g||t[19]!==v||t[20]!==A||t[21]!==i?(P=g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`ripple-ask-chips`,role:`group`,"aria-label":`Suggested questions`,children:[f[m].map(e=>(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(e),disabled:a,children:e},e)),b&&(0,u.jsxs)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(`What breaks if I change ${b}?`),disabled:a,children:[`What breaks if I change `,b,`?`]})]}),(0,u.jsxs)(`div`,{className:`ripple-ask-thread`,ref:C,children:[i.length===0&&(0,u.jsx)(`p`,{className:`ripple-ask-empty`,children:`Ask anything about this repo or PR. The answer cites real files — and says so honestly when nothing gathered addresses it.`}),i.map(e=>(0,u.jsxs)(`div`,{className:`ripple-ask-turn`,children:[(0,u.jsx)(`p`,{className:`ripple-ask-q`,children:e.question}),e.status===`pending`&&(0,u.jsxs)(`p`,{className:`ripple-ask-pending`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-dot`,"aria-hidden":`true`}),`Reading the repo…`]}),e.status===`error`&&(0,u.jsx)(`p`,{className:`ripple-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,u.jsxs)(`div`,{className:`ripple-ask-a`,children:[(0,u.jsxs)(`span`,{className:`ripple-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":d[e.answer.coverage].token},children:[(0,u.jsx)(`span`,{className:`ripple-ask-cover-dot`,"aria-hidden":`true`}),d[e.answer.coverage].label]}),e.answer.text&&(0,u.jsx)(`p`,{className:`ripple-ask-text`,children:e.answer.text}),e.answer.citations.length>0&&(0,u.jsx)(`div`,{className:`ripple-ask-cites`,role:`group`,"aria-label":`Sources`,children:e.answer.citations.map((e,t)=>{let n=e.unpinned?null:s(v,y,e.file),r=p(e),i=`${e.file}\n“${e.quote}”`;return n?(0,u.jsxs)(`a`,{className:`ripple-ask-cite`,href:n,target:`_blank`,rel:`noopener noreferrer`,title:i,children:[r,` ↗`]},`${e.file}:${t}`):(0,u.jsx)(`span`,{className:`ripple-ask-cite`,"data-unpinned":e.unpinned?`true`:void 0,title:i,children:r},`${e.file}:${t}`)})})]})]},e.id))]}),(0,u.jsxs)(`form`,{className:`ripple-ask-form`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,u.jsx)(`textarea`,{ref:w,className:`ripple-ask-input`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())},rows:1,placeholder:a?`Reading the repo…`:`Ask about this repo or PR…`,"aria-label":`Ask about this repo or PR`}),(0,u.jsx)(`button`,{type:`submit`,className:`ripple-ask-send`,disabled:a||x.trim().length===0,"aria-label":`Ask`,children:`↵`})]})]}):(0,u.jsx)(`div`,{className:`ripple-ask-empty-state`,children:(0,u.jsx)(`p`,{children:`Connect a model in Settings → Live to ask questions about this repo.`})}),t[13]=m,t[14]=a,t[15]=x,t[16]=b,t[17]=y,t[18]=g,t[19]=v,t[20]=A,t[21]=i,t[22]=P):P=t[22];let F;return t[23]!==N||t[24]!==P?(F=(0,u.jsxs)(`section`,{className:`ripple-ask-rail`,"aria-label":`Ask`,onPointerDown:j,onWheel:j,onClick:j,children:[N,P]}),t[23]=N,t[24]=P,t[25]=F):F=t[25],F}function h(e){return e.stopPropagation()}var g=3,_=3e3,v=6e3,y=40,b=40,x=30,S=12,C=6;function w(e,t){return`${e}::${t}`}function T(e,t,n=new Set,r=g){let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[]));return i.length===0?[]:e.map((e,t)=>({p:e,i:t})).filter(({p:e})=>!n.has(e)).map(({p:e,i:t})=>{let n=e.toLowerCase();return{p:e,i:t,score:i.reduce((e,t)=>e+ +!!n.includes(t),0)}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.i-t.i).slice(0,r).map(e=>e.p)}async function E(e,t){if(!e.repo||!e.treePaths?.length)return;let n=T(e.treePaths,t,new Set(e.fileCache.keys()));if(n.length===0)return;let r=await Promise.all(n.map(t=>i(t,e.gitRef,e.repo).catch(()=>({ok:!1}))));e.signal?.aborted||r.forEach((t,r)=>{t.ok&&t.content&&e.fileCache.set(n[r],t.content.slice(0,_))})}function D(e,t){let n=[],r=e.pr;return n.push(`REPO: ${r.repo}${r.title?` — ${r.title}`:``}`),r.summary&&n.push(`SUMMARY: ${r.summary}`),r.risks.length&&n.push(`RISKS:\n${r.risks.slice(0,S).map(e=>`- [${e.level}] ${e.text}`).join(`
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DOpl5xzv.js";import{t as r}from"./providers-wzm7E8Pa.js";import{r as i}from"./githubBrowser-DywfDeYx.js";import{t as a}from"./json-B0N3XRZU.js";import{n as o}from"./verbatim-CBMzUDlf.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=n(),u=t(),d={full:{label:`grounded in the repo`,token:`var(--insight)`},partial:{label:`partly grounded`,token:`var(--warning)`},none:{label:`not covered by what Ripple has read`,token:`var(--text-muted)`}},f={newgrad:[`Explain this repo like I’m new`,`Where should I start reading?`],working:[`What’s the blast radius of this change?`,`What would I need to know to review this?`],principal:[`What’s the crux here?`,`What would a principal push back on?`]};function p(e){let t=e.file?e.file.split(`/`).pop()??e.file:`source`;return e.unpinned?`${t} · unverified`:t}function m(e){let t=(0,l.c)(26),{open:n,onClose:r,turns:i,busy:a,onAsk:o,altitude:m,hasModel:g,seed:_,repo:v,gitRef:y,focusFile:b}=e,[x,S]=(0,c.useState)(``),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{let e=C.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=T):T=t[0];let E;t[1]===i?E=t[2]:(E=[i],t[1]=i,t[2]=E),(0,c.useEffect)(T,E);let D,O;t[3]===_?(D=t[4],O=t[5]):(D=()=>{_&&(S(_.text),w.current?.focus())},O=[_],t[3]=_,t[4]=D,t[5]=O),(0,c.useEffect)(D,O);let k;t[6]!==a||t[7]!==x||t[8]!==o?(k=e=>{let t=(e??x).trim();!t||a||(o(t),S(``))},t[6]=a,t[7]=x,t[8]=o,t[9]=k):k=t[9];let A=k,j=h;if(!n)return null;let M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,u.jsxs)(`span`,{className:`ripple-ask-title`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-spark`,"aria-hidden":`true`}),`Ask`]}),t[10]=M):M=t[10];let N;t[11]===r?N=t[12]:(N=(0,u.jsxs)(`header`,{className:`ripple-ask-head`,children:[M,(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-min`,onClick:r,"aria-label":`Collapse the ask rail`,children:`✕`})]}),t[11]=r,t[12]=N);let P;t[13]!==m||t[14]!==a||t[15]!==x||t[16]!==b||t[17]!==y||t[18]!==g||t[19]!==v||t[20]!==A||t[21]!==i?(P=g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`ripple-ask-chips`,role:`group`,"aria-label":`Suggested questions`,children:[f[m].map(e=>(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(e),disabled:a,children:e},e)),b&&(0,u.jsxs)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(`What breaks if I change ${b}?`),disabled:a,children:[`What breaks if I change `,b,`?`]})]}),(0,u.jsxs)(`div`,{className:`ripple-ask-thread`,ref:C,children:[i.length===0&&(0,u.jsx)(`p`,{className:`ripple-ask-empty`,children:`Ask anything about this repo or PR. The answer cites real files — and says so honestly when nothing gathered addresses it.`}),i.map(e=>(0,u.jsxs)(`div`,{className:`ripple-ask-turn`,children:[(0,u.jsx)(`p`,{className:`ripple-ask-q`,children:e.question}),e.status===`pending`&&(0,u.jsxs)(`p`,{className:`ripple-ask-pending`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-dot`,"aria-hidden":`true`}),`Reading the repo…`]}),e.status===`error`&&(0,u.jsx)(`p`,{className:`ripple-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,u.jsxs)(`div`,{className:`ripple-ask-a`,children:[(0,u.jsxs)(`span`,{className:`ripple-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":d[e.answer.coverage].token},children:[(0,u.jsx)(`span`,{className:`ripple-ask-cover-dot`,"aria-hidden":`true`}),d[e.answer.coverage].label]}),e.answer.text&&(0,u.jsx)(`p`,{className:`ripple-ask-text`,children:e.answer.text}),e.answer.citations.length>0&&(0,u.jsx)(`div`,{className:`ripple-ask-cites`,role:`group`,"aria-label":`Sources`,children:e.answer.citations.map((e,t)=>{let n=e.unpinned?null:s(v,y,e.file),r=p(e),i=`${e.file}\n“${e.quote}”`;return n?(0,u.jsxs)(`a`,{className:`ripple-ask-cite`,href:n,target:`_blank`,rel:`noopener noreferrer`,title:i,children:[r,` ↗`]},`${e.file}:${t}`):(0,u.jsx)(`span`,{className:`ripple-ask-cite`,"data-unpinned":e.unpinned?`true`:void 0,title:i,children:r},`${e.file}:${t}`)})})]})]},e.id))]}),(0,u.jsxs)(`form`,{className:`ripple-ask-form`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,u.jsx)(`textarea`,{ref:w,className:`ripple-ask-input`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())},rows:1,placeholder:a?`Reading the repo…`:`Ask about this repo or PR…`,"aria-label":`Ask about this repo or PR`}),(0,u.jsx)(`button`,{type:`submit`,className:`ripple-ask-send`,disabled:a||x.trim().length===0,"aria-label":`Ask`,children:`↵`})]})]}):(0,u.jsx)(`div`,{className:`ripple-ask-empty-state`,children:(0,u.jsx)(`p`,{children:`Connect a model in Settings → Live to ask questions about this repo.`})}),t[13]=m,t[14]=a,t[15]=x,t[16]=b,t[17]=y,t[18]=g,t[19]=v,t[20]=A,t[21]=i,t[22]=P):P=t[22];let F;return t[23]!==N||t[24]!==P?(F=(0,u.jsxs)(`section`,{className:`ripple-ask-rail`,"aria-label":`Ask`,onPointerDown:j,onWheel:j,onClick:j,children:[N,P]}),t[23]=N,t[24]=P,t[25]=F):F=t[25],F}function h(e){return e.stopPropagation()}var g=3,_=3e3,v=6e3,y=40,b=40,x=30,S=12,C=6;function w(e,t){return`${e}::${t}`}function T(e,t,n=new Set,r=g){let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[]));return i.length===0?[]:e.map((e,t)=>({p:e,i:t})).filter(({p:e})=>!n.has(e)).map(({p:e,i:t})=>{let n=e.toLowerCase();return{p:e,i:t,score:i.reduce((e,t)=>e+ +!!n.includes(t),0)}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.i-t.i).slice(0,r).map(e=>e.p)}async function E(e,t){if(!e.repo||!e.treePaths?.length)return;let n=T(e.treePaths,t,new Set(e.fileCache.keys()));if(n.length===0)return;let r=await Promise.all(n.map(t=>i(t,e.gitRef,e.repo).catch(()=>({ok:!1}))));e.signal?.aborted||r.forEach((t,r)=>{t.ok&&t.content&&e.fileCache.set(n[r],t.content.slice(0,_))})}function D(e,t){let n=[],r=e.pr;return n.push(`REPO: ${r.repo}${r.title?` — ${r.title}`:``}`),r.summary&&n.push(`SUMMARY: ${r.summary}`),r.risks.length&&n.push(`RISKS:\n${r.risks.slice(0,S).map(e=>`- [${e.level}] ${e.text}`).join(`
2
2
  `)}`),e.changes.length&&n.push(`CHANGES (${e.changes.length}):\n${e.changes.slice(0,y).map(e=>`- ${e.file} [${e.kind}/${e.risk}]: ${e.intent}${e.why?` — ${e.why}`:``}`).join(`
3
3
  `)}`),e.nodes.length&&n.push(`SYSTEM NODES (${e.nodes.length}):\n${e.nodes.slice(0,b).map(e=>{let t=[e.contract,e.problem,e.fix].filter(Boolean).join(` | `);return`- ${e.label}${e.sub?` (${e.sub})`:``}${t?`: ${t}`:``}`}).join(`
4
4
  `)}`),e.modules.length&&n.push(`MODULES (${e.modules.length}):\n${e.modules.slice(0,x).map(e=>`- ${e.name}: ${[e.purpose,e.explain].filter(Boolean).join(` `)}`.trim()).join(`
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/generate-8odaTyr4.js","assets/providers-wzm7E8Pa.js","assets/chunk-BVpWp9h4.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/cache-BumECILO.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/githubBrowser-DywfDeYx.js","assets/streamParse-DRgMHWye.js","assets/owners-FXDGInVq.js","assets/codeContext-0UMRSGRr.js","assets/ShipRead-Bnw7mnv3.js","assets/index-CWqRe4-B.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShipIncident-Cqn6ZmKz.js","assets/ShipIncident-BUHvFFiC.css","assets/ShipWorkspace-BT6gZrqd.js","assets/colors-D49Req-e.js","assets/ShipWorkspace-D6XQpGEN.css","assets/ShipCascade-Cq_I4c_v.js","assets/ShipCascade-CyFnrlET.css","assets/ShipMigration-5_ZWn7K9.js","assets/ShipMigration-BznCskNg.css","assets/ShipRollout-ECsDrqAd.js","assets/ShipRollout-CqeObx5b.css","assets/ShipCourse-CzsJyMnT.js","assets/courseStore-DfafnL-9.js","assets/links--u_phi0x.js","assets/DropSelect-BMZYAX6q.js","assets/store-DXmC_fP2.js","assets/ShipCourse-DcT7PUSm.css","assets/ShipOnboarding-Yr8oKgmQ.js","assets/ShipOnboarding-BC9Vxkpa.css","assets/ShipHotspots-OMjPhQWP.js","assets/ShipHotspots-CLOMutPv.css","assets/ShipSuggestions-C6oDw2F8.js","assets/ShipSuggestions-BKRvk5Mj.css","assets/ShipGate-BYYu9WVq.js","assets/ShipGate-BVZfCllb.css","assets/RippleAskController-Cd86GrKs.js","assets/json-B0N3XRZU.js","assets/verbatim-CBMzUDlf.js","assets/RippleAskController-BNAUoIW0.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,q as s}from"./index-CWqRe4-B.js";import{t as c}from"./useFocusTrap-DbfG6zbM.js";import{t as l}from"./FeatureUseNotice-CoK5HkbR.js";import{t as u}from"./useSpatialCanvas-CEXy6ZC2.js";import{_ as d,a as f,i as p,m,r as h,t as g,v as _,y as v}from"./githubToken-DtcLYqwm.js";import{i as y,n as b,t as x}from"./cache-BumECILO.js";import{n as S,r as C}from"./colors-D49Req-e.js";import{n as w,r as ee}from"./courseStore-DfafnL-9.js";var T=e(),E=.82;function D(e,t){let n=e.find(e=>e.type===`pr`)??e[0],r=n?.id??``,i=e.filter(e=>e.id!==r),a=e=>230+(e-1)*210,o=e=>Math.max(4,Math.floor(2*Math.PI*a(e)*E/204)),s=[];n&&s.push({node:n,x:0,y:0});let c=1,l=0,u=o(c);for(let e of i){l>=u&&(c+=1,l=0,u=o(c));let t=a(c),n=l/u*Math.PI*2-Math.PI/2+c*.5;s.push({node:e,x:0+Math.cos(n)*t,y:0+Math.sin(n)*t*E}),l+=1}for(let e=0;e<240;e++){let e=!1;for(let t=0;t<s.length;t++)for(let n=t+1;n<s.length;n++){let i=s[t],a=s[n],o=a.x-i.x,c=a.y-i.y,l=204-Math.abs(o),u=112-Math.abs(c);if(!(l<=0||u<=0))if(e=!0,l<u){let e=(l/2+.5)*(o<0?-1:1);i.node.id!==r&&(i.x-=e),a.node.id!==r&&(a.x+=e)}else{let e=(u/2+.5)*(c<0?-1:1);i.node.id!==r&&(i.y-=e),a.node.id!==r&&(a.y+=e)}}if(!e)break}let d=1/0,f=1/0,p=-1/0,m=-1/0;for(let e of s)d=Math.min(d,e.x-168/2),f=Math.min(f,e.y-76/2),p=Math.max(p,e.x+168/2),m=Math.max(m,e.y+76/2);let h=80-d,g=80-f;for(let e of s)e.x+=h,e.y+=g;let _=p-d+160,v=m-f+160;return{centerId:r,nodes:s,w:_,h:v,bbox:{x:0,y:0,w:_,h:v}}}var O=t();function te({nodes:e,edges:t,altitude:n,onAsk:r,animate:i}){let[a,o]=(0,T.useState)(`severity`),[s,c]=(0,T.useState)(!1),[l,d]=(0,T.useState)(null),f=(0,T.useMemo)(()=>{let n=s?e.filter(e=>e.type===`pr`||e.crossRepo):e,r=new Set(n.map(e=>e.id));return D(n,t.filter(e=>r.has(e.from)&&r.has(e.to)))},[e,t,s]),p=(0,T.useMemo)(()=>{let e=new Map;for(let t of f.nodes)e.set(t.node.id,t);return e},[f]),m=(0,T.useMemo)(()=>{let e=new Map,t=p.get(f.centerId);if(!t)return e;let n=1;for(let e of f.nodes)n=Math.max(n,Math.hypot(e.x-t.x,e.y-t.y));for(let r of f.nodes){let i=Math.hypot(r.x-t.x,r.y-t.y);e.set(r.node.id,Math.round(i/n*460))}return e},[f,p]),h=p.get(f.centerId),g=u({clamp:{min:.7,max:2.2},margin:56}),{fitTo:_}=g;(0,T.useEffect)(()=>{_(f.bbox)},[f,_]);let[v,y]=(0,T.useState)(!1),b=(0,T.useRef)(!1),x=(0,T.useRef)(!1),w=(0,T.useRef)({x:0,y:0}),ee=(0,T.useCallback)(e=>{b.current=!0,x.current=!1,y(!0),w.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)},[]),E=(0,T.useCallback)(e=>{if(!b.current)return;let t=e.clientX-w.current.x,n=e.clientY-w.current.y;Math.abs(t)+Math.abs(n)>2&&(x.current=!0),w.current={x:e.clientX,y:e.clientY},g.pan(t,n)},[g]),te=(0,T.useCallback)(e=>{b.current=!1,y(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),k=g.viewportRef,{zoomAtClient:A}=g;(0,T.useEffect)(()=>{let e=k.current;if(!e)return;let t=e=>{e.preventDefault(),A(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[k,A]);let j=g.camera.scale>=.7,M=a===`traffic`,N=l?p.get(l)?.node??null:null,P=e.some(e=>typeof e.traffic==`number`),F=e.some(e=>e.crossRepo===!0);return(0,O.jsxs)(`div`,{className:`ripple-impact`,children:[(0,O.jsxs)(`div`,{className:`ripple-impact-controls`,children:[P&&(0,O.jsxs)(`div`,{className:`ripple-lens`,role:`group`,"aria-label":`Map lens`,children:[(0,O.jsx)(`button`,{type:`button`,"data-active":a===`severity`?`true`:void 0,onClick:()=>o(`severity`),children:`Severity`}),(0,O.jsx)(`button`,{type:`button`,"data-active":a===`traffic`?`true`:void 0,onClick:()=>o(`traffic`),children:`Traffic`})]}),F&&(0,O.jsxs)(`label`,{className:`ripple-crossrepo`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),`Cross-repo only`]}),(0,O.jsx)(`div`,{className:`ripple-zoombtns`,children:(0,O.jsx)(`button`,{type:`button`,onClick:()=>_(f.bbox),title:`Fit the whole map`,"aria-label":`Fit`,children:`⤢`})})]}),(0,O.jsxs)(`div`,{className:`ripple-stage`+(v?` is-panning`:``),ref:g.viewportRef,onPointerDown:ee,onPointerMove:E,onPointerUp:te,onPointerCancel:te,children:[(0,O.jsxs)(`div`,{className:`ripple-world`,"data-animate":i?`true`:void 0,style:{width:f.w,height:f.h,transform:g.transform},children:[i&&h&&(0,O.jsx)(`span`,{className:`ripple-enter-pulse`,"aria-hidden":`true`,style:{left:h.x,top:h.y}}),(0,O.jsx)(`svg`,{className:`ripple-edges`,width:f.w,height:f.h,viewBox:`0 0 ${f.w} ${f.h}`,"aria-hidden":`true`,children:f.nodes.filter(e=>e.node.id!==f.centerId).map(e=>{let n=p.get(f.centerId);if(!n)return null;let r=t.find(t=>t.from===n.node.id&&t.to===e.node.id)??t.find(t=>t.to===n.node.id&&t.from===e.node.id),i=C(e.node.status),a=M?1.3+(e.node.traffic??0)*3:r?.breaking?2.4:1.6;return(0,O.jsx)(`line`,{x1:n.x,y1:n.y,x2:e.x,y2:e.y,stroke:i,strokeWidth:a,strokeLinecap:`round`,strokeDasharray:r?.breaking?`6 5`:r?.dashed?`2 6`:void 0,className:`ripple-edge`+(r?.breaking?` ripple-edge-break`:``),style:{animationDelay:`${m.get(e.node.id)??0}ms`},opacity:l&&l!==e.node.id?.25:.7},e.node.id)})}),j&&f.nodes.filter(e=>e.node.id!==f.centerId).map(e=>{let n=p.get(f.centerId);if(!n)return null;let r=t.find(t=>t.from===n.node.id&&t.to===e.node.id)??t.find(t=>t.to===n.node.id&&t.from===e.node.id);return r?(0,O.jsx)(`div`,{className:`ripple-edge-verb`,style:{left:(n.x+e.x)/2,top:(n.y+e.y)/2,color:C(e.node.status)},children:r.verb},`v-${e.node.id}`):null}),f.nodes.map(e=>{let t=e.node,n=t.id===f.centerId,r=C(t.status),i=M&&!n?1+(t.traffic??0)*.24:1;return(0,O.jsx)(`button`,{type:`button`,className:`ripple-node`,"data-center":n?`true`:void 0,"data-status":t.status,"data-open":l===t.id?`true`:void 0,style:{left:e.x-168/2,top:e.y-76/2,width:168,minHeight:76,transform:`scale(${i.toFixed(3)})`,borderColor:r,opacity:l&&l!==t.id?.55:1,animationDelay:`${m.get(t.id)??0}ms`},onClick:()=>{x.current||d(e=>e===t.id?null:t.id)},children:n?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`ripple-node-eyebrow`,style:{color:r},children:`THIS CHANGE`}),(0,O.jsx)(`span`,{className:`ripple-node-name ripple-node-name-lg`,children:t.label})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`ripple-node-top`,children:[(0,O.jsx)(`span`,{className:`ripple-node-dot`,style:{background:r},"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-node-status`,style:{color:r},children:S(t.status)}),t.severity&&(0,O.jsx)(`span`,{className:`ripple-node-sev`,style:{background:r},children:t.severity})]}),(0,O.jsx)(`span`,{className:`ripple-node-name`,children:t.label}),j&&(0,O.jsxs)(`span`,{className:`ripple-node-meta`,children:[t.team??t.owner??``,t.trafficLabel?` · ${t.trafficLabel}`:``]}),t.crossRepo&&(0,O.jsx)(`span`,{className:`ripple-node-repo`,children:`other repo`})]})},t.id)})]}),(0,O.jsx)(`div`,{className:`ripple-map-legend`,"aria-hidden":`true`,children:[`breaks`,`migration`,`untested`,`affected`,`safe`].map(e=>(0,O.jsxs)(`span`,{className:`ripple-map-legend-item`,children:[(0,O.jsx)(`span`,{className:`ripple-node-dot`,style:{background:C(e)}}),S(e).toLowerCase()]},e))})]}),N&&(0,O.jsxs)(`aside`,{className:`ripple-inspect`,"aria-label":`${N.label} detail`,children:[(0,O.jsxs)(`div`,{className:`ripple-inspect-head`,children:[(0,O.jsxs)(`div`,{className:`ripple-inspect-titles`,children:[(0,O.jsx)(`span`,{className:`ripple-node-status`,style:{color:C(N.status)},children:S(N.status)}),N.severity&&(0,O.jsxs)(`span`,{className:`ripple-inspect-sev`,style:{background:C(N.status)},children:[`would page · `,N.severity]})]}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>d(null),"aria-label":`Close detail`,children:`✕`})]}),(0,O.jsx)(`div`,{className:`ripple-inspect-name`,children:N.label}),(0,O.jsxs)(`div`,{className:`ripple-inspect-owner`,children:[N.team?`owned by ${N.team}`:``,N.cite?(0,O.jsxs)(`span`,{className:`ripple-inspect-cite`,children:[` · `,N.cite.ref]}):null]}),N.trafficLabel&&(0,O.jsxs)(`div`,{className:`ripple-inspect-traffic`,children:[(0,O.jsx)(`strong`,{children:N.trafficLabel}),(0,O.jsx)(`span`,{children:`live traffic, from tracing — not the diff`})]}),N.contract&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`The contract`}),(0,O.jsx)(`p`,{children:N.contract})]}),N.problem&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block ripple-inspect-problem`,style:{borderColor:`color-mix(in oklab, ${C(N.status)} 40%, transparent)`},children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,style:{color:C(N.status)},children:`What happens`}),(0,O.jsx)(`p`,{children:N.problem})]}),N.altitudeNotes?.[n]&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`At your altitude`}),(0,O.jsx)(`p`,{children:N.altitudeNotes[n]})]}),N.fix&&(0,O.jsxs)(`div`,{className:`ripple-inspect-fix`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`Mavéa’s call`}),(0,O.jsx)(`p`,{children:N.fix})]}),r&&(0,O.jsxs)(`button`,{type:`button`,className:`ripple-ask-btn`,onClick:()=>r(N),children:[`Ask about `,N.label]})]})]})}function k(e){let t=e.lastIndexOf(`/`),n=t>0?e.slice(0,t):``;return n?n.split(`/`).slice(0,2).join(`/`):`(root)`}function A(e){let t=e.split(`/`);return t[t.length-1]||e}function j(e){let t=e.toLowerCase();return/\b(api|routes?|server|http|controllers?|handlers?)\b/.test(t)?`Routes + request handling.`:/\b(auth|identity|session|login)\b/.test(t)?`Tokens, sessions, permissions.`:/\b(db|data|models?|schema|migrations?|store)\b/.test(t)?`Schemas, queries, persistence.`:/\b(billing|payments?|charge|orders?)\b/.test(t)?`The money path.`:/\b(jobs?|workers?|queue|tasks?|cron)\b/.test(t)?`Async / background work.`:/\b(ui|components?|views?|pages?|client|web)\b/.test(t)?`The user interface.`:/\b(tests?|__tests__|spec|e2e)\b/.test(t)?`Tests.`:/\b(lib|utils?|shared|common|helpers?)\b/.test(t)?`Shared utilities.`:/\b(config|infra|deploy|ci|scripts?)\b/.test(t)?`Config + tooling.`:/\b(webhooks?|events?|integrations?|connectors?)\b/.test(t)?`Outbound events / integrations.`:``}function M(e){return e.find(e=>/\/(index|main|mod|app|server)\.[a-z]+$/i.test(e))||([...e].sort((e,t)=>e.length-t.length)[0]??e[0]??``)}function N(e,t,n=!1){let r=e.filter(e=>typeof e==`string`&&e.length>0),i=new Map;for(let e of r){let t=k(e);(i.get(t)??i.set(t,[]).get(t)).push(e)}let a=[...i.entries()].sort((e,t)=>t[1].length-e[1].length),o=a.map(([e,t],n)=>{let r=M(t),i=`${t.length} file${t.length===1?``:`s`}`,a=j(e);return{id:`m${n}`,name:e,purpose:a||i,entry:r,owner:``,health:i,explain:`${a?a+` `:``}${i} in ${e}.`+(r?` Start with ${A(r)} and follow what it imports.`:``),startHere:t.slice(0,3).map(A),depends:[],usedBy:[]}}),s=[{id:`pr`,label:t.split(`/`).pop()||t,sub:`THIS REPO`,type:`pr`,status:`affected`,scope:`in-pr`}],c=[],l=a.slice(0,9);l.forEach(([e,t],n)=>{let r=`n${n}`,i=M(t);s.push({id:r,label:e,sub:`${t.length} file${t.length===1?``:`s`}`,type:`module`,status:`affected`,scope:`in-pr`,contract:`${j(e)||`${t.length} files`}`+(i?` · start with ${A(i)}`:``)}),c.push({from:`pr`,to:r,verb:`contains`,status:`affected`})});let u=a.slice(0,4).map(([e])=>e).join(`, `);return{pr:{repo:t,title:`${r.length} file${r.length===1?``:`s`}`,files:r.length,summary:`${t} — ${r.length} file${r.length===1?``:`s`} across ${i.size} area${i.size===1?``:`s`}${u?` (${u})`:``}. Start with the busiest areas and follow what they touch.`,risks:[],readScope:`Read the repo tree: ${r.length} file${r.length===1?``:`s`}.`},nodes:s,edges:c,changes:[],cascades:[],rollout:[],workTypes:[],hotspots:[],suggestions:[],suppressedNits:0,modules:o,onboarding:{firstWeek:a.slice(0,5).map(([e,t])=>({team:e.toUpperCase(),title:e,sub:j(e)||`${t.length} files`,file:M(t)})),requestLife:[]},gate:{decision:`watch`,shipSafe:!1,unackedP0:0,requires:[],deployOrder:`unset`,conditions:[],rationale:`Exploring the repo — there’s no change to gate here.`},provenance:{source:`github`,example:!1,notes:[`Exploring ${t} — ${r.length} files grouped into ${i.size} areas.`,`This is the code as it stands, not a change. The gate and diff views don’t apply.`,...a.length>l.length?[`The map shows the ${l.length} busiest areas; the full list is in Onboarding.`]:[],...n?[`Large repo — only the first slice of files was read.`]:[]]}}}var P={tier:`slow-cheap`,enrichMaxTokens:1600,courseCount:3,coursesMaxTokens:2600,closingMaxTokens:3600,lessonMaxTokens:3600,fetchCodeContext:!1,thinkingLevel:`minimal`},F={tier:`frontier-deep`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:7e3,fetchCodeContext:!0,thinkingLevel:`low`},I={tier:`frontier-fast`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:6e3,fetchCodeContext:!0,thinkingLevel:`minimal`},L=e=>!!e&&/(localhost|127\.0\.0\.1|0\.0\.0\.0|host\.docker\.internal|:11434)/i.test(e);function ne(e){let t=e.model.toLowerCase();return L(e.baseUrl)||/:free\b/.test(t)?`slow-cheap`:/\bopus\b/.test(t)||/\bgpt-5(?!.*mini)/.test(t)||/(^|[^a-z])o[1-9](-|\b)/.test(t)||/gemini-[0-9.]*-?pro/.test(t)||/\bsonnet\b/.test(t)&&!/haiku/.test(t)?`frontier-deep`:`frontier-fast`}function re(e){switch(ne(e)){case`slow-cheap`:return P;case`frontier-deep`:return F;default:return I}}var ie=/^[A-Za-z0-9._-]+$/,R=e=>({kind:`invalid`,reason:e});function ae(e,t){let n=e.trim().replace(/^git@github\.com:/i,`github.com/`);if(!n)return R(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`);let r=n.replace(/^https?:\/\//i,``).replace(/^www\./i,``),i=/^github\.com\/(.+)$/i.exec(r),a=/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+\/(?:pull|pulls|compare|tree|blob)\b/i.test(n),o=i?i[1]:a?n:null;if(o){let e=o.split(`#`)[0].split(`?`)[0].replace(/\/+$/,``).split(`/`),t=e[0]??``,n=(e[1]??``).replace(/\.git$/,``);if(!t||!n||!ie.test(t)||!ie.test(n))return R(`That GitHub URL is missing an owner/repo.`);let r=`${t}/${n}`,i=e[2],a=e.slice(3);if(!i)return{kind:`repo`,repo:r};if(i===`pull`||i===`pulls`){let e=(a[0]??``).replace(/\D.*$/,``);return e?{kind:`pr`,repo:r,prNumber:e}:R(`That pull-request URL has no number.`)}if(i===`compare`){let e=decodeURIComponent(a.join(`/`)),t=/^(.+?)\.{2,3}(.+)$/.exec(e);return t?{kind:`compare`,repo:r,base:t[1],head:t[2]}:R(`A compare URL looks like base...head.`)}if(i===`tree`||i===`blob`){let e=a[0],t=a.slice(1).join(`/`);return i===`blob`&&t&&(t=t.replace(/\/?[^/]*$/,``)),{kind:`tree`,repo:r,ref:e||void 0,path:t||void 0}}return{kind:`repo`,repo:r}}let s=/^([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?#(\d+)$/.exec(n);if(s)return{kind:`pr`,repo:`${s[1]}/${s[2]}`,prNumber:s[3]};let c=/^([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(n);if(c)return{kind:`repo`,repo:`${c[1]}/${c[2]}`};let l=/^#?(\d+)$/.exec(n);return l?t?{kind:`pr`,repo:t,prNumber:l[1]}:R(`Enter owner/repo#number, or connect a default repo first.`):R(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`)}var oe=`mavea.ripple.tracked.v1`,se=20;function z(){try{let e=localStorage.getItem(oe);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&e.id&&e.model):[]}catch{return[]}}function B(e){try{localStorage.setItem(oe,JSON.stringify(e.slice(0,se)))}catch{}}function ce(){return z().sort((e,t)=>t.savedAt-e.savedAt)}function le(e,t=Date.now()){let n=e.pr.repo||e.pr.title||`change`,r={id:`${n}::${t}`,label:n,savedAt:t,source:e.provenance.source,model:e};return B([r,...z().filter(e=>e.label!==n)]),r}function ue(e){B(z().filter(t=>t.id!==e))}var V=a();function de(e){return(/^(.*?[.!?])(\s|$)/.exec(e.trim())?.[1]??e).trim()}function fe(e){let t=(0,V.c)(65),{model:n,altitude:r,onNavigate:i,onAsk:a}=e,{pr:o,gate:s}=n,c=n.changes.length===0,l;t[0]!==c||t[1]!==s?(l=c?{label:`Explore`,tone:`neutral`}:s.decision===`pass`?{label:`Clear to ship`,tone:`safe`}:s.decision===`block`?{label:`Hold`,tone:`breaks`}:{label:`Review first`,tone:`watch`},t[0]=c,t[1]=s,t[2]=l):l=t[2];let u=l,d=c?`${Math.max(0,n.nodes.length-1)} areas · ${o.files??0} files`:`+${o.added??0} −${o.removed??0} · ${o.files??n.changes.length} file${(o.files??n.changes.length)===1?``:`s`}`,f;t[3]===o.summary?f=t[4]:(f=de(o.summary),t[3]=o.summary,t[4]=f);let p=f,m=o.risks[0]?.text,h;t[5]!==n.courses||t[6]!==n.modules?(h=n.courses?.length||n.modules.length?[{id:`onboarding`,label:n.courses?.length?`Onboard · ${n.courses.length} course${n.courses.length===1?``:`s`}`:`Onboarding`}]:[],t[5]=n.courses,t[6]=n.modules,t[7]=h):h=t[7];let g;t[8]===n.changes.length?g=t[9]:(g=n.changes.length?[{id:`workspace`,label:`${n.changes.length} change${n.changes.length===1?``:`s`}`}]:[],t[8]=n.changes.length,t[9]=g);let _;t[10]===n.cascades.length?_=t[11]:(_=n.cascades.length?[{id:`cascade`,label:`The cascade`}]:[],t[10]=n.cascades.length,t[11]=_);let v;t[12]===n.migration?v=t[13]:(v=n.migration?[{id:`migration`,label:`The migration`}]:[],t[12]=n.migration,t[13]=v);let y;t[14]===n.rollout.length?y=t[15]:(y=n.rollout.length?[{id:`rollout`,label:`Safe rollout`}]:[],t[14]=n.rollout.length,t[15]=y);let b;t[16]===n.suggestions.length?b=t[17]:(b=n.suggestions.length?[{id:`suggestions`,label:`${n.suggestions.length} suggestion${n.suggestions.length===1?``:`s`}`}]:[],t[16]=n.suggestions.length,t[17]=b);let x;t[18]===n.hotspots.length?x=t[19]:(x=n.hotspots.length?[{id:`hotspots`,label:`The story`}]:[],t[18]=n.hotspots.length,t[19]=x);let S;t[20]===n.incident?S=t[21]:(S=n.incident?[{id:`incident`,label:`Incident`}]:[],t[20]=n.incident,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C={id:`read`,label:`Full read`},t[22]=C):C=t[22];let w;t[23]===c?w=t[24]:(w=c?[]:[{id:`gate`,label:`The gate`}],t[23]=c,t[24]=w);let ee;t[25]!==S||t[26]!==w||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==b||t[33]!==x?(ee=[...h,...g,..._,...v,...y,...b,...x,...S,C,...w],t[25]=S,t[26]=w,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=b,t[33]=x,t[34]=ee):ee=t[34];let T=ee,E;t[35]===u.label?E=t[36]:(E=(0,O.jsx)(`span`,{className:`ripple-verdict-badge`,children:u.label}),t[35]=u.label,t[36]=E);let D;t[37]===d?D=t[38]:(D=(0,O.jsx)(`span`,{className:`ripple-verdict-scale`,children:d}),t[37]=d,t[38]=D);let k;t[39]!==E||t[40]!==D?(k=(0,O.jsxs)(`div`,{className:`ripple-verdict-top`,children:[E,D]}),t[39]=E,t[40]=D,t[41]=k):k=t[41];let A;t[42]===p?A=t[43]:(A=(0,O.jsx)(`p`,{className:`ripple-verdict-what`,children:p}),t[42]=p,t[43]=A);let j;t[44]!==c||t[45]!==m?(j=m?(0,O.jsxs)(`div`,{className:`ripple-verdict-one`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:c?`Where to start`:`The one thing to check`}),(0,O.jsx)(`span`,{className:`ripple-verdict-one-text`,children:m})]}):!c&&(0,O.jsxs)(`div`,{className:`ripple-verdict-one ripple-verdict-clean`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:`Reads clean`}),(0,O.jsx)(`span`,{className:`ripple-verdict-one-text`,children:`Nothing risky pulled to the top — review and ship.`})]}),t[44]=c,t[45]=m,t[46]=j):j=t[46];let M;t[47]!==k||t[48]!==A||t[49]!==j||t[50]!==u.tone?(M=(0,O.jsxs)(`div`,{className:`ripple-verdict-head`,"data-tone":u.tone,children:[k,A,j]}),t[47]=k,t[48]=A,t[49]=j,t[50]=u.tone,t[51]=M):M=t[51];let N;t[52]!==r||t[53]!==n.edges||t[54]!==n.nodes||t[55]!==a?(N=(0,O.jsx)(`div`,{className:`ripple-verdict-map`,children:(0,O.jsx)(te,{nodes:n.nodes,edges:n.edges,altitude:r,onAsk:a,animate:!0})}),t[52]=r,t[53]=n.edges,t[54]=n.nodes,t[55]=a,t[56]=N):N=t[56];let P;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,O.jsx)(`span`,{className:`ripple-verdict-chips-tag`,children:`Go deeper`}),t[57]=P):P=t[57];let F;t[58]!==T||t[59]!==i?(F=(0,O.jsxs)(`div`,{className:`ripple-verdict-chips`,"aria-label":`Go deeper`,children:[P,T.map(e=>(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-chip`,onClick:()=>i(e.id),children:e.label},e.id))]}),t[58]=T,t[59]=i,t[60]=F):F=t[60];let I;return t[61]!==M||t[62]!==N||t[63]!==F?(I=(0,O.jsxs)(`div`,{className:`ripple-verdict`,children:[M,N,F]}),t[61]=M,t[62]=N,t[63]=F,t[64]=I):I=t[64],I}r();var pe,H=()=>(pe??=s(()=>import(`./generate-8odaTyr4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),pe),me=(...e)=>H().then(t=>t.enrichShipModel(...e)),he=(...e)=>H().then(t=>t.enrichIncident(...e)),ge=(...e)=>H().then(t=>t.enrichOrientation(...e)),_e=(...e)=>H().then(t=>t.enrichCourses(...e)),ve=(...e)=>H().then(t=>t.enrichCourseClosing(...e)),ye=(...e)=>H().then(t=>t.enrichLesson(...e)),be=(...e)=>H().then(t=>t.gatherLessonCode(...e)),xe,U=()=>(xe??=s(()=>import(`./githubBrowser-DywfDeYx.js`).then(e=>e.i),__vite__mapDeps([8,2,3,6,7])),xe),Se=(...e)=>U().then(t=>t.fetchPrDiff(...e)),Ce=(...e)=>U().then(t=>t.compareRefs(...e)),we=(...e)=>U().then(t=>t.fetchRepoTree(...e)),Te,Ee=(...e)=>(Te??=s(()=>import(`./owners-FXDGInVq.js`),__vite__mapDeps([10,8,2,3,6,7])),Te.then(t=>t.resolveOwners(...e))),De,Oe=(...e)=>(De??=s(()=>import(`./codeContext-0UMRSGRr.js`),__vite__mapDeps([11,8,2,3,6,7])),De.then(t=>t.gatherCodeContext(...e))),ke=e=>e?/^([\w.-]+\/[\w.-]+)/.exec(e.trim())?.[1]:void 0,Ae=n(()=>s(()=>import(`./ShipRead-Bnw7mnv3.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([12,13,2,14,15,16,17]))),je=n(()=>s(()=>import(`./ShipIncident-Cqn6ZmKz.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([18,13,2,14,15,16,17,19]))),Me=n(()=>s(()=>import(`./ShipWorkspace-BT6gZrqd.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([20,13,2,14,15,16,17,21,22]))),Ne=n(()=>s(()=>import(`./ShipCascade-Cq_I4c_v.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([23,13,2,14,15,16,17,21,24]))),Pe=n(()=>s(()=>import(`./ShipMigration-5_ZWn7K9.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([25,13,2,14,15,16,17,26]))),Fe=n(()=>s(()=>import(`./ShipRollout-ECsDrqAd.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([27,13,2,14,15,16,17,28]))),Ie=n(()=>s(()=>import(`./ShipCourse-CzsJyMnT.js`).then(e=>({default:e.ShipCourse})),__vite__mapDeps([29,13,2,14,15,16,17,30,6,7,31,32,33,34]))),Le=n(()=>s(()=>import(`./ShipOnboarding-Yr8oKgmQ.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([35,13,2,14,15,16,17,36]))),Re=n(()=>s(()=>import(`./ShipHotspots-OMjPhQWP.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([37,13,2,14,15,16,17,38]))),W=n(()=>s(()=>import(`./ShipSuggestions-C6oDw2F8.js`).then(e=>({default:e.ShipSuggestions})),__vite__mapDeps([39,13,2,14,15,16,17,40]))),G=n(()=>s(()=>import(`./ShipGate-BYYu9WVq.js`).then(e=>({default:e.ShipGate})),__vite__mapDeps([41,14,2,15,42]))),ze=n(()=>s(()=>import(`./RippleAskController-Cd86GrKs.js`).then(e=>({default:e.RippleAskController})),__vite__mapDeps([43,13,2,14,15,16,17,1,3,4,44,45,8,6,7,31,46]))),Be=ze.Component,Ve=Ae.Component,He=je.Component,Ue=Me.Component,We=Ne.Component,Ge=Pe.Component,Ke=Fe.Component,qe=Ie.Component,Je=Le.Component,Ye=Re.Component,Xe=W.Component,Ze=G.Component,Qe=(e,t)=>`${e}::${t}`;function $e(e){try{return localStorage.getItem(e)}catch{return null}}function et(e,t){try{localStorage.setItem(e,t)}catch{}}var tt=[{id:`newgrad`,label:`New grad`},{id:`working`,label:`Working`},{id:`principal`,label:`Principal`}],nt=new Set([`anthropic`,`openai`,`gemini`,`grok`,`openrouter`]);function rt(e){return{read:Ae.preload,incident:je.preload,workspace:Me.preload,cascade:Ne.preload,migration:Pe.preload,rollout:Fe.preload,course:Ie.preload,onboarding:Le.preload,hotspots:Re.preload,suggestions:W.preload,gate:G.preload}[e]?.()??Promise.resolve()}var it={understand:`Understand`,ship:`Ship the change`},at=e=>e===`course`?`courses`:e===`onboarding`?`orientation`:`verdict`,ot=[{id:`verdict`,label:`Overview`,intent:`The verdict, the one thing to check, and the change rippling out.`,jobs:[`ship`],applies:e=>e.changes.length>0},{id:`read`,label:`Mavéa’s read`,intent:`The whole change in two sentences, risks pulled to the top.`,jobs:[`ship`,`understand`],applies:e=>!!e.pr.summary||e.changes.length>0},{id:`course`,label:`Courses`,intent:`A leveled curriculum built from THIS code — beginner → expert, with checkpoints.`,jobs:[`understand`],applies:(e,t)=>!!e.courses?.length||t.courses===`enriching`||t.hasRepo},{id:`onboarding`,label:`Map & request life`,intent:`The modules, who owns what, and a request’s life through the code.`,jobs:[`understand`],applies:(e,t)=>e.modules.length>0||t.hasRepo},{id:`incident`,label:`Incident`,intent:`A live alert, traced back to its likely cause — the rollback and who to wake.`,jobs:[`ship`,`understand`],applies:e=>!!e.incident},{id:`workspace`,label:`Workspace`,intent:`Pick a change — its diff, intent, and cause & effect assemble.`,jobs:[`ship`],applies:e=>e.changes.length>0},{id:`impact`,label:`Impact map`,intent:`Everything this change touches, and what those changes hit downstream.`,jobs:[`ship`,`understand`],applies:e=>e.nodes.length>0},{id:`cascade`,label:`The cascade`,intent:`How one line becomes a P0 — hop by hop, before anyone gets paged.`,jobs:[`ship`],applies:e=>e.cascades.length>0},{id:`migration`,label:`The migration`,intent:`The cost of a schema change isn’t in the SQL — it’s in the table size.`,jobs:[`ship`],applies:e=>!!e.migration},{id:`rollout`,label:`Safe rollout`,intent:`One safe order — so you ship with your eyes open.`,jobs:[`ship`],applies:e=>e.rollout.length>0},{id:`hotspots`,label:`The story`,intent:`Why a line exists, what it broke, and who to ask.`,jobs:[`understand`],applies:e=>e.hotspots.length>0},{id:`suggestions`,label:`Suggestions`,intent:`The “did you think about X?” a staff engineer would raise — grounded, and rare.`,jobs:[`ship`],applies:e=>e.suggestions.length>0},{id:`gate`,label:`The gate`,intent:`A picture for you, a pre-merge check for the agents.`,jobs:[`ship`],applies:e=>e.changes.length>0}];function st({model:e,cfg:t,speak:n,showcase:r,onClose:a}){let[s,u]=(0,T.useState)(!1),[S,C]=(0,T.useState)(!1),[E,D]=(0,T.useState)(`verdict`),[k,A]=(0,T.useState)(`working`),[j,M]=(0,T.useState)(e),P=(0,T.useRef)(e),[F,I]=(0,T.useState)({verdict:`floor`,orientation:`floor`,courses:`floor`}),L=(0,T.useRef)(0),ne=(0,T.useRef)(null),ie=(0,T.useRef)(null),R=(0,T.useRef)(null),oe=(0,T.useRef)(null),se=(0,T.useRef)(!1),z=(0,T.useRef)(!1),B=(0,T.useRef)(void 0),V=(0,T.useRef)(void 0),de=(0,T.useRef)(void 0),pe=(0,T.useRef)(null),[H,xe]=(0,T.useState)(!1),[U,Te]=(0,T.useState)(!1),[De,Ae]=(0,T.useState)(0),[je,Me]=(0,T.useState)(null),Ne=(0,T.useRef)([]),Pe=(0,T.useRef)(new Map),Fe=(0,T.useRef)(new Map),Ie=(0,T.useCallback)(e=>{Me(t=>({text:e,nonce:(t?.nonce??0)+1})),Te(!0)},[]),Le=(0,T.useMemo)(()=>t?{model:j,cfg:t,altitude:k,diffText:pe.current?.text,repo:B.current,gitRef:V.current,treePaths:Ne.current,lessonDetails:Fe.current,fileCache:Pe.current}:null,[t,j,k]),Re=(0,T.useCallback)(()=>{Ae(e=>e+1),Ne.current=[],Pe.current.clear(),Fe.current.clear()},[]),W=(0,T.useCallback)(()=>{ne.current?.abort(),ie.current?.abort(),R.current?.abort(),oe.current?.abort()},[]);(0,T.useEffect)(()=>W,[W]);let G=(0,T.useRef)(0);(0,T.useEffect)(()=>{M(e),P.current=e,B.current=void 0,se.current=!0,z.current=!0,I({verdict:`done`,orientation:e.modules.length?`done`:`floor`,courses:e.courses?.length?`done`:`floor`})},[e]);let st=(0,T.useRef)(!1);(0,T.useEffect)(()=>{st.current||(st.current=!0,!(!e.provenance.example||r)&&($e(`ripple.seenWorkedExample`)===`1`?(Nt(`github`),Y(!0)):et(`ripple.seenWorkedExample`,`1`)))},[e.provenance.example,r]);let K=(0,T.useMemo)(()=>t&&nt.has(t.provider)?t:{provider:`gemini`,model:`gemini-3.5-flash`,apiKey:``},[t]),q=(0,T.useMemo)(()=>re(K),[K]),[ct,lt]=(0,T.useState)(()=>$e(`ripple.hint.fastModel.dismissed`)===`1`),[ut,dt]=(0,T.useState)(!1),ft=(0,T.useCallback)(()=>{lt(!0),et(`ripple.hint.fastModel.dismissed`,`1`)},[]),pt=(0,T.useCallback)((e,t,n)=>{let r=++L.current;ne.current?.abort();let i=new AbortController;ne.current=i,xe(!1),I(e=>({...e,verdict:`enriching`})),(async()=>{let a=n&&q.fetchCodeContext?await Oe(e,n,void 0,i.signal).catch(()=>``):``;if(i.signal.aborted||L.current!==r)return;let o=await me(e,t,K,{signal:i.signal,codeContext:a||void 0,maxTokens:q.enrichMaxTokens,thinkingLevel:q.thinkingLevel,onPartial:t=>{L.current===r&&M(m(e,t,K.model))}});L.current===r&&(o?(M(o),P.current=o,I(e=>({...e,verdict:`done`}))):(M(e),P.current=e,I(e=>({...e,verdict:`error`}))))})()},[K,q]),mt=(0,T.useCallback)((e,t,n)=>{let r=v(_(e),t);return r.changes.length===0?0:(G.current++,W(),P.current=r,B.current=n,V.current=r.pr.branch||void 0,de.current=void 0,pe.current={text:e,repo:n},se.current=!1,z.current=!1,Re(),M(r),D(`verdict`),dt(!0),I({verdict:`enriching`,orientation:`floor`,courses:`floor`}),pt(r,e,n),r.changes.length)},[W,pt,Re]),ht=(0,T.useCallback)(()=>{let e=pe.current;e&&pt(P.current,e.text,e.repo)},[pt]),gt=(0,T.useCallback)(e=>{let t=P.current;return t.modules.length?t.modules:N(t.changes.map(e=>e.file),e,!1).modules},[]),_t=(0,T.useCallback)((e=!1)=>{let t=B.current;if(!t||se.current&&!e)return;se.current=!0;let n=L.current;ie.current?.abort();let r=new AbortController;ie.current=r,I(e=>({...e,orientation:`enriching`})),(async()=>{let e=await ge({...P.current,modules:gt(t)},t,V.current,K,{signal:r.signal,maxTokens:q.enrichMaxTokens,thinkingLevel:q.thinkingLevel}).catch(()=>null);if(r.signal.aborted||L.current!==n)return;let i=e?await Ee(e,t,V.current,r.signal).catch(()=>e):{...P.current,modules:gt(t)};r.signal.aborted||L.current!==n||(M(e=>({...e,modules:i.modules,nodes:i.nodes,onboarding:i.onboarding})),I(t=>({...t,orientation:e?`done`:`error`})))})()},[K,q,gt]),J=(0,T.useCallback)((e=!1,t)=>{let n=B.current;if(!n||z.current&&!e)return;z.current=!0;let r=L.current;R.current?.abort();let i=new AbortController;R.current=i;let a=setTimeout(()=>i.abort(),9e4);I(e=>({...e,courses:`enriching`})),(async()=>{let o=y(`courses|${n}|${V.current??``}|${t??``}`,K.model),s=e?null:await x(o);if(i.signal.aborted||L.current!==r)return;let c={...P.current,modules:gt(n)},l=s?.courses??await _e(c,n,V.current,K,{signal:i.signal,count:q.courseCount,maxTokens:q.coursesMaxTokens,thinkingLevel:q.thinkingLevel,focus:t}).catch(()=>void 0);if(clearTimeout(a),!(i.signal.aborted||L.current!==r))if(l?.length){M(e=>({...e,courses:l})),I(e=>({...e,courses:`done`}));let e=s?s.commitSha:de.current;s||b(o,{courses:l,commitSha:de.current}),ee(n,{commitSha:e??``,ref:V.current??``,model:K.model,builtAt:Date.now(),courseTitles:l.map(e=>e.title)})}else I(e=>({...e,courses:`error`}))})()},[K,q,gt]),vt=(0,T.useCallback)(()=>J(!0),[J]),[yt,bt]=(0,T.useState)(void 0),xt=(0,T.useCallback)(e=>{bt(e),z.current=!1,J(!0,e)},[J]),St=(0,T.useCallback)((e,t)=>{let n=B.current;return n?Ce(e,t,n):Promise.resolve({ok:!1,detail:`No connected repo.`})},[]),Ct=(0,T.useCallback)(async(e,t,n=!1,r)=>{let i=B.current;if(!i)return null;let{codeContext:a,contentHash:o}=await be(t,V.current,i),s=y(`lesson|${i}|${e.title}|${t.title}|${r??`working`}|${o}`,K.model);if(!n){let n=await x(s);if(n)return Fe.current.set(Qe(e.title,t.title),n),n}let c=await ye(e,t,a,K,{maxTokens:q.lessonMaxTokens,thinkingLevel:q.thinkingLevel,altitude:r}).catch(()=>null);return c&&(b(s,c),Fe.current.set(Qe(e.title,t.title),c)),c},[K,q]),wt=(0,T.useCallback)(async(e,t=!1)=>{let n=B.current;if(!n)return;let r=y(`closing|${n}|${e.title}|${V.current??``}`,K.model);if(!t){let e=await x(r);if(e)return e}let i=new AbortController,a=setTimeout(()=>i.abort(),9e4),o=await ve(e,K,{signal:i.signal,maxTokens:q.closingMaxTokens,thinkingLevel:q.thinkingLevel}).catch(()=>void 0).finally(()=>clearTimeout(a));return o&&b(r,o),o},[K,q]),Tt=(0,T.useCallback)(e=>{D(e);let t=at(e);t===`courses`?J():t===`orientation`&&_t()},[J,_t]),[Et,Y]=(0,T.useState)(!1),[Dt,Ot]=(0,T.useState)(``),[kt,At]=(0,T.useState)(``),jt=(0,T.useCallback)(()=>{let e=Dt.trim();if(!d(e)){At("That doesn’t look like a unified diff — paste the output of `git diff` (or a .diff / .patch file).");return}if(mt(e)===0){At(`No changed files found in that diff.`);return}Y(!1),Ot(``),At(``)},[Dt,mt]),[Mt,Nt]=(0,T.useState)(`github`),[Pt,Ft]=(0,T.useState)(()=>ce()),[It,Lt]=(0,T.useState)(!1),Rt=(0,T.useRef)(void 0),zt=(0,T.useCallback)(()=>{le(j),Lt(!0),window.clearTimeout(Rt.current),Rt.current=window.setTimeout(()=>Lt(!1),1600)},[j]);(0,T.useEffect)(()=>()=>window.clearTimeout(Rt.current),[]);let Bt=(0,T.useCallback)(e=>{Ft(ce()),Nt(e),qt(``),Z(``),ln(``),dn(h()),Y(!0)},[]),[Vt,Ht]=(0,T.useState)(``),[Ut,Wt]=(0,T.useState)(``),Gt=(0,T.useCallback)(()=>{let e=Vt.trim();if(!e){Wt(`Paste the alert, error, or log line that fired.`);return}G.current++;let t=f(e,j.changes.length>0&&!j.provenance.example?j:void 0);if(M(t),D(`incident`),Y(!1),Ht(``),Wt(``),K){oe.current?.abort();let n=new AbortController;oe.current=n,he(t,e,K,n.signal).then(e=>M(n=>n.incident===t.incident?e:n))}},[Vt,j,K]),[Kt,qt]=(0,T.useState)(``),[X,Jt]=(0,T.useState)(``),[Yt,Xt]=(0,T.useState)(``),[Zt,Qt]=(0,T.useState)(``),[$t,en]=(0,T.useState)(``),[tn,nn]=(0,T.useState)(``),[rn,an]=(0,T.useState)(``),[on,Z]=(0,T.useState)(``),[Q,sn]=(0,T.useState)(!1),[cn,ln]=(0,T.useState)(``),[un,dn]=(0,T.useState)(!1),fn=(0,T.useRef)(null);(0,T.useEffect)(()=>()=>fn.current?.abort(),[]);let pn=(0,T.useCallback)(async e=>{let t=G.current;fn.current?.abort();let n=new AbortController;fn.current=n,sn(!0),Z(``);let r=await e(n.signal);if(!(n.signal.aborted||t!==G.current)){if(sn(!1),!r.ok||!r.diff){Z(r.detail);return}if(mt(r.diff,r.label,ke(r.label))===0){Z(`That diff had no changed files to analyze.`);return}Y(!1)}},[mt]),mn=(0,T.useCallback)(()=>{let e=Yt.trim();if(!e){Z(`Enter a pull-request number.`);return}pn(t=>Se(e,X.trim()||void 0,t))},[Yt,X,pn]),hn=(0,T.useCallback)(()=>{let e=Zt.trim(),t=$t.trim();if(!e||!t){Z(`Enter a base and a head ref to compare.`);return}pn(n=>Ce(e,t,X.trim()||void 0,n))},[Zt,$t,X,pn]),gn=(0,T.useCallback)(()=>{let e=cn.trim();e&&p(e).then(e=>{dn(e),ln(``),e&&Z(``)})},[cn]),_n=(0,T.useCallback)(()=>{g().then(()=>{dn(!1),ln(``)})},[]),vn=(0,T.useCallback)(async(e,t,n)=>{let r=(e??X).trim()||void 0,i=(t??tn).trim()||void 0,a=(n??rn).trim(),o=G.current;fn.current?.abort();let s=new AbortController;fn.current=s,sn(!0),Z(``);let c=await we(i,r,s.signal);if(s.signal.aborted||o!==G.current)return;if(sn(!1),!c.ok||!c.paths){Z(c.detail);return}let l=a.replace(/^\/+|\/+$/g,``),u=l?c.paths.filter(e=>e===l||e.startsWith(l+`/`)):c.paths;if(u.length===0){Z(`No files under “${l}”.`);return}let d=N(u,l?`${c.label??`repo`}/${l}`:c.label??`repo`,c.truncated),f=ke(c.label),p=i,m=f?!!w(f):!1;G.current++,W(),++L.current,P.current=d,B.current=f,V.current=p,de.current=c.sha,pe.current=null,se.current=!1,z.current=!1,Re(),Ne.current=u,M(d),D(m?`course`:`onboarding`),dt(!0),Y(!1),I({verdict:`done`,orientation:`floor`,courses:`floor`}),f&&(_t(),m&&J())},[tn,X,rn,W,_t,J,Re]),yn=(0,T.useCallback)(()=>{let e=ae(Kt,X.trim()||void 0);if(e.kind===`invalid`){Z(e.reason);return}if(Z(``),e.kind===`pr`)pn(t=>Se(e.prNumber,e.repo,t));else if(e.kind===`compare`)pn(t=>Ce(e.base,e.head,e.repo,t));else{let t=e.kind===`tree`?e.ref:void 0,n=e.kind===`tree`?e.path:void 0;vn(e.repo,t,n)}},[Kt,X,pn,vn]),bn=j.changes.length>0?`ship`:`understand`,xn=(0,T.useMemo)(()=>{let e={orientation:F.orientation,courses:F.courses,hasRepo:!!B.current},t=ot.filter(t=>t.applies(j,e)),n=bn===`ship`?`understand`:`ship`,r=t.filter(e=>e.jobs.includes(bn)),i=t.filter(e=>!e.jobs.includes(bn)&&e.jobs.includes(n));return[{job:bn,items:r},{job:n,items:i}].filter(e=>e.items.length>0)},[j,F.orientation,F.courses,bn]),Sn=(0,T.useMemo)(()=>xn.flatMap(e=>e.items),[xn]);(0,T.useEffect)(()=>{Sn.length&&!Sn.some(e=>e.id===E)&&D(Sn[0].id)},[Sn,E]);let Cn=(0,T.useCallback)(e=>{S&&n&&n(`${e.label}. ${e.problem??e.contract??``} ${e.fix??``}`.trim()),Ie(`Explain ${e.label}${e.contract?` — ${e.contract}`:``}`)},[S,n,Ie]),wn=(0,T.useCallback)(e=>{let t=j;switch(e){case`verdict`:return t.pr.summary;case`read`:return t.pr.summary;case`incident`:return t.incident?`${t.incident.symptom}. ${t.incident.rootCause}`:``;case`workspace`:return`Here are all ${t.changes.length} changes, grouped by subsystem. Pick one to see its diff and what it touches.`;case`impact`:{let e=t.nodes.filter(e=>e.status===`breaks`).length;return e?`Everything this change touches. ${e} of these break — the coral lines are where.`:`Everything this change touches. Nothing breaks downstream.`}case`cascade`:{let e=t.cascades[0];return e?`Watch how one line becomes a ${e.incidentSeverity}: ${e.trigger}, and ${e.incident}.`:``}case`migration`:return t.migration?`The migration looks harmless, but on ${t.migration.rows} rows it costs ${t.migration.lockCost}.`:``;case`rollout`:return`Ship in this order and the change never breaks a caller mid-rollout.`;case`course`:return t.courses?.length?`A guided curriculum — ${t.courses.length} ${t.courses.length===1?`course`:`courses`} that take you from oriented to fearless, built from this code.`:`A leveled course, built from this code, so you can change it without fear.`;case`onboarding`:return`Understand the whole service — module by module, and a request's life through it.`;case`hotspots`:return`The story behind the lines worth knowing before you touch them.`;case`suggestions`:return`${t.suggestions.length} things worth your time. ${t.suppressedNits} shallow nits suppressed.`;case`gate`:return t.gate.rationale;default:return``}},[j]);(0,T.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let Tn=(0,T.useRef)(null);c(Tn);let $=j.pr,En=j.provenance.example,Dn=(0,T.useCallback)(()=>{switch(E){case`verdict`:return(0,O.jsx)(fe,{model:j,altitude:k,onNavigate:e=>Tt(e),onAsk:Cn});case`read`:return(0,O.jsx)(Ve,{model:j,altitude:k});case`incident`:return(0,O.jsx)(He,{model:j,altitude:k});case`impact`:return(0,O.jsx)(te,{nodes:j.nodes,edges:j.edges,altitude:k,onAsk:Cn});case`workspace`:return(0,O.jsx)(Ue,{model:j,altitude:k});case`cascade`:return(0,O.jsx)(We,{model:j});case`migration`:return(0,O.jsx)(Ge,{model:j,altitude:k});case`rollout`:return(0,O.jsx)(Ke,{model:j,altitude:k});case`course`:return(0,O.jsx)(qe,{model:j,altitude:k,building:F.courses===`enriching`,onRegenerate:B.current?vt:void 0,loadLessonDetail:B.current?Ct:void 0,loadCourseClosing:B.current?wt:void 0,courseFocus:yt,onCourseFocus:B.current?xt:void 0,speak:S?n:void 0,commitSha:B.current?de.current:void 0,compareSinceBuilt:B.current?St:void 0,openFullAnalysis:B.current?mt:void 0,onAskAboutLesson:Ie});case`onboarding`:return(0,O.jsx)(Je,{model:j,altitude:k});case`hotspots`:return(0,O.jsx)(Ye,{model:j,altitude:k});case`suggestions`:return(0,O.jsx)(Xe,{model:j,altitude:k});case`gate`:return(0,O.jsx)(Ze,{model:j,altitude:k});default:throw Error(`Ripple: no section renderer for "${E}"`)}},[E,j,k,Cn,Tt,F.courses,vt,Ct,wt,yt,xt,St,mt,S,n,Ie]);return(0,O.jsx)(`div`,{className:`ripple-scrim`,"data-expanded":s?`true`:void 0,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close Ripple`,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),a())},children:(0,O.jsxs)(`section`,{className:`ripple-panel`,role:`dialog`,"aria-label":`Ripple`,ref:Tn,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`header`,{className:`ripple-head`,children:[(0,O.jsxs)(`div`,{className:`ripple-id`,children:[(0,O.jsx)(`span`,{className:`ripple-word`,children:`Ripple`}),(0,O.jsx)(`span`,{className:`ripple-sep`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-repo`,children:$.repo}),$.number&&(0,O.jsx)(`span`,{className:`ripple-pr`,children:$.number}),$.branch&&(0,O.jsxs)(`span`,{className:`ripple-branch`,children:[$.branch,$.base?` → ${$.base}`:``]})]}),(0,O.jsxs)(`div`,{className:`ripple-head-right`,children:[($.added!=null||$.removed!=null)&&(0,O.jsxs)(`span`,{className:`ripple-stat`,children:[$.added!=null&&(0,O.jsxs)(`span`,{className:`ripple-add`,children:[`+`,$.added.toLocaleString()]}),` `,$.removed!=null&&(0,O.jsxs)(`span`,{className:`ripple-del`,children:[`−`,$.removed.toLocaleString()]}),$.files==null?``:` · ${$.files} files`]}),$.p0Ways?(0,O.jsxs)(`span`,{className:`ripple-p0`,title:`Ways this change could cause a P0`,children:[(0,O.jsx)(`span`,{className:`ripple-p0-dot`,"aria-hidden":`true`}),$.p0Ways,` `,$.p0Ways===1?`way`:`ways`,` to cause a P0`]}):null,!En&&(0,O.jsx)(`button`,{type:`button`,className:`ripple-track-btn`,onClick:zt,title:`Keep an eye on this change — saved on this device`,children:It?`Tracked ✓`:`☆ Track`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-ask-toggle`+(U?` is-active`:``),onClick:()=>Te(e=>!e),...i(ze.preload),"aria-pressed":U,"aria-label":U?`Close the ask rail`:`Ask about this repo or PR`,title:U?`Hide ask`:`Ask about this repo or PR`,children:`Ask`}),n&&(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>C(e=>!e),"aria-pressed":S,"aria-label":S?`Turn narration off`:`Turn narration on`,title:S?`Narration on — the orb speaks the walkthrough`:`Narration off`,children:S?`🔊`:`🔇`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>u(e=>!e),"aria-label":s?`Exit full screen`:`Expand to full screen`,title:s?`Exit full screen`:`Full screen`,children:s?`⤡`:`⤢`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:a,"aria-label":`Close Ripple`,children:`✕`})]})]}),q.tier===`slow-cheap`&&ut&&!ct&&(0,O.jsxs)(`div`,{className:`ripple-hint`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-hint-text`,children:`Tip: a flash or lite model makes Ripple feel instant — your model still works, it’s just slower here.`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-hint-dismiss`,onClick:ft,"aria-label":`Dismiss tip`,children:`Got it`})]}),(En||(j.provenance.notes?.length??0)>0)&&(0,O.jsxs)(`div`,{className:`ripple-example`,"data-real":En?void 0:`true`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-example-dot`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-example-text`,children:En?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`strong`,{children:`Worked example`}),` — a sample of a GitHub-connected analysis, not your code. It shows only what GitHub gives us (diff, files, in-repo callers).`]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`strong`,{children:j.changes.length===0?`Exploring`:`From your diff`}),` —`,` `,j.provenance.notes?.[0]]})}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-example-cta`,onClick:()=>Bt(`github`),children:En?`Run on your own code →`:`New`})]}),(0,O.jsxs)(`div`,{className:`ripple-body`,children:[(0,O.jsxs)(`nav`,{className:`ripple-rail`,"aria-label":`Sections`,children:[xn.map(e=>(0,O.jsxs)(`div`,{className:`ripple-rail-group`,children:[xn.length>1&&(0,O.jsx)(`div`,{className:`ripple-rail-grouplabel`,children:it[e.job]}),e.items.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`ripple-rail-item`,"data-ripple-section":e.id,"data-active":e.id===E?`true`:void 0,"data-enriching":F[at(e.id)]===`enriching`?`true`:void 0,onClick:()=>{if(Tt(e.id),S&&n){let t=wn(e.id);t&&n(t)}},...i(()=>rt(e.id)),children:[(0,O.jsx)(`span`,{className:`ripple-rail-label`,children:e.label}),F[at(e.id)]===`enriching`&&(0,O.jsx)(`span`,{className:`ripple-rail-spark`,"aria-hidden":`true`})]},e.id))]},e.job)),(0,O.jsxs)(`div`,{className:`ripple-rail-altitude`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`Explain for`}),(0,O.jsx)(`div`,{className:`ripple-alt`,role:`group`,"aria-label":`Explanation altitude`,children:tt.map(e=>(0,O.jsx)(`button`,{type:`button`,"data-active":k===e.id?`true`:void 0,onClick:()=>A(e.id),children:e.label},e.id))})]})]}),(0,O.jsxs)(`div`,{className:`ripple-main`,children:[F[at(E)]===`enriching`&&at(E)!==`courses`&&(0,O.jsxs)(`div`,{className:`ripple-sharpening-wrap`,children:[(0,O.jsxs)(`div`,{className:`ripple-sharpening`,role:`status`,"aria-live":`polite`,children:[(0,O.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),at(E)===`orientation`?`Reading the repo to map it out…`:`Sharpening with the model’s read…`]}),(0,O.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`})]}),at(E)===`verdict`&&F.verdict===`error`&&!H&&(0,O.jsxs)(`div`,{className:`ripple-verdict-err`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-err-text`,children:`The model’s read didn’t land — showing the grounded floor. Connect a key in Settings → Live, or try again.`}),(0,O.jsxs)(`div`,{className:`ripple-verdict-err-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-retry`,onClick:ht,children:`Try again`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-dismiss`,onClick:()=>xe(!0),"aria-label":`Dismiss`,children:`Dismiss`})]})]}),(0,O.jsx)(o,{label:`${ot.find(e=>e.id===E)?.label??`Ripple`} section`,children:Dn()})]}),U&&(0,O.jsx)(o,{label:`Ripple ask rail`,children:(0,O.jsx)(Be,{ctx:Le,onClose:()=>Te(!1),altitude:k,seed:je,repo:$.repo||``,gitRef:$.branch||`HEAD`,focusFile:j.changes[0]?.file??j.modules[0]?.entry},De)})]}),Et&&(0,O.jsx)(`div`,{className:`ripple-paste`,role:`dialog`,"aria-label":`Run Ripple on a diff`,children:(0,O.jsxs)(`div`,{className:`ripple-paste-card`,children:[(0,O.jsxs)(`div`,{className:`ripple-paste-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`ripple-paste-title`,children:`Run Ripple on your code`}),(0,O.jsx)(`div`,{className:`ripple-paste-sub`,children:`Read-only — Ripple analyzes a change and never writes, comments, or merges.`})]}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>Y(!1),"aria-label":`Cancel`,children:`✕`})]}),(0,O.jsx)(l,{kind:`code`,from:`live`}),Mt===`incident`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`textarea`,{className:`ripple-paste-input`,value:Vt,onChange:e=>{Ht(e.target.value),Ut&&Wt(``)},placeholder:`PagerDuty: [payments-api] P1 — 5xx rate 38% on /charge
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/generate-8odaTyr4.js","assets/providers-wzm7E8Pa.js","assets/chunk-BVpWp9h4.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/cache-BumECILO.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/githubBrowser-DywfDeYx.js","assets/streamParse-DRgMHWye.js","assets/owners-FXDGInVq.js","assets/codeContext-0UMRSGRr.js","assets/ShipRead-CMe1DNik.js","assets/index-DOpl5xzv.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShipIncident-DXXciEP7.js","assets/ShipIncident-BUHvFFiC.css","assets/ShipWorkspace--x-q6Ly3.js","assets/colors-D49Req-e.js","assets/ShipWorkspace-D6XQpGEN.css","assets/ShipCascade-BmTE193h.js","assets/ShipCascade-CyFnrlET.css","assets/ShipMigration-rhBm0Tre.js","assets/ShipMigration-BznCskNg.css","assets/ShipRollout-BA4x-btU.js","assets/ShipRollout-CqeObx5b.css","assets/ShipCourse-K2vnS3Sw.js","assets/courseStore-DfafnL-9.js","assets/links--u_phi0x.js","assets/DropSelect-CeCNaut0.js","assets/store-DXmC_fP2.js","assets/ShipCourse-DcT7PUSm.css","assets/ShipOnboarding-9KCVVAkX.js","assets/ShipOnboarding-BC9Vxkpa.css","assets/ShipHotspots-DILwqPxh.js","assets/ShipHotspots-CLOMutPv.css","assets/ShipSuggestions-Jm45jfFl.js","assets/ShipSuggestions-BKRvk5Mj.css","assets/ShipGate-BYYu9WVq.js","assets/ShipGate-BVZfCllb.css","assets/RippleAskController-BA_kGOmL.js","assets/json-B0N3XRZU.js","assets/verbatim-CBMzUDlf.js","assets/RippleAskController-BNAUoIW0.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,q as s}from"./index-DOpl5xzv.js";import{t as c}from"./useFocusTrap-DbfG6zbM.js";import{t as l}from"./FeatureUseNotice-CoK5HkbR.js";import{t as u}from"./useSpatialCanvas-L0r29F7F.js";import{_ as d,a as f,i as p,m,r as h,t as g,v as _,y as v}from"./githubToken-DtcLYqwm.js";import{i as y,n as b,t as x}from"./cache-BumECILO.js";import{n as S,r as C}from"./colors-D49Req-e.js";import{n as w,r as ee}from"./courseStore-DfafnL-9.js";var T=e(),E=.82;function D(e,t){let n=e.find(e=>e.type===`pr`)??e[0],r=n?.id??``,i=e.filter(e=>e.id!==r),a=e=>230+(e-1)*210,o=e=>Math.max(4,Math.floor(2*Math.PI*a(e)*E/204)),s=[];n&&s.push({node:n,x:0,y:0});let c=1,l=0,u=o(c);for(let e of i){l>=u&&(c+=1,l=0,u=o(c));let t=a(c),n=l/u*Math.PI*2-Math.PI/2+c*.5;s.push({node:e,x:0+Math.cos(n)*t,y:0+Math.sin(n)*t*E}),l+=1}for(let e=0;e<240;e++){let e=!1;for(let t=0;t<s.length;t++)for(let n=t+1;n<s.length;n++){let i=s[t],a=s[n],o=a.x-i.x,c=a.y-i.y,l=204-Math.abs(o),u=112-Math.abs(c);if(!(l<=0||u<=0))if(e=!0,l<u){let e=(l/2+.5)*(o<0?-1:1);i.node.id!==r&&(i.x-=e),a.node.id!==r&&(a.x+=e)}else{let e=(u/2+.5)*(c<0?-1:1);i.node.id!==r&&(i.y-=e),a.node.id!==r&&(a.y+=e)}}if(!e)break}let d=1/0,f=1/0,p=-1/0,m=-1/0;for(let e of s)d=Math.min(d,e.x-168/2),f=Math.min(f,e.y-76/2),p=Math.max(p,e.x+168/2),m=Math.max(m,e.y+76/2);let h=80-d,g=80-f;for(let e of s)e.x+=h,e.y+=g;let _=p-d+160,v=m-f+160;return{centerId:r,nodes:s,w:_,h:v,bbox:{x:0,y:0,w:_,h:v}}}var O=t();function te({nodes:e,edges:t,altitude:n,onAsk:r,animate:i}){let[a,o]=(0,T.useState)(`severity`),[s,c]=(0,T.useState)(!1),[l,d]=(0,T.useState)(null),f=(0,T.useMemo)(()=>{let n=s?e.filter(e=>e.type===`pr`||e.crossRepo):e,r=new Set(n.map(e=>e.id));return D(n,t.filter(e=>r.has(e.from)&&r.has(e.to)))},[e,t,s]),p=(0,T.useMemo)(()=>{let e=new Map;for(let t of f.nodes)e.set(t.node.id,t);return e},[f]),m=(0,T.useMemo)(()=>{let e=new Map,t=p.get(f.centerId);if(!t)return e;let n=1;for(let e of f.nodes)n=Math.max(n,Math.hypot(e.x-t.x,e.y-t.y));for(let r of f.nodes){let i=Math.hypot(r.x-t.x,r.y-t.y);e.set(r.node.id,Math.round(i/n*460))}return e},[f,p]),h=p.get(f.centerId),g=u({clamp:{min:.7,max:2.2},margin:56}),{fitTo:_}=g;(0,T.useEffect)(()=>{_(f.bbox)},[f,_]);let[v,y]=(0,T.useState)(!1),b=(0,T.useRef)(!1),x=(0,T.useRef)(!1),w=(0,T.useRef)({x:0,y:0}),ee=(0,T.useCallback)(e=>{b.current=!0,x.current=!1,y(!0),w.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)},[]),E=(0,T.useCallback)(e=>{if(!b.current)return;let t=e.clientX-w.current.x,n=e.clientY-w.current.y;Math.abs(t)+Math.abs(n)>2&&(x.current=!0),w.current={x:e.clientX,y:e.clientY},g.pan(t,n)},[g]),te=(0,T.useCallback)(e=>{b.current=!1,y(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),k=g.viewportRef,{zoomAtClient:A}=g;(0,T.useEffect)(()=>{let e=k.current;if(!e)return;let t=e=>{e.preventDefault(),A(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[k,A]);let j=g.camera.scale>=.7,M=a===`traffic`,N=l?p.get(l)?.node??null:null,P=e.some(e=>typeof e.traffic==`number`),F=e.some(e=>e.crossRepo===!0);return(0,O.jsxs)(`div`,{className:`ripple-impact`,children:[(0,O.jsxs)(`div`,{className:`ripple-impact-controls`,children:[P&&(0,O.jsxs)(`div`,{className:`ripple-lens`,role:`group`,"aria-label":`Map lens`,children:[(0,O.jsx)(`button`,{type:`button`,"data-active":a===`severity`?`true`:void 0,onClick:()=>o(`severity`),children:`Severity`}),(0,O.jsx)(`button`,{type:`button`,"data-active":a===`traffic`?`true`:void 0,onClick:()=>o(`traffic`),children:`Traffic`})]}),F&&(0,O.jsxs)(`label`,{className:`ripple-crossrepo`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),`Cross-repo only`]}),(0,O.jsx)(`div`,{className:`ripple-zoombtns`,children:(0,O.jsx)(`button`,{type:`button`,onClick:()=>_(f.bbox),title:`Fit the whole map`,"aria-label":`Fit`,children:`⤢`})})]}),(0,O.jsxs)(`div`,{className:`ripple-stage`+(v?` is-panning`:``),ref:g.viewportRef,onPointerDown:ee,onPointerMove:E,onPointerUp:te,onPointerCancel:te,children:[(0,O.jsxs)(`div`,{className:`ripple-world`,"data-animate":i?`true`:void 0,style:{width:f.w,height:f.h,transform:g.transform},children:[i&&h&&(0,O.jsx)(`span`,{className:`ripple-enter-pulse`,"aria-hidden":`true`,style:{left:h.x,top:h.y}}),(0,O.jsx)(`svg`,{className:`ripple-edges`,width:f.w,height:f.h,viewBox:`0 0 ${f.w} ${f.h}`,"aria-hidden":`true`,children:f.nodes.filter(e=>e.node.id!==f.centerId).map(e=>{let n=p.get(f.centerId);if(!n)return null;let r=t.find(t=>t.from===n.node.id&&t.to===e.node.id)??t.find(t=>t.to===n.node.id&&t.from===e.node.id),i=C(e.node.status),a=M?1.3+(e.node.traffic??0)*3:r?.breaking?2.4:1.6;return(0,O.jsx)(`line`,{x1:n.x,y1:n.y,x2:e.x,y2:e.y,stroke:i,strokeWidth:a,strokeLinecap:`round`,strokeDasharray:r?.breaking?`6 5`:r?.dashed?`2 6`:void 0,className:`ripple-edge`+(r?.breaking?` ripple-edge-break`:``),style:{animationDelay:`${m.get(e.node.id)??0}ms`},opacity:l&&l!==e.node.id?.25:.7},e.node.id)})}),j&&f.nodes.filter(e=>e.node.id!==f.centerId).map(e=>{let n=p.get(f.centerId);if(!n)return null;let r=t.find(t=>t.from===n.node.id&&t.to===e.node.id)??t.find(t=>t.to===n.node.id&&t.from===e.node.id);return r?(0,O.jsx)(`div`,{className:`ripple-edge-verb`,style:{left:(n.x+e.x)/2,top:(n.y+e.y)/2,color:C(e.node.status)},children:r.verb},`v-${e.node.id}`):null}),f.nodes.map(e=>{let t=e.node,n=t.id===f.centerId,r=C(t.status),i=M&&!n?1+(t.traffic??0)*.24:1;return(0,O.jsx)(`button`,{type:`button`,className:`ripple-node`,"data-center":n?`true`:void 0,"data-status":t.status,"data-open":l===t.id?`true`:void 0,style:{left:e.x-168/2,top:e.y-76/2,width:168,minHeight:76,transform:`scale(${i.toFixed(3)})`,borderColor:r,opacity:l&&l!==t.id?.55:1,animationDelay:`${m.get(t.id)??0}ms`},onClick:()=>{x.current||d(e=>e===t.id?null:t.id)},children:n?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`ripple-node-eyebrow`,style:{color:r},children:`THIS CHANGE`}),(0,O.jsx)(`span`,{className:`ripple-node-name ripple-node-name-lg`,children:t.label})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`ripple-node-top`,children:[(0,O.jsx)(`span`,{className:`ripple-node-dot`,style:{background:r},"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-node-status`,style:{color:r},children:S(t.status)}),t.severity&&(0,O.jsx)(`span`,{className:`ripple-node-sev`,style:{background:r},children:t.severity})]}),(0,O.jsx)(`span`,{className:`ripple-node-name`,children:t.label}),j&&(0,O.jsxs)(`span`,{className:`ripple-node-meta`,children:[t.team??t.owner??``,t.trafficLabel?` · ${t.trafficLabel}`:``]}),t.crossRepo&&(0,O.jsx)(`span`,{className:`ripple-node-repo`,children:`other repo`})]})},t.id)})]}),(0,O.jsx)(`div`,{className:`ripple-map-legend`,"aria-hidden":`true`,children:[`breaks`,`migration`,`untested`,`affected`,`safe`].map(e=>(0,O.jsxs)(`span`,{className:`ripple-map-legend-item`,children:[(0,O.jsx)(`span`,{className:`ripple-node-dot`,style:{background:C(e)}}),S(e).toLowerCase()]},e))})]}),N&&(0,O.jsxs)(`aside`,{className:`ripple-inspect`,"aria-label":`${N.label} detail`,children:[(0,O.jsxs)(`div`,{className:`ripple-inspect-head`,children:[(0,O.jsxs)(`div`,{className:`ripple-inspect-titles`,children:[(0,O.jsx)(`span`,{className:`ripple-node-status`,style:{color:C(N.status)},children:S(N.status)}),N.severity&&(0,O.jsxs)(`span`,{className:`ripple-inspect-sev`,style:{background:C(N.status)},children:[`would page · `,N.severity]})]}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>d(null),"aria-label":`Close detail`,children:`✕`})]}),(0,O.jsx)(`div`,{className:`ripple-inspect-name`,children:N.label}),(0,O.jsxs)(`div`,{className:`ripple-inspect-owner`,children:[N.team?`owned by ${N.team}`:``,N.cite?(0,O.jsxs)(`span`,{className:`ripple-inspect-cite`,children:[` · `,N.cite.ref]}):null]}),N.trafficLabel&&(0,O.jsxs)(`div`,{className:`ripple-inspect-traffic`,children:[(0,O.jsx)(`strong`,{children:N.trafficLabel}),(0,O.jsx)(`span`,{children:`live traffic, from tracing — not the diff`})]}),N.contract&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`The contract`}),(0,O.jsx)(`p`,{children:N.contract})]}),N.problem&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block ripple-inspect-problem`,style:{borderColor:`color-mix(in oklab, ${C(N.status)} 40%, transparent)`},children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,style:{color:C(N.status)},children:`What happens`}),(0,O.jsx)(`p`,{children:N.problem})]}),N.altitudeNotes?.[n]&&(0,O.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`At your altitude`}),(0,O.jsx)(`p`,{children:N.altitudeNotes[n]})]}),N.fix&&(0,O.jsxs)(`div`,{className:`ripple-inspect-fix`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`Mavéa’s call`}),(0,O.jsx)(`p`,{children:N.fix})]}),r&&(0,O.jsxs)(`button`,{type:`button`,className:`ripple-ask-btn`,onClick:()=>r(N),children:[`Ask about `,N.label]})]})]})}function k(e){let t=e.lastIndexOf(`/`),n=t>0?e.slice(0,t):``;return n?n.split(`/`).slice(0,2).join(`/`):`(root)`}function A(e){let t=e.split(`/`);return t[t.length-1]||e}function j(e){let t=e.toLowerCase();return/\b(api|routes?|server|http|controllers?|handlers?)\b/.test(t)?`Routes + request handling.`:/\b(auth|identity|session|login)\b/.test(t)?`Tokens, sessions, permissions.`:/\b(db|data|models?|schema|migrations?|store)\b/.test(t)?`Schemas, queries, persistence.`:/\b(billing|payments?|charge|orders?)\b/.test(t)?`The money path.`:/\b(jobs?|workers?|queue|tasks?|cron)\b/.test(t)?`Async / background work.`:/\b(ui|components?|views?|pages?|client|web)\b/.test(t)?`The user interface.`:/\b(tests?|__tests__|spec|e2e)\b/.test(t)?`Tests.`:/\b(lib|utils?|shared|common|helpers?)\b/.test(t)?`Shared utilities.`:/\b(config|infra|deploy|ci|scripts?)\b/.test(t)?`Config + tooling.`:/\b(webhooks?|events?|integrations?|connectors?)\b/.test(t)?`Outbound events / integrations.`:``}function M(e){return e.find(e=>/\/(index|main|mod|app|server)\.[a-z]+$/i.test(e))||([...e].sort((e,t)=>e.length-t.length)[0]??e[0]??``)}function N(e,t,n=!1){let r=e.filter(e=>typeof e==`string`&&e.length>0),i=new Map;for(let e of r){let t=k(e);(i.get(t)??i.set(t,[]).get(t)).push(e)}let a=[...i.entries()].sort((e,t)=>t[1].length-e[1].length),o=a.map(([e,t],n)=>{let r=M(t),i=`${t.length} file${t.length===1?``:`s`}`,a=j(e);return{id:`m${n}`,name:e,purpose:a||i,entry:r,owner:``,health:i,explain:`${a?a+` `:``}${i} in ${e}.`+(r?` Start with ${A(r)} and follow what it imports.`:``),startHere:t.slice(0,3).map(A),depends:[],usedBy:[]}}),s=[{id:`pr`,label:t.split(`/`).pop()||t,sub:`THIS REPO`,type:`pr`,status:`affected`,scope:`in-pr`}],c=[],l=a.slice(0,9);l.forEach(([e,t],n)=>{let r=`n${n}`,i=M(t);s.push({id:r,label:e,sub:`${t.length} file${t.length===1?``:`s`}`,type:`module`,status:`affected`,scope:`in-pr`,contract:`${j(e)||`${t.length} files`}`+(i?` · start with ${A(i)}`:``)}),c.push({from:`pr`,to:r,verb:`contains`,status:`affected`})});let u=a.slice(0,4).map(([e])=>e).join(`, `);return{pr:{repo:t,title:`${r.length} file${r.length===1?``:`s`}`,files:r.length,summary:`${t} — ${r.length} file${r.length===1?``:`s`} across ${i.size} area${i.size===1?``:`s`}${u?` (${u})`:``}. Start with the busiest areas and follow what they touch.`,risks:[],readScope:`Read the repo tree: ${r.length} file${r.length===1?``:`s`}.`},nodes:s,edges:c,changes:[],cascades:[],rollout:[],workTypes:[],hotspots:[],suggestions:[],suppressedNits:0,modules:o,onboarding:{firstWeek:a.slice(0,5).map(([e,t])=>({team:e.toUpperCase(),title:e,sub:j(e)||`${t.length} files`,file:M(t)})),requestLife:[]},gate:{decision:`watch`,shipSafe:!1,unackedP0:0,requires:[],deployOrder:`unset`,conditions:[],rationale:`Exploring the repo — there’s no change to gate here.`},provenance:{source:`github`,example:!1,notes:[`Exploring ${t} — ${r.length} files grouped into ${i.size} areas.`,`This is the code as it stands, not a change. The gate and diff views don’t apply.`,...a.length>l.length?[`The map shows the ${l.length} busiest areas; the full list is in Onboarding.`]:[],...n?[`Large repo — only the first slice of files was read.`]:[]]}}}var P={tier:`slow-cheap`,enrichMaxTokens:1600,courseCount:3,coursesMaxTokens:2600,closingMaxTokens:3600,lessonMaxTokens:3600,fetchCodeContext:!1,thinkingLevel:`minimal`},F={tier:`frontier-deep`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:7e3,fetchCodeContext:!0,thinkingLevel:`low`},I={tier:`frontier-fast`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:6e3,fetchCodeContext:!0,thinkingLevel:`minimal`},L=e=>!!e&&/(localhost|127\.0\.0\.1|0\.0\.0\.0|host\.docker\.internal|:11434)/i.test(e);function ne(e){let t=e.model.toLowerCase();return L(e.baseUrl)||/:free\b/.test(t)?`slow-cheap`:/\bopus\b/.test(t)||/\bgpt-5(?!.*mini)/.test(t)||/(^|[^a-z])o[1-9](-|\b)/.test(t)||/gemini-[0-9.]*-?pro/.test(t)||/\bsonnet\b/.test(t)&&!/haiku/.test(t)?`frontier-deep`:`frontier-fast`}function re(e){switch(ne(e)){case`slow-cheap`:return P;case`frontier-deep`:return F;default:return I}}var ie=/^[A-Za-z0-9._-]+$/,R=e=>({kind:`invalid`,reason:e});function ae(e,t){let n=e.trim().replace(/^git@github\.com:/i,`github.com/`);if(!n)return R(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`);let r=n.replace(/^https?:\/\//i,``).replace(/^www\./i,``),i=/^github\.com\/(.+)$/i.exec(r),a=/^[A-Za-z0-9._-]+\/[A-Za-z0-9._-]+\/(?:pull|pulls|compare|tree|blob)\b/i.test(n),o=i?i[1]:a?n:null;if(o){let e=o.split(`#`)[0].split(`?`)[0].replace(/\/+$/,``).split(`/`),t=e[0]??``,n=(e[1]??``).replace(/\.git$/,``);if(!t||!n||!ie.test(t)||!ie.test(n))return R(`That GitHub URL is missing an owner/repo.`);let r=`${t}/${n}`,i=e[2],a=e.slice(3);if(!i)return{kind:`repo`,repo:r};if(i===`pull`||i===`pulls`){let e=(a[0]??``).replace(/\D.*$/,``);return e?{kind:`pr`,repo:r,prNumber:e}:R(`That pull-request URL has no number.`)}if(i===`compare`){let e=decodeURIComponent(a.join(`/`)),t=/^(.+?)\.{2,3}(.+)$/.exec(e);return t?{kind:`compare`,repo:r,base:t[1],head:t[2]}:R(`A compare URL looks like base...head.`)}if(i===`tree`||i===`blob`){let e=a[0],t=a.slice(1).join(`/`);return i===`blob`&&t&&(t=t.replace(/\/?[^/]*$/,``)),{kind:`tree`,repo:r,ref:e||void 0,path:t||void 0}}return{kind:`repo`,repo:r}}let s=/^([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?#(\d+)$/.exec(n);if(s)return{kind:`pr`,repo:`${s[1]}/${s[2]}`,prNumber:s[3]};let c=/^([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(n);if(c)return{kind:`repo`,repo:`${c[1]}/${c[2]}`};let l=/^#?(\d+)$/.exec(n);return l?t?{kind:`pr`,repo:t,prNumber:l[1]}:R(`Enter owner/repo#number, or connect a default repo first.`):R(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`)}var oe=`mavea.ripple.tracked.v1`,se=20;function z(){try{let e=localStorage.getItem(oe);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&e.id&&e.model):[]}catch{return[]}}function B(e){try{localStorage.setItem(oe,JSON.stringify(e.slice(0,se)))}catch{}}function ce(){return z().sort((e,t)=>t.savedAt-e.savedAt)}function le(e,t=Date.now()){let n=e.pr.repo||e.pr.title||`change`,r={id:`${n}::${t}`,label:n,savedAt:t,source:e.provenance.source,model:e};return B([r,...z().filter(e=>e.label!==n)]),r}function ue(e){B(z().filter(t=>t.id!==e))}var V=a();function de(e){return(/^(.*?[.!?])(\s|$)/.exec(e.trim())?.[1]??e).trim()}function fe(e){let t=(0,V.c)(65),{model:n,altitude:r,onNavigate:i,onAsk:a}=e,{pr:o,gate:s}=n,c=n.changes.length===0,l;t[0]!==c||t[1]!==s?(l=c?{label:`Explore`,tone:`neutral`}:s.decision===`pass`?{label:`Clear to ship`,tone:`safe`}:s.decision===`block`?{label:`Hold`,tone:`breaks`}:{label:`Review first`,tone:`watch`},t[0]=c,t[1]=s,t[2]=l):l=t[2];let u=l,d=c?`${Math.max(0,n.nodes.length-1)} areas · ${o.files??0} files`:`+${o.added??0} −${o.removed??0} · ${o.files??n.changes.length} file${(o.files??n.changes.length)===1?``:`s`}`,f;t[3]===o.summary?f=t[4]:(f=de(o.summary),t[3]=o.summary,t[4]=f);let p=f,m=o.risks[0]?.text,h;t[5]!==n.courses||t[6]!==n.modules?(h=n.courses?.length||n.modules.length?[{id:`onboarding`,label:n.courses?.length?`Onboard · ${n.courses.length} course${n.courses.length===1?``:`s`}`:`Onboarding`}]:[],t[5]=n.courses,t[6]=n.modules,t[7]=h):h=t[7];let g;t[8]===n.changes.length?g=t[9]:(g=n.changes.length?[{id:`workspace`,label:`${n.changes.length} change${n.changes.length===1?``:`s`}`}]:[],t[8]=n.changes.length,t[9]=g);let _;t[10]===n.cascades.length?_=t[11]:(_=n.cascades.length?[{id:`cascade`,label:`The cascade`}]:[],t[10]=n.cascades.length,t[11]=_);let v;t[12]===n.migration?v=t[13]:(v=n.migration?[{id:`migration`,label:`The migration`}]:[],t[12]=n.migration,t[13]=v);let y;t[14]===n.rollout.length?y=t[15]:(y=n.rollout.length?[{id:`rollout`,label:`Safe rollout`}]:[],t[14]=n.rollout.length,t[15]=y);let b;t[16]===n.suggestions.length?b=t[17]:(b=n.suggestions.length?[{id:`suggestions`,label:`${n.suggestions.length} suggestion${n.suggestions.length===1?``:`s`}`}]:[],t[16]=n.suggestions.length,t[17]=b);let x;t[18]===n.hotspots.length?x=t[19]:(x=n.hotspots.length?[{id:`hotspots`,label:`The story`}]:[],t[18]=n.hotspots.length,t[19]=x);let S;t[20]===n.incident?S=t[21]:(S=n.incident?[{id:`incident`,label:`Incident`}]:[],t[20]=n.incident,t[21]=S);let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C={id:`read`,label:`Full read`},t[22]=C):C=t[22];let w;t[23]===c?w=t[24]:(w=c?[]:[{id:`gate`,label:`The gate`}],t[23]=c,t[24]=w);let ee;t[25]!==S||t[26]!==w||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==b||t[33]!==x?(ee=[...h,...g,..._,...v,...y,...b,...x,...S,C,...w],t[25]=S,t[26]=w,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=b,t[33]=x,t[34]=ee):ee=t[34];let T=ee,E;t[35]===u.label?E=t[36]:(E=(0,O.jsx)(`span`,{className:`ripple-verdict-badge`,children:u.label}),t[35]=u.label,t[36]=E);let D;t[37]===d?D=t[38]:(D=(0,O.jsx)(`span`,{className:`ripple-verdict-scale`,children:d}),t[37]=d,t[38]=D);let k;t[39]!==E||t[40]!==D?(k=(0,O.jsxs)(`div`,{className:`ripple-verdict-top`,children:[E,D]}),t[39]=E,t[40]=D,t[41]=k):k=t[41];let A;t[42]===p?A=t[43]:(A=(0,O.jsx)(`p`,{className:`ripple-verdict-what`,children:p}),t[42]=p,t[43]=A);let j;t[44]!==c||t[45]!==m?(j=m?(0,O.jsxs)(`div`,{className:`ripple-verdict-one`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:c?`Where to start`:`The one thing to check`}),(0,O.jsx)(`span`,{className:`ripple-verdict-one-text`,children:m})]}):!c&&(0,O.jsxs)(`div`,{className:`ripple-verdict-one ripple-verdict-clean`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:`Reads clean`}),(0,O.jsx)(`span`,{className:`ripple-verdict-one-text`,children:`Nothing risky pulled to the top — review and ship.`})]}),t[44]=c,t[45]=m,t[46]=j):j=t[46];let M;t[47]!==k||t[48]!==A||t[49]!==j||t[50]!==u.tone?(M=(0,O.jsxs)(`div`,{className:`ripple-verdict-head`,"data-tone":u.tone,children:[k,A,j]}),t[47]=k,t[48]=A,t[49]=j,t[50]=u.tone,t[51]=M):M=t[51];let N;t[52]!==r||t[53]!==n.edges||t[54]!==n.nodes||t[55]!==a?(N=(0,O.jsx)(`div`,{className:`ripple-verdict-map`,children:(0,O.jsx)(te,{nodes:n.nodes,edges:n.edges,altitude:r,onAsk:a,animate:!0})}),t[52]=r,t[53]=n.edges,t[54]=n.nodes,t[55]=a,t[56]=N):N=t[56];let P;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,O.jsx)(`span`,{className:`ripple-verdict-chips-tag`,children:`Go deeper`}),t[57]=P):P=t[57];let F;t[58]!==T||t[59]!==i?(F=(0,O.jsxs)(`div`,{className:`ripple-verdict-chips`,"aria-label":`Go deeper`,children:[P,T.map(e=>(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-chip`,onClick:()=>i(e.id),children:e.label},e.id))]}),t[58]=T,t[59]=i,t[60]=F):F=t[60];let I;return t[61]!==M||t[62]!==N||t[63]!==F?(I=(0,O.jsxs)(`div`,{className:`ripple-verdict`,children:[M,N,F]}),t[61]=M,t[62]=N,t[63]=F,t[64]=I):I=t[64],I}r();var pe,H=()=>(pe??=s(()=>import(`./generate-8odaTyr4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),pe),me=(...e)=>H().then(t=>t.enrichShipModel(...e)),he=(...e)=>H().then(t=>t.enrichIncident(...e)),ge=(...e)=>H().then(t=>t.enrichOrientation(...e)),_e=(...e)=>H().then(t=>t.enrichCourses(...e)),ve=(...e)=>H().then(t=>t.enrichCourseClosing(...e)),ye=(...e)=>H().then(t=>t.enrichLesson(...e)),be=(...e)=>H().then(t=>t.gatherLessonCode(...e)),xe,U=()=>(xe??=s(()=>import(`./githubBrowser-DywfDeYx.js`).then(e=>e.i),__vite__mapDeps([8,2,3,6,7])),xe),Se=(...e)=>U().then(t=>t.fetchPrDiff(...e)),Ce=(...e)=>U().then(t=>t.compareRefs(...e)),we=(...e)=>U().then(t=>t.fetchRepoTree(...e)),Te,Ee=(...e)=>(Te??=s(()=>import(`./owners-FXDGInVq.js`),__vite__mapDeps([10,8,2,3,6,7])),Te.then(t=>t.resolveOwners(...e))),De,Oe=(...e)=>(De??=s(()=>import(`./codeContext-0UMRSGRr.js`),__vite__mapDeps([11,8,2,3,6,7])),De.then(t=>t.gatherCodeContext(...e))),ke=e=>e?/^([\w.-]+\/[\w.-]+)/.exec(e.trim())?.[1]:void 0,Ae=n(()=>s(()=>import(`./ShipRead-CMe1DNik.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([12,13,2,14,15,16,17]))),je=n(()=>s(()=>import(`./ShipIncident-DXXciEP7.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([18,13,2,14,15,16,17,19]))),Me=n(()=>s(()=>import(`./ShipWorkspace--x-q6Ly3.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([20,13,2,14,15,16,17,21,22]))),Ne=n(()=>s(()=>import(`./ShipCascade-BmTE193h.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([23,13,2,14,15,16,17,21,24]))),Pe=n(()=>s(()=>import(`./ShipMigration-rhBm0Tre.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([25,13,2,14,15,16,17,26]))),Fe=n(()=>s(()=>import(`./ShipRollout-BA4x-btU.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([27,13,2,14,15,16,17,28]))),Ie=n(()=>s(()=>import(`./ShipCourse-K2vnS3Sw.js`).then(e=>({default:e.ShipCourse})),__vite__mapDeps([29,13,2,14,15,16,17,30,6,7,31,32,33,34]))),Le=n(()=>s(()=>import(`./ShipOnboarding-9KCVVAkX.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([35,13,2,14,15,16,17,36]))),Re=n(()=>s(()=>import(`./ShipHotspots-DILwqPxh.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([37,13,2,14,15,16,17,38]))),W=n(()=>s(()=>import(`./ShipSuggestions-Jm45jfFl.js`).then(e=>({default:e.ShipSuggestions})),__vite__mapDeps([39,13,2,14,15,16,17,40]))),G=n(()=>s(()=>import(`./ShipGate-BYYu9WVq.js`).then(e=>({default:e.ShipGate})),__vite__mapDeps([41,14,2,15,42]))),ze=n(()=>s(()=>import(`./RippleAskController-BA_kGOmL.js`).then(e=>({default:e.RippleAskController})),__vite__mapDeps([43,13,2,14,15,16,17,1,3,4,44,45,8,6,7,31,46]))),Be=ze.Component,Ve=Ae.Component,He=je.Component,Ue=Me.Component,We=Ne.Component,Ge=Pe.Component,Ke=Fe.Component,qe=Ie.Component,Je=Le.Component,Ye=Re.Component,Xe=W.Component,Ze=G.Component,Qe=(e,t)=>`${e}::${t}`;function $e(e){try{return localStorage.getItem(e)}catch{return null}}function et(e,t){try{localStorage.setItem(e,t)}catch{}}var tt=[{id:`newgrad`,label:`New grad`},{id:`working`,label:`Working`},{id:`principal`,label:`Principal`}],nt=new Set([`anthropic`,`openai`,`gemini`,`grok`,`openrouter`]);function rt(e){return{read:Ae.preload,incident:je.preload,workspace:Me.preload,cascade:Ne.preload,migration:Pe.preload,rollout:Fe.preload,course:Ie.preload,onboarding:Le.preload,hotspots:Re.preload,suggestions:W.preload,gate:G.preload}[e]?.()??Promise.resolve()}var it={understand:`Understand`,ship:`Ship the change`},at=e=>e===`course`?`courses`:e===`onboarding`?`orientation`:`verdict`,ot=[{id:`verdict`,label:`Overview`,intent:`The verdict, the one thing to check, and the change rippling out.`,jobs:[`ship`],applies:e=>e.changes.length>0},{id:`read`,label:`Mavéa’s read`,intent:`The whole change in two sentences, risks pulled to the top.`,jobs:[`ship`,`understand`],applies:e=>!!e.pr.summary||e.changes.length>0},{id:`course`,label:`Courses`,intent:`A leveled curriculum built from THIS code — beginner → expert, with checkpoints.`,jobs:[`understand`],applies:(e,t)=>!!e.courses?.length||t.courses===`enriching`||t.hasRepo},{id:`onboarding`,label:`Map & request life`,intent:`The modules, who owns what, and a request’s life through the code.`,jobs:[`understand`],applies:(e,t)=>e.modules.length>0||t.hasRepo},{id:`incident`,label:`Incident`,intent:`A live alert, traced back to its likely cause — the rollback and who to wake.`,jobs:[`ship`,`understand`],applies:e=>!!e.incident},{id:`workspace`,label:`Workspace`,intent:`Pick a change — its diff, intent, and cause & effect assemble.`,jobs:[`ship`],applies:e=>e.changes.length>0},{id:`impact`,label:`Impact map`,intent:`Everything this change touches, and what those changes hit downstream.`,jobs:[`ship`,`understand`],applies:e=>e.nodes.length>0},{id:`cascade`,label:`The cascade`,intent:`How one line becomes a P0 — hop by hop, before anyone gets paged.`,jobs:[`ship`],applies:e=>e.cascades.length>0},{id:`migration`,label:`The migration`,intent:`The cost of a schema change isn’t in the SQL — it’s in the table size.`,jobs:[`ship`],applies:e=>!!e.migration},{id:`rollout`,label:`Safe rollout`,intent:`One safe order — so you ship with your eyes open.`,jobs:[`ship`],applies:e=>e.rollout.length>0},{id:`hotspots`,label:`The story`,intent:`Why a line exists, what it broke, and who to ask.`,jobs:[`understand`],applies:e=>e.hotspots.length>0},{id:`suggestions`,label:`Suggestions`,intent:`The “did you think about X?” a staff engineer would raise — grounded, and rare.`,jobs:[`ship`],applies:e=>e.suggestions.length>0},{id:`gate`,label:`The gate`,intent:`A picture for you, a pre-merge check for the agents.`,jobs:[`ship`],applies:e=>e.changes.length>0}];function st({model:e,cfg:t,speak:n,showcase:r,onClose:a}){let[s,u]=(0,T.useState)(!1),[S,C]=(0,T.useState)(!1),[E,D]=(0,T.useState)(`verdict`),[k,A]=(0,T.useState)(`working`),[j,M]=(0,T.useState)(e),P=(0,T.useRef)(e),[F,I]=(0,T.useState)({verdict:`floor`,orientation:`floor`,courses:`floor`}),L=(0,T.useRef)(0),ne=(0,T.useRef)(null),ie=(0,T.useRef)(null),R=(0,T.useRef)(null),oe=(0,T.useRef)(null),se=(0,T.useRef)(!1),z=(0,T.useRef)(!1),B=(0,T.useRef)(void 0),V=(0,T.useRef)(void 0),de=(0,T.useRef)(void 0),pe=(0,T.useRef)(null),[H,xe]=(0,T.useState)(!1),[U,Te]=(0,T.useState)(!1),[De,Ae]=(0,T.useState)(0),[je,Me]=(0,T.useState)(null),Ne=(0,T.useRef)([]),Pe=(0,T.useRef)(new Map),Fe=(0,T.useRef)(new Map),Ie=(0,T.useCallback)(e=>{Me(t=>({text:e,nonce:(t?.nonce??0)+1})),Te(!0)},[]),Le=(0,T.useMemo)(()=>t?{model:j,cfg:t,altitude:k,diffText:pe.current?.text,repo:B.current,gitRef:V.current,treePaths:Ne.current,lessonDetails:Fe.current,fileCache:Pe.current}:null,[t,j,k]),Re=(0,T.useCallback)(()=>{Ae(e=>e+1),Ne.current=[],Pe.current.clear(),Fe.current.clear()},[]),W=(0,T.useCallback)(()=>{ne.current?.abort(),ie.current?.abort(),R.current?.abort(),oe.current?.abort()},[]);(0,T.useEffect)(()=>W,[W]);let G=(0,T.useRef)(0);(0,T.useEffect)(()=>{M(e),P.current=e,B.current=void 0,se.current=!0,z.current=!0,I({verdict:`done`,orientation:e.modules.length?`done`:`floor`,courses:e.courses?.length?`done`:`floor`})},[e]);let st=(0,T.useRef)(!1);(0,T.useEffect)(()=>{st.current||(st.current=!0,!(!e.provenance.example||r)&&($e(`ripple.seenWorkedExample`)===`1`?(Nt(`github`),Y(!0)):et(`ripple.seenWorkedExample`,`1`)))},[e.provenance.example,r]);let K=(0,T.useMemo)(()=>t&&nt.has(t.provider)?t:{provider:`gemini`,model:`gemini-3.5-flash`,apiKey:``},[t]),q=(0,T.useMemo)(()=>re(K),[K]),[ct,lt]=(0,T.useState)(()=>$e(`ripple.hint.fastModel.dismissed`)===`1`),[ut,dt]=(0,T.useState)(!1),ft=(0,T.useCallback)(()=>{lt(!0),et(`ripple.hint.fastModel.dismissed`,`1`)},[]),pt=(0,T.useCallback)((e,t,n)=>{let r=++L.current;ne.current?.abort();let i=new AbortController;ne.current=i,xe(!1),I(e=>({...e,verdict:`enriching`})),(async()=>{let a=n&&q.fetchCodeContext?await Oe(e,n,void 0,i.signal).catch(()=>``):``;if(i.signal.aborted||L.current!==r)return;let o=await me(e,t,K,{signal:i.signal,codeContext:a||void 0,maxTokens:q.enrichMaxTokens,thinkingLevel:q.thinkingLevel,onPartial:t=>{L.current===r&&M(m(e,t,K.model))}});L.current===r&&(o?(M(o),P.current=o,I(e=>({...e,verdict:`done`}))):(M(e),P.current=e,I(e=>({...e,verdict:`error`}))))})()},[K,q]),mt=(0,T.useCallback)((e,t,n)=>{let r=v(_(e),t);return r.changes.length===0?0:(G.current++,W(),P.current=r,B.current=n,V.current=r.pr.branch||void 0,de.current=void 0,pe.current={text:e,repo:n},se.current=!1,z.current=!1,Re(),M(r),D(`verdict`),dt(!0),I({verdict:`enriching`,orientation:`floor`,courses:`floor`}),pt(r,e,n),r.changes.length)},[W,pt,Re]),ht=(0,T.useCallback)(()=>{let e=pe.current;e&&pt(P.current,e.text,e.repo)},[pt]),gt=(0,T.useCallback)(e=>{let t=P.current;return t.modules.length?t.modules:N(t.changes.map(e=>e.file),e,!1).modules},[]),_t=(0,T.useCallback)((e=!1)=>{let t=B.current;if(!t||se.current&&!e)return;se.current=!0;let n=L.current;ie.current?.abort();let r=new AbortController;ie.current=r,I(e=>({...e,orientation:`enriching`})),(async()=>{let e=await ge({...P.current,modules:gt(t)},t,V.current,K,{signal:r.signal,maxTokens:q.enrichMaxTokens,thinkingLevel:q.thinkingLevel}).catch(()=>null);if(r.signal.aborted||L.current!==n)return;let i=e?await Ee(e,t,V.current,r.signal).catch(()=>e):{...P.current,modules:gt(t)};r.signal.aborted||L.current!==n||(M(e=>({...e,modules:i.modules,nodes:i.nodes,onboarding:i.onboarding})),I(t=>({...t,orientation:e?`done`:`error`})))})()},[K,q,gt]),J=(0,T.useCallback)((e=!1,t)=>{let n=B.current;if(!n||z.current&&!e)return;z.current=!0;let r=L.current;R.current?.abort();let i=new AbortController;R.current=i;let a=setTimeout(()=>i.abort(),9e4);I(e=>({...e,courses:`enriching`})),(async()=>{let o=y(`courses|${n}|${V.current??``}|${t??``}`,K.model),s=e?null:await x(o);if(i.signal.aborted||L.current!==r)return;let c={...P.current,modules:gt(n)},l=s?.courses??await _e(c,n,V.current,K,{signal:i.signal,count:q.courseCount,maxTokens:q.coursesMaxTokens,thinkingLevel:q.thinkingLevel,focus:t}).catch(()=>void 0);if(clearTimeout(a),!(i.signal.aborted||L.current!==r))if(l?.length){M(e=>({...e,courses:l})),I(e=>({...e,courses:`done`}));let e=s?s.commitSha:de.current;s||b(o,{courses:l,commitSha:de.current}),ee(n,{commitSha:e??``,ref:V.current??``,model:K.model,builtAt:Date.now(),courseTitles:l.map(e=>e.title)})}else I(e=>({...e,courses:`error`}))})()},[K,q,gt]),vt=(0,T.useCallback)(()=>J(!0),[J]),[yt,bt]=(0,T.useState)(void 0),xt=(0,T.useCallback)(e=>{bt(e),z.current=!1,J(!0,e)},[J]),St=(0,T.useCallback)((e,t)=>{let n=B.current;return n?Ce(e,t,n):Promise.resolve({ok:!1,detail:`No connected repo.`})},[]),Ct=(0,T.useCallback)(async(e,t,n=!1,r)=>{let i=B.current;if(!i)return null;let{codeContext:a,contentHash:o}=await be(t,V.current,i),s=y(`lesson|${i}|${e.title}|${t.title}|${r??`working`}|${o}`,K.model);if(!n){let n=await x(s);if(n)return Fe.current.set(Qe(e.title,t.title),n),n}let c=await ye(e,t,a,K,{maxTokens:q.lessonMaxTokens,thinkingLevel:q.thinkingLevel,altitude:r}).catch(()=>null);return c&&(b(s,c),Fe.current.set(Qe(e.title,t.title),c)),c},[K,q]),wt=(0,T.useCallback)(async(e,t=!1)=>{let n=B.current;if(!n)return;let r=y(`closing|${n}|${e.title}|${V.current??``}`,K.model);if(!t){let e=await x(r);if(e)return e}let i=new AbortController,a=setTimeout(()=>i.abort(),9e4),o=await ve(e,K,{signal:i.signal,maxTokens:q.closingMaxTokens,thinkingLevel:q.thinkingLevel}).catch(()=>void 0).finally(()=>clearTimeout(a));return o&&b(r,o),o},[K,q]),Tt=(0,T.useCallback)(e=>{D(e);let t=at(e);t===`courses`?J():t===`orientation`&&_t()},[J,_t]),[Et,Y]=(0,T.useState)(!1),[Dt,Ot]=(0,T.useState)(``),[kt,At]=(0,T.useState)(``),jt=(0,T.useCallback)(()=>{let e=Dt.trim();if(!d(e)){At("That doesn’t look like a unified diff — paste the output of `git diff` (or a .diff / .patch file).");return}if(mt(e)===0){At(`No changed files found in that diff.`);return}Y(!1),Ot(``),At(``)},[Dt,mt]),[Mt,Nt]=(0,T.useState)(`github`),[Pt,Ft]=(0,T.useState)(()=>ce()),[It,Lt]=(0,T.useState)(!1),Rt=(0,T.useRef)(void 0),zt=(0,T.useCallback)(()=>{le(j),Lt(!0),window.clearTimeout(Rt.current),Rt.current=window.setTimeout(()=>Lt(!1),1600)},[j]);(0,T.useEffect)(()=>()=>window.clearTimeout(Rt.current),[]);let Bt=(0,T.useCallback)(e=>{Ft(ce()),Nt(e),qt(``),Z(``),ln(``),dn(h()),Y(!0)},[]),[Vt,Ht]=(0,T.useState)(``),[Ut,Wt]=(0,T.useState)(``),Gt=(0,T.useCallback)(()=>{let e=Vt.trim();if(!e){Wt(`Paste the alert, error, or log line that fired.`);return}G.current++;let t=f(e,j.changes.length>0&&!j.provenance.example?j:void 0);if(M(t),D(`incident`),Y(!1),Ht(``),Wt(``),K){oe.current?.abort();let n=new AbortController;oe.current=n,he(t,e,K,n.signal).then(e=>M(n=>n.incident===t.incident?e:n))}},[Vt,j,K]),[Kt,qt]=(0,T.useState)(``),[X,Jt]=(0,T.useState)(``),[Yt,Xt]=(0,T.useState)(``),[Zt,Qt]=(0,T.useState)(``),[$t,en]=(0,T.useState)(``),[tn,nn]=(0,T.useState)(``),[rn,an]=(0,T.useState)(``),[on,Z]=(0,T.useState)(``),[Q,sn]=(0,T.useState)(!1),[cn,ln]=(0,T.useState)(``),[un,dn]=(0,T.useState)(!1),fn=(0,T.useRef)(null);(0,T.useEffect)(()=>()=>fn.current?.abort(),[]);let pn=(0,T.useCallback)(async e=>{let t=G.current;fn.current?.abort();let n=new AbortController;fn.current=n,sn(!0),Z(``);let r=await e(n.signal);if(!(n.signal.aborted||t!==G.current)){if(sn(!1),!r.ok||!r.diff){Z(r.detail);return}if(mt(r.diff,r.label,ke(r.label))===0){Z(`That diff had no changed files to analyze.`);return}Y(!1)}},[mt]),mn=(0,T.useCallback)(()=>{let e=Yt.trim();if(!e){Z(`Enter a pull-request number.`);return}pn(t=>Se(e,X.trim()||void 0,t))},[Yt,X,pn]),hn=(0,T.useCallback)(()=>{let e=Zt.trim(),t=$t.trim();if(!e||!t){Z(`Enter a base and a head ref to compare.`);return}pn(n=>Ce(e,t,X.trim()||void 0,n))},[Zt,$t,X,pn]),gn=(0,T.useCallback)(()=>{let e=cn.trim();e&&p(e).then(e=>{dn(e),ln(``),e&&Z(``)})},[cn]),_n=(0,T.useCallback)(()=>{g().then(()=>{dn(!1),ln(``)})},[]),vn=(0,T.useCallback)(async(e,t,n)=>{let r=(e??X).trim()||void 0,i=(t??tn).trim()||void 0,a=(n??rn).trim(),o=G.current;fn.current?.abort();let s=new AbortController;fn.current=s,sn(!0),Z(``);let c=await we(i,r,s.signal);if(s.signal.aborted||o!==G.current)return;if(sn(!1),!c.ok||!c.paths){Z(c.detail);return}let l=a.replace(/^\/+|\/+$/g,``),u=l?c.paths.filter(e=>e===l||e.startsWith(l+`/`)):c.paths;if(u.length===0){Z(`No files under “${l}”.`);return}let d=N(u,l?`${c.label??`repo`}/${l}`:c.label??`repo`,c.truncated),f=ke(c.label),p=i,m=f?!!w(f):!1;G.current++,W(),++L.current,P.current=d,B.current=f,V.current=p,de.current=c.sha,pe.current=null,se.current=!1,z.current=!1,Re(),Ne.current=u,M(d),D(m?`course`:`onboarding`),dt(!0),Y(!1),I({verdict:`done`,orientation:`floor`,courses:`floor`}),f&&(_t(),m&&J())},[tn,X,rn,W,_t,J,Re]),yn=(0,T.useCallback)(()=>{let e=ae(Kt,X.trim()||void 0);if(e.kind===`invalid`){Z(e.reason);return}if(Z(``),e.kind===`pr`)pn(t=>Se(e.prNumber,e.repo,t));else if(e.kind===`compare`)pn(t=>Ce(e.base,e.head,e.repo,t));else{let t=e.kind===`tree`?e.ref:void 0,n=e.kind===`tree`?e.path:void 0;vn(e.repo,t,n)}},[Kt,X,pn,vn]),bn=j.changes.length>0?`ship`:`understand`,xn=(0,T.useMemo)(()=>{let e={orientation:F.orientation,courses:F.courses,hasRepo:!!B.current},t=ot.filter(t=>t.applies(j,e)),n=bn===`ship`?`understand`:`ship`,r=t.filter(e=>e.jobs.includes(bn)),i=t.filter(e=>!e.jobs.includes(bn)&&e.jobs.includes(n));return[{job:bn,items:r},{job:n,items:i}].filter(e=>e.items.length>0)},[j,F.orientation,F.courses,bn]),Sn=(0,T.useMemo)(()=>xn.flatMap(e=>e.items),[xn]);(0,T.useEffect)(()=>{Sn.length&&!Sn.some(e=>e.id===E)&&D(Sn[0].id)},[Sn,E]);let Cn=(0,T.useCallback)(e=>{S&&n&&n(`${e.label}. ${e.problem??e.contract??``} ${e.fix??``}`.trim()),Ie(`Explain ${e.label}${e.contract?` — ${e.contract}`:``}`)},[S,n,Ie]),wn=(0,T.useCallback)(e=>{let t=j;switch(e){case`verdict`:return t.pr.summary;case`read`:return t.pr.summary;case`incident`:return t.incident?`${t.incident.symptom}. ${t.incident.rootCause}`:``;case`workspace`:return`Here are all ${t.changes.length} changes, grouped by subsystem. Pick one to see its diff and what it touches.`;case`impact`:{let e=t.nodes.filter(e=>e.status===`breaks`).length;return e?`Everything this change touches. ${e} of these break — the coral lines are where.`:`Everything this change touches. Nothing breaks downstream.`}case`cascade`:{let e=t.cascades[0];return e?`Watch how one line becomes a ${e.incidentSeverity}: ${e.trigger}, and ${e.incident}.`:``}case`migration`:return t.migration?`The migration looks harmless, but on ${t.migration.rows} rows it costs ${t.migration.lockCost}.`:``;case`rollout`:return`Ship in this order and the change never breaks a caller mid-rollout.`;case`course`:return t.courses?.length?`A guided curriculum — ${t.courses.length} ${t.courses.length===1?`course`:`courses`} that take you from oriented to fearless, built from this code.`:`A leveled course, built from this code, so you can change it without fear.`;case`onboarding`:return`Understand the whole service — module by module, and a request's life through it.`;case`hotspots`:return`The story behind the lines worth knowing before you touch them.`;case`suggestions`:return`${t.suggestions.length} things worth your time. ${t.suppressedNits} shallow nits suppressed.`;case`gate`:return t.gate.rationale;default:return``}},[j]);(0,T.useEffect)(()=>{let e=e=>{e.key===`Escape`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]);let Tn=(0,T.useRef)(null);c(Tn);let $=j.pr,En=j.provenance.example,Dn=(0,T.useCallback)(()=>{switch(E){case`verdict`:return(0,O.jsx)(fe,{model:j,altitude:k,onNavigate:e=>Tt(e),onAsk:Cn});case`read`:return(0,O.jsx)(Ve,{model:j,altitude:k});case`incident`:return(0,O.jsx)(He,{model:j,altitude:k});case`impact`:return(0,O.jsx)(te,{nodes:j.nodes,edges:j.edges,altitude:k,onAsk:Cn});case`workspace`:return(0,O.jsx)(Ue,{model:j,altitude:k});case`cascade`:return(0,O.jsx)(We,{model:j});case`migration`:return(0,O.jsx)(Ge,{model:j,altitude:k});case`rollout`:return(0,O.jsx)(Ke,{model:j,altitude:k});case`course`:return(0,O.jsx)(qe,{model:j,altitude:k,building:F.courses===`enriching`,onRegenerate:B.current?vt:void 0,loadLessonDetail:B.current?Ct:void 0,loadCourseClosing:B.current?wt:void 0,courseFocus:yt,onCourseFocus:B.current?xt:void 0,speak:S?n:void 0,commitSha:B.current?de.current:void 0,compareSinceBuilt:B.current?St:void 0,openFullAnalysis:B.current?mt:void 0,onAskAboutLesson:Ie});case`onboarding`:return(0,O.jsx)(Je,{model:j,altitude:k});case`hotspots`:return(0,O.jsx)(Ye,{model:j,altitude:k});case`suggestions`:return(0,O.jsx)(Xe,{model:j,altitude:k});case`gate`:return(0,O.jsx)(Ze,{model:j,altitude:k});default:throw Error(`Ripple: no section renderer for "${E}"`)}},[E,j,k,Cn,Tt,F.courses,vt,Ct,wt,yt,xt,St,mt,S,n,Ie]);return(0,O.jsx)(`div`,{className:`ripple-scrim`,"data-expanded":s?`true`:void 0,onClick:a,role:`button`,tabIndex:0,"aria-label":`Close Ripple`,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),a())},children:(0,O.jsxs)(`section`,{className:`ripple-panel`,role:`dialog`,"aria-label":`Ripple`,ref:Tn,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`header`,{className:`ripple-head`,children:[(0,O.jsxs)(`div`,{className:`ripple-id`,children:[(0,O.jsx)(`span`,{className:`ripple-word`,children:`Ripple`}),(0,O.jsx)(`span`,{className:`ripple-sep`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-repo`,children:$.repo}),$.number&&(0,O.jsx)(`span`,{className:`ripple-pr`,children:$.number}),$.branch&&(0,O.jsxs)(`span`,{className:`ripple-branch`,children:[$.branch,$.base?` → ${$.base}`:``]})]}),(0,O.jsxs)(`div`,{className:`ripple-head-right`,children:[($.added!=null||$.removed!=null)&&(0,O.jsxs)(`span`,{className:`ripple-stat`,children:[$.added!=null&&(0,O.jsxs)(`span`,{className:`ripple-add`,children:[`+`,$.added.toLocaleString()]}),` `,$.removed!=null&&(0,O.jsxs)(`span`,{className:`ripple-del`,children:[`−`,$.removed.toLocaleString()]}),$.files==null?``:` · ${$.files} files`]}),$.p0Ways?(0,O.jsxs)(`span`,{className:`ripple-p0`,title:`Ways this change could cause a P0`,children:[(0,O.jsx)(`span`,{className:`ripple-p0-dot`,"aria-hidden":`true`}),$.p0Ways,` `,$.p0Ways===1?`way`:`ways`,` to cause a P0`]}):null,!En&&(0,O.jsx)(`button`,{type:`button`,className:`ripple-track-btn`,onClick:zt,title:`Keep an eye on this change — saved on this device`,children:It?`Tracked ✓`:`☆ Track`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-ask-toggle`+(U?` is-active`:``),onClick:()=>Te(e=>!e),...i(ze.preload),"aria-pressed":U,"aria-label":U?`Close the ask rail`:`Ask about this repo or PR`,title:U?`Hide ask`:`Ask about this repo or PR`,children:`Ask`}),n&&(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>C(e=>!e),"aria-pressed":S,"aria-label":S?`Turn narration off`:`Turn narration on`,title:S?`Narration on — the orb speaks the walkthrough`:`Narration off`,children:S?`🔊`:`🔇`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>u(e=>!e),"aria-label":s?`Exit full screen`:`Expand to full screen`,title:s?`Exit full screen`:`Full screen`,children:s?`⤡`:`⤢`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:a,"aria-label":`Close Ripple`,children:`✕`})]})]}),q.tier===`slow-cheap`&&ut&&!ct&&(0,O.jsxs)(`div`,{className:`ripple-hint`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-hint-text`,children:`Tip: a flash or lite model makes Ripple feel instant — your model still works, it’s just slower here.`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-hint-dismiss`,onClick:ft,"aria-label":`Dismiss tip`,children:`Got it`})]}),(En||(j.provenance.notes?.length??0)>0)&&(0,O.jsxs)(`div`,{className:`ripple-example`,"data-real":En?void 0:`true`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-example-dot`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`ripple-example-text`,children:En?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`strong`,{children:`Worked example`}),` — a sample of a GitHub-connected analysis, not your code. It shows only what GitHub gives us (diff, files, in-repo callers).`]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`strong`,{children:j.changes.length===0?`Exploring`:`From your diff`}),` —`,` `,j.provenance.notes?.[0]]})}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-example-cta`,onClick:()=>Bt(`github`),children:En?`Run on your own code →`:`New`})]}),(0,O.jsxs)(`div`,{className:`ripple-body`,children:[(0,O.jsxs)(`nav`,{className:`ripple-rail`,"aria-label":`Sections`,children:[xn.map(e=>(0,O.jsxs)(`div`,{className:`ripple-rail-group`,children:[xn.length>1&&(0,O.jsx)(`div`,{className:`ripple-rail-grouplabel`,children:it[e.job]}),e.items.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:`ripple-rail-item`,"data-ripple-section":e.id,"data-active":e.id===E?`true`:void 0,"data-enriching":F[at(e.id)]===`enriching`?`true`:void 0,onClick:()=>{if(Tt(e.id),S&&n){let t=wn(e.id);t&&n(t)}},...i(()=>rt(e.id)),children:[(0,O.jsx)(`span`,{className:`ripple-rail-label`,children:e.label}),F[at(e.id)]===`enriching`&&(0,O.jsx)(`span`,{className:`ripple-rail-spark`,"aria-hidden":`true`})]},e.id))]},e.job)),(0,O.jsxs)(`div`,{className:`ripple-rail-altitude`,children:[(0,O.jsx)(`div`,{className:`ripple-eyebrow`,children:`Explain for`}),(0,O.jsx)(`div`,{className:`ripple-alt`,role:`group`,"aria-label":`Explanation altitude`,children:tt.map(e=>(0,O.jsx)(`button`,{type:`button`,"data-active":k===e.id?`true`:void 0,onClick:()=>A(e.id),children:e.label},e.id))})]})]}),(0,O.jsxs)(`div`,{className:`ripple-main`,children:[F[at(E)]===`enriching`&&at(E)!==`courses`&&(0,O.jsxs)(`div`,{className:`ripple-sharpening-wrap`,children:[(0,O.jsxs)(`div`,{className:`ripple-sharpening`,role:`status`,"aria-live":`polite`,children:[(0,O.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),at(E)===`orientation`?`Reading the repo to map it out…`:`Sharpening with the model’s read…`]}),(0,O.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`})]}),at(E)===`verdict`&&F.verdict===`error`&&!H&&(0,O.jsxs)(`div`,{className:`ripple-verdict-err`,role:`note`,children:[(0,O.jsx)(`span`,{className:`ripple-verdict-err-text`,children:`The model’s read didn’t land — showing the grounded floor. Connect a key in Settings → Live, or try again.`}),(0,O.jsxs)(`div`,{className:`ripple-verdict-err-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-retry`,onClick:ht,children:`Try again`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-dismiss`,onClick:()=>xe(!0),"aria-label":`Dismiss`,children:`Dismiss`})]})]}),(0,O.jsx)(o,{label:`${ot.find(e=>e.id===E)?.label??`Ripple`} section`,children:Dn()})]}),U&&(0,O.jsx)(o,{label:`Ripple ask rail`,children:(0,O.jsx)(Be,{ctx:Le,onClose:()=>Te(!1),altitude:k,seed:je,repo:$.repo||``,gitRef:$.branch||`HEAD`,focusFile:j.changes[0]?.file??j.modules[0]?.entry},De)})]}),Et&&(0,O.jsx)(`div`,{className:`ripple-paste`,role:`dialog`,"aria-label":`Run Ripple on a diff`,children:(0,O.jsxs)(`div`,{className:`ripple-paste-card`,children:[(0,O.jsxs)(`div`,{className:`ripple-paste-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`ripple-paste-title`,children:`Run Ripple on your code`}),(0,O.jsx)(`div`,{className:`ripple-paste-sub`,children:`Read-only — Ripple analyzes a change and never writes, comments, or merges.`})]}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>Y(!1),"aria-label":`Cancel`,children:`✕`})]}),(0,O.jsx)(l,{kind:`code`,from:`live`}),Mt===`incident`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`textarea`,{className:`ripple-paste-input`,value:Vt,onChange:e=>{Ht(e.target.value),Ut&&Wt(``)},placeholder:`PagerDuty: [payments-api] P1 — 5xx rate 38% on /charge
3
3
  or paste the error / log line that fired`,spellCheck:!1}),Ut&&(0,O.jsx)(`div`,{className:`ripple-paste-err`,children:Ut}),(0,O.jsxs)(`div`,{className:`ripple-paste-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`ripple-paste-go`,onClick:Gt,children:`Trace it back`}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-paste-cancel`,onClick:()=>Y(!1),children:`Cancel`})]}),(0,O.jsx)(`div`,{className:`ripple-paste-hint`,children:`Ripple traces the alert back to its likely cause — read-only. If a change is open, the trace grounds in it. It never reverts, deploys, or pages anyone.`})]}):Mt===`tracked`?(0,O.jsx)(`div`,{className:`ripple-tracked`,children:Pt.length===0?(0,O.jsxs)(`div`,{className:`ripple-tracked-empty`,children:[`Nothing tracked yet. Open a change and hit `,(0,O.jsx)(`strong`,{children:`☆ Track`}),` to keep an eye on it — it’s saved on this device only.`]}):Pt.map(e=>(0,O.jsxs)(`div`,{className:`ripple-tracked-row`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`ripple-tracked-open`,onClick:()=>{M(e.model),D(`verdict`),Y(!1)},children:[(0,O.jsx)(`span`,{className:`ripple-tracked-label`,children:e.label}),(0,O.jsxs)(`span`,{className:`ripple-tracked-meta`,children:[e.source,` · `,e.model.changes.length||e.model.modules.length,` items`]})]}),(0,O.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,"aria-label":`Untrack ${e.label}`,onClick:()=>{ue(e.id),Ft(ce())},children:`✕`})]},e.id))}):Mt===`paste`?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`textarea`,{className:`ripple-paste-input`,value:Dt,onChange:e=>{Ot(e.target.value),kt&&At(``)},placeholder:`diff --git a/auth/token.ts b/auth/token.ts
4
4
  @@ -42 +42 @@
5
5
  -validateToken(t: string)
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{dt as n,ht as r,ut as i}from"./index-CWqRe4-B.js";var a=r(),o=e(),s=t(),c=[{w:`100%`},{w:`94%`,data:!0},{w:`97%`},{w:`88%`,data:!0},{w:`100%`},{w:`91%`,data:!0},{w:`96%`},{w:`70%`,data:!0},{w:`82%`}],l=[`42%`,`54%`,`48%`,`70%`,`100%`];function u(e,t,n,r){let i=(0,a.c)(6),[s,c]=(0,o.useState)(0),l,u;return i[0]!==r||i[1]!==t||i[2]!==n||i[3]!==e?(l=()=>{if(!r)return;if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.dataset.perf===`lite`){c(e);return}let i=0,a=0,o=t=>{a||=t;let r=Math.min(1,(t-a)/n);c(e*(1-(1-r)**3)),r<1&&(i=requestAnimationFrame(o))},s=window.setTimeout(()=>{i=requestAnimationFrame(o)},t);return()=>{clearTimeout(s),cancelAnimationFrame(i)}},u=[r,e,t,n],i[0]=r,i[1]=t,i[2]=n,i[3]=e,i[4]=l,i[5]=u):(l=i[4],u=i[5]),(0,o.useEffect)(l,u),s}function d(){let[e,t]=n({threshold:.3,nearestScrollRoot:!0}),r=u(23.8,1100,900,t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i,{eyebrow:`Why it feels different`,children:[`Stop reading paragraphs.`,(0,s.jsx)(`br`,{}),(0,s.jsx)(`em`,{className:`fl-grad`,children:`Start seeing answers.`})]}),(0,s.jsxs)(`div`,{className:`fl-compare`+(t?` sd-play`:``),ref:e,children:[(0,s.jsxs)(`div`,{className:`fl-compare-wall`,children:[(0,s.jsx)(`div`,{className:`fl-compare-label`,children:`The usual answer · a wall of text`}),(0,s.jsx)(`div`,{className:`fl-wall-lines`,children:c.map((e,t)=>(0,s.jsx)(`div`,{className:`fl-wall-line`+(e.data?` data`:``),style:{width:e.w,"--wl-i":String(t)}},t))}),(0,s.jsx)(`div`,{className:`fl-compare-hand`,children:`…still reading?`})]}),(0,s.jsxs)(`div`,{className:`fl-compare-seen`,children:[(0,s.jsx)(`div`,{className:`fl-compare-label accent`,children:`Mavéa · the same answer, seen`}),(0,s.jsxs)(`div`,{className:`fl-seen-stat`,children:[(0,s.jsxs)(`span`,{className:`fl-seen-num`,children:[`$`,r.toFixed(1),`M`]}),(0,s.jsx)(`span`,{className:`fl-seen-delta`,children:`▲ 18%`})]}),(0,s.jsx)(`div`,{className:`fl-seen-cap`,children:`Q3 revenue · best quarter on record`}),(0,s.jsx)(`div`,{className:`fl-seen-bars`,children:l.map((e,t)=>(0,s.jsx)(`div`,{className:`fl-seen-bar`+(e===`100%`?` peak`:``),style:{"--h":e,"--sb-i":String(t)}},t))}),(0,s.jsx)(`div`,{className:`fl-seen-note`,children:`Illustrative numbers`})]})]})]})}export{d as SeeDontRead};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{dt as n,ht as r,ut as i}from"./index-DOpl5xzv.js";var a=r(),o=e(),s=t(),c=[{w:`100%`},{w:`94%`,data:!0},{w:`97%`},{w:`88%`,data:!0},{w:`100%`},{w:`91%`,data:!0},{w:`96%`},{w:`70%`,data:!0},{w:`82%`}],l=[`42%`,`54%`,`48%`,`70%`,`100%`];function u(e,t,n,r){let i=(0,a.c)(6),[s,c]=(0,o.useState)(0),l,u;return i[0]!==r||i[1]!==t||i[2]!==n||i[3]!==e?(l=()=>{if(!r)return;if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||document.documentElement.dataset.perf===`lite`){c(e);return}let i=0,a=0,o=t=>{a||=t;let r=Math.min(1,(t-a)/n);c(e*(1-(1-r)**3)),r<1&&(i=requestAnimationFrame(o))},s=window.setTimeout(()=>{i=requestAnimationFrame(o)},t);return()=>{clearTimeout(s),cancelAnimationFrame(i)}},u=[r,e,t,n],i[0]=r,i[1]=t,i[2]=n,i[3]=e,i[4]=l,i[5]=u):(l=i[4],u=i[5]),(0,o.useEffect)(l,u),s}function d(){let[e,t]=n({threshold:.3,nearestScrollRoot:!0}),r=u(23.8,1100,900,t);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i,{eyebrow:`Why it feels different`,children:[`Stop reading paragraphs.`,(0,s.jsx)(`br`,{}),(0,s.jsx)(`em`,{className:`fl-grad`,children:`Start seeing answers.`})]}),(0,s.jsxs)(`div`,{className:`fl-compare`+(t?` sd-play`:``),ref:e,children:[(0,s.jsxs)(`div`,{className:`fl-compare-wall`,children:[(0,s.jsx)(`div`,{className:`fl-compare-label`,children:`The usual answer · a wall of text`}),(0,s.jsx)(`div`,{className:`fl-wall-lines`,children:c.map((e,t)=>(0,s.jsx)(`div`,{className:`fl-wall-line`+(e.data?` data`:``),style:{width:e.w,"--wl-i":String(t)}},t))}),(0,s.jsx)(`div`,{className:`fl-compare-hand`,children:`…still reading?`})]}),(0,s.jsxs)(`div`,{className:`fl-compare-seen`,children:[(0,s.jsx)(`div`,{className:`fl-compare-label accent`,children:`Mavéa · the same answer, seen`}),(0,s.jsxs)(`div`,{className:`fl-seen-stat`,children:[(0,s.jsxs)(`span`,{className:`fl-seen-num`,children:[`$`,r.toFixed(1),`M`]}),(0,s.jsx)(`span`,{className:`fl-seen-delta`,children:`▲ 18%`})]}),(0,s.jsx)(`div`,{className:`fl-seen-cap`,children:`Q3 revenue · best quarter on record`}),(0,s.jsx)(`div`,{className:`fl-seen-bars`,children:l.map((e,t)=>(0,s.jsx)(`div`,{className:`fl-seen-bar`+(e===`100%`?` peak`:``),style:{"--h":e,"--sb-i":String(t)}},t))}),(0,s.jsx)(`div`,{className:`fl-seen-note`,children:`Illustrative numbers`})]})]})]})}export{d as SeeDontRead};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/src-B-t8Mww-.js","assets/chunk-BVpWp9h4.js","assets/__vite-browser-external-BufR4LQa.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{J as r,L as i,c as a,ht as o,q as s}from"./index-CWqRe4-B.js";import{n as c}from"./icons-CHVz6kv_.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{C as u,r as d,x as f}from"./kokoro-B-3GqktX.js";import{n as p,r as m}from"./spokenText-D4zPX9JY.js";import{n as h,t as g}from"./share-QHGHNDhQ.js";import{t as _}from"./toast-BBNs2h3L.js";import{C as v,D as y,E as b,T as x,a as S,i as C,n as w,o as T,r as E,s as ee,t as D,w as O}from"./registry-_T6pLDPG.js";import{t as k}from"./ReelJelly-Dg3XGB0c.js";import{t as A}from"./threads-CkMgrSDP.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";var j=t(),M=24e3,N=.15,P=.18,F=240,ne=.008,I=.89,L=6;async function R(e,t,n){let r=f(e).trim().slice(0,F);if(!r)return new Float32Array;for(let e=0;e<2;e++)try{let e=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:r,voice:t,response_format:`pcm`,speed:1}),signal:n});if(e.ok)return u(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(n?.aborted)return new Float32Array}return new Float32Array}async function re(e,t){let n=e.slides,r=n.map(e=>Math.max(800,Math.round(e.durationMs))),i=a();if(!i||typeof OfflineAudioContext>`u`)return{buffer:null,timings:r,missing:0};let o=d(`mavea`),s=await Promise.all(n.map(e=>R(e.voiceover,o,t))),c=n.filter(e=>e.voiceover.trim()).length,l=s.filter(e=>e.length>0).length,u=Math.max(0,c-l);if(l===0)return{buffer:null,timings:r,missing:u};let f=n.map((e,t)=>{let n=s[t].length/M*1e3;return Math.round(n>0?Math.max(r[t],n+P*1e3):r[t])}),p=0;for(let e of s)for(let t=0;t<e.length;t++)p=Math.max(p,Math.abs(e[t]));let m=p>0?Math.min(L,I/p):1,h=i.sampleRate,g=.65+f.reduce((e,t)=>e+t/1e3,0),_=new OfflineAudioContext(1,Math.ceil(g*h),h),v=_.createGain();v.gain.value=m,v.connect(_.destination);let y=N;return f.forEach((e,t)=>{let n=s[t];if(n.length){let e=_.createBuffer(1,n.length,M);e.getChannelData(0).set(n);let t=_.createBufferSource();t.buffer=e;let r=_.createGain(),i=n.length/M,a=Math.min(ne,i/2);r.gain.setValueAtTime(0,y),r.gain.linearRampToValueAtTime(1,y+a),r.gain.setValueAtTime(1,y+i-a),r.gain.linearRampToValueAtTime(0,y+i),t.connect(r).connect(v),t.start(y)}y+=e/1e3}),{buffer:await _.startRendering(),timings:f,missing:u}}function z(e){let t=a();if(!t||typeof t.createMediaStreamDestination!=`function`)return null;let n=t.createMediaStreamDestination(),r=t.createBufferSource();r.buffer=e,r.connect(n);let i=!1;return{stream:n.stream,start(){i||(i=!0,t.state!==`running`&&t.resume().catch(()=>{}),r.start())},stop(){try{r.stop()}catch{}try{r.disconnect()}catch{}}}}function B(e,t,n){return t+Math.max(0,n-e)}function V(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function ie(e){let t=a();if(!t)return null;let n=t.createGain();n.connect(t.destination);let r=null,i=0,o=0,s=!1,c=()=>{try{r?.stop(),r?.disconnect()}catch{}r=null},l=a=>{c(),r=t.createBufferSource(),r.buffer=e,r.connect(n),r.start(0,a),i=a,o=t.currentTime,s=!1};return{play(){t.state!==`running`&&t.resume().catch(()=>{}),l(0)},setMuted(e){n.gain.value=+!e},pause(){s||!r||(i=Math.min(e.duration,B(o,i,t.currentTime)),c(),s=!0)},resume(){if(!s)return;s=!1;let n=V(i,e.duration);n!==null&&(t.state!==`running`&&t.resume().catch(()=>{}),l(n))},stop(){c();try{n.disconnect()}catch{}}}}r();var H={balanced:{fps:30,bitrate:6e6},high:{fps:30,bitrate:1e7},ultra:{fps:60,bitrate:16e6}};function ae(e){let{fps:t,bitrate:n}=H[e];return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function U(){try{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}=await s(async()=>{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}=await import(`./src-B-t8Mww-.js`);return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}}catch{return null}}async function W(){try{return await s(()=>import(`./dist-xRGLOZwv.js`),[])}catch{return null}}var G={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function oe(){if(typeof document>`u`)return!1;let e=typeof MediaRecorder<`u`,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function se(e){let t=H[e.quality??`high`],n=e.fps??t.fps,{w:r,h:i}=G[e.aspect],a=await W();if(!a)throw Error(`rasterizer-unavailable`);let o=e.el.clientWidth||r,s=Math.min(3,Math.max(1,r/o)),c=0,l=0,u=document.createElement(`canvas`);u.width=r,u.height=i;let d=u.getContext(`2d`,{alpha:!1});d.fillStyle=`#05070c`,d.fillRect(0,0,r,i);let f=document.createElement(`canvas`);f.width=Math.round(r/2),f.height=Math.round(i/2);let p=f.getContext(`2d`),m=!1,h=()=>{p&&(p.drawImage(u,0,0,f.width,f.height),m=!0)},g=()=>new Blob([],{type:`image/png`}),_=async()=>(!m&&c>0&&h(),m?await new Promise(e=>f.toBlob(e,`image/png`))??g():g()),v=async()=>{let t;try{t=await a.domToCanvas(e.el,{scale:s,backgroundColor:`#05070c`})}catch{l++;return}if(!t.width||!t.height){l++;return}l=0,c++;let n=Math.max(r/t.width,i/t.height),o=t.width*n,u=t.height*n;d.fillStyle=`#05070c`,d.fillRect(0,0,r,i),d.drawImage(t,(r-o)/2,(i-u)/2,o,u)},y=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await U():null;if(y&&await y.canEncodeVideo(`avc`).catch(()=>!1)&&y){let r=new y.Output({format:new y.Mp4OutputFormat,target:new y.BufferTarget}),i=new y.CanvasSource(u,{codec:`avc`,bitrate:t.bitrate});r.addVideoTrack(i);let a=null;if(e.audioBuffer){let t=new y.AudioBufferSource({codec:`aac`,bitrate:192e3});r.addAudioTrack(t);let n=e.audioBuffer;a=async()=>{try{await t.add(n),t.close()}catch{}}}await r.start(),a?.();let o=!0,s=!0,d=performance.now(),p=0,g=1e3/n,b=e.maxDurationMs??1/0;(async()=>{for(;o;){let e=performance.now();if(await v(),!o)break;let t=s?0:(performance.now()-d)/1e3;s=!1;try{await i.add(t,Math.max(1/n,t-p))}catch{break}if(p=t,t*1e3>=b)break;!m&&t>1.2&&c>2&&l===0&&h();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,g-r)))}})();let x=()=>{o=!1,u.width=u.height=0,f.width=f.height=0};return{async stop(){o=!1;let t=await _();await r.finalize();let n=r.target.buffer;return x(),{blob:new Blob([n??new ArrayBuffer(0)],{type:`video/mp4`}),type:`video/mp4`,poster:t,hasAudio:!!e.audioBuffer,durationMs:Math.round(performance.now()-d)}},cancel(){o=!1,r.cancel?.(),x()}}}let b=u.captureStream(n),x=new MediaStream(b.getVideoTracks()),S=e.audioBuffer?z(e.audioBuffer):null,C=S?.stream.getAudioTracks()[0]??null;C&&x.addTrack(C);let w=MediaRecorder.isTypeSupported(`video/webm;codecs=vp9,opus`)?`video/webm;codecs=vp9,opus`:`video/webm`,T=new MediaRecorder(x,{mimeType:w,videoBitsPerSecond:t.bitrate}),E=[];T.ondataavailable=e=>e.data.size&&E.push(e.data);let ee=new Promise(e=>{T.addEventListener(`stop`,()=>e(),{once:!0})}),D=()=>{try{T.state!==`inactive`&&T.stop()}catch{}};T.start(),S?.start();let O=!0,k=performance.now(),A=e.maxDurationMs??1/0,te=1e3/n;(async()=>{for(;O;){let e=performance.now();await v();let t=performance.now()-k;if(t>=A){D();break}!m&&t>1200&&c>2&&l===0&&h();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,te-n)))}})();let j=()=>{O=!1;for(let e of x.getTracks())e.stop();S?.stop(),u.width=u.height=0,f.width=f.height=0};return{async stop(){O=!1;let e=await _();D(),await ee;let t=new Blob(E,{type:w}),n=Math.round(performance.now()-k);return j(),{blob:t,type:w,poster:e,hasAudio:!!C,durationMs:n}},cancel(){O=!1,D(),j()}}}var K=n();function q({slide:e}){"use no memo";let t=T(e);return(0,K.jsx)(t.Slide,{slots:t.slots})}var ce=o(),le=(0,j.createContext)(0),J=new Set([`hidden`,`clip`,`auto`,`scroll`]);function ue(e){let t=(0,ce.c)(11),{children:n}=e,r=(0,j.useRef)(null),i=(0,j.useRef)(null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={k:1,x:0,y:0},t[0]=a):a=t[0];let[o,s]=(0,j.useState)(a),c=(0,j.useContext)(le),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=r.current,t=i.current;if(!e||!t)return;let n=()=>{let n=e.clientHeight,r=e.clientWidth;if(!n||!r)return;let i=t.style.transform;t.style.transform=`none`,t.style.left=`0`,t.style.top=`0`;let a=[],o=[...t.querySelectorAll(`*`)],c=new Set;for(let e of t.querySelectorAll(`[data-reel-marquee]`)){for(let n=e;n&&n!==t;n=n.parentElement)c.add(n);for(let t of e.querySelectorAll(`*`))c.add(t)}let l=new Set,u=[];for(let e of o){if(c.has(e))continue;let t=getComputedStyle(e);if(t.webkitLineClamp!==`none`){l.add(e);continue}!J.has(t.overflowX)&&!J.has(t.overflowY)||u.push(e)}for(let e of u)a.push({el:e,o:e.style.overflow,m:e.style.maxHeight}),e.style.overflow=`visible`,e.style.maxHeight=`none`;let d=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(l.has(n))return!0;return!1},f=e=>{let n=0,r=0;for(let i=e;i&&i!==t&&t.contains(i);i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{x:n,y:r}},p=t.scrollWidth,m=t.scrollHeight;for(let e of o)if(!c.has(e)&&!d(e)){if(e.scrollWidth>p&&(p=e.scrollWidth),e.scrollHeight>m&&(m=e.scrollHeight),e.scrollWidth>e.clientWidth+1){let t=f(e);t.x+e.scrollWidth>p&&(p=t.x+e.scrollWidth)}if(e.scrollHeight>e.clientHeight+1){let t=f(e);t.y+e.scrollHeight>m&&(m=t.y+e.scrollHeight)}}for(let e of l){let t=f(e);t.x+e.clientWidth>p&&(p=t.x+e.clientWidth),t.y+e.clientHeight>m&&(m=t.y+e.clientHeight)}for(let e of a)e.el.style.overflow=e.o,e.el.style.maxHeight=e.m;if(t.style.transform=i,!m||!p)return;let h=Math.min(1,n*.95/m,r*.92/p),g=Number.isFinite(h)&&h>0?Math.floor(h*1e3)/1e3:1,_=t.firstElementChild,v=_?.offsetWidth||p,y=_?f(_).x:0,b=Math.max(0,(r-v*g)/2-y*g),x=Math.max(0,(n-m*g)/2);s(e=>Math.abs(e.k-g)>.002||Math.abs(e.x-b)>.5||Math.abs(e.y-x)>.5?{k:g,x:b,y:x}:e)};n();let a=!1,o=0;typeof document<`u`&&document.fonts?.ready&&document.fonts.ready.then(()=>{a||(o=requestAnimationFrame(n))});let c=requestAnimationFrame(n),l=0,u=new ResizeObserver(()=>{cancelAnimationFrame(l),l=requestAnimationFrame(n)});return u.observe(e),u.observe(t),()=>{a=!0,u.disconnect(),cancelAnimationFrame(l),cancelAnimationFrame(c),cancelAnimationFrame(o)}},t[1]=l):l=t[1];let u;t[2]!==n||t[3]!==c?(u=[n,c],t[2]=n,t[3]=c,t[4]=u):u=t[4],(0,j.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={position:`absolute`,inset:0,overflow:`hidden`},t[5]=d):d=t[5];let f=`translate(${o.x}px, ${o.y}px) scale(${o.k})`,p;t[6]===f?p=t[7]:(p={position:`absolute`,left:0,top:0,transformOrigin:`top left`,transform:f},t[6]=f,t[7]=p);let m;return t[8]!==n||t[9]!==p?(m=(0,K.jsx)(`div`,{ref:r,style:d,children:(0,K.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var de=[`up`,`left`,`zoom`,`wipe`,`fade`];function fe(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function pe(e){let t=e.clientWidth,n=e.clientHeight;if(!t||!n)return!1;let r=Math.min(t,n)/100,i=r*16/9,a=fe(t,n),o=`${r}px`,s=e.style.getPropertyValue(`--rw`)!==o||e.dataset.aspect!==a;return e.style.setProperty(`--ru`,`${i}px`),e.style.setProperty(`--rw`,o),e.dataset.aspect=a,s}var Y=e=>e.template!==`title`&&e.template!==`outro`,me=e=>e.template===`outro`,X=e=>e.template===`title`;function he(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)Y(e[r])&&n++;return n}function ge(e,t){let n=e[t];return n&&Y(n)?he(e,t):-1}function _e({script:e,timings:t,loop:n=!1,onDone:r,frameRef:i,playKey:a=0,playing:o=!0,initialIndex:s=0,onCycle:c,interactive:l=!1,paused:u,onPausedChange:d}){let f=e.slides,p=f.map((e,n)=>Math.max(800,Math.round(t?.[n]??e.durationMs))),m=Math.max(0,Math.min(s,f.length-1)),[h,g]=(0,j.useState)(m),[_,v]=(0,j.useState)(0),y=u!==void 0,[b,x]=(0,j.useState)(!1),S=y?u:b,w=(0,j.useCallback)(()=>{y?d?.(!S):x(e=>!e)},[y,S,d]),[T,ee]=(0,j.useState)(0),D=(0,j.useRef)(!1),O=(0,j.useRef)(null),A=(0,j.useRef)(null),te=(0,j.useRef)(i);te.current=i;let M=(0,j.useCallback)(e=>{A.current=e,te.current?.(e)},[]);(0,j.useEffect)(()=>{l&&A.current?.focus({preventScroll:!0})},[l]);let N=(0,j.useRef)(!1);N.current=S;let P=(0,j.useRef)(null),F=(0,j.useRef)(0),ne=(0,j.useCallback)(e=>{O.current=e,e&&pe(e)&&ee(e=>e+1)},[]);if((0,j.useLayoutEffect)(()=>{let e=O.current;if(!e)return;let t=new ResizeObserver(()=>{pe(e)&&ee(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,j.useEffect)(()=>{o&&(D.current=!1,g(m),v(e=>e+1))},[a,o]),(0,j.useEffect)(()=>{if(!o||S||h>=f.length)return;let e=P.current??p[h];P.current=null,F.current=Date.now();let t=window.setTimeout(()=>{h+1<f.length?g(h+1):n?(g(0),v(e=>e+1),c?.()):D.current||(D.current=!0,r?.())},e);return()=>{window.clearTimeout(t),N.current&&(P.current=Math.max(0,e-(Date.now()-F.current)))}},[h,f.length,n,r,a,o,S]),(0,j.useEffect)(()=>{P.current=null},[h]),!f.length)return null;let I=f[Math.min(h,f.length-1)],L=he(f,h),R=ge(f,h),re=f.filter(Y).length,z=e=>{let t=-1;for(let n=0;n<f.length;n++)if(Y(f[n])&&t++,t===e){g(n),v(e=>e+1);return}},B=e=>{if(!re)return;let t=Y(I)?R+e:e>0?L:L-1;z(Math.max(0,Math.min(re-1,t)))},V=f.reduce((e,t,n)=>(X(t)&&e.push(n),e),[]),ie=e=>{if(V.length<=1)return;let t=V.filter(e=>e<=h).length-1;g(V[Math.max(0,Math.min(V.length-1,t+e))]),v(e=>e+1)},H=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),B(1);break;case`ArrowLeft`:e.preventDefault(),B(-1);break;case`ArrowDown`:e.preventDefault(),ie(1);break;case`ArrowUp`:e.preventDefault(),ie(-1);break;case` `:case`Spacebar`:e.preventDefault(),w();break;default:break}},ae=C(I.template)===`dark`,U=E(I.template),W=h===0?`fade`:de[(h+e.seed)%de.length];return(0,K.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:M,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?H:void 0,"aria-label":l?`Reel preview. Left and right arrows step between beats, up and down jump sections, space bar pauses.`:void 0,children:(0,K.jsxs)(`div`,{className:`reel-board`,ref:ne,"data-surface":ae?`dark`:`light`,"data-bleed":U?`true`:`false`,children:[ae&&(0,K.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,K.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:re},(e,t)=>{let n=t===R,r=t<L||me(I),i=(0,K.jsx)(`span`,{className:`reel-seg`,children:(0,K.jsx)(`i`,{style:n?{width:0,animation:`reel-seg-fill ${p[h]}ms linear forwards`,animationPlayState:S?`paused`:`running`}:{width:r?`100%`:`0%`}})},`seg`);return l?(0,K.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>z(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,K.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,K.jsxs)(`div`,{className:`reel-top`,children:[(0,K.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,K.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,K.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!U&&(0,K.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,K.jsx)(k,{})}),(0,K.jsx)(`div`,{className:`reel-stage`,children:(0,K.jsx)(`div`,{className:`reel-trans`,"data-trans":W,children:(0,K.jsx)(le.Provider,{value:T,children:(0,K.jsx)(ue,{children:(0,K.jsx)(q,{slide:I})})})},`${_}-${h}`)}),(0,K.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&S,"aria-hidden":`true`,children:(0,K.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,K.jsx)(`span`,{}),(0,K.jsx)(`span`,{})]})})]})})}function ve(e){let t=[],n=A(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var ye=/^(how|what|why|should|can|could|would|will|plan|show|make|build|tell|give|explain|who|when|where|which|is|are|do|does|did|help|me)\b[\s,]*/i,be=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function xe(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return y(n,b.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(ye,``).replace(/[?!.]+$/,``).trim(),a=(i.split(be)[0]||``).trim()||i;return a?y(a.charAt(0).toUpperCase()+a.slice(1),b.heading):``}r();var Se={palette:`aurora`,vibe:`clean`,maxSlides:6};function Z(e){return y(e[0]?.question||e[0]?.spec?.title||`Mavéa`,b.title)}function Q(e){return e[0]?.spec?.topic||e[0]?.spec?.title||Z(e)}function Ce(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function we(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function Te(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var Ee=0;function De(e,t,n,r,i){let a=y(m(r.voiceover),b.voiceover);return{id:`s${Ee++}`,content:e,template:t,slots:w(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function Oe(e,t,n,r,i,a){return De(e,D(e,i,a,S(e,t)),t,n,r)}function ke(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function Ae(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function je(e,t,n,r){let i=Z(e.frames);return De(`title`,`title`,{question:i,kicker:e.heading||xe(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:x.intro},r)}function Me(e,t,n){let r=e.flatMap(e=>e.frames),i=Z(r),a=Q(r),o=[];e.forEach((t,n)=>{let r={topic:Q(t.frames),question:Z(t.frames)};o.push(je(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(De(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:x.outro},s)),{topic:a,question:i,palette:t.palette,vibe:t.vibe,seed:n,slides:o,durationMs:o.reduce((e,t)=>e+t.durationMs,0)}}function Ne(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:D(e.content,t,n,S(e.content,e.slots),e.template)})}}function Pe(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:p((e.note||``).trim()),spoken:m((e.noteSpoken||e.note||``).trim())})).filter(e=>e.shown.length>8),i=r.map(e=>e.shown),a=r.map(e=>e.spoken||e.shown),o=[];if(e.forEach((e,t)=>{let n=we(e),r=Ce(Te(e)),s=Ce(p(n));s.length&&o.push({speaksFor:t,covers:!0,content:`quote`,raw:{quote:s[0]},voiceover:r.slice(0,2).join(` `)}),t===0&&i.length>=2&&o.push({speaksFor:t,covers:!1,content:`list`,raw:{items:i.slice(0,4)},voiceover:a.slice(0,3).join(`. `)})}),!o.length){let e=t.question;o.push({speaksFor:0,covers:!0,content:`quote`,raw:{quote:e},voiceover:e})}let s=new Set;for(let e of[!0,!1])for(let t of o){if(s.size>=n)break;t.covers===e&&!s.has(t)&&s.add(t)}return o.filter(e=>s.has(e)).map((e,n)=>Oe(e.content,e.raw,{voiceover:e.voiceover,ms:x.default},t,0,n+1))}function Fe(e,t){let n=ve(e);return n.slice(-ke(t,n.length))}function Ie(e,t={}){let n={...Se,...t},r=Fe(e,n.maxSlides);return Me(r.map((e,t)=>({frames:e,content:Pe(e,{topic:Q(e),question:Z(e)},Ae(n.maxSlides,r.length,t))})),n,0)}var $=v,Le=`You are Mavéa's reel director. You recut a finished conversation into a short, vertical (9:16) social video — a sequence of card "beats" for TikTok/Reels/Shorts. Each beat is ONE card with very little room.
2
+ import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{J as r,L as i,c as a,ht as o,q as s}from"./index-DOpl5xzv.js";import{n as c}from"./icons-CHVz6kv_.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{C as u,r as d,x as f}from"./kokoro-B-MNB16v.js";import{n as p,r as m}from"./spokenText-D4zPX9JY.js";import{n as h,t as g}from"./share-QHGHNDhQ.js";import{t as _}from"./toast-BBNs2h3L.js";import{C as v,D as y,E as b,T as x,a as S,i as C,n as w,o as T,r as E,s as ee,t as D,w as O}from"./registry-BnSnMnyk.js";import{t as k}from"./ReelJelly-B2JQsaRI.js";import{t as A}from"./threads-CkMgrSDP.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";var j=t(),M=24e3,N=.15,P=.18,F=240,ne=.008,I=.89,L=6;async function R(e,t,n){let r=f(e).trim().slice(0,F);if(!r)return new Float32Array;for(let e=0;e<2;e++)try{let e=await fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:r,voice:t,response_format:`pcm`,speed:1}),signal:n});if(e.ok)return u(new Uint8Array(await e.arrayBuffer()),null).samples}catch{if(n?.aborted)return new Float32Array}return new Float32Array}async function re(e,t){let n=e.slides,r=n.map(e=>Math.max(800,Math.round(e.durationMs))),i=a();if(!i||typeof OfflineAudioContext>`u`)return{buffer:null,timings:r,missing:0};let o=d(`mavea`),s=await Promise.all(n.map(e=>R(e.voiceover,o,t))),c=n.filter(e=>e.voiceover.trim()).length,l=s.filter(e=>e.length>0).length,u=Math.max(0,c-l);if(l===0)return{buffer:null,timings:r,missing:u};let f=n.map((e,t)=>{let n=s[t].length/M*1e3;return Math.round(n>0?Math.max(r[t],n+P*1e3):r[t])}),p=0;for(let e of s)for(let t=0;t<e.length;t++)p=Math.max(p,Math.abs(e[t]));let m=p>0?Math.min(L,I/p):1,h=i.sampleRate,g=.65+f.reduce((e,t)=>e+t/1e3,0),_=new OfflineAudioContext(1,Math.ceil(g*h),h),v=_.createGain();v.gain.value=m,v.connect(_.destination);let y=N;return f.forEach((e,t)=>{let n=s[t];if(n.length){let e=_.createBuffer(1,n.length,M);e.getChannelData(0).set(n);let t=_.createBufferSource();t.buffer=e;let r=_.createGain(),i=n.length/M,a=Math.min(ne,i/2);r.gain.setValueAtTime(0,y),r.gain.linearRampToValueAtTime(1,y+a),r.gain.setValueAtTime(1,y+i-a),r.gain.linearRampToValueAtTime(0,y+i),t.connect(r).connect(v),t.start(y)}y+=e/1e3}),{buffer:await _.startRendering(),timings:f,missing:u}}function z(e){let t=a();if(!t||typeof t.createMediaStreamDestination!=`function`)return null;let n=t.createMediaStreamDestination(),r=t.createBufferSource();r.buffer=e,r.connect(n);let i=!1;return{stream:n.stream,start(){i||(i=!0,t.state!==`running`&&t.resume().catch(()=>{}),r.start())},stop(){try{r.stop()}catch{}try{r.disconnect()}catch{}}}}function B(e,t,n){return t+Math.max(0,n-e)}function V(e,t){return!Number.isFinite(t)||t<=0||e>=t?null:Math.max(0,e)}function ie(e){let t=a();if(!t)return null;let n=t.createGain();n.connect(t.destination);let r=null,i=0,o=0,s=!1,c=()=>{try{r?.stop(),r?.disconnect()}catch{}r=null},l=a=>{c(),r=t.createBufferSource(),r.buffer=e,r.connect(n),r.start(0,a),i=a,o=t.currentTime,s=!1};return{play(){t.state!==`running`&&t.resume().catch(()=>{}),l(0)},setMuted(e){n.gain.value=+!e},pause(){s||!r||(i=Math.min(e.duration,B(o,i,t.currentTime)),c(),s=!0)},resume(){if(!s)return;s=!1;let n=V(i,e.duration);n!==null&&(t.state!==`running`&&t.resume().catch(()=>{}),l(n))},stop(){c();try{n.disconnect()}catch{}}}}r();var H={balanced:{fps:30,bitrate:6e6},high:{fps:30,bitrate:1e7},ultra:{fps:60,bitrate:16e6}};function ae(e){let{fps:t,bitrate:n}=H[e];return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function U(){try{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}=await s(async()=>{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}=await import(`./src-B-t8Mww-.js`);return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,AudioBufferSource:i,canEncodeVideo:a}}catch{return null}}async function W(){try{return await s(()=>import(`./dist-xRGLOZwv.js`),[])}catch{return null}}var G={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function oe(){if(typeof document>`u`)return!1;let e=typeof MediaRecorder<`u`,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function se(e){let t=H[e.quality??`high`],n=e.fps??t.fps,{w:r,h:i}=G[e.aspect],a=await W();if(!a)throw Error(`rasterizer-unavailable`);let o=e.el.clientWidth||r,s=Math.min(3,Math.max(1,r/o)),c=0,l=0,u=document.createElement(`canvas`);u.width=r,u.height=i;let d=u.getContext(`2d`,{alpha:!1});d.fillStyle=`#05070c`,d.fillRect(0,0,r,i);let f=document.createElement(`canvas`);f.width=Math.round(r/2),f.height=Math.round(i/2);let p=f.getContext(`2d`),m=!1,h=()=>{p&&(p.drawImage(u,0,0,f.width,f.height),m=!0)},g=()=>new Blob([],{type:`image/png`}),_=async()=>(!m&&c>0&&h(),m?await new Promise(e=>f.toBlob(e,`image/png`))??g():g()),v=async()=>{let t;try{t=await a.domToCanvas(e.el,{scale:s,backgroundColor:`#05070c`})}catch{l++;return}if(!t.width||!t.height){l++;return}l=0,c++;let n=Math.max(r/t.width,i/t.height),o=t.width*n,u=t.height*n;d.fillStyle=`#05070c`,d.fillRect(0,0,r,i),d.drawImage(t,(r-o)/2,(i-u)/2,o,u)},y=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await U():null;if(y&&await y.canEncodeVideo(`avc`).catch(()=>!1)&&y){let r=new y.Output({format:new y.Mp4OutputFormat,target:new y.BufferTarget}),i=new y.CanvasSource(u,{codec:`avc`,bitrate:t.bitrate});r.addVideoTrack(i);let a=null;if(e.audioBuffer){let t=new y.AudioBufferSource({codec:`aac`,bitrate:192e3});r.addAudioTrack(t);let n=e.audioBuffer;a=async()=>{try{await t.add(n),t.close()}catch{}}}await r.start(),a?.();let o=!0,s=!0,d=performance.now(),p=0,g=1e3/n,b=e.maxDurationMs??1/0;(async()=>{for(;o;){let e=performance.now();if(await v(),!o)break;let t=s?0:(performance.now()-d)/1e3;s=!1;try{await i.add(t,Math.max(1/n,t-p))}catch{break}if(p=t,t*1e3>=b)break;!m&&t>1.2&&c>2&&l===0&&h();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,g-r)))}})();let x=()=>{o=!1,u.width=u.height=0,f.width=f.height=0};return{async stop(){o=!1;let t=await _();await r.finalize();let n=r.target.buffer;return x(),{blob:new Blob([n??new ArrayBuffer(0)],{type:`video/mp4`}),type:`video/mp4`,poster:t,hasAudio:!!e.audioBuffer,durationMs:Math.round(performance.now()-d)}},cancel(){o=!1,r.cancel?.(),x()}}}let b=u.captureStream(n),x=new MediaStream(b.getVideoTracks()),S=e.audioBuffer?z(e.audioBuffer):null,C=S?.stream.getAudioTracks()[0]??null;C&&x.addTrack(C);let w=MediaRecorder.isTypeSupported(`video/webm;codecs=vp9,opus`)?`video/webm;codecs=vp9,opus`:`video/webm`,T=new MediaRecorder(x,{mimeType:w,videoBitsPerSecond:t.bitrate}),E=[];T.ondataavailable=e=>e.data.size&&E.push(e.data);let ee=new Promise(e=>{T.addEventListener(`stop`,()=>e(),{once:!0})}),D=()=>{try{T.state!==`inactive`&&T.stop()}catch{}};T.start(),S?.start();let O=!0,k=performance.now(),A=e.maxDurationMs??1/0,te=1e3/n;(async()=>{for(;O;){let e=performance.now();await v();let t=performance.now()-k;if(t>=A){D();break}!m&&t>1200&&c>2&&l===0&&h();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,te-n)))}})();let j=()=>{O=!1;for(let e of x.getTracks())e.stop();S?.stop(),u.width=u.height=0,f.width=f.height=0};return{async stop(){O=!1;let e=await _();D(),await ee;let t=new Blob(E,{type:w}),n=Math.round(performance.now()-k);return j(),{blob:t,type:w,poster:e,hasAudio:!!C,durationMs:n}},cancel(){O=!1,D(),j()}}}var K=n();function q({slide:e}){"use no memo";let t=T(e);return(0,K.jsx)(t.Slide,{slots:t.slots})}var ce=o(),le=(0,j.createContext)(0),J=new Set([`hidden`,`clip`,`auto`,`scroll`]);function ue(e){let t=(0,ce.c)(11),{children:n}=e,r=(0,j.useRef)(null),i=(0,j.useRef)(null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={k:1,x:0,y:0},t[0]=a):a=t[0];let[o,s]=(0,j.useState)(a),c=(0,j.useContext)(le),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=r.current,t=i.current;if(!e||!t)return;let n=()=>{let n=e.clientHeight,r=e.clientWidth;if(!n||!r)return;let i=t.style.transform;t.style.transform=`none`,t.style.left=`0`,t.style.top=`0`;let a=[],o=[...t.querySelectorAll(`*`)],c=new Set;for(let e of t.querySelectorAll(`[data-reel-marquee]`)){for(let n=e;n&&n!==t;n=n.parentElement)c.add(n);for(let t of e.querySelectorAll(`*`))c.add(t)}let l=new Set,u=[];for(let e of o){if(c.has(e))continue;let t=getComputedStyle(e);if(t.webkitLineClamp!==`none`){l.add(e);continue}!J.has(t.overflowX)&&!J.has(t.overflowY)||u.push(e)}for(let e of u)a.push({el:e,o:e.style.overflow,m:e.style.maxHeight}),e.style.overflow=`visible`,e.style.maxHeight=`none`;let d=e=>{for(let n=e;n&&n!==t;n=n.parentElement)if(l.has(n))return!0;return!1},f=e=>{let n=0,r=0;for(let i=e;i&&i!==t&&t.contains(i);i=i.offsetParent)n+=i.offsetLeft,r+=i.offsetTop;return{x:n,y:r}},p=t.scrollWidth,m=t.scrollHeight;for(let e of o)if(!c.has(e)&&!d(e)){if(e.scrollWidth>p&&(p=e.scrollWidth),e.scrollHeight>m&&(m=e.scrollHeight),e.scrollWidth>e.clientWidth+1){let t=f(e);t.x+e.scrollWidth>p&&(p=t.x+e.scrollWidth)}if(e.scrollHeight>e.clientHeight+1){let t=f(e);t.y+e.scrollHeight>m&&(m=t.y+e.scrollHeight)}}for(let e of l){let t=f(e);t.x+e.clientWidth>p&&(p=t.x+e.clientWidth),t.y+e.clientHeight>m&&(m=t.y+e.clientHeight)}for(let e of a)e.el.style.overflow=e.o,e.el.style.maxHeight=e.m;if(t.style.transform=i,!m||!p)return;let h=Math.min(1,n*.95/m,r*.92/p),g=Number.isFinite(h)&&h>0?Math.floor(h*1e3)/1e3:1,_=t.firstElementChild,v=_?.offsetWidth||p,y=_?f(_).x:0,b=Math.max(0,(r-v*g)/2-y*g),x=Math.max(0,(n-m*g)/2);s(e=>Math.abs(e.k-g)>.002||Math.abs(e.x-b)>.5||Math.abs(e.y-x)>.5?{k:g,x:b,y:x}:e)};n();let a=!1,o=0;typeof document<`u`&&document.fonts?.ready&&document.fonts.ready.then(()=>{a||(o=requestAnimationFrame(n))});let c=requestAnimationFrame(n),l=0,u=new ResizeObserver(()=>{cancelAnimationFrame(l),l=requestAnimationFrame(n)});return u.observe(e),u.observe(t),()=>{a=!0,u.disconnect(),cancelAnimationFrame(l),cancelAnimationFrame(c),cancelAnimationFrame(o)}},t[1]=l):l=t[1];let u;t[2]!==n||t[3]!==c?(u=[n,c],t[2]=n,t[3]=c,t[4]=u):u=t[4],(0,j.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={position:`absolute`,inset:0,overflow:`hidden`},t[5]=d):d=t[5];let f=`translate(${o.x}px, ${o.y}px) scale(${o.k})`,p;t[6]===f?p=t[7]:(p={position:`absolute`,left:0,top:0,transformOrigin:`top left`,transform:f},t[6]=f,t[7]=p);let m;return t[8]!==n||t[9]!==p?(m=(0,K.jsx)(`div`,{ref:r,style:d,children:(0,K.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var de=[`up`,`left`,`zoom`,`wipe`,`fade`];function fe(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function pe(e){let t=e.clientWidth,n=e.clientHeight;if(!t||!n)return!1;let r=Math.min(t,n)/100,i=r*16/9,a=fe(t,n),o=`${r}px`,s=e.style.getPropertyValue(`--rw`)!==o||e.dataset.aspect!==a;return e.style.setProperty(`--ru`,`${i}px`),e.style.setProperty(`--rw`,o),e.dataset.aspect=a,s}var Y=e=>e.template!==`title`&&e.template!==`outro`,me=e=>e.template===`outro`,X=e=>e.template===`title`;function he(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)Y(e[r])&&n++;return n}function ge(e,t){let n=e[t];return n&&Y(n)?he(e,t):-1}function _e({script:e,timings:t,loop:n=!1,onDone:r,frameRef:i,playKey:a=0,playing:o=!0,initialIndex:s=0,onCycle:c,interactive:l=!1,paused:u,onPausedChange:d}){let f=e.slides,p=f.map((e,n)=>Math.max(800,Math.round(t?.[n]??e.durationMs))),m=Math.max(0,Math.min(s,f.length-1)),[h,g]=(0,j.useState)(m),[_,v]=(0,j.useState)(0),y=u!==void 0,[b,x]=(0,j.useState)(!1),S=y?u:b,w=(0,j.useCallback)(()=>{y?d?.(!S):x(e=>!e)},[y,S,d]),[T,ee]=(0,j.useState)(0),D=(0,j.useRef)(!1),O=(0,j.useRef)(null),A=(0,j.useRef)(null),te=(0,j.useRef)(i);te.current=i;let M=(0,j.useCallback)(e=>{A.current=e,te.current?.(e)},[]);(0,j.useEffect)(()=>{l&&A.current?.focus({preventScroll:!0})},[l]);let N=(0,j.useRef)(!1);N.current=S;let P=(0,j.useRef)(null),F=(0,j.useRef)(0),ne=(0,j.useCallback)(e=>{O.current=e,e&&pe(e)&&ee(e=>e+1)},[]);if((0,j.useLayoutEffect)(()=>{let e=O.current;if(!e)return;let t=new ResizeObserver(()=>{pe(e)&&ee(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,j.useEffect)(()=>{o&&(D.current=!1,g(m),v(e=>e+1))},[a,o]),(0,j.useEffect)(()=>{if(!o||S||h>=f.length)return;let e=P.current??p[h];P.current=null,F.current=Date.now();let t=window.setTimeout(()=>{h+1<f.length?g(h+1):n?(g(0),v(e=>e+1),c?.()):D.current||(D.current=!0,r?.())},e);return()=>{window.clearTimeout(t),N.current&&(P.current=Math.max(0,e-(Date.now()-F.current)))}},[h,f.length,n,r,a,o,S]),(0,j.useEffect)(()=>{P.current=null},[h]),!f.length)return null;let I=f[Math.min(h,f.length-1)],L=he(f,h),R=ge(f,h),re=f.filter(Y).length,z=e=>{let t=-1;for(let n=0;n<f.length;n++)if(Y(f[n])&&t++,t===e){g(n),v(e=>e+1);return}},B=e=>{if(!re)return;let t=Y(I)?R+e:e>0?L:L-1;z(Math.max(0,Math.min(re-1,t)))},V=f.reduce((e,t,n)=>(X(t)&&e.push(n),e),[]),ie=e=>{if(V.length<=1)return;let t=V.filter(e=>e<=h).length-1;g(V[Math.max(0,Math.min(V.length-1,t+e))]),v(e=>e+1)},H=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),B(1);break;case`ArrowLeft`:e.preventDefault(),B(-1);break;case`ArrowDown`:e.preventDefault(),ie(1);break;case`ArrowUp`:e.preventDefault(),ie(-1);break;case` `:case`Spacebar`:e.preventDefault(),w();break;default:break}},ae=C(I.template)===`dark`,U=E(I.template),W=h===0?`fade`:de[(h+e.seed)%de.length];return(0,K.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:M,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?H:void 0,"aria-label":l?`Reel preview. Left and right arrows step between beats, up and down jump sections, space bar pauses.`:void 0,children:(0,K.jsxs)(`div`,{className:`reel-board`,ref:ne,"data-surface":ae?`dark`:`light`,"data-bleed":U?`true`:`false`,children:[ae&&(0,K.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,K.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:re},(e,t)=>{let n=t===R,r=t<L||me(I),i=(0,K.jsx)(`span`,{className:`reel-seg`,children:(0,K.jsx)(`i`,{style:n?{width:0,animation:`reel-seg-fill ${p[h]}ms linear forwards`,animationPlayState:S?`paused`:`running`}:{width:r?`100%`:`0%`}})},`seg`);return l?(0,K.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>z(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,K.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,K.jsxs)(`div`,{className:`reel-top`,children:[(0,K.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,K.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,K.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!U&&(0,K.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,K.jsx)(k,{})}),(0,K.jsx)(`div`,{className:`reel-stage`,children:(0,K.jsx)(`div`,{className:`reel-trans`,"data-trans":W,children:(0,K.jsx)(le.Provider,{value:T,children:(0,K.jsx)(ue,{children:(0,K.jsx)(q,{slide:I})})})},`${_}-${h}`)}),(0,K.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&S,"aria-hidden":`true`,children:(0,K.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,K.jsx)(`span`,{}),(0,K.jsx)(`span`,{})]})})]})})}function ve(e){let t=[],n=A(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var ye=/^(how|what|why|should|can|could|would|will|plan|show|make|build|tell|give|explain|who|when|where|which|is|are|do|does|did|help|me)\b[\s,]*/i,be=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function xe(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return y(n,b.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(ye,``).replace(/[?!.]+$/,``).trim(),a=(i.split(be)[0]||``).trim()||i;return a?y(a.charAt(0).toUpperCase()+a.slice(1),b.heading):``}r();var Se={palette:`aurora`,vibe:`clean`,maxSlides:6};function Z(e){return y(e[0]?.question||e[0]?.spec?.title||`Mavéa`,b.title)}function Q(e){return e[0]?.spec?.topic||e[0]?.spec?.title||Z(e)}function Ce(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function we(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function Te(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var Ee=0;function De(e,t,n,r,i){let a=y(m(r.voiceover),b.voiceover);return{id:`s${Ee++}`,content:e,template:t,slots:w(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function Oe(e,t,n,r,i,a){return De(e,D(e,i,a,S(e,t)),t,n,r)}function ke(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function Ae(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function je(e,t,n,r){let i=Z(e.frames);return De(`title`,`title`,{question:i,kicker:e.heading||xe(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:x.intro},r)}function Me(e,t,n){let r=e.flatMap(e=>e.frames),i=Z(r),a=Q(r),o=[];e.forEach((t,n)=>{let r={topic:Q(t.frames),question:Z(t.frames)};o.push(je(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(De(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:x.outro},s)),{topic:a,question:i,palette:t.palette,vibe:t.vibe,seed:n,slides:o,durationMs:o.reduce((e,t)=>e+t.durationMs,0)}}function Ne(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:D(e.content,t,n,S(e.content,e.slots),e.template)})}}function Pe(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:p((e.note||``).trim()),spoken:m((e.noteSpoken||e.note||``).trim())})).filter(e=>e.shown.length>8),i=r.map(e=>e.shown),a=r.map(e=>e.spoken||e.shown),o=[];if(e.forEach((e,t)=>{let n=we(e),r=Ce(Te(e)),s=Ce(p(n));s.length&&o.push({speaksFor:t,covers:!0,content:`quote`,raw:{quote:s[0]},voiceover:r.slice(0,2).join(` `)}),t===0&&i.length>=2&&o.push({speaksFor:t,covers:!1,content:`list`,raw:{items:i.slice(0,4)},voiceover:a.slice(0,3).join(`. `)})}),!o.length){let e=t.question;o.push({speaksFor:0,covers:!0,content:`quote`,raw:{quote:e},voiceover:e})}let s=new Set;for(let e of[!0,!1])for(let t of o){if(s.size>=n)break;t.covers===e&&!s.has(t)&&s.add(t)}return o.filter(e=>s.has(e)).map((e,n)=>Oe(e.content,e.raw,{voiceover:e.voiceover,ms:x.default},t,0,n+1))}function Fe(e,t){let n=ve(e);return n.slice(-ke(t,n.length))}function Ie(e,t={}){let n={...Se,...t},r=Fe(e,n.maxSlides);return Me(r.map((e,t)=>({frames:e,content:Pe(e,{topic:Q(e),question:Z(e)},Ae(n.maxSlides,r.length,t))})),n,0)}var $=v,Le=`You are Mavéa's reel director. You recut a finished conversation into a short, vertical (9:16) social video — a sequence of card "beats" for TikTok/Reels/Shorts. Each beat is ONE card with very little room.
3
3
 
4
4
  Return ONLY JSON: {"heading": <string>, "slides":[{ "type": <content-type>, "slots": {…}, "voiceover": <string> }]}. Give 3 to 5 content beats (the intro question and the outro are added for you — do NOT include them).
5
5
 
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./colors-D49Req-e.js";var i=e(),a=n(),o=t();function s(e){return e===`P0`?`var(--danger)`:`var(--warning)`}function c(){let e=(0,a.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,o.jsx)(`svg`,{className:`ripple-casc-chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`,children:(0,o.jsx)(`path`,{d:`M5.5 3.5 L10 8 L5.5 12.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}),e[0]=t):t=e[0],t}function l(){let e=(0,a.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,o.jsxs)(`svg`,{className:`ripple-casc-check`,viewBox:`0 0 18 18`,"aria-hidden":`true`,focusable:`false`,children:[(0,o.jsx)(`circle`,{cx:`9`,cy:`9`,r:`8`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`}),(0,o.jsx)(`path`,{d:`M5.5 9.2 L8 11.6 L12.5 6.4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),e[0]=t):t=e[0],t}function u({cascade:e}){return(0,o.jsxs)(`div`,{className:`ripple-casc-row`,children:[(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-trigger`,style:{"--casc-tint":`var(--presence)`},children:[(0,o.jsxs)(`div`,{className:`ripple-casc-eyebrow`,children:[(0,o.jsx)(`span`,{className:`ripple-eyebrow`,children:`Your change`}),e.triggerRef?.ref&&(0,o.jsx)(`code`,{className:`ripple-casc-ref`,children:e.triggerRef.ref})]}),(0,o.jsx)(`p`,{className:`ripple-casc-title`,children:e.trigger})]}),e.hops.map((e,t)=>(0,o.jsxs)(`div`,{className:`ripple-casc-step`,children:[(0,o.jsx)(c,{}),(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-hop`,style:{"--casc-tint":r(e.severity)},children:[(0,o.jsx)(`div`,{className:`ripple-eyebrow ripple-casc-hop-eyebrow`,children:e.context}),(0,o.jsx)(`p`,{className:`ripple-casc-title`,children:e.label})]})]},`${e.context}-${t}`)),(0,o.jsxs)(`div`,{className:`ripple-casc-step`,children:[(0,o.jsx)(c,{}),(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-incident`,children:[(0,o.jsxs)(`div`,{className:`ripple-casc-incident-top`,children:[(0,o.jsx)(`span`,{className:`ripple-casc-sev`,style:{"--casc-sev":s(e.incidentSeverity)},children:e.incidentSeverity}),(0,o.jsx)(`span`,{className:`ripple-eyebrow ripple-casc-incident-label`,children:`Incident`})]}),(0,o.jsx)(`p`,{className:`ripple-casc-incident-text`,children:e.incident})]})]})]})}function d({model:e}){let{cascades:t}=e,[n,r]=(0,i.useState)(()=>new Set),a=e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return t.length===0?(0,o.jsx)(`div`,{className:`ripple-casc-empty`,role:`status`,children:`No cascade found — nothing in this change reaches far enough to page someone.`}):(0,o.jsxs)(`section`,{className:`ripple-casc`,"aria-label":`How one line becomes an incident`,children:[(0,o.jsxs)(`header`,{className:`ripple-casc-intro`,children:[(0,o.jsx)(`div`,{className:`ripple-eyebrow`,children:`The cascade`}),(0,o.jsx)(`p`,{className:`ripple-casc-lede`,children:`Each chain is one line turning into a page — read it left to right, then read how it’s caught.`})]}),t.map((e,t)=>{let r=n.has(t),i=`ripple-casc-${t}`;return(0,o.jsxs)(`div`,{className:`ripple-casc-item`,children:[t>0&&(0,o.jsx)(`div`,{className:`ripple-casc-divider`,"aria-hidden":`true`}),(0,o.jsxs)(`button`,{type:`button`,className:`ripple-casc-bar`,"aria-expanded":!r,"aria-controls":i,onClick:()=>a(t),children:[(0,o.jsx)(`span`,{className:`ripple-casc-bar-sev`,style:{"--casc-sev":s(e.incidentSeverity)},"aria-hidden":`true`,children:e.incidentSeverity}),(0,o.jsxs)(`span`,{className:`ripple-casc-bar-text`,id:i,children:[e.trigger,` `,(0,o.jsx)(`span`,{className:`ripple-casc-bar-arrow`,children:`→`}),` `,(0,o.jsx)(`strong`,{children:e.incident})]}),(0,o.jsx)(`span`,{className:`ripple-casc-bar-toggle`,"aria-hidden":`true`,children:r?`Show chain`:`Hide chain`})]}),!r&&(0,o.jsxs)(`div`,{className:`ripple-casc-detail`,children:[(0,o.jsx)(`div`,{className:`ripple-casc-scroll`,children:(0,o.jsx)(u,{cascade:e})}),(0,o.jsxs)(`p`,{className:`ripple-casc-resolution`,children:[(0,o.jsx)(`span`,{className:`ripple-casc-resolution-icon`,"aria-hidden":`true`,children:(0,o.jsx)(l,{})}),(0,o.jsxs)(`span`,{className:`ripple-casc-resolution-text`,children:[(0,o.jsx)(`strong`,{children:`Caught before merge.`}),` `,e.caughtBeforeMerge]})]})]})]},`${e.trigger}-${t}`)})]})}export{d as ShipCascade};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DOpl5xzv.js";import{t as r}from"./colors-D49Req-e.js";var i=e(),a=n(),o=t();function s(e){return e===`P0`?`var(--danger)`:`var(--warning)`}function c(){let e=(0,a.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,o.jsx)(`svg`,{className:`ripple-casc-chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,focusable:`false`,children:(0,o.jsx)(`path`,{d:`M5.5 3.5 L10 8 L5.5 12.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})}),e[0]=t):t=e[0],t}function l(){let e=(0,a.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,o.jsxs)(`svg`,{className:`ripple-casc-check`,viewBox:`0 0 18 18`,"aria-hidden":`true`,focusable:`false`,children:[(0,o.jsx)(`circle`,{cx:`9`,cy:`9`,r:`8`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`}),(0,o.jsx)(`path`,{d:`M5.5 9.2 L8 11.6 L12.5 6.4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),e[0]=t):t=e[0],t}function u({cascade:e}){return(0,o.jsxs)(`div`,{className:`ripple-casc-row`,children:[(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-trigger`,style:{"--casc-tint":`var(--presence)`},children:[(0,o.jsxs)(`div`,{className:`ripple-casc-eyebrow`,children:[(0,o.jsx)(`span`,{className:`ripple-eyebrow`,children:`Your change`}),e.triggerRef?.ref&&(0,o.jsx)(`code`,{className:`ripple-casc-ref`,children:e.triggerRef.ref})]}),(0,o.jsx)(`p`,{className:`ripple-casc-title`,children:e.trigger})]}),e.hops.map((e,t)=>(0,o.jsxs)(`div`,{className:`ripple-casc-step`,children:[(0,o.jsx)(c,{}),(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-hop`,style:{"--casc-tint":r(e.severity)},children:[(0,o.jsx)(`div`,{className:`ripple-eyebrow ripple-casc-hop-eyebrow`,children:e.context}),(0,o.jsx)(`p`,{className:`ripple-casc-title`,children:e.label})]})]},`${e.context}-${t}`)),(0,o.jsxs)(`div`,{className:`ripple-casc-step`,children:[(0,o.jsx)(c,{}),(0,o.jsxs)(`article`,{className:`ripple-casc-card ripple-casc-incident`,children:[(0,o.jsxs)(`div`,{className:`ripple-casc-incident-top`,children:[(0,o.jsx)(`span`,{className:`ripple-casc-sev`,style:{"--casc-sev":s(e.incidentSeverity)},children:e.incidentSeverity}),(0,o.jsx)(`span`,{className:`ripple-eyebrow ripple-casc-incident-label`,children:`Incident`})]}),(0,o.jsx)(`p`,{className:`ripple-casc-incident-text`,children:e.incident})]})]})]})}function d({model:e}){let{cascades:t}=e,[n,r]=(0,i.useState)(()=>new Set),a=e=>r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return t.length===0?(0,o.jsx)(`div`,{className:`ripple-casc-empty`,role:`status`,children:`No cascade found — nothing in this change reaches far enough to page someone.`}):(0,o.jsxs)(`section`,{className:`ripple-casc`,"aria-label":`How one line becomes an incident`,children:[(0,o.jsxs)(`header`,{className:`ripple-casc-intro`,children:[(0,o.jsx)(`div`,{className:`ripple-eyebrow`,children:`The cascade`}),(0,o.jsx)(`p`,{className:`ripple-casc-lede`,children:`Each chain is one line turning into a page — read it left to right, then read how it’s caught.`})]}),t.map((e,t)=>{let r=n.has(t),i=`ripple-casc-${t}`;return(0,o.jsxs)(`div`,{className:`ripple-casc-item`,children:[t>0&&(0,o.jsx)(`div`,{className:`ripple-casc-divider`,"aria-hidden":`true`}),(0,o.jsxs)(`button`,{type:`button`,className:`ripple-casc-bar`,"aria-expanded":!r,"aria-controls":i,onClick:()=>a(t),children:[(0,o.jsx)(`span`,{className:`ripple-casc-bar-sev`,style:{"--casc-sev":s(e.incidentSeverity)},"aria-hidden":`true`,children:e.incidentSeverity}),(0,o.jsxs)(`span`,{className:`ripple-casc-bar-text`,id:i,children:[e.trigger,` `,(0,o.jsx)(`span`,{className:`ripple-casc-bar-arrow`,children:`→`}),` `,(0,o.jsx)(`strong`,{children:e.incident})]}),(0,o.jsx)(`span`,{className:`ripple-casc-bar-toggle`,"aria-hidden":`true`,children:r?`Show chain`:`Hide chain`})]}),!r&&(0,o.jsxs)(`div`,{className:`ripple-casc-detail`,children:[(0,o.jsx)(`div`,{className:`ripple-casc-scroll`,children:(0,o.jsx)(u,{cascade:e})}),(0,o.jsxs)(`p`,{className:`ripple-casc-resolution`,children:[(0,o.jsx)(`span`,{className:`ripple-casc-resolution-icon`,"aria-hidden":`true`,children:(0,o.jsx)(l,{})}),(0,o.jsxs)(`span`,{className:`ripple-casc-resolution-text`,children:[(0,o.jsx)(`strong`,{children:`Caught before merge.`}),` `,e.caughtBeforeMerge]})]})]})]},`${e.trigger}-${t}`)})]})}export{d as ShipCascade};