@mavea/mavea 1.0.10 → 1.0.11
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.
- package/dist/.vite/manifest.json +585 -585
- package/dist/assets/{AppCommandPalette-BrvbfsdK.js → AppCommandPalette-DzUPm-Qa.js} +1 -1
- package/dist/assets/{BlockEmpty-L6Ii29YE.js → BlockEmpty-Dp9IPo4S.js} +1 -1
- package/dist/assets/{BriefingPlayer-CtB3h9TJ.js → BriefingPlayer-CTab7H0c.js} +1 -1
- package/dist/assets/{CanvasSkeleton-CqvzF0Ix.js → CanvasSkeleton-BCq4yAAN.js} +2 -2
- package/dist/assets/{CheckLogRail-Dr0S3LeI.js → CheckLogRail-DbGJtneK.js} +1 -1
- package/dist/assets/{CodeOutput-BGCRjlET.js → CodeOutput-DjsCJAel.js} +1 -1
- package/dist/assets/{CommandPalette-D2kV4Mdl.js → CommandPalette-Cq9mDWiI.js} +1 -1
- package/dist/assets/{CourseLessonReader-ItmH7ccs.js → CourseLessonReader-Dz8IhHEw.js} +2 -2
- package/dist/assets/{CourseRail-B8Ot8hW9.js → CourseRail-DjK_L3eD.js} +1 -1
- package/dist/assets/{CoursesApp-DSu2zswg.js → CoursesApp-Dv4yt63y.js} +2 -2
- package/dist/assets/{CrossExamPanel-xOgmL2kl.js → CrossExamPanel-DJCn13Aa.js} +1 -1
- package/dist/assets/{DashPresent-C8Yk9AOu.js → DashPresent-pfOEJGzV.js} +1 -1
- package/dist/assets/{DashboardDetail-BK3ozdBm.js → DashboardDetail-BSZ3CgcK.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-DfnDIGFz.js +1 -0
- package/dist/assets/{DashboardOverview-Bhiwt3py.js → DashboardOverview-DpJ2BDNu.js} +1 -1
- package/dist/assets/{DashboardSettings-ConUIT2l.js → DashboardSettings-C1rC3iTs.js} +1 -1
- package/dist/assets/{DashboardsApp-CAxFYHsK.js → DashboardsApp-DeBWrYDk.js} +2 -2
- package/dist/assets/{DeepZoomApp-B1uh9Yyg.js → DeepZoomApp-B91oHx2Y.js} +1 -1
- package/dist/assets/{DelegatePanel-CDOU8DfD.js → DelegatePanel-bFmfn9-D.js} +1 -1
- package/dist/assets/{DemoGallery-D1YRuz0S.js → DemoGallery-fYIVdHQV.js} +1 -1
- package/dist/assets/{DropSelect-DZGCKxxw.js → DropSelect-DbxAWKQn.js} +1 -1
- package/dist/assets/{ExportModal-DhM80yeB.js → ExportModal-HczU1Zg1.js} +2 -2
- package/dist/assets/{ExtractionPreview-CEVvwL6Z.js → ExtractionPreview-BfjJci-N.js} +1 -1
- package/dist/assets/{FlagshipCTA-CYkF5LO_.js → FlagshipCTA-CTb5P2Ix.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-gbdvHS2L.js → FlagshipCommandPalette-DLkDmsF-.js} +1 -1
- package/dist/assets/{FlagshipShowcase-BB4BJP3V.js → FlagshipShowcase-CrFSCHHX.js} +1 -1
- package/dist/assets/{FlashcardsApp-kGal2QE_.js → FlashcardsApp-CV777TGC.js} +1 -1
- package/dist/assets/{ForecastPanel-gs5apRKg.js → ForecastPanel-BfAngk8l.js} +1 -1
- package/dist/assets/{GalleryApp-DPdu4q7k.js → GalleryApp-DLssAAhN.js} +1 -1
- package/dist/assets/{HonestByDesign-CKnSiPcq.js → HonestByDesign-B0o03QVw.js} +1 -1
- package/dist/assets/{HowItWorks-DWp-ASxN.js → HowItWorks-DfUsQ2xD.js} +1 -1
- package/dist/assets/{LegalApp-D17oe1-B.js → LegalApp-CnFE80Ja.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-B-0LA_X_.js → LegalMarkdownDocument-BidNcrNj.js} +1 -1
- package/dist/assets/{LegalPageShell-CY2O507f.js → LegalPageShell-CFktFKTK.js} +1 -1
- package/dist/assets/{LeverPanel-CiRg_mFN.js → LeverPanel-DgfX7mTL.js} +1 -1
- package/dist/assets/{Library-DhMHA6Q_.js → Library-CAnmN5YL.js} +1 -1
- package/dist/assets/{LibraryOverlay-C3ECZIkZ.js → LibraryOverlay-D7Gg_GIv.js} +1 -1
- package/dist/assets/{LiveApp-D2QFBykD.css → LiveApp-COz1ZZp9.css} +1 -1
- package/dist/assets/{LiveApp-CPPQzp34.js → LiveApp-DmU3RMfZ.js} +4 -4
- package/dist/assets/{LiveSettings-Bk-_UwJ6.js → LiveSettings-5UCN5UWM.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-C25mTggg.js → MindMapViewerDrawer-DoXy6hCD.js} +1 -1
- package/dist/assets/{MindShape-BxkLfo53.js → MindShape-BJCnqyTi.js} +1 -1
- package/dist/assets/{PinToDashboard-D7IJhkHd.js → PinToDashboard-Dq77a2iP.js} +1 -1
- package/dist/assets/{PlanReview-Cr5XQnuN.js → PlanReview-DvxM1675.js} +1 -1
- package/dist/assets/{Presence-DKuWuuqK.js → Presence-LNSqCz8N.js} +1 -1
- package/dist/assets/{PresentationDeck-Cd0r3n1O.js → PresentationDeck-8kT0cMtk.js} +1 -1
- package/dist/assets/{PrismApp-DcKFHKlU.js → PrismApp-Jf4pIAkh.js} +2 -2
- package/dist/assets/{PrismAskController-PncuR6Km.js → PrismAskController-QXSoZBNb.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-DPVF0uAk.js → PrismBriefingPlayer-edFfwMNP.js} +2 -2
- package/dist/assets/{PrismOverlay-COemfAxM.js → PrismOverlay-CYItOpax.js} +4 -4
- package/dist/assets/{PrivacyApp-C8D6D4ug.js → PrivacyApp-Dqz_BgOS.js} +1 -1
- package/dist/assets/{Recap-BiNtOx5h.js → Recap-Ba2qZ2lX.js} +1 -1
- package/dist/assets/{ReelJelly-DlUpsGvm.js → ReelJelly-9SCjNeHq.js} +1 -1
- package/dist/assets/{RehearsalPanel-BzjZl2d1.js → RehearsalPanel-CtYKPl6O.js} +1 -1
- package/dist/assets/{ReplayCard-EEL3-N3E.js → ReplayCard-MSWq-Mxr.js} +2 -2
- package/dist/assets/{ReplayOverlay-D30116VF.js → ReplayOverlay-ChDrwMLh.js} +1 -1
- package/dist/assets/{RewindOverlay-C4W4TlTA.js → RewindOverlay-CM9d5xhh.js} +1 -1
- package/dist/assets/{RippleApp-Bp3koJmT.js → RippleApp-B7G_jg05.js} +2 -2
- package/dist/assets/{RippleAskController-fvq109Pn.js → RippleAskController-CJjt7VG8.js} +1 -1
- package/dist/assets/{RippleOverlay-BDc4eEW2.js → RippleOverlay-Cfu3ZVL1.js} +2 -2
- package/dist/assets/{SeeDontRead-D-Cpq9BU.js → SeeDontRead-DHhwv6RU.js} +1 -1
- package/dist/assets/{ShareModal-jNmCfrjC.js → ShareModal-d_o2hebL.js} +1 -1
- package/dist/assets/{ShipCascade-Dy1JkWLT.js → ShipCascade-B6kVuilv.js} +1 -1
- package/dist/assets/{ShipCourse-wmdSNt0D.js → ShipCourse-CerQYrsy.js} +1 -1
- package/dist/assets/{ShipHotspots-BJESX960.js → ShipHotspots-DOmWYgHH.js} +1 -1
- package/dist/assets/{ShipIncident-DZ7YVj3U.js → ShipIncident-D0lvmytD.js} +1 -1
- package/dist/assets/{ShipMigration-Cw2fI6TU.js → ShipMigration-D70LbiJk.js} +1 -1
- package/dist/assets/{ShipOnboarding-v3pjB9Dd.js → ShipOnboarding-B_0dp9a-.js} +1 -1
- package/dist/assets/{ShipRead-D8nzUWiX.js → ShipRead-Cp2s7bSL.js} +1 -1
- package/dist/assets/{ShipRollout-CEIWoYzI.js → ShipRollout-Bw9pvbSM.js} +1 -1
- package/dist/assets/{ShipSuggestions-DcKMr0By.js → ShipSuggestions-eHLjOJL5.js} +1 -1
- package/dist/assets/{ShipWorkspace-Ck-C4iW9.js → ShipWorkspace-DwdoBSix.js} +1 -1
- package/dist/assets/{SignatureLoop-bo7wU13q.js → SignatureLoop-Bl43npTM.js} +1 -1
- package/dist/assets/{SynthesisApp-2uQFqWDb.js → SynthesisApp-BkOWv_pc.js} +2 -2
- package/dist/assets/{SynthesisOverlay-_lC1TNb0.js → SynthesisOverlay-CHlVL7sT.js} +1 -1
- package/dist/assets/{TermsApp-BVBZzP88.js → TermsApp-PakIMrh0.js} +1 -1
- package/dist/assets/{TopicCanvas-B1WcxoEs.js → TopicCanvas-wmAsICUd.js} +2 -2
- package/dist/assets/{TourPrism-BfJXC1SR.js → TourPrism-VQqowXpY.js} +1 -1
- package/dist/assets/{TrackerTile-Bp2KIlOe.js → TrackerTile-C1mU8Zxj.js} +2 -2
- package/dist/assets/{TwoSurfaces-BH7wc_Ep.js → TwoSurfaces-SNT4AVzV.js} +1 -1
- package/dist/assets/{UnderstoodPanel-BNsNgsry.js → UnderstoodPanel-BkwhDLhW.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-DtuKQK6a.js → WhyMachineOverlay-DgYhqU53.js} +1 -1
- package/dist/assets/{WowFeatures-AtKR62OJ.js → WowFeatures-Cky9THxT.js} +1 -1
- package/dist/assets/{ZoomDeck-Cjxd13Gj.js → ZoomDeck-BXwcRCO_.js} +1 -1
- package/dist/assets/{alternateFinishes-0zAldUWA.js → alternateFinishes-Cn5LyQ0-.js} +1 -1
- package/dist/assets/{annotationAuto-LzJWWed8.js → annotationAuto-L2AxlJ2F.js} +1 -1
- package/dist/assets/{annotationReel-_G28azfX.js → annotationReel-DdHNp2IH.js} +1 -1
- package/dist/assets/{backup-BEABatjO.js → backup-Cw4GBHBV.js} +1 -1
- package/dist/assets/canvas-BwR8ltlj.js +1 -0
- package/dist/assets/{catalog-DPzc-MaH.js → catalog-2srqP2Jf.js} +1 -1
- package/dist/assets/{dashboardEvents-CCCsM3Bq.js → dashboardEvents-S4Y2aOP_.js} +1 -1
- package/dist/assets/{dist-PCzrhF4p.js → dist-BJbBdhc0.js} +1 -1
- package/dist/assets/{fit-B4AIV3jM.js → fit-C3MkNFdn.js} +1 -1
- package/dist/assets/{generateLive-B4vyL_X9.js → generateLive-Ci8kqPD9.js} +1 -1
- package/dist/assets/{index-DiPGFGsJ.js → index-DWHIOldG.js} +3 -3
- package/dist/assets/{jspdf.es.min-CuE7vq_-.js → jspdf.es.min-CfZM9xhl.js} +1 -1
- package/dist/assets/{kokoro-BAiRCDY0.js → kokoro-Da60jB7C.js} +1 -1
- package/dist/assets/{lib-CQDCalVC.js → lib-C9jT-CD8.js} +1 -1
- package/dist/assets/{liveSchema-Df33WFbg.js → liveSchema-Dw4t_k7M.js} +1 -1
- package/dist/assets/{motion-S_ZJkP9s.js → motion-QSGW_vc_.js} +1 -1
- package/dist/assets/{notes-CRP7J2eu.js → notes-D21K92Wx.js} +1 -1
- package/dist/assets/{pdf-C80f-ORI.js → pdf-BP_vXBKO.js} +1 -1
- package/dist/assets/{perfProbe-CBJQvhlT.js → perfProbe-DFw7brPU.js} +1 -1
- package/dist/assets/{pin-Le0tONqk.js → pin-BzDcIYD4.js} +1 -1
- package/dist/assets/{portal-4ZN6jo0N.js → portal-n6TW0FuE.js} +1 -1
- package/dist/assets/{pptxgen.es-DCKUqU8v.js → pptxgen.es-GleD8us4.js} +1 -1
- package/dist/assets/{prewarm-CTFQ2mCg.js → prewarm-CehIIttc.js} +1 -1
- package/dist/assets/{quietHours-CzNHI0JD.js → quietHours-Brg4oaDf.js} +1 -1
- package/dist/assets/{registry-CQzRD746.js → registry-BE1QBNKm.js} +1 -1
- package/dist/assets/{registry-BsYURZ0N.js → registry-BPpjU0S5.js} +1 -1
- package/dist/assets/{registry-CmrE7O4v.js → registry-BYn3Bcie.js} +1 -1
- package/dist/assets/{registry-jZYQkNJ2.js → registry-BvEfWbB0.js} +1 -1
- package/dist/assets/{registry-BqcHHCvG.js → registry-CFU0k7VB.js} +1 -1
- package/dist/assets/{registry-BftXZ9vp.js → registry-CG5W7Xs6.js} +1 -1
- package/dist/assets/{registry-BXafX9C8.js → registry-CePhqBU6.js} +2 -2
- package/dist/assets/{registry-D6rlO36K.js → registry-ChG5tFfx.js} +2 -2
- package/dist/assets/{registry-DOWgQUqz.js → registry-CoCl26Tl.js} +1 -1
- package/dist/assets/{registry-CgrywLei.js → registry-Cpr0zSyk.js} +1 -1
- package/dist/assets/{registry-DygrqpKl.js → registry-CrpEXqNF.js} +1 -1
- package/dist/assets/{registry-DOt6RM72.js → registry-D86iln18.js} +1 -1
- package/dist/assets/{registry-CGZNwEdk.js → registry-DgIia4dY.js} +1 -1
- package/dist/assets/{registry-BeStN3Pr.js → registry-HB-VAc6H.js} +1 -1
- package/dist/assets/{registry-ejl3mwuM.js → registry-NNLA0NQi.js} +1 -1
- package/dist/assets/{registry-Bl7cQtEK.js → registry-VKh9QiDf.js} +1 -1
- package/dist/assets/{registry-DYzIwDFU.js → registry-VS55xdsN.js} +1 -1
- package/dist/assets/{registry-CS2QCeW9.js → registry-_mqmf4_W.js} +1 -1
- package/dist/assets/{registry-2H41hRIB.js → registry-eQ4cE0zj.js} +1 -1
- package/dist/assets/{registry-Cm59DqEh.js → registry-h3m1zDGt.js} +1 -1
- package/dist/assets/{registry-Dmrednfo.js → registry-ia68k5sK.js} +1 -1
- package/dist/assets/{registry-HN-JpqFb.js → registry-mmGDT0wn.js} +1 -1
- package/dist/assets/{registry-B2ntaO2N.js → registry-vPwth4BB.js} +1 -1
- package/dist/assets/{relate-C5sGCY-w.js → relate-DDWak0Tv.js} +1 -1
- package/dist/assets/{shikiHighlight-CifX0fpk.js → shikiHighlight-SWupBCFg.js} +1 -1
- package/dist/assets/{useDashboardLoop-Bj1otKTo.js → useDashboardLoop-BSBGTrE2.js} +3 -3
- package/dist/assets/{useLiveConfig-CbMkeKrN.js → useLiveConfig-Cc4IKgOd.js} +1 -1
- package/dist/assets/{useSpatialCanvas-CgmEY3Ri.js → useSpatialCanvas-D3nfHkST.js} +1 -1
- package/dist/assets/{useSpotlightWalk-aimD20cU.js → useSpotlightWalk-gVilFhpa.js} +1 -1
- package/dist/assets/{useSrsCards-DItrX8z6.js → useSrsCards-BhFfq4vc.js} +1 -1
- package/dist/assets/{useStudy-DyBiirxE.js → useStudy-DRNarubG.js} +1 -1
- package/dist/assets/{useZoomGesture-iiPgDTx_.js → useZoomGesture-BdeFOm7j.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-elAVdpQj.js +0 -1
- package/dist/assets/canvas-zLlyd97t.js +0 -1
|
@@ -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-
|
|
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-DiPGFGsJ.js";import{t as c}from"./useFocusTrap-DbfG6zbM.js";import{t as l}from"./FeatureUseNotice-CoK5HkbR.js";import{t as u}from"./useSpatialCanvas-CgmEY3Ri.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-D8nzUWiX.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([12,13,2,14,15,16,17]))),je=n(()=>s(()=>import(`./ShipIncident-DZ7YVj3U.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([18,13,2,14,15,16,17,19]))),Me=n(()=>s(()=>import(`./ShipWorkspace-Ck-C4iW9.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([20,13,2,14,15,16,17,21,22]))),Ne=n(()=>s(()=>import(`./ShipCascade-Dy1JkWLT.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([23,13,2,14,15,16,17,21,24]))),Pe=n(()=>s(()=>import(`./ShipMigration-Cw2fI6TU.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([25,13,2,14,15,16,17,26]))),Fe=n(()=>s(()=>import(`./ShipRollout-CEIWoYzI.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([27,13,2,14,15,16,17,28]))),Ie=n(()=>s(()=>import(`./ShipCourse-wmdSNt0D.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-v3pjB9Dd.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([35,13,2,14,15,16,17,36]))),Re=n(()=>s(()=>import(`./ShipHotspots-BJESX960.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([37,13,2,14,15,16,17,38]))),W=n(()=>s(()=>import(`./ShipSuggestions-DcKMr0By.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-fvq109Pn.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-Cp2s7bSL.js","assets/index-DWHIOldG.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShipIncident-D0lvmytD.js","assets/ShipIncident-BUHvFFiC.css","assets/ShipWorkspace-DwdoBSix.js","assets/colors-D49Req-e.js","assets/ShipWorkspace-D6XQpGEN.css","assets/ShipCascade-B6kVuilv.js","assets/ShipCascade-CyFnrlET.css","assets/ShipMigration-D70LbiJk.js","assets/ShipMigration-BznCskNg.css","assets/ShipRollout-Bw9pvbSM.js","assets/ShipRollout-CqeObx5b.css","assets/ShipCourse-CerQYrsy.js","assets/courseStore-DfafnL-9.js","assets/links--u_phi0x.js","assets/DropSelect-DbxAWKQn.js","assets/store-DXmC_fP2.js","assets/ShipCourse-DcT7PUSm.css","assets/ShipOnboarding-B_0dp9a-.js","assets/ShipOnboarding-BC9Vxkpa.css","assets/ShipHotspots-DOmWYgHH.js","assets/ShipHotspots-CLOMutPv.css","assets/ShipSuggestions-eHLjOJL5.js","assets/ShipSuggestions-BKRvk5Mj.css","assets/ShipGate-BYYu9WVq.js","assets/ShipGate-BVZfCllb.css","assets/RippleAskController-CJjt7VG8.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-DWHIOldG.js";import{t as c}from"./useFocusTrap-DbfG6zbM.js";import{t as l}from"./FeatureUseNotice-CoK5HkbR.js";import{t as u}from"./useSpatialCanvas-D3nfHkST.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-Cp2s7bSL.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([12,13,2,14,15,16,17]))),je=n(()=>s(()=>import(`./ShipIncident-D0lvmytD.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([18,13,2,14,15,16,17,19]))),Me=n(()=>s(()=>import(`./ShipWorkspace-DwdoBSix.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([20,13,2,14,15,16,17,21,22]))),Ne=n(()=>s(()=>import(`./ShipCascade-B6kVuilv.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([23,13,2,14,15,16,17,21,24]))),Pe=n(()=>s(()=>import(`./ShipMigration-D70LbiJk.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([25,13,2,14,15,16,17,26]))),Fe=n(()=>s(()=>import(`./ShipRollout-Bw9pvbSM.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([27,13,2,14,15,16,17,28]))),Ie=n(()=>s(()=>import(`./ShipCourse-CerQYrsy.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-B_0dp9a-.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([35,13,2,14,15,16,17,36]))),Re=n(()=>s(()=>import(`./ShipHotspots-DOmWYgHH.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([37,13,2,14,15,16,17,38]))),W=n(()=>s(()=>import(`./ShipSuggestions-eHLjOJL5.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-CJjt7VG8.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-
|
|
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-DWHIOldG.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-DbgF7cRH.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-DiPGFGsJ.js";import{n as c}from"./icons-CHVz6kv_.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{n as u,t as d}from"./share-QHGHNDhQ.js";import{t as f}from"./toast-BBNs2h3L.js";import{C as p,D as m,E as h,T as g,a as _,i as v,n as y,o as b,r as x,s as ee,t as S,w as C}from"./registry-D6rlO36K.js";import{t as w}from"./ReelJelly-DlUpsGvm.js";import{n as T,r as E}from"./spokenText-D4zPX9JY.js";import{t as D}from"./threads-CkMgrSDP.js";import{C as O,r as k,x as A}from"./kokoro-BAiRCDY0.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";var j=t();r();var ne={balanced:{fps:30,bitrate:6e6},high:{fps:30,bitrate:1e7},ultra:{fps:60,bitrate:16e6}};function re(e){let{fps:t,bitrate:n}=ne[e];return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function M(){try{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await s(async()=>{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await import(`./src-DbgF7cRH.js`);return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}}catch{return null}}async function N(){try{return await s(()=>import(`./dist-xRGLOZwv.js`),[])}catch{return null}}var P={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function F(){if(typeof document>`u`)return!1;let e=typeof MediaRecorder<`u`,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function ie(e){let t=ne[e.quality??`high`],n=e.fps??t.fps,{w:r,h:i}=P[e.aspect],a=e.audioStream?.getAudioTracks()[0]??null,o=await N();if(!o)throw Error(`rasterizer-unavailable`);let s=e.el.clientWidth||r,c=Math.min(3,Math.max(1,r/s)),l=0,u=0,d=document.createElement(`canvas`);d.width=r,d.height=i;let f=d.getContext(`2d`,{alpha:!1});f.fillStyle=`#05070c`,f.fillRect(0,0,r,i);let p=document.createElement(`canvas`);p.width=Math.round(r/2),p.height=Math.round(i/2);let m=p.getContext(`2d`),h=!1,g=()=>{m&&(m.drawImage(d,0,0,p.width,p.height),h=!0)},_=()=>new Blob([],{type:`image/png`}),v=async()=>(!h&&l>0&&g(),h?await new Promise(e=>p.toBlob(e,`image/png`))??_():_()),y=async()=>{let t;try{t=await o.domToCanvas(e.el,{scale:c,backgroundColor:`#05070c`})}catch{u++;return}if(!t.width||!t.height){u++;return}u=0,l++;let n=Math.max(r/t.width,i/t.height),a=t.width*n,s=t.height*n;f.fillStyle=`#05070c`,f.fillRect(0,0,r,i),f.drawImage(t,(r-a)/2,(i-s)/2,a,s)},b=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await M():null;if(b&&await b.canEncodeVideo(`avc`).catch(()=>!1)&&b){let r=new b.Output({format:new b.Mp4OutputFormat,target:new b.BufferTarget}),i=new b.CanvasSource(d,{codec:`avc`,bitrate:t.bitrate});if(r.addVideoTrack(i),a){let e=new b.MediaStreamAudioTrackSource(a,{codec:`aac`,bitrate:192e3});e.errorPromise.catch(()=>{}),r.addAudioTrack(e)}await r.start();let o=!0,s=!0,c=performance.now(),f=0,m=1e3/n,_=e.maxDurationMs??1/0;(async()=>{for(;o;){let e=performance.now();if(await y(),!o)break;let t=s?0:(performance.now()-c)/1e3;s=!1;try{await i.add(t,Math.max(1/n,t-f))}catch{break}if(f=t,t*1e3>=_)break;!h&&t>1.2&&l>2&&u===0&&g();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,m-r)))}})();let x=()=>{o=!1,a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){o=!1;let e=await v();await r.finalize();let t=r.target.buffer;return x(),{blob:new Blob([t??new ArrayBuffer(0)],{type:`video/mp4`}),type:`video/mp4`,poster:e,hasAudio:!!a,durationMs:Math.round(performance.now()-c)}},cancel(){o=!1,r.cancel?.(),x()}}}let x=d.captureStream(n),ee=new MediaStream(x.getVideoTracks());a&&ee.addTrack(a);let S=MediaRecorder.isTypeSupported(`video/webm;codecs=vp9,opus`)?`video/webm;codecs=vp9,opus`:`video/webm`,C=new MediaRecorder(ee,{mimeType:S,videoBitsPerSecond:t.bitrate}),w=[];C.ondataavailable=e=>e.data.size&&w.push(e.data);let T=new Promise(e=>{C.addEventListener(`stop`,()=>e(),{once:!0})}),E=()=>{try{C.state!==`inactive`&&C.stop()}catch{}};C.start();let D=!0,O=performance.now(),k=e.maxDurationMs??1/0,A=1e3/n;(async()=>{for(;D;){let e=performance.now();await y();let t=performance.now()-O;if(t>=k){E();break}!h&&t>1200&&l>2&&u===0&&g();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,A-n)))}})();let te=()=>{D=!1;for(let e of ee.getTracks())e.stop();a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){D=!1;let e=await v();E(),await T;let t=new Blob(w,{type:S}),n=Math.round(performance.now()-O);return te(),{blob:t,type:S,poster:e,hasAudio:!!a,durationMs:n}},cancel(){D=!1,E(),te()}}}var I=n();function ae({slide:e}){"use no memo";let t=b(e);return(0,I.jsx)(t.Slide,{slots:t.slots})}var oe=o(),L=(0,j.createContext)(0),R=new Set([`hidden`,`clip`,`auto`,`scroll`]);function z(e){let t=(0,oe.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)(L),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}!R.has(t.overflowX)&&!R.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,I.jsx)(`div`,{ref:r,style:d,children:(0,I.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var B=[`up`,`left`,`zoom`,`wipe`,`fade`];function V(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function se(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=V(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 H=e=>e.template!==`title`&&e.template!==`outro`,U=e=>e.template===`outro`,W=e=>e.template===`title`;function G(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)H(e[r])&&n++;return n}function ce(e,t){let n=e[t];return n&&H(n)?G(e,t):-1}function le({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),[_,y]=(0,j.useState)(0),b=u!==void 0,[ee,S]=(0,j.useState)(!1),C=b?u:ee,T=(0,j.useCallback)(()=>{b?d?.(!C):S(e=>!e)},[b,C,d]),[E,D]=(0,j.useState)(0),O=(0,j.useRef)(!1),k=(0,j.useRef)(null),A=(0,j.useRef)(null),te=(0,j.useRef)(i);te.current=i;let ne=(0,j.useCallback)(e=>{A.current=e,te.current?.(e)},[]);(0,j.useEffect)(()=>{l&&A.current?.focus({preventScroll:!0})},[l]);let re=(0,j.useRef)(!1);re.current=C;let M=(0,j.useRef)(null),N=(0,j.useRef)(0),P=(0,j.useCallback)(e=>{k.current=e,e&&se(e)&&D(e=>e+1)},[]);if((0,j.useLayoutEffect)(()=>{let e=k.current;if(!e)return;let t=new ResizeObserver(()=>{se(e)&&D(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,j.useEffect)(()=>{o&&(O.current=!1,g(m),y(e=>e+1))},[a,o]),(0,j.useEffect)(()=>{if(!o||C||h>=f.length)return;let e=M.current??p[h];M.current=null,N.current=Date.now();let t=window.setTimeout(()=>{h+1<f.length?g(h+1):n?(g(0),y(e=>e+1),c?.()):O.current||(O.current=!0,r?.())},e);return()=>{window.clearTimeout(t),re.current&&(M.current=Math.max(0,e-(Date.now()-N.current)))}},[h,f.length,n,r,a,o,C]),(0,j.useEffect)(()=>{M.current=null},[h]),!f.length)return null;let F=f[Math.min(h,f.length-1)],ie=G(f,h),oe=ce(f,h),R=f.filter(H).length,V=e=>{let t=-1;for(let n=0;n<f.length;n++)if(H(f[n])&&t++,t===e){g(n),y(e=>e+1);return}},le=e=>{if(!R)return;let t=H(F)?oe+e:e>0?ie:ie-1;V(Math.max(0,Math.min(R-1,t)))},K=f.reduce((e,t,n)=>(W(t)&&e.push(n),e),[]),q=e=>{if(K.length<=1)return;let t=K.filter(e=>e<=h).length-1;g(K[Math.max(0,Math.min(K.length-1,t+e))]),y(e=>e+1)},ue=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),le(1);break;case`ArrowLeft`:e.preventDefault(),le(-1);break;case`ArrowDown`:e.preventDefault(),q(1);break;case`ArrowUp`:e.preventDefault(),q(-1);break;case` `:case`Spacebar`:e.preventDefault(),T();break;default:break}},de=v(F.template)===`dark`,fe=x(F.template),J=h===0?`fade`:B[(h+e.seed)%B.length];return(0,I.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:ne,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?ue: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,I.jsxs)(`div`,{className:`reel-board`,ref:P,"data-surface":de?`dark`:`light`,"data-bleed":fe?`true`:`false`,children:[de&&(0,I.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:R},(e,t)=>{let n=t===oe,r=t<ie||U(F),i=(0,I.jsx)(`span`,{className:`reel-seg`,children:(0,I.jsx)(`i`,{style:n?{width:0,animation:`reel-seg-fill ${p[h]}ms linear forwards`,animationPlayState:C?`paused`:`running`}:{width:r?`100%`:`0%`}})},`seg`);return l?(0,I.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>V(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,I.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,I.jsxs)(`div`,{className:`reel-top`,children:[(0,I.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,I.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,I.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!fe&&(0,I.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,I.jsx)(w,{})}),(0,I.jsx)(`div`,{className:`reel-stage`,children:(0,I.jsx)(`div`,{className:`reel-trans`,"data-trans":J,children:(0,I.jsx)(L.Provider,{value:E,children:(0,I.jsx)(z,{children:(0,I.jsx)(ae,{slide:F})})})},`${_}-${h}`)}),(0,I.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&C,"aria-hidden":`true`,children:(0,I.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]})})]})})}function K(e){let t=[],n=D(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var q=/^(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,ue=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function de(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return m(n,h.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(q,``).replace(/[?!.]+$/,``).trim(),a=(i.split(ue)[0]||``).trim()||i;return a?m(a.charAt(0).toUpperCase()+a.slice(1),h.heading):``}r();var fe={palette:`aurora`,vibe:`clean`,maxSlides:6};function J(e){return m(e[0]?.question||e[0]?.spec?.title||`Mavéa`,h.title)}function Y(e){return e[0]?.spec?.topic||e[0]?.spec?.title||J(e)}function pe(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function X(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function me(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var he=0;function ge(e,t,n,r,i){let a=m(E(r.voiceover),h.voiceover);return{id:`s${he++}`,content:e,template:t,slots:y(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function _e(e,t,n,r,i,a){return ge(e,S(e,i,a,_(e,t)),t,n,r)}function ve(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function ye(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function be(e,t,n,r){let i=J(e.frames);return ge(`title`,`title`,{question:i,kicker:e.heading||de(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:g.intro},r)}function xe(e,t,n){let r=e.flatMap(e=>e.frames),i=J(r),a=Y(r),o=[];e.forEach((t,n)=>{let r={topic:Y(t.frames),question:J(t.frames)};o.push(be(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(ge(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:g.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 Se(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:S(e.content,t,n,_(e.content,e.slots),e.template)})}}function Z(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:T((e.note||``).trim()),spoken:E((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=X(e),r=pe(me(e)),s=pe(T(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)=>_e(e.content,e.raw,{voiceover:e.voiceover,ms:g.default},t,0,n+1))}function Ce(e,t){let n=K(e);return n.slice(-ve(t,n.length))}function we(e,t={}){let n={...fe,...t},r=Ce(e,n.maxSlides);return xe(r.map((e,t)=>({frames:e,content:Z(e,{topic:Y(e),question:J(e)},ye(n.maxSlides,r.length,t))})),n,0)}var Q=p,Te=`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-DWHIOldG.js";import{n as c}from"./icons-CHVz6kv_.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{n as u,t as d}from"./share-QHGHNDhQ.js";import{t as f}from"./toast-BBNs2h3L.js";import{C as p,D as m,E as h,T as g,a as _,i as v,n as y,o as b,r as x,s as ee,t as S,w as C}from"./registry-ChG5tFfx.js";import{t as w}from"./ReelJelly-9SCjNeHq.js";import{n as T,r as E}from"./spokenText-D4zPX9JY.js";import{t as D}from"./threads-CkMgrSDP.js";import{C as O,r as k,x as A}from"./kokoro-Da60jB7C.js";import{t as te}from"./FeatureUseNotice-CoK5HkbR.js";var j=t();r();var ne={balanced:{fps:30,bitrate:6e6},high:{fps:30,bitrate:1e7},ultra:{fps:60,bitrate:16e6}};function re(e){let{fps:t,bitrate:n}=ne[e];return`up to ${t} fps · ${Math.round(n/1e6)} Mbps`}async function M(){try{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await s(async()=>{let{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}=await import(`./src-DbgF7cRH.js`);return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}},__vite__mapDeps([0,1,2]));return{Output:e,Mp4OutputFormat:t,BufferTarget:n,CanvasSource:r,MediaStreamAudioTrackSource:i,canEncodeVideo:a}}catch{return null}}async function N(){try{return await s(()=>import(`./dist-xRGLOZwv.js`),[])}catch{return null}}var P={"9:16":{w:1080,h:1920},"1:1":{w:1080,h:1080},"16:9":{w:1920,h:1080}};function F(){if(typeof document>`u`)return!1;let e=typeof MediaRecorder<`u`,t=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0;return e||t}async function ie(e){let t=ne[e.quality??`high`],n=e.fps??t.fps,{w:r,h:i}=P[e.aspect],a=e.audioStream?.getAudioTracks()[0]??null,o=await N();if(!o)throw Error(`rasterizer-unavailable`);let s=e.el.clientWidth||r,c=Math.min(3,Math.max(1,r/s)),l=0,u=0,d=document.createElement(`canvas`);d.width=r,d.height=i;let f=d.getContext(`2d`,{alpha:!1});f.fillStyle=`#05070c`,f.fillRect(0,0,r,i);let p=document.createElement(`canvas`);p.width=Math.round(r/2),p.height=Math.round(i/2);let m=p.getContext(`2d`),h=!1,g=()=>{m&&(m.drawImage(d,0,0,p.width,p.height),h=!0)},_=()=>new Blob([],{type:`image/png`}),v=async()=>(!h&&l>0&&g(),h?await new Promise(e=>p.toBlob(e,`image/png`))??_():_()),y=async()=>{let t;try{t=await o.domToCanvas(e.el,{scale:c,backgroundColor:`#05070c`})}catch{u++;return}if(!t.width||!t.height){u++;return}u=0,l++;let n=Math.max(r/t.width,i/t.height),a=t.width*n,s=t.height*n;f.fillStyle=`#05070c`,f.fillRect(0,0,r,i),f.drawImage(t,(r-a)/2,(i-s)/2,a,s)},b=typeof VideoEncoder<`u`&&globalThis.AudioEncoder!==void 0?await M():null;if(b&&await b.canEncodeVideo(`avc`).catch(()=>!1)&&b){let r=new b.Output({format:new b.Mp4OutputFormat,target:new b.BufferTarget}),i=new b.CanvasSource(d,{codec:`avc`,bitrate:t.bitrate});if(r.addVideoTrack(i),a){let e=new b.MediaStreamAudioTrackSource(a,{codec:`aac`,bitrate:192e3});e.errorPromise.catch(()=>{}),r.addAudioTrack(e)}await r.start();let o=!0,s=!0,c=performance.now(),f=0,m=1e3/n,_=e.maxDurationMs??1/0;(async()=>{for(;o;){let e=performance.now();if(await y(),!o)break;let t=s?0:(performance.now()-c)/1e3;s=!1;try{await i.add(t,Math.max(1/n,t-f))}catch{break}if(f=t,t*1e3>=_)break;!h&&t>1.2&&l>2&&u===0&&g();let r=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,m-r)))}})();let x=()=>{o=!1,a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){o=!1;let e=await v();await r.finalize();let t=r.target.buffer;return x(),{blob:new Blob([t??new ArrayBuffer(0)],{type:`video/mp4`}),type:`video/mp4`,poster:e,hasAudio:!!a,durationMs:Math.round(performance.now()-c)}},cancel(){o=!1,r.cancel?.(),x()}}}let x=d.captureStream(n),ee=new MediaStream(x.getVideoTracks());a&&ee.addTrack(a);let S=MediaRecorder.isTypeSupported(`video/webm;codecs=vp9,opus`)?`video/webm;codecs=vp9,opus`:`video/webm`,C=new MediaRecorder(ee,{mimeType:S,videoBitsPerSecond:t.bitrate}),w=[];C.ondataavailable=e=>e.data.size&&w.push(e.data);let T=new Promise(e=>{C.addEventListener(`stop`,()=>e(),{once:!0})}),E=()=>{try{C.state!==`inactive`&&C.stop()}catch{}};C.start();let D=!0,O=performance.now(),k=e.maxDurationMs??1/0,A=1e3/n;(async()=>{for(;D;){let e=performance.now();await y();let t=performance.now()-O;if(t>=k){E();break}!h&&t>1200&&l>2&&u===0&&g();let n=performance.now()-e;await new Promise(e=>setTimeout(e,Math.max(0,A-n)))}})();let te=()=>{D=!1;for(let e of ee.getTracks())e.stop();a?.stop(),d.width=d.height=0,p.width=p.height=0};return{async stop(){D=!1;let e=await v();E(),await T;let t=new Blob(w,{type:S}),n=Math.round(performance.now()-O);return te(),{blob:t,type:S,poster:e,hasAudio:!!a,durationMs:n}},cancel(){D=!1,E(),te()}}}var I=n();function ae({slide:e}){"use no memo";let t=b(e);return(0,I.jsx)(t.Slide,{slots:t.slots})}var oe=o(),L=(0,j.createContext)(0),R=new Set([`hidden`,`clip`,`auto`,`scroll`]);function z(e){let t=(0,oe.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)(L),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}!R.has(t.overflowX)&&!R.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,I.jsx)(`div`,{ref:r,style:d,children:(0,I.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var B=[`up`,`left`,`zoom`,`wipe`,`fade`];function V(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function se(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=V(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 H=e=>e.template!==`title`&&e.template!==`outro`,U=e=>e.template===`outro`,W=e=>e.template===`title`;function G(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)H(e[r])&&n++;return n}function ce(e,t){let n=e[t];return n&&H(n)?G(e,t):-1}function le({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),[_,y]=(0,j.useState)(0),b=u!==void 0,[ee,S]=(0,j.useState)(!1),C=b?u:ee,T=(0,j.useCallback)(()=>{b?d?.(!C):S(e=>!e)},[b,C,d]),[E,D]=(0,j.useState)(0),O=(0,j.useRef)(!1),k=(0,j.useRef)(null),A=(0,j.useRef)(null),te=(0,j.useRef)(i);te.current=i;let ne=(0,j.useCallback)(e=>{A.current=e,te.current?.(e)},[]);(0,j.useEffect)(()=>{l&&A.current?.focus({preventScroll:!0})},[l]);let re=(0,j.useRef)(!1);re.current=C;let M=(0,j.useRef)(null),N=(0,j.useRef)(0),P=(0,j.useCallback)(e=>{k.current=e,e&&se(e)&&D(e=>e+1)},[]);if((0,j.useLayoutEffect)(()=>{let e=k.current;if(!e)return;let t=new ResizeObserver(()=>{se(e)&&D(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,j.useEffect)(()=>{o&&(O.current=!1,g(m),y(e=>e+1))},[a,o]),(0,j.useEffect)(()=>{if(!o||C||h>=f.length)return;let e=M.current??p[h];M.current=null,N.current=Date.now();let t=window.setTimeout(()=>{h+1<f.length?g(h+1):n?(g(0),y(e=>e+1),c?.()):O.current||(O.current=!0,r?.())},e);return()=>{window.clearTimeout(t),re.current&&(M.current=Math.max(0,e-(Date.now()-N.current)))}},[h,f.length,n,r,a,o,C]),(0,j.useEffect)(()=>{M.current=null},[h]),!f.length)return null;let F=f[Math.min(h,f.length-1)],ie=G(f,h),oe=ce(f,h),R=f.filter(H).length,V=e=>{let t=-1;for(let n=0;n<f.length;n++)if(H(f[n])&&t++,t===e){g(n),y(e=>e+1);return}},le=e=>{if(!R)return;let t=H(F)?oe+e:e>0?ie:ie-1;V(Math.max(0,Math.min(R-1,t)))},K=f.reduce((e,t,n)=>(W(t)&&e.push(n),e),[]),q=e=>{if(K.length<=1)return;let t=K.filter(e=>e<=h).length-1;g(K[Math.max(0,Math.min(K.length-1,t+e))]),y(e=>e+1)},ue=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),le(1);break;case`ArrowLeft`:e.preventDefault(),le(-1);break;case`ArrowDown`:e.preventDefault(),q(1);break;case`ArrowUp`:e.preventDefault(),q(-1);break;case` `:case`Spacebar`:e.preventDefault(),T();break;default:break}},de=v(F.template)===`dark`,fe=x(F.template),J=h===0?`fade`:B[(h+e.seed)%B.length];return(0,I.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:ne,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?ue: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,I.jsxs)(`div`,{className:`reel-board`,ref:P,"data-surface":de?`dark`:`light`,"data-bleed":fe?`true`:`false`,children:[de&&(0,I.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:R},(e,t)=>{let n=t===oe,r=t<ie||U(F),i=(0,I.jsx)(`span`,{className:`reel-seg`,children:(0,I.jsx)(`i`,{style:n?{width:0,animation:`reel-seg-fill ${p[h]}ms linear forwards`,animationPlayState:C?`paused`:`running`}:{width:r?`100%`:`0%`}})},`seg`);return l?(0,I.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>V(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,I.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,I.jsxs)(`div`,{className:`reel-top`,children:[(0,I.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,I.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,I.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!fe&&(0,I.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,I.jsx)(w,{})}),(0,I.jsx)(`div`,{className:`reel-stage`,children:(0,I.jsx)(`div`,{className:`reel-trans`,"data-trans":J,children:(0,I.jsx)(L.Provider,{value:E,children:(0,I.jsx)(z,{children:(0,I.jsx)(ae,{slide:F})})})},`${_}-${h}`)}),(0,I.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&C,"aria-hidden":`true`,children:(0,I.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]})})]})})}function K(e){let t=[],n=D(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var q=/^(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,ue=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function de(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return m(n,h.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(q,``).replace(/[?!.]+$/,``).trim(),a=(i.split(ue)[0]||``).trim()||i;return a?m(a.charAt(0).toUpperCase()+a.slice(1),h.heading):``}r();var fe={palette:`aurora`,vibe:`clean`,maxSlides:6};function J(e){return m(e[0]?.question||e[0]?.spec?.title||`Mavéa`,h.title)}function Y(e){return e[0]?.spec?.topic||e[0]?.spec?.title||J(e)}function pe(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function X(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function me(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var he=0;function ge(e,t,n,r,i){let a=m(E(r.voiceover),h.voiceover);return{id:`s${he++}`,content:e,template:t,slots:y(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function _e(e,t,n,r,i,a){return ge(e,S(e,i,a,_(e,t)),t,n,r)}function ve(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function ye(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function be(e,t,n,r){let i=J(e.frames);return ge(`title`,`title`,{question:i,kicker:e.heading||de(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:g.intro},r)}function xe(e,t,n){let r=e.flatMap(e=>e.frames),i=J(r),a=Y(r),o=[];e.forEach((t,n)=>{let r={topic:Y(t.frames),question:J(t.frames)};o.push(be(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(ge(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:g.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 Se(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:S(e.content,t,n,_(e.content,e.slots),e.template)})}}function Z(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:T((e.note||``).trim()),spoken:E((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=X(e),r=pe(me(e)),s=pe(T(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)=>_e(e.content,e.raw,{voiceover:e.voiceover,ms:g.default},t,0,n+1))}function Ce(e,t){let n=K(e);return n.slice(-ve(t,n.length))}function we(e,t={}){let n={...fe,...t},r=Ce(e,n.maxSlides);return xe(r.map((e,t)=>({frames:e,content:Z(e,{topic:Y(e),question:J(e)},ye(n.maxSlides,r.length,t))})),n,0)}var Q=p,Te=`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-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.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 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DiPGFGsJ.js";import{t as r}from"./DropSelect-DZGCKxxw.js";import{n as i}from"./store-DXmC_fP2.js";import{v as a}from"./githubToken-DtcLYqwm.js";import{n as o,t as s}from"./courseStore-DfafnL-9.js";import{t as c}from"./links--u_phi0x.js";var l=e(),u=n(),d=`mavea.ripple.course.v2`,f=`mavea.ripple.course.v1`;function p(){try{let e=localStorage.getItem(f);if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))Array.isArray(r)&&(n[e]={lessons:r.filter(e=>typeof e==`number`)});return Object.keys(n).length>0&&h(n),n}catch{return{}}}function m(){try{let e=localStorage.getItem(d);if(e===null)return p();let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function h(e){try{localStorage.setItem(d,JSON.stringify(e))}catch{}}function g(e){return new Set(m()[e]?.lessons??[])}function _(e,t,n){let r=m(),i=new Set(r[e]?.lessons??[]);return n?i.add(t):i.delete(t),r[e]={...r[e],lessons:[...i].sort((e,t)=>e-t)},h(r),i}function v(e){return m()[e]?.quiz}function y(e,t,n){let r=m();r[e]={lessons:r[e]?.lessons??[],quiz:{correct:t,total:n,passedAt:Date.now()}},h(r)}function b(e,t){return t>0&&e>=t-1}function x(e){return!!(!(e.lessonsTotal>0&&e.lessonsDone>=e.lessonsTotal)||e.hasQuiz&&!e.quizPassed)}var S=t();function C(e){let t=(0,u.c)(86),{course:n,lesson:r,altitude:i,fileUrl:a,loadLessonDetail:o,speak:s,onAskAboutLesson:c}=e,[d,f]=(0,l.useState)(r.detail??null),[p,m]=(0,l.useState)(`idle`),[h,g]=(0,l.useState)(null),_=(0,l.useRef)(!1),v=(0,l.useRef)(!0),y=(0,l.useRef)(null),b=(0,l.useRef)(0),x,C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>()=>{v.current=!1,y.current!==null&&clearTimeout(y.current)},C=[],t[0]=x,t[1]=C):(x=t[0],C=t[1]),(0,l.useEffect)(x,C);let k;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(k=e=>{if(!o)return;y.current!==null&&clearTimeout(y.current);let t=b.current+=1;m(`loading`),f(null);let a=s=>{o(n,r,e,i).then(e=>{!v.current||t!==b.current||(e?(f(e),m(`idle`)):s>0?y.current=setTimeout(()=>a(s-1),2e3):m(`error`))})};a(1)},t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=k):k=t[6];let A=k,j;t[7]!==r.detail||t[8]!==o||t[9]!==A?(j=()=>{if(r.detail){f(r.detail);return}!o||_.current||(_.current=!0,A(!1))},t[7]=r.detail,t[8]=o,t[9]=A,t[10]=j):j=t[10];let M;t[11]!==r||t[12]!==o||t[13]!==A?(M=[r,o,A],t[11]=r,t[12]=o,t[13]=A,t[14]=M):M=t[14],(0,l.useEffect)(j,M);let N;t[15]===d?.walkthrough?N=t[16]:(N=d?.walkthrough??[],t[15]=d?.walkthrough,t[16]=N);let P=N,F,I;t[17]!==s||t[18]!==h||t[19]!==P?(F=()=>{if(h===null||!s)return;let e=P[h];e&&s(`${e.focus?e.focus+`. `:``}${e.explain}`)},I=[h,P,s],t[17]=s,t[18]=h,t[19]=P,t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,l.useEffect)(F,I);let L=r.goal,R=r.explainFor?.[i]??r.goal,z;t[22]!==n||t[23]!==L||t[24]!==r.title||t[25]!==c?(z=c&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-lesson-ask`,onClick:()=>c(`In "${n.title}" — ${r.title}: ${L||`what should I understand here?`}`),children:`Ask about this lesson`}),t[22]=n,t[23]=L,t[24]=r.title,t[25]=c,t[26]=z):z=t[26];let B=z;if(d){let e,n,r;if(t[27]!==B||t[28]!==d.overview||t[29]!==L){let i=d.overview.split(/\n\n+/).filter(te);t[33]===L?e=t[34]:(e=L&&(0,S.jsx)(`p`,{className:`ripple-course-lede`,children:L}),t[33]=L,t[34]=e),n=B,r=i.length>0&&(0,S.jsx)(`div`,{className:`ripple-lesson-overview`,children:i.map(ee)}),t[27]=B,t[28]=d.overview,t[29]=L,t[30]=e,t[31]=n,t[32]=r}else e=t[30],n=t[31],r=t[32];let i;t[35]!==a||t[36]!==h||t[37]!==P?(i=P.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsxs)(`div`,{className:`ripple-lesson-spot-head`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Spotlight — walk the real code`}),(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>g(0),"aria-label":`Step through the code one part at a time`,children:[`▶ Step through (`,P.length,`)`]})]}),h===null?(0,S.jsx)(`ol`,{className:`ripple-walk`,children:P.map((e,t)=>(0,S.jsxs)(`li`,{className:`ripple-walk-step`,children:[(0,S.jsxs)(`div`,{className:`ripple-walk-where`,children:[(0,S.jsx)(`span`,{className:`ripple-walk-num`,"aria-hidden":`true`,children:t+1}),(0,S.jsx)(O,{file:e.file,focus:e.focus,url:a(e.file)})]}),e.code&&(0,S.jsx)(`pre`,{className:`ripple-walk-code`,children:(0,S.jsx)(`code`,{children:e.code})}),(0,S.jsx)(`p`,{className:`ripple-walk-explain`,children:e.explain})]},t))}):(0,S.jsx)(ne,{steps:P,index:h,fileUrl:a,onPrev:()=>g(D),onNext:()=>g(e=>e===null?null:Math.min(P.length-1,e+1)),onClose:()=>g(null)})]}),t[35]=a,t[36]=h,t[37]=P,t[38]=i):i=t[38];let s;t[39]===d.concepts?s=t[40]:(s=d.concepts.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Key concepts`}),(0,S.jsx)(`dl`,{className:`ripple-lesson-concepts`,children:d.concepts.map(E)})]}),t[39]=d.concepts,t[40]=s);let c;t[41]===d.pitfalls?c=t[42]:(c=d.pitfalls&&d.pitfalls.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-caution`,role:`note`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Watch out for`}),(0,S.jsx)(`ul`,{className:`ripple-lesson-pitfalls`,children:d.pitfalls.map(T)})]}),t[41]=d.pitfalls,t[42]=c);let l;t[43]===d.exercise?l=t[44]:(l=d.exercise&&(0,S.jsxs)(`section`,{className:`ripple-course-group ripple-lesson-exercise`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Try it`}),(0,S.jsx)(`p`,{className:`ripple-lesson-task`,children:d.exercise.task}),d.exercise.hint&&(0,S.jsxs)(`p`,{className:`ripple-lesson-hint`,children:[`Hint — `,d.exercise.hint]}),d.exercise.check&&(0,S.jsxs)(`p`,{className:`ripple-lesson-check`,children:[`How you’ll know it worked — `,d.exercise.check]})]}),t[43]=d.exercise,t[44]=l);let u;t[45]!==o||t[46]!==A?(u=o&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-lesson-regen`,onClick:()=>A(!0),title:`Rewrite this lesson from the latest code`,children:`↻ Rewrite this lesson`}),t[45]=o,t[46]=A,t[47]=u):u=t[47];let f;return t[48]!==e||t[49]!==n||t[50]!==r||t[51]!==i||t[52]!==s||t[53]!==c||t[54]!==l||t[55]!==u?(f=(0,S.jsxs)(S.Fragment,{children:[e,n,r,i,s,c,l,u]}),t[48]=e,t[49]=n,t[50]=r,t[51]=i,t[52]=s,t[53]=c,t[54]=l,t[55]=u,t[56]=f):f=t[56],f}if(p===`loading`){let e,n;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),n=(0,S.jsx)(`div`,{className:`ripple-course-skeleton-title`,children:`Writing this lesson from the real code…`}),t[57]=e,t[58]=n):(e=t[57],n=t[58]);let i;t[59]===r.read?i=t[60]:(i=r.read.slice(0,3).join(`, `)||`the relevant files`,t[59]=r.read,t[60]=i);let a;return t[61]===i?a=t[62]:(a=(0,S.jsxs)(`div`,{className:`ripple-course-skeleton`,role:`status`,"aria-live":`polite`,children:[e,n,(0,S.jsxs)(`div`,{className:`ripple-course-skeleton-sub`,children:[`Reading `,i,` to teach it properly — with a walk through the actual code.`]})]}),t[61]=i,t[62]=a),a}if(p===`error`){let e;t[63]===L?e=t[64]:(e=L&&(0,S.jsx)(`p`,{className:`ripple-course-lede`,children:L}),t[63]=L,t[64]=e);let n;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,S.jsx)(`p`,{children:`Couldn’t write this lesson from the code just now.`}),t[65]=n):n=t[65];let r;t[66]===A?r=t[67]:(r=(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>A(!0),children:`Try again`}),t[66]=A,t[67]=r);let i;return t[68]!==e||t[69]!==r?(i=(0,S.jsxs)(`div`,{className:`ripple-course-empty`,children:[e,n,r]}),t[68]=e,t[69]=r,t[70]=i):i=t[70],i}let re;t[71]===R?re=t[72]:(re=(0,S.jsx)(`p`,{className:`ripple-course-explain`,children:R}),t[71]=R,t[72]=re);let ie;t[73]!==a||t[74]!==r.read?(ie=r.read.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Open and read`}),(0,S.jsx)(`div`,{className:`ripple-course-files`,children:r.read.map(e=>(0,S.jsx)(O,{file:e,url:a(e)},e))})]}),t[73]=a,t[74]=r.read,t[75]=ie):ie=t[75];let ae;t[76]===r.concepts?ae=t[77]:(ae=r.concepts.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Key concepts`}),(0,S.jsx)(`ul`,{className:`ripple-course-concepts`,children:r.concepts.map(w)})]}),t[76]=r.concepts,t[77]=ae);let V;t[78]===r.caution?V=t[79]:(V=r.caution&&(0,S.jsxs)(`section`,{className:`ripple-course-caution`,role:`note`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Be careful here — and why`}),(0,S.jsx)(`p`,{className:`ripple-course-caution-text`,children:r.caution})]}),t[78]=r.caution,t[79]=V);let oe;return t[80]!==B||t[81]!==re||t[82]!==ie||t[83]!==ae||t[84]!==V?(oe=(0,S.jsxs)(S.Fragment,{children:[re,B,ie,ae,V]}),t[80]=B,t[81]=re,t[82]=ie,t[83]=ae,t[84]=V,t[85]=oe):oe=t[85],oe}function w(e,t){return(0,S.jsx)(`li`,{children:e},t)}function T(e,t){return(0,S.jsx)(`li`,{children:e},t)}function E(e,t){return(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`dt`,{children:e.term}),(0,S.jsx)(`dd`,{children:e.explain})]},t)}function D(e){return e===null?null:Math.max(0,e-1)}function ee(e,t){return(0,S.jsx)(`p`,{children:e},t)}function te(e){return e.trim().length>0}function O(e){let t=(0,u.c)(3),{file:n,focus:r,url:i}=e,a=r?`${n} · ${r}`:n,o;return t[0]!==a||t[1]!==i?(o=i?(0,S.jsxs)(`a`,{className:`ripple-course-file ripple-course-file-link`,href:i,target:`_blank`,rel:`noreferrer noopener`,children:[a,` ↗`]}):(0,S.jsx)(`code`,{className:`ripple-course-file`,children:a}),t[0]=a,t[1]=i,t[2]=o):o=t[2],o}function ne(e){let t=(0,u.c)(36),{steps:n,index:r,fileUrl:i,onPrev:a,onNext:o,onClose:s}=e,c=n[r],l=r+1,d;t[0]!==n.length||t[1]!==l?(d=(0,S.jsxs)(`span`,{className:`ripple-spotlight-count`,children:[l,` / `,n.length]}),t[0]=n.length,t[1]=l,t[2]=d):d=t[2];let f=c.file,p=c.focus,m;t[3]!==i||t[4]!==c.file?(m=i(c.file),t[3]=i,t[4]=c.file,t[5]=m):m=t[5];let h;t[6]!==c.file||t[7]!==c.focus||t[8]!==m?(h=(0,S.jsx)(O,{file:f,focus:p,url:m}),t[6]=c.file,t[7]=c.focus,t[8]=m,t[9]=h):h=t[9];let g;t[10]===s?g=t[11]:(g=(0,S.jsx)(`button`,{type:`button`,className:`ripple-spotlight-x`,onClick:s,"aria-label":`Exit spotlight`,children:`✕`}),t[10]=s,t[11]=g);let _;t[12]!==d||t[13]!==h||t[14]!==g?(_=(0,S.jsxs)(`div`,{className:`ripple-spotlight-bar`,children:[d,h,g]}),t[12]=d,t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]===c.code?v=t[17]:(v=c.code&&(0,S.jsx)(`pre`,{className:`ripple-walk-code ripple-spotlight-code`,children:(0,S.jsx)(`code`,{children:c.code})}),t[16]=c.code,t[17]=v);let y;t[18]===c.explain?y=t[19]:(y=(0,S.jsx)(`p`,{className:`ripple-spotlight-explain`,children:c.explain}),t[18]=c.explain,t[19]=y);let b=r===0,x;t[20]!==a||t[21]!==b?(x=(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:a,disabled:b,children:`← Back`}),t[20]=a,t[21]=b,t[22]=x):x=t[22];let C;t[23]!==r||t[24]!==s||t[25]!==o||t[26]!==n.length?(C=r<n.length-1?(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:o,children:`Next →`}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:s,children:`Done ✓`}),t[23]=r,t[24]=s,t[25]=o,t[26]=n.length,t[27]=C):C=t[27];let w;t[28]!==x||t[29]!==C?(w=(0,S.jsxs)(`div`,{className:`ripple-spotlight-nav`,children:[x,C]}),t[28]=x,t[29]=C,t[30]=w):w=t[30];let T;return t[31]!==y||t[32]!==w||t[33]!==_||t[34]!==v?(T=(0,S.jsxs)(`div`,{className:`ripple-spotlight`,role:`group`,"aria-label":`Code spotlight`,children:[_,v,y,w]}),t[31]=y,t[32]=w,t[33]=_,t[34]=v,t[35]=T):T=t[35],T}function k(e){let t=(0,u.c)(56),{questions:n,onFinish:r,children:i}=e,[a,o]=(0,l.useState)(0),[s,c]=(0,l.useState)(`ask`),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(0),[_,v]=(0,l.useState)(!1),[y,x]=(0,l.useState)(null),C=n.length,w=n[Math.min(a,C-1)],T=!!(w.choices&&w.choices.length>=2&&w.correct!==void 0),E;t[0]===s?E=t[1]:(E=e=>{s!==`graded`&&(m(e),c(`graded`),e&&g(j))},t[0]=s,t[1]=E);let D=E,ee;t[2]!==D||t[3]!==s||t[4]!==w.correct?(ee=e=>{s!==`graded`&&(f(e),D(e===w.correct))},t[2]=D,t[3]=s,t[4]=w.correct,t[5]=ee):ee=t[5];let te=ee,O;t[6]===s?O=t[7]:(O=()=>{s===`ask`&&c(`revealed`)},t[6]=s,t[7]=O);let ne=O,k;t[8]!==h||t[9]!==a||t[10]!==r||t[11]!==C?(k=()=>{if(a+1>=C){let e={correct:h,total:C};x(e),v(!0),r?.(e);return}o(A),c(`ask`),f(null),m(!1)},t[8]=h,t[9]=a,t[10]=r,t[11]=C,t[12]=k):k=t[12];let M=k;if(_&&y){let e=y.total-y.correct,n=b(y.correct,y.total),r=n?`true`:void 0,a;t[13]!==y.correct||t[14]!==y.total?(a=(0,S.jsxs)(`div`,{className:`ripple-quiz-score-num`,children:[y.correct,`/`,y.total]}),t[13]=y.correct,t[14]=y.total,t[15]=a):a=t[15];let o=n?`You know this one — nice work.`:`Worth another pass — ${e} to revisit.`,s;t[16]===o?s=t[17]:(s=(0,S.jsx)(`p`,{className:`ripple-quiz-score-text`,children:o}),t[16]=o,t[17]=s);let c;t[18]!==r||t[19]!==a||t[20]!==s?(c=(0,S.jsxs)(`div`,{className:`ripple-quiz-score`,"data-passed":r,role:`status`,children:[a,s]}),t[18]=r,t[19]=a,t[20]=s,t[21]=c):c=t[21];let l;return t[22]!==i||t[23]!==c?(l=(0,S.jsxs)(`div`,{className:`ripple-quiz-done`,children:[c,i]}),t[22]=i,t[23]=c,t[24]=l):l=t[24],l}let N=`Question ${a+1} of ${C}`,P=a+1,F;t[25]!==P||t[26]!==C?(F=(0,S.jsxs)(`div`,{className:`ripple-quiz-progress`,children:[`Question `,P,` of `,C]}),t[25]=P,t[26]=C,t[27]=F):F=t[27];let I;t[28]===w.question?I=t[29]:(I=(0,S.jsx)(`p`,{className:`ripple-course-q`,children:w.question}),t[28]=w.question,t[29]=I);let L;t[30]!==D||t[31]!==T||t[32]!==s||t[33]!==te||t[34]!==d||t[35]!==w.answer||t[36]!==w.choices||t[37]!==w.correct||t[38]!==ne?(L=T?(0,S.jsx)(`ul`,{className:`ripple-quiz-choices`,children:w.choices.map((e,t)=>{let n=`idle`;return s===`graded`&&(t===w.correct?n=`correct`:t===d&&(n=`wrong`)),(0,S.jsx)(`li`,{children:(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-choice`,"data-state":n,onClick:()=>te(t),disabled:s===`graded`,"aria-pressed":d===t,children:e})},t)})}):(0,S.jsxs)(`div`,{className:`ripple-quiz-plain`,children:[s===`ask`&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:ne,children:`Show answer`}),s!==`ask`&&(0,S.jsx)(`p`,{className:`ripple-course-a`,children:w.answer}),s===`revealed`&&(0,S.jsxs)(`div`,{className:`ripple-quiz-selfgrade`,children:[(0,S.jsx)(`span`,{className:`ripple-quiz-selfgrade-prompt`,children:`Did you get it?`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-selfgrade-btn`,"data-answer":`yes`,onClick:()=>D(!0),children:`Yes, I had it`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-selfgrade-btn`,"data-answer":`no`,onClick:()=>D(!1),children:`Not quite`})]})]}),t[30]=D,t[31]=T,t[32]=s,t[33]=te,t[34]=d,t[35]=w.answer,t[36]=w.choices,t[37]=w.correct,t[38]=ne,t[39]=L):L=t[39];let R;t[40]!==s||t[41]!==w.explain||t[42]!==p?(R=s===`graded`&&(0,S.jsxs)(`div`,{className:`ripple-quiz-feedback`,"data-right":p?`true`:void 0,children:[(0,S.jsx)(`p`,{className:`ripple-quiz-feedback-label`,children:p?`Correct`:`Not quite`}),w.explain&&(0,S.jsx)(`p`,{className:`ripple-quiz-explain`,children:w.explain})]}),t[40]=s,t[41]=w.explain,t[42]=p,t[43]=R):R=t[43];let z;t[44]!==M||t[45]!==a||t[46]!==s||t[47]!==C?(z=s===`graded`&&(0,S.jsx)(`div`,{className:`ripple-quiz-actions`,children:(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:M,children:a+1>=C?`See your score →`:`Next question →`})}),t[44]=M,t[45]=a,t[46]=s,t[47]=C,t[48]=z):z=t[48];let B;return t[49]!==R||t[50]!==z||t[51]!==N||t[52]!==F||t[53]!==I||t[54]!==L?(B=(0,S.jsxs)(`div`,{className:`ripple-quiz`,role:`group`,"aria-label":N,children:[F,I,L,R,z]}),t[49]=R,t[50]=z,t[51]=N,t[52]=F,t[53]=I,t[54]=L,t[55]=B):B=t[55],B}function A(e){return e+1}function j(e){return e+1}var M=e=>e.slice(0,7),N={beginner:`Beginner`,intermediate:`Intermediate`,expert:`Expert`};function P({title:e,sub:t,preview:n=!1}){return(0,S.jsxs)(`div`,{className:`ripple-course-skeleton`+(n?` ripple-course-skeleton--preview`:``),role:`status`,"aria-live":`polite`,children:[(0,S.jsxs)(`div`,{className:`ripple-course-skeleton-head`,children:[(0,S.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),(0,S.jsx)(`div`,{className:`ripple-course-skeleton-title`,children:e})]}),(0,S.jsx)(`div`,{className:`ripple-course-skeleton-sub`,children:t}),(0,S.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`}),n&&(0,S.jsx)(`div`,{className:`ripple-course-skeleton-lessons`,"aria-hidden":`true`,children:[0,1,2,3].map(e=>(0,S.jsxs)(`div`,{className:`ripple-skel-lesson`,children:[(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-step`}),(0,S.jsxs)(`span`,{className:`ripple-skel-lines`,children:[(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-line-title`}),(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-line-meta`})]})]},e))})]})}function F(e){let t=(0,u.c)(137),{model:n,altitude:d,building:f,onRegenerate:p,loadLessonDetail:m,loadCourseClosing:h,courseFocus:w,onCourseFocus:T,speak:E,commitSha:D,compareSinceBuilt:ee,openFullAnalysis:te,onAskAboutLesson:O}=e,ne;t[0]===n.courses?ne=t[1]:(ne=n.courses??[],t[0]=n.courses,t[1]=ne);let A=ne,j=n.pr.repo||``,F=n.pr.branch||`HEAD`,V=j?o(j):void 0,oe=!!(!n.provenance.example&&j&&D&&V?.commitSha&&V.commitSha!==D),[H,se]=(0,l.useState)(0),U=A[Math.min(H,Math.max(0,A.length-1))],W=U?`${j||`repo`}::${U.title}`:`repo`,ce;t[2]===W?ce=t[3]:(ce=()=>g(W),t[2]=W,t[3]=ce);let[G,le]=(0,l.useState)(ce),ue,de;t[4]===W?(ue=t[5],de=t[6]):(ue=()=>le(g(W)),de=[W],t[4]=W,t[5]=ue,t[6]=de),(0,l.useEffect)(ue,de);let fe;t[7]===W?fe=t[8]:(fe=(e,t)=>{le(new Set(_(W,e,t)))},t[7]=W,t[8]=fe);let pe=fe,[K,q]=(0,l.useState)(0),[me,he]=(0,l.useState)(!1),ge;t[9]===W?ge=t[10]:(ge=()=>v(W),t[9]=W,t[10]=ge);let[J,_e]=(0,l.useState)(ge),[ve,ye]=(0,l.useState)(0),[be,xe]=(0,l.useState)(!1),Se;t[11]!==H||t[12]!==A||t[13]!==W||t[14]!==q||t[15]!==xe?(Se=()=>{let e=g(W),t=(A[H]?.lessons??[]).findIndex((t,n)=>!e.has(n));q(t===-1?0:t),_e(v(W)),ye(0),xe(!1)},t[11]=H,t[12]=A,t[13]=W,t[14]=q,t[15]=xe,t[16]=Se):Se=t[16];let Ce;t[17]!==H||t[18]!==A||t[19]!==W?(Ce=[W,H,A],t[17]=H,t[18]=A,t[19]=W,t[20]=Ce):Ce=t[20],(0,l.useEffect)(Se,Ce);let we;t[21]===he?we=t[22]:(we=()=>he(!1),t[21]=he,t[22]=we);let Te;t[23]!==K||t[24]!==H?(Te=[K,H],t[23]=K,t[24]=H,t[25]=Te):Te=t[25],(0,l.useEffect)(we,Te);let[Ee,De]=(0,l.useState)(null),[Oe,ke]=(0,l.useState)(`idle`),[Ae,je]=(0,l.useState)(0),Me=(0,l.useRef)(null),Ne;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>{De(null),ke(`idle`),Me.current=null},t[26]=Ne):Ne=t[26];let Pe;t[27]===H?Pe=t[28]:(Pe=[H],t[27]=H,t[28]=Pe),(0,l.useEffect)(Ne,Pe);let Fe,Ie;t[29]!==K||t[30]!==Ae||t[31]!==H||t[32]!==A||t[33]!==h?(Fe=()=>{let e=A[H];if(!e||!h||K<e.lessons.length||e.quiz?.length||e.capstone)return;let t=`${H}:${Ae}`;if(Me.current===t)return;Me.current=t;let n=!0;return ke(`loading`),h(e).then(e=>{n&&(e&&(e.quiz?.length||e.capstone)?(De(e),ke(`ready`)):ke(`error`))}),()=>{n=!1}},Ie=[A,H,K,h,Ae],t[29]=K,t[30]=Ae,t[31]=H,t[32]=A,t[33]=h,t[34]=Fe,t[35]=Ie):(Fe=t[34],Ie=t[35]),(0,l.useEffect)(Fe,Ie);let Le;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>je(ae),t[36]=Le):Le=t[36];let Re=Le,[Y,ze]=(0,l.useState)(null),[Be,Ve]=(0,l.useState)(``),[He,Ue]=(0,l.useState)(!1),[We,Ge]=(0,l.useState)(!1),[Ke,qe]=(0,l.useState)(``),Je;if(t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Je=()=>{ze(null),Ve(``),Ue(!1),qe(``)},t[37]=Je):Je=t[37],(0,l.useEffect)(Je,[V?.commitSha,D]),A.length===0||!U){if(f){let e;return t[38]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsx)(P,{title:`Building your curriculum from the code…`,sub:`Reading the README, the areas, and the real files to write a leveled course you can climb without fear.`,preview:!0}),t[38]=e):e=t[38],e}let e;return t[39]===p?e=t[40]:(e=(0,S.jsx)(`div`,{className:`ripple-course-empty`,children:p?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{children:`Couldn’t build a course from this view yet.`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:p,children:`Try again`})]}):(0,S.jsx)(`p`,{children:`Connect a model in Settings to generate a course from this code.`})}),t[39]=p,t[40]=e),e}let X=U.lessons,Z=X[Math.min(K,X.length-1)],Ye=X.reduce(ie,0),Xe;t[41]!==G.size||t[42]!==X.length?(Xe=Math.round(G.size/X.length*100),t[41]=G.size,t[42]=X.length,t[43]=Xe):Xe=t[43];let Ze=Xe,Qe;t[44]!==Ee?.quiz||t[45]!==U.quiz?(Qe=U.quiz??Ee?.quiz??[],t[44]=Ee?.quiz,t[45]=U.quiz,t[46]=Qe):Qe=t[46];let Q=Qe,$=U.capstone??Ee?.capstone,$e=X.length>0&&(Q.length>0||!!$||!!h),et=$e&&K>=X.length,tt=K<X.length-1||$e,nt;t[47]===W?nt=t[48]:(nt=e=>{y(W,e.correct,e.total),_e(v(W))},t[47]=W,t[48]=nt);let rt=nt,it;t[49]!==U.title||t[50]!==Q||t[51]!==j?(it=()=>{ye(i(Q.map(re),{deck:`Ripple · ${j||`this repo`}`,tags:[U.title],source:{topic:U.title,ts:Date.now()},origin:`auto`}).length)},t[49]=U.title,t[50]=Q,t[51]=j,t[52]=it):it=t[52];let at=it,ot;t[53]!==ve||t[54]!==at?(ot=()=>ve>0?(0,S.jsxs)(`p`,{className:`ripple-quiz-flash-saved`,children:[`+`,ve,` card`,ve===1?``:`s`,` saved to your deck`]}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:at,children:`Keep these as flashcards`}),t[53]=ve,t[54]=at,t[55]=ot):ot=t[55];let st=ot,ct=oe&&Y?s(X,Y):new Set,lt=async()=>{if(Y)return Y;if(!ee||!V?.commitSha||!D)return null;Ge(!0),qe(``);let e=await ee(V.commitSha,D);if(Ge(!1),!e.ok||!e.diff)return qe(e.detail||`Couldn’t load what changed.`),null;let t=a(e.diff).files.map(B);return ze(t),Ve(e.diff),t},ut=()=>{if(He){Ue(!1);return}lt().then(e=>{e&&Ue(!0)})},dt=()=>{lt().then(e=>{if(!e)return;let t=s(X,e);t.size>0&&q(Math.min(...t))})},ft=()=>{!Be||!te||!V||!D||te(Be,`${j} ${M(V.commitSha)}...${M(D)}`,j)},pt;t[56]===j?pt=t[57]:(pt=e=>{let t=`${j||`repo`}::${e.title}`,n=v(t);return{lessonsDone:g(t).size,lessonsTotal:e.lessons.length,hasQuiz:(e.quiz?.length??0)>0,quizPassed:!!n&&b(n.correct,n.total)}},t[56]=j,t[57]=pt);let mt=pt,ht;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,S.jsx)(`span`,{className:`ripple-course-pill`,children:`Guided curriculum`}),t[58]=ht):ht=t[58];let gt;t[59]!==f||t[60]!==w||t[61]!==n.modules||t[62]!==T?(gt=T&&n.modules.length>1&&(0,S.jsxs)(`div`,{className:`ripple-course-focus`,title:`Build the course around one area — best on a large repo, where a whole-repo course only skims. Whole repo prioritises the highest-impact areas.`,children:[(0,S.jsx)(`span`,{className:`ripple-course-focus-label`,children:`Focus`}),(0,S.jsx)(r,{ariaLabel:`Course focus`,triggerClassName:`ripple-course-focus-select`,value:w??``,onChange:e=>T(e||void 0),disabled:f,options:[{value:``,label:`Whole repo`},...n.modules.slice(0,50).map(z)]})]}),t[59]=f,t[60]=w,t[61]=n.modules,t[62]=T,t[63]=gt):gt=t[63];let _t;t[64]!==f||t[65]!==p?(_t=p&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-regen`,onClick:p,disabled:f,title:`Rebuild the curriculum from the latest code`,children:f?`Rebuilding…`:`↻ Regenerate`}),t[64]=f,t[65]=p,t[66]=_t):_t=t[66];let vt;t[67]!==gt||t[68]!==_t?(vt=(0,S.jsxs)(`div`,{className:`ripple-course-head-top`,children:[ht,gt,_t]}),t[67]=gt,t[68]=_t,t[69]=vt):vt=t[69];let yt;t[70]!==H||t[71]!==A||t[72]!==mt||t[73]!==j?(yt=A.length>1&&(0,S.jsx)(`div`,{className:`ripple-course-tracks`,role:`tablist`,"aria-label":`Courses`,children:A.map((e,t)=>{let n=g(`${j||`repo`}::${e.title}`).size,r=n>=e.lessons.length,i=t>0?A[t-1]:void 0,a=!!i&&x(mt(i));return(0,S.jsxs)(`button`,{type:`button`,role:`tab`,className:`ripple-course-track`,"data-active":t===H?`true`:void 0,"data-locked":a?`true`:void 0,"aria-selected":t===H,onClick:()=>se(t),children:[(0,S.jsxs)(`span`,{className:`ripple-course-track-top`,children:[(0,S.jsx)(`span`,{className:`ripple-course-step`,"data-done":r?`true`:void 0,children:r?`✓`:t+1}),e.level?(0,S.jsx)(`span`,{className:`ripple-course-level`,"data-level":e.level,children:N[e.level]}):(0,S.jsxs)(`span`,{className:`ripple-course-track-meta`,children:[n,`/`,e.lessons.length]})]}),(0,S.jsx)(`span`,{className:`ripple-course-track-title`,children:e.title}),a&&(0,S.jsxs)(`span`,{className:`ripple-course-track-lock`,children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`🔒`}),` Usually after “`,i.title,`” —`,` `,(0,S.jsx)(`span`,{className:`ripple-course-track-skip`,children:`I already know this, skip ahead`})]})]},e.title)})}),t[70]=H,t[71]=A,t[72]=mt,t[73]=j,t[74]=yt):yt=t[74];let bt;t[75]===U.title?bt=t[76]:(bt=(0,S.jsx)(`h2`,{className:`ripple-course-title`,children:U.title}),t[75]=U.title,t[76]=bt);let xt;t[77]===U.subtitle?xt=t[78]:(xt=U.subtitle&&(0,S.jsx)(`p`,{className:`ripple-course-sub`,children:U.subtitle}),t[77]=U.subtitle,t[78]=xt);let St=Ye>0?` · ~${Ye} min`:``,Ct;t[79]!==G.size||t[80]!==X.length||t[81]!==St?(Ct=(0,S.jsxs)(`div`,{className:`ripple-course-meta`,children:[X.length,` lessons`,St,` · `,G.size,`/`,X.length,` done`]}),t[79]=G.size,t[80]=X.length,t[81]=St,t[82]=Ct):Ct=t[82];let wt=`${Ze}%`,Tt;t[83]===wt?Tt=t[84]:(Tt=(0,S.jsx)(`div`,{className:`ripple-course-bar`,"aria-hidden":`true`,children:(0,S.jsx)(`span`,{style:{width:wt}})}),t[83]=wt,t[84]=Tt);let Et;t[85]!==vt||t[86]!==yt||t[87]!==bt||t[88]!==xt||t[89]!==Ct||t[90]!==Tt?(Et=(0,S.jsxs)(`header`,{className:`ripple-course-head`,children:[vt,yt,bt,xt,Ct,Tt]}),t[85]=vt,t[86]=yt,t[87]=bt,t[88]=xt,t[89]=Ct,t[90]=Tt,t[91]=Et):Et=t[91];let Dt=oe&&V&&(0,S.jsxs)(`div`,{className:`ripple-course-stale`,role:`status`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`The code moved`}),(0,S.jsxs)(`p`,{className:`ripple-course-stale-text`,children:[`The code moved since this course was built (`,(0,S.jsx)(`code`,{children:M(V.commitSha)}),` →`,` `,(0,S.jsx)(`code`,{children:M(D)}),`).`]}),Ke&&(0,S.jsx)(`p`,{className:`ripple-course-stale-err`,children:Ke}),(0,S.jsxs)(`div`,{className:`ripple-course-stale-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:ut,disabled:We,children:We?`Loading…`:He?`Hide what changed`:`See what changed`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:dt,disabled:We,children:`Refresh stale lessons`}),p&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:p,disabled:f,children:`Rebuild course`})]}),He&&Y&&(0,S.jsxs)(`div`,{className:`ripple-course-changed-panel`,children:[(0,S.jsx)(`ul`,{children:Y.slice(0,20).map(R)}),Y.length>20&&(0,S.jsxs)(`p`,{className:`ripple-course-changed-more`,children:[`+`,Y.length-20,` more file`,Y.length-20==1?``:`s`]}),te&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:ft,children:`Open as a full analysis →`})]})]}),Ot=X.map((e,t)=>{let n=G.has(t),r=ct.has(t);return(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-item`,"data-active":t===K?`true`:void 0,"data-done":n?`true`:void 0,"data-stale":r?`true`:void 0,onClick:()=>q(t),children:[(0,S.jsx)(`span`,{className:`ripple-course-num`,"aria-hidden":`true`,children:n?`✓`:t+1}),(0,S.jsxs)(`span`,{className:`ripple-course-item-body`,children:[(0,S.jsxs)(`span`,{className:`ripple-course-item-title`,children:[e.title,r&&(0,S.jsx)(`span`,{className:`ripple-course-item-stale`,title:`Its files changed since this course was built`,children:`stale`})]}),e.minutes?(0,S.jsxs)(`span`,{className:`ripple-course-item-min`,children:[`~`,e.minutes,` min`]}):null]})]},t)}),kt;t[92]!==$e||t[93]!==$||t[94]!==X.length||t[95]!==et||t[96]!==Q.length||t[97]!==q?(kt=$e&&(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-item ripple-course-item-quiz`,"data-active":et?`true`:void 0,onClick:()=>q(X.length),children:[(0,S.jsx)(`span`,{className:`ripple-course-num`,"aria-hidden":`true`,children:`★`}),(0,S.jsxs)(`span`,{className:`ripple-course-item-body`,children:[(0,S.jsx)(`span`,{className:`ripple-course-item-title`,children:Q.length>0?`Quiz`:$?`Capstone`:`Wrap-up`}),(0,S.jsx)(`span`,{className:`ripple-course-item-min`,children:Q.length>0?`${Q.length} question${Q.length===1?``:`s`}`:$?`Closing project`:`Quiz & capstone`})]})]}),t[92]=$e,t[93]=$,t[94]=X.length,t[95]=et,t[96]=Q.length,t[97]=q,t[98]=kt):kt=t[98];let At;t[99]!==Ot||t[100]!==kt?(At=(0,S.jsxs)(`nav`,{className:`ripple-course-list`,"aria-label":`Lessons`,children:[Ot,kt]}),t[99]=Ot,t[100]=kt,t[101]=At):At=t[101];let jt;t[102]!==K||t[103]!==d||t[104]!==$||t[105]!==Oe||t[106]!==U||t[107]!==H||t[108]!==G||t[109]!==rt||t[110]!==st||t[111]!==tt||t[112]!==Z||t[113]!==X.length||t[114]!==m||t[115]!==pe||t[116]!==O||t[117]!==et||t[118]!==Q||t[119]!==J||t[120]!==F||t[121]!==j||t[122]!==be||t[123]!==Re||t[124]!==me||t[125]!==q||t[126]!==xe||t[127]!==he||t[128]!==E?(jt=(0,S.jsx)(`article`,{className:`ripple-course-lesson`,"aria-live":`polite`,children:et?(0,S.jsx)(S.Fragment,{children:Q.length===0&&!$&&Oe===`loading`?(0,S.jsx)(P,{title:`Writing the quiz & capstone for ${U.title}…`,sub:`A few end-of-week questions and a small hands-on project, grounded in what this week studied.`}):Q.length===0&&!$&&Oe===`error`?(0,S.jsxs)(`div`,{className:`ripple-course-empty`,children:[(0,S.jsx)(`p`,{children:`Couldn’t build the quiz & capstone for this course yet.`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:Re,children:`Try again`})]}):(0,S.jsxs)(S.Fragment,{children:[Q.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Course quiz`}),(0,S.jsx)(`h3`,{className:`ripple-course-lesson-title`,children:`Test yourself`}),(0,S.jsxs)(`p`,{className:`ripple-course-explain`,children:[`Answer these to be sure you really understood `,U.title,`.`]}),J&&!be?(0,S.jsxs)(`div`,{className:`ripple-quiz-done`,children:[(0,S.jsxs)(`div`,{className:`ripple-quiz-score`,"data-passed":b(J.correct,J.total)?`true`:void 0,role:`status`,children:[(0,S.jsxs)(`div`,{className:`ripple-quiz-score-num`,children:[J.correct,`/`,J.total]}),(0,S.jsx)(`p`,{className:`ripple-quiz-score-text`,children:b(J.correct,J.total)?`You know this one — nice work.`:`Worth another pass — ${J.total-J.correct} to revisit.`})]}),(0,S.jsx)(`div`,{className:`ripple-quiz-flashcards`,children:st()}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:()=>xe(!0),children:`Retake the quiz`})]}):(0,S.jsx)(k,{questions:Q,onFinish:e=>{rt(e),xe(!1)},children:(0,S.jsx)(`div`,{className:`ripple-quiz-flashcards`,children:st()})},`quiz:${H}`)]}),$&&(0,S.jsxs)(`section`,{className:`ripple-course-capstone`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Capstone`}),(0,S.jsx)(`h4`,{className:`ripple-course-capstone-title`,children:$.title}),(0,S.jsx)(`p`,{className:`ripple-course-capstone-brief`,children:$.brief}),$.steps.length>0&&(0,S.jsxs)(`div`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-course-capstone-label`,children:`Do this`}),(0,S.jsx)(`ol`,{className:`ripple-course-capstone-steps`,children:$.steps.map(L)})]}),$.acceptance.length>0&&(0,S.jsxs)(`div`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-course-capstone-label`,children:`You’ll know it worked when`}),(0,S.jsx)(`ul`,{className:`ripple-course-capstone-accept`,children:$.acceptance.map(I)})]})]})]})}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`ripple-eyebrow`,children:[`Lesson `,K+1,` of `,X.length,Z.minutes?` · ~${Z.minutes} min`:``]}),(0,S.jsx)(`h3`,{className:`ripple-course-lesson-title`,children:Z.title}),(0,S.jsx)(C,{course:U,lesson:Z,altitude:d,repo:j,gitRef:F,fileUrl:e=>c(j,F,e),loadLessonDetail:m,speak:E,onAskAboutLesson:O},`${H}:${K}:${d}`),Z.checkpoint&&(0,S.jsxs)(`section`,{className:`ripple-course-checkpoint`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Check yourself`}),(0,S.jsx)(`p`,{className:`ripple-course-q`,children:Z.checkpoint.question}),me?(0,S.jsx)(`p`,{className:`ripple-course-a`,children:Z.checkpoint.answer}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>he(!0),children:`Show answer`})]}),(0,S.jsxs)(`div`,{className:`ripple-course-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:()=>{let e=G.has(K);pe(K,!e),!e&&tt&&q(K+1)},children:G.has(K)?`Done ✓`:tt?`Mark done & next →`:`Mark done ✓`}),tt&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:()=>q(K+1),children:K===X.length-1?`Take the quiz →`:`Skip ahead`})]})]})}),t[102]=K,t[103]=d,t[104]=$,t[105]=Oe,t[106]=U,t[107]=H,t[108]=G,t[109]=rt,t[110]=st,t[111]=tt,t[112]=Z,t[113]=X.length,t[114]=m,t[115]=pe,t[116]=O,t[117]=et,t[118]=Q,t[119]=J,t[120]=F,t[121]=j,t[122]=be,t[123]=Re,t[124]=me,t[125]=q,t[126]=xe,t[127]=he,t[128]=E,t[129]=jt):jt=t[129];let Mt;t[130]!==At||t[131]!==jt?(Mt=(0,S.jsxs)(`div`,{className:`ripple-course-body`,children:[At,jt]}),t[130]=At,t[131]=jt,t[132]=Mt):Mt=t[132];let Nt;return t[133]!==Et||t[134]!==Dt||t[135]!==Mt?(Nt=(0,S.jsxs)(`div`,{className:`ripple-course`,children:[Et,Dt,Mt]}),t[133]=Et,t[134]=Dt,t[135]=Mt,t[136]=Nt):Nt=t[136],Nt}function I(e,t){return(0,S.jsx)(`li`,{children:e},t)}function L(e,t){return(0,S.jsx)(`li`,{children:e},t)}function R(e){return(0,S.jsx)(`li`,{children:e},e)}function z(e){return{value:e.name,label:e.name}}function B(e){return e.path}function re(e){return{front:e.question,back:e.answer}}function ie(e,t){return e+(t.minutes??0)}function ae(e){return e+1}export{F as ShipCourse};
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{t as r}from"./DropSelect-DbxAWKQn.js";import{n as i}from"./store-DXmC_fP2.js";import{v as a}from"./githubToken-DtcLYqwm.js";import{n as o,t as s}from"./courseStore-DfafnL-9.js";import{t as c}from"./links--u_phi0x.js";var l=e(),u=n(),d=`mavea.ripple.course.v2`,f=`mavea.ripple.course.v1`;function p(){try{let e=localStorage.getItem(f);if(!e)return{};let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return{};let n={};for(let[e,r]of Object.entries(t))Array.isArray(r)&&(n[e]={lessons:r.filter(e=>typeof e==`number`)});return Object.keys(n).length>0&&h(n),n}catch{return{}}}function m(){try{let e=localStorage.getItem(d);if(e===null)return p();let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function h(e){try{localStorage.setItem(d,JSON.stringify(e))}catch{}}function g(e){return new Set(m()[e]?.lessons??[])}function _(e,t,n){let r=m(),i=new Set(r[e]?.lessons??[]);return n?i.add(t):i.delete(t),r[e]={...r[e],lessons:[...i].sort((e,t)=>e-t)},h(r),i}function v(e){return m()[e]?.quiz}function y(e,t,n){let r=m();r[e]={lessons:r[e]?.lessons??[],quiz:{correct:t,total:n,passedAt:Date.now()}},h(r)}function b(e,t){return t>0&&e>=t-1}function x(e){return!!(!(e.lessonsTotal>0&&e.lessonsDone>=e.lessonsTotal)||e.hasQuiz&&!e.quizPassed)}var S=t();function C(e){let t=(0,u.c)(86),{course:n,lesson:r,altitude:i,fileUrl:a,loadLessonDetail:o,speak:s,onAskAboutLesson:c}=e,[d,f]=(0,l.useState)(r.detail??null),[p,m]=(0,l.useState)(`idle`),[h,g]=(0,l.useState)(null),_=(0,l.useRef)(!1),v=(0,l.useRef)(!0),y=(0,l.useRef)(null),b=(0,l.useRef)(0),x,C;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>()=>{v.current=!1,y.current!==null&&clearTimeout(y.current)},C=[],t[0]=x,t[1]=C):(x=t[0],C=t[1]),(0,l.useEffect)(x,C);let k;t[2]!==i||t[3]!==n||t[4]!==r||t[5]!==o?(k=e=>{if(!o)return;y.current!==null&&clearTimeout(y.current);let t=b.current+=1;m(`loading`),f(null);let a=s=>{o(n,r,e,i).then(e=>{!v.current||t!==b.current||(e?(f(e),m(`idle`)):s>0?y.current=setTimeout(()=>a(s-1),2e3):m(`error`))})};a(1)},t[2]=i,t[3]=n,t[4]=r,t[5]=o,t[6]=k):k=t[6];let A=k,j;t[7]!==r.detail||t[8]!==o||t[9]!==A?(j=()=>{if(r.detail){f(r.detail);return}!o||_.current||(_.current=!0,A(!1))},t[7]=r.detail,t[8]=o,t[9]=A,t[10]=j):j=t[10];let M;t[11]!==r||t[12]!==o||t[13]!==A?(M=[r,o,A],t[11]=r,t[12]=o,t[13]=A,t[14]=M):M=t[14],(0,l.useEffect)(j,M);let N;t[15]===d?.walkthrough?N=t[16]:(N=d?.walkthrough??[],t[15]=d?.walkthrough,t[16]=N);let P=N,F,I;t[17]!==s||t[18]!==h||t[19]!==P?(F=()=>{if(h===null||!s)return;let e=P[h];e&&s(`${e.focus?e.focus+`. `:``}${e.explain}`)},I=[h,P,s],t[17]=s,t[18]=h,t[19]=P,t[20]=F,t[21]=I):(F=t[20],I=t[21]),(0,l.useEffect)(F,I);let L=r.goal,R=r.explainFor?.[i]??r.goal,z;t[22]!==n||t[23]!==L||t[24]!==r.title||t[25]!==c?(z=c&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-lesson-ask`,onClick:()=>c(`In "${n.title}" — ${r.title}: ${L||`what should I understand here?`}`),children:`Ask about this lesson`}),t[22]=n,t[23]=L,t[24]=r.title,t[25]=c,t[26]=z):z=t[26];let B=z;if(d){let e,n,r;if(t[27]!==B||t[28]!==d.overview||t[29]!==L){let i=d.overview.split(/\n\n+/).filter(te);t[33]===L?e=t[34]:(e=L&&(0,S.jsx)(`p`,{className:`ripple-course-lede`,children:L}),t[33]=L,t[34]=e),n=B,r=i.length>0&&(0,S.jsx)(`div`,{className:`ripple-lesson-overview`,children:i.map(ee)}),t[27]=B,t[28]=d.overview,t[29]=L,t[30]=e,t[31]=n,t[32]=r}else e=t[30],n=t[31],r=t[32];let i;t[35]!==a||t[36]!==h||t[37]!==P?(i=P.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsxs)(`div`,{className:`ripple-lesson-spot-head`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Spotlight — walk the real code`}),(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>g(0),"aria-label":`Step through the code one part at a time`,children:[`▶ Step through (`,P.length,`)`]})]}),h===null?(0,S.jsx)(`ol`,{className:`ripple-walk`,children:P.map((e,t)=>(0,S.jsxs)(`li`,{className:`ripple-walk-step`,children:[(0,S.jsxs)(`div`,{className:`ripple-walk-where`,children:[(0,S.jsx)(`span`,{className:`ripple-walk-num`,"aria-hidden":`true`,children:t+1}),(0,S.jsx)(O,{file:e.file,focus:e.focus,url:a(e.file)})]}),e.code&&(0,S.jsx)(`pre`,{className:`ripple-walk-code`,children:(0,S.jsx)(`code`,{children:e.code})}),(0,S.jsx)(`p`,{className:`ripple-walk-explain`,children:e.explain})]},t))}):(0,S.jsx)(ne,{steps:P,index:h,fileUrl:a,onPrev:()=>g(D),onNext:()=>g(e=>e===null?null:Math.min(P.length-1,e+1)),onClose:()=>g(null)})]}),t[35]=a,t[36]=h,t[37]=P,t[38]=i):i=t[38];let s;t[39]===d.concepts?s=t[40]:(s=d.concepts.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Key concepts`}),(0,S.jsx)(`dl`,{className:`ripple-lesson-concepts`,children:d.concepts.map(E)})]}),t[39]=d.concepts,t[40]=s);let c;t[41]===d.pitfalls?c=t[42]:(c=d.pitfalls&&d.pitfalls.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-caution`,role:`note`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Watch out for`}),(0,S.jsx)(`ul`,{className:`ripple-lesson-pitfalls`,children:d.pitfalls.map(T)})]}),t[41]=d.pitfalls,t[42]=c);let l;t[43]===d.exercise?l=t[44]:(l=d.exercise&&(0,S.jsxs)(`section`,{className:`ripple-course-group ripple-lesson-exercise`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Try it`}),(0,S.jsx)(`p`,{className:`ripple-lesson-task`,children:d.exercise.task}),d.exercise.hint&&(0,S.jsxs)(`p`,{className:`ripple-lesson-hint`,children:[`Hint — `,d.exercise.hint]}),d.exercise.check&&(0,S.jsxs)(`p`,{className:`ripple-lesson-check`,children:[`How you’ll know it worked — `,d.exercise.check]})]}),t[43]=d.exercise,t[44]=l);let u;t[45]!==o||t[46]!==A?(u=o&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-lesson-regen`,onClick:()=>A(!0),title:`Rewrite this lesson from the latest code`,children:`↻ Rewrite this lesson`}),t[45]=o,t[46]=A,t[47]=u):u=t[47];let f;return t[48]!==e||t[49]!==n||t[50]!==r||t[51]!==i||t[52]!==s||t[53]!==c||t[54]!==l||t[55]!==u?(f=(0,S.jsxs)(S.Fragment,{children:[e,n,r,i,s,c,l,u]}),t[48]=e,t[49]=n,t[50]=r,t[51]=i,t[52]=s,t[53]=c,t[54]=l,t[55]=u,t[56]=f):f=t[56],f}if(p===`loading`){let e,n;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),n=(0,S.jsx)(`div`,{className:`ripple-course-skeleton-title`,children:`Writing this lesson from the real code…`}),t[57]=e,t[58]=n):(e=t[57],n=t[58]);let i;t[59]===r.read?i=t[60]:(i=r.read.slice(0,3).join(`, `)||`the relevant files`,t[59]=r.read,t[60]=i);let a;return t[61]===i?a=t[62]:(a=(0,S.jsxs)(`div`,{className:`ripple-course-skeleton`,role:`status`,"aria-live":`polite`,children:[e,n,(0,S.jsxs)(`div`,{className:`ripple-course-skeleton-sub`,children:[`Reading `,i,` to teach it properly — with a walk through the actual code.`]})]}),t[61]=i,t[62]=a),a}if(p===`error`){let e;t[63]===L?e=t[64]:(e=L&&(0,S.jsx)(`p`,{className:`ripple-course-lede`,children:L}),t[63]=L,t[64]=e);let n;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,S.jsx)(`p`,{children:`Couldn’t write this lesson from the code just now.`}),t[65]=n):n=t[65];let r;t[66]===A?r=t[67]:(r=(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>A(!0),children:`Try again`}),t[66]=A,t[67]=r);let i;return t[68]!==e||t[69]!==r?(i=(0,S.jsxs)(`div`,{className:`ripple-course-empty`,children:[e,n,r]}),t[68]=e,t[69]=r,t[70]=i):i=t[70],i}let re;t[71]===R?re=t[72]:(re=(0,S.jsx)(`p`,{className:`ripple-course-explain`,children:R}),t[71]=R,t[72]=re);let ie;t[73]!==a||t[74]!==r.read?(ie=r.read.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Open and read`}),(0,S.jsx)(`div`,{className:`ripple-course-files`,children:r.read.map(e=>(0,S.jsx)(O,{file:e,url:a(e)},e))})]}),t[73]=a,t[74]=r.read,t[75]=ie):ie=t[75];let ae;t[76]===r.concepts?ae=t[77]:(ae=r.concepts.length>0&&(0,S.jsxs)(`section`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Key concepts`}),(0,S.jsx)(`ul`,{className:`ripple-course-concepts`,children:r.concepts.map(w)})]}),t[76]=r.concepts,t[77]=ae);let V;t[78]===r.caution?V=t[79]:(V=r.caution&&(0,S.jsxs)(`section`,{className:`ripple-course-caution`,role:`note`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Be careful here — and why`}),(0,S.jsx)(`p`,{className:`ripple-course-caution-text`,children:r.caution})]}),t[78]=r.caution,t[79]=V);let oe;return t[80]!==B||t[81]!==re||t[82]!==ie||t[83]!==ae||t[84]!==V?(oe=(0,S.jsxs)(S.Fragment,{children:[re,B,ie,ae,V]}),t[80]=B,t[81]=re,t[82]=ie,t[83]=ae,t[84]=V,t[85]=oe):oe=t[85],oe}function w(e,t){return(0,S.jsx)(`li`,{children:e},t)}function T(e,t){return(0,S.jsx)(`li`,{children:e},t)}function E(e,t){return(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`dt`,{children:e.term}),(0,S.jsx)(`dd`,{children:e.explain})]},t)}function D(e){return e===null?null:Math.max(0,e-1)}function ee(e,t){return(0,S.jsx)(`p`,{children:e},t)}function te(e){return e.trim().length>0}function O(e){let t=(0,u.c)(3),{file:n,focus:r,url:i}=e,a=r?`${n} · ${r}`:n,o;return t[0]!==a||t[1]!==i?(o=i?(0,S.jsxs)(`a`,{className:`ripple-course-file ripple-course-file-link`,href:i,target:`_blank`,rel:`noreferrer noopener`,children:[a,` ↗`]}):(0,S.jsx)(`code`,{className:`ripple-course-file`,children:a}),t[0]=a,t[1]=i,t[2]=o):o=t[2],o}function ne(e){let t=(0,u.c)(36),{steps:n,index:r,fileUrl:i,onPrev:a,onNext:o,onClose:s}=e,c=n[r],l=r+1,d;t[0]!==n.length||t[1]!==l?(d=(0,S.jsxs)(`span`,{className:`ripple-spotlight-count`,children:[l,` / `,n.length]}),t[0]=n.length,t[1]=l,t[2]=d):d=t[2];let f=c.file,p=c.focus,m;t[3]!==i||t[4]!==c.file?(m=i(c.file),t[3]=i,t[4]=c.file,t[5]=m):m=t[5];let h;t[6]!==c.file||t[7]!==c.focus||t[8]!==m?(h=(0,S.jsx)(O,{file:f,focus:p,url:m}),t[6]=c.file,t[7]=c.focus,t[8]=m,t[9]=h):h=t[9];let g;t[10]===s?g=t[11]:(g=(0,S.jsx)(`button`,{type:`button`,className:`ripple-spotlight-x`,onClick:s,"aria-label":`Exit spotlight`,children:`✕`}),t[10]=s,t[11]=g);let _;t[12]!==d||t[13]!==h||t[14]!==g?(_=(0,S.jsxs)(`div`,{className:`ripple-spotlight-bar`,children:[d,h,g]}),t[12]=d,t[13]=h,t[14]=g,t[15]=_):_=t[15];let v;t[16]===c.code?v=t[17]:(v=c.code&&(0,S.jsx)(`pre`,{className:`ripple-walk-code ripple-spotlight-code`,children:(0,S.jsx)(`code`,{children:c.code})}),t[16]=c.code,t[17]=v);let y;t[18]===c.explain?y=t[19]:(y=(0,S.jsx)(`p`,{className:`ripple-spotlight-explain`,children:c.explain}),t[18]=c.explain,t[19]=y);let b=r===0,x;t[20]!==a||t[21]!==b?(x=(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:a,disabled:b,children:`← Back`}),t[20]=a,t[21]=b,t[22]=x):x=t[22];let C;t[23]!==r||t[24]!==s||t[25]!==o||t[26]!==n.length?(C=r<n.length-1?(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:o,children:`Next →`}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:s,children:`Done ✓`}),t[23]=r,t[24]=s,t[25]=o,t[26]=n.length,t[27]=C):C=t[27];let w;t[28]!==x||t[29]!==C?(w=(0,S.jsxs)(`div`,{className:`ripple-spotlight-nav`,children:[x,C]}),t[28]=x,t[29]=C,t[30]=w):w=t[30];let T;return t[31]!==y||t[32]!==w||t[33]!==_||t[34]!==v?(T=(0,S.jsxs)(`div`,{className:`ripple-spotlight`,role:`group`,"aria-label":`Code spotlight`,children:[_,v,y,w]}),t[31]=y,t[32]=w,t[33]=_,t[34]=v,t[35]=T):T=t[35],T}function k(e){let t=(0,u.c)(56),{questions:n,onFinish:r,children:i}=e,[a,o]=(0,l.useState)(0),[s,c]=(0,l.useState)(`ask`),[d,f]=(0,l.useState)(null),[p,m]=(0,l.useState)(!1),[h,g]=(0,l.useState)(0),[_,v]=(0,l.useState)(!1),[y,x]=(0,l.useState)(null),C=n.length,w=n[Math.min(a,C-1)],T=!!(w.choices&&w.choices.length>=2&&w.correct!==void 0),E;t[0]===s?E=t[1]:(E=e=>{s!==`graded`&&(m(e),c(`graded`),e&&g(j))},t[0]=s,t[1]=E);let D=E,ee;t[2]!==D||t[3]!==s||t[4]!==w.correct?(ee=e=>{s!==`graded`&&(f(e),D(e===w.correct))},t[2]=D,t[3]=s,t[4]=w.correct,t[5]=ee):ee=t[5];let te=ee,O;t[6]===s?O=t[7]:(O=()=>{s===`ask`&&c(`revealed`)},t[6]=s,t[7]=O);let ne=O,k;t[8]!==h||t[9]!==a||t[10]!==r||t[11]!==C?(k=()=>{if(a+1>=C){let e={correct:h,total:C};x(e),v(!0),r?.(e);return}o(A),c(`ask`),f(null),m(!1)},t[8]=h,t[9]=a,t[10]=r,t[11]=C,t[12]=k):k=t[12];let M=k;if(_&&y){let e=y.total-y.correct,n=b(y.correct,y.total),r=n?`true`:void 0,a;t[13]!==y.correct||t[14]!==y.total?(a=(0,S.jsxs)(`div`,{className:`ripple-quiz-score-num`,children:[y.correct,`/`,y.total]}),t[13]=y.correct,t[14]=y.total,t[15]=a):a=t[15];let o=n?`You know this one — nice work.`:`Worth another pass — ${e} to revisit.`,s;t[16]===o?s=t[17]:(s=(0,S.jsx)(`p`,{className:`ripple-quiz-score-text`,children:o}),t[16]=o,t[17]=s);let c;t[18]!==r||t[19]!==a||t[20]!==s?(c=(0,S.jsxs)(`div`,{className:`ripple-quiz-score`,"data-passed":r,role:`status`,children:[a,s]}),t[18]=r,t[19]=a,t[20]=s,t[21]=c):c=t[21];let l;return t[22]!==i||t[23]!==c?(l=(0,S.jsxs)(`div`,{className:`ripple-quiz-done`,children:[c,i]}),t[22]=i,t[23]=c,t[24]=l):l=t[24],l}let N=`Question ${a+1} of ${C}`,P=a+1,F;t[25]!==P||t[26]!==C?(F=(0,S.jsxs)(`div`,{className:`ripple-quiz-progress`,children:[`Question `,P,` of `,C]}),t[25]=P,t[26]=C,t[27]=F):F=t[27];let I;t[28]===w.question?I=t[29]:(I=(0,S.jsx)(`p`,{className:`ripple-course-q`,children:w.question}),t[28]=w.question,t[29]=I);let L;t[30]!==D||t[31]!==T||t[32]!==s||t[33]!==te||t[34]!==d||t[35]!==w.answer||t[36]!==w.choices||t[37]!==w.correct||t[38]!==ne?(L=T?(0,S.jsx)(`ul`,{className:`ripple-quiz-choices`,children:w.choices.map((e,t)=>{let n=`idle`;return s===`graded`&&(t===w.correct?n=`correct`:t===d&&(n=`wrong`)),(0,S.jsx)(`li`,{children:(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-choice`,"data-state":n,onClick:()=>te(t),disabled:s===`graded`,"aria-pressed":d===t,children:e})},t)})}):(0,S.jsxs)(`div`,{className:`ripple-quiz-plain`,children:[s===`ask`&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:ne,children:`Show answer`}),s!==`ask`&&(0,S.jsx)(`p`,{className:`ripple-course-a`,children:w.answer}),s===`revealed`&&(0,S.jsxs)(`div`,{className:`ripple-quiz-selfgrade`,children:[(0,S.jsx)(`span`,{className:`ripple-quiz-selfgrade-prompt`,children:`Did you get it?`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-selfgrade-btn`,"data-answer":`yes`,onClick:()=>D(!0),children:`Yes, I had it`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-quiz-selfgrade-btn`,"data-answer":`no`,onClick:()=>D(!1),children:`Not quite`})]})]}),t[30]=D,t[31]=T,t[32]=s,t[33]=te,t[34]=d,t[35]=w.answer,t[36]=w.choices,t[37]=w.correct,t[38]=ne,t[39]=L):L=t[39];let R;t[40]!==s||t[41]!==w.explain||t[42]!==p?(R=s===`graded`&&(0,S.jsxs)(`div`,{className:`ripple-quiz-feedback`,"data-right":p?`true`:void 0,children:[(0,S.jsx)(`p`,{className:`ripple-quiz-feedback-label`,children:p?`Correct`:`Not quite`}),w.explain&&(0,S.jsx)(`p`,{className:`ripple-quiz-explain`,children:w.explain})]}),t[40]=s,t[41]=w.explain,t[42]=p,t[43]=R):R=t[43];let z;t[44]!==M||t[45]!==a||t[46]!==s||t[47]!==C?(z=s===`graded`&&(0,S.jsx)(`div`,{className:`ripple-quiz-actions`,children:(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:M,children:a+1>=C?`See your score →`:`Next question →`})}),t[44]=M,t[45]=a,t[46]=s,t[47]=C,t[48]=z):z=t[48];let B;return t[49]!==R||t[50]!==z||t[51]!==N||t[52]!==F||t[53]!==I||t[54]!==L?(B=(0,S.jsxs)(`div`,{className:`ripple-quiz`,role:`group`,"aria-label":N,children:[F,I,L,R,z]}),t[49]=R,t[50]=z,t[51]=N,t[52]=F,t[53]=I,t[54]=L,t[55]=B):B=t[55],B}function A(e){return e+1}function j(e){return e+1}var M=e=>e.slice(0,7),N={beginner:`Beginner`,intermediate:`Intermediate`,expert:`Expert`};function P({title:e,sub:t,preview:n=!1}){return(0,S.jsxs)(`div`,{className:`ripple-course-skeleton`+(n?` ripple-course-skeleton--preview`:``),role:`status`,"aria-live":`polite`,children:[(0,S.jsxs)(`div`,{className:`ripple-course-skeleton-head`,children:[(0,S.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),(0,S.jsx)(`div`,{className:`ripple-course-skeleton-title`,children:e})]}),(0,S.jsx)(`div`,{className:`ripple-course-skeleton-sub`,children:t}),(0,S.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`}),n&&(0,S.jsx)(`div`,{className:`ripple-course-skeleton-lessons`,"aria-hidden":`true`,children:[0,1,2,3].map(e=>(0,S.jsxs)(`div`,{className:`ripple-skel-lesson`,children:[(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-step`}),(0,S.jsxs)(`span`,{className:`ripple-skel-lines`,children:[(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-line-title`}),(0,S.jsx)(`span`,{className:`ripple-skel-bar ripple-skel-line-meta`})]})]},e))})]})}function F(e){let t=(0,u.c)(137),{model:n,altitude:d,building:f,onRegenerate:p,loadLessonDetail:m,loadCourseClosing:h,courseFocus:w,onCourseFocus:T,speak:E,commitSha:D,compareSinceBuilt:ee,openFullAnalysis:te,onAskAboutLesson:O}=e,ne;t[0]===n.courses?ne=t[1]:(ne=n.courses??[],t[0]=n.courses,t[1]=ne);let A=ne,j=n.pr.repo||``,F=n.pr.branch||`HEAD`,V=j?o(j):void 0,oe=!!(!n.provenance.example&&j&&D&&V?.commitSha&&V.commitSha!==D),[H,se]=(0,l.useState)(0),U=A[Math.min(H,Math.max(0,A.length-1))],W=U?`${j||`repo`}::${U.title}`:`repo`,ce;t[2]===W?ce=t[3]:(ce=()=>g(W),t[2]=W,t[3]=ce);let[G,le]=(0,l.useState)(ce),ue,de;t[4]===W?(ue=t[5],de=t[6]):(ue=()=>le(g(W)),de=[W],t[4]=W,t[5]=ue,t[6]=de),(0,l.useEffect)(ue,de);let fe;t[7]===W?fe=t[8]:(fe=(e,t)=>{le(new Set(_(W,e,t)))},t[7]=W,t[8]=fe);let pe=fe,[K,q]=(0,l.useState)(0),[me,he]=(0,l.useState)(!1),ge;t[9]===W?ge=t[10]:(ge=()=>v(W),t[9]=W,t[10]=ge);let[J,_e]=(0,l.useState)(ge),[ve,ye]=(0,l.useState)(0),[be,xe]=(0,l.useState)(!1),Se;t[11]!==H||t[12]!==A||t[13]!==W||t[14]!==q||t[15]!==xe?(Se=()=>{let e=g(W),t=(A[H]?.lessons??[]).findIndex((t,n)=>!e.has(n));q(t===-1?0:t),_e(v(W)),ye(0),xe(!1)},t[11]=H,t[12]=A,t[13]=W,t[14]=q,t[15]=xe,t[16]=Se):Se=t[16];let Ce;t[17]!==H||t[18]!==A||t[19]!==W?(Ce=[W,H,A],t[17]=H,t[18]=A,t[19]=W,t[20]=Ce):Ce=t[20],(0,l.useEffect)(Se,Ce);let we;t[21]===he?we=t[22]:(we=()=>he(!1),t[21]=he,t[22]=we);let Te;t[23]!==K||t[24]!==H?(Te=[K,H],t[23]=K,t[24]=H,t[25]=Te):Te=t[25],(0,l.useEffect)(we,Te);let[Ee,De]=(0,l.useState)(null),[Oe,ke]=(0,l.useState)(`idle`),[Ae,je]=(0,l.useState)(0),Me=(0,l.useRef)(null),Ne;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>{De(null),ke(`idle`),Me.current=null},t[26]=Ne):Ne=t[26];let Pe;t[27]===H?Pe=t[28]:(Pe=[H],t[27]=H,t[28]=Pe),(0,l.useEffect)(Ne,Pe);let Fe,Ie;t[29]!==K||t[30]!==Ae||t[31]!==H||t[32]!==A||t[33]!==h?(Fe=()=>{let e=A[H];if(!e||!h||K<e.lessons.length||e.quiz?.length||e.capstone)return;let t=`${H}:${Ae}`;if(Me.current===t)return;Me.current=t;let n=!0;return ke(`loading`),h(e).then(e=>{n&&(e&&(e.quiz?.length||e.capstone)?(De(e),ke(`ready`)):ke(`error`))}),()=>{n=!1}},Ie=[A,H,K,h,Ae],t[29]=K,t[30]=Ae,t[31]=H,t[32]=A,t[33]=h,t[34]=Fe,t[35]=Ie):(Fe=t[34],Ie=t[35]),(0,l.useEffect)(Fe,Ie);let Le;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Le=()=>je(ae),t[36]=Le):Le=t[36];let Re=Le,[Y,ze]=(0,l.useState)(null),[Be,Ve]=(0,l.useState)(``),[He,Ue]=(0,l.useState)(!1),[We,Ge]=(0,l.useState)(!1),[Ke,qe]=(0,l.useState)(``),Je;if(t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Je=()=>{ze(null),Ve(``),Ue(!1),qe(``)},t[37]=Je):Je=t[37],(0,l.useEffect)(Je,[V?.commitSha,D]),A.length===0||!U){if(f){let e;return t[38]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,S.jsx)(P,{title:`Building your curriculum from the code…`,sub:`Reading the README, the areas, and the real files to write a leveled course you can climb without fear.`,preview:!0}),t[38]=e):e=t[38],e}let e;return t[39]===p?e=t[40]:(e=(0,S.jsx)(`div`,{className:`ripple-course-empty`,children:p?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{children:`Couldn’t build a course from this view yet.`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:p,children:`Try again`})]}):(0,S.jsx)(`p`,{children:`Connect a model in Settings to generate a course from this code.`})}),t[39]=p,t[40]=e),e}let X=U.lessons,Z=X[Math.min(K,X.length-1)],Ye=X.reduce(ie,0),Xe;t[41]!==G.size||t[42]!==X.length?(Xe=Math.round(G.size/X.length*100),t[41]=G.size,t[42]=X.length,t[43]=Xe):Xe=t[43];let Ze=Xe,Qe;t[44]!==Ee?.quiz||t[45]!==U.quiz?(Qe=U.quiz??Ee?.quiz??[],t[44]=Ee?.quiz,t[45]=U.quiz,t[46]=Qe):Qe=t[46];let Q=Qe,$=U.capstone??Ee?.capstone,$e=X.length>0&&(Q.length>0||!!$||!!h),et=$e&&K>=X.length,tt=K<X.length-1||$e,nt;t[47]===W?nt=t[48]:(nt=e=>{y(W,e.correct,e.total),_e(v(W))},t[47]=W,t[48]=nt);let rt=nt,it;t[49]!==U.title||t[50]!==Q||t[51]!==j?(it=()=>{ye(i(Q.map(re),{deck:`Ripple · ${j||`this repo`}`,tags:[U.title],source:{topic:U.title,ts:Date.now()},origin:`auto`}).length)},t[49]=U.title,t[50]=Q,t[51]=j,t[52]=it):it=t[52];let at=it,ot;t[53]!==ve||t[54]!==at?(ot=()=>ve>0?(0,S.jsxs)(`p`,{className:`ripple-quiz-flash-saved`,children:[`+`,ve,` card`,ve===1?``:`s`,` saved to your deck`]}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:at,children:`Keep these as flashcards`}),t[53]=ve,t[54]=at,t[55]=ot):ot=t[55];let st=ot,ct=oe&&Y?s(X,Y):new Set,lt=async()=>{if(Y)return Y;if(!ee||!V?.commitSha||!D)return null;Ge(!0),qe(``);let e=await ee(V.commitSha,D);if(Ge(!1),!e.ok||!e.diff)return qe(e.detail||`Couldn’t load what changed.`),null;let t=a(e.diff).files.map(B);return ze(t),Ve(e.diff),t},ut=()=>{if(He){Ue(!1);return}lt().then(e=>{e&&Ue(!0)})},dt=()=>{lt().then(e=>{if(!e)return;let t=s(X,e);t.size>0&&q(Math.min(...t))})},ft=()=>{!Be||!te||!V||!D||te(Be,`${j} ${M(V.commitSha)}...${M(D)}`,j)},pt;t[56]===j?pt=t[57]:(pt=e=>{let t=`${j||`repo`}::${e.title}`,n=v(t);return{lessonsDone:g(t).size,lessonsTotal:e.lessons.length,hasQuiz:(e.quiz?.length??0)>0,quizPassed:!!n&&b(n.correct,n.total)}},t[56]=j,t[57]=pt);let mt=pt,ht;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,S.jsx)(`span`,{className:`ripple-course-pill`,children:`Guided curriculum`}),t[58]=ht):ht=t[58];let gt;t[59]!==f||t[60]!==w||t[61]!==n.modules||t[62]!==T?(gt=T&&n.modules.length>1&&(0,S.jsxs)(`div`,{className:`ripple-course-focus`,title:`Build the course around one area — best on a large repo, where a whole-repo course only skims. Whole repo prioritises the highest-impact areas.`,children:[(0,S.jsx)(`span`,{className:`ripple-course-focus-label`,children:`Focus`}),(0,S.jsx)(r,{ariaLabel:`Course focus`,triggerClassName:`ripple-course-focus-select`,value:w??``,onChange:e=>T(e||void 0),disabled:f,options:[{value:``,label:`Whole repo`},...n.modules.slice(0,50).map(z)]})]}),t[59]=f,t[60]=w,t[61]=n.modules,t[62]=T,t[63]=gt):gt=t[63];let _t;t[64]!==f||t[65]!==p?(_t=p&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-regen`,onClick:p,disabled:f,title:`Rebuild the curriculum from the latest code`,children:f?`Rebuilding…`:`↻ Regenerate`}),t[64]=f,t[65]=p,t[66]=_t):_t=t[66];let vt;t[67]!==gt||t[68]!==_t?(vt=(0,S.jsxs)(`div`,{className:`ripple-course-head-top`,children:[ht,gt,_t]}),t[67]=gt,t[68]=_t,t[69]=vt):vt=t[69];let yt;t[70]!==H||t[71]!==A||t[72]!==mt||t[73]!==j?(yt=A.length>1&&(0,S.jsx)(`div`,{className:`ripple-course-tracks`,role:`tablist`,"aria-label":`Courses`,children:A.map((e,t)=>{let n=g(`${j||`repo`}::${e.title}`).size,r=n>=e.lessons.length,i=t>0?A[t-1]:void 0,a=!!i&&x(mt(i));return(0,S.jsxs)(`button`,{type:`button`,role:`tab`,className:`ripple-course-track`,"data-active":t===H?`true`:void 0,"data-locked":a?`true`:void 0,"aria-selected":t===H,onClick:()=>se(t),children:[(0,S.jsxs)(`span`,{className:`ripple-course-track-top`,children:[(0,S.jsx)(`span`,{className:`ripple-course-step`,"data-done":r?`true`:void 0,children:r?`✓`:t+1}),e.level?(0,S.jsx)(`span`,{className:`ripple-course-level`,"data-level":e.level,children:N[e.level]}):(0,S.jsxs)(`span`,{className:`ripple-course-track-meta`,children:[n,`/`,e.lessons.length]})]}),(0,S.jsx)(`span`,{className:`ripple-course-track-title`,children:e.title}),a&&(0,S.jsxs)(`span`,{className:`ripple-course-track-lock`,children:[(0,S.jsx)(`span`,{"aria-hidden":`true`,children:`🔒`}),` Usually after “`,i.title,`” —`,` `,(0,S.jsx)(`span`,{className:`ripple-course-track-skip`,children:`I already know this, skip ahead`})]})]},e.title)})}),t[70]=H,t[71]=A,t[72]=mt,t[73]=j,t[74]=yt):yt=t[74];let bt;t[75]===U.title?bt=t[76]:(bt=(0,S.jsx)(`h2`,{className:`ripple-course-title`,children:U.title}),t[75]=U.title,t[76]=bt);let xt;t[77]===U.subtitle?xt=t[78]:(xt=U.subtitle&&(0,S.jsx)(`p`,{className:`ripple-course-sub`,children:U.subtitle}),t[77]=U.subtitle,t[78]=xt);let St=Ye>0?` · ~${Ye} min`:``,Ct;t[79]!==G.size||t[80]!==X.length||t[81]!==St?(Ct=(0,S.jsxs)(`div`,{className:`ripple-course-meta`,children:[X.length,` lessons`,St,` · `,G.size,`/`,X.length,` done`]}),t[79]=G.size,t[80]=X.length,t[81]=St,t[82]=Ct):Ct=t[82];let wt=`${Ze}%`,Tt;t[83]===wt?Tt=t[84]:(Tt=(0,S.jsx)(`div`,{className:`ripple-course-bar`,"aria-hidden":`true`,children:(0,S.jsx)(`span`,{style:{width:wt}})}),t[83]=wt,t[84]=Tt);let Et;t[85]!==vt||t[86]!==yt||t[87]!==bt||t[88]!==xt||t[89]!==Ct||t[90]!==Tt?(Et=(0,S.jsxs)(`header`,{className:`ripple-course-head`,children:[vt,yt,bt,xt,Ct,Tt]}),t[85]=vt,t[86]=yt,t[87]=bt,t[88]=xt,t[89]=Ct,t[90]=Tt,t[91]=Et):Et=t[91];let Dt=oe&&V&&(0,S.jsxs)(`div`,{className:`ripple-course-stale`,role:`status`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`The code moved`}),(0,S.jsxs)(`p`,{className:`ripple-course-stale-text`,children:[`The code moved since this course was built (`,(0,S.jsx)(`code`,{children:M(V.commitSha)}),` →`,` `,(0,S.jsx)(`code`,{children:M(D)}),`).`]}),Ke&&(0,S.jsx)(`p`,{className:`ripple-course-stale-err`,children:Ke}),(0,S.jsxs)(`div`,{className:`ripple-course-stale-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:ut,disabled:We,children:We?`Loading…`:He?`Hide what changed`:`See what changed`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:dt,disabled:We,children:`Refresh stale lessons`}),p&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:p,disabled:f,children:`Rebuild course`})]}),He&&Y&&(0,S.jsxs)(`div`,{className:`ripple-course-changed-panel`,children:[(0,S.jsx)(`ul`,{children:Y.slice(0,20).map(R)}),Y.length>20&&(0,S.jsxs)(`p`,{className:`ripple-course-changed-more`,children:[`+`,Y.length-20,` more file`,Y.length-20==1?``:`s`]}),te&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-stale-btn`,onClick:ft,children:`Open as a full analysis →`})]})]}),Ot=X.map((e,t)=>{let n=G.has(t),r=ct.has(t);return(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-item`,"data-active":t===K?`true`:void 0,"data-done":n?`true`:void 0,"data-stale":r?`true`:void 0,onClick:()=>q(t),children:[(0,S.jsx)(`span`,{className:`ripple-course-num`,"aria-hidden":`true`,children:n?`✓`:t+1}),(0,S.jsxs)(`span`,{className:`ripple-course-item-body`,children:[(0,S.jsxs)(`span`,{className:`ripple-course-item-title`,children:[e.title,r&&(0,S.jsx)(`span`,{className:`ripple-course-item-stale`,title:`Its files changed since this course was built`,children:`stale`})]}),e.minutes?(0,S.jsxs)(`span`,{className:`ripple-course-item-min`,children:[`~`,e.minutes,` min`]}):null]})]},t)}),kt;t[92]!==$e||t[93]!==$||t[94]!==X.length||t[95]!==et||t[96]!==Q.length||t[97]!==q?(kt=$e&&(0,S.jsxs)(`button`,{type:`button`,className:`ripple-course-item ripple-course-item-quiz`,"data-active":et?`true`:void 0,onClick:()=>q(X.length),children:[(0,S.jsx)(`span`,{className:`ripple-course-num`,"aria-hidden":`true`,children:`★`}),(0,S.jsxs)(`span`,{className:`ripple-course-item-body`,children:[(0,S.jsx)(`span`,{className:`ripple-course-item-title`,children:Q.length>0?`Quiz`:$?`Capstone`:`Wrap-up`}),(0,S.jsx)(`span`,{className:`ripple-course-item-min`,children:Q.length>0?`${Q.length} question${Q.length===1?``:`s`}`:$?`Closing project`:`Quiz & capstone`})]})]}),t[92]=$e,t[93]=$,t[94]=X.length,t[95]=et,t[96]=Q.length,t[97]=q,t[98]=kt):kt=t[98];let At;t[99]!==Ot||t[100]!==kt?(At=(0,S.jsxs)(`nav`,{className:`ripple-course-list`,"aria-label":`Lessons`,children:[Ot,kt]}),t[99]=Ot,t[100]=kt,t[101]=At):At=t[101];let jt;t[102]!==K||t[103]!==d||t[104]!==$||t[105]!==Oe||t[106]!==U||t[107]!==H||t[108]!==G||t[109]!==rt||t[110]!==st||t[111]!==tt||t[112]!==Z||t[113]!==X.length||t[114]!==m||t[115]!==pe||t[116]!==O||t[117]!==et||t[118]!==Q||t[119]!==J||t[120]!==F||t[121]!==j||t[122]!==be||t[123]!==Re||t[124]!==me||t[125]!==q||t[126]!==xe||t[127]!==he||t[128]!==E?(jt=(0,S.jsx)(`article`,{className:`ripple-course-lesson`,"aria-live":`polite`,children:et?(0,S.jsx)(S.Fragment,{children:Q.length===0&&!$&&Oe===`loading`?(0,S.jsx)(P,{title:`Writing the quiz & capstone for ${U.title}…`,sub:`A few end-of-week questions and a small hands-on project, grounded in what this week studied.`}):Q.length===0&&!$&&Oe===`error`?(0,S.jsxs)(`div`,{className:`ripple-course-empty`,children:[(0,S.jsx)(`p`,{children:`Couldn’t build the quiz & capstone for this course yet.`}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:Re,children:`Try again`})]}):(0,S.jsxs)(S.Fragment,{children:[Q.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Course quiz`}),(0,S.jsx)(`h3`,{className:`ripple-course-lesson-title`,children:`Test yourself`}),(0,S.jsxs)(`p`,{className:`ripple-course-explain`,children:[`Answer these to be sure you really understood `,U.title,`.`]}),J&&!be?(0,S.jsxs)(`div`,{className:`ripple-quiz-done`,children:[(0,S.jsxs)(`div`,{className:`ripple-quiz-score`,"data-passed":b(J.correct,J.total)?`true`:void 0,role:`status`,children:[(0,S.jsxs)(`div`,{className:`ripple-quiz-score-num`,children:[J.correct,`/`,J.total]}),(0,S.jsx)(`p`,{className:`ripple-quiz-score-text`,children:b(J.correct,J.total)?`You know this one — nice work.`:`Worth another pass — ${J.total-J.correct} to revisit.`})]}),(0,S.jsx)(`div`,{className:`ripple-quiz-flashcards`,children:st()}),(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:()=>xe(!0),children:`Retake the quiz`})]}):(0,S.jsx)(k,{questions:Q,onFinish:e=>{rt(e),xe(!1)},children:(0,S.jsx)(`div`,{className:`ripple-quiz-flashcards`,children:st()})},`quiz:${H}`)]}),$&&(0,S.jsxs)(`section`,{className:`ripple-course-capstone`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Capstone`}),(0,S.jsx)(`h4`,{className:`ripple-course-capstone-title`,children:$.title}),(0,S.jsx)(`p`,{className:`ripple-course-capstone-brief`,children:$.brief}),$.steps.length>0&&(0,S.jsxs)(`div`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-course-capstone-label`,children:`Do this`}),(0,S.jsx)(`ol`,{className:`ripple-course-capstone-steps`,children:$.steps.map(L)})]}),$.acceptance.length>0&&(0,S.jsxs)(`div`,{className:`ripple-course-group`,children:[(0,S.jsx)(`div`,{className:`ripple-course-capstone-label`,children:`You’ll know it worked when`}),(0,S.jsx)(`ul`,{className:`ripple-course-capstone-accept`,children:$.acceptance.map(I)})]})]})]})}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`ripple-eyebrow`,children:[`Lesson `,K+1,` of `,X.length,Z.minutes?` · ~${Z.minutes} min`:``]}),(0,S.jsx)(`h3`,{className:`ripple-course-lesson-title`,children:Z.title}),(0,S.jsx)(C,{course:U,lesson:Z,altitude:d,repo:j,gitRef:F,fileUrl:e=>c(j,F,e),loadLessonDetail:m,speak:E,onAskAboutLesson:O},`${H}:${K}:${d}`),Z.checkpoint&&(0,S.jsxs)(`section`,{className:`ripple-course-checkpoint`,children:[(0,S.jsx)(`div`,{className:`ripple-eyebrow`,children:`Check yourself`}),(0,S.jsx)(`p`,{className:`ripple-course-q`,children:Z.checkpoint.question}),me?(0,S.jsx)(`p`,{className:`ripple-course-a`,children:Z.checkpoint.answer}):(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-reveal`,onClick:()=>he(!0),children:`Show answer`})]}),(0,S.jsxs)(`div`,{className:`ripple-course-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-done`,onClick:()=>{let e=G.has(K);pe(K,!e),!e&&tt&&q(K+1)},children:G.has(K)?`Done ✓`:tt?`Mark done & next →`:`Mark done ✓`}),tt&&(0,S.jsx)(`button`,{type:`button`,className:`ripple-course-skip`,onClick:()=>q(K+1),children:K===X.length-1?`Take the quiz →`:`Skip ahead`})]})]})}),t[102]=K,t[103]=d,t[104]=$,t[105]=Oe,t[106]=U,t[107]=H,t[108]=G,t[109]=rt,t[110]=st,t[111]=tt,t[112]=Z,t[113]=X.length,t[114]=m,t[115]=pe,t[116]=O,t[117]=et,t[118]=Q,t[119]=J,t[120]=F,t[121]=j,t[122]=be,t[123]=Re,t[124]=me,t[125]=q,t[126]=xe,t[127]=he,t[128]=E,t[129]=jt):jt=t[129];let Mt;t[130]!==At||t[131]!==jt?(Mt=(0,S.jsxs)(`div`,{className:`ripple-course-body`,children:[At,jt]}),t[130]=At,t[131]=jt,t[132]=Mt):Mt=t[132];let Nt;return t[133]!==Et||t[134]!==Dt||t[135]!==Mt?(Nt=(0,S.jsxs)(`div`,{className:`ripple-course`,children:[Et,Dt,Mt]}),t[133]=Et,t[134]=Dt,t[135]=Mt,t[136]=Nt):Nt=t[136],Nt}function I(e,t){return(0,S.jsx)(`li`,{children:e},t)}function L(e,t){return(0,S.jsx)(`li`,{children:e},t)}function R(e){return(0,S.jsx)(`li`,{children:e},e)}function z(e){return{value:e.name,label:e.name}}function B(e){return e.path}function re(e){return{front:e.question,back:e.answer}}function ie(e,t){return e+(t.minutes??0)}function ae(e){return e+1}export{F as ShipCourse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";var r=e(),i=n(),a=t();function o(e){return e===`haunted`?`var(--danger)`:e===`hot`?`var(--warning)`:`var(--insight)`}function s(e){return e===`incident`?`var(--danger)`:`var(--presence)`}function c(e){let t=(0,i.c)(50),{model:n}=e,{hotspots:s}=n,[c,d]=(0,r.useState)(s[0]?.id??``),f;t[0]!==s||t[1]!==c?(f=s.find(e=>e.id===c)??s[0],t[0]=s,t[1]=c,t[2]=f):f=t[2];let p=f;if(!p){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,a.jsxs)(`div`,{className:`ripple-hot-empty`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`The story behind any line`}),(0,a.jsx)(`p`,{children:`No load-bearing lines surfaced for this change.`})]}),t[3]=e):e=t[3],e}let m;t[4]===p.cls?m=t[5]:(m=o(p.cls),t[4]=p.cls,t[5]=m);let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,a.jsx)(`div`,{className:`ripple-eyebrow ripple-hot-list-head`,children:`The story behind any line`}),t[6]=g):g=t[6];let _;if(t[7]!==p.id||t[8]!==s){let e;t[10]===p.id?e=t[11]:(e=e=>{let t=e.id===p.id;return(0,a.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t,className:`ripple-hot-item`,"data-active":t,onClick:()=>d(e.id),children:[(0,a.jsx)(`span`,{className:`ripple-hot-cls`,style:{color:o(e.cls),background:`color-mix(in oklab, ${o(e.cls)} 16%, transparent)`,borderColor:`color-mix(in oklab, ${o(e.cls)} 34%, transparent)`},children:e.cls}),(0,a.jsx)(`span`,{className:`ripple-hot-symbol`,children:e.symbol}),(0,a.jsx)(`span`,{className:`ripple-hot-file`,children:e.file})]},e.id)},t[10]=p.id,t[11]=e),_=s.map(e),t[7]=p.id,t[8]=s,t[9]=_}else _=t[9];let v;t[12]===_?v=t[13]:(v=(0,a.jsxs)(`div`,{className:`ripple-hot-list`,role:`tablist`,"aria-label":`Load-bearing lines`,children:[g,_]}),t[12]=_,t[13]=v);let y=`color-mix(in oklab, ${h} 14%, transparent)`,b=`color-mix(in oklab, ${h} 30%, transparent)`,x;t[14]!==h||t[15]!==y||t[16]!==b?(x={color:h,background:y,borderColor:b},t[14]=h,t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]!==p.symbol||t[19]!==x?(S=(0,a.jsx)(`code`,{className:`ripple-hot-chip`,style:x,children:p.symbol}),t[18]=p.symbol,t[19]=x,t[20]=S):S=t[20];let C;t[21]===p.file?C=t[22]:(C=(0,a.jsx)(`span`,{className:`ripple-hot-detail-file`,children:p.file}),t[21]=p.file,t[22]=C);let w;t[23]!==C||t[24]!==S?(w=(0,a.jsxs)(`div`,{className:`ripple-hot-detail-head`,children:[S,C]}),t[23]=C,t[24]=S,t[25]=w):w=t[25];let T;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Why this line exists`}),t[26]=T):T=t[26];let E;t[27]===p.whyExists?E=t[28]:(E=(0,a.jsxs)(`section`,{className:`ripple-hot-why`,children:[T,(0,a.jsx)(`p`,{children:p.whyExists})]}),t[27]=p.whyExists,t[28]=E);let D;t[29]!==h||t[30]!==p.incident?(D=p.incident&&(0,a.jsxs)(`section`,{className:`ripple-hot-incident`,style:{background:`color-mix(in oklab, ${h} 9%, transparent)`,borderColor:`color-mix(in oklab, ${h} 28%, transparent)`},children:[(0,a.jsxs)(`div`,{className:`ripple-hot-incident-head`,children:[(0,a.jsx)(`span`,{className:`ripple-hot-sev`,style:{background:h},children:p.incident.severity}),(0,a.jsx)(`code`,{className:`ripple-hot-incident-id`,children:p.incident.id})]}),(0,a.jsx)(`p`,{children:p.incident.text})]}),t[29]=h,t[30]=p.incident,t[31]=D):D=t[31];let O;t[32]===p.decisionTrail?O=t[33]:(O=p.decisionTrail&&p.decisionTrail.length>0&&(0,a.jsxs)(`section`,{className:`ripple-hot-trail`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`The decision trail`}),(0,a.jsx)(`ol`,{className:`ripple-hot-timeline`,children:p.decisionTrail.map(u)})]}),t[32]=p.decisionTrail,t[33]=O);let k;t[34]===p.ask?k=t[35]:(k=p.ask&&(0,a.jsxs)(`section`,{className:`ripple-hot-ask`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Who to actually ask`}),(0,a.jsxs)(`div`,{className:`ripple-hot-ask-card`,children:[(0,a.jsx)(`span`,{className:`ripple-hot-avatar`,"aria-hidden":`true`,children:p.ask.name.charAt(0)}),(0,a.jsxs)(`div`,{className:`ripple-hot-ask-who`,children:[(0,a.jsx)(`span`,{className:`ripple-hot-ask-name`,children:p.ask.name}),(0,a.jsx)(`span`,{className:`ripple-hot-ask-team`,children:p.ask.team})]})]}),(0,a.jsx)(`p`,{className:`ripple-hot-ask-why`,children:p.ask.why}),p.ask.note&&(0,a.jsx)(`p`,{className:`ripple-hot-ask-note`,children:p.ask.note})]}),t[34]=p.ask,t[35]=k);let A;t[36]===p.riskSignals?A=t[37]:(A=p.riskSignals&&p.riskSignals.length>0&&(0,a.jsxs)(`section`,{className:`ripple-hot-signals`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Risk signals`}),(0,a.jsx)(`dl`,{className:`ripple-hot-signal-grid`,children:p.riskSignals.map(l)})]}),t[36]=p.riskSignals,t[37]=A);let j;t[38]!==k||t[39]!==A?(j=(0,a.jsxs)(`div`,{className:`ripple-hot-cols`,children:[k,A]}),t[38]=k,t[39]=A,t[40]=j):j=t[40];let M;t[41]!==w||t[42]!==E||t[43]!==D||t[44]!==O||t[45]!==j?(M=(0,a.jsxs)(`div`,{className:`ripple-hot-detail`,role:`tabpanel`,children:[w,E,D,O,j]}),t[41]=w,t[42]=E,t[43]=D,t[44]=O,t[45]=j,t[46]=M):M=t[46];let N;return t[47]!==M||t[48]!==v?(N=(0,a.jsxs)(`div`,{className:`ripple-hot`,children:[v,M]}),t[47]=M,t[48]=v,t[49]=N):N=t[49],N}function l(e,t){return(0,a.jsxs)(`div`,{className:`ripple-hot-signal`,children:[(0,a.jsx)(`dt`,{children:e.k}),(0,a.jsx)(`dd`,{children:e.v})]},`${e.k}-${t}`)}function u(e,t){return(0,a.jsxs)(`li`,{className:`ripple-hot-event`,children:[(0,a.jsx)(`span`,{className:`ripple-hot-event-dot`,style:{background:s(e.kind)},"aria-hidden":`true`}),(0,a.jsxs)(`div`,{className:`ripple-hot-event-body`,children:[(0,a.jsxs)(`div`,{className:`ripple-hot-event-top`,children:[(0,a.jsx)(`time`,{className:`ripple-hot-event-date`,children:e.date}),(0,a.jsx)(`span`,{className:`ripple-hot-event-kind`,children:e.kind})]}),(0,a.jsx)(`span`,{className:`ripple-hot-event-label`,children:e.label})]})]},`${e.date}-${t}`)}export{c as ShipHotspots};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-
|
|
1
|
+
import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";var r=e(),i=n(),a=t();function o(e){let t=(0,i.c)(41),{model:n}=e,o=n.incident,[p,m]=(0,r.useState)(!1),h=(0,r.useRef)(void 0),g;t[0]===o?g=t[1]:(g=()=>{o?.rollback.length&&navigator.clipboard?.writeText(o.rollback.map(f).join(`
|
|
2
2
|
`)).then(()=>{m(!0),window.clearTimeout(h.current),h.current=window.setTimeout(()=>m(!1),1800)},d)},t[0]=o,t[1]=g);let _=g,v,y;if(t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>window.clearTimeout(h.current),y=[],t[2]=v,t[3]=y):(v=t[2],y=t[3]),(0,r.useEffect)(v,y),!o){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,a.jsx)(`div`,{className:`ripple-inc-empty`,children:`No incident loaded.`}),t[4]=e):e=t[4],e}let b;t[5]===o.severity?b=t[6]:(b=o.severity&&(0,a.jsx)(`span`,{className:`ripple-inc-sev`,children:o.severity}),t[5]=o.severity,t[6]=b);let x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`The page`}),t[7]=x):x=t[7];let S;t[8]===o.symptom?S=t[9]:(S=(0,a.jsx)(`div`,{className:`ripple-inc-symptom-line`,children:o.symptom}),t[8]=o.symptom,t[9]=S);let C;t[10]===o.service?C=t[11]:(C=o.service&&(0,a.jsx)(`div`,{className:`ripple-inc-service`,children:o.service}),t[10]=o.service,t[11]=C);let w;t[12]!==S||t[13]!==C?(w=(0,a.jsxs)(`div`,{className:`ripple-inc-symptom-text`,children:[x,S,C]}),t[12]=S,t[13]=C,t[14]=w):w=t[14];let T;t[15]!==b||t[16]!==w?(T=(0,a.jsxs)(`div`,{className:`ripple-inc-symptom`,children:[b,w]}),t[15]=b,t[16]=w,t[17]=T):T=t[17];let E;t[18]===o.chain?E=t[19]:(E=o.chain.length>0&&(0,a.jsxs)(`div`,{className:`ripple-inc-block`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`The trace back`}),(0,a.jsx)(`div`,{className:`ripple-inc-chain`,children:o.chain.map(u)})]}),t[18]=o.chain,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Likely root cause`}),t[20]=D):D=t[20];let O;t[21]===o.rootCause?O=t[22]:(O=(0,a.jsxs)(`div`,{className:`ripple-inc-cause`,children:[D,(0,a.jsx)(`p`,{children:o.rootCause})]}),t[21]=o.rootCause,t[22]=O);let k;t[23]!==p||t[24]!==_||t[25]!==o.rollback?(k=o.rollback.length>0&&(0,a.jsxs)(`div`,{className:`ripple-inc-rollback`,children:[(0,a.jsxs)(`div`,{className:`ripple-inc-rollback-head`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Rollback — a draft you run`}),(0,a.jsx)(`button`,{type:`button`,className:`ripple-track-btn`,onClick:_,children:p?`Copied ✓`:`Copy steps`})]}),(0,a.jsx)(`ol`,{className:`ripple-inc-steps`,children:o.rollback.map(l)}),(0,a.jsx)(`div`,{className:`ripple-inc-note`,children:`Ripple never reverts, deploys, or pages — this is yours to run.`})]}),t[23]=p,t[24]=_,t[25]=o.rollback,t[26]=k):k=t[26];let A;t[27]===o.whoToWake?A=t[28]:(A=o.whoToWake.length>0&&(0,a.jsxs)(`div`,{className:`ripple-inc-block`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`Who to wake`}),(0,a.jsx)(`div`,{className:`ripple-inc-people`,children:o.whoToWake.map(c)})]}),t[27]=o.whoToWake,t[28]=A);let j;t[29]===o.timeline?j=t[30]:(j=o.timeline.length>0&&(0,a.jsxs)(`div`,{className:`ripple-inc-block`,children:[(0,a.jsx)(`div`,{className:`ripple-eyebrow`,children:`War-room timeline`}),(0,a.jsx)(`div`,{className:`ripple-inc-timeline`,children:o.timeline.map(s)})]}),t[29]=o.timeline,t[30]=j);let M;t[31]===o.evidence?M=t[32]:(M=o.evidence&&(0,a.jsx)(`div`,{className:`ripple-inc-evidence`,children:o.evidence}),t[31]=o.evidence,t[32]=M);let N;return t[33]!==E||t[34]!==O||t[35]!==k||t[36]!==A||t[37]!==j||t[38]!==M||t[39]!==T?(N=(0,a.jsxs)(`div`,{className:`ripple-inc`,children:[T,E,O,k,A,j,M]}),t[33]=E,t[34]=O,t[35]=k,t[36]=A,t[37]=j,t[38]=M,t[39]=T,t[40]=N):N=t[40],N}function s(e,t){return(0,a.jsxs)(`div`,{className:`ripple-inc-tl-row`,children:[(0,a.jsx)(`span`,{className:`ripple-inc-tl-time`,children:e.time}),(0,a.jsx)(`span`,{className:`ripple-inc-tl-label`,children:e.label})]},t)}function c(e,t){return(0,a.jsxs)(`div`,{className:`ripple-inc-person`,children:[(0,a.jsx)(`span`,{className:`ripple-inc-avatar`,"aria-hidden":`true`,children:e.name.charAt(0)}),(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`div`,{className:`ripple-inc-person-name`,children:e.name}),(0,a.jsx)(`div`,{className:`ripple-inc-person-team`,children:e.team}),(0,a.jsx)(`div`,{className:`ripple-inc-person-why`,children:e.why})]})]},t)}function l(e,t){return(0,a.jsx)(`li`,{children:e},t)}function u(e,t){return(0,a.jsxs)(`div`,{className:`ripple-inc-hop`,children:[(0,a.jsx)(`span`,{className:`ripple-inc-hop-dot`,"aria-hidden":`true`}),(0,a.jsxs)(`div`,{className:`ripple-inc-hop-body`,children:[(0,a.jsx)(`div`,{className:`ripple-inc-hop-ctx`,children:e.context}),(0,a.jsx)(`div`,{className:`ripple-inc-hop-label`,children:e.label})]})]},t)}function d(){}function f(e,t){return`${t+1}. ${e}`}export{o as ShipIncident};
|