@mavea/mavea 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/.vite/manifest.json +354 -354
- package/dist/assets/{AnnotationLayer-HanjTRYY.js → AnnotationLayer-CzXCVZCu.js} +1 -1
- package/dist/assets/{AppCommandPalette-DBiuHUNL.js → AppCommandPalette-D6904cc9.js} +1 -1
- package/dist/assets/{CheckLogRail-CfoGgTqv.js → CheckLogRail-CeRhbIwa.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-CEi_cgBR.js → ConversationVideoStudio-Cyu-M9Us.js} +1 -1
- package/dist/assets/{CourseLessonReader-CaLT_Y6N.js → CourseLessonReader-BvTabDPT.js} +2 -2
- package/dist/assets/{CoursesApp-IfWCeml5.js → CoursesApp-B8kZ6pFr.js} +2 -2
- package/dist/assets/{DashPresent-T7I-lAng.js → DashPresent-Dr0LLNnz.js} +1 -1
- package/dist/assets/{DashboardDetail-BhRSDenD.js → DashboardDetail-B5JZ6fRz.js} +2 -2
- package/dist/assets/{DashboardLoopGate-DBVAR7IS.js → DashboardLoopGate-UHcbTCXN.js} +2 -2
- package/dist/assets/DashboardLoopRuntime-BZutKupS.js +1 -0
- package/dist/assets/{DashboardsApp-C_awJ3hM.js → DashboardsApp-DzVa4Nqd.js} +2 -2
- package/dist/assets/{DeepZoomApp-C-66OasV.js → DeepZoomApp-CN8ZKeS4.js} +1 -1
- package/dist/assets/{DelegatePanel-DaJTDkYu.js → DelegatePanel-DO7J_rk_.js} +1 -1
- package/dist/assets/{DemoGallery-B9F7SUzp.js → DemoGallery-DMQP4JAa.js} +1 -1
- package/dist/assets/{DropSelect-IBjV5Ol1.js → DropSelect-BVDNR47E.js} +1 -1
- package/dist/assets/{ExportModal-gckBiikq.js → ExportModal-BVsirsNU.js} +1 -1
- package/dist/assets/{ExtractionPreview-DDOkCH9u.js → ExtractionPreview-872OE2ZI.js} +1 -1
- package/dist/assets/{FeatureUseNotice-BfnZH8Vt.js → FeatureUseNotice-BNDajs0p.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-CYQdl3Zu.js → FlagshipCommandPalette-mKkMVsza.js} +1 -1
- package/dist/assets/{FlagshipShowcase-CFMmbeff.js → FlagshipShowcase-CL_KWgKn.js} +1 -1
- package/dist/assets/{FlashcardsApp-KJ1bmlbp.js → FlashcardsApp-COYviD1h.js} +1 -1
- package/dist/assets/GalleryApp-B5z9rsrO.css +1 -0
- package/dist/assets/{GalleryApp-Dh8Nc_So.js → GalleryApp-D96R7Hdy.js} +2 -2
- package/dist/assets/{HonestByDesign-C3LTj4Bx.js → HonestByDesign-DOg91fEf.js} +1 -1
- package/dist/assets/{HowItWorks-C5Dqqvl-.js → HowItWorks-D4lHSwEb.js} +1 -1
- package/dist/assets/{LegalApp-DYVJIUyF.js → LegalApp-BSPhYvKz.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CbuQ-pLN.js → LegalMarkdownDocument-DDUOgn72.js} +1 -1
- package/dist/assets/{LegalPageShell-CoEyiZGz.js → LegalPageShell-DSbe8dTr.js} +1 -1
- package/dist/assets/{LibraryOverlay-TQnxY9R8.js → LibraryOverlay-CEhVoSyv.js} +1 -1
- package/dist/assets/{LiveApp-DRnphsFA.js → LiveApp-DtpM4tO0.js} +4 -4
- package/dist/assets/{LiveSettings-Cz3XSqv8.js → LiveSettings-C7luyoWU.js} +1 -1
- package/dist/assets/{MindMapViewerDrawer-AUJlLC2R.js → MindMapViewerDrawer-DxcjLJzB.js} +1 -1
- package/dist/assets/{MindShape-BbuVOTaR.js → MindShape-DhEmAQeq.js} +1 -1
- package/dist/assets/{PinToDashboard-BdXI7oo9.js → PinToDashboard-CQHDENt1.js} +1 -1
- package/dist/assets/{PlanReview-CGRvSRAt.js → PlanReview-f7EY7XTc.js} +1 -1
- package/dist/assets/{PresentationDeck-CoPmOr2f.js → PresentationDeck-Bo1BVx73.js} +1 -1
- package/dist/assets/{PrismApp-DPECS285.js → PrismApp-CBr8XpUt.js} +2 -2
- package/dist/assets/{PrismBriefingPlayer-BvpG7oZs.js → PrismBriefingPlayer-qNjVbmUq.js} +2 -2
- package/dist/assets/{PrismOverlay-c8rcvt4V.js → PrismOverlay-L_lLIH_1.js} +3 -3
- package/dist/assets/{PrismWorkbench-BEaD7Arj.js → PrismWorkbench-DK-1IY4A.js} +1 -1
- package/dist/assets/{PrivacyApp-_O_MR088.js → PrivacyApp-DT8wZumn.js} +1 -1
- package/dist/assets/{ReplayCard-IN-ilb2E.js → ReplayCard-BQr6DWYi.js} +2 -2
- package/dist/assets/{ReplayOverlay-ZRjFP-zf.js → ReplayOverlay-CRVixwg2.js} +1 -1
- package/dist/assets/{RippleApp-D_Gd8Lw8.js → RippleApp-CMY2OCRm.js} +2 -2
- package/dist/assets/{RippleOverlay-vP2KxTiI.js → RippleOverlay-Dwi8Ir43.js} +2 -2
- package/dist/assets/{SeeDontRead-BmUyUai5.js → SeeDontRead-BkeAv1Jd.js} +1 -1
- package/dist/assets/{ShareModal-_KYCohqO.js → ShareModal-DVwc57KT.js} +2 -2
- package/dist/assets/{ShipCourse--ajDej06.js → ShipCourse-BNEPgsV5.js} +1 -1
- package/dist/assets/{SignatureLoop-DDw2gtQ_.js → SignatureLoop-C9GvENvP.js} +1 -1
- package/dist/assets/{SynthesisApp-CilzogOF.js → SynthesisApp-BPAT6v7a.js} +2 -2
- package/dist/assets/{SynthesisOverlay-CAK5h0hB.js → SynthesisOverlay-u_W105hD.js} +1 -1
- package/dist/assets/{TemplatePicker-3w18ViSc.js → TemplatePicker-CAC4ggbJ.js} +1 -1
- package/dist/assets/{TermsApp-BfTGOTq6.js → TermsApp-BlyUsTrJ.js} +1 -1
- package/dist/assets/{TopicCanvas-DSCNWNjv.js → TopicCanvas-CyBGLgb0.js} +2 -2
- package/dist/assets/{TourPrism-Y47m-KGq.js → TourPrism-Cn2YHIwh.js} +1 -1
- package/dist/assets/{TrackerTile-LXFQXcvH.js → TrackerTile-Ds3ks6Bh.js} +2 -2
- package/dist/assets/{TwoSurfaces-CSpKrgfJ.js → TwoSurfaces-cdP8bAG9.js} +1 -1
- package/dist/assets/{WorldOverlay-D5FWgYe3.js → WorldOverlay-DPkQobVE.js} +1 -1
- package/dist/assets/{WowFeatures-e6mkftpD.js → WowFeatures-BBtcWAOz.js} +1 -1
- package/dist/assets/{ZoomDeck-CC9zXPxF.js → ZoomDeck-Cdvkvo2H.js} +1 -1
- package/dist/assets/{audioTrack-w1tZwSoU.js → audioTrack-W_18XwGZ.js} +1 -1
- package/dist/assets/canvas-BX595EVB.js +1 -0
- package/dist/assets/{capture-Bomj_Egy.js → capture-Dyff_zSz.js} +1 -1
- package/dist/assets/{confirmAdd-CUFiPNWz.js → confirmAdd-D_hDIeaD.js} +1 -1
- package/dist/assets/{dashboardEvents-PktCbV72.js → dashboardEvents-BV0Ly6No.js} +1 -1
- package/dist/assets/{deepen-Dz4yTyJs.js → deepen-D8kPrlU5.js} +1 -1
- package/dist/assets/docs-6X4Ki_cV.js +1 -0
- package/dist/assets/{effort-BKGxLYoq.js → effort-QeWrMtZt.js} +1 -1
- package/dist/assets/{generateBeats-BjWC2fwl.js → generateBeats-Da9RmZke.js} +1 -1
- package/dist/assets/{generateLive-BLajGcNK.js → generateLive-CDIkclO4.js} +1 -1
- package/dist/assets/{index-CKRjGbeR.js → index-BMeoXWPR.js} +3 -3
- package/dist/assets/{kokoro-B-rc224u.js → kokoro-DcP-u0Tl.js} +1 -1
- package/dist/assets/{loader-BiYFMeRS.js → loader-BRfSnl9t.js} +2 -2
- package/dist/assets/{notes-nfocTnUv.js → notes-BDCTTA87.js} +1 -1
- package/dist/assets/{perfProbe-BqMK4N56.js → perfProbe-ssw0AtWX.js} +1 -1
- package/dist/assets/{pin-IyE46GaQ.js → pin-Bic4-gim.js} +1 -1
- package/dist/assets/{portal-C2b5NoMN.js → portal-Dpb34d3-.js} +1 -1
- package/dist/assets/{prewarm-Pvdu5Jt0.js → prewarm-xdXDmF8B.js} +1 -1
- package/dist/assets/{quietHours-lWcjQ2Iu.js → quietHours-uFS7n8N6.js} +1 -1
- package/dist/assets/{registry-BD1Zyd46.js → registry-BV02ROnH.js} +1 -1
- package/dist/assets/{registry-OUL5YJry.js → registry-BWx2f_wi.js} +1 -1
- package/dist/assets/{registry-BJFqryP_.js → registry-Bs5HUWIJ.js} +1 -1
- package/dist/assets/registry-CdPShFc3.js +1 -0
- package/dist/assets/{registry-BiT0eNZb.js → registry-DNIasVGX.js} +1 -1
- package/dist/assets/{registry-BTUHr4mQ.js → registry-DueizAoA.js} +1 -1
- package/dist/assets/{registry-CnmuVlAA.js → registry-PAcazQzL.js} +1 -1
- package/dist/assets/{relate-ZHm-ZvaR.js → relate-BHJl3RaA.js} +1 -1
- package/dist/assets/{replay-DBeCo_vn.js → replay-DoRQJHjZ.js} +1 -1
- package/dist/assets/{select-CejTsgpx.js → select-StjZ4ZRN.js} +1 -1
- package/dist/assets/shard010-Bal9PeRL.js +1 -0
- package/dist/assets/shard049-C4_IyApZ.js +1 -0
- package/dist/assets/{useDashboardLoop-SPlr1Mrm.js → useDashboardLoop-DEE_sLT0.js} +1 -1
- package/dist/assets/{walkSync-BtO3jsqQ.js → walkSync-CRhkAQFu.js} +1 -1
- package/dist/demo-assets/CREDITS.md +36 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/DashboardLoopRuntime-B55z8L4b.js +0 -1
- package/dist/assets/GalleryApp-B4KBdNyu.css +0 -1
- package/dist/assets/canvas-BRGFkCD-.js +0 -1
- package/dist/assets/docs-B2aDtm5K.js +0 -1
- package/dist/assets/registry-BmjYillB.js +0 -1
- package/dist/assets/shard010-CQfR6lnk.js +0 -1
- package/dist/assets/shard049-hPaNN2sL.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/generate-BZobrQPX.js","assets/streamParse-BX0bAppQ.js","assets/rolldown-runtime-DkW27tQK.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/info-CiqHR5cs.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/cache-7UEbF3S6.js","assets/incident-D3bmMmES.js","assets/githubBrowser-CErQprLW.js","assets/githubToken-Bwa7V9YT.js","assets/keyVault-Aw5Y2PjT.js","assets/owners-CP-4Q59L.js","assets/codeContext-CFnI3GLf.js","assets/ShipRead-CJJmY-wy.js","assets/compiler-runtime-qQQXpJgv.js","assets/react-BZJXY1be.js","assets/jsx-runtime-DeHZSEgm.js","assets/ShipIncident-DMLb14Lx.js","assets/ShipIncident-BUHvFFiC.css","assets/ShipWorkspace-_MtKAiKH.js","assets/colors-D49Req-e.js","assets/ShipWorkspace-D6XQpGEN.css","assets/ShipCascade-Bf-qDWMb.js","assets/ShipCascade-CyFnrlET.css","assets/ShipMigration-ZnzL-1rC.js","assets/ShipMigration-BznCskNg.css","assets/ShipRollout-Dt2TgI0L.js","assets/ShipRollout-CqeObx5b.css","assets/ShipCourse
|
|
2
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{t as a}from"./cachedImport-DW0gP14h.js";import{n as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{E as c}from"./index-CKRjGbeR.js";import{t as l}from"./useFocusTrap-CJmpNZv2.js";import{t as u}from"./useSpatialCanvas-CfmZOXXP.js";import{t as d}from"./FeatureUseNotice-BfnZH8Vt.js";import{t as f}from"./route-CMdTFx0P.js";import{i as p,n as m,t as h}from"./cache-7UEbF3S6.js";import{t as g}from"./buildShip-BgFg98tH.js";import{n as _,t as v}from"./parseDiff-D8uBQ9mQ.js";import{t as y,u as b}from"./incident-D3bmMmES.js";import{i as x,r as S,t as ee}from"./githubToken-Bwa7V9YT.js";import{n as C,r as w}from"./colors-D49Req-e.js";import{n as te,r as T}from"./courseStore-DfafnL-9.js";var E=e(),D=.82;function O(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)*D/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*D}),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-84),f=Math.min(f,e.y-38),p=Math.max(p,e.x+84),m=Math.max(m,e.y+38);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 k=n();function ne({nodes:e,edges:t,altitude:n,onAsk:r,animate:i}){let[a,o]=(0,E.useState)(`severity`),[s,c]=(0,E.useState)(!1),[l,d]=(0,E.useState)(null),f=(0,E.useMemo)(()=>{let n=s?e.filter(e=>e.type===`pr`||e.crossRepo):e,r=new Set(n.map(e=>e.id));return O(n,t.filter(e=>r.has(e.from)&&r.has(e.to)))},[e,t,s]),p=(0,E.useMemo)(()=>{let e=new Map;for(let t of f.nodes)e.set(t.node.id,t);return e},[f]),m=(0,E.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,E.useEffect)(()=>{_(f.bbox)},[f,_]);let[v,y]=(0,E.useState)(!1),b=(0,E.useRef)(!1),x=(0,E.useRef)(!1),S=(0,E.useRef)({x:0,y:0}),ee=(0,E.useCallback)(e=>{b.current=!0,x.current=!1,y(!0),S.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)},[]),te=(0,E.useCallback)(e=>{if(!b.current)return;let t=e.clientX-S.current.x,n=e.clientY-S.current.y;Math.abs(t)+Math.abs(n)>2&&(x.current=!0),S.current={x:e.clientX,y:e.clientY},g.pan(t,n)},[g]),T=(0,E.useCallback)(e=>{b.current=!1,y(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),D=g.viewportRef,{zoomAtClient:ne}=g;(0,E.useEffect)(()=>{let e=D.current;if(!e)return;let t=e=>{e.preventDefault(),ne(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[D,ne]);let A=g.camera.scale>=.7,j=a===`traffic`,M=l?p.get(l)?.node??null:null,N=e.some(e=>typeof e.traffic==`number`),P=e.some(e=>e.crossRepo===!0);return(0,k.jsxs)(`div`,{className:`ripple-impact`,children:[(0,k.jsxs)(`div`,{className:`ripple-impact-controls`,children:[N&&(0,k.jsxs)(`div`,{className:`ripple-lens`,role:`group`,"aria-label":`Map lens`,children:[(0,k.jsx)(`button`,{type:`button`,"data-active":a===`severity`?`true`:void 0,onClick:()=>o(`severity`),children:`Severity`}),(0,k.jsx)(`button`,{type:`button`,"data-active":a===`traffic`?`true`:void 0,onClick:()=>o(`traffic`),children:`Traffic`})]}),P&&(0,k.jsxs)(`label`,{className:`ripple-crossrepo`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),`Cross-repo only`]}),(0,k.jsx)(`div`,{className:`ripple-zoombtns`,children:(0,k.jsx)(`button`,{type:`button`,onClick:()=>_(f.bbox),title:`Fit the whole map`,"aria-label":`Fit`,children:`⊡`})})]}),(0,k.jsxs)(`div`,{className:`ripple-stage`+(v?` is-panning`:``),ref:g.viewportRef,onPointerDown:ee,onPointerMove:te,onPointerUp:T,onPointerCancel:T,children:[(0,k.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,k.jsx)(`span`,{className:`ripple-enter-pulse`,"aria-hidden":`true`,style:{left:h.x,top:h.y}}),(0,k.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=w(e.node.status),a=j?1.3+(e.node.traffic??0)*3:r?.breaking?2.4:1.6;return(0,k.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)})}),A&&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,k.jsx)(`div`,{className:`ripple-edge-verb`,style:{left:(n.x+e.x)/2,top:(n.y+e.y)/2,color:w(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=w(t.status),i=j&&!n?1+(t.traffic??0)*.24:1;return(0,k.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-84,top:e.y-38,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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`ripple-node-eyebrow`,style:{color:r},children:`THIS CHANGE`}),(0,k.jsx)(`span`,{className:`ripple-node-name ripple-node-name-lg`,children:t.label})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{className:`ripple-node-top`,children:[(0,k.jsx)(`span`,{className:`ripple-node-dot`,style:{background:r},"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-node-status`,style:{color:r},children:C(t.status)}),t.severity&&(0,k.jsx)(`span`,{className:`ripple-node-sev`,style:{background:r},children:t.severity})]}),(0,k.jsx)(`span`,{className:`ripple-node-name`,children:t.label}),A&&(0,k.jsxs)(`span`,{className:`ripple-node-meta`,children:[t.team??t.owner??``,t.trafficLabel?` · ${t.trafficLabel}`:``]}),t.crossRepo&&(0,k.jsx)(`span`,{className:`ripple-node-repo`,children:`other repo`})]})},t.id)})]}),(0,k.jsx)(`div`,{className:`ripple-map-legend`,"aria-hidden":`true`,children:[`breaks`,`migration`,`untested`,`affected`,`safe`].map(e=>(0,k.jsxs)(`span`,{className:`ripple-map-legend-item`,children:[(0,k.jsx)(`span`,{className:`ripple-node-dot`,style:{background:w(e)}}),C(e).toLowerCase()]},e))})]}),M&&(0,k.jsxs)(`aside`,{className:`ripple-inspect`,"aria-label":`${M.label} detail`,children:[(0,k.jsxs)(`div`,{className:`ripple-inspect-head`,children:[(0,k.jsxs)(`div`,{className:`ripple-inspect-titles`,children:[(0,k.jsx)(`span`,{className:`ripple-node-status`,style:{color:w(M.status)},children:C(M.status)}),M.severity&&(0,k.jsxs)(`span`,{className:`ripple-inspect-sev`,style:{background:w(M.status)},children:[`would page · `,M.severity]})]}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>d(null),"aria-label":`Close detail`,children:`✕`})]}),(0,k.jsx)(`div`,{className:`ripple-inspect-name`,children:M.label}),(0,k.jsxs)(`div`,{className:`ripple-inspect-owner`,children:[M.team?`owned by ${M.team}`:``,M.cite?(0,k.jsxs)(`span`,{className:`ripple-inspect-cite`,children:[` · `,M.cite.ref]}):null]}),M.trafficLabel&&(0,k.jsxs)(`div`,{className:`ripple-inspect-traffic`,children:[(0,k.jsx)(`strong`,{children:M.trafficLabel}),(0,k.jsx)(`span`,{children:`live traffic, from tracing — not the diff`})]}),M.contract&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`The contract`}),(0,k.jsx)(`p`,{children:M.contract})]}),M.problem&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block ripple-inspect-problem`,style:{borderColor:`color-mix(in oklab, ${w(M.status)} 40%, transparent)`},children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,style:{color:w(M.status)},children:`What happens`}),(0,k.jsx)(`p`,{children:M.problem})]}),M.altitudeNotes?.[n]&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`At your altitude`}),(0,k.jsx)(`p`,{children:M.altitudeNotes[n]})]}),M.fix&&(0,k.jsxs)(`div`,{className:`ripple-inspect-fix`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`Mavéa’s call`}),(0,k.jsx)(`p`,{children:M.fix})]}),r&&(0,k.jsxs)(`button`,{type:`button`,className:`ripple-ask-btn`,onClick:()=>r(M),children:[`Ask about `,M.label]})]})]})}function A(e){let t=e.lastIndexOf(`/`),n=t>0?e.slice(0,t):``;return n?n.split(`/`).slice(0,2).join(`/`):`(root)`}function j(e){let t=e.split(`/`);return t[t.length-1]||e}function M(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 N(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 P(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=A(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=N(t),i=`${t.length} file${t.length===1?``:`s`}`,a=M(e);return{id:`m${n}`,name:e,purpose:a||i,entry:r,owner:``,health:i,explain:`${a?a+` `:``}${i} in ${e}.`+(r?` Start with ${j(r)} and follow what it imports.`:``),startHere:t.slice(0,3).map(j),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=N(t);s.push({id:r,label:e,sub:`${t.length} file${t.length===1?``:`s`}`,type:`module`,status:`affected`,scope:`in-pr`,contract:`${M(e)||`${t.length} files`}`+(i?` · start with ${j(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:M(e)||`${t.length} files`,file:N(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 F={tier:`slow-cheap`,enrichMaxTokens:1600,courseCount:3,coursesMaxTokens:2600,closingMaxTokens:3600,lessonMaxTokens:3600,fetchCodeContext:!1,thinkingLevel:`minimal`},re={tier:`frontier-deep`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:7e3,fetchCodeContext:!0,thinkingLevel:`low`},ie={tier:`frontier-fast`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:6e3,fetchCodeContext:!0,thinkingLevel:`minimal`},ae=e=>!!e&&/(localhost|127\.0\.0\.1|0\.0\.0\.0|host\.docker\.internal|:11434)/i.test(e);function oe(e){let t=e.model.toLowerCase();return ae(e.baseUrl)||f(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 se(e){switch(oe(e)){case`slow-cheap`:return F;case`frontier-deep`:return re;default:return ie}}var ce=/^[A-Za-z0-9._-]+$/,I=e=>({kind:`invalid`,reason:e});function le(e,t){let n=e.trim().replace(/^git@github\.com:/i,`github.com/`);if(!n)return I(`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||!ce.test(t)||!ce.test(n))return I(`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}:I(`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]}:I(`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]}:I(`Enter owner/repo#number, or connect a default repo first.`):I(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`)}var L=`mavea.ripple.tracked.v1`,R=20;function z(){try{let e=localStorage.getItem(L);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&e.id&&e.model):[]}catch{return[]}}function ue(e){try{localStorage.setItem(L,JSON.stringify(e.slice(0,R)))}catch{}}function de(){return z().sort((e,t)=>t.savedAt-e.savedAt)}function fe(e){ue(z().filter(t=>t.id!==e))}var pe=t();function me(e){return(/^(.*?[.!?])(\s|$)/.exec(e.trim())?.[1]??e).trim()}function he(e){let t=(0,pe.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=me(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 ee;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ee={id:`read`,label:`Full read`},t[22]=ee):ee=t[22];let C;t[23]===c?C=t[24]:(C=c?[]:[{id:`gate`,label:`The gate`}],t[23]=c,t[24]=C);let w;t[25]!==S||t[26]!==C||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==b||t[33]!==x?(w=[...h,...g,..._,...v,...y,...b,...x,...S,ee,...C],t[25]=S,t[26]=C,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=b,t[33]=x,t[34]=w):w=t[34];let te=w,T;t[35]===u.label?T=t[36]:(T=(0,k.jsx)(`span`,{className:`ripple-verdict-badge`,children:u.label}),t[35]=u.label,t[36]=T);let E;t[37]===d?E=t[38]:(E=(0,k.jsx)(`span`,{className:`ripple-verdict-scale`,children:d}),t[37]=d,t[38]=E);let D;t[39]!==T||t[40]!==E?(D=(0,k.jsxs)(`div`,{className:`ripple-verdict-top`,children:[T,E]}),t[39]=T,t[40]=E,t[41]=D):D=t[41];let O;t[42]===p?O=t[43]:(O=(0,k.jsx)(`p`,{className:`ripple-verdict-what`,children:p}),t[42]=p,t[43]=O);let A;t[44]!==c||t[45]!==m?(A=m?(0,k.jsxs)(`div`,{className:`ripple-verdict-one`,children:[(0,k.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:c?`Where to start`:`The one thing to check`}),(0,k.jsx)(`span`,{className:`ripple-verdict-one-text`,children:m})]}):!c&&(0,k.jsxs)(`div`,{className:`ripple-verdict-one ripple-verdict-clean`,children:[(0,k.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:`Reads clean`}),(0,k.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]=A):A=t[46];let j;t[47]!==D||t[48]!==O||t[49]!==A||t[50]!==u.tone?(j=(0,k.jsxs)(`div`,{className:`ripple-verdict-head`,"data-tone":u.tone,children:[D,O,A]}),t[47]=D,t[48]=O,t[49]=A,t[50]=u.tone,t[51]=j):j=t[51];let M;t[52]!==r||t[53]!==n.edges||t[54]!==n.nodes||t[55]!==a?(M=(0,k.jsx)(`div`,{className:`ripple-verdict-map`,children:(0,k.jsx)(ne,{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]=M):M=t[56];let N;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(`span`,{className:`ripple-verdict-chips-tag`,children:`Go deeper`}),t[57]=N):N=t[57];let P;t[58]!==te||t[59]!==i?(P=(0,k.jsxs)(`div`,{className:`ripple-verdict-chips`,"aria-label":`Go deeper`,children:[N,te.map(e=>(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-chip`,onClick:()=>i(e.id),children:e.label},e.id))]}),t[58]=te,t[59]=i,t[60]=P):P=t[60];let F;return t[61]!==j||t[62]!==M||t[63]!==P?(F=(0,k.jsxs)(`div`,{className:`ripple-verdict`,children:[j,M,P]}),t[61]=j,t[62]=M,t[63]=P,t[64]=F):F=t[64],F}r();var B=a(()=>i(()=>import(`./generate-BZobrQPX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),ge=(...e)=>B().then(t=>t.enrichShipModel(...e)),_e=(...e)=>B().then(t=>t.enrichIncident(...e)),ve=(...e)=>B().then(t=>t.enrichOrientation(...e)),ye=(...e)=>B().then(t=>t.enrichCourses(...e)),be=(...e)=>B().then(t=>t.enrichCourseClosing(...e)),xe=(...e)=>B().then(t=>t.enrichLesson(...e)),Se=(...e)=>B().then(t=>t.gatherLessonCode(...e)),V=a(()=>i(()=>import(`./githubBrowser-CErQprLW.js`).then(e=>e.i),__vite__mapDeps([11,2,4,12,13]))),Ce=(...e)=>V().then(t=>t.fetchPrDiff(...e)),we=(...e)=>V().then(t=>t.compareRefs(...e)),Te=(...e)=>V().then(t=>t.fetchRepoTree(...e)),Ee=a(()=>i(()=>import(`./owners-CP-4Q59L.js`),__vite__mapDeps([14,11,2,4,12,13]))),De=(...e)=>Ee().then(t=>t.resolveOwners(...e)),Oe=a(()=>i(()=>import(`./codeContext-CFnI3GLf.js`),__vite__mapDeps([15,11,2,4,12,13]))),ke=(...e)=>Oe().then(t=>t.gatherCodeContext(...e)),Ae=e=>e?/^([\w.-]+\/[\w.-]+)/.exec(e.trim())?.[1]:void 0,je=s(()=>i(()=>import(`./ShipRead-CJJmY-wy.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([16,17,2,18,19]))),Me=s(()=>i(()=>import(`./ShipIncident-DMLb14Lx.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([20,18,2,17,19,21]))),Ne=s(()=>i(()=>import(`./ShipWorkspace-_MtKAiKH.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([22,18,2,17,19,23,24]))),Pe=s(()=>i(()=>import(`./ShipCascade-Bf-qDWMb.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([25,18,2,17,19,23,26]))),Fe=s(()=>i(()=>import(`./ShipMigration-ZnzL-1rC.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([27,17,2,18,19,28]))),Ie=s(()=>i(()=>import(`./ShipRollout-Dt2TgI0L.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([29,17,2,18,19,30]))),Le=s(()=>i(()=>import(`./ShipCourse--ajDej06.js`).then(e=>({default:e.ShipCourse})),__vite__mapDeps([31,18,2,17,19,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]))),Re=s(()=>i(()=>import(`./ShipOnboarding-DUxtx2Vr.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([48,18,2,17,19,49]))),ze=s(()=>i(()=>import(`./ShipHotspots-lGioTtf1.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([50,18,2,17,19,51]))),H=s(()=>i(()=>import(`./ShipSuggestions-BrAXTjAR.js`).then(e=>({default:e.ShipSuggestions})),__vite__mapDeps([52,18,2,17,19,53]))),U=s(()=>i(()=>import(`./ShipGate-D4BP41-h.js`).then(e=>({default:e.ShipGate})),__vite__mapDeps([54,18,2,19,55]))),Be=s(()=>i(()=>import(`./RippleAskController-BqnazbZ7.js`).then(e=>({default:e.RippleAskController})),__vite__mapDeps([56,18,2,17,19,3,4,5,6,7,8,57,58,11,12,13,46,59]))),Ve=Be.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=ze.Component,Ze=H.Component,Qe=U.Component,$e=(e,t)=>`${e}::${t}`;function et(e){try{return localStorage.getItem(e)}catch{return null}}function tt(e,t){try{localStorage.setItem(e,t)}catch{}}var nt=[{id:`newgrad`,label:`New grad`},{id:`working`,label:`Working`},{id:`principal`,label:`Principal`}],rt=new Set([`anthropic`,`openai`,`gemini`,`grok`,`openrouter`]);function it(e){return{read:je.preload,incident:Me.preload,workspace:Ne.preload,cascade:Pe.preload,migration:Fe.preload,rollout:Ie.preload,course:Le.preload,onboarding:Re.preload,hotspots:ze.preload,suggestions:H.preload,gate:U.preload}[e]?.()??Promise.resolve()}var at={understand:`Understand`,ship:`Ship the change`},W=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:i}){let[a,s]=(0,E.useState)(!1),[u,f]=(0,E.useState)(!1),[C,w]=(0,E.useState)(`verdict`),[D,O]=(0,E.useState)(`working`),[A,j]=(0,E.useState)(e),M=(0,E.useRef)(e),[N,F]=(0,E.useState)({verdict:`floor`,orientation:`floor`,courses:`floor`}),re=(0,E.useRef)(0),ie=(0,E.useRef)(null),ae=(0,E.useRef)(null),oe=(0,E.useRef)(null),ce=(0,E.useRef)(null),I=(0,E.useRef)(!1),L=(0,E.useRef)(!1),R=(0,E.useRef)(void 0),z=(0,E.useRef)(void 0),ue=(0,E.useRef)(void 0),pe=(0,E.useRef)(null),[me,B]=(0,E.useState)(!1),[V,Ee]=(0,E.useState)(!1),[Oe,je]=(0,E.useState)(0),[Me,Ne]=(0,E.useState)(null),Pe=(0,E.useRef)([]),Fe=(0,E.useRef)(new Map),Ie=(0,E.useRef)(new Map),Le=(0,E.useCallback)(e=>{Ne(t=>({text:e,nonce:(t?.nonce??0)+1})),Ee(!0)},[]),Re=(0,E.useMemo)(()=>t?{model:A,cfg:t,altitude:D,diffText:pe.current?.text,repo:R.current,gitRef:z.current,treePaths:Pe.current,lessonDetails:Ie.current,fileCache:Fe.current}:null,[t,A,D]),ze=(0,E.useCallback)(()=>{je(e=>e+1),Pe.current=[],Fe.current.clear(),Ie.current.clear()},[]),H=(0,E.useCallback)(()=>{ie.current?.abort(),ae.current?.abort(),oe.current?.abort(),ce.current?.abort()},[]);(0,E.useEffect)(()=>H,[H]);let U=(0,E.useRef)(0);(0,E.useEffect)(()=>{j(e),M.current=e,R.current=void 0,I.current=!0,L.current=!0,F({verdict:`done`,orientation:e.modules.length?`done`:`floor`,courses:e.courses?.length?`done`:`floor`})},[e]);let st=(0,E.useRef)(!1);(0,E.useEffect)(()=>{st.current||(st.current=!0,!(!e.provenance.example||r)&&(et(`ripple.seenWorkedExample`)===`1`?(Nt(`github`),J(!0)):tt(`ripple.seenWorkedExample`,`1`)))},[e.provenance.example,r]);let G=(0,E.useMemo)(()=>t&&rt.has(t.provider)?t:{provider:`gemini`,model:`gemini-3.5-flash`,apiKey:``},[t]),K=(0,E.useMemo)(()=>se(G),[G]),[ct,lt]=(0,E.useState)(()=>et(`ripple.hint.fastModel.dismissed`)===`1`),[ut,dt]=(0,E.useState)(!1),ft=(0,E.useCallback)(()=>{lt(!0),tt(`ripple.hint.fastModel.dismissed`,`1`)},[]),pt=(0,E.useCallback)((e,t,n)=>{let r=++re.current;ie.current?.abort();let i=new AbortController;ie.current=i,B(!1),F(e=>({...e,verdict:`enriching`})),(async()=>{let a=n&&K.fetchCodeContext?await ke(e,n,void 0,i.signal).catch(()=>``):``;if(i.signal.aborted||re.current!==r)return;let o=await ge(e,t,G,{signal:i.signal,codeContext:a||void 0,maxTokens:K.enrichMaxTokens,thinkingLevel:K.thinkingLevel,onPartial:t=>{re.current===r&&j(b(e,t,G.model))}});re.current===r&&(o?(j(o),M.current=o,F(e=>({...e,verdict:`done`}))):(j(e),M.current=e,F(e=>({...e,verdict:`error`}))))})()},[G,K]),mt=(0,E.useCallback)((e,t,n)=>{let r=g(_(e),t);return r.changes.length===0?0:(U.current++,H(),M.current=r,R.current=n,z.current=r.pr.branch||void 0,ue.current=void 0,pe.current={text:e,repo:n},I.current=!1,L.current=!1,ze(),j(r),w(`verdict`),dt(!0),F({verdict:`enriching`,orientation:`floor`,courses:`floor`}),pt(r,e,n),r.changes.length)},[H,pt,ze]),ht=(0,E.useCallback)(()=>{let e=pe.current;e&&pt(M.current,e.text,e.repo)},[pt]),gt=(0,E.useCallback)(e=>{let t=M.current;return t.modules.length?t.modules:P(t.changes.map(e=>e.file),e,!1).modules},[]),_t=(0,E.useCallback)((e=!1)=>{let t=R.current;if(!t||I.current&&!e)return;I.current=!0,ae.current?.abort();let n=new AbortController;ae.current=n,F(e=>({...e,orientation:`enriching`})),(async()=>{let e=await ve({...M.current,modules:gt(t)},t,z.current,G,{signal:n.signal,maxTokens:K.enrichMaxTokens,thinkingLevel:K.thinkingLevel}).catch(()=>null);if(n.signal.aborted)return;let r=e?await De(e,t,z.current,n.signal).catch(()=>e):{...M.current,modules:gt(t)};n.signal.aborted||(j(e=>({...e,modules:r.modules,nodes:r.nodes,onboarding:r.onboarding})),F(t=>({...t,orientation:e?`done`:`error`})))})()},[G,K,gt]),q=(0,E.useCallback)((e=!1,t)=>{let n=R.current;if(!n||L.current&&!e)return;L.current=!0,oe.current?.abort();let r=new AbortController;oe.current=r;let i=setTimeout(()=>r.abort(),9e4);F(e=>({...e,courses:`enriching`})),(async()=>{try{let i=p(`courses|${n}|${z.current??``}|${t??``}`,G.model),a=e?null:await h(i);if(r.signal.aborted)return;let o={...M.current,modules:gt(n)},s=a?.courses??await ye(o,n,z.current,G,{signal:r.signal,count:K.courseCount,maxTokens:K.coursesMaxTokens,thinkingLevel:K.thinkingLevel,focus:t}).catch(()=>void 0);if(r.signal.aborted)return;if(s?.length){j(e=>({...e,courses:s})),F(e=>({...e,courses:`done`}));let e=a?a.commitSha:ue.current;a||m(i,{courses:s,commitSha:ue.current}),T(n,{commitSha:e??``,ref:z.current??``,model:G.model,builtAt:Date.now(),courseTitles:s.map(e=>e.title)})}else F(e=>({...e,courses:`error`}))}finally{clearTimeout(i)}})()},[G,K,gt]),vt=(0,E.useCallback)(()=>q(!0),[q]),[yt,bt]=(0,E.useState)(void 0),xt=(0,E.useCallback)(e=>{bt(e),L.current=!1,q(!0,e)},[q]),St=(0,E.useCallback)((e,t)=>{let n=R.current;return n?we(e,t,n):Promise.resolve({ok:!1,detail:`No connected repo.`})},[]),Ct=(0,E.useCallback)(async(e,t,n=!1,r)=>{let i=R.current;if(!i)return null;let{codeContext:a,contentHash:o}=await Se(t,z.current,i),s=p(`lesson|${i}|${e.title}|${t.title}|${r??`working`}|${o}`,G.model);if(!n){let n=await h(s);if(n)return Ie.current.set($e(e.title,t.title),n),n}let c=await xe(e,t,a,G,{maxTokens:K.lessonMaxTokens,thinkingLevel:K.thinkingLevel,altitude:r}).catch(()=>null);return c&&(m(s,c),Ie.current.set($e(e.title,t.title),c)),c},[G,K]),wt=(0,E.useCallback)(async(e,t=!1)=>{let n=R.current;if(!n)return;let r=p(`closing|${n}|${e.title}|${z.current??``}`,G.model);if(!t){let e=await h(r);if(e)return e}let i=new AbortController,a=setTimeout(()=>i.abort(),9e4),o=await be(e,G,{signal:i.signal,maxTokens:K.closingMaxTokens,thinkingLevel:K.thinkingLevel}).catch(()=>void 0).finally(()=>clearTimeout(a));return o&&m(r,o),o},[G,K]),Tt=(0,E.useCallback)(e=>{w(e);let t=W(e);t===`courses`?q():t===`orientation`&&_t()},[q,_t]),[Et,J]=(0,E.useState)(!1),[Dt,Ot]=(0,E.useState)(``),[kt,At]=(0,E.useState)(``),jt=(0,E.useCallback)(()=>{let e=Dt.trim();if(!v(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}J(!1),Ot(``),At(``)},[Dt,mt]),[Mt,Nt]=(0,E.useState)(`github`),[Pt,Ft]=(0,E.useState)(()=>de()),It=(0,E.useCallback)(e=>{Ft(de()),Nt(e),Ut(``),X(``),an(``),sn(S()),J(!0)},[]),[Lt,Rt]=(0,E.useState)(``),[zt,Bt]=(0,E.useState)(``),Vt=(0,E.useCallback)(()=>{let e=Lt.trim();if(!e){Bt(`Paste the alert, error, or log line that fired.`);return}U.current++;let t=A.changes.length>0&&!A.provenance.example?A:void 0,n=y(e,t);if(j(n),w(`incident`),J(!1),Rt(``),Bt(``),G){ce.current?.abort();let t=new AbortController;ce.current=t,_e(n,e,G,t.signal).then(e=>j(t=>t.incident===n.incident?e:t))}},[Lt,A,G]),[Ht,Ut]=(0,E.useState)(``),[Y,Wt]=(0,E.useState)(``),[Gt,Kt]=(0,E.useState)(``),[qt,Jt]=(0,E.useState)(``),[Yt,Xt]=(0,E.useState)(``),[Zt,Qt]=(0,E.useState)(``),[$t,en]=(0,E.useState)(``),[tn,X]=(0,E.useState)(``),[Z,nn]=(0,E.useState)(!1),[rn,an]=(0,E.useState)(``),[on,sn]=(0,E.useState)(!1),cn=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>cn.current?.abort(),[]);let Q=(0,E.useCallback)(async e=>{let t=U.current;cn.current?.abort();let n=new AbortController;cn.current=n,nn(!0),X(``);let r=await e(n.signal);if(!(n.signal.aborted||t!==U.current)){if(nn(!1),!r.ok||!r.diff){X(r.detail);return}if(mt(r.diff,r.label,Ae(r.label))===0){X(`That diff had no changed files to analyze.`);return}J(!1)}},[mt]),ln=(0,E.useCallback)(()=>{let e=Gt.trim();if(!e){X(`Enter a pull-request number.`);return}Q(t=>Ce(e,Y.trim()||void 0,t))},[Gt,Y,Q]),un=(0,E.useCallback)(()=>{let e=qt.trim(),t=Yt.trim();if(!e||!t){X(`Enter a base and a head ref to compare.`);return}Q(n=>we(e,t,Y.trim()||void 0,n))},[qt,Yt,Y,Q]),dn=(0,E.useCallback)(()=>{let e=rn.trim();e&&x(e).then(e=>{sn(e),an(``),e&&X(``)})},[rn]),fn=(0,E.useCallback)(()=>{ee().then(()=>{sn(!1),an(``)})},[]),pn=(0,E.useCallback)(async(e,t,n)=>{let r=(e??Y).trim()||void 0,i=(t??Zt).trim()||void 0,a=(n??$t).trim(),o=U.current;cn.current?.abort();let s=new AbortController;cn.current=s,nn(!0),X(``);let c=await Te(i,r,s.signal);if(s.signal.aborted||o!==U.current)return;if(nn(!1),!c.ok||!c.paths){X(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){X(`No files under “${l}”.`);return}let d=P(u,l?`${c.label??`repo`}/${l}`:c.label??`repo`,c.truncated),f=Ae(c.label),p=i,m=f?!!te(f):!1;U.current++,H(),++re.current,M.current=d,R.current=f,z.current=p,ue.current=c.sha,pe.current=null,I.current=!1,L.current=!1,ze(),Pe.current=u,j(d),w(m?`course`:`onboarding`),dt(!0),J(!1),F({verdict:`done`,orientation:`floor`,courses:`floor`}),f&&(_t(),m&&q())},[Zt,Y,$t,H,_t,q,ze]),mn=(0,E.useCallback)(()=>{let e=le(Ht,Y.trim()||void 0);if(e.kind===`invalid`){X(e.reason);return}if(X(``),e.kind===`pr`)Q(t=>Ce(e.prNumber,e.repo,t));else if(e.kind===`compare`)Q(t=>we(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;pn(e.repo,t,n)}},[Ht,Y,Q,pn]),hn=A.changes.length>0?`ship`:`understand`,gn=(0,E.useMemo)(()=>{let e={orientation:N.orientation,courses:N.courses,hasRepo:!!R.current},t=ot.filter(t=>t.applies(A,e)),n=hn===`ship`?`understand`:`ship`,r=t.filter(e=>e.jobs.includes(hn)),i=t.filter(e=>!e.jobs.includes(hn)&&e.jobs.includes(n));return[{job:hn,items:r},{job:n,items:i}].filter(e=>e.items.length>0)},[A,N.orientation,N.courses,hn]),_n=(0,E.useMemo)(()=>gn.flatMap(e=>e.items),[gn]);(0,E.useEffect)(()=>{_n.length&&!_n.some(e=>e.id===C)&&w(_n[0].id)},[_n,C]);let vn=(0,E.useCallback)(e=>{u&&n&&n(`${e.label}. ${e.problem??e.contract??``} ${e.fix??``}`.trim()),Le(`Explain ${e.label}${e.contract?` — ${e.contract}`:``}`)},[u,n,Le]),yn=(0,E.useCallback)(e=>{let t=A;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``}},[A]);(0,E.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(Et){J(!1);return}if(V){Ee(!1);return}i()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,Et,V]);let bn=(0,E.useRef)(null);l(bn);let $=A.pr,xn=A.provenance.example,Sn=(0,E.useCallback)(()=>{switch(C){case`verdict`:return(0,k.jsx)(he,{model:A,altitude:D,onNavigate:e=>Tt(e),onAsk:vn});case`read`:return(0,k.jsx)(He,{model:A,altitude:D});case`incident`:return(0,k.jsx)(Ue,{model:A,altitude:D});case`impact`:return(0,k.jsx)(ne,{nodes:A.nodes,edges:A.edges,altitude:D,onAsk:vn});case`workspace`:return(0,k.jsx)(We,{model:A,altitude:D});case`cascade`:return(0,k.jsx)(Ge,{model:A});case`migration`:return(0,k.jsx)(Ke,{model:A,altitude:D});case`rollout`:return(0,k.jsx)(qe,{model:A,altitude:D});case`course`:return(0,k.jsx)(Je,{model:A,altitude:D,building:N.courses===`enriching`,onRegenerate:R.current?vt:void 0,loadLessonDetail:R.current?Ct:void 0,loadCourseClosing:R.current?wt:void 0,courseFocus:yt,onCourseFocus:R.current?xt:void 0,speak:u?n:void 0,commitSha:R.current?ue.current:void 0,compareSinceBuilt:R.current?St:void 0,openFullAnalysis:R.current?mt:void 0,onAskAboutLesson:Le});case`onboarding`:return(0,k.jsx)(Ye,{model:A,altitude:D});case`hotspots`:return(0,k.jsx)(Xe,{model:A,altitude:D});case`suggestions`:return(0,k.jsx)(Ze,{model:A,altitude:D});case`gate`:return(0,k.jsx)(Qe,{model:A,altitude:D});default:throw Error(`Ripple: no section renderer for "${C}"`)}},[C,A,D,vn,Tt,N.courses,vt,Ct,wt,yt,xt,St,mt,u,n,Le]);return(0,k.jsx)(`div`,{className:`ripple-scrim`,"data-expanded":a?`true`:void 0,onClick:i,role:`button`,tabIndex:0,"aria-label":`Close Ripple`,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},children:(0,k.jsxs)(`section`,{className:`ripple-panel`,role:`dialog`,"aria-label":`Ripple`,ref:bn,onClick:e=>e.stopPropagation(),children:[(0,k.jsxs)(`header`,{className:`ripple-head`,children:[(0,k.jsxs)(`div`,{className:`ripple-id`,children:[(0,k.jsx)(`span`,{className:`ripple-word`,children:`Ripple`}),(0,k.jsx)(`span`,{className:`ripple-sep`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-repo`,children:$.repo}),$.number&&(0,k.jsx)(`span`,{className:`ripple-pr`,children:$.number}),$.branch&&(0,k.jsxs)(`span`,{className:`ripple-branch`,children:[$.branch,$.base?` → ${$.base}`:``]})]}),(0,k.jsxs)(`div`,{className:`ripple-head-right`,children:[($.added!=null||$.removed!=null)&&(0,k.jsxs)(`span`,{className:`ripple-stat`,children:[$.added!=null&&(0,k.jsxs)(`span`,{className:`ripple-add`,children:[`+`,$.added.toLocaleString()]}),` `,$.removed!=null&&(0,k.jsxs)(`span`,{className:`ripple-del`,children:[`−`,$.removed.toLocaleString()]}),$.files==null?``:` · ${$.files} files`]}),$.p0Ways?(0,k.jsxs)(`span`,{className:`ripple-p0`,title:`Ways this change could cause a P0`,children:[(0,k.jsx)(`span`,{className:`ripple-p0-dot`,"aria-hidden":`true`}),$.p0Ways,` `,$.p0Ways===1?`way`:`ways`,` to cause a P0`]}):null,(0,k.jsx)(`button`,{type:`button`,className:`ripple-ask-toggle`+(V?` is-active`:``),onClick:()=>Ee(e=>!e),...o(Be.preload),"aria-pressed":V,"aria-label":V?`Close the ask rail`:`Ask about this repo or PR`,title:V?`Hide ask`:`Ask about this repo or PR`,children:`Ask`}),n&&(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>f(e=>!e),"aria-pressed":u,"aria-label":u?`Turn narration off`:`Turn narration on`,title:u?`Narration on — the orb speaks the walkthrough`:`Narration off`,children:u?`🔊`:`🔇`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>s(e=>!e),"aria-label":a?`Exit full screen`:`Expand to full screen`,title:a?`Exit full screen`:`Full screen`,children:a?`⤡`:`⤢`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:i,"aria-label":`Close Ripple`,children:`✕`})]})]}),K.tier===`slow-cheap`&&ut&&!ct&&(0,k.jsxs)(`div`,{className:`ripple-hint`,role:`note`,children:[(0,k.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,k.jsx)(`button`,{type:`button`,className:`ripple-hint-dismiss`,onClick:ft,"aria-label":`Dismiss tip`,children:`Got it`})]}),(xn||(A.provenance.notes?.length??0)>0)&&(0,k.jsxs)(`div`,{className:`ripple-example`,"data-real":xn?void 0:`true`,role:`note`,children:[(0,k.jsx)(`span`,{className:`ripple-example-dot`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-example-text`,children:xn?(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`strong`,{children:A.changes.length===0?`Exploring`:`From your diff`}),` —`,` `,A.provenance.notes?.[0]]})}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-example-cta`,onClick:()=>It(`github`),children:xn?`Run on your own code →`:`New`})]}),(0,k.jsxs)(`div`,{className:`ripple-body`,children:[(0,k.jsxs)(`nav`,{className:`ripple-rail`,"aria-label":`Sections`,children:[gn.map(e=>(0,k.jsxs)(`div`,{className:`ripple-rail-group`,children:[gn.length>1&&(0,k.jsx)(`div`,{className:`ripple-rail-grouplabel`,children:at[e.job]}),e.items.map(e=>(0,k.jsxs)(`button`,{type:`button`,className:`ripple-rail-item`,"data-ripple-section":e.id,"data-active":e.id===C?`true`:void 0,"data-enriching":N[W(e.id)]===`enriching`?`true`:void 0,onClick:()=>{if(Tt(e.id),u&&n){let t=yn(e.id);t&&n(t)}},...o(()=>it(e.id)),children:[(0,k.jsx)(`span`,{className:`ripple-rail-label`,children:e.label}),N[W(e.id)]===`enriching`&&(0,k.jsx)(`span`,{className:`ripple-rail-spark`,"aria-hidden":`true`})]},e.id))]},e.job)),(0,k.jsxs)(`div`,{className:`ripple-rail-altitude`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`Explain for`}),(0,k.jsx)(`div`,{className:`ripple-alt`,role:`group`,"aria-label":`Explanation altitude`,children:nt.map(e=>(0,k.jsx)(`button`,{type:`button`,"data-active":D===e.id?`true`:void 0,onClick:()=>O(e.id),children:e.label},e.id))})]})]}),(0,k.jsxs)(`div`,{className:`ripple-main`,children:[N[W(C)]===`enriching`&&W(C)!==`courses`&&(0,k.jsxs)(`div`,{className:`ripple-sharpening-wrap`,children:[(0,k.jsxs)(`div`,{className:`ripple-sharpening`,role:`status`,"aria-live":`polite`,children:[(0,k.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),W(C)===`orientation`?`Reading the repo to map it out…`:`Sharpening with the model’s read…`]}),(0,k.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`})]}),W(C)===`verdict`&&N.verdict===`error`&&!me&&(0,k.jsxs)(`div`,{className:`ripple-verdict-err`,role:`note`,children:[(0,k.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,k.jsxs)(`div`,{className:`ripple-verdict-err-actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-retry`,onClick:ht,children:`Try again`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-dismiss`,onClick:()=>B(!0),"aria-label":`Dismiss`,children:`Dismiss`})]})]}),(0,k.jsx)(c,{label:`${ot.find(e=>e.id===C)?.label??`Ripple`} section`,children:Sn()})]}),V&&(0,k.jsx)(c,{label:`Ripple ask rail`,children:(0,k.jsx)(Ve,{ctx:Re,onClose:()=>Ee(!1),altitude:D,seed:Me,repo:$.repo||``,gitRef:$.branch||`HEAD`,focusFile:A.changes[0]?.file??A.modules[0]?.entry},Oe)})]}),Et&&(0,k.jsx)(`div`,{className:`ripple-paste`,role:`dialog`,"aria-label":`Run Ripple on a diff`,children:(0,k.jsxs)(`div`,{className:`ripple-paste-card`,children:[(0,k.jsxs)(`div`,{className:`ripple-paste-head`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`ripple-paste-title`,children:`Run Ripple on your code`}),(0,k.jsx)(`div`,{className:`ripple-paste-sub`,children:`Read-only — Ripple analyzes a change and never writes, comments, or merges.`})]}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>J(!1),"aria-label":`Cancel`,children:`✕`})]}),(0,k.jsx)(d,{kind:`code`,from:`live`}),Mt===`incident`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`textarea`,{className:`ripple-paste-input`,value:Lt,onChange:e=>{Rt(e.target.value),zt&&Bt(``)},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-BZobrQPX.js","assets/streamParse-BX0bAppQ.js","assets/rolldown-runtime-DkW27tQK.js","assets/providers-CPhoN8j0.js","assets/http-Bqk6nJiH.js","assets/blockTypes-DUDdP3pB.js","assets/info-CiqHR5cs.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/cache-7UEbF3S6.js","assets/incident-D3bmMmES.js","assets/githubBrowser-CErQprLW.js","assets/githubToken-Bwa7V9YT.js","assets/keyVault-Aw5Y2PjT.js","assets/owners-CP-4Q59L.js","assets/codeContext-CFnI3GLf.js","assets/ShipRead-CJJmY-wy.js","assets/compiler-runtime-qQQXpJgv.js","assets/react-BZJXY1be.js","assets/jsx-runtime-DeHZSEgm.js","assets/ShipIncident-DMLb14Lx.js","assets/ShipIncident-BUHvFFiC.css","assets/ShipWorkspace-_MtKAiKH.js","assets/colors-D49Req-e.js","assets/ShipWorkspace-D6XQpGEN.css","assets/ShipCascade-Bf-qDWMb.js","assets/ShipCascade-CyFnrlET.css","assets/ShipMigration-ZnzL-1rC.js","assets/ShipMigration-BznCskNg.css","assets/ShipRollout-Dt2TgI0L.js","assets/ShipRollout-CqeObx5b.css","assets/ShipCourse-BNEPgsV5.js","assets/DropSelect-BVDNR47E.js","assets/index-BMeoXWPR.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/preload-helper-CiWYd9n-.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/DropSelect-B4lqCEjw.css","assets/store-D2IJF4SA.js","assets/parseDiff-D8uBQ9mQ.js","assets/courseStore-DfafnL-9.js","assets/links--u_phi0x.js","assets/ShipCourse-DcT7PUSm.css","assets/ShipOnboarding-DUxtx2Vr.js","assets/ShipOnboarding-BC9Vxkpa.css","assets/ShipHotspots-lGioTtf1.js","assets/ShipHotspots-CLOMutPv.css","assets/ShipSuggestions-BrAXTjAR.js","assets/ShipSuggestions-BKRvk5Mj.css","assets/ShipGate-D4BP41-h.js","assets/ShipGate-BVZfCllb.css","assets/RippleAskController-BqnazbZ7.js","assets/json-J4Y32_i9.js","assets/verbatim-DBTj9sPD.js","assets/RippleAskController-BNAUoIW0.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{t as a}from"./cachedImport-DW0gP14h.js";import{n as o,t as s}from"./preloadableLazy-MIX1ApBW.js";import{E as c}from"./index-BMeoXWPR.js";import{t as l}from"./useFocusTrap-CJmpNZv2.js";import{t as u}from"./useSpatialCanvas-CfmZOXXP.js";import{t as d}from"./FeatureUseNotice-BNDajs0p.js";import{t as f}from"./route-CMdTFx0P.js";import{i as p,n as m,t as h}from"./cache-7UEbF3S6.js";import{t as g}from"./buildShip-BgFg98tH.js";import{n as _,t as v}from"./parseDiff-D8uBQ9mQ.js";import{t as y,u as b}from"./incident-D3bmMmES.js";import{i as x,r as S,t as ee}from"./githubToken-Bwa7V9YT.js";import{n as C,r as w}from"./colors-D49Req-e.js";import{n as te,r as T}from"./courseStore-DfafnL-9.js";var E=e(),D=.82;function O(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)*D/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*D}),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-84),f=Math.min(f,e.y-38),p=Math.max(p,e.x+84),m=Math.max(m,e.y+38);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 k=n();function ne({nodes:e,edges:t,altitude:n,onAsk:r,animate:i}){let[a,o]=(0,E.useState)(`severity`),[s,c]=(0,E.useState)(!1),[l,d]=(0,E.useState)(null),f=(0,E.useMemo)(()=>{let n=s?e.filter(e=>e.type===`pr`||e.crossRepo):e,r=new Set(n.map(e=>e.id));return O(n,t.filter(e=>r.has(e.from)&&r.has(e.to)))},[e,t,s]),p=(0,E.useMemo)(()=>{let e=new Map;for(let t of f.nodes)e.set(t.node.id,t);return e},[f]),m=(0,E.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,E.useEffect)(()=>{_(f.bbox)},[f,_]);let[v,y]=(0,E.useState)(!1),b=(0,E.useRef)(!1),x=(0,E.useRef)(!1),S=(0,E.useRef)({x:0,y:0}),ee=(0,E.useCallback)(e=>{b.current=!0,x.current=!1,y(!0),S.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)},[]),te=(0,E.useCallback)(e=>{if(!b.current)return;let t=e.clientX-S.current.x,n=e.clientY-S.current.y;Math.abs(t)+Math.abs(n)>2&&(x.current=!0),S.current={x:e.clientX,y:e.clientY},g.pan(t,n)},[g]),T=(0,E.useCallback)(e=>{b.current=!1,y(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),D=g.viewportRef,{zoomAtClient:ne}=g;(0,E.useEffect)(()=>{let e=D.current;if(!e)return;let t=e=>{e.preventDefault(),ne(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[D,ne]);let A=g.camera.scale>=.7,j=a===`traffic`,M=l?p.get(l)?.node??null:null,N=e.some(e=>typeof e.traffic==`number`),P=e.some(e=>e.crossRepo===!0);return(0,k.jsxs)(`div`,{className:`ripple-impact`,children:[(0,k.jsxs)(`div`,{className:`ripple-impact-controls`,children:[N&&(0,k.jsxs)(`div`,{className:`ripple-lens`,role:`group`,"aria-label":`Map lens`,children:[(0,k.jsx)(`button`,{type:`button`,"data-active":a===`severity`?`true`:void 0,onClick:()=>o(`severity`),children:`Severity`}),(0,k.jsx)(`button`,{type:`button`,"data-active":a===`traffic`?`true`:void 0,onClick:()=>o(`traffic`),children:`Traffic`})]}),P&&(0,k.jsxs)(`label`,{className:`ripple-crossrepo`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),`Cross-repo only`]}),(0,k.jsx)(`div`,{className:`ripple-zoombtns`,children:(0,k.jsx)(`button`,{type:`button`,onClick:()=>_(f.bbox),title:`Fit the whole map`,"aria-label":`Fit`,children:`⊡`})})]}),(0,k.jsxs)(`div`,{className:`ripple-stage`+(v?` is-panning`:``),ref:g.viewportRef,onPointerDown:ee,onPointerMove:te,onPointerUp:T,onPointerCancel:T,children:[(0,k.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,k.jsx)(`span`,{className:`ripple-enter-pulse`,"aria-hidden":`true`,style:{left:h.x,top:h.y}}),(0,k.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=w(e.node.status),a=j?1.3+(e.node.traffic??0)*3:r?.breaking?2.4:1.6;return(0,k.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)})}),A&&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,k.jsx)(`div`,{className:`ripple-edge-verb`,style:{left:(n.x+e.x)/2,top:(n.y+e.y)/2,color:w(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=w(t.status),i=j&&!n?1+(t.traffic??0)*.24:1;return(0,k.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-84,top:e.y-38,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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`ripple-node-eyebrow`,style:{color:r},children:`THIS CHANGE`}),(0,k.jsx)(`span`,{className:`ripple-node-name ripple-node-name-lg`,children:t.label})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{className:`ripple-node-top`,children:[(0,k.jsx)(`span`,{className:`ripple-node-dot`,style:{background:r},"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-node-status`,style:{color:r},children:C(t.status)}),t.severity&&(0,k.jsx)(`span`,{className:`ripple-node-sev`,style:{background:r},children:t.severity})]}),(0,k.jsx)(`span`,{className:`ripple-node-name`,children:t.label}),A&&(0,k.jsxs)(`span`,{className:`ripple-node-meta`,children:[t.team??t.owner??``,t.trafficLabel?` · ${t.trafficLabel}`:``]}),t.crossRepo&&(0,k.jsx)(`span`,{className:`ripple-node-repo`,children:`other repo`})]})},t.id)})]}),(0,k.jsx)(`div`,{className:`ripple-map-legend`,"aria-hidden":`true`,children:[`breaks`,`migration`,`untested`,`affected`,`safe`].map(e=>(0,k.jsxs)(`span`,{className:`ripple-map-legend-item`,children:[(0,k.jsx)(`span`,{className:`ripple-node-dot`,style:{background:w(e)}}),C(e).toLowerCase()]},e))})]}),M&&(0,k.jsxs)(`aside`,{className:`ripple-inspect`,"aria-label":`${M.label} detail`,children:[(0,k.jsxs)(`div`,{className:`ripple-inspect-head`,children:[(0,k.jsxs)(`div`,{className:`ripple-inspect-titles`,children:[(0,k.jsx)(`span`,{className:`ripple-node-status`,style:{color:w(M.status)},children:C(M.status)}),M.severity&&(0,k.jsxs)(`span`,{className:`ripple-inspect-sev`,style:{background:w(M.status)},children:[`would page · `,M.severity]})]}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>d(null),"aria-label":`Close detail`,children:`✕`})]}),(0,k.jsx)(`div`,{className:`ripple-inspect-name`,children:M.label}),(0,k.jsxs)(`div`,{className:`ripple-inspect-owner`,children:[M.team?`owned by ${M.team}`:``,M.cite?(0,k.jsxs)(`span`,{className:`ripple-inspect-cite`,children:[` · `,M.cite.ref]}):null]}),M.trafficLabel&&(0,k.jsxs)(`div`,{className:`ripple-inspect-traffic`,children:[(0,k.jsx)(`strong`,{children:M.trafficLabel}),(0,k.jsx)(`span`,{children:`live traffic, from tracing — not the diff`})]}),M.contract&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`The contract`}),(0,k.jsx)(`p`,{children:M.contract})]}),M.problem&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block ripple-inspect-problem`,style:{borderColor:`color-mix(in oklab, ${w(M.status)} 40%, transparent)`},children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,style:{color:w(M.status)},children:`What happens`}),(0,k.jsx)(`p`,{children:M.problem})]}),M.altitudeNotes?.[n]&&(0,k.jsxs)(`div`,{className:`ripple-inspect-block`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`At your altitude`}),(0,k.jsx)(`p`,{children:M.altitudeNotes[n]})]}),M.fix&&(0,k.jsxs)(`div`,{className:`ripple-inspect-fix`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`Mavéa’s call`}),(0,k.jsx)(`p`,{children:M.fix})]}),r&&(0,k.jsxs)(`button`,{type:`button`,className:`ripple-ask-btn`,onClick:()=>r(M),children:[`Ask about `,M.label]})]})]})}function A(e){let t=e.lastIndexOf(`/`),n=t>0?e.slice(0,t):``;return n?n.split(`/`).slice(0,2).join(`/`):`(root)`}function j(e){let t=e.split(`/`);return t[t.length-1]||e}function M(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 N(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 P(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=A(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=N(t),i=`${t.length} file${t.length===1?``:`s`}`,a=M(e);return{id:`m${n}`,name:e,purpose:a||i,entry:r,owner:``,health:i,explain:`${a?a+` `:``}${i} in ${e}.`+(r?` Start with ${j(r)} and follow what it imports.`:``),startHere:t.slice(0,3).map(j),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=N(t);s.push({id:r,label:e,sub:`${t.length} file${t.length===1?``:`s`}`,type:`module`,status:`affected`,scope:`in-pr`,contract:`${M(e)||`${t.length} files`}`+(i?` · start with ${j(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:M(e)||`${t.length} files`,file:N(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 F={tier:`slow-cheap`,enrichMaxTokens:1600,courseCount:3,coursesMaxTokens:2600,closingMaxTokens:3600,lessonMaxTokens:3600,fetchCodeContext:!1,thinkingLevel:`minimal`},re={tier:`frontier-deep`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:7e3,fetchCodeContext:!0,thinkingLevel:`low`},ie={tier:`frontier-fast`,enrichMaxTokens:2600,courseCount:5,coursesMaxTokens:3e3,closingMaxTokens:4e3,lessonMaxTokens:6e3,fetchCodeContext:!0,thinkingLevel:`minimal`},ae=e=>!!e&&/(localhost|127\.0\.0\.1|0\.0\.0\.0|host\.docker\.internal|:11434)/i.test(e);function oe(e){let t=e.model.toLowerCase();return ae(e.baseUrl)||f(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 se(e){switch(oe(e)){case`slow-cheap`:return F;case`frontier-deep`:return re;default:return ie}}var ce=/^[A-Za-z0-9._-]+$/,I=e=>({kind:`invalid`,reason:e});function le(e,t){let n=e.trim().replace(/^git@github\.com:/i,`github.com/`);if(!n)return I(`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||!ce.test(t)||!ce.test(n))return I(`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}:I(`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]}:I(`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]}:I(`Enter owner/repo#number, or connect a default repo first.`):I(`Paste a GitHub PR, compare, or repo URL — or owner/repo#123.`)}var L=`mavea.ripple.tracked.v1`,R=20;function z(){try{let e=localStorage.getItem(L);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>e&&e.id&&e.model):[]}catch{return[]}}function ue(e){try{localStorage.setItem(L,JSON.stringify(e.slice(0,R)))}catch{}}function de(){return z().sort((e,t)=>t.savedAt-e.savedAt)}function fe(e){ue(z().filter(t=>t.id!==e))}var pe=t();function me(e){return(/^(.*?[.!?])(\s|$)/.exec(e.trim())?.[1]??e).trim()}function he(e){let t=(0,pe.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=me(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 ee;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ee={id:`read`,label:`Full read`},t[22]=ee):ee=t[22];let C;t[23]===c?C=t[24]:(C=c?[]:[{id:`gate`,label:`The gate`}],t[23]=c,t[24]=C);let w;t[25]!==S||t[26]!==C||t[27]!==h||t[28]!==g||t[29]!==_||t[30]!==v||t[31]!==y||t[32]!==b||t[33]!==x?(w=[...h,...g,..._,...v,...y,...b,...x,...S,ee,...C],t[25]=S,t[26]=C,t[27]=h,t[28]=g,t[29]=_,t[30]=v,t[31]=y,t[32]=b,t[33]=x,t[34]=w):w=t[34];let te=w,T;t[35]===u.label?T=t[36]:(T=(0,k.jsx)(`span`,{className:`ripple-verdict-badge`,children:u.label}),t[35]=u.label,t[36]=T);let E;t[37]===d?E=t[38]:(E=(0,k.jsx)(`span`,{className:`ripple-verdict-scale`,children:d}),t[37]=d,t[38]=E);let D;t[39]!==T||t[40]!==E?(D=(0,k.jsxs)(`div`,{className:`ripple-verdict-top`,children:[T,E]}),t[39]=T,t[40]=E,t[41]=D):D=t[41];let O;t[42]===p?O=t[43]:(O=(0,k.jsx)(`p`,{className:`ripple-verdict-what`,children:p}),t[42]=p,t[43]=O);let A;t[44]!==c||t[45]!==m?(A=m?(0,k.jsxs)(`div`,{className:`ripple-verdict-one`,children:[(0,k.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:c?`Where to start`:`The one thing to check`}),(0,k.jsx)(`span`,{className:`ripple-verdict-one-text`,children:m})]}):!c&&(0,k.jsxs)(`div`,{className:`ripple-verdict-one ripple-verdict-clean`,children:[(0,k.jsx)(`span`,{className:`ripple-verdict-one-tag`,children:`Reads clean`}),(0,k.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]=A):A=t[46];let j;t[47]!==D||t[48]!==O||t[49]!==A||t[50]!==u.tone?(j=(0,k.jsxs)(`div`,{className:`ripple-verdict-head`,"data-tone":u.tone,children:[D,O,A]}),t[47]=D,t[48]=O,t[49]=A,t[50]=u.tone,t[51]=j):j=t[51];let M;t[52]!==r||t[53]!==n.edges||t[54]!==n.nodes||t[55]!==a?(M=(0,k.jsx)(`div`,{className:`ripple-verdict-map`,children:(0,k.jsx)(ne,{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]=M):M=t[56];let N;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,k.jsx)(`span`,{className:`ripple-verdict-chips-tag`,children:`Go deeper`}),t[57]=N):N=t[57];let P;t[58]!==te||t[59]!==i?(P=(0,k.jsxs)(`div`,{className:`ripple-verdict-chips`,"aria-label":`Go deeper`,children:[N,te.map(e=>(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-chip`,onClick:()=>i(e.id),children:e.label},e.id))]}),t[58]=te,t[59]=i,t[60]=P):P=t[60];let F;return t[61]!==j||t[62]!==M||t[63]!==P?(F=(0,k.jsxs)(`div`,{className:`ripple-verdict`,children:[j,M,P]}),t[61]=j,t[62]=M,t[63]=P,t[64]=F):F=t[64],F}r();var B=a(()=>i(()=>import(`./generate-BZobrQPX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),ge=(...e)=>B().then(t=>t.enrichShipModel(...e)),_e=(...e)=>B().then(t=>t.enrichIncident(...e)),ve=(...e)=>B().then(t=>t.enrichOrientation(...e)),ye=(...e)=>B().then(t=>t.enrichCourses(...e)),be=(...e)=>B().then(t=>t.enrichCourseClosing(...e)),xe=(...e)=>B().then(t=>t.enrichLesson(...e)),Se=(...e)=>B().then(t=>t.gatherLessonCode(...e)),V=a(()=>i(()=>import(`./githubBrowser-CErQprLW.js`).then(e=>e.i),__vite__mapDeps([11,2,4,12,13]))),Ce=(...e)=>V().then(t=>t.fetchPrDiff(...e)),we=(...e)=>V().then(t=>t.compareRefs(...e)),Te=(...e)=>V().then(t=>t.fetchRepoTree(...e)),Ee=a(()=>i(()=>import(`./owners-CP-4Q59L.js`),__vite__mapDeps([14,11,2,4,12,13]))),De=(...e)=>Ee().then(t=>t.resolveOwners(...e)),Oe=a(()=>i(()=>import(`./codeContext-CFnI3GLf.js`),__vite__mapDeps([15,11,2,4,12,13]))),ke=(...e)=>Oe().then(t=>t.gatherCodeContext(...e)),Ae=e=>e?/^([\w.-]+\/[\w.-]+)/.exec(e.trim())?.[1]:void 0,je=s(()=>i(()=>import(`./ShipRead-CJJmY-wy.js`).then(e=>({default:e.ShipRead})),__vite__mapDeps([16,17,2,18,19]))),Me=s(()=>i(()=>import(`./ShipIncident-DMLb14Lx.js`).then(e=>({default:e.ShipIncident})),__vite__mapDeps([20,18,2,17,19,21]))),Ne=s(()=>i(()=>import(`./ShipWorkspace-_MtKAiKH.js`).then(e=>({default:e.ShipWorkspace})),__vite__mapDeps([22,18,2,17,19,23,24]))),Pe=s(()=>i(()=>import(`./ShipCascade-Bf-qDWMb.js`).then(e=>({default:e.ShipCascade})),__vite__mapDeps([25,18,2,17,19,23,26]))),Fe=s(()=>i(()=>import(`./ShipMigration-ZnzL-1rC.js`).then(e=>({default:e.ShipMigration})),__vite__mapDeps([27,17,2,18,19,28]))),Ie=s(()=>i(()=>import(`./ShipRollout-Dt2TgI0L.js`).then(e=>({default:e.ShipRollout})),__vite__mapDeps([29,17,2,18,19,30]))),Le=s(()=>i(()=>import(`./ShipCourse-BNEPgsV5.js`).then(e=>({default:e.ShipCourse})),__vite__mapDeps([31,18,2,17,19,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]))),Re=s(()=>i(()=>import(`./ShipOnboarding-DUxtx2Vr.js`).then(e=>({default:e.ShipOnboarding})),__vite__mapDeps([48,18,2,17,19,49]))),ze=s(()=>i(()=>import(`./ShipHotspots-lGioTtf1.js`).then(e=>({default:e.ShipHotspots})),__vite__mapDeps([50,18,2,17,19,51]))),H=s(()=>i(()=>import(`./ShipSuggestions-BrAXTjAR.js`).then(e=>({default:e.ShipSuggestions})),__vite__mapDeps([52,18,2,17,19,53]))),U=s(()=>i(()=>import(`./ShipGate-D4BP41-h.js`).then(e=>({default:e.ShipGate})),__vite__mapDeps([54,18,2,19,55]))),Be=s(()=>i(()=>import(`./RippleAskController-BqnazbZ7.js`).then(e=>({default:e.RippleAskController})),__vite__mapDeps([56,18,2,17,19,3,4,5,6,7,8,57,58,11,12,13,46,59]))),Ve=Be.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=ze.Component,Ze=H.Component,Qe=U.Component,$e=(e,t)=>`${e}::${t}`;function et(e){try{return localStorage.getItem(e)}catch{return null}}function tt(e,t){try{localStorage.setItem(e,t)}catch{}}var nt=[{id:`newgrad`,label:`New grad`},{id:`working`,label:`Working`},{id:`principal`,label:`Principal`}],rt=new Set([`anthropic`,`openai`,`gemini`,`grok`,`openrouter`]);function it(e){return{read:je.preload,incident:Me.preload,workspace:Ne.preload,cascade:Pe.preload,migration:Fe.preload,rollout:Ie.preload,course:Le.preload,onboarding:Re.preload,hotspots:ze.preload,suggestions:H.preload,gate:U.preload}[e]?.()??Promise.resolve()}var at={understand:`Understand`,ship:`Ship the change`},W=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:i}){let[a,s]=(0,E.useState)(!1),[u,f]=(0,E.useState)(!1),[C,w]=(0,E.useState)(`verdict`),[D,O]=(0,E.useState)(`working`),[A,j]=(0,E.useState)(e),M=(0,E.useRef)(e),[N,F]=(0,E.useState)({verdict:`floor`,orientation:`floor`,courses:`floor`}),re=(0,E.useRef)(0),ie=(0,E.useRef)(null),ae=(0,E.useRef)(null),oe=(0,E.useRef)(null),ce=(0,E.useRef)(null),I=(0,E.useRef)(!1),L=(0,E.useRef)(!1),R=(0,E.useRef)(void 0),z=(0,E.useRef)(void 0),ue=(0,E.useRef)(void 0),pe=(0,E.useRef)(null),[me,B]=(0,E.useState)(!1),[V,Ee]=(0,E.useState)(!1),[Oe,je]=(0,E.useState)(0),[Me,Ne]=(0,E.useState)(null),Pe=(0,E.useRef)([]),Fe=(0,E.useRef)(new Map),Ie=(0,E.useRef)(new Map),Le=(0,E.useCallback)(e=>{Ne(t=>({text:e,nonce:(t?.nonce??0)+1})),Ee(!0)},[]),Re=(0,E.useMemo)(()=>t?{model:A,cfg:t,altitude:D,diffText:pe.current?.text,repo:R.current,gitRef:z.current,treePaths:Pe.current,lessonDetails:Ie.current,fileCache:Fe.current}:null,[t,A,D]),ze=(0,E.useCallback)(()=>{je(e=>e+1),Pe.current=[],Fe.current.clear(),Ie.current.clear()},[]),H=(0,E.useCallback)(()=>{ie.current?.abort(),ae.current?.abort(),oe.current?.abort(),ce.current?.abort()},[]);(0,E.useEffect)(()=>H,[H]);let U=(0,E.useRef)(0);(0,E.useEffect)(()=>{j(e),M.current=e,R.current=void 0,I.current=!0,L.current=!0,F({verdict:`done`,orientation:e.modules.length?`done`:`floor`,courses:e.courses?.length?`done`:`floor`})},[e]);let st=(0,E.useRef)(!1);(0,E.useEffect)(()=>{st.current||(st.current=!0,!(!e.provenance.example||r)&&(et(`ripple.seenWorkedExample`)===`1`?(Nt(`github`),J(!0)):tt(`ripple.seenWorkedExample`,`1`)))},[e.provenance.example,r]);let G=(0,E.useMemo)(()=>t&&rt.has(t.provider)?t:{provider:`gemini`,model:`gemini-3.5-flash`,apiKey:``},[t]),K=(0,E.useMemo)(()=>se(G),[G]),[ct,lt]=(0,E.useState)(()=>et(`ripple.hint.fastModel.dismissed`)===`1`),[ut,dt]=(0,E.useState)(!1),ft=(0,E.useCallback)(()=>{lt(!0),tt(`ripple.hint.fastModel.dismissed`,`1`)},[]),pt=(0,E.useCallback)((e,t,n)=>{let r=++re.current;ie.current?.abort();let i=new AbortController;ie.current=i,B(!1),F(e=>({...e,verdict:`enriching`})),(async()=>{let a=n&&K.fetchCodeContext?await ke(e,n,void 0,i.signal).catch(()=>``):``;if(i.signal.aborted||re.current!==r)return;let o=await ge(e,t,G,{signal:i.signal,codeContext:a||void 0,maxTokens:K.enrichMaxTokens,thinkingLevel:K.thinkingLevel,onPartial:t=>{re.current===r&&j(b(e,t,G.model))}});re.current===r&&(o?(j(o),M.current=o,F(e=>({...e,verdict:`done`}))):(j(e),M.current=e,F(e=>({...e,verdict:`error`}))))})()},[G,K]),mt=(0,E.useCallback)((e,t,n)=>{let r=g(_(e),t);return r.changes.length===0?0:(U.current++,H(),M.current=r,R.current=n,z.current=r.pr.branch||void 0,ue.current=void 0,pe.current={text:e,repo:n},I.current=!1,L.current=!1,ze(),j(r),w(`verdict`),dt(!0),F({verdict:`enriching`,orientation:`floor`,courses:`floor`}),pt(r,e,n),r.changes.length)},[H,pt,ze]),ht=(0,E.useCallback)(()=>{let e=pe.current;e&&pt(M.current,e.text,e.repo)},[pt]),gt=(0,E.useCallback)(e=>{let t=M.current;return t.modules.length?t.modules:P(t.changes.map(e=>e.file),e,!1).modules},[]),_t=(0,E.useCallback)((e=!1)=>{let t=R.current;if(!t||I.current&&!e)return;I.current=!0,ae.current?.abort();let n=new AbortController;ae.current=n,F(e=>({...e,orientation:`enriching`})),(async()=>{let e=await ve({...M.current,modules:gt(t)},t,z.current,G,{signal:n.signal,maxTokens:K.enrichMaxTokens,thinkingLevel:K.thinkingLevel}).catch(()=>null);if(n.signal.aborted)return;let r=e?await De(e,t,z.current,n.signal).catch(()=>e):{...M.current,modules:gt(t)};n.signal.aborted||(j(e=>({...e,modules:r.modules,nodes:r.nodes,onboarding:r.onboarding})),F(t=>({...t,orientation:e?`done`:`error`})))})()},[G,K,gt]),q=(0,E.useCallback)((e=!1,t)=>{let n=R.current;if(!n||L.current&&!e)return;L.current=!0,oe.current?.abort();let r=new AbortController;oe.current=r;let i=setTimeout(()=>r.abort(),9e4);F(e=>({...e,courses:`enriching`})),(async()=>{try{let i=p(`courses|${n}|${z.current??``}|${t??``}`,G.model),a=e?null:await h(i);if(r.signal.aborted)return;let o={...M.current,modules:gt(n)},s=a?.courses??await ye(o,n,z.current,G,{signal:r.signal,count:K.courseCount,maxTokens:K.coursesMaxTokens,thinkingLevel:K.thinkingLevel,focus:t}).catch(()=>void 0);if(r.signal.aborted)return;if(s?.length){j(e=>({...e,courses:s})),F(e=>({...e,courses:`done`}));let e=a?a.commitSha:ue.current;a||m(i,{courses:s,commitSha:ue.current}),T(n,{commitSha:e??``,ref:z.current??``,model:G.model,builtAt:Date.now(),courseTitles:s.map(e=>e.title)})}else F(e=>({...e,courses:`error`}))}finally{clearTimeout(i)}})()},[G,K,gt]),vt=(0,E.useCallback)(()=>q(!0),[q]),[yt,bt]=(0,E.useState)(void 0),xt=(0,E.useCallback)(e=>{bt(e),L.current=!1,q(!0,e)},[q]),St=(0,E.useCallback)((e,t)=>{let n=R.current;return n?we(e,t,n):Promise.resolve({ok:!1,detail:`No connected repo.`})},[]),Ct=(0,E.useCallback)(async(e,t,n=!1,r)=>{let i=R.current;if(!i)return null;let{codeContext:a,contentHash:o}=await Se(t,z.current,i),s=p(`lesson|${i}|${e.title}|${t.title}|${r??`working`}|${o}`,G.model);if(!n){let n=await h(s);if(n)return Ie.current.set($e(e.title,t.title),n),n}let c=await xe(e,t,a,G,{maxTokens:K.lessonMaxTokens,thinkingLevel:K.thinkingLevel,altitude:r}).catch(()=>null);return c&&(m(s,c),Ie.current.set($e(e.title,t.title),c)),c},[G,K]),wt=(0,E.useCallback)(async(e,t=!1)=>{let n=R.current;if(!n)return;let r=p(`closing|${n}|${e.title}|${z.current??``}`,G.model);if(!t){let e=await h(r);if(e)return e}let i=new AbortController,a=setTimeout(()=>i.abort(),9e4),o=await be(e,G,{signal:i.signal,maxTokens:K.closingMaxTokens,thinkingLevel:K.thinkingLevel}).catch(()=>void 0).finally(()=>clearTimeout(a));return o&&m(r,o),o},[G,K]),Tt=(0,E.useCallback)(e=>{w(e);let t=W(e);t===`courses`?q():t===`orientation`&&_t()},[q,_t]),[Et,J]=(0,E.useState)(!1),[Dt,Ot]=(0,E.useState)(``),[kt,At]=(0,E.useState)(``),jt=(0,E.useCallback)(()=>{let e=Dt.trim();if(!v(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}J(!1),Ot(``),At(``)},[Dt,mt]),[Mt,Nt]=(0,E.useState)(`github`),[Pt,Ft]=(0,E.useState)(()=>de()),It=(0,E.useCallback)(e=>{Ft(de()),Nt(e),Ut(``),X(``),an(``),sn(S()),J(!0)},[]),[Lt,Rt]=(0,E.useState)(``),[zt,Bt]=(0,E.useState)(``),Vt=(0,E.useCallback)(()=>{let e=Lt.trim();if(!e){Bt(`Paste the alert, error, or log line that fired.`);return}U.current++;let t=A.changes.length>0&&!A.provenance.example?A:void 0,n=y(e,t);if(j(n),w(`incident`),J(!1),Rt(``),Bt(``),G){ce.current?.abort();let t=new AbortController;ce.current=t,_e(n,e,G,t.signal).then(e=>j(t=>t.incident===n.incident?e:t))}},[Lt,A,G]),[Ht,Ut]=(0,E.useState)(``),[Y,Wt]=(0,E.useState)(``),[Gt,Kt]=(0,E.useState)(``),[qt,Jt]=(0,E.useState)(``),[Yt,Xt]=(0,E.useState)(``),[Zt,Qt]=(0,E.useState)(``),[$t,en]=(0,E.useState)(``),[tn,X]=(0,E.useState)(``),[Z,nn]=(0,E.useState)(!1),[rn,an]=(0,E.useState)(``),[on,sn]=(0,E.useState)(!1),cn=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>cn.current?.abort(),[]);let Q=(0,E.useCallback)(async e=>{let t=U.current;cn.current?.abort();let n=new AbortController;cn.current=n,nn(!0),X(``);let r=await e(n.signal);if(!(n.signal.aborted||t!==U.current)){if(nn(!1),!r.ok||!r.diff){X(r.detail);return}if(mt(r.diff,r.label,Ae(r.label))===0){X(`That diff had no changed files to analyze.`);return}J(!1)}},[mt]),ln=(0,E.useCallback)(()=>{let e=Gt.trim();if(!e){X(`Enter a pull-request number.`);return}Q(t=>Ce(e,Y.trim()||void 0,t))},[Gt,Y,Q]),un=(0,E.useCallback)(()=>{let e=qt.trim(),t=Yt.trim();if(!e||!t){X(`Enter a base and a head ref to compare.`);return}Q(n=>we(e,t,Y.trim()||void 0,n))},[qt,Yt,Y,Q]),dn=(0,E.useCallback)(()=>{let e=rn.trim();e&&x(e).then(e=>{sn(e),an(``),e&&X(``)})},[rn]),fn=(0,E.useCallback)(()=>{ee().then(()=>{sn(!1),an(``)})},[]),pn=(0,E.useCallback)(async(e,t,n)=>{let r=(e??Y).trim()||void 0,i=(t??Zt).trim()||void 0,a=(n??$t).trim(),o=U.current;cn.current?.abort();let s=new AbortController;cn.current=s,nn(!0),X(``);let c=await Te(i,r,s.signal);if(s.signal.aborted||o!==U.current)return;if(nn(!1),!c.ok||!c.paths){X(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){X(`No files under “${l}”.`);return}let d=P(u,l?`${c.label??`repo`}/${l}`:c.label??`repo`,c.truncated),f=Ae(c.label),p=i,m=f?!!te(f):!1;U.current++,H(),++re.current,M.current=d,R.current=f,z.current=p,ue.current=c.sha,pe.current=null,I.current=!1,L.current=!1,ze(),Pe.current=u,j(d),w(m?`course`:`onboarding`),dt(!0),J(!1),F({verdict:`done`,orientation:`floor`,courses:`floor`}),f&&(_t(),m&&q())},[Zt,Y,$t,H,_t,q,ze]),mn=(0,E.useCallback)(()=>{let e=le(Ht,Y.trim()||void 0);if(e.kind===`invalid`){X(e.reason);return}if(X(``),e.kind===`pr`)Q(t=>Ce(e.prNumber,e.repo,t));else if(e.kind===`compare`)Q(t=>we(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;pn(e.repo,t,n)}},[Ht,Y,Q,pn]),hn=A.changes.length>0?`ship`:`understand`,gn=(0,E.useMemo)(()=>{let e={orientation:N.orientation,courses:N.courses,hasRepo:!!R.current},t=ot.filter(t=>t.applies(A,e)),n=hn===`ship`?`understand`:`ship`,r=t.filter(e=>e.jobs.includes(hn)),i=t.filter(e=>!e.jobs.includes(hn)&&e.jobs.includes(n));return[{job:hn,items:r},{job:n,items:i}].filter(e=>e.items.length>0)},[A,N.orientation,N.courses,hn]),_n=(0,E.useMemo)(()=>gn.flatMap(e=>e.items),[gn]);(0,E.useEffect)(()=>{_n.length&&!_n.some(e=>e.id===C)&&w(_n[0].id)},[_n,C]);let vn=(0,E.useCallback)(e=>{u&&n&&n(`${e.label}. ${e.problem??e.contract??``} ${e.fix??``}`.trim()),Le(`Explain ${e.label}${e.contract?` — ${e.contract}`:``}`)},[u,n,Le]),yn=(0,E.useCallback)(e=>{let t=A;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``}},[A]);(0,E.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){if(Et){J(!1);return}if(V){Ee(!1);return}i()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i,Et,V]);let bn=(0,E.useRef)(null);l(bn);let $=A.pr,xn=A.provenance.example,Sn=(0,E.useCallback)(()=>{switch(C){case`verdict`:return(0,k.jsx)(he,{model:A,altitude:D,onNavigate:e=>Tt(e),onAsk:vn});case`read`:return(0,k.jsx)(He,{model:A,altitude:D});case`incident`:return(0,k.jsx)(Ue,{model:A,altitude:D});case`impact`:return(0,k.jsx)(ne,{nodes:A.nodes,edges:A.edges,altitude:D,onAsk:vn});case`workspace`:return(0,k.jsx)(We,{model:A,altitude:D});case`cascade`:return(0,k.jsx)(Ge,{model:A});case`migration`:return(0,k.jsx)(Ke,{model:A,altitude:D});case`rollout`:return(0,k.jsx)(qe,{model:A,altitude:D});case`course`:return(0,k.jsx)(Je,{model:A,altitude:D,building:N.courses===`enriching`,onRegenerate:R.current?vt:void 0,loadLessonDetail:R.current?Ct:void 0,loadCourseClosing:R.current?wt:void 0,courseFocus:yt,onCourseFocus:R.current?xt:void 0,speak:u?n:void 0,commitSha:R.current?ue.current:void 0,compareSinceBuilt:R.current?St:void 0,openFullAnalysis:R.current?mt:void 0,onAskAboutLesson:Le});case`onboarding`:return(0,k.jsx)(Ye,{model:A,altitude:D});case`hotspots`:return(0,k.jsx)(Xe,{model:A,altitude:D});case`suggestions`:return(0,k.jsx)(Ze,{model:A,altitude:D});case`gate`:return(0,k.jsx)(Qe,{model:A,altitude:D});default:throw Error(`Ripple: no section renderer for "${C}"`)}},[C,A,D,vn,Tt,N.courses,vt,Ct,wt,yt,xt,St,mt,u,n,Le]);return(0,k.jsx)(`div`,{className:`ripple-scrim`,"data-expanded":a?`true`:void 0,onClick:i,role:`button`,tabIndex:0,"aria-label":`Close Ripple`,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())},children:(0,k.jsxs)(`section`,{className:`ripple-panel`,role:`dialog`,"aria-label":`Ripple`,ref:bn,onClick:e=>e.stopPropagation(),children:[(0,k.jsxs)(`header`,{className:`ripple-head`,children:[(0,k.jsxs)(`div`,{className:`ripple-id`,children:[(0,k.jsx)(`span`,{className:`ripple-word`,children:`Ripple`}),(0,k.jsx)(`span`,{className:`ripple-sep`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-repo`,children:$.repo}),$.number&&(0,k.jsx)(`span`,{className:`ripple-pr`,children:$.number}),$.branch&&(0,k.jsxs)(`span`,{className:`ripple-branch`,children:[$.branch,$.base?` → ${$.base}`:``]})]}),(0,k.jsxs)(`div`,{className:`ripple-head-right`,children:[($.added!=null||$.removed!=null)&&(0,k.jsxs)(`span`,{className:`ripple-stat`,children:[$.added!=null&&(0,k.jsxs)(`span`,{className:`ripple-add`,children:[`+`,$.added.toLocaleString()]}),` `,$.removed!=null&&(0,k.jsxs)(`span`,{className:`ripple-del`,children:[`−`,$.removed.toLocaleString()]}),$.files==null?``:` · ${$.files} files`]}),$.p0Ways?(0,k.jsxs)(`span`,{className:`ripple-p0`,title:`Ways this change could cause a P0`,children:[(0,k.jsx)(`span`,{className:`ripple-p0-dot`,"aria-hidden":`true`}),$.p0Ways,` `,$.p0Ways===1?`way`:`ways`,` to cause a P0`]}):null,(0,k.jsx)(`button`,{type:`button`,className:`ripple-ask-toggle`+(V?` is-active`:``),onClick:()=>Ee(e=>!e),...o(Be.preload),"aria-pressed":V,"aria-label":V?`Close the ask rail`:`Ask about this repo or PR`,title:V?`Hide ask`:`Ask about this repo or PR`,children:`Ask`}),n&&(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>f(e=>!e),"aria-pressed":u,"aria-label":u?`Turn narration off`:`Turn narration on`,title:u?`Narration on — the orb speaks the walkthrough`:`Narration off`,children:u?`🔊`:`🔇`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>s(e=>!e),"aria-label":a?`Exit full screen`:`Expand to full screen`,title:a?`Exit full screen`:`Full screen`,children:a?`⤡`:`⤢`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:i,"aria-label":`Close Ripple`,children:`✕`})]})]}),K.tier===`slow-cheap`&&ut&&!ct&&(0,k.jsxs)(`div`,{className:`ripple-hint`,role:`note`,children:[(0,k.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,k.jsx)(`button`,{type:`button`,className:`ripple-hint-dismiss`,onClick:ft,"aria-label":`Dismiss tip`,children:`Got it`})]}),(xn||(A.provenance.notes?.length??0)>0)&&(0,k.jsxs)(`div`,{className:`ripple-example`,"data-real":xn?void 0:`true`,role:`note`,children:[(0,k.jsx)(`span`,{className:`ripple-example-dot`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`ripple-example-text`,children:xn?(0,k.jsxs)(k.Fragment,{children:[(0,k.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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`strong`,{children:A.changes.length===0?`Exploring`:`From your diff`}),` —`,` `,A.provenance.notes?.[0]]})}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-example-cta`,onClick:()=>It(`github`),children:xn?`Run on your own code →`:`New`})]}),(0,k.jsxs)(`div`,{className:`ripple-body`,children:[(0,k.jsxs)(`nav`,{className:`ripple-rail`,"aria-label":`Sections`,children:[gn.map(e=>(0,k.jsxs)(`div`,{className:`ripple-rail-group`,children:[gn.length>1&&(0,k.jsx)(`div`,{className:`ripple-rail-grouplabel`,children:at[e.job]}),e.items.map(e=>(0,k.jsxs)(`button`,{type:`button`,className:`ripple-rail-item`,"data-ripple-section":e.id,"data-active":e.id===C?`true`:void 0,"data-enriching":N[W(e.id)]===`enriching`?`true`:void 0,onClick:()=>{if(Tt(e.id),u&&n){let t=yn(e.id);t&&n(t)}},...o(()=>it(e.id)),children:[(0,k.jsx)(`span`,{className:`ripple-rail-label`,children:e.label}),N[W(e.id)]===`enriching`&&(0,k.jsx)(`span`,{className:`ripple-rail-spark`,"aria-hidden":`true`})]},e.id))]},e.job)),(0,k.jsxs)(`div`,{className:`ripple-rail-altitude`,children:[(0,k.jsx)(`div`,{className:`ripple-eyebrow`,children:`Explain for`}),(0,k.jsx)(`div`,{className:`ripple-alt`,role:`group`,"aria-label":`Explanation altitude`,children:nt.map(e=>(0,k.jsx)(`button`,{type:`button`,"data-active":D===e.id?`true`:void 0,onClick:()=>O(e.id),children:e.label},e.id))})]})]}),(0,k.jsxs)(`div`,{className:`ripple-main`,children:[N[W(C)]===`enriching`&&W(C)!==`courses`&&(0,k.jsxs)(`div`,{className:`ripple-sharpening-wrap`,children:[(0,k.jsxs)(`div`,{className:`ripple-sharpening`,role:`status`,"aria-live":`polite`,children:[(0,k.jsx)(`span`,{className:`ripple-sharpening-dot`,"aria-hidden":`true`}),W(C)===`orientation`?`Reading the repo to map it out…`:`Sharpening with the model’s read…`]}),(0,k.jsx)(`div`,{className:`ripple-progress`,"aria-hidden":`true`})]}),W(C)===`verdict`&&N.verdict===`error`&&!me&&(0,k.jsxs)(`div`,{className:`ripple-verdict-err`,role:`note`,children:[(0,k.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,k.jsxs)(`div`,{className:`ripple-verdict-err-actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-retry`,onClick:ht,children:`Try again`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-verdict-err-dismiss`,onClick:()=>B(!0),"aria-label":`Dismiss`,children:`Dismiss`})]})]}),(0,k.jsx)(c,{label:`${ot.find(e=>e.id===C)?.label??`Ripple`} section`,children:Sn()})]}),V&&(0,k.jsx)(c,{label:`Ripple ask rail`,children:(0,k.jsx)(Ve,{ctx:Re,onClose:()=>Ee(!1),altitude:D,seed:Me,repo:$.repo||``,gitRef:$.branch||`HEAD`,focusFile:A.changes[0]?.file??A.modules[0]?.entry},Oe)})]}),Et&&(0,k.jsx)(`div`,{className:`ripple-paste`,role:`dialog`,"aria-label":`Run Ripple on a diff`,children:(0,k.jsxs)(`div`,{className:`ripple-paste-card`,children:[(0,k.jsxs)(`div`,{className:`ripple-paste-head`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`ripple-paste-title`,children:`Run Ripple on your code`}),(0,k.jsx)(`div`,{className:`ripple-paste-sub`,children:`Read-only — Ripple analyzes a change and never writes, comments, or merges.`})]}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,onClick:()=>J(!1),"aria-label":`Cancel`,children:`✕`})]}),(0,k.jsx)(d,{kind:`code`,from:`live`}),Mt===`incident`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`textarea`,{className:`ripple-paste-input`,value:Lt,onChange:e=>{Rt(e.target.value),zt&&Bt(``)},placeholder:`PagerDuty: [payments-api] P1 — 5xx rate 38% on /charge
|
|
3
3
|
or paste the error / log line that fired`,spellCheck:!1}),zt&&(0,k.jsx)(`div`,{className:`ripple-paste-err`,children:zt}),(0,k.jsxs)(`div`,{className:`ripple-paste-actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`ripple-paste-go`,onClick:Vt,children:`Trace it back`}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-paste-cancel`,onClick:()=>J(!1),children:`Cancel`})]}),(0,k.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,k.jsx)(`div`,{className:`ripple-tracked`,children:Pt.length===0?(0,k.jsxs)(`div`,{className:`ripple-tracked-empty`,children:[`Nothing tracked yet. Open a change and hit `,(0,k.jsx)(`strong`,{children:`☆ Track`}),` to keep an eye on it — it’s saved on this device only.`]}):Pt.map(e=>(0,k.jsxs)(`div`,{className:`ripple-tracked-row`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`ripple-tracked-open`,onClick:()=>{j(e.model),w(`verdict`),J(!1)},children:[(0,k.jsx)(`span`,{className:`ripple-tracked-label`,children:e.label}),(0,k.jsxs)(`span`,{className:`ripple-tracked-meta`,children:[e.source,` · `,e.model.changes.length||e.model.modules.length,` items`]})]}),(0,k.jsx)(`button`,{type:`button`,className:`ripple-iconbtn`,"aria-label":`Untrack ${e.label}`,onClick:()=>{fe(e.id),Ft(de())},children:`✕`})]},e.id))}):Mt===`paste`?(0,k.jsxs)(k.Fragment,{children:[(0,k.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-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{n}from"./useInView-DsTvv7L_.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{ot as i}from"./index-
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{n}from"./useInView-DsTvv7L_.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{ot as i}from"./index-BMeoXWPR.js";var a=t(),o=e(),s=r(),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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/audioTrack-
|
|
2
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a}from"./preloadableLazy-MIX1ApBW.js";import{n as o}from"./icons-gLFQTv74.js";import{t as s}from"./useFocusTrap-CJmpNZv2.js";import{t as c}from"./toast-BBNs2h3L.js";import{n as l,r as u}from"./spokenText-Dy-GZvZV.js";import{i as d,n as f,o as p,r as m}from"./capture-Bomj_Egy.js";import{n as h}from"./share--tpc1nLE.js";import{a as g,c as _,i as v,l as y,n as b,o as x,r as S,s as ee,t as C,u as w}from"./registry-Cz5cZREW.js";import{t as te}from"./ReelJelly-D5e-jt-8.js";import{t as T}from"./threads-DNfxMTwx.js";import{t as ne}from"./FeatureUseNotice-BfnZH8Vt.js";var E=e(),D=n();function re({slide:e}){"use no memo";let t=x(e);return(0,D.jsx)(t.Slide,{slots:t.slots})}var O=t(),k=(0,E.createContext)(0),A=new Set([`hidden`,`clip`,`auto`,`scroll`]);function j(e){let t=(0,O.c)(11),{children:n}=e,r=(0,E.useRef)(null),i=(0,E.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,E.useState)(a),c=(0,E.useContext)(k),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}!A.has(t.overflowX)&&!A.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,E.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,D.jsx)(`div`,{ref:r,style:d,children:(0,D.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var ie=[`up`,`left`,`zoom`,`wipe`,`fade`];function M(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function ae(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=M(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 N=e=>e.template!==`title`&&e.template!==`outro`,P=e=>e.template===`outro`,oe=e=>e.template===`title`;function F(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)N(e[r])&&n++;return n}function se(e,t){let n=e[t];return n&&N(n)?F(e,t):-1}function ce({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,E.useState)(m),[_,y]=(0,E.useState)(0),b=u!==void 0,[x,ee]=(0,E.useState)(!1),C=b?u:x,w=(0,E.useCallback)(()=>{b?d?.(!C):ee(e=>!e)},[b,C,d]),[T,ne]=(0,E.useState)(0),O=(0,E.useRef)(!1),A=(0,E.useRef)(null),M=(0,E.useRef)(null),ce=(0,E.useRef)(i);ce.current=i;let I=(0,E.useCallback)(e=>{M.current=e,ce.current?.(e)},[]);(0,E.useEffect)(()=>{l&&M.current?.focus({preventScroll:!0})},[l]);let L=(0,E.useRef)(!1);L.current=C;let R=(0,E.useRef)(null),z=(0,E.useRef)(0),B=(0,E.useCallback)(e=>{A.current=e,e&&ae(e)&&ne(e=>e+1)},[]);if((0,E.useLayoutEffect)(()=>{let e=A.current;if(!e)return;let t=new ResizeObserver(()=>{ae(e)&&ne(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,E.useEffect)(()=>{o&&(O.current=!1,g(m),y(e=>e+1))},[a,o]),(0,E.useEffect)(()=>{if(!o||C||h>=f.length)return;let e=R.current??p[h];R.current=null,z.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),L.current&&(R.current=Math.max(0,e-(Date.now()-z.current)))}},[h,f.length,n,r,a,o,C]),(0,E.useEffect)(()=>{R.current=null},[h]),!f.length)return null;let V=f[Math.min(h,f.length-1)],H=F(f,h),U=se(f,h),W=f.filter(N).length,G=e=>{let t=-1;for(let n=0;n<f.length;n++)if(N(f[n])&&t++,t===e){g(n),y(e=>e+1);return}},K=e=>{if(!W)return;let t=N(V)?U+e:e>0?H:H-1;G(Math.max(0,Math.min(W-1,t)))},q=f.reduce((e,t,n)=>(oe(t)&&e.push(n),e),[]),J=e=>{if(q.length<=1)return;let t=q.filter(e=>e<=h).length-1,n=Math.max(0,Math.min(q.length-1,t+e));g(q[n]),y(e=>e+1)},Y=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),K(1);break;case`ArrowLeft`:e.preventDefault(),K(-1);break;case`ArrowDown`:e.preventDefault(),J(1);break;case`ArrowUp`:e.preventDefault(),J(-1);break;case` `:case`Spacebar`:e.preventDefault(),w()}},X=v(V.template)===`dark`,le=S(V.template),ue=h===0?`fade`:ie[(h+e.seed)%ie.length];return(0,D.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:I,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?Y: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,D.jsxs)(`div`,{className:`reel-board`,ref:B,"data-surface":X?`dark`:`light`,"data-bleed":le?`true`:`false`,children:[X&&(0,D.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,D.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:W},(e,t)=>{let n=t===U,r=t<H||P(V),i=(0,D.jsx)(`span`,{className:`reel-seg`,children:(0,D.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,D.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>G(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,D.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,D.jsxs)(`div`,{className:`reel-top`,children:[(0,D.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,D.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,D.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!le&&(0,D.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,D.jsx)(te,{})}),(0,D.jsx)(`div`,{className:`reel-stage`,children:(0,D.jsx)(`div`,{className:`reel-trans`,"data-trans":ue,children:(0,D.jsx)(k.Provider,{value:T,children:(0,D.jsx)(j,{children:(0,D.jsx)(re,{slide:V})})})},`${_}-${h}`)}),(0,D.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&C,"aria-hidden":`true`,children:(0,D.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{})]})})]})})}function I(e){let t=[],n=T(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var L=/^(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,R=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function z(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return w(n,y.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(L,``).replace(/[?!.]+$/,``).trim(),a=(i.split(R)[0]||``).trim()||i;return a?w(a.charAt(0).toUpperCase()+a.slice(1),y.heading):``}var B={palette:`aurora`,vibe:`clean`,maxSlides:6};function V(e){return w(e[0]?.question||e[0]?.spec?.title||`Mavéa`,y.title)}function H(e){return e[0]?.spec?.topic||e[0]?.spec?.title||V(e)}function U(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function W(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function G(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var K=0;function q(e,t,n,r,i){let a=w(u(r.voiceover),y.voiceover);return{id:`s${K++}`,content:e,template:t,slots:b(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function J(e,t,n,r,i,a){return q(e,C(e,i,a,g(e,t)),t,n,r)}function Y(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function X(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function le(e,t,n,r){let i=V(e.frames);return q(`title`,`title`,{question:i,kicker:e.heading||z(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:_.intro},r)}function ue(e,t,n){let r=e.flatMap(e=>e.frames),i=V(r),a=H(r),o=[];e.forEach((t,n)=>{let r={topic:H(t.frames),question:V(t.frames)};o.push(le(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(q(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:_.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 de(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:C(e.content,t,n,g(e.content,e.slots),e.template)})}}function fe(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:l((e.note||``).trim()),spoken:u((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=W(e),r=U(G(e)),s=U(l(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)=>J(e.content,e.raw,{voiceover:e.voiceover,ms:_.default},t,0,n+1))}function pe(e,t){let n=I(e);return n.slice(-Y(t,n.length))}function me(e,t={}){let n={...B,...t},r=pe(e,n.maxSlides);return ue(r.map((e,t)=>({frames:e,content:fe(e,{topic:H(e),question:V(e)},X(n.maxSlides,r.length,t))})),n,0)}var he=[{id:`aurora`,label:`Aurora`,dot:`linear-gradient(135deg,#6d6dff,#a78bfa)`,blurb:`Indigo`},{id:`ember`,label:`Ember`,dot:`linear-gradient(135deg,#f4923c,#e0603a)`,blurb:`Warm amber`},{id:`ocean`,label:`Ocean`,dot:`linear-gradient(135deg,#2ad0e6,#0f9bad)`,blurb:`Deep teal`},{id:`chalk`,label:`Chalk`,dot:`linear-gradient(135deg,#c3c8d6,#7d8398)`,blurb:`Editorial`}];r();var ge=()=>i(()=>import(`./audioTrack-w1tZwSoU.js`).then(e=>e.t).then(e=>e.renderReelAudio),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),_e=(0,E.lazy)(()=>i(()=>import(`./ConversationVideoStudio-CEi_cgBR.js`).then(e=>({default:e.ConversationVideoStudio})),__vite__mapDeps([16,3,1,4,6,2,5,7,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,0,14,15,50,51,52,53,54,55,56,57,58,59,60]))),ve=[{id:`9:16`,label:`Story`,w:12,h:20},{id:`1:1`,label:`Square`,w:16,h:16},{id:`16:9`,label:`Landscape`,w:20,h:12}],ye=[{id:`balanced`,label:`Balanced`},{id:`high`,label:`High`},{id:`ultra`,label:`Ultra`}],be={idle:``,voicing:`Synthesizing narration…`,recording:`Recording the reel…`,saving:`Finishing the file…`};function xe(e){return e.slides.map(e=>e.voiceover).join(`\0`)}function Z({frames:e,script:t,retainedAudio:n,onClose:r,onShared:i}){let[l,u]=(0,E.useState)(t?`reel`:`conversation`),[g,_]=(0,E.useState)(!1),[v,y]=(0,E.useState)(`9:16`),[b,x]=(0,E.useState)(`aurora`),[S,C]=(0,E.useState)(`high`),[w,te]=(0,E.useState)(()=>t??(e?.length?me(e):null)),[T,re]=(0,E.useState)(!1),[O,k]=(0,E.useState)(!1),[A,j]=(0,E.useState)(`idle`),[ie,M]=(0,E.useState)(null),[ae,N]=(0,E.useState)(!1),[P,oe]=(0,E.useState)(!1),[F,se]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(0),B=l===`conversation`?g:A===`voicing`||A===`recording`||A===`saving`,V=A===`error`?ie:be[A],H=(0,E.useRef)(null),U=(0,E.useRef)(null),W=(0,E.useRef)(null),G=(0,E.useRef)(void 0),K=(0,E.useRef)(`high`);K.current=S;let q=(0,E.useRef)(null),J=(0,E.useRef)(null),[Y,X]=(0,E.useState)(null),le=(0,E.useMemo)(()=>a(()=>ee().then(()=>void 0)),[]),ue=(0,E.useRef)(null),fe=(0,E.useCallback)(()=>{B||r()},[B,r]);s(ue,{onEscape:fe,initialFocus:l===`reel`?H:void 0});let pe=(e??[]).map(e=>`${e.at}:${e.question}`).join(`|`);(0,E.useEffect)(()=>{if(q.current?.stop(),q.current=null,J.current=null,X(null),oe(!1),L(!1),z(0),t){te(t);return}te(me(e??[]))},[pe,t]);let Z=(0,E.useMemo)(()=>w?{...w,palette:b}:null,[w,b]),Se=w?Math.max(6,Math.round(w.durationMs/1e3)):0,Ce=Y?Math.max(6,Math.round(Y.reduce((e,t)=>e+t,0)/1e3)):null,we=Ce??Se,Te=Z?`${v}-${T?`rec`:`preview-${Z.seed}-${Y?`synced`:`rough`}`}`:null,Ee=(0,E.useRef)(!1);Ee.current=P;let De=(0,E.useCallback)(async()=>{if(P){q.current?.setMuted(!0),oe(!1);return}if(!Z)return;let e=xe(Z),t=J.current;if(!t||t.sig!==e){se(!0);try{t={sig:e,...await(await ge())(Z)},J.current=t}catch{c(`Could not prepare the narration`,`warn`);return}finally{se(!1)}}if(!t.buffer){c(`Narration is unavailable. Check the local voice service, then retry.`,`warn`);return}q.current||=p(t.buffer),q.current?.setMuted(!1),q.current?.play(),I&&q.current?.pause(),X(t.timings),oe(!0)},[P,Z,I]);(0,E.useEffect)(()=>()=>{q.current?.stop(),q.current=null},[]);let Oe=(0,E.useCallback)(e=>{L(e),Ee.current&&(e?q.current?.pause():q.current?.resume())},[]),ke=(0,E.useCallback)(()=>{L(!1),z(e=>e+1),Ee.current&&q.current?.play()},[]),Q=(0,E.useCallback)((e=`idle`)=>{U.current?.cancel(),U.current=null,W.current=null,G.current=void 0,re(!1),k(!1),j(e)},[]),$=(0,E.useCallback)(e=>{c(e,`warn`),M(e),Q(`error`)},[Q]);(0,E.useEffect)(()=>()=>Q(),[Q]),(0,E.useEffect)(()=>{if(!T||!ae||U.current||!H.current)return;let e=!1,t=(G.current??[]).reduce((e,t)=>e+t,0);return d({el:H.current,audioBuffer:W.current,aspect:v,quality:K.current,maxDurationMs:t?t+900:void 0}).then(t=>{if(e){t.cancel();return}U.current=t,k(!0)}).catch(()=>$(`Couldn't render the clip in this browser`)),()=>{e=!0}},[T,ae,v,$]);let Ae=(0,E.useCallback)(()=>{if(B||!Z)return;if(!f()){c(`This browser can't render a video clip`,`warn`);return}M(null),j(`voicing`);let e=xe(Z),t=J.current;(t&&t.sig===e?Promise.resolve(t):ge().then(e=>e(Z))).then(t=>{J.current={sig:e,...t};let{buffer:n,timings:r,missing:i,firstMissingLine:a}=t;if(!n||i>0){let e=a?` for “${a.slice(0,72)}${a.length>72?`…`:``}”`:``;$(`Narration is unavailable${e}. Check the local voice service, then retry.`);return}G.current=r,W.current=n,k(!1),N(!1),j(`recording`),re(!0)}).catch(()=>$(`Could not prepare the narration`))},[B,Z,$]),je=(0,E.useCallback)(async()=>{let e=U.current;if(!e){Q();return}U.current=null,j(`saving`);try{let t=await e.stop();h(t.blob,void 0,()=>void t.dispose?.()),c(`Saved to your downloads`,`good`),i?.(),Q()}catch{$(`Could not finish the clip`)}},[Q,$,i]);if(!t&&!e?.length)return null;let Me=()=>{L(!1),te(e=>e&&de(e,e.seed+1))};return(0,D.jsx)(`div`,{className:`shm-scrim`,role:`presentation`,onClick:B?void 0:e=>e.target===e.currentTarget&&r(),children:(0,D.jsxs)(`div`,{ref:ue,className:`shm-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Share this conversation as a video`,children:[e?.length?(0,D.jsxs)(`div`,{className:`shm-tabs`,role:`group`,"aria-label":`Video style`,children:[(0,D.jsx)(`button`,{type:`button`,"aria-pressed":l===`conversation`,disabled:B,onClick:()=>u(`conversation`),children:`Conversation`}),(0,D.jsx)(`button`,{type:`button`,"aria-pressed":l===`reel`,disabled:B,onClick:()=>u(`reel`),children:`Reel`})]}):null,l===`conversation`&&e?.length?(0,D.jsx)(E.Suspense,{fallback:(0,D.jsxs)(`div`,{className:`shm-composing`,role:`status`,children:[(0,D.jsx)(`span`,{className:`shm-composing-dot`}),`Opening…`]}),children:(0,D.jsx)(_e,{frames:e,retainedAudio:n,onShared:i,onBusyChange:_})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`shm-panel`,children:[(0,D.jsx)(`div`,{className:`shm-eyebrow`,children:`▷ MAVÉA REEL`}),(0,D.jsxs)(`div`,{className:`shm-headline`,children:[`Your session, as`,Ce?``:` about`,` a`,` `,(0,D.jsx)(`span`,{style:{color:`var(--presence-soft)`},children:we?`${we}-second`:``}),` `,`clip.`]}),(0,D.jsx)(`div`,{className:`shm-sub`,children:`Auto-cut locally from the conversation and rendered in this browser. Narration uses the local Kokoro voice service; the finished video saves straight to your downloads.`}),(0,D.jsx)(ne,{kind:`publishing`,from:`live`}),Z&&!T&&(0,D.jsxs)(`div`,{className:`shm-kbd-hint`,"aria-hidden":`true`,children:[(0,D.jsx)(`kbd`,{children:`←`}),(0,D.jsx)(`kbd`,{children:`→`}),` beats · `,(0,D.jsx)(`kbd`,{children:`↑`}),(0,D.jsx)(`kbd`,{children:`↓`}),` sections · `,(0,D.jsx)(`kbd`,{children:`space`}),` pause`]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Palette`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:he.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":b===e.id,"aria-pressed":b===e.id,disabled:B,onClick:()=>{x(e.id)},title:e.blurb,children:[(0,D.jsx)(`span`,{className:`shm-dot`,style:{background:e.dot},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Format`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:ve.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":v===e.id,"aria-pressed":v===e.id,disabled:B,onClick:()=>{y(e.id)},children:[(0,D.jsx)(`span`,{className:`shm-shape`,style:{width:e.w,height:e.h},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Quality`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:ye.map(e=>(0,D.jsx)(`button`,{type:`button`,className:`shm-chip`,"data-active":S===e.id,"aria-pressed":S===e.id,disabled:B,onClick:()=>{C(e.id)},title:m(e.id),children:e.label},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-actions`,children:[(0,D.jsx)(`button`,{type:`button`,className:`shm-btn shm-btn-primary`,disabled:B||!Z,onClick:Ae,children:B?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}),V]}):`↓ Download video`}),(0,D.jsx)(`button`,{type:`button`,className:`shm-remix`,...le,disabled:B||!w||!!t,onClick:Me,title:`Re-roll the look (same content, free)`,children:`↻ Remix`})]}),(0,D.jsxs)(`div`,{className:`shm-progress`,"data-on":B||A===`error`,"data-error":A===`error`,role:`status`,children:[(0,D.jsx)(`div`,{className:`shm-progress-bar`,children:(0,D.jsx)(`i`,{})}),(0,D.jsx)(`span`,{className:`shm-progress-text`,children:V||` `})]})]}),(0,D.jsx)(`div`,{className:`shm-stage`,children:(0,D.jsxs)(`div`,{className:`shm-frame`,"data-aspect":v,children:[Z?(0,D.jsx)(ce,{script:Z,timings:T?G.current:Y??void 0,loop:!T,playing:!T||O,playKey:T?0:R,paused:T?void 0:I,onPausedChange:T?void 0:Oe,initialIndex:!T&&Z.seed>0?Math.max(0,Z.slides.findIndex(e=>e.content!==`title`&&e.content!==`outro`)):0,interactive:!T,onCycle:()=>{Ee.current&&q.current?.play()},frameRef:e=>{H.current=e,e&&N(!0)},onDone:T?je:void 0},Te):null,Z&&!T&&(0,D.jsxs)(`div`,{className:`shm-controls`,children:[(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":P,onClick:De,disabled:F,"aria-pressed":P,title:P?`Mute preview`:`Play sound`,children:F?(0,D.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}):P?(0,D.jsx)(o.speaker,{style:{width:18,height:18}}):(0,D.jsx)(o.speakerOff,{style:{width:18,height:18}})}),(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":I,onClick:()=>Oe(!I),"aria-pressed":I,title:I?`Play`:`Pause`,children:I?(0,D.jsx)(o.play,{style:{width:17,height:17}}):(0,D.jsx)(o.pause,{style:{width:17,height:17}})}),(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,onClick:ke,title:`Replay from the start`,children:(0,D.jsx)(o.refresh,{style:{width:17,height:17}})})]})]})})]}),(0,D.jsx)(`button`,{type:`button`,className:`shm-close`,onClick:B?void 0:r,disabled:B,title:B?`Finishing the export…`:void 0,"aria-label":`Close`,children:`✕`})]})})}export{Z as ShareModal};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/audioTrack-W_18XwGZ.js","assets/rolldown-runtime-DkW27tQK.js","assets/index-BMeoXWPR.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/useInView-DsTvv7L_.js","assets/jsx-runtime-DeHZSEgm.js","assets/coreIcons-DDTChE1H.js","assets/preload-helper-CiWYd9n-.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/theme-D5D55hZi.js","assets/index-CFE0vqqO.css","assets/kokoro-DcP-u0Tl.js","assets/spokenText-Dy-GZvZV.js","assets/ConversationVideoStudio-Cyu-M9Us.js","assets/icons-gLFQTv74.js","assets/TopicCanvas-CyBGLgb0.js","assets/loader-BRfSnl9t.js","assets/FallbackCard-CUe6i-zT.js","assets/blockLabel-FogyzEQY.js","assets/FallbackCard-D_6ps1xA.css","assets/useFocusTrap-CJmpNZv2.js","assets/motion-BY_Egaxm.js","assets/useSpatialCanvas-CfmZOXXP.js","assets/CanvasSkeleton-BmGjJHUQ.js","assets/CanvasSkeleton-DYASkTjW.css","assets/richText-BkxJhl9N.js","assets/toast-BBNs2h3L.js","assets/format-q0LwBjID.js","assets/safeImageUrl-BINWXOTz.js","assets/useValidatedImage-BQi2c66o.js","assets/empty-D51uhW0E.js","assets/deepenStore-BWLLzLCY.js","assets/catalog-BHjl-1uH.js","assets/http-Bqk6nJiH.js","assets/lib-Dkb5WBRc.js","assets/BlockEmpty-B-giiUPy.js","assets/motion-DxHSlPN6.js","assets/lib-DP9Kuxqk.css","assets/TopicCanvas-sGuo7pnQ.css","assets/Presence-UqXfH4Y-.js","assets/geometry-DXAbnb0J.js","assets/sentenceCase-CLDiNB0f.js","assets/capture-Dyff_zSz.js","assets/share--tpc1nLE.js","assets/FeatureUseNotice-BNDajs0p.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/history-D2EH2X6D.js","assets/replay-DoRQJHjZ.js","assets/generateBeats-Da9RmZke.js","assets/walkSync-CRhkAQFu.js","assets/nextFrame-12y0UrAd.js","assets/canvas-BX595EVB.js","assets/AnnotationLayer-CzXCVZCu.js","assets/gesture-BBS5nQEi.js","assets/number-zqlPMliA.js","assets/emphasize-BqCIst-B.js","assets/AnnotationLayer-BRYhJ1LB.css","assets/ConversationVideoStudio-CSO3jHXD.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{n as a}from"./preloadableLazy-MIX1ApBW.js";import{n as o}from"./icons-gLFQTv74.js";import{t as s}from"./useFocusTrap-CJmpNZv2.js";import{t as c}from"./toast-BBNs2h3L.js";import{n as l,r as u}from"./spokenText-Dy-GZvZV.js";import{i as d,n as f,o as p,r as m}from"./capture-Dyff_zSz.js";import{n as h}from"./share--tpc1nLE.js";import{a as g,c as _,i as v,l as y,n as b,o as x,r as S,s as ee,t as C,u as w}from"./registry-Cz5cZREW.js";import{t as te}from"./ReelJelly-D5e-jt-8.js";import{t as T}from"./threads-DNfxMTwx.js";import{t as ne}from"./FeatureUseNotice-BNDajs0p.js";var E=e(),D=n();function re({slide:e}){"use no memo";let t=x(e);return(0,D.jsx)(t.Slide,{slots:t.slots})}var O=t(),k=(0,E.createContext)(0),A=new Set([`hidden`,`clip`,`auto`,`scroll`]);function j(e){let t=(0,O.c)(11),{children:n}=e,r=(0,E.useRef)(null),i=(0,E.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,E.useState)(a),c=(0,E.useContext)(k),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}!A.has(t.overflowX)&&!A.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,E.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,D.jsx)(`div`,{ref:r,style:d,children:(0,D.jsx)(`div`,{ref:i,style:p,children:n})}),t[8]=n,t[9]=p,t[10]=m):m=t[10],m}var ie=[`up`,`left`,`zoom`,`wipe`,`fade`];function M(e,t){let n=e/t;return n<.8?`9:16`:n<1.3?`1:1`:`16:9`}function ae(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=M(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 N=e=>e.template!==`title`&&e.template!==`outro`,P=e=>e.template===`outro`,oe=e=>e.template===`title`;function F(e,t){let n=0;for(let r=0;r<t&&r<e.length;r++)N(e[r])&&n++;return n}function se(e,t){let n=e[t];return n&&N(n)?F(e,t):-1}function ce({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,E.useState)(m),[_,y]=(0,E.useState)(0),b=u!==void 0,[x,ee]=(0,E.useState)(!1),C=b?u:x,w=(0,E.useCallback)(()=>{b?d?.(!C):ee(e=>!e)},[b,C,d]),[T,ne]=(0,E.useState)(0),O=(0,E.useRef)(!1),A=(0,E.useRef)(null),M=(0,E.useRef)(null),ce=(0,E.useRef)(i);ce.current=i;let I=(0,E.useCallback)(e=>{M.current=e,ce.current?.(e)},[]);(0,E.useEffect)(()=>{l&&M.current?.focus({preventScroll:!0})},[l]);let L=(0,E.useRef)(!1);L.current=C;let R=(0,E.useRef)(null),z=(0,E.useRef)(0),B=(0,E.useCallback)(e=>{A.current=e,e&&ae(e)&&ne(e=>e+1)},[]);if((0,E.useLayoutEffect)(()=>{let e=A.current;if(!e)return;let t=new ResizeObserver(()=>{ae(e)&&ne(e=>e+1)});return t.observe(e),()=>t.disconnect()},[]),(0,E.useEffect)(()=>{o&&(O.current=!1,g(m),y(e=>e+1))},[a,o]),(0,E.useEffect)(()=>{if(!o||C||h>=f.length)return;let e=R.current??p[h];R.current=null,z.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),L.current&&(R.current=Math.max(0,e-(Date.now()-z.current)))}},[h,f.length,n,r,a,o,C]),(0,E.useEffect)(()=>{R.current=null},[h]),!f.length)return null;let V=f[Math.min(h,f.length-1)],H=F(f,h),U=se(f,h),W=f.filter(N).length,G=e=>{let t=-1;for(let n=0;n<f.length;n++)if(N(f[n])&&t++,t===e){g(n),y(e=>e+1);return}},K=e=>{if(!W)return;let t=N(V)?U+e:e>0?H:H-1;G(Math.max(0,Math.min(W-1,t)))},q=f.reduce((e,t,n)=>(oe(t)&&e.push(n),e),[]),J=e=>{if(q.length<=1)return;let t=q.filter(e=>e<=h).length-1,n=Math.max(0,Math.min(q.length-1,t+e));g(q[n]),y(e=>e+1)},Y=e=>{switch(e.key){case`ArrowRight`:e.preventDefault(),K(1);break;case`ArrowLeft`:e.preventDefault(),K(-1);break;case`ArrowDown`:e.preventDefault(),J(1);break;case`ArrowUp`:e.preventDefault(),J(-1);break;case` `:case`Spacebar`:e.preventDefault(),w()}},X=v(V.template)===`dark`,le=S(V.template),ue=h===0?`fade`:ie[(h+e.seed)%ie.length];return(0,D.jsx)(`div`,{className:`reel`,"data-palette":e.palette,"data-vibe":e.vibe,ref:I,role:l?`application`:void 0,tabIndex:l?0:void 0,onKeyDown:l?Y: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,D.jsxs)(`div`,{className:`reel-board`,ref:B,"data-surface":X?`dark`:`light`,"data-bleed":le?`true`:`false`,children:[X&&(0,D.jsx)(`div`,{className:`reel-darkwash`,"aria-hidden":`true`}),(0,D.jsx)(`div`,{className:`reel-progress`,"data-interactive":l,"aria-hidden":!l,children:Array.from({length:W},(e,t)=>{let n=t===U,r=t<H||P(V),i=(0,D.jsx)(`span`,{className:`reel-seg`,children:(0,D.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,D.jsx)(`button`,{type:`button`,className:`reel-seg-hit`,onClick:()=>G(t),"aria-label":`Jump to beat ${t+1}`,children:i},t):(0,D.jsx)(`span`,{className:`reel-seg-hit`,children:i},t)})}),(0,D.jsxs)(`div`,{className:`reel-top`,children:[(0,D.jsxs)(`span`,{className:`reel-wordmark`,children:[(0,D.jsx)(`span`,{className:`reel-dot`,"aria-hidden":`true`}),`Mavéa`]}),(0,D.jsx)(`span`,{className:`reel-palettename`,children:e.palette})]}),!le&&(0,D.jsx)(`div`,{className:`reel-jelly-pos`,"aria-hidden":`true`,children:(0,D.jsx)(te,{})}),(0,D.jsx)(`div`,{className:`reel-stage`,children:(0,D.jsx)(`div`,{className:`reel-trans`,"data-trans":ue,children:(0,D.jsx)(k.Provider,{value:T,children:(0,D.jsx)(j,{children:(0,D.jsx)(re,{slide:V})})})},`${_}-${h}`)}),(0,D.jsx)(`div`,{className:`reel-pause-badge`,"data-show":l&&C,"aria-hidden":`true`,children:(0,D.jsxs)(`div`,{className:`reel-pause-glyph`,children:[(0,D.jsx)(`span`,{}),(0,D.jsx)(`span`,{})]})})]})})}function I(e){let t=[],n=T(e,null);return e.forEach((e,r)=>{t.length===0||n[r]?t.push([e]):t[t.length-1].push(e)}),t}var L=/^(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,R=/\s*[,;:]\s+|\s+—\s+|\s+–\s+|\s+\band\b\s+|\s+\bbut\b\s+|\s+\bso\b\s+/i;function z(e){let t=e[0];if(!t)return``;let n=t.spec?.title?.trim();if(n)return w(n,y.heading);let r=(t.question||``).trim();if(!r)return``;let i=r.replace(L,``).replace(/[?!.]+$/,``).trim(),a=(i.split(R)[0]||``).trim()||i;return a?w(a.charAt(0).toUpperCase()+a.slice(1),y.heading):``}var B={palette:`aurora`,vibe:`clean`,maxSlides:6};function V(e){return w(e[0]?.question||e[0]?.spec?.title||`Mavéa`,y.title)}function H(e){return e[0]?.spec?.topic||e[0]?.spec?.title||V(e)}function U(e){return(e||``).replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(e=>e.length>1)}function W(e){return(e.narration||e.spec?.found||e.spec?.sub||``).trim()}function G(e){return(e.spoken||e.narration||e.spec?.found||e.spec?.sub||``).trim()}var K=0;function q(e,t,n,r,i){let a=w(u(r.voiceover),y.voiceover);return{id:`s${K++}`,content:e,template:t,slots:b(e,n,i),voiceover:a,durationMs:Math.max(r.ms,a?Math.round(a.length/13*1e3)+500:0),sourceBlockId:r.sourceBlockId}}function J(e,t,n,r,i,a){return q(e,C(e,i,a,g(e,t)),t,n,r)}function Y(e,t){return Math.max(1,Math.min(t,Math.floor((e-1)/2)))}function X(e,t,n=0){let r=Math.max(t,e-1-t);return Math.max(1,Math.floor(r/t)+ +(n<r%t))}function le(e,t,n,r){let i=V(e.frames);return q(`title`,`title`,{question:i,kicker:e.heading||z(e.frames)||void 0,part:n>1?{index:t+1,count:n}:void 0},{voiceover:i,ms:_.intro},r)}function ue(e,t,n){let r=e.flatMap(e=>e.frames),i=V(r),a=H(r),o=[];e.forEach((t,n)=>{let r={topic:H(t.frames),question:V(t.frames)};o.push(le(t,n,e.length,r)),o.push(...t.content)});let s={topic:a,question:i};return o.push(q(`outro`,`outro`,{wordmark:`Mavéa`,tagline:`Talk to AI. See what it means.`},{voiceover:`Made with Mavéa.`,ms:_.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 de(e,t){return{...e,seed:t,slides:e.slides.map((e,n)=>e.content===`title`||e.content===`outro`?e:{...e,template:C(e.content,t,n,g(e.content,e.slots),e.template)})}}function fe(e,t,n){let r=e.flatMap(e=>e.spec?.blocks??[]).map(e=>({shown:l((e.note||``).trim()),spoken:u((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=W(e),r=U(G(e)),s=U(l(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)=>J(e.content,e.raw,{voiceover:e.voiceover,ms:_.default},t,0,n+1))}function pe(e,t){let n=I(e);return n.slice(-Y(t,n.length))}function me(e,t={}){let n={...B,...t},r=pe(e,n.maxSlides);return ue(r.map((e,t)=>({frames:e,content:fe(e,{topic:H(e),question:V(e)},X(n.maxSlides,r.length,t))})),n,0)}var he=[{id:`aurora`,label:`Aurora`,dot:`linear-gradient(135deg,#6d6dff,#a78bfa)`,blurb:`Indigo`},{id:`ember`,label:`Ember`,dot:`linear-gradient(135deg,#f4923c,#e0603a)`,blurb:`Warm amber`},{id:`ocean`,label:`Ocean`,dot:`linear-gradient(135deg,#2ad0e6,#0f9bad)`,blurb:`Deep teal`},{id:`chalk`,label:`Chalk`,dot:`linear-gradient(135deg,#c3c8d6,#7d8398)`,blurb:`Editorial`}];r();var ge=()=>i(()=>import(`./audioTrack-W_18XwGZ.js`).then(e=>e.t).then(e=>e.renderReelAudio),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),_e=(0,E.lazy)(()=>i(()=>import(`./ConversationVideoStudio-Cyu-M9Us.js`).then(e=>({default:e.ConversationVideoStudio})),__vite__mapDeps([16,3,1,4,6,2,5,7,8,9,10,11,12,13,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,0,14,15,50,51,52,53,54,55,56,57,58,59,60]))),ve=[{id:`9:16`,label:`Story`,w:12,h:20},{id:`1:1`,label:`Square`,w:16,h:16},{id:`16:9`,label:`Landscape`,w:20,h:12}],ye=[{id:`balanced`,label:`Balanced`},{id:`high`,label:`High`},{id:`ultra`,label:`Ultra`}],be={idle:``,voicing:`Synthesizing narration…`,recording:`Recording the reel…`,saving:`Finishing the file…`};function xe(e){return e.slides.map(e=>e.voiceover).join(`\0`)}function Z({frames:e,script:t,retainedAudio:n,onClose:r,onShared:i}){let[l,u]=(0,E.useState)(t?`reel`:`conversation`),[g,_]=(0,E.useState)(!1),[v,y]=(0,E.useState)(`9:16`),[b,x]=(0,E.useState)(`aurora`),[S,C]=(0,E.useState)(`high`),[w,te]=(0,E.useState)(()=>t??(e?.length?me(e):null)),[T,re]=(0,E.useState)(!1),[O,k]=(0,E.useState)(!1),[A,j]=(0,E.useState)(`idle`),[ie,M]=(0,E.useState)(null),[ae,N]=(0,E.useState)(!1),[P,oe]=(0,E.useState)(!1),[F,se]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(0),B=l===`conversation`?g:A===`voicing`||A===`recording`||A===`saving`,V=A===`error`?ie:be[A],H=(0,E.useRef)(null),U=(0,E.useRef)(null),W=(0,E.useRef)(null),G=(0,E.useRef)(void 0),K=(0,E.useRef)(`high`);K.current=S;let q=(0,E.useRef)(null),J=(0,E.useRef)(null),[Y,X]=(0,E.useState)(null),le=(0,E.useMemo)(()=>a(()=>ee().then(()=>void 0)),[]),ue=(0,E.useRef)(null),fe=(0,E.useCallback)(()=>{B||r()},[B,r]);s(ue,{onEscape:fe,initialFocus:l===`reel`?H:void 0});let pe=(e??[]).map(e=>`${e.at}:${e.question}`).join(`|`);(0,E.useEffect)(()=>{if(q.current?.stop(),q.current=null,J.current=null,X(null),oe(!1),L(!1),z(0),t){te(t);return}te(me(e??[]))},[pe,t]);let Z=(0,E.useMemo)(()=>w?{...w,palette:b}:null,[w,b]),Se=w?Math.max(6,Math.round(w.durationMs/1e3)):0,Ce=Y?Math.max(6,Math.round(Y.reduce((e,t)=>e+t,0)/1e3)):null,we=Ce??Se,Te=Z?`${v}-${T?`rec`:`preview-${Z.seed}-${Y?`synced`:`rough`}`}`:null,Ee=(0,E.useRef)(!1);Ee.current=P;let De=(0,E.useCallback)(async()=>{if(P){q.current?.setMuted(!0),oe(!1);return}if(!Z)return;let e=xe(Z),t=J.current;if(!t||t.sig!==e){se(!0);try{t={sig:e,...await(await ge())(Z)},J.current=t}catch{c(`Could not prepare the narration`,`warn`);return}finally{se(!1)}}if(!t.buffer){c(`Narration is unavailable. Check the local voice service, then retry.`,`warn`);return}q.current||=p(t.buffer),q.current?.setMuted(!1),q.current?.play(),I&&q.current?.pause(),X(t.timings),oe(!0)},[P,Z,I]);(0,E.useEffect)(()=>()=>{q.current?.stop(),q.current=null},[]);let Oe=(0,E.useCallback)(e=>{L(e),Ee.current&&(e?q.current?.pause():q.current?.resume())},[]),ke=(0,E.useCallback)(()=>{L(!1),z(e=>e+1),Ee.current&&q.current?.play()},[]),Q=(0,E.useCallback)((e=`idle`)=>{U.current?.cancel(),U.current=null,W.current=null,G.current=void 0,re(!1),k(!1),j(e)},[]),$=(0,E.useCallback)(e=>{c(e,`warn`),M(e),Q(`error`)},[Q]);(0,E.useEffect)(()=>()=>Q(),[Q]),(0,E.useEffect)(()=>{if(!T||!ae||U.current||!H.current)return;let e=!1,t=(G.current??[]).reduce((e,t)=>e+t,0);return d({el:H.current,audioBuffer:W.current,aspect:v,quality:K.current,maxDurationMs:t?t+900:void 0}).then(t=>{if(e){t.cancel();return}U.current=t,k(!0)}).catch(()=>$(`Couldn't render the clip in this browser`)),()=>{e=!0}},[T,ae,v,$]);let Ae=(0,E.useCallback)(()=>{if(B||!Z)return;if(!f()){c(`This browser can't render a video clip`,`warn`);return}M(null),j(`voicing`);let e=xe(Z),t=J.current;(t&&t.sig===e?Promise.resolve(t):ge().then(e=>e(Z))).then(t=>{J.current={sig:e,...t};let{buffer:n,timings:r,missing:i,firstMissingLine:a}=t;if(!n||i>0){let e=a?` for “${a.slice(0,72)}${a.length>72?`…`:``}”`:``;$(`Narration is unavailable${e}. Check the local voice service, then retry.`);return}G.current=r,W.current=n,k(!1),N(!1),j(`recording`),re(!0)}).catch(()=>$(`Could not prepare the narration`))},[B,Z,$]),je=(0,E.useCallback)(async()=>{let e=U.current;if(!e){Q();return}U.current=null,j(`saving`);try{let t=await e.stop();h(t.blob,void 0,()=>void t.dispose?.()),c(`Saved to your downloads`,`good`),i?.(),Q()}catch{$(`Could not finish the clip`)}},[Q,$,i]);if(!t&&!e?.length)return null;let Me=()=>{L(!1),te(e=>e&&de(e,e.seed+1))};return(0,D.jsx)(`div`,{className:`shm-scrim`,role:`presentation`,onClick:B?void 0:e=>e.target===e.currentTarget&&r(),children:(0,D.jsxs)(`div`,{ref:ue,className:`shm-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Share this conversation as a video`,children:[e?.length?(0,D.jsxs)(`div`,{className:`shm-tabs`,role:`group`,"aria-label":`Video style`,children:[(0,D.jsx)(`button`,{type:`button`,"aria-pressed":l===`conversation`,disabled:B,onClick:()=>u(`conversation`),children:`Conversation`}),(0,D.jsx)(`button`,{type:`button`,"aria-pressed":l===`reel`,disabled:B,onClick:()=>u(`reel`),children:`Reel`})]}):null,l===`conversation`&&e?.length?(0,D.jsx)(E.Suspense,{fallback:(0,D.jsxs)(`div`,{className:`shm-composing`,role:`status`,children:[(0,D.jsx)(`span`,{className:`shm-composing-dot`}),`Opening…`]}),children:(0,D.jsx)(_e,{frames:e,retainedAudio:n,onShared:i,onBusyChange:_})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`shm-panel`,children:[(0,D.jsx)(`div`,{className:`shm-eyebrow`,children:`▷ MAVÉA REEL`}),(0,D.jsxs)(`div`,{className:`shm-headline`,children:[`Your session, as`,Ce?``:` about`,` a`,` `,(0,D.jsx)(`span`,{style:{color:`var(--presence-soft)`},children:we?`${we}-second`:``}),` `,`clip.`]}),(0,D.jsx)(`div`,{className:`shm-sub`,children:`Auto-cut locally from the conversation and rendered in this browser. Narration uses the local Kokoro voice service; the finished video saves straight to your downloads.`}),(0,D.jsx)(ne,{kind:`publishing`,from:`live`}),Z&&!T&&(0,D.jsxs)(`div`,{className:`shm-kbd-hint`,"aria-hidden":`true`,children:[(0,D.jsx)(`kbd`,{children:`←`}),(0,D.jsx)(`kbd`,{children:`→`}),` beats · `,(0,D.jsx)(`kbd`,{children:`↑`}),(0,D.jsx)(`kbd`,{children:`↓`}),` sections · `,(0,D.jsx)(`kbd`,{children:`space`}),` pause`]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Palette`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:he.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":b===e.id,"aria-pressed":b===e.id,disabled:B,onClick:()=>{x(e.id)},title:e.blurb,children:[(0,D.jsx)(`span`,{className:`shm-dot`,style:{background:e.dot},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Format`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:ve.map(e=>(0,D.jsxs)(`button`,{type:`button`,className:`shm-chip`,"data-active":v===e.id,"aria-pressed":v===e.id,disabled:B,onClick:()=>{y(e.id)},children:[(0,D.jsx)(`span`,{className:`shm-shape`,style:{width:e.w,height:e.h},"aria-hidden":`true`}),e.label]},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-group`,children:[(0,D.jsx)(`div`,{className:`shm-label`,children:`Quality`}),(0,D.jsx)(`div`,{className:`shm-chips`,children:ye.map(e=>(0,D.jsx)(`button`,{type:`button`,className:`shm-chip`,"data-active":S===e.id,"aria-pressed":S===e.id,disabled:B,onClick:()=>{C(e.id)},title:m(e.id),children:e.label},e.id))})]}),(0,D.jsxs)(`div`,{className:`shm-actions`,children:[(0,D.jsx)(`button`,{type:`button`,className:`shm-btn shm-btn-primary`,disabled:B||!Z,onClick:Ae,children:B?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}),V]}):`↓ Download video`}),(0,D.jsx)(`button`,{type:`button`,className:`shm-remix`,...le,disabled:B||!w||!!t,onClick:Me,title:`Re-roll the look (same content, free)`,children:`↻ Remix`})]}),(0,D.jsxs)(`div`,{className:`shm-progress`,"data-on":B||A===`error`,"data-error":A===`error`,role:`status`,children:[(0,D.jsx)(`div`,{className:`shm-progress-bar`,children:(0,D.jsx)(`i`,{})}),(0,D.jsx)(`span`,{className:`shm-progress-text`,children:V||` `})]})]}),(0,D.jsx)(`div`,{className:`shm-stage`,children:(0,D.jsxs)(`div`,{className:`shm-frame`,"data-aspect":v,children:[Z?(0,D.jsx)(ce,{script:Z,timings:T?G.current:Y??void 0,loop:!T,playing:!T||O,playKey:T?0:R,paused:T?void 0:I,onPausedChange:T?void 0:Oe,initialIndex:!T&&Z.seed>0?Math.max(0,Z.slides.findIndex(e=>e.content!==`title`&&e.content!==`outro`)):0,interactive:!T,onCycle:()=>{Ee.current&&q.current?.play()},frameRef:e=>{H.current=e,e&&N(!0)},onDone:T?je:void 0},Te):null,Z&&!T&&(0,D.jsxs)(`div`,{className:`shm-controls`,children:[(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":P,onClick:De,disabled:F,"aria-pressed":P,title:P?`Mute preview`:`Play sound`,children:F?(0,D.jsx)(`span`,{className:`shm-spin`,"aria-hidden":`true`}):P?(0,D.jsx)(o.speaker,{style:{width:18,height:18}}):(0,D.jsx)(o.speakerOff,{style:{width:18,height:18}})}),(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,"data-on":I,onClick:()=>Oe(!I),"aria-pressed":I,title:I?`Play`:`Pause`,children:I?(0,D.jsx)(o.play,{style:{width:17,height:17}}):(0,D.jsx)(o.pause,{style:{width:17,height:17}})}),(0,D.jsx)(`button`,{type:`button`,className:`shm-sound`,onClick:ke,title:`Replay from the start`,children:(0,D.jsx)(o.refresh,{style:{width:17,height:17}})})]})]})})]}),(0,D.jsx)(`button`,{type:`button`,className:`shm-close`,onClick:B?void 0:r,disabled:B,title:B?`Finishing the export…`:void 0,"aria-label":`Close`,children:`✕`})]})})}export{Z as ShareModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{t as r}from"./DropSelect-IBjV5Ol1.js";import{n as i}from"./store-D2IJF4SA.js";import{n as a}from"./parseDiff-D8uBQ9mQ.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=t(),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=n();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=()=>{let e=i(Q.map(re),{deck:`Ripple · ${j||`this repo`}`,tags:[U.title],source:{topic:U.title,ts:Date.now()},origin:`auto`});ye(e.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-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{t as r}from"./DropSelect-BVDNR47E.js";import{n as i}from"./store-D2IJF4SA.js";import{n as a}from"./parseDiff-D8uBQ9mQ.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=t(),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=n();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=()=>{let e=i(Q.map(re),{deck:`Ripple · ${j||`this repo`}`,tags:[U.title],source:{topic:U.title,ts:Date.now()},origin:`auto`});ye(e.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"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-
|
|
1
|
+
import{t as e}from"./compiler-runtime-qQQXpJgv.js";import{t}from"./jsx-runtime-DeHZSEgm.js";import{ot as n}from"./index-BMeoXWPR.js";import{t as r}from"./Orb-D8lhTdmY.js";var i=e(),a=t(),o=[{title:`Chicago · 4-Day Architectu…`,time:`3:14`,snip:`help me plan a trip t…`,tone:`blue`},{title:`Chicago · 4-Day Culinary…`,time:`3:14`,snip:`what are the restaura…`,tone:`green`},{title:`Chicago · 4-Day Itinerary`,time:`3:14`,snip:`what other things sh…`,tone:`amber`,active:!0}],s=[{name:`Speakeasies`,tag:`Hidden & exclusive`,w:`48%`,tone:`presence`},{name:`Live music`,tag:`Blues & jazz`,w:`78%`,tone:`warning`},{name:`Cocktail bars`,tag:`Modern & craft`,w:`46%`,tone:`presence`}],c=[`Reservations are essential for popular speakeasies.`,`Check the music schedule for blues clubs in advance.`,`Use the “L” train or a rideshare; parking is difficult.`,`Dress codes vary; check the venue’s site before going.`],l=[{left:`62%`,top:`34%`,tone:`presence`,n:`2`},{left:`54%`,top:`66%`,tone:`warning`,n:`3`},{left:`60%`,top:`70%`,tone:`insight`,n:`1`,ring:!0}];function u(e){let t=[];for(let n=-48;n<=448;n+=24)t.push(e?`M${n},-48 V248`:`M-48,${n} H448`);return t.join(` `)}function d(){let e=(0,i.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,a.jsx)(`rect`,{className:`fl-m-land`,width:`400`,height:`200`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,a.jsx)(`path`,{className:`fl-m-minor`,d:u(!0)}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,a.jsxs)(`svg`,{className:`fl-map-art`,viewBox:`0 0 400 200`,preserveAspectRatio:`xMidYMid slice`,"aria-hidden":`true`,children:[t,(0,a.jsxs)(`g`,{className:`fl-m-streets`,transform:`rotate(-8 200 100)`,children:[n,(0,a.jsx)(`path`,{className:`fl-m-minor`,d:u(!1)}),(0,a.jsx)(`path`,{className:`fl-m-major`,d:`M88,-48 V248 M168,-48 V248 M248,-48 V248`}),(0,a.jsx)(`path`,{className:`fl-m-major`,d:`M-48,64 H448 M-48,128 H448`}),(0,a.jsx)(`path`,{className:`fl-m-major`,d:`M-10,214 L300,-14`})]}),(0,a.jsx)(`path`,{className:`fl-m-park`,d:`M196,132 C218,124 244,128 250,146 C255,162 236,176 214,174 C192,172 180,152 196,132 Z`}),(0,a.jsx)(`path`,{className:`fl-m-river`,d:`M284,36 C238,52 206,44 168,58 C136,70 104,62 70,76`}),(0,a.jsx)(`path`,{className:`fl-m-water`,d:`M285,0 C270,60 276,140 262,200 L400,200 L400,0 Z`}),(0,a.jsx)(`path`,{className:`fl-m-shore`,d:`M285,0 C270,60 276,140 262,200`}),(0,a.jsx)(`path`,{className:`fl-m-current`,d:`M310,52 C326,46 342,50 356,42`}),(0,a.jsx)(`path`,{className:`fl-m-current`,d:`M318,120 C336,114 350,120 366,110`})]}),e[2]=r):r=e[2],r}function f(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n,{eyebrow:`The signature move`,children:[`It listens. It speaks. `,(0,a.jsx)(`em`,{children:`Then it draws.`})]}),(0,a.jsxs)(`div`,{className:`fl-window`,children:[(0,a.jsxs)(`div`,{className:`fl-window-bar`,children:[(0,a.jsx)(`span`,{className:`fl-light r`}),(0,a.jsx)(`span`,{className:`fl-light y`}),(0,a.jsx)(`span`,{className:`fl-light g`}),(0,a.jsxs)(`div`,{className:`fl-window-title`,children:[(0,a.jsx)(r,{size:18,className:`fl-orb-inline`}),(0,a.jsx)(`span`,{className:`fl-window-topic`,children:`Chicago Nightlife: A Curated Guide`}),(0,a.jsx)(`span`,{className:`fl-live`,style:{color:`var(--text-muted)`},children:`Example`})]})]}),(0,a.jsxs)(`div`,{className:`fl-window-body`,children:[(0,a.jsxs)(`aside`,{className:`fl-rail`,children:[(0,a.jsxs)(`div`,{className:`fl-rail-head`,children:[(0,a.jsx)(`span`,{children:`This session`}),(0,a.jsx)(`span`,{className:`fl-rail-chip`,children:`Replay`})]}),o.map(e=>(0,a.jsxs)(`div`,{className:`fl-rail-row`+(e.active?` active`:``),children:[(0,a.jsx)(`div`,{className:`fl-rail-title tone-`+e.tone,children:e.title}),(0,a.jsxs)(`div`,{className:`fl-rail-snip`,children:[(0,a.jsx)(`span`,{className:`fl-rail-time`,children:e.time}),(0,a.jsx)(`span`,{className:`fl-rail-text`,children:e.snip})]})]},e.title))]}),(0,a.jsxs)(`div`,{className:`fl-canvas`,children:[(0,a.jsxs)(`div`,{className:`fl-finding`,children:[(0,a.jsxs)(`div`,{className:`fl-finding-kicker`,children:[(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M12 2l1.6 6.4L20 10l-6.4 1.6L12 18l-1.6-6.4L4 10l6.4-1.6z`})}),`Finding 1`]}),(0,a.jsx)(`div`,{className:`fl-finding-title`,children:`The Chicago after-dark vibe`}),(0,a.jsxs)(`p`,{className:`fl-finding-text`,children:[`Chicago’s nightlife thrives on variety. Whether you’re after a quiet, high-end cocktail lounge or a high-energy blues bar, there’s a district for it.`,(0,a.jsx)(`span`,{className:`fl-caret`})]}),(0,a.jsx)(`span`,{className:`fl-badge inferred`,children:`Inferred`})]}),(0,a.jsxs)(`div`,{className:`fl-fig`,children:[(0,a.jsx)(`div`,{className:`fl-fig-label`,children:`Fig. 1 — Nightlife hotspots`}),(0,a.jsxs)(`div`,{className:`fl-map`,children:[(0,a.jsx)(d,{}),(0,a.jsxs)(`div`,{className:`fl-map-zoom`,children:[(0,a.jsx)(`span`,{children:`+`}),(0,a.jsx)(`span`,{children:`−`})]}),l.map((e,t)=>(0,a.jsx)(`span`,{className:`fl-pin tone-`+e.tone+(e.ring?` ring`:``),style:{left:e.left,top:e.top,"--pin-i":String(t)},children:e.n},e.n)),(0,a.jsx)(`span`,{className:`fl-map-attr`,children:`Illustrated map`})]}),(0,a.jsx)(`div`,{className:`fl-fig-note`,children:`Illustrated example · 3 locations`})]}),(0,a.jsxs)(`div`,{className:`fl-cardrow`,children:[(0,a.jsxs)(`div`,{className:`fl-mini`,children:[(0,a.jsx)(`div`,{className:`fl-mini-label`,children:`▦ Nightlife categories`}),s.map((e,t)=>(0,a.jsxs)(`div`,{className:`fl-bar`,children:[(0,a.jsxs)(`div`,{className:`fl-bar-top`,children:[(0,a.jsx)(`span`,{className:`fl-bar-name`,children:e.name}),(0,a.jsx)(`span`,{className:`fl-bar-tag`,children:e.tag})]}),(0,a.jsx)(`div`,{className:`fl-bar-track`,children:(0,a.jsx)(`div`,{className:`fl-bar-fill tone-`+e.tone,style:{"--w":e.w,"--bar-i":String(t)}})})]},e.name))]}),(0,a.jsxs)(`div`,{className:`fl-mini`,children:[(0,a.jsx)(`div`,{className:`fl-mini-label`,children:`✦ Pro-tips for Chicago nights`}),c.map((e,t)=>(0,a.jsxs)(`div`,{className:`fl-tip`,style:{"--tip-i":String(t)},children:[(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{pathLength:1,d:`M20 6L9 17l-5-5`})}),(0,a.jsx)(`span`,{children:e})]},e))]})]}),(0,a.jsxs)(`div`,{className:`fl-dock`,children:[(0,a.jsx)(`span`,{className:`fl-dock-mic`,children:(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3`})})}),(0,a.jsx)(`span`,{className:`fl-dock-text`,children:`Talk, or type — anything.`}),(0,a.jsxs)(`span`,{className:`fl-dock-mark`,children:[(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M3 21l3.2-.9L18 8.3l-2.3-2.3L4 17.6 3 21z M14.7 7l2.3 2.3`})}),`Highlight`]}),(0,a.jsx)(`span`,{className:`fl-dock-send`,children:(0,a.jsx)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,a.jsx)(`path`,{d:`M5 12h14M13 6l6 6-6 6`})})})]})]})]})]})]})}export{f as SignatureLoop};
|