@viberaven/cli 1.6.12 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stack/app.js CHANGED
@@ -1,25 +1,25 @@
1
- "use strict";(()=>{function Un(e=document){return e.querySelector('meta[name="viberaven-token"]')?.content??""}async function O(e,n){let t=await fetch(e,{...n,credentials:"same-origin",headers:{"content-type":"application/json","x-viberaven-token":Un(),...n?.headers??{}}}),r=await t.text(),s=null;try{s=r?JSON.parse(r):null}catch{s={error:r}}if(!t.ok){let a=s?.error??s?.message??r??`HTTP ${t.status}`;throw new Error(String(a))}return s}var D=(e,n)=>O(e,{method:"POST",body:JSON.stringify(n)}),x={project:()=>O("/api/project"),scan:()=>D("/api/scan",{}),scanStatus:()=>O("/api/scan-status"),githubWorkflow:()=>O("/api/github-workflow"),addGithubWorkflow:()=>D("/api/github-workflow",{}),agents:()=>O("/api/cli-agents"),probe:e=>D("/api/cli-agents/probe",{cliId:e}),runSetup:(e,n)=>D("/api/cli-agents/run-setup",{cliId:e,step:n}),openTerminal:(e,n)=>D("/api/cli-agents/open-terminal",{cliId:e,step:n}),chat:e=>D("/api/agent-chat",e),catalog:()=>O("/api/provider-catalog"),verified:()=>O("/api/provider-verify"),stop:e=>D("/api/agent-chat/stop",{runId:e}),verify:e=>D("/api/provider-verify",e),connectMcp:e=>D("/api/mcp/connect",{providerId:e}),compare:(e,n)=>O(`/api/releases/compare?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`),fullCheckStatus:()=>O("/api/fullcheck/status"),fullCheckLatest:()=>O("/api/fullcheck/latest"),fullCheckSignInStart:()=>D("/api/fullcheck/signin/start",{}),fullCheckSignInPoll:()=>D("/api/fullcheck/signin/poll",{}),fullCheckSignOut:()=>D("/api/fullcheck/signout",{}),fullCheckPrepare:()=>D("/api/fullcheck/prepare",{}),fullCheckRun:e=>D("/api/fullcheck/run",{previewId:e}),actions:e=>O(`/api/actions?cli=${encodeURIComponent(e)}`),planAction:e=>D("/api/actions/plan",e),startRun:e=>D("/api/runs",e),runs:()=>O("/api/runs"),run:(e,n)=>O(`/api/runs/${encodeURIComponent(e)}?after=${n}`),resumeRun:e=>D(`/api/runs/${encodeURIComponent(e)}/resume`,{}),cancelRun:e=>D(`/api/runs/${encodeURIComponent(e)}/cancel`,{}),runDiff:e=>O(`/api/runs/${encodeURIComponent(e)}/diff`),restoreFile:(e,n)=>D(`/api/runs/${encodeURIComponent(e)}/restore`,{path:n}),revertRun:e=>D(`/api/runs/${encodeURIComponent(e)}/revert`,{}),preview:()=>O("/api/preview"),stopPreview:()=>D("/api/preview/stop",{}),changelog:(e,n)=>O(`/api/releases/changelog?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`)};function i(e,n,...t){let r=document.createElement(e);if(n){for(let[s,a]of Object.entries(n))if(!(a==null||a===!1))if(s==="class")r.className=String(a);else if(s==="on")for(let[c,o]of Object.entries(a))r.addEventListener(c,o);else if(s==="dataset")for(let[c,o]of Object.entries(a))r.dataset[c]=o;else s==="html"?r.innerHTML=String(a):s==="style"&&typeof a=="object"?Object.assign(r.style,a):s in r&&typeof a!="string"?r[s]=a:r.setAttribute(s,String(a))}return xt(r,t),r}function xt(e,n){for(let t of n)t==null||t===!1||(Array.isArray(t)?xt(e,t):t instanceof Node?e.appendChild(t):e.appendChild(document.createTextNode(String(t))))}function ye(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function X(e){let t=ye(e.replace(/\r\n/g,`
1
+ "use strict";(()=>{function Fn(e=document){return e.querySelector('meta[name="viberaven-token"]')?.content??""}async function O(e,n){let t=await fetch(e,{...n,credentials:"same-origin",headers:{"content-type":"application/json","x-viberaven-token":Fn(),...n?.headers??{}}}),r=await t.text(),s=null;try{s=r?JSON.parse(r):null}catch{s={error:r}}if(!t.ok){let a=s?.error??s?.message??r??`HTTP ${t.status}`;throw new Error(String(a))}return s}var D=(e,n)=>O(e,{method:"POST",body:JSON.stringify(n)}),S={project:()=>O("/api/project"),scan:()=>D("/api/scan",{}),scanStatus:()=>O("/api/scan-status"),githubWorkflow:()=>O("/api/github-workflow"),addGithubWorkflow:()=>D("/api/github-workflow",{}),agents:()=>O("/api/cli-agents"),probe:e=>D("/api/cli-agents/probe",{cliId:e}),runSetup:(e,n)=>D("/api/cli-agents/run-setup",{cliId:e,step:n}),openTerminal:(e,n)=>D("/api/cli-agents/open-terminal",{cliId:e,step:n}),chat:e=>D("/api/agent-chat",e),catalog:()=>O("/api/provider-catalog"),verified:()=>O("/api/provider-verify"),stop:e=>D("/api/agent-chat/stop",{runId:e}),verify:e=>D("/api/provider-verify",e),connectMcp:e=>D("/api/mcp/connect",{providerId:e}),compare:(e,n)=>O(`/api/releases/compare?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`),fullCheckStatus:()=>O("/api/fullcheck/status"),fullCheckLatest:()=>O("/api/fullcheck/latest"),fullCheckSignInStart:()=>D("/api/fullcheck/signin/start",{}),fullCheckSignInPoll:()=>D("/api/fullcheck/signin/poll",{}),fullCheckSignOut:()=>D("/api/fullcheck/signout",{}),fullCheckPrepare:()=>D("/api/fullcheck/prepare",{}),fullCheckRun:e=>D("/api/fullcheck/run",{previewId:e}),actions:e=>O(`/api/actions?cli=${encodeURIComponent(e)}`),planAction:e=>D("/api/actions/plan",e),startRun:e=>D("/api/runs",e),runs:()=>O("/api/runs"),run:(e,n)=>O(`/api/runs/${encodeURIComponent(e)}?after=${n}`),resumeRun:e=>D(`/api/runs/${encodeURIComponent(e)}/resume`,{}),cancelRun:e=>D(`/api/runs/${encodeURIComponent(e)}/cancel`,{}),runDiff:e=>O(`/api/runs/${encodeURIComponent(e)}/diff`),restoreFile:(e,n)=>D(`/api/runs/${encodeURIComponent(e)}/restore`,{path:n}),revertRun:e=>D(`/api/runs/${encodeURIComponent(e)}/revert`,{}),preview:()=>O("/api/preview"),stopPreview:()=>D("/api/preview/stop",{}),changelog:(e,n)=>O(`/api/releases/changelog?from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`)};function i(e,n,...t){let r=document.createElement(e);if(n){for(let[s,a]of Object.entries(n))if(!(a==null||a===!1))if(s==="class")r.className=String(a);else if(s==="on")for(let[c,o]of Object.entries(a))r.addEventListener(c,o);else if(s==="dataset")for(let[c,o]of Object.entries(a))r.dataset[c]=o;else s==="html"?r.innerHTML=String(a):s==="style"&&typeof a=="object"?Object.assign(r.style,a):s in r&&typeof a!="string"?r[s]=a:r.setAttribute(s,String(a))}return xt(r,t),r}function xt(e,n){for(let t of n)t==null||t===!1||(Array.isArray(t)?xt(e,t):t instanceof Node?e.appendChild(t):e.appendChild(document.createTextNode(String(t))))}function ye(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function X(e){let t=ye(e.replace(/\r\n/g,`
2
2
  `)).split(/```/),r="";return t.forEach((s,a)=>{if(a%2===1){let d=s.replace(/^[a-z0-9-]*\n/i,"");r+=`<pre><code>${d}</code></pre>`;return}let c=s.split(`
3
- `),o=null;for(let d of c){let p=d.trimEnd(),l=/^\s*[-*•]\s+(.*)$/.exec(p),u=/^\s*\d+[.)]\s+(.*)$/.exec(p),h=/^(#{1,3})\s+(.*)$/.exec(p),f=l?"ul":u?"ol":null;o&&f!==o&&(r+=`</${o}>`,o=null),f&&!o&&(r+=`<${f}>`,o=f),l||u?r+=`<li>${rt((l??u)[1])}</li>`:h?r+=`<h4>${rt(h[2])}</h4>`:p.trim()&&(r+=`<p>${rt(p)}</p>`)}o&&(r+=`</${o}>`)}),r}function rt(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function F(e){let n=Date.now()-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return"just now";let t=Math.round(n/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let r=Math.round(t/60);return r<24?`${r} h ago`:`${Math.round(r/24)} d ago`}function ze(){return{step:"closed",status:null,signIn:null,preview:null,result:null,saved:null,fromSaved:!1,limit:null,error:null,notice:null}}var Fn=new Set(["network","timeout","server","rate_limited","busy"]);function At(e,n={}){let t=n.wait??(g=>new Promise(w=>window.setTimeout(w,g))),r=0,s=()=>e.get().fullCheck,a=g=>e.set(w=>({fullCheck:{...w.fullCheck,...g}})),c=g=>g===r&&s().step!=="closed";async function o(g){try{return await g()}catch(w){return{kind:"error",reason:"unexpected",message:`The Studio did not answer: ${w instanceof Error?w.message:String(w)}`}}}async function d(){try{let g=await x.fullCheckStatus();return a({status:g}),g}catch{return null}}async function p(g,w,v){if(c(v))switch(g.kind){case"signin":a({step:"signin",signIn:{code:g.code,verificationUrl:g.verificationUrl,expiresAt:g.expiresAt,opened:g.opened},error:null}),l(v,g.pollIntervalSeconds);return;case"signin_pending":return;case"signed_in":if(a({signIn:null,notice:g.notice??(s().preview?"Signed in again. Confirm to send the same request.":null)}),await d(),!c(v))return;s().preview?a({step:"preview"}):await h(v);return;case"signin_expired":case"signin_denied":a({step:"error",signIn:null,error:{message:g.message,retry:"signin"}});return;case"signed_out":a({...ze(),saved:s().saved}),e.toast("Signed out of VibeRaven on this computer.");return;case"signin_required":case"reauth":a({notice:g.message}),await u(v);return;case"preview":a({step:"preview",preview:g.preview,error:null});return;case"result":a({step:"result",result:g.result,saved:g.result,fromSaved:!1,preview:null,notice:null,error:null}),await d();return;case"plan_limit":a({step:"limit",preview:null,notice:null,limit:{plan:g.plan,message:g.message,pricingUrl:g.pricingUrl,usage:g.usage}}),await d();return;case"error":{let L=g.reason==="not_confirmed"||g.reason==="prepare_failed"?"prepare":g.reason==="no_signin"?"signin":w==="run"&&!Fn.has(g.reason)?"prepare":w;L==="prepare"&&w==="run"&&a({preview:null}),a({step:"error",error:{message:g.message,retry:L}});return}}}async function l(g,w){for(;c(g)&&s().step==="signin";){if(await t(Math.max(1,w)*1e3),!c(g)||s().step!=="signin")return;let v=await o(()=>x.fullCheckSignInPoll());if(v.kind!=="signin_pending"){await p(v,"signin",g);return}}}async function u(g){a({step:"loading",error:null}),await p(await o(()=>x.fullCheckSignInStart()),"signin",g)}async function h(g){a({step:"preparing",error:null,result:null,limit:null}),await p(await o(()=>x.fullCheckPrepare()),"prepare",g)}async function f(g){a({step:"loading",error:null});let w=await d();if(c(g)){if(!w){a({step:"error",error:{message:"The Studio server did not answer. Reload the page and try again.",retry:"status"}});return}w.signedIn?await h(g):await u(g)}}return{async openFullCheck(){let g=s().step;g!=="closed"&&g!=="result"&&g!=="limit"&&g!=="error"||(r+=1,a({...ze(),step:"loading",status:s().status,saved:s().saved}),await f(r))},closeFullCheck(){r+=1,a({step:"closed",signIn:null,error:null,notice:null}),document.getElementById("run-full-check")?.focus({preventScroll:!0})},async fullCheckSignIn(){await u(r)},async fullCheckConfirm(){let g=s().preview;if(!g||s().step!=="preview")return;let w=r;a({step:"running",error:null}),await p(await o(()=>x.fullCheckRun(g.id)),"run",w)},async fullCheckRetry(){let g=s().error?.retry??"status",w=r;if(g==="run"&&s().preview){a({step:"preview",error:null});return}g==="signin"?await u(w):g==="prepare"?await h(w):await f(w)},async fullCheckSignOut(){await p(await o(()=>x.fullCheckSignOut()),"status",r),await d()},async loadSavedFullCheck(){try{let{result:g}=await x.fullCheckLatest();g&&!s().saved&&a({saved:g})}catch{}},showSavedFullCheck(){let g=s().saved,w=s().step;!g||w!=="closed"&&w!=="result"&&w!=="limit"&&w!=="error"||(r+=1,a({step:"result",result:g,fromSaved:!0,preview:null,limit:null,error:null,notice:null}))},async copyFullCheckPrompt(g){try{await navigator.clipboard.writeText(g),e.toast("Fix prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the text and copy it by hand.","err")}}}}function ve(e){return e?e.plan==="pro"?`${e.used} of ${e.limit} Pro full checks used this month`:`${e.used} of ${e.limit} free full checks used`:null}function ot(e,n=new Date){let t=new Date(e);if(Number.isNaN(t.getTime()))return"at an unknown time";let r=Math.round((n.getTime()-t.getTime())/6e4);return r<1?"just now":r<60?`${r} min ago`:r<1440?`${Math.round(r/60)} h ago`:`on ${t.toISOString().slice(0,10)}`}function Ct(e){return e==="pro"?"Pro plan":"Free plan"}function st(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function zn(e){try{return new URL(e).host}catch{return e}}function St(e){return i("span",{class:`tag ${e==="critical"?"red":e==="warning"?"amber":"dim"}`},e==="critical"?"Critical":e==="warning"?"Important":"Nice to have")}function Hn(e,n){let t=e.status?.account;if(!t)return null;let r=ve(e.status?.usage);return i("div",{class:"fc-account"},i("span",{class:"fc-avatar","aria-hidden":"true"},t.email.slice(0,1).toUpperCase()),i("span",{class:"fc-who"},`Signed in as ${t.email}`),i("span",{class:`fc-plan is-${t.plan}`},Ct(t.plan)),e.status?.sessionOnly?i("span",{class:"fc-dot"},"this session only"):null,r?i("span",{class:"fc-dot"},r):null,i("button",{class:"fc-link",on:{click:()=>n.fullCheckSignOut()}},"Sign out"))}function Bn(e,n){let t=e.signIn;return[i("p",{class:"fc-lead"},e.notice??"Full checks run on VibeRaven, so they need your VibeRaven account. Sign in once on this computer."),i("div",{class:"fc-code"},i("span",{class:"fc-code-label"},"Your code"),i("strong",{id:"fc-code"},...t.code.split("").map(r=>i("span",{},r)))),i("p",{class:"fc-hint"},t.opened?"We opened the sign-in page in your browser. Check the code matches, then confirm it there.":"Open the sign-in page, check the code matches, then confirm it there."),i("div",{class:"fc-actions"},i("a",{class:"btn primary",href:t.verificationUrl,target:"_blank",rel:"noopener noreferrer"},"Open the sign-in page"),i("span",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),"Waiting for you to confirm\u2026"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function Fe(e,n,t,r=!1){return i("details",{class:"fc-files",open:r},i("summary",{},i("span",{},e),i("span",{class:"fc-files-count"},String(n.length))),n.length?i("ul",{},...n.map(s=>i("li",{},i("code",{},s.path),i("span",{},s.meta)))):i("p",{class:"fc-empty"},t))}function Yn(e,n){let t=e.preview,r=t.promptFiles.length;return[e.notice?i("p",{class:"fc-notice",role:"status"},e.notice):null,i("div",{class:"fc-summary"},i("div",{class:"fc-summary-main"},i("span",{class:"fc-summary-size"},st(t.bytes)),i("span",{class:"fc-summary-what"},`${r} file${r===1?"":"s"} in full, plus names and snippets`)),i("p",{class:"fc-lead"},`This is exactly what gets sent to ${zn(t.endpoint)} when you confirm. Nothing has been uploaded yet.`)),Hn(e,n),i("dl",{class:"fc-facts"},i("div",{},i("dt",{},"Project folder"),i("dd",{},i("code",{},t.workspacePath))),i("div",{},i("dt",{},"Request size"),i("dd",{},st(t.bytes))),i("div",{},i("dt",{},"SPEC.md"),i("dd",{},t.spec.included?`Included (${t.spec.chars.toLocaleString()} characters)`:"Not found, not sent")),i("div",{},i("dt",{},"Dependencies"),i("dd",{},`${t.dependencyCount} package names`)),i("div",{},i("dt",{},"File tree"),i("dd",{},`${t.fileTreeEntries} paths, names only`))),i("div",{class:"fc-filegrid"},Fe("Files sent in full",t.promptFiles.map(s=>({path:s.path,meta:`${s.chars.toLocaleString()} chars${s.redactions?`, ${s.redactions} redacted`:""}`})),"No file contents are sent.",!0),Fe("File snippets (first 200 characters)",t.snippetFiles.map(s=>({path:s.path,meta:s.heat})),"None."),Fe("Skipped as secret files (name sent, contents never read)",t.secretFilesNamedOnly.map(s=>({path:s,meta:"name only"})),"None found."),Fe("Request text by section",t.promptSections.map(s=>({path:s.title,meta:`${s.chars.toLocaleString()} chars`})),"Empty.")),i("p",{id:"fc-redaction",class:`fc-shield${t.redactions>0?" is-on":""}`},t.redactions>0?`VibeRaven replaced ${t.redactions} secret-looking value${t.redactions===1?"":"s"} with [REDACTED]. `:"VibeRaven found no secret-looking values to replace. ","This is pattern matching, not a guarantee. Other files are sent as they are, so read the exact request body below before you send it."),i("details",{class:"fc-raw"},i("summary",{},`Show the exact request body: the prompt, file snippets and SPEC.md. Shown formatted here; sent compact (${st(t.bytes)}), same content.`),i("pre",{id:"fc-request-json"},t.requestJson)),i("p",{class:"fc-hint"},"Most of the request text is written by VibeRaven on your machine from the local scan: stack notes and the check instructions."),i("div",{class:"fc-actions fc-footer"},i("button",{id:"fc-confirm",class:"btn primary",on:{click:()=>n.fullCheckConfirm()}},"Send and run full check"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function Gn(e){return e<50?"fail":e<80?"warn":"pass"}function Qn(e,n){let t=e.result,r=t.areas.reduce((o,d)=>o+d.hiddenCount,0),s=t.nextFix,a=t.areas.filter(o=>!o.locked&&o.findings.length),c=t.areas.filter(o=>o.locked||!o.findings.length);return[i("div",{class:`fc-score is-${Gn(t.score)}`},i("div",{class:"fc-score-num",style:`--score:${Math.max(0,Math.min(100,t.score))}`},String(t.score)),i("div",{},i("div",{class:"fc-score-label"},t.scoreLabel,i("span",{class:"tag dim"},`${t.confidence} confidence`)),i("p",{},t.summary),i("p",{class:"fc-checked"},`Checked ${ot(t.checkedAt)}. Changes made after that are not in this result; run it again after your next change.`))),i("div",{class:"fc-account"},e.fromSaved?i("span",{class:"fc-dot"},"At the time of this check:"):null,i("span",{class:`fc-plan is-${t.usage.plan}`},Ct(t.usage.plan)),i("span",{class:"fc-dot"},ve(t.usage)),i("span",{class:"fc-dot"},`${t.usage.remaining} left${t.usage.period==="monthly"?" this month":""}`)),s?i("article",{class:`fc-next is-${s.severity}`},i("div",{class:"fix-top"},i("span",{class:"fc-eyebrow"},"Next fix"),St(s.severity),i("span",{class:"fix-meta"},s.areaTitle)),i("h3",{},s.title),s.detail?i("p",{},s.detail):null,s.prompt?i("button",{class:"btn primary sm",on:{click:()=>n.copyFullCheckPrompt(s.prompt)}},"Copy fix prompt"):null):i("p",{class:"fc-lead"},"No findings in the areas your plan covers."),i("h4",{class:"fc-h4"},"Findings by area"),a.length?i("div",{class:"fc-areas"},...a.map(o=>i("section",{class:"fc-area","aria-label":o.title},i("div",{class:"fc-area-head"},i("h5",{},o.title),i("span",{class:"fc-count on"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>i("li",{},St(d.severity),i("span",{title:d.detail},d.title))))))):null,c.length?i("div",{class:"fc-quiet"},...c.map(o=>i("section",{class:`fc-chip${o.locked?" locked":""}`,"aria-label":o.title},i("span",{class:"fc-chip-mark","aria-hidden":"true"},o.locked?"":"\u2713"),i("span",{},o.title),o.locked?i("span",{class:"tag dim"},"Pro area"):i("span",{class:"fc-sr"},"No findings."),o.locked&&o.hiddenCount?i("span",{class:"fc-sr"},`${o.hiddenCount} finding${o.hiddenCount===1?"":"s"} here. Pro shows every area.`):null))):null,r&&t.usage.plan==="free"?i("p",{class:"fc-upsell"},`${r} finding${r===1?" is":"s are"} in areas Pro covers. `,i("a",{href:"https://viberaven.dev/pricing",target:"_blank",rel:"noopener noreferrer"},"See Pro")):null,i("div",{class:"fc-actions fc-footer"},i("button",{class:"btn",on:{click:()=>n.closeFullCheck()}},"Done"))]}function Wn(e,n){let t=e.limit;return[i("h3",{class:"fc-limit",role:"alert"},t.message),ve(t.usage)?i("p",{class:"fc-hint"},ve(t.usage)):null,t.plan==="free"?i("p",{class:"fc-hint"},"The local Studio checks stay free and unlimited. Pro adds 50 full checks a month across all production areas."):i("p",{class:"fc-hint"},"The local Studio checks keep working until your monthly allowance resets."),i("div",{class:"fc-actions"},t.pricingUrl?i("a",{id:"fc-see-pro",class:"btn primary",href:t.pricingUrl,target:"_blank",rel:"noopener noreferrer"},"See Pro"):null,i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function Vn(e,n){let t=e.error;return[i("p",{class:"fc-error",role:"alert"},t.message),i("div",{class:"fc-actions"},i("button",{class:"btn primary",on:{click:()=>n.fullCheckRetry()}},t.retry==="signin"?"Sign in again":"Try again"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function at(e){return i("p",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),e)}var Zn={closed:"",loading:"Full check",signin:"Sign in to run a full check",preparing:"Full check",preview:"Review what gets sent",running:"Running the full check",result:"Full check result",limit:"Full check limit reached",error:"Full check did not run"};function $t(e,n){let t=e.fullCheck;if(t.step==="closed")return[];let r=t.step==="signin"&&t.signIn?Bn(t,n):t.step==="preview"&&t.preview?Yn(t,n):t.step==="result"&&t.result?Qn(t,n):t.step==="limit"&&t.limit?Wn(t,n):t.step==="error"&&t.error?Vn(t,n):t.step==="preparing"?[at("Reading your project to build the request\u2026")]:t.step==="running"?[at("Sent. VibeRaven is checking your app\u2026")]:[at("Checking your VibeRaven sign-in\u2026")],s=t.step!=="running";return[i("div",{class:"fc-veil",on:{click:()=>{s&&n.closeFullCheck()}}}),i("section",{id:"full-check",class:"fc-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"fc-title"},i("header",{class:"fc-head"},i("h2",{id:"fc-title"},Zn[t.step]),s?i("button",{class:"btn ghost sm","aria-label":"Close full check",on:{click:()=>n.closeFullCheck()}},"Close"):null),i("div",{class:"fc-body"},...r))]}function qn(){return{offers:[],facts:null,preview:null,request:"",plan:null,error:null,run:null,events:[],cursor:0,history:[],diff:null,previewExpanded:!1,busy:!1,selectedPart:null,gallery:null}}var It="viberaven.stack.";function Ce(e,n,t=localStorage){try{let r=t.getItem(It+e);return r?JSON.parse(r):n}catch{return n}}function $e(e,n,t=localStorage){try{t.setItem(It+e,JSON.stringify(n))}catch{}}function Kn(e){return!e.empty&&!!e.project?.scannedAt?(e.missionCards?.blockers??[]).length?"findings":"ready":"app"}function jt(e){let n=`chat.${e.project?.path??"project"}`,t=`checklist.${e.project?.path??"project"}`,r={project:e,catalog:[],verified:{},agents:[],probes:{},cliId:Ce("cliId","codex"),accessMode:Ce("accessMode","approve"),modelId:Ce("modelId",""),messages:Ce(n,[],sessionStorage),draft:"",contextProviderId:null,busy:{chat:!1,scan:!1,probe:null,tile:null,compare:!1},terminalOutput:"",compare:{from:"",to:"HEAD",result:null,error:null},drawer:null,section:"stack",agentOpen:!1,moreOpen:!1,showAll:!1,setup:{open:!1,initialized:!1,selected:[],running:!1,progress:[],error:null},scan:null,toasts:[],workingSince:null,runId:null,fullCheck:ze(),prChecks:{status:null,open:!1,busy:!1,written:!1,error:null},flow:{step:Kn(e),fixId:null,handoff:null,recheck:null,checklist:Ce(t,{})},work:qn()},s=new Set,a=0,c={get:()=>r,set(o){let d=typeof o=="function"?o(r):o;r={...r,...d},"cliId"in d&&$e("cliId",r.cliId),"accessMode"in d&&$e("accessMode",r.accessMode),"modelId"in d&&$e("modelId",r.modelId),"messages"in d&&$e(n,r.messages.slice(-60),sessionStorage),"flow"in d&&$e(t,r.flow.checklist);for(let p of s)p(r)},flow(o){c.set(d=>({flow:{...d.flow,...o}}))},work(o){c.set(d=>({work:{...d.work,...typeof o=="function"?o(d.work):o}}))},subscribe(o){return s.add(o),()=>s.delete(o)},toast(o,d="ok"){let p=++a;c.set(l=>({toasts:[...l.toasts,{id:p,text:o,kind:d}]})),window.setTimeout(()=>c.set(l=>({toasts:l.toasts.filter(u=>u.id!==p)})),d==="err"?7e3:3600)},push(o){let d={...o,id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,at:new Date().toISOString()};return c.set(p=>({messages:[...p.messages,d]})),d}};return c}var Tt=["sentry","stripe","clerk","cloudflare","render","railway","neon","posthog","upstash","resend","authjs"];function _n(e){return e?e.launchPath.filter(t=>t.state==="needs_fix"||t.state==="needs_connect"||t.state==="requires_user_action"||t.state==="blocked").length||(e.nextFix?1:0):0}function be(e,n,t){let r=new Map(e.providers.map(p=>[p.id,p])),s=new Set,a=[],c=(p,l)=>{let u=p?.id??l.id;if(s.has(u))return;s.add(u);let h=!!p?.detected||!!(l&&l.state!=="not_detected"),f=!!p?.mcpConfigured||l?.mcp?.status==="connected",g=t[u],w=h?_n(l):0,v="absent",L="Not in this app";h&&(v="in_repo",L=f?"MCP configured \xB7 not verified live":"In repo \xB7 MCP not set up",f&&(v="mcp"),g&&(v=g.ok&&w===0?"ready":"verified",L=g.ok?"Verified live":"Verified live \xB7 issues found")),a.push({id:u,name:p?.name??l.name,area:p?.area??l.area,logoUrl:p?.logoUrl??Xn(l?.iconHtml??""),step:v,statusText:L,fixes:w,hasRecipe:!!p?.hasRecipe||l?.mcp?.available===!0,mcpConfigured:f,note:p?.note,mcpSource:p?.mcpSource??l?.mcp?.source,verified:g,provider:l})};for(let p of n)c(p,r.get(p.id));for(let p of e.providers)c(null,p);let o=p=>p.step==="absent"?p.hasRecipe?1:2:0,d=p=>{let l=Tt.indexOf(p.id);return l===-1?Tt.length:l};return a.sort((p,l)=>o(p)-o(l)||l.fixes-p.fixes||d(p)-d(l)||p.name.localeCompare(l.name))}function Xn(e){let n=/src="([^"]+)"/.exec(e);return n?n[1]:""}function Nt(e,n,t){let r=e.setup,s=r.selected.length,a=e.probes[e.cliId]?.ready,c=r.running||e.busy.chat||!!e.busy.tile||e.busy.scan;return i("section",{class:"stack-setup","aria-label":"Connect my app"},i("div",{class:"setup-heading"},i("div",{},i("h2",{id:"stack-setup-heading",tabIndex:-1},"Set up your app"),i("ol",{class:"setup-steps"},i("li",{class:s?"done":""},i("i",{"aria-hidden":"true"},s?"\u2713":"1"),"Pick your services"),i("li",{class:a?"done":""},i("i",{"aria-hidden":"true"},a?"\u2713":"2"),"Connect your coding agent"),i("li",{},i("i",{"aria-hidden":"true"},"3"),e.accessMode==="ask"?"Get a plan":"Start setup"))),i("button",{class:"btn ghost sm",disabled:r.running,on:{click:()=>{n.set({setup:{...n.get().setup,open:!1}}),document.getElementById("connect-my-app")?.focus({preventScroll:!0})}}},"Close")),e.catalog.length?i("div",{class:"setup-services"},...e.catalog.map(o=>{let d=r.selected.includes(o.id);return i("button",{id:`setup-provider-${o.id}`,class:`setup-service${d?" selected":""}`,"aria-pressed":String(d),disabled:c,on:{click:()=>t.toggleSetupProvider(o.id)}},i("img",{src:o.logoUrl,alt:""}),i("span",{class:"setup-service-copy"},i("strong",{},o.name),i("small",{},o.detected?"In your app":o.area)),i("span",{class:"setup-check","aria-hidden":"true"},d?"\u2713":"+"))})):i("p",{class:"setup-note"},"Loading the service catalog\u2026"),i("div",{class:"setup-footer"},i("div",{},i("strong",{},s?a?`${s} service${s===1?"":"s"} ready to set up`:"Connect your agent to continue":"Pick at least one service"),i("p",{},e.accessMode==="ask"?"Ask mode only plans. It does not change your app.":"Your agent edits the repo. Provider sign-ins stay with you.")),r.running?i("button",{class:"btn",on:{click:()=>t.stop()}},"Stop setup"):a?i("button",{class:"btn primary",disabled:!s||c,on:{click:()=>t.startStackSetup()}},e.accessMode==="ask"?"Plan my setup":"Start setup",i("span",{"aria-hidden":"true"},"\u2197")):i("button",{class:"btn primary",disabled:e.busy.probe!==null,on:{click:()=>t.testConnection(e.cliId)}},e.busy.probe?"Testing agent\u2026":"Test agent connection")),r.progress.length?i("ol",{class:"setup-progress","aria-live":"polite"},...r.progress.map(o=>i("li",{class:o.state},i("span",{class:o.state==="working"&&r.running&&!r.error?"spin":"progress-dot","aria-hidden":"true"}),o.label))):null,r.error?i("p",{class:"setup-error",role:"alert"},r.error):null)}function Dt(e){if(e.actionDestination)return e.actionDestination;if(e.asksFirst||["missing_stripe_webhook","unverified_stripe_webhook"].includes(e.id))return"repo-code";let n=`${e.id} ${e.title} ${e.detail??""}`.replace(/[-_]/g," ");return/\bdashboard\b|\bdns\b|apex domain|\blive\b[^.\n]*\bproof\b|\bprovider action\b/i.test(n)?"provider-action":e.requiresUserAction?"manual-review":"repo-code"}var J={authjs:"data:image/webp;base64,UklGRtANAABXRUJQVlA4WAoAAAAQAAAAVgAAXwAAQUxQSEIEAAABoETbtmnbmRvftl2LbSffthGVbNu2bdu2bdvGY5K91prBw73n7KAYEROAajsfPYBuk856r7Gh9tlD1wkAQvQotQsBAAbNv+QjNisvnTC2OwAXvSuJjwGAX3XP+2tJmhhJFZL8+rothwNADK5ozkcHoOvoE14lSRFl85qUZN1De60WAIToi+NCBIChi674jCSTGFtrIiT5xqkTegBw0bsC+BgA+FX3fLCOpCY1VtYkkeSX1ywbDgAhuGo4Hx2ArqNPe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gMi45ODY3IDIuOTg2OCAyLjk4NjcgNy44Mjk3IDAgMTAuODE2NC0yLjk4NjcgMi45ODY4LTcuODI5NyAyLjk4NjgtMTAuODE2NCAwbC0xLjgwMjggMS44MDI4YzMuOTgyMyAzLjk4MjIgMTAuNDM5NiAzLjk4MjIgMTQuNDIxOSAwIDMuOTgyMy0zLjk4MjQgMy45ODIzLTEwLjQzOTYgMC0xNC40MjE5LS45OTU2LS45OTU2LTIuMzAwNi0xLjQ5MjItMy42MDU1LTEuNDkyMi0xLjMwNDggMC0yLjYwOTkuNDk2Ni0zLjYwNTQgMS40OTIyLTEuOTkxMiAxLjk5MTItMS45OTEyIDUuMjE5OCAwIDcuMjExeiIvPjwvc3ZnPg==",vercel:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+VmVyY2VsPC90aXRsZT48cGF0aCBkPSJtMTIgMS42MDggMTIgMjAuNzg0SDBaIi8+PC9zdmc+"};function Et(e){return J[e]??null}var Ie={critical:0,warning:1,info:2},Pt={supabase:"https://supabase.com/dashboard/projects",vercel:"https://vercel.com/dashboard",stripe:"https://dashboard.stripe.com",github:"https://github.com/settings/profile",sentry:"https://sentry.io",posthog:"https://app.posthog.com",clerk:"https://dashboard.clerk.com",resend:"https://resend.com/emails",upstash:"https://console.upstash.com",neon:"https://console.neon.tech",railway:"https://railway.com/dashboard",render:"https://dashboard.render.com",cloudflare:"https://dash.cloudflare.com"},Jn="sql|ts|tsx|js|jsx|mjs|cjs|json|toml|ya?ml|env|py|rb|go|rs|vue|svelte|astro|html|css|md|prisma|php|java|kt|sh|lock",ei=new RegExp(String.raw`((?:[\w.@-]+[\\/])*[\w.@-]+\.(?:${Jn})):(\d{1,6})\b`,"g");function ti(e){if(!e)return[];let n=new Set;for(let t of e.matchAll(ei))n.add(`${t[1].split("\\").join("/")}:${t[2]}`);return[...n]}function ni(e){let n=(e??"").split(`
4
- `).map(s=>s.trim()).filter(Boolean),[t="",...r]=n;return{summary:t,evidence:r.filter(s=>s!=="Evidence:").map(s=>s.replace(/^-\s*/,""))}}function He(e){return Et(e.id)??e.logoUrl}function ii(e,n,t){let r=n?.provider?.nextFix,s=e.asksFirst?`${e.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.`:"";return t==="manual-review"?[s,`Review this finding: ${e.title}. Do not edit files or change provider settings. Identify what evidence is missing and whether the next step belongs in the repo or with a provider, then ask the user before any change.`,e.detail,e.prompt?`Scanner guidance to review, not authorization to execute: ${e.prompt}`:""].filter(Boolean).join(`
3
+ `),o=null;for(let d of c){let p=d.trimEnd(),l=/^\s*[-*•]\s+(.*)$/.exec(p),u=/^\s*\d+[.)]\s+(.*)$/.exec(p),h=/^(#{1,3})\s+(.*)$/.exec(p),f=l?"ul":u?"ol":null;o&&f!==o&&(r+=`</${o}>`,o=null),f&&!o&&(r+=`<${f}>`,o=f),l||u?r+=`<li>${rt((l??u)[1])}</li>`:h?r+=`<h4>${rt(h[2])}</h4>`:p.trim()&&(r+=`<p>${rt(p)}</p>`)}o&&(r+=`</${o}>`)}),r}function rt(e){return e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>")}function F(e){let n=Date.now()-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return"just now";let t=Math.round(n/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let r=Math.round(t/60);return r<24?`${r} h ago`:`${Math.round(r/24)} d ago`}function ze(){return{step:"closed",status:null,signIn:null,preview:null,result:null,saved:null,fromSaved:!1,limit:null,error:null,notice:null}}var zn=new Set(["network","timeout","server","rate_limited","busy"]);function At(e,n={}){let t=n.wait??(g=>new Promise(w=>window.setTimeout(w,g))),r=0,s=()=>e.get().fullCheck,a=g=>e.set(w=>({fullCheck:{...w.fullCheck,...g}})),c=g=>g===r&&s().step!=="closed";async function o(g){try{return await g()}catch(w){return{kind:"error",reason:"unexpected",message:`The Studio did not answer: ${w instanceof Error?w.message:String(w)}`}}}async function d(){try{let g=await S.fullCheckStatus();return a({status:g}),g}catch{return null}}async function p(g,w,b){if(c(b))switch(g.kind){case"signin":a({step:"signin",signIn:{code:g.code,verificationUrl:g.verificationUrl,expiresAt:g.expiresAt,opened:g.opened},error:null}),l(b,g.pollIntervalSeconds);return;case"signin_pending":return;case"signed_in":if(a({signIn:null,notice:g.notice??(s().preview?"Signed in again. Confirm to send the same request.":null)}),await d(),!c(b))return;s().preview?a({step:"preview"}):await h(b);return;case"signin_expired":case"signin_denied":a({step:"error",signIn:null,error:{message:g.message,retry:"signin"}});return;case"signed_out":a({...ze(),saved:s().saved}),e.toast("Signed out of VibeRaven on this computer.");return;case"signin_required":case"reauth":a({notice:g.message}),await u(b);return;case"preview":a({step:"preview",preview:g.preview,error:null});return;case"result":a({step:"result",result:g.result,saved:g.result,fromSaved:!1,preview:null,notice:null,error:null}),await d();return;case"plan_limit":a({step:"limit",preview:null,notice:null,limit:{plan:g.plan,message:g.message,pricingUrl:g.pricingUrl,usage:g.usage}}),await d();return;case"error":{let L=g.reason==="not_confirmed"||g.reason==="prepare_failed"?"prepare":g.reason==="no_signin"?"signin":w==="run"&&!zn.has(g.reason)?"prepare":w;L==="prepare"&&w==="run"&&a({preview:null}),a({step:"error",error:{message:g.message,retry:L}});return}}}async function l(g,w){for(;c(g)&&s().step==="signin";){if(await t(Math.max(1,w)*1e3),!c(g)||s().step!=="signin")return;let b=await o(()=>S.fullCheckSignInPoll());if(b.kind!=="signin_pending"){await p(b,"signin",g);return}}}async function u(g){a({step:"loading",error:null}),await p(await o(()=>S.fullCheckSignInStart()),"signin",g)}async function h(g){a({step:"preparing",error:null,result:null,limit:null}),await p(await o(()=>S.fullCheckPrepare()),"prepare",g)}async function f(g){a({step:"loading",error:null});let w=await d();if(c(g)){if(!w){a({step:"error",error:{message:"The Studio server did not answer. Reload the page and try again.",retry:"status"}});return}w.signedIn?await h(g):await u(g)}}return{async openFullCheck(){let g=s().step;g!=="closed"&&g!=="result"&&g!=="limit"&&g!=="error"||(r+=1,a({...ze(),step:"loading",status:s().status,saved:s().saved}),await f(r))},closeFullCheck(){r+=1,a({step:"closed",signIn:null,error:null,notice:null}),document.getElementById("run-full-check")?.focus({preventScroll:!0})},async fullCheckSignIn(){await u(r)},async fullCheckConfirm(){let g=s().preview;if(!g||s().step!=="preview")return;let w=r;a({step:"running",error:null}),await p(await o(()=>S.fullCheckRun(g.id)),"run",w)},async fullCheckRetry(){let g=s().error?.retry??"status",w=r;if(g==="run"&&s().preview){a({step:"preview",error:null});return}g==="signin"?await u(w):g==="prepare"?await h(w):await f(w)},async fullCheckSignOut(){await p(await o(()=>S.fullCheckSignOut()),"status",r),await d()},async loadSavedFullCheck(){try{let{result:g}=await S.fullCheckLatest();g&&!s().saved&&a({saved:g})}catch{}},showSavedFullCheck(){let g=s().saved,w=s().step;!g||w!=="closed"&&w!=="result"&&w!=="limit"&&w!=="error"||(r+=1,a({step:"result",result:g,fromSaved:!0,preview:null,limit:null,error:null,notice:null}))},async copyFullCheckPrompt(g){try{await navigator.clipboard.writeText(g),e.toast("Fix prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the text and copy it by hand.","err")}}}}function be(e){return e?e.plan==="pro"?`${e.used} of ${e.limit} Pro full checks used this month`:`${e.used} of ${e.limit} free full checks used`:null}function ot(e,n=new Date){let t=new Date(e);if(Number.isNaN(t.getTime()))return"at an unknown time";let r=Math.round((n.getTime()-t.getTime())/6e4);return r<1?"just now":r<60?`${r} min ago`:r<1440?`${Math.round(r/60)} h ago`:`on ${t.toISOString().slice(0,10)}`}function Ct(e){return e==="pro"?"Pro plan":"Free plan"}function st(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function Hn(e){try{return new URL(e).host}catch{return e}}function St(e){return i("span",{class:`tag ${e==="critical"?"red":e==="warning"?"amber":"dim"}`},e==="critical"?"Critical":e==="warning"?"Important":"Nice to have")}function Bn(e,n){let t=e.status?.account;if(!t)return null;let r=be(e.status?.usage);return i("div",{class:"fc-account"},i("span",{class:"fc-avatar","aria-hidden":"true"},t.email.slice(0,1).toUpperCase()),i("span",{class:"fc-who"},`Signed in as ${t.email}`),i("span",{class:`fc-plan is-${t.plan}`},Ct(t.plan)),e.status?.sessionOnly?i("span",{class:"fc-dot"},"this session only"):null,r?i("span",{class:"fc-dot"},r):null,i("button",{class:"fc-link",on:{click:()=>n.fullCheckSignOut()}},"Sign out"))}function Yn(e,n){let t=e.signIn;return[i("p",{class:"fc-lead"},e.notice??"Full checks run on VibeRaven, so they need your VibeRaven account. Sign in once on this computer."),i("div",{class:"fc-code"},i("span",{class:"fc-code-label"},"Your code"),i("strong",{id:"fc-code"},...t.code.split("").map(r=>i("span",{},r)))),i("p",{class:"fc-hint"},t.opened?"We opened the sign-in page in your browser. Check the code matches, then confirm it there.":"Open the sign-in page, check the code matches, then confirm it there."),i("div",{class:"fc-actions"},i("a",{class:"btn primary",href:t.verificationUrl,target:"_blank",rel:"noopener noreferrer"},"Open the sign-in page"),i("span",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),"Waiting for you to confirm\u2026"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function Fe(e,n,t,r=!1){return i("details",{class:"fc-files",open:r},i("summary",{},i("span",{},e),i("span",{class:"fc-files-count"},String(n.length))),n.length?i("ul",{},...n.map(s=>i("li",{},i("code",{},s.path),i("span",{},s.meta)))):i("p",{class:"fc-empty"},t))}function Gn(e,n){let t=e.preview,r=t.promptFiles.length;return[e.notice?i("p",{class:"fc-notice",role:"status"},e.notice):null,i("div",{class:"fc-summary"},i("div",{class:"fc-summary-main"},i("span",{class:"fc-summary-size"},st(t.bytes)),i("span",{class:"fc-summary-what"},`${r} file${r===1?"":"s"} in full, plus names and snippets`)),i("p",{class:"fc-lead"},`This is exactly what gets sent to ${Hn(t.endpoint)} when you confirm. Nothing has been uploaded yet.`)),Bn(e,n),i("dl",{class:"fc-facts"},i("div",{},i("dt",{},"Project folder"),i("dd",{},i("code",{},t.workspacePath))),i("div",{},i("dt",{},"Request size"),i("dd",{},st(t.bytes))),i("div",{},i("dt",{},"SPEC.md"),i("dd",{},t.spec.included?`Included (${t.spec.chars.toLocaleString()} characters)`:"Not found, not sent")),i("div",{},i("dt",{},"Dependencies"),i("dd",{},`${t.dependencyCount} package names`)),i("div",{},i("dt",{},"File tree"),i("dd",{},`${t.fileTreeEntries} paths, names only`))),i("div",{class:"fc-filegrid"},Fe("Files sent in full",t.promptFiles.map(s=>({path:s.path,meta:`${s.chars.toLocaleString()} chars${s.redactions?`, ${s.redactions} redacted`:""}`})),"No file contents are sent.",!0),Fe("File snippets (first 200 characters)",t.snippetFiles.map(s=>({path:s.path,meta:s.heat})),"None."),Fe("Skipped as secret files (name sent, contents never read)",t.secretFilesNamedOnly.map(s=>({path:s,meta:"name only"})),"None found."),Fe("Request text by section",t.promptSections.map(s=>({path:s.title,meta:`${s.chars.toLocaleString()} chars`})),"Empty.")),i("p",{id:"fc-redaction",class:`fc-shield${t.redactions>0?" is-on":""}`},t.redactions>0?`VibeRaven replaced ${t.redactions} secret-looking value${t.redactions===1?"":"s"} with [REDACTED]. `:"VibeRaven found no secret-looking values to replace. ","This is pattern matching, not a guarantee. Other files are sent as they are, so read the exact request body below before you send it."),i("details",{class:"fc-raw"},i("summary",{},`Show the exact request body: the prompt, file snippets and SPEC.md. Shown formatted here; sent compact (${st(t.bytes)}), same content.`),i("pre",{id:"fc-request-json"},t.requestJson)),i("p",{class:"fc-hint"},"Most of the request text is written by VibeRaven on your machine from the local scan: stack notes and the check instructions."),i("div",{class:"fc-actions fc-footer"},i("button",{id:"fc-confirm",class:"btn primary",on:{click:()=>n.fullCheckConfirm()}},"Send and run full check"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Cancel"))]}function Qn(e){return e<50?"fail":e<80?"warn":"pass"}function Wn(e,n){let t=e.result,r=t.areas.reduce((o,d)=>o+d.hiddenCount,0),s=t.nextFix,a=t.areas.filter(o=>!o.locked&&o.findings.length),c=t.areas.filter(o=>o.locked||!o.findings.length);return[i("div",{class:`fc-score is-${Qn(t.score)}`},i("div",{class:"fc-score-num",style:`--score:${Math.max(0,Math.min(100,t.score))}`},String(t.score)),i("div",{},i("div",{class:"fc-score-label"},t.scoreLabel,i("span",{class:"tag dim"},`${t.confidence} confidence`)),i("p",{},t.summary),i("p",{class:"fc-checked"},`Checked ${ot(t.checkedAt)}. Changes made after that are not in this result; run it again after your next change.`))),i("div",{class:"fc-account"},e.fromSaved?i("span",{class:"fc-dot"},"At the time of this check:"):null,i("span",{class:`fc-plan is-${t.usage.plan}`},Ct(t.usage.plan)),i("span",{class:"fc-dot"},be(t.usage)),i("span",{class:"fc-dot"},`${t.usage.remaining} left${t.usage.period==="monthly"?" this month":""}`)),s?i("article",{class:`fc-next is-${s.severity}`},i("div",{class:"fix-top"},i("span",{class:"fc-eyebrow"},"Next fix"),St(s.severity),i("span",{class:"fix-meta"},s.areaTitle)),i("h3",{},s.title),s.detail?i("p",{},s.detail):null,s.prompt?i("button",{class:"btn primary sm",on:{click:()=>n.copyFullCheckPrompt(s.prompt)}},"Copy fix prompt"):null):i("p",{class:"fc-lead"},"No findings in the areas your plan covers."),i("h4",{class:"fc-h4"},"Findings by area"),a.length?i("div",{class:"fc-areas"},...a.map(o=>i("section",{class:"fc-area","aria-label":o.title},i("div",{class:"fc-area-head"},i("h5",{},o.title),i("span",{class:"fc-count on"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>i("li",{},St(d.severity),i("span",{title:d.detail},d.title))))))):null,c.length?i("div",{class:"fc-quiet"},...c.map(o=>i("section",{class:`fc-chip${o.locked?" locked":""}`,"aria-label":o.title},i("span",{class:"fc-chip-mark","aria-hidden":"true"},o.locked?"":"\u2713"),i("span",{},o.title),o.locked?i("span",{class:"tag dim"},"Pro area"):i("span",{class:"fc-sr"},"No findings."),o.locked&&o.hiddenCount?i("span",{class:"fc-sr"},`${o.hiddenCount} finding${o.hiddenCount===1?"":"s"} here. Pro shows every area.`):null))):null,r&&t.usage.plan==="free"?i("p",{class:"fc-upsell"},`${r} finding${r===1?" is":"s are"} in areas Pro covers. `,i("a",{href:"https://viberaven.dev/pricing",target:"_blank",rel:"noopener noreferrer"},"See Pro")):null,i("div",{class:"fc-actions fc-footer"},i("button",{class:"btn",on:{click:()=>n.closeFullCheck()}},"Done"))]}function Vn(e,n){let t=e.limit;return[i("h3",{class:"fc-limit",role:"alert"},t.message),be(t.usage)?i("p",{class:"fc-hint"},be(t.usage)):null,t.plan==="free"?i("p",{class:"fc-hint"},"The local Studio checks stay free and unlimited. Pro adds 50 full checks a month across all production areas."):i("p",{class:"fc-hint"},"The local Studio checks keep working until your monthly allowance resets."),i("div",{class:"fc-actions"},t.pricingUrl?i("a",{id:"fc-see-pro",class:"btn primary",href:t.pricingUrl,target:"_blank",rel:"noopener noreferrer"},"See Pro"):null,i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function Zn(e,n){let t=e.error;return[i("p",{class:"fc-error",role:"alert"},t.message),i("div",{class:"fc-actions"},i("button",{class:"btn primary",on:{click:()=>n.fullCheckRetry()}},t.retry==="signin"?"Sign in again":"Try again"),i("button",{class:"btn ghost",on:{click:()=>n.closeFullCheck()}},"Close"))]}function at(e){return i("p",{class:"fc-wait",role:"status"},i("span",{class:"spin"}),e)}var qn={closed:"",loading:"Full check",signin:"Sign in to run a full check",preparing:"Full check",preview:"Review what gets sent",running:"Running the full check",result:"Full check result",limit:"Full check limit reached",error:"Full check did not run"};function $t(e,n){let t=e.fullCheck;if(t.step==="closed")return[];let r=t.step==="signin"&&t.signIn?Yn(t,n):t.step==="preview"&&t.preview?Gn(t,n):t.step==="result"&&t.result?Wn(t,n):t.step==="limit"&&t.limit?Vn(t,n):t.step==="error"&&t.error?Zn(t,n):t.step==="preparing"?[at("Reading your project to build the request\u2026")]:t.step==="running"?[at("Sent. VibeRaven is checking your app\u2026")]:[at("Checking your VibeRaven sign-in\u2026")],s=t.step!=="running";return[i("div",{class:"fc-veil",on:{click:()=>{s&&n.closeFullCheck()}}}),i("section",{id:"full-check",class:"fc-sheet",role:"dialog","aria-modal":"true","aria-labelledby":"fc-title"},i("header",{class:"fc-head"},i("h2",{id:"fc-title"},qn[t.step]),s?i("button",{class:"btn ghost sm","aria-label":"Close full check",on:{click:()=>n.closeFullCheck()}},"Close"):null),i("div",{class:"fc-body"},...r))]}function Kn(){return{offers:[],facts:null,preview:null,request:"",plan:null,error:null,run:null,events:[],cursor:0,history:[],diff:null,previewExpanded:!1,busy:!1,selectedPart:null,gallery:null}}var It="viberaven.stack.";function Ce(e,n,t=localStorage){try{let r=t.getItem(It+e);return r?JSON.parse(r):n}catch{return n}}function $e(e,n,t=localStorage){try{t.setItem(It+e,JSON.stringify(n))}catch{}}function _n(e){return!e.empty&&!!e.project?.scannedAt?(e.missionCards?.blockers??[]).length?"findings":"ready":"app"}function jt(e){let n=`chat.${e.project?.path??"project"}`,t=`checklist.${e.project?.path??"project"}`,r={project:e,catalog:[],verified:{},agents:[],probes:{},cliId:Ce("cliId","codex"),accessMode:Ce("accessMode","approve"),modelId:Ce("modelId",""),messages:Ce(n,[],sessionStorage),draft:"",contextProviderId:null,busy:{chat:!1,scan:!1,probe:null,tile:null,compare:!1},terminalOutput:"",compare:{from:"",to:"HEAD",result:null,error:null},drawer:null,section:"stack",agentOpen:!1,moreOpen:!1,showAll:!1,setup:{open:!1,initialized:!1,selected:[],running:!1,progress:[],error:null},scan:null,toasts:[],workingSince:null,runId:null,fullCheck:ze(),prChecks:{status:null,open:!1,busy:!1,written:!1,error:null},flow:{step:_n(e),fixId:null,handoff:null,recheck:null,checklist:Ce(t,{})},work:Kn()},s=new Set,a=0,c={get:()=>r,set(o){let d=typeof o=="function"?o(r):o;r={...r,...d},"cliId"in d&&$e("cliId",r.cliId),"accessMode"in d&&$e("accessMode",r.accessMode),"modelId"in d&&$e("modelId",r.modelId),"messages"in d&&$e(n,r.messages.slice(-60),sessionStorage),"flow"in d&&$e(t,r.flow.checklist);for(let p of s)p(r)},flow(o){c.set(d=>({flow:{...d.flow,...o}}))},work(o){c.set(d=>({work:{...d.work,...typeof o=="function"?o(d.work):o}}))},subscribe(o){return s.add(o),()=>s.delete(o)},toast(o,d="ok"){let p=++a;c.set(l=>({toasts:[...l.toasts,{id:p,text:o,kind:d}]})),window.setTimeout(()=>c.set(l=>({toasts:l.toasts.filter(u=>u.id!==p)})),d==="err"?7e3:3600)},push(o){let d={...o,id:`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,at:new Date().toISOString()};return c.set(p=>({messages:[...p.messages,d]})),d}};return c}var Tt=["sentry","stripe","clerk","cloudflare","render","railway","neon","posthog","upstash","resend","authjs"];function Xn(e){return e?e.launchPath.filter(t=>t.state==="needs_fix"||t.state==="needs_connect"||t.state==="requires_user_action"||t.state==="blocked").length||(e.nextFix?1:0):0}function ve(e,n,t){let r=new Map(e.providers.map(p=>[p.id,p])),s=new Set,a=[],c=(p,l)=>{let u=p?.id??l.id;if(s.has(u))return;s.add(u);let h=!!p?.detected||!!(l&&l.state!=="not_detected"),f=!!p?.mcpConfigured||l?.mcp?.status==="connected",g=t[u],w=h?Xn(l):0,b="absent",L="Not in this app";h&&(b="in_repo",L=f?"MCP configured \xB7 not verified live":"In repo \xB7 MCP not set up",f&&(b="mcp"),g&&(b=g.ok&&w===0?"ready":"verified",L=g.ok?"Verified live":"Verified live \xB7 issues found")),a.push({id:u,name:p?.name??l.name,area:p?.area??l.area,logoUrl:p?.logoUrl??Jn(l?.iconHtml??""),step:b,statusText:L,fixes:w,hasRecipe:!!p?.hasRecipe||l?.mcp?.available===!0,mcpConfigured:f,note:p?.note,mcpSource:p?.mcpSource??l?.mcp?.source,verified:g,provider:l})};for(let p of n)c(p,r.get(p.id));for(let p of e.providers)c(null,p);let o=p=>p.step==="absent"?p.hasRecipe?1:2:0,d=p=>{let l=Tt.indexOf(p.id);return l===-1?Tt.length:l};return a.sort((p,l)=>o(p)-o(l)||l.fixes-p.fixes||d(p)-d(l)||p.name.localeCompare(l.name))}function Jn(e){let n=/src="([^"]+)"/.exec(e);return n?n[1]:""}function Nt(e,n,t){let r=e.setup,s=r.selected.length,a=e.probes[e.cliId]?.ready,c=r.running||e.busy.chat||!!e.busy.tile||e.busy.scan;return i("section",{class:"stack-setup","aria-label":"Connect my app"},i("div",{class:"setup-heading"},i("div",{},i("h2",{id:"stack-setup-heading",tabIndex:-1},"Set up your app"),i("ol",{class:"setup-steps"},i("li",{class:s?"done":""},i("i",{"aria-hidden":"true"},s?"\u2713":"1"),"Pick your services"),i("li",{class:a?"done":""},i("i",{"aria-hidden":"true"},a?"\u2713":"2"),"Connect your coding agent"),i("li",{},i("i",{"aria-hidden":"true"},"3"),e.accessMode==="ask"?"Get a plan":"Start setup"))),i("button",{class:"btn ghost sm",disabled:r.running,on:{click:()=>{n.set({setup:{...n.get().setup,open:!1}}),document.getElementById("connect-my-app")?.focus({preventScroll:!0})}}},"Close")),e.catalog.length?i("div",{class:"setup-services"},...e.catalog.map(o=>{let d=r.selected.includes(o.id);return i("button",{id:`setup-provider-${o.id}`,class:`setup-service${d?" selected":""}`,"aria-pressed":String(d),disabled:c,on:{click:()=>t.toggleSetupProvider(o.id)}},i("img",{src:o.logoUrl,alt:""}),i("span",{class:"setup-service-copy"},i("strong",{},o.name),i("small",{},o.detected?"In your app":o.area)),i("span",{class:"setup-check","aria-hidden":"true"},d?"\u2713":"+"))})):i("p",{class:"setup-note"},"Loading the service catalog\u2026"),i("div",{class:"setup-footer"},i("div",{},i("strong",{},s?a?`${s} service${s===1?"":"s"} ready to set up`:"Connect your agent to continue":"Pick at least one service"),i("p",{},e.accessMode==="ask"?"Ask mode only plans. It does not change your app.":"Your agent edits the repo. Provider sign-ins stay with you.")),r.running?i("button",{class:"btn",on:{click:()=>t.stop()}},"Stop setup"):a?i("button",{class:"btn primary",disabled:!s||c,on:{click:()=>t.startStackSetup()}},e.accessMode==="ask"?"Plan my setup":"Start setup",i("span",{"aria-hidden":"true"},"\u2197")):i("button",{class:"btn primary",disabled:e.busy.probe!==null,on:{click:()=>t.testConnection(e.cliId)}},e.busy.probe?"Testing agent\u2026":"Test agent connection")),r.progress.length?i("ol",{class:"setup-progress","aria-live":"polite"},...r.progress.map(o=>i("li",{class:o.state},i("span",{class:o.state==="working"&&r.running&&!r.error?"spin":"progress-dot","aria-hidden":"true"}),o.label))):null,r.error?i("p",{class:"setup-error",role:"alert"},r.error):null)}function Dt(e){if(e.actionDestination)return e.actionDestination;if(e.asksFirst||["missing_stripe_webhook","unverified_stripe_webhook"].includes(e.id))return"repo-code";let n=`${e.id} ${e.title} ${e.detail??""}`.replace(/[-_]/g," ");return/\bdashboard\b|\bdns\b|apex domain|\blive\b[^.\n]*\bproof\b|\bprovider action\b/i.test(n)?"provider-action":e.requiresUserAction?"manual-review":"repo-code"}var J={authjs:"data:image/webp;base64,UklGRtANAABXRUJQVlA4WAoAAAAQAAAAVgAAXwAAQUxQSEIEAAABoETbtmnbmRvftl2LbSffthGVbNu2bdu2bdvGY5K91prBw73n7KAYEROAajsfPYBuk856r7Gh9tlD1wkAQvQotQsBAAbNv+QjNisvnTC2OwAXvSuJjwGAX3XP+2tJmhhJFZL8+rothwNADK5ozkcHoOvoE14lSRFl85qUZN1De60WAIToi+NCBIChi674jCSTGFtrIiT5xqkTegBw0bsC+BgA+FX3fLCOpCY1VtYkkeSX1ywbDgAhuGo4Hx2ArqNPeIUkRZTV1aQk6x/eZ80IIERfGRciAAxdes0XJJnEWEQTIck3Th3XFYCL3rXChwAAK+12Xw1JTWosrkkiyc+uXDwMAGJwTTkfPYBuY0542UiKGIuvSUnWP7TXagFAiB4IADBk0ZWfk2QSY1lVhCRfPXF0VwDew62y+/01JDWpsdwmiSS/uHrpMGDmCyQpYsyiaVKStbctX09LYsypiZBXNCoznOTKBuZYeMX/Wpfn6opf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45OTU2LS45OTU2LTIuMzAwNi0xLjQ5MjItMy42MDU1LTEuNDkyMi0xLjMwNDggMC0yLjYwOTkuNDk2Ni0zLjYwNTQgMS40OTIyLTEuOTkxMiAxLjk5MTItMS45OTEyIDUuMjE5OCAwIDcuMjExeiIvPjwvc3ZnPg==",vercel:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+VmVyY2VsPC90aXRsZT48cGF0aCBkPSJtMTIgMS42MDggMTIgMjAuNzg0SDBaIi8+PC9zdmc+"};function Et(e){return J[e]??null}var Ie={critical:0,warning:1,info:2},Pt={supabase:"https://supabase.com/dashboard/projects",vercel:"https://vercel.com/dashboard",stripe:"https://dashboard.stripe.com",github:"https://github.com/settings/profile",sentry:"https://sentry.io",posthog:"https://app.posthog.com",clerk:"https://dashboard.clerk.com",resend:"https://resend.com/emails",upstash:"https://console.upstash.com",neon:"https://console.neon.tech",railway:"https://railway.com/dashboard",render:"https://dashboard.render.com",cloudflare:"https://dash.cloudflare.com"},ei="sql|ts|tsx|js|jsx|mjs|cjs|json|toml|ya?ml|env|py|rb|go|rs|vue|svelte|astro|html|css|md|prisma|php|java|kt|sh|lock",ti=new RegExp(String.raw`((?:[\w.@-]+[\\/])*[\w.@-]+\.(?:${ei})):(\d{1,6})\b`,"g");function ni(e){if(!e)return[];let n=new Set;for(let t of e.matchAll(ti))n.add(`${t[1].split("\\").join("/")}:${t[2]}`);return[...n]}function ii(e){let n=(e??"").split(`
4
+ `).map(s=>s.trim()).filter(Boolean),[t="",...r]=n;return{summary:t,evidence:r.filter(s=>s!=="Evidence:").map(s=>s.replace(/^-\s*/,""))}}function He(e){return Et(e.id)??e.logoUrl}function ri(e,n,t){let r=n?.provider?.nextFix,s=e.asksFirst?`${e.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.`:"";return t==="manual-review"?[s,`Review this finding: ${e.title}. Do not edit files or change provider settings. Identify what evidence is missing and whether the next step belongs in the repo or with a provider, then ask the user before any change.`,e.detail,e.prompt?`Scanner guidance to review, not authorization to execute: ${e.prompt}`:""].filter(Boolean).join(`
5
5
  `):!e.prompt&&r?.id===e.id&&r.prompt?[s,r.prompt].filter(Boolean).join(`
6
6
  `):[s,`Address this repository finding: ${e.title}.`,e.detail??"",e.prompt?`How to fix it: ${e.prompt}`:"","Make the minimal change, then summarize what you changed and which files. Do not claim the app is production-ready; VibeRaven will check again."].filter(Boolean).join(`
7
- `)}function ri(e,n){let t=e.find(s=>s.provider?.nextFix?.id===n.id);if(t)return t;let r=`${n.title} ${n.detail??""}`.toLowerCase();return e.find(s=>r.includes(s.name.toLowerCase())||r.includes(`${s.id}/`))}function Ot(e){let[n,t]=[e.slice(0,e.lastIndexOf(":")),e.slice(e.lastIndexOf(":")+1)];return`${n.split("/").pop()??n}:${t}`}function si(e){return!e.project.empty&&!!e.project.project?.scannedAt}function ai(e){return e.busy.scan||e.scan?.state==="running"}function R(e){let n=si(e),t=ai(e),s=be(e.project,e.catalog,e.verified).filter(y=>y.step!=="absent"),a=n?e.project.missionCards?.blockers??[]:[],c=new Map((e.project.missionCards?.planSteps??[]).map(y=>[y.id,y])),o=a.map(y=>{let k=ri(s,y),{summary:E,evidence:A}=ni(y.detail),I=c.get(y.id),H=Dt({...y,asksFirst:y.asksFirst??I?.asksFirst,actionDestination:y.actionDestination??I?.actionDestination,requiresUserAction:y.requiresUserAction===!0||I?.requiresUserAction===!0});return{id:y.id,title:y.title,severity:y.severity,summary:E,evidence:A,locations:ti(y.detail),service:k?{id:k.id,name:k.name,mark:He(k)}:null,dashboard:H==="provider-action",actionDestination:H,prompt:ii({...y,asksFirst:y.asksFirst??I?.asksFirst},k,H)}}),d=new Map;for(let y of o){let k=y.service?.id??"app",E=d.get(k)??{key:k,name:y.service?.name??"Your code",mark:y.service?.mark??null,findings:[]};E.findings.push(y),d.set(k,E)}let p=y=>Math.min(...y.findings.map(k=>Ie[k.severity])),l=[...d.values()].map(y=>({...y,findings:[...y.findings].sort((k,E)=>Ie[k.severity]-Ie[E.severity])})).sort((y,k)=>p(y)-p(k)||k.findings.length-y.findings.length),u=l.flatMap(y=>y.findings),h=u.filter(y=>!y.dashboard).sort((y,k)=>Ie[y.severity]-Ie[k.severity]),f={critical:0,warning:0,info:0};for(let y of o)f[y.severity]+=1;let g=s.map(y=>{let k=o.filter(it=>it.service?.id===y.id),E=k.filter(it=>it.severity==="critical").length,A=e.verified[y.id],I="pending",H="Unknown \xB7 not checked yet";return t?H="Checking":n&&(E?(I="fail",H=`Repo checks \xB7 ${E} blocker${E===1?"":"s"}`):k.length?(I="warn",H=`${k.length} to review`):(I="pass",H="Repo checks \xB7 no blockers found")),{id:y.id,name:y.name,area:y.area,mark:He(y),tone:I,stateText:H,findings:k.length,verified:A}}),w=h.find(y=>y.id===e.flow.fixId)??null,v=[];for(let y of s){let k=e.verified[y.id];v.push({id:`live:${y.id}`,label:`Check ${y.name} live`,detail:k?`Recorded ${y.name} check (${k.at}): ${k.summary}`:`Your agent reads your real ${y.name} project and confirms it matches the code.`,kind:"live",done:k?.ok===!0,doneBy:"viberaven",providerId:y.id});let E=y.provider?.cockpit?.proof.checks.filter(A=>A.source==="dashboard"&&A.status!=="yes")??[];for(let A of E){let I=`dash:${y.id}:${A.label}`;v.push({id:I,label:A.label==="Production secret proof"?`Production keys for ${y.name} are set where you deploy`:`${y.name}: ${A.label}`,detail:A.label==="Production secret proof"?`The keys your app reads for ${y.name} go in your hosting provider's environment settings for production. VibeRaven cannot see your dashboards, so you tick this.`:`VibeRaven cannot see your ${y.name} dashboard, so you tick this.`,kind:"dashboard",done:e.flow.checklist[I]===!0,doneBy:"you",providerId:y.id,href:Pt[y.id]})}}for(let y of u.filter(k=>k.dashboard))v.push({id:`finding:${y.id}`,label:y.title,detail:`${y.summary} This clears when the next check no longer finds it.`,kind:"finding",done:!1,doneBy:"viberaven",providerId:y.service?.id,href:y.service?Pt[y.service.id]:void 0});let L=h.filter(y=>y.severity==="critical").length,$={app:!0,work:!0,findings:n,fix:n&&h.length>0,recheck:n&&e.flow.recheck!==null,ready:n&&L===0};return{scanned:n,scanning:t,services:g,findings:o,groups:l,fixable:h,counts:f,current:w,checklist:v,gateClear:n&&e.project.gate?.status==="clear",available:$}}function lt(e){return e.scanned?e.findings.length===0||!e.available.fix?"ready":"findings":"app"}function Rt(e,n){let t=n.flow.recheck,r=e.checklist.filter(s=>!s.done).length;return{work:"",app:e.scanning?"Checking now":e.services.length?`${e.services.length} service${e.services.length===1?"":"s"} found`:"No services found",findings:e.scanned?e.findings.length===0?"Nothing found":[e.counts.critical?`${e.counts.critical} critical`:null,`${e.findings.length} total`].filter(Boolean).join(" \xB7 "):"After the check",fix:e.scanned?e.fixable.length===0?"Nothing to fix in code":`${e.fixable.length} to fix`:"After the check",recheck:t?t.status==="running"?"Checking now":t.status==="fixed"?"Last fix held":t.status==="open"?"Still open":"Did not finish":"After a fix",ready:e.scanned?e.available.ready?e.gateClear?"No blockers found":r?`${r} step${r===1?"":"s"} left`:"Checklist done":"After the critical fixes":"After the check"}}var Be='<svg class="brand-raven" width="24" height="20" viewBox="0 0 796 667" aria-hidden="true" focusable="false"><path fill-rule="evenodd" fill="currentColor" d="M177.0 347.5 L170.0 352.0 L152.5 365.5 L142.0 375.5 L141.5 375.5 L141.5 376.0 L133.5 383.5 L133.5 384.0 L120.5 397.5 L96.5 427.5 L95.5 429.5 L84.0 445.0 L65.5 472.5 L65.0 474.0 L56.0 487.5 L55.5 489.0 L49.5 498.0 L43.0 509.5 L38.0 517.0 L37.0 519.5 L36.0 520.5 L35.5 522.0 L31.5 528.0 L30.0 531.5 L27.5 535.0 L26.5 537.5 L24.0 541.0 L18.5 552.0 L17.5 553.0 L2.0 584.0 L2.0 585.0 L0.0 589.0 L1.0 589.0 L10.0 583.0 L13.5 580.0 L20.0 576.0 L21.5 574.5 L23.0 574.0 L31.0 568.0 L47.5 557.0 L50.5 555.5 L52.0 554.0 L74.0 539.5 L75.5 538.0 L83.5 533.0 L85.0 531.5 L94.5 525.0 L100.5 520.0 L108.0 512.5 L121.0 496.0 L123.5 492.0 L130.0 478.0 L130.0 477.0 L133.0 470.5 L133.5 468.0 L136.5 461.5 L139.0 453.5 L140.0 452.0 L142.5 444.5 L143.5 443.0 L144.0 440.5 L147.0 434.0 L151.0 421.5 L152.0 420.0 L154.0 413.5 L156.0 409.5 L158.0 402.5 L161.0 396.0 L162.0 392.0 L163.0 390.5 L163.0 389.0 L164.0 387.5 L168.0 375.0 L169.0 373.5 L170.0 369.0 L171.0 367.5 L175.0 355.0 L176.0 353.5 L176.0 352.0 L177.5 348.0 Z M763.0 175.5 L732.0 140.0 L703.5 118.0 L652.0 93.5 L604.5 79.5 L586.0 56.5 L562.0 38.5 L525.0 19.5 L483.5 5.0 L455.5 0.5 L426.5 0.0 L383.5 6.0 L333.0 23.0 L275.0 55.5 L237.0 86.0 L302.0 77.5 L238.5 129.0 L199.5 169.5 L136.5 254.5 L67.0 356.5 L296.5 247.0 L232.5 314.0 L201.5 357.0 L110.0 552.5 L69.0 666.5 L211.0 526.0 L264.5 479.0 L323.0 433.0 L206.0 633.5 L288.5 587.0 L349.0 547.5 L417.0 497.0 L471.5 450.5 L529.0 392.5 L499.5 279.5 L501.0 275.0 L544.5 251.5 L605.5 229.5 L658.5 223.0 L725.5 221.0 L701.5 210.0 L655.5 197.0 L515.0 178.5 L549.5 171.0 L594.0 166.0 L649.5 175.0 L692.5 189.0 L718.5 201.0 L747.0 217.5 L795.0 252.0 L784.0 214.0 Z M436.5 73.5 L437.0 73.0 L438.0 73.0 L438.5 73.5 L439.5 73.5 L440.0 74.0 L441.5 74.0 L442.0 74.5 L443.0 74.5 L443.5 75.0 L445.0 75.0 L445.5 75.5 L446.0 75.5 L446.5 76.0 L448.0 76.0 L448.5 76.5 L449.0 76.5 L449.5 77.0 L451.0 77.0 L451.5 77.5 L452.0 77.5 L452.5 78.0 L453.5 78.0 L454.0 78.5 L454.5 78.5 L455.0 79.0 L456.0 79.0 L456.5 79.5 L457.5 79.5 L458.0 80.0 L459.0 80.0 L459.5 80.5 L460.5 80.5 L461.0 81.0 L461.5 81.0 L462.0 81.5 L463.0 81.5 L463.5 82.0 L464.5 82.0 L465.0 82.5 L465.5 82.5 L466.0 83.0 L467.0 83.0 L467.5 83.5 L468.5 83.5 L469.0 84.0 L469.5 84.0 L470.0 84.5 L471.0 84.5 L471.5 85.0 L472.5 85.0 L473.0 85.5 L473.5 85.5 L474.0 86.0 L475.0 86.0 L475.5 86.5 L476.5 86.5 L477.0 87.0 L477.5 87.0 L478.0 87.5 L478.5 87.5 L479.0 88.0 L480.0 88.0 L480.5 88.5 L481.0 88.5 L481.5 89.0 L482.5 89.0 L483.0 89.5 L483.5 89.5 L484.0 90.0 L484.5 90.0 L485.0 90.5 L486.0 90.5 L486.5 91.0 L487.5 91.0 L488.0 91.5 L488.5 91.5 L489.0 92.0 L489.5 92.0 L490.0 92.5 L491.0 92.5 L491.5 93.0 L492.0 93.0 L492.5 93.5 L493.5 93.5 L494.0 94.0 L494.5 94.0 L495.0 94.5 L495.5 94.5 L496.0 95.0 L496.5 95.0 L497.0 95.5 L497.5 95.5 L498.0 96.0 L499.0 96.0 L499.5 96.5 L500.0 96.5 L500.5 97.0 L501.0 97.0 L501.5 97.5 L502.0 97.5 L502.5 98.0 L503.5 98.0 L504.0 98.5 L504.5 98.5 L505.0 99.0 L506.0 99.0 L506.5 99.5 L507.0 99.5 L507.5 100.0 L508.0 100.0 L508.5 100.5 L509.0 100.5 L509.5 101.0 L510.5 101.0 L511.0 101.5 L511.5 101.5 L512.0 102.0 L512.5 102.0 L513.0 102.5 L513.5 102.5 L514.0 103.0 L514.5 103.0 L515.0 103.5 L515.5 103.5 L516.0 104.0 L516.5 104.0 L517.0 104.5 L517.5 104.5 L518.0 105.0 L518.5 105.0 L519.0 105.5 L519.5 105.5 L520.0 106.0 L521.0 106.0 L521.5 106.5 L522.0 106.5 L522.5 107.0 L523.0 107.0 L523.5 107.5 L524.0 107.5 L524.5 108.0 L525.0 108.0 L525.5 108.5 L526.0 108.5 L526.5 109.0 L527.0 109.0 L527.5 109.5 L528.0 109.5 L528.5 110.0 L529.0 110.0 L529.5 110.5 L530.0 110.5 L530.5 111.0 L531.0 111.0 L531.5 111.5 L532.0 111.5 L532.5 112.0 L533.0 112.0 L533.5 112.5 L534.0 112.5 L534.5 113.0 L535.0 113.0 L535.5 113.5 L536.0 113.5 L536.5 114.0 L537.0 114.0 L537.5 114.5 L538.0 114.5 L539.0 115.5 L539.0 116.0 L538.0 117.0 L537.0 117.0 L536.5 117.5 L536.0 117.5 L535.5 118.0 L535.0 118.0 L534.5 118.5 L533.5 118.5 L533.0 119.0 L532.5 119.0 L532.0 119.5 L531.0 119.5 L530.5 120.0 L530.0 120.0 L529.5 120.5 L528.5 120.5 L528.0 121.0 L527.5 121.0 L527.0 121.5 L526.5 121.5 L526.0 122.0 L525.5 122.0 L525.0 122.5 L524.0 122.5 L523.5 123.0 L523.0 123.0 L522.5 123.5 L521.5 123.5 L521.0 124.0 L520.5 124.0 L520.0 124.5 L519.0 124.5 L518.5 125.0 L518.0 125.0 L517.5 125.5 L516.5 125.5 L516.0 126.0 L515.0 126.0 L514.5 126.5 L513.5 126.5 L513.0 127.0 L512.5 127.0 L512.0 127.5 L511.0 127.5 L510.5 128.0 L510.0 128.0 L509.5 128.5 L508.5 128.5 L508.0 129.0 L507.0 129.0 L506.5 129.5 L505.0 129.5 L504.5 130.0 L504.0 130.0 L503.5 130.5 L502.0 130.5 L501.5 131.0 L500.0 131.0 L499.5 131.5 L496.5 131.5 L496.0 132.0 L491.5 132.0 L491.0 131.5 L488.5 131.5 L488.0 131.0 L487.0 131.0 L486.5 130.5 L485.5 130.5 L485.0 130.0 L484.0 130.0 L483.5 129.5 L483.0 129.5 L482.5 129.0 L482.0 129.0 L481.5 128.5 L481.0 128.5 L480.5 128.0 L480.0 128.0 L479.0 127.0 L478.5 127.0 L477.5 126.0 L477.0 126.0 L475.5 124.5 L475.0 124.5 L470.0 119.5 L470.0 119.0 L468.0 117.0 L468.0 116.5 L466.5 115.0 L466.5 114.5 L464.5 112.5 L464.5 112.0 L463.0 110.5 L463.0 110.0 L461.5 108.5 L461.5 108.0 L460.0 106.5 L460.0 106.0 L458.5 104.5 L458.5 104.0 L457.0 102.5 L457.0 102.0 L455.5 100.5 L455.5 100.0 L454.0 98.5 L454.0 98.0 L452.5 96.5 L452.5 96.0 L451.5 95.0 L451.5 94.5 L450.0 93.0 L450.0 92.5 L448.5 91.0 L448.5 90.5 L447.0 89.0 L447.0 88.5 L446.0 87.5 L446.0 87.0 L444.5 85.5 L444.5 85.0 L443.0 83.5 L443.0 83.0 L442.0 82.0 L442.0 81.5 L440.5 80.0 L440.5 79.5 L439.5 78.5 L439.5 78.0 L438.5 77.0 L438.5 76.5 L437.5 75.5 L437.5 75.0 L436.5 74.0 Z"/></svg>';var ct=new Map,Ft=()=>{};function dt(e){return`vr-canvas:${e}`}function je(e){let n=ct.get(e);if(n)return n;let t={pan:{x:0,y:0},zoom:1,cards:{}};try{let r=localStorage.getItem(dt(e));if(r){let s=JSON.parse(r);t={pan:s.pan??t.pan,zoom:Ht(s.zoom??1),cards:s.cards??{}}}}catch{}return ct.set(e,t),t}function zt(e){try{localStorage.setItem(dt(e),JSON.stringify(je(e)))}catch{}}function Ht(e){return Math.min(1.6,Math.max(.5,Math.round(e*100)/100))}function oi(e){return`translate(${e.pan.x}px, ${e.pan.y}px) scale(${e.zoom})`}function li(e,n){let t=e.cards[n];return t?`translate(${t.x}px, ${t.y}px)`:void 0}function ci(e){return e.zoom!==1||e.pan.x!==0||e.pan.y!==0||Object.keys(e.cards).length>0}function Ye(e){return e.querySelector(".board")}function ke(e){let n=Ye(e);if(!n)return;let t=je(n.dataset.layoutKey??"default");n.style.transform=oi(t);for(let r of Array.from(n.querySelectorAll("[data-card]")))r.style.transform=li(t,r.dataset.card??"")??"";e.classList.toggle("is-moved",ci(t)),Ft(n)}function Ge(e,n){let t=Ye(e);if(!t)return;let r=t.dataset.layoutKey??"default",s=je(r);s.zoom=Ht(s.zoom*n),ke(e),zt(r)}function Bt(e){let n=Ye(e);if(!n)return;let t=n.dataset.layoutKey??"default";ct.set(t,{pan:{x:0,y:0},zoom:1,cards:{}}),ke(e);try{localStorage.removeItem(dt(t))}catch{}}var Ut=new WeakSet;function Yt(e,n){if(Ft=n,Ut.has(e)){ke(e);return}Ut.add(e);let t=null,r=0;e.addEventListener("pointerdown",a=>{if(a.button!==0)return;let c=a.target;if(c.closest("button, a, input, select, textarea, pre, form, iframe, .canvas-tools, .pr-checks, .shelf"))return;let o=Ye(e);if(!o)return;let d=o.dataset.layoutKey??"default",p=je(d),l=c.closest("[data-card]"),u=l?.dataset.card??"";t={kind:l?"card":"pan",id:u,key:d,startX:a.clientX,startY:a.clientY,origin:l?{...p.cards[u]??{x:0,y:0}}:{...p.pan},moved:!1,pointer:a.pointerId,target:l??e}}),e.addEventListener("pointermove",a=>{if(!t||a.pointerId!==t.pointer)return;let c=a.clientX-t.startX,o=a.clientY-t.startY;if(!t.moved){if(Math.hypot(c,o)<4)return;t.moved=!0,e.setPointerCapture?.(t.pointer),e.classList.add("is-dragging"),t.target.classList.add("is-lifted")}let d=je(t.key);t.kind==="pan"?d.pan={x:Math.round(t.origin.x+c),y:Math.round(t.origin.y+o)}:d.cards[t.id]={x:Math.round(t.origin.x+c/d.zoom),y:Math.round(t.origin.y+o/d.zoom)},r||(r=requestAnimationFrame(()=>{r=0,ke(e)}))});let s=a=>{!t||a.pointerId!==t.pointer||(t.moved&&(e.releasePointerCapture?.(t.pointer),e.classList.remove("is-dragging"),t.target.classList.remove("is-lifted"),ke(e),zt(t.key)),t=null)};e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("wheel",a=>{!a.ctrlKey&&!a.metaKey||(a.preventDefault(),Ge(e,a.deltaY<0?1.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S40NzMuODQybDEuNjk0IDIuOTY1LTEuNjg4IDIuODQ4YS44NDkuODQ5IDAgMDAxLjQ2Ljg2NGwxLjk0LTMuMjcyYS44NDkuODQ5IDAgMDAuMDA3LS44NTRsLTEuOTQtMy4zOTN6bTUuNDQ2IDYuMjRhLjg0OS44NDkgMCAwMDAgMS42OTVoNC44NDhhLjg0OS44NDkgMCAwMDAtMS42OTZoLTQuODQ4eiIgLz4NCjwvc3ZnPg0K",gemini:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHJvbGU9ImltZyIgdmlld0JveD0iMCAwIDI0IDI0IiBhcmlhLWhpZGRlbj0idHJ1ZSI+DQogIDx0aXRsZT5HZW1pbmkgQ0xJPC90aXRsZT4NCiAgPHBhdGggZmlsbD0iIzQyODVGNCIgZD0iTTExLjA0IDE5LjMyUTEyIDIxLjUxIDEyIDI0cTAtMi40OS45My00LjY4Ljk2LTIuMTkgMi41OC0zLjgxdDMuODEtMi41NVEyMS41MSAxMiAyNCAxMnEtMi40OSAwLTQuNjgtLjkzYTEyLjMgMTIuMyAwIDAgMS0zLjgxLTIuNTggMTIuMyAxMi4zIDAgMCAxLTIuNTgtMy44MVExMiAyLjQ5IDEyIDBxMCAyLjQ5LS45NiA0LjY4LS45MyAyLjE5LTIuNTUgMy44MWExMi4zIDEyLjMgMCAwIDEtMy44MSAyLjU4UTIuNDkgMTIgMCAxMnEyLjQ5IDAgNC42OC45NiAyLjE5LjkzIDMuODEgMi41NXQyLjU1IDMuODEiLz4NCjwvc3ZnPg0K"};var ee=new Set(["succeeded","partially_completed","failed","cancelled","interrupted"]),Gt=600;function di(e){let n=e.trim().toLowerCase();return/^(?:please\s+)?(?:show|run|start|open|launch)\s+(?:me\s+)?(?:my\s+|the\s+)?(?:app|preview|site)\b\.?$/.test(n)?"preview.start":/^(?:please\s+)?fix\s+(?:the\s+|my\s+|all\s+)?(?:findings?|blockers?|issues?)\b\.?$/.test(n)?"findings.fix":"app.change"}function Qt(e,n){let t=null,r=null,s=()=>e.get().work;async function a(){try{let f=await x.actions(e.get().cliId);e.work({offers:f.actions,facts:f.facts,preview:f.preview}),f.activeRunId&&f.activeRunId!==s().run?.id&&await p(f.activeRunId)}catch{}}async function c(){try{e.work({history:(await x.runs()).runs})}catch{}}function o(f){let g=e.get().work.run;g&&g.id!==f.run.id||e.work(w=>{let v=w.run?.id===f.run.id,L=v?w.cursor:0,$=f.events.filter(y=>y.seq>L);return{run:f.run,events:[...v?w.events:[],...$].slice(-300),cursor:$.length?$[$.length-1].seq:L}})}async function d(f){if(t!==f){t=f;try{for(;s().run?.id===f;){let g;try{g=await x.run(f,s().cursor)}catch{await new Promise(v=>window.setTimeout(v,Gt*2));continue}let w=s().run?.state;if(o(g),g.events.some(v=>v.type==="preview.refreshed"||v.type==="preview.ready")&&await l(),ee.has(g.run.state)){w&&!ee.has(w)&&(await Promise.all([a(),c(),l()]),g.run.changes.length&&await n.refreshProject().catch(()=>{}));break}await new Promise(v=>window.setTimeout(v,Gt))}}finally{t===f&&(t=null)}}}async function p(f){let g=await x.run(f,0);e.work({run:g.run,events:g.events,cursor:g.events.at(-1)?.seq??0,plan:null,diff:null,error:null}),n.goToStep("work"),ee.has(g.run.state)||d(f)}async function l(){try{let f=await x.preview();e.work({preview:f}),f.state==="starting"&&u()}catch{}}function u(){r===null&&(r=window.setTimeout(()=>{r=null,l()},900))}let h={async loadWork(){await Promise.all([a(),c()])},setRequest(f){e.get().work.request=f},async submitRequest(f){let g=f.trim();if(!g){document.getElementById("shelf-input")?.focus();return}let w=di(g);if(w==="findings.fix"){n.goToStep("findings");return}await h.planAction(w,w==="app.change"?g:void 0)},runOffer(f){if(f.id==="findings.fix"){n.goToStep("findings");return}if(f.id==="agent.connect"||f.unblock==="connect-agent"){n.openAgents();return}if(f.id==="app.change"){n.openCatalog(!1),queueMicrotask(()=>document.getElementById("shelf-input")?.focus());return}f.availability==="ready"&&(n.openCatalog(!1),h.planAction(f.id))},async planAction(f,g){let w=e.get();if(w.work.run&&!ee.has(w.work.run.state)){n.goToStep("work");return}e.work({busy:!0,error:null});try{let{plan:v}=await x.planAction({actionId:f,request:g,cliId:w.cliId,accessMode:w.accessMode,modelId:w.modelId||void 0});e.work({plan:{actionId:f,request:g,plan:v},run:null,events:[],cursor:0,diff:null,gallery:null,selectedPart:null}),n.goToStep("work"),queueMicrotask(()=>document.getElementById("work-start")?.focus({preventScroll:!0}))}catch(v){e.toast(v instanceof Error?v.message:String(v),"err")}finally{e.work({busy:!1})}},async setWorkAccess(f){n.setAccessMode(f);let g=s().plan;g&&await h.planAction(g.actionId,g.request)},async startPlanned(){let f=s().plan,g=e.get();if(!(!f||g.work.busy)&&!(f.actionId==="app.change"&&!g.probes[g.cliId]?.ready&&(await n.testConnection(),!e.get().probes[e.get().cliId]?.ready))){e.work({busy:!0,error:null});try{let w=await x.startRun({actionId:f.actionId,request:f.request,cliId:g.cliId,accessMode:g.accessMode,modelId:g.modelId||void 0,planRevision:f.plan.revision});e.work({plan:null,run:w.run,events:w.events,cursor:w.events.at(-1)?.seq??0,request:f.actionId==="app.change"?"":s().request,selectedPart:null}),d(w.run.id),f.actionId==="preview.start"&&u()}catch(w){let v=w instanceof Error?w.message:String(w);e.work({error:v}),/plan changed/i.test(v)&&await h.planAction(f.actionId,f.request)}finally{e.work({busy:!1})}}},async cancelRun(){let f=s().run;if(!(!f||ee.has(f.state)))try{await x.cancelRun(f.id)}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},closeWork(){e.work({plan:null,diff:null,error:null,gallery:null,selectedPart:null,...s().run&&!ee.has(s().run.state)?{}:{run:null,events:[],cursor:0}}),n.goToStep("app")},newChange(){e.work({plan:null,run:null,events:[],cursor:0,diff:null,error:null,gallery:null,selectedPart:null}),n.goToStep("app"),queueMicrotask(()=>document.getElementById("shelf-input")?.focus())},async showDiff(){let f=s().run;if(f){if(s().diff?.runId===f.id){e.work({diff:null});return}try{e.work({diff:{runId:f.id,files:(await x.runDiff(f.id)).files}})}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}}},async undoRun(){let f=s().run;if(f)try{let g=await x.revertRun(f.id);g.run&&e.work({run:g.run,diff:null}),e.toast(g.skipped.length?`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}. ${g.skipped.length} left as ${g.skipped.length===1?"it is":"they are"}: Review shows why.`:`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}.`,g.skipped.length?"err":"ok"),await Promise.all([l(),n.refreshProject().catch(()=>{}),c()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},async restoreFile(f){let g=s().run;if(g)try{let w=await x.restoreFile(g.id,f);e.work({run:w.run??g,diff:{runId:g.id,files:(await x.runDiff(g.id)).files}}),e.toast(`Put back ${f.split("/").pop()}. A copy of it as it was is kept with the run.`,"ok"),await Promise.all([l(),n.refreshProject().catch(()=>{})])}catch(w){e.toast(w instanceof Error?w.message:String(w),"err")}},async stopPreview(){try{e.work({preview:await x.stopPreview(),previewExpanded:!1}),await a()}catch(f){e.toast(f instanceof Error?f.message:String(f),"err")}},reloadPreview(){let f=document.getElementById("app-frame");f&&(f.src=f.src)},selectPart(f){e.work({selectedPart:s().selectedPart===f?null:f})},showGallery(f,g,w){if(s().run&&!ee.has(s().run.state)){n.goToStep("work");return}n.openCatalog(!1),e.work({gallery:{kind:f,phase:g,provider:w},plan:null,run:null,events:[],cursor:0,diff:null,selectedPart:null}),n.goToStep("work")},async resumeRun(){let f=s().run;if(!(!f||f.state!=="waiting_for_user"||s().busy)){e.work({busy:!0});try{o(await x.resumeRun(f.id));let g=s().run;g&&!ee.has(g.state)?d(g.id):await Promise.all([a(),c(),l()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}finally{e.work({busy:!1})}}},toggleCatalog(f){n.openCatalog(f??e.get().drawer!=="actions")},togglePreviewExpanded(f){let g=f??!s().previewExpanded;e.work({previewExpanded:g}),queueMicrotask(()=>document.getElementById(g?"preview-collapse":"preview-expand")?.focus({preventScroll:!0}))}};return h}function te(e){return e!==void 0&&ee.has(e)}var C=24,le=.8660254,ce=.5,Wt={x:470,y:120},W=null;function b(e,n,t){let r=[Wt.x+(e-n)*le*C,Wt.y+(e+n)*ce*C-t*C];return W&&(W.x0=Math.min(W.x0,r[0]),W.x1=Math.max(W.x1,r[0]),W.y0=Math.min(W.y0,r[1]),W.y1=Math.max(W.y1,r[1])),r}function U(e){return e.map(([n,t])=>`${n.toFixed(1)},${t.toFixed(1)}`).join(" ")}function m(e){return e.toFixed(1)}function j(e,n,t,r){let[s,a]=b(n,t,r);return e==="front"?`matrix(${m(le*C)} ${m(ce*C)} 0 ${C} ${m(s)} ${m(a)})`:e==="side"?`matrix(${m(le*C)} ${m(-ce*C)} 0 ${C} ${m(s)} ${m(a)})`:`matrix(${m(le*C)} ${m(ce*C)} ${m(-le*C)} ${m(ce*C)} ${m(s)} ${m(a)})`}function S(e,n,t,r,s,a,c){let o=[b(e,n,t+a),b(e+r,n,t+a),b(e+r,n+s,t+a),b(e,n+s,t+a)],d=[b(e,n+s,t+a),b(e+r,n+s,t+a),b(e+r,n+s,t),b(e,n+s,t)],p=[b(e+r,n,t+a),b(e+r,n+s,t+a),b(e+r,n+s,t),b(e+r,n,t)],l=U([b(e,n+s,t+a),b(e+r,n+s,t+a),b(e+r,n,t+a)]);return`<g class="box ${c}"><polygon class="f-left" points="${U(d)}"/><polygon class="f-right" points="${U(p)}"/><polygon class="f-top" points="${U(o)}"/><polyline class="edge" points="${l}"/></g>`}function ui(e,n,t,r,s,a,c=0){let[o,d]=b(e,n,t+s),p=r*C*1.2247,l=r*C*.7071,u=d+s*C;return`<g class="cyl ${a}" style="animation-delay:${c}ms"><path class="f-left" d="M${m(o-p)} ${m(d)} L${m(o-p)} ${m(u)} A${m(p)} ${m(l)} 0 0 0 ${m(o+p)} ${m(u)} L${m(o+p)} ${m(d)} Z"/><ellipse class="f-top" cx="${m(o)}" cy="${m(d)}" rx="${m(p)}" ry="${m(l)}"/></g>`}function Z(e,n,t,r,s=0){return`<polygon class="shadow" points="${U([b(e+.3,n+.3,s),b(e+t+.5,n+.3,s),b(e+t+.5,n+r+.6,s),b(e+.3,n+r+.6,s)])}"/>`}function de(e,n,t=2){let[r,s]=b(...e),[a,c]=b(...n),o=(r+a)/2,d=Math.min(s,c)-t*C;return`M${m(r)} ${m(s)} Q${m(o)} ${m(d)} ${m(a)} ${m(c)}`}function Te(e){return e.map((n,t)=>`${t?"L":"M"}${m(b(...n)[0])} ${m(b(...n)[1])}`).join(" ")}function Ke(e,n,t,r,s=""){let[a,c]=b(e,n,t),o=Math.max(26,r.length*5.6+14);return`<g class="tag ${s}" transform="translate(${m(a)} ${m(c)})"><rect x="${m(-o/2)}" y="-9.5" width="${m(o)}" height="18" rx="9"/><text x="0" y="3.2" text-anchor="middle">${ut(r)}</text></g>`}function ut(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}var Vt=/d="([^"]+)"/.exec(Be)?.[1]??"",pi="data:image/svg+xml;base64,"+qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>');function qt(e){return btoa(e)}function ie(e,n,t,r,s,a,c,o){let d=[];for(let h=1;h<r;h+=1)d.push(`<path class="grid" d="M${h} 0 L${h} ${s}"/>`);for(let h=1;h<s;h+=1)d.push(`<path class="grid" d="M0 ${h} L${r} ${h}"/>`);let p=Vt&&!o?`<g transform="${j("front",n+.5,t+s,.62)}"><g transform="scale(0.00105 0.00105) translate(0 -620)"><path class="raven" d="${Vt}"/></g></g>`:"",l=o?`<g transform="${j("front",n+.45,t+s,.62)}"><image href="${o}" x="0" y="-0.55" width="0.5" height="0.5"/></g>`:"",u=U([b(n,t+s,.7),b(n,t,.7),b(n+r,t,.7),b(n+r,t+s,.7),b(n,t+s,.7)]);return{id:e,label:a,state:c,svg:`${S(n,t,0,r,s,.7,"ground")}<g transform="${j("top",n,t,.7)}" class="grid-lines">${d.join("")}</g><polyline class="rim" points="${u}"/>${p}${l}<g transform="${j("front",n+(o?1.25:1.7),t+s,.7)}"><text class="ground-label" x="0" y="0.47">${ut(a.toUpperCase())}</text></g>`}}function gi(e,n,t,r,s,a,c,o){let l=`<rect class="win-face" x="0" y="0" width="${r}" height="${s}" rx="0.18"/><rect class="win-bar" x="0" y="0" width="${r}" height="0.62" rx="0.18"/><circle class="dot" cx="0.42" cy="0.31" r="0.1"/><circle class="dot" cx="0.74" cy="0.31" r="0.1"/><circle class="dot" cx="1.06" cy="0.31" r="0.1"/><rect class="win-url" x="1.5" y="0.17" width="${Math.max(1,r-2.3)}" height="0.28" rx="0.14"/>`;return{id:e,label:o,state:a,svg:`${Z(n,t,r,.32,.7)}${S(n,t,.7,r,.32,s,"frame")}<g transform="${j("front",n,t+.32,.7+s)}" class="win">${l}<g class="win-content">${c}</g><rect class="win-outline" x="0" y="0" width="${r}" height="${s}" rx="0.18" pathLength="1"/></g>`}}function ne(e,n="0 0 24 24"){return`data:image/svg+xml;base64,${qt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${n}">${e}</svg>`)}`}var ge='fill="none" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"',oe={code:ne(`<path ${ge} d="M8.5 7 3.5 12l5 5M15.5 7l5 5-5 5"/>`),tests:ne(`<path ${ge} d="M9 3h6M10 3v6l-5 9a2 2 0 0 0 1.7 3h10.6a2 2 0 0 0 1.7-3l-5-9V3M7.5 15h9"/>`),page:ne(`<path ${ge} d="M6 3h8.5L19 7.5V21H6zM14 3v5h5M9 12.5h7M9 16.5h5"/>`),preview:ne(`<path ${ge} d="M3 5h18v12H3zM9 21h6M12 17v4"/><path fill="#f5f5f7" d="M10 8.5v5l4.3-2.5z"/>`),check:ne(`<path ${ge} d="M4.5 12.5l4.5 4.5 10-10"/>`),user:ne(`<circle ${ge} cx="12" cy="8" r="3.6"/><path ${ge} d="M4.8 20c.9-3.6 3.8-5.6 7.2-5.6s6.3 2 7.2 5.6"/>`)},hi=ne('<rect width="24" height="24" rx="4" fill="#CB3837"/><path fill="#fff" d="M5 7h14v10h-3.5V10.5h-3V17H5z"/>'),fi=ne('<circle cx="12" cy="12" r="11" fill="#000" stroke="#f5f5f7" stroke-width="1.2"/><path d="M8.4 16.8V7.2l8.4 11.4" fill="none" stroke="#f5f5f7" stroke-width="1.7" stroke-linejoin="round"/><path d="M15.6 7.2v6.6" stroke="#f5f5f7" stroke-width="1.7"/>'),mi=ne('<path fill="#bd34fe" d="M21.5 3.5 12.6 21a.6.6 0 0 1-1.1 0L2.5 3.5a.6.6 0 0 1 .6-.8l8.8 1.6h.2l8.8-1.6a.6.6 0 0 1 .6.8z"/><path fill="#ffd62e" d="M16.2 2.3 9.6 3.6a.3.3 0 0 0-.2.3l-.4 6.8a.3.3 0 0 0 .3.3l1.8-.4a.3.3 0 0 1 .4.4l-.5 2.6a.3.3 0 0 0 .4.3l1.1-.3a.3.3 0 0 1 .4.3l-.9 4.2c0 .3.3.4.5.2l.1-.2 3.9-7.8a.3.3 0 0 0-.3-.4l-1.9.4a.3.3 0 0 1-.3-.4l1.2-4.3a.3.3 0 0 0-.3-.4z"/>'),wi={claude:"#D97757",codex:"#2563eb",gemini:"#4285F4"};function yi(e){return e==="Next.js"?fi:e==="Vite"?mi:oe.code}function vi(e){return/type/i.test(e)?oe.code:/test/i.test(e)?oe.tests:/page|load|answer/i.test(e)?oe.page:/sign|user|owner|other/i.test(e)?oe.user:oe.check}function _e(e){let{x:n,y:t,size:r}=e,s=e.h??.5,a=e.grounded?.7:e.z??1.5,c=r*.5,o=n+(r-c)/2,d=t+(r-c)/2,[p,l]=b(n+r/2,t+r/2,.7),u=r*.68,h=(r-u)/2,f=u*.62,g=e.grounded?Z(n,t,r,r,.7):`<ellipse class="shadow soft" cx="${m(p)}" cy="${m(l)}" rx="${m(r*.85*C)}" ry="${m(r*.48*C)}"/>${e.floating?"":S(o,d,.7,c,c,Math.max(.2,a-.7-.25),"pedestal")}`;return`<g class="unit-wrap ${e.cls??""}" style="--brand:${e.brand??"rgba(255,255,255,0.35)"}">${g}<g class="${e.grounded?"still":"hover"}">${S(n,t,a,r,r,s,"unit")}<g transform="${j("top",n,t,a+s)}"><rect class="unit-plate" x="${m(h)}" y="${m(h)}" width="${m(u)}" height="${m(u)}" rx="${m(u*.22)}"/><rect class="unit-ring" x="${m(h)}" y="${m(h)}" width="${m(u)}" height="${m(u)}" rx="${m(u*.22)}"/><image href="${e.mark}" x="${m(h+(u-f)/2)}" y="${m(h+(u-f)/2)}" width="${m(f)}" height="${m(f)}"/></g><g transform="${j("front",n,t+r,a+s)}"><rect class="unit-led" x="${m(r*.18)}" y="${m(s*.42)}" width="${m(r*.64)}" height="0.11" rx="0.055"/></g></g></g>`}function bi(e,n,t,r,s,a,c,o="#D97757",d=!1,p=!1){let l=_e({x:n,y:t,size:1.8,z:r,h:.55,mark:a,brand:o,floating:!0});return{id:e,label:c,state:s,svg:d&&!p?l.replace(/<\/g><\/g>$/,`${Kt(n+.1,t+.55,r+.55)}</g></g>`):l}}function ki(e,n,t,r,s){return{id:e,label:s,state:r,svg:`${_e({x:n,y:t,size:1.25,z:1.6,h:.42,mark:vi(s)})}${Ke(n+.62,t+.62,3.05,s,"tag-check")}`}}function G(e,n,t,r){return{id:e,label:r,state:t,svg:`<path class="pipe-base" d="${n}"/><path class="pipe" d="${n}" pathLength="1"/><path class="pipe-flow" d="${n}"/>`}}function Ve(e,n,t,r,s,a){if(!s)return`<circle class="token ${n}" r="5" cx="0" cy="0"><animateMotion dur="0.01s" fill="freeze" path="${e}" keyPoints="${a??1};${a??1}" keyTimes="0;1" calcMode="linear"/></circle>`;let c=a!==void 0?`keyPoints="0;${a};${a}" keyTimes="0;0.7;1" calcMode="linear"`:"";return`<g class="token-g ${n}"><circle class="token-halo" r="9"/><circle class="token" r="4.5"/><animateMotion dur="${t}s" ${r?'repeatCount="indefinite"':'fill="freeze"'} ${c} path="${e}"/></g>`}function Mi(e,n,t,r){return{id:e,label:"Live preview",state:r,svg:`${_e({x:n,y:t,size:1.2,z:1.25,h:.4,mark:oe.preview,brand:"#6fd08c"})}${Ke(n+.6,t+.6,3.15,r==="done"?"LIVE":"PREVIEW","tag-port")}`}}function pt(e,n,t,r,s,a,c){let o=[],d=[];for(let h=0;h<3;h+=1){if(h>=s&&r!=="planned")continue;let f=.7+h*.95;if(o.push(ui(n,t,f,1.55,.75,`layer${h<s?"":" ghost"}`,h*160)),h<s){let[g,w]=b(n,t,f+.75),v=1.55*C*1.2247,L=1.55*C*.7071;d.push(`<path class="seam" style="animation-delay:${h*200}ms" d="M${m(g-v)} ${m(w+.18*C)} A${m(v)} ${m(L)} 0 0 0 ${m(g+v)} ${m(w+.18*C)}"/>`)}}let p=.7+Math.min(Math.max(s,1),3)*.95-.2,l=[];for(let h=0;h<a;h+=1)l.push(`<rect class="table" x="${-.95+h%2*1}" y="${-.95+Math.floor(h/2)*1}" width="0.85" height="0.85" rx="0.12" style="animation-delay:${h*140}ms"/>`);let u=s?`<g transform="${j("front",n-.45,t+1.35,1.55)}"><rect class="brand-badge" x="0" y="0" width="0.9" height="0.9" rx="0.22"/><image href="${c}" x="0.17" y="0.17" width="0.56" height="0.56"/></g>`:"";return{id:e,label:"Supabase database",state:r,svg:`<g class="brand-supabase" style="--brand:#3ECF8E">${Z(n-1.6,t-1.6,3.2,3.2,.7)}${o.join("")}${d.join("")}<g transform="${j("top",n,t,p)}">${l.join("")}</g>${u}</g>`}}function Li(e,n,t,r,s,a){let c=s==="github"?["g-dark","g-light"]:["g-blue","g-green"],o=p=>{let[l,u]=_t(p,0,0);return`${m(l)} ${m(u)}`},d=(p,l)=>{let u=a==="cycle"?`<animateTransform attributeName="transform" type="translate" values="0 0;0 0;${o(p)};${o(p)};0 0;0 0" keyTimes="0;0.16;0.28;0.5;0.62;1" calcMode="spline" keySplines="0 0 1 1;0.4 0 0.2 1;0 0 1 1;0.4 0 0.2 1;0 0 1 1" dur="3.6s" repeatCount="indefinite"/>`:"";return`<g${a==="open"?` transform="translate(${o(p)})"`:""}>${S(l,t+.28,.7,.9,.12,2.5,`door ${s}`)}${u}</g>`};return{id:e,label:s==="github"?"GitHub sign-in gateway":"Google sign-in gateway",state:r,svg:`<g class="brand-${s}" style="--brand:${s==="github"?"#f0f6fc":"#4285F4"}">${Z(n,t,3,.8,.7)}${S(n,t,.7,.6,.7,2.6,"pillar")}${d(-.82,n+.6)}${d(.82,n+1.5)}${S(n+2.4,t,.7,.6,.7,2.6,"pillar")}${S(n-.02,t-.02,3.3,.64,.74,.16,`cap ${c[0]}`)}${S(n+2.38,t-.02,3.3,.64,.74,.16,`cap ${c[1]}`)}${S(n-.1,t-.05,3.46,3.2,.8,.6,"lintel")}${Xt(`gate-${s}`,q(s),n+.85,t+.5,4.06,1.5)}</g>`}}function xi(e,n,t,r){return{id:e,label:"Access rule",state:r,svg:`${S(n,t,.7,.35,1.8,1.1,"bar")}<g transform="${j("side",n+.35,t,1.8)}"><path class="bar-stripes" d="M0.2 0.2 L0.6 0.9 M0.7 0.2 L1.1 0.9 M1.2 0.2 L1.6 0.9"/></g>`}}function Si(e,n,t,r,s,a,c,o){let d=ie(e,n,t,r,s,a,c,o),p=2.2,l=n+(r-p)/2,u=t+(s-p)/2-.3,h=b(l+p/2,u+p/2,.7+2.4),f=U([b(l,u+p,.7),b(l+p,u+p,.7),h]),g=U([b(l+p,u,.7),b(l+p,u+p,.7),h]),w=`<g class="pyramid">${Z(l,u,p,p,.7)}<polygon class="f-left" points="${f}"/><polygon class="f-right" points="${g}"/><polyline class="edge" points="${U([b(l,u+p,.7),h,b(l+p,u,.7)])}"/></g>`;return{...d,svg:`<g class="pad brand-vercel" style="--brand:#f5f5f7">${d.svg}${w}</g>`}}function Ai(e,n,t,r){return{id:e,label:"GitHub repository",state:r,svg:`<g class="brand-github" style="--brand:#f0f6fc">${Z(n,t,2.1,1.7,.7)}${S(n,t,.7,2.1,1.7,1.5,"vault")}<g transform="${j("top",n,t,2.2)}"><rect class="unit-plate" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><rect class="unit-ring" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><image href="${J.github}" x="0.6" y="0.5" width="0.7" height="0.7"/></g><g transform="${j("front",n,t+1.7,2.2)}"><g class="gitgraph"><path d="M0.25 0.55 H1.85"/><path class="branch" d="M0.65 0.55 C0.9 0.55 0.9 1.05 1.15 1.05 H1.55"/><circle cx="0.35" cy="0.55" r="0.09"/><circle cx="0.8" cy="0.55" r="0.09"/><circle cx="1.3" cy="0.55" r="0.09"/><circle class="tip" cx="1.8" cy="0.55" r="0.1"/><circle class="branch-dot" cx="1.5" cy="1.05" r="0.09"/></g></g></g>`}}function Kt(e,n,t,r=.066){let a=(o,d,p,l,u)=>S(e+o*r,n,t+(20-l)*r,(d-o)*r,.55,(l-p)*r,u),c=`<g transform="${j("front",e+3*r,n+.55,t+15*r)}"><rect class="cc-eye" x="${m(3*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/><rect class="cc-eye" x="${m(13.510000000000002*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/></g>`;return`<g class="critter"><g class="cc-legs a">${a(4.49,6,17,20,"cc cc-leg")}${a(15,16.51,17,20,"cc cc-leg")}</g><g class="cc-legs b">${a(7.49,9,17,20,"cc cc-leg")}${a(18,19.51,17,20,"cc cc-leg")}</g><g class="cc-torso">${a(0,3,10.95,14.05,"cc")}${a(3,21,5,17,"cc")}${a(21,24,10.95,14.05,"cc")}${c}</g></g>`}function Ci(e,n=7,t=1.3){let r=[];for(let s=0;s<n;s+=1){let a=e[0]-150+s*46,c=e[1]-190-s%3*18,o=`M${m(a)} ${m(c)} Q${m((a+e[0])/2+(s%2?40:-30))} ${m(c+30)} ${m(e[0])} ${m(e[1])}`;r.push(`<g class="tok"><rect x="-4" y="-4" width="8" height="8" rx="2"/><animateMotion dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite" path="${o}"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.85;1" dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite"/></g>`)}return`<g class="hype tokens">${r.join("")}</g>`}function _t(e,n,t){return[(e-n)*le*C,(e+n)*ce*C-t*C]}function We(e,n){let t=e.replace("#",""),r=t.length===3?t.split("").map(c=>c+c).join(""):t;return`rgb(${[0,2,4].map(c=>parseInt(r.slice(c,c+2),16)).map(c=>n<=1?Math.round(c*n):Math.round(c+(255-c)*(n-1))).join(",")})`}function V(e,n,t,r,s=""){let a=(h,f,g)=>_t(h-e/2,f-n/2,g),c=[a(0,0,t),a(e,0,t),a(e,n,t),a(0,n,t)],o=[a(0,n,t),a(e,n,t),a(e,n,0),a(0,n,0)],d=[a(e,0,t),a(e,n,t),a(e,n,0),a(e,0,0)],[p,l]=a(0,0,t),u=s?`<g transform="matrix(${m(le*C)} ${m(ce*C)} ${m(-le*C)} ${m(ce*C)} ${m(p)} ${m(l)})">${s}</g>`:"";return`<polygon points="${U(o)}" fill="${We(r,.72)}"/><polygon points="${U(d)}" fill="${We(r,.52)}"/><polygon points="${U(c)}" fill="${We(r,1.12)}"/>${u}<polyline points="${U([a(0,n,t),a(e,n,t),a(e,0,t)])}" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8"/>`}function $i(e,n,t=0){switch(e){case"card":return V(.95,.62,.09,"#635BFF",'<rect x="0.06" y="0.14" width="0.83" height="0.09" fill="rgba(255,255,255,0.75)"/><rect x="0.12" y="0.34" width="0.18" height="0.14" rx="0.03" fill="#f2c15f"/>');case"envelope":return V(.95,.62,.1,"#f2f2f5",'<path d="M0.05 0.05 L0.475 0.36 L0.9 0.05" fill="none" stroke="#9b9ba5" stroke-width="0.04"/>');case"app":return V(.72,.72,.5,"#2c2c34",'<rect x="0.08" y="0.08" width="0.56" height="0.56" rx="0.06" fill="#0e0e12"/><circle cx="0.16" cy="0.16" r="0.03" fill="#f4715f"/><circle cx="0.24" cy="0.16" r="0.03" fill="#f2c15f"/><rect x="0.14" y="0.28" width="0.44" height="0.08" rx="0.03" fill="rgba(255,255,255,0.35)"/>');case"user":return V(.46,.46,.46,"#f5f5f7",'<circle cx="0.23" cy="0.18" r="0.07" fill="#55555f"/><path d="M0.1 0.38 Q0.23 0.22 0.36 0.38" fill="#55555f"/>');case"commit":return V(.44,.44,.44,"#3fb950",'<circle cx="0.22" cy="0.22" r="0.08" fill="none" stroke="#0d1117" stroke-width="0.05"/>');case"event":return V(.42,.42,.42,["#F54E00","#F9BD2B","#1D4AFF"][t%3]);case"record":return V(.5,.5,.36,n,'<rect x="0.08" y="0.12" width="0.34" height="0.06" fill="rgba(255,255,255,0.55)"/><rect x="0.08" y="0.26" width="0.24" height="0.06" fill="rgba(255,255,255,0.35)"/>');default:return V(.48,.48,.48,n)}}function Ne(e,n,t,r={}){let s=r.count??2,a=r.dur??3.2,c=r.travel??.55,o=[];for(let d=0;d<s;d+=1){let p=`${m(-d*(a/s))}s`;o.push(`<g class="pl"><g>${$i(n,t,d)}</g><animateMotion dur="${a}s" begin="${p}" repeatCount="indefinite" path="${e}" keyPoints="0;1;1" keyTimes="0;${c};1" calcMode="spline" keySplines="0.45 0 0.25 1;0 0 1 1"/><animate attributeName="opacity" values="0;1;1;0;0" keyTimes="0;0.06;${m(c-.03)};${c};1" dur="${a}s" begin="${p}" repeatCount="indefinite"/></g>`),r.landing&&o.push(r.landing(p))}return`<g class="hype">${o.join("")}</g>`}function Le(e,n,t,r,s,a=34){let c=Math.min(r+.22,.99);return`<ellipse cx="${m(e[0])}" cy="${m(e[1])}" rx="${a*.4}" ry="${m(a*.4*.42)}" fill="none" stroke="${s}" stroke-width="2" opacity="0"><animate attributeName="rx" values="${a*.4};${a*.4};${a};${a}" keyTimes="0;${r};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="ry" values="${m(a*.4*.42)};${m(a*.4*.42)};${m(a*.42)};${m(a*.42)}" keyTimes="0;${r};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="opacity" values="0;0;0.9;0;0" keyTimes="0;${r};${m(r+.02)};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/></ellipse>`}function Xt(e,n,t,r,s,a,c=.28,o=10){let d=[];for(let u=o-1;u>=0;u-=1){let h=c*u/(o-1);d.push(`<g transform="${j("front",t,r-h,s+a)}"><image class="${u===0?"emb-face":"emb-side"}" href="${n}" x="0" y="0" width="${a}" height="${a}"/></g>`)}let p=`emb-${e.replace(/[^a-z0-9-]/gi,"")}`,l=`<g transform="${j("front",t,r,s+a)}"><mask id="${p}" maskUnits="userSpaceOnUse" x="-1" y="-1" width="${a+2}" height="${a+2}" style="mask-type:alpha"><image href="${n}" x="0" y="0" width="${a}" height="${a}"/></mask><g mask="url(#${p})"><rect class="emb-sheen" x="${m(-a*.6)}" y="0" width="${m(a*.45)}" height="${a}"><animateTransform attributeName="transform" type="translate" values="0 0;${m(a*1.9)} 0;${m(a*1.9)} 0" keyTimes="0;0.3;1" dur="4.8s" repeatCount="indefinite"/></rect></g></g>`;return`<g class="emblem">${d.join("")}${l}</g>`}function Jt(e,n,t,r,s,a,c,o=1.5){let d=o+.5,p=`${Z(r,s,d,1.25,.7)}${S(r,s,.7,d,1.25,.34,"plinth")}<g transform="${j("front",r,s+1.25,1.04)}"><rect class="unit-led" x="${m(d*.15)}" y="0.13" width="${m(d*.7)}" height="0.09" rx="0.045"/></g>`;return{id:e,label:n,state:t,svg:`<g class="unit-wrap emblem-unit" style="--brand:${c}">${p}<g class="emb-float">${Xt(e,a,r+.25,s+.8,1.06,o)}</g></g>`}}var he={supabase:{name:"Supabase",brand:"#3ECF8E",payload:"record",verb:"Records reach the database"},vercel:{name:"Vercel",brand:"#f5f5f7",payload:"app",verb:"The app reaches Vercel"},github:{name:"GitHub",brand:"#f0f6fc",payload:"commit",verb:"Commits reach the repository"},stripe:{name:"Stripe",brand:"#635BFF",payload:"card",verb:"A test payment reaches Stripe"},sentry:{name:"Sentry",brand:"#8B5CF6",payload:"event",verb:"A test error reaches Sentry"},posthog:{name:"PostHog",brand:"#F54E00",payload:"event",verb:"Events reach PostHog"},clerk:{name:"Clerk",brand:"#6C47FF",payload:"user",verb:"A test user signs in with Clerk"},authjs:{name:"Auth.js",brand:"#a855f7",payload:"user",verb:"A test user signs in"},resend:{name:"Resend",brand:"#f5f5f7",payload:"envelope",verb:"A test email reaches Resend"},upstash:{name:"Upstash",brand:"#00E9A3",payload:"record",verb:"Keys reach Redis"},neon:{name:"Neon",brand:"#00E599",payload:"record",verb:"Rows reach Postgres"},railway:{name:"Railway",brand:"#f5f5f7",payload:"app",verb:"The app reaches Railway"},render:{name:"Render",brand:"#f5f5f7",payload:"app",verb:"The app reaches Render"},cloudflare:{name:"Cloudflare",brand:"#F38020",payload:"cube",verb:"Traffic reaches the edge"},google:{name:"Google",brand:"#4285F4",payload:"user",verb:"A test user signs in with Google"}};function q(e){return e==="google"?pi:J[e]??oe.check}function Ze(e){return e.map(n=>n.toFixed(3)).join(";")}function N(e,n,t,r){return e.startsWith("transform-")?`<animateTransform attributeName="transform" type="${e.slice(10)}" values="${n.join(";")}" keyTimes="${Ze(t)}" dur="${r}s" repeatCount="indefinite"/>`:`<animate attributeName="${e}" values="${n.join(";")}" keyTimes="${Ze(t)}" dur="${r}s" repeatCount="indefinite"/>`}function qe(e,n,t,r,s){return`<g transform="translate(${m(e[0])} ${m(e[1])})"><g>${N("transform-scale",n.map(a=>`${a} ${a}`),t,r)}<g transform="translate(${m(-e[0])} ${m(-e[1])})">${s}</g></g></g>`}function ae(e,n){return`${m(n[0]-e[0])} ${m(n[1]-e[1])}`}function Me(e,n,t,r=7){let s=`M0 ${-r} L${r*.25} ${-r*.25} L${r} 0 L${r*.25} ${r*.25} L0 ${r} L${-r*.25} ${r*.25} L${-r} 0 L${-r*.25} ${-r*.25} Z`,a=Math.max(.001,n-.02),c=Math.min(.998,n+.08);return`<g transform="translate(${m(e[0])} ${m(e[1])})"><path class="sparkle" d="${s}" opacity="0">${N("opacity",["0","0","1","0","0"],[0,a,n,c,1],t)}</path></g>`}function en(e,n,t,r){let s=Array.from({length:5},(o,d)=>`<g class="oc-tent t${d%2}">${S(e+.06+d*.25,n+.5,t,.19,.34,.44,"oc")}${S(e+.06+d*.25,n+.84,t,.19,.14,.12,"oc")}</g>`).join(""),a=`<g transform="${j("front",e,n+1.3,t+1.44)}"><rect class="oc-face" x="0.12" y="0.14" width="1.06" height="0.74" rx="0.12"/><rect class="oc-eye" x="0.3" y="0.32" width="0.18" height="0.26"/><rect class="oc-eye" x="0.82" y="0.32" width="0.18" height="0.26"/><rect class="oc-shine" x="0.36" y="0.35" width="0.06" height="0.07"/><rect class="oc-shine" x="0.88" y="0.35" width="0.06" height="0.07"/><rect class="oc-mouth" x="0.6" y="0.68" width="0.1" height="0.04"/></g>`,c=b(e+1.4,n+.78,t+1.05);return`<g class="octocat">${s}${S(e-.2,n+.66,t+.6,.2,.24,.46,"oc")}${S(e,n+.3,t+.44,1.3,1,1,"oc")}${S(e+.04,n+.45,t+1.44,.3,.3,.28,"oc")}${S(e+.96,n+.45,t+1.44,.3,.3,.28,"oc")}${a}${r(S(e+1.3,n+.66,t+.6,.2,.24,.46,"oc"),c)}</g>`}function tn(e,n,t,r,s=7,a=1.3){let c=b(e+.65,n+.8,t),o=b(e+.65,n+.8,t+1.1+1.3*a),d=b(e-1.6,n+.4,t+3.2),p=b(e+2.9,n+1.2,t+3),l=b(e+.65+.95*a,n+.8,t+1.5*a),u=[(l[0]+r[0])/2,Math.min(l[1],r[1])-70],h=(y,k)=>`<g>${N("transform-rotate",["0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"-70 "+m(k[0])+" "+m(k[1]),"45 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1])],[0,.44,.5,.54,.6,1],s)}${y}</g>`,f=`<g>${N("transform-translate",["0 0","0 0","0 -9","0 0","0 -6","0 0","0 0"],[0,.62,.66,.7,.73,.76,1],s)}${en(e,n,t,h)}</g>`,g=qe(c,[0,0,1.15*a,a,a,0,0],[0,.02,.08,.11,.8,.86,1],s,f),w=(y,k)=>`<g transform="translate(${m(y[0])} ${m(y[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.12,.14,.355,.37,1],s)}${N("transform-translate",["0 0","0 0",ae(y,o),ae(y,o)],[0,.12,.36,1],s)}${V(.42,.42,.42,k,'<circle cx="0.21" cy="0.21" r="0.08" fill="none" stroke="rgba(0,0,0,0.55)" stroke-width="0.05"/>')}</g></g>`,v=`<g transform="translate(${m(o[0])} ${m(o[1]-6)})"><circle class="burst" r="2" opacity="0">${N("opacity",["0","0","1","0","0"],[0,.355,.365,.43,1],s)}<animate attributeName="r" values="2;2;26;26" keyTimes="${Ze([0,.355,.43,1])}" dur="${s}s" repeatCount="indefinite"/></circle></g>`,L=`<g transform="translate(${m(o[0])} ${m(o[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.365,.38,.655,.67,1],s)}${N("transform-translate",["0 0","0 0",ae(o,l),ae(o,l),ae(o,u),ae(o,r),ae(o,r)],[0,.44,.5,.53,.595,.66,1],s)}${qe([0,0],[0,0,1.25,1,1],[0,.365,.4,.43,1],s,V(.5,.5,.5,"#8957e5",'<path d="M0.12 0.12 L0.12 0.38 M0.12 0.18 Q0.25 0.3 0.38 0.38" fill="none" stroke="#fff" stroke-width="0.05" stroke-linecap="round"/><circle cx="0.12" cy="0.12" r="0.05" fill="#fff"/><circle cx="0.38" cy="0.38" r="0.05" fill="#fff"/>'))}</g></g>`,$=`<g transform="translate(${m(o[0])} ${m(o[1]-34)})" opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.38,.4,.5,.52,1],s)}<rect class="say" x="-30" y="-10" width="60" height="20" rx="10"/><text class="say-text" x="0" y="4" text-anchor="middle">merged!</text></g>`;return`<g class="hype skit">${g}${w(d,"#3fb950")}${w(p,"#2f81f7")}${v}${L}${$}</g>`}function Ii(e,n,t,r=7.2){let s=b(e+.65,n+.8,t),a=(o,d)=>{let p=l=>`${l} ${m(d[0])} ${m(d[1])}`;return`<g>${N("transform-rotate",[p(0),p(0),p(-80),p(-40),p(-80),p(-40),p(-80),p(0),p(0),p(-110),p(0),p(0)],[0,.08,.11,.14,.17,.2,.23,.27,.58,.61,.66,1],r)}${o}</g>`},c=`<g>${N("transform-translate",["0 0","0 0","0 -12","0 0","0 -8","0 0","0 0"],[0,.58,.61,.64,.67,.7,1],r)}${en(e,n,t,a)}</g>`;return`<g class="hype skit">${qe(s,[0,0,1.12,1,1,0,0],[0,.02,.06,.08,.84,.9,1],r,c)}</g>`}function ji(e,n,t,r){let s=[];for(let h=0;h<5;h+=1)s.push(S(e-.04+h*.25,n+.04,t+2.25,.2,.3,.2+h%2*.18,"mx-spike"));for(let h=0;h<4;h+=1)s.push(S(e+1.16,n+.06,t+.45+h*.42,.2+h%2*.1,.3,.2,"mx-spike")),s.push(S(e-.3-h%2*.08,n+.06,t+.6+h*.42,.24+h%2*.08,.3,.2,"mx-spike"));let a=`${S(e-.08,n,t+.3,1.26,.42,1.95,"mx-spike")}${s.join("")}`,c=`${S(e+.16,n+.45,t,.3,.34,.32,"mx-leg")}${S(e+.64,n+.45,t,.3,.34,.32,"mx-leg")}`,o=`${S(e+.05,n+.35,t+.3,1,.62,.86,"mx-body")}<g transform="${j("front",e+.05,n+.97,t+1.16)}"><rect class="mx-belly" x="0.2" y="0.1" width="0.6" height="0.66" rx="0.22"/></g>`,d=`<g transform="${j("front",e,n+1.05,t+1.95)}"><rect class="mx-eye" x="0.2" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-eye" x="0.7" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-brow" x="0.17" y="0.19" width="0.26" height="0.05"/><rect class="mx-brow" x="0.67" y="0.19" width="0.26" height="0.05"/></g>`,p=`${S(e,n+.3,t+1.15,1.1,.75,.8,"mx-face")}${d}${S(e+.3,n+1.05,t+1.2,.5,.34,.36,"mx-snout")}${S(e+.46,n+1.39,t+1.38,.18,.08,.15,"mx-nose")}`,l=`${S(e-.06,n+.24,t+1.95,1.22,.92,.06,"mx-hat")}${S(e+.14,n+.38,t+2.01,.82,.62,.3,"mx-hat")}${S(e+.49,n+.38,t+2.31,.12,.62,.05,"mx-hat-ridge")}`,u=b(e+1.14,n+.63,t+1.12);return`<g class="hog">${a}${c}${S(e-.13,n+.5,t+.62,.18,.26,.52,"mx-body")}${o}${p}${l}${r(S(e+1.05,n+.5,t+.62,.18,.26,.52,"mx-body"),u)}</g>`}function nn(e,n,t=8){let s=($,y)=>{let k=E=>`${E} ${m(y[0])} ${m(y[1])}`;return`<g>${N("transform-rotate",[k(0),k(0),k(-150),k(-150),k(-10),k(-10),k(-160),k(-110),k(-160),k(-110),k(0),k(0)],[0,.18,.22,.3,.34,.45,.48,.52,.56,.6,.64,1],t)}${$}</g>`},a=`<g>${N("transform-translate",["0 0","0 0","0 3","0 0","0 0","0 -16","0 0","0 -12","0 0","0 0"],[0,.3,.33,.37,.48,.52,.56,.6,.64,1],t)}${ji(e,n,.7,s)}</g>`,c=qe(b(e+.55,n+.7,.7),[0,0,1.12,1,1,0,0],[0,.02,.08,.11,.78,.84,1],t,a),o=e+1.75,d=n+.7,p=`0 ${m(-1.6*C)}`,l=$=>["#55555f","#55555f","#F54E00","#F54E00","#55555f","#55555f"].map(y=>y==="#55555f"?y:We(y,$)).join(";"),u=($,y)=>`<polygon class="mx-flag" points="${U($)}"><animate attributeName="fill" values="${l(y)}" keyTimes="${Ze([0,.32,.42,.86,.9,1])}" dur="${t}s" repeatCount="indefinite"/></polygon>`,h=.7+.3,f=[b(o+.1,d+.06,h+.45),b(o+.85,d+.06,h+.45),b(o+.85,d+.06,h),b(o+.1,d+.06,h)],g=[b(o+.1,d,h+.45),b(o+.85,d,h+.45),b(o+.85,d+.06,h+.45),b(o+.1,d+.06,h+.45)],w=`<g>${N("transform-translate",["0 0","0 0",p,p,"0 0","0 0"],[0,.32,.42,.86,.94,1],t)}${u(f,1)}${u(g,1.2)}<g transform="${j("front",o+.1,d+.06,h+.45)}"><text class="flag-text" x="0.38" y="0.31" text-anchor="middle" opacity="0">ON${N("opacity",["0","0","1","1","0","0"],[0,.42,.45,.84,.86,1],t)}</text></g></g>`,v=`${Z(o,d,.12,.12,.7)}${S(o,d,.7,.1,.1,2.55,"mx-pole")}${S(o-.08,d-.08,.7,.26,.26,.08,"mx-pole")}${S(o-.03,d-.03,3.25,.16,.16,.08,"mx-pole")}`,L=[Me(b(o+.6,d,3.4),.43,t),Me(b(o+1,d,2.9),.46,t,5),Me(b(o+.2,d,3.6),.49,t,5)].join("");return`<g class="hype skit">${c}${v}${w}${L}</g>`}function Ti(e,n=7){let t=b(...e),r=b(e[0]+1.75,e[1]+.3,e[2]+1.2),s=b(3,2,.7),a=b(6.8,2,.7),c=(A,I)=>`${m((A[0]+I[0])/2-t[0])} ${m(Math.min(A[1],I[1])-40-t[1])}`,o=A=>ae(t,A),d=["0 0","0 0",c(t,s),o(s),o(a),o(s),o(a),c(a,t),"0 0","0 -10","0 0","0 0"],p=[0,.08,.14,.2,.36,.5,.64,.72,.8,.84,.88,1],l=["0 0","5 -3","0 -7","-5 -3"],u=["0 0"],h=[0];for(let A=0;.2+A*.022<=.64;A+=1)u.push(l[A%4]),h.push(Number((.2+A*.022).toFixed(3)));u.push("0 0"),h.push(1);let f=[[-6,0],[4,-.27],[10,-.54],[-2,-.81]].map(([A,I],H)=>`<circle class="bubble" cx="${m(r[0]+A)}" cy="${m(r[1]-6)}" r="${2.2+H%2*1.4}"><animate attributeName="cy" values="${m(r[1]-6)};${m(r[1]-34)}" dur="1.08s" begin="${I}s" repeatCount="indefinite"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.7;1" dur="1.08s" begin="${I}s" repeatCount="indefinite"/></circle>`).join(""),g=A=>`<g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.19,.2,.64,.65,1],n)}${A}</g>`,w=`<g>${N("transform-translate",u,h,n)}${g(`<g transform="translate(${m(r[0])} ${m(r[1])})">${V(.56,.3,.32,"#f2c15f",'<circle cx="0.14" cy="0.1" r="0.035" fill="#c99528"/><circle cx="0.32" cy="0.2" r="0.03" fill="#c99528"/><circle cx="0.44" cy="0.08" r="0.03" fill="#c99528"/>')}<ellipse class="foam" cx="-2" cy="-9" rx="9" ry="4"/></g>`)}</g>`,v=`<g>${N("transform-translate",d,p,n)}<g class="critter is-busy">${Kt(...e).replace('<g class="critter">',"<g>")}</g>${g(f)}${w}</g>`,L=A=>.2+(A-2.07)/3.8*.16,$=[[2.4,3.9],[3.2,3.6],[4.1,4.1],[4.9,3.7],[5.7,4]],y=$.map(([A,I])=>{let H=L(A);return`<g class="smudge">${N("opacity",["1","1","0","0","1","1"],[0,H,H+.03,.9,.98,1],n)}<ellipse cx="${A}" cy="${I}" rx="0.42" ry="0.24"/><ellipse cx="${m(A+.3)}" cy="${m(I-.16)}" rx="0.2" ry="0.13"/><path class="streak" d="M${m(A-.4)} ${m(I+.2)} q0.3 -0.25 0.75 -0.1"/></g>`}).join(""),k=[...$.map(([A,I])=>Me(b(2+A,1.62,5.3-I+.2),L(A)+.02,n,9)),Me(b(4.4,1.62,3.9),.7,n,10),Me(b(7.6,1.62,3.2),.74,n,8)].join("");return`<g class="hype skit">${`<g transform="${j("front",2,1.62,5.3)}"><clipPath id="polish-clip"><rect width="7" height="4.6" rx="0.18"/></clipPath><g clip-path="url(#polish-clip)">${y}<g transform="skewX(-22)"><rect x="-1.6" y="-0.5" width="1.3" height="5.6" fill="url(#sc-sheen)" opacity="0">${N("transform-translate",["0 0","0 0","11 0","11 0"],[0,.66,.8,1],n)}${N("opacity",["0","0","0.9","0.9","0","0"],[0,.655,.67,.79,.8,1],n)}</rect></g></g></g>`}${k}${v}</g>`}var Ni=()=>typeof matchMedia!="function"||!matchMedia("(prefers-reduced-motion: reduce)").matches;function fe(e,n,t=7){let r=[];if(!e.length){let s=n==="active"?" sketch":"",a=(t-1.1)/2;return r.push(`<rect class="ghost-panel${s}" x="0.4" y="1" width="${t-.8}" height="0.85" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="0.4" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="${.7+a}" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.join("")}return e.slice(0,3).forEach((s,a)=>{let c=1+a*1.05,o=s.path.split("/").pop()??s.path;r.push(`<g class="panel-in" style="animation-delay:${a*90}ms"><rect class="panel ${s.kind}" x="0.4" y="${c}" width="${t-.8}" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="${c+.22}" width="${Math.min(t-2,1.2+o.length*.16)}" height="0.12" rx="0.06"/><text class="panel-name" x="0.65" y="${c+.66}">${ut(o)}</text></g>`)}),e.length>3&&r.push(`<text class="panel-name more" x="0.65" y="${1+3*1.05+.4}">+${e.length-3} more</text>`),r.join("")}function Di(e){return e==="passed"?"done":e==="failed"?"failed":e==="active"?"active":e==="not_run"?"idle":"planned"}var Ei=[[8.2,7.6],[9.9,6.5],[11.5,5.3]];function ue(e,n=Ei){return e.checks.slice(0,n.length).map((t,r)=>ki(`check:${t.id}`,n[r][0],n[r][1],Di(t.status),t.label))}function me(e,n,t,r,s=2,a=7){return gi("window",s,1.3,a,4.6,n,t,r)}function rn(e){return[G("pipe-live",Te([[9.15,1.85,.72],[10.9,1.85,.72],[10.9,2.7,.72]]),e["pipe-live"]??"planned","To the live preview"),Mi("port",10.4,2.7,e.port??"planned")]}function Pi(e,n){let t=e.parts,r=e.agent?B[e.agent.id]:B.claude,s=!e.agent||e.agent.id==="claude",a=de([2.6,4.8,5],[5.2,1.62,3.4],.5),c=s&&n&&e.phase==="done"&&t.agent==="done",o=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned"),"Your app (workflow view)"),...rn(t),G("beam",a,t.beam??"planned","Agent at work"),...ue(e),bi("agent",1.4,4.2,3.8,t.agent??"planned",r,e.agent?.label??"Coding agent",wi[e.agent?.id??"claude"],s,c)],d=[];return t.beam==="active"&&n&&(d.push(Ve(a,"spark",.55,!0,!0)),s&&d.push(Ci(b(2.45,4.75,5.05),8,.9))),c&&d.push(Ti([1.5,4.75,4.35])),{parts:o,fx:d,viewBox:""}}function Oi(e,n,t,r,s){let a=[.5,.9,1.3,1.7].map(c=>`<rect class="vent" x="0.25" y="${c}" width="1" height="0.14" rx="0.07"/>`).join("");return{id:e,label:s?`${s} dev server`:"Dev server",state:r,svg:`<g class="unit-wrap" style="--brand:rgba(255,255,255,0.4)">${Z(n,t,1.5,1.5,.7)}${S(n,t,.7,1.5,1.5,2.6,"tower")}<g transform="${j("top",n,t,3.3)}"><rect class="unit-plate" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><rect class="unit-ring" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><image href="${yi(s)}" x="0.42" y="0.42" width="0.66" height="0.66"/></g><g transform="${j("front",n,t+1.5,3.3)}">${a}<rect class="tower-led" x="0.25" y="2.2" width="0.5" height="0.16" rx="0.08"/></g></g>`}}function Ri(e,n,t,r,s){return{id:e,label:"Run command",state:r,svg:`${_e({x:n,y:t,size:1.5,h:.75,mark:hi,brand:"#CB3837",grounded:!0})}${Ke(n+.75,t+.75,2.55,s,"tag-cmd")}`}}function Ui(e,n){let t=e.parts,s=t.window==="waiting"?'<g class="key-sign"><circle cx="3.5" cy="2.5" r="0.85"/><path d="M3.1 2.5 h0.9 m-0.3 0 v0.35 m-0.25 -0.35 v0.25"/></g>':t.window==="done"?'<g class="panel-in"><rect class="panel modified" x="0.4" y="1" width="6.2" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="1.3" width="3" height="0.12" rx="0.06"/></g><g class="panel-in" style="animation-delay:90ms"><rect class="panel" x="0.4" y="2.1" width="2.95" height="1.9" rx="0.12"/><rect class="panel" x="3.65" y="2.1" width="2.95" height="1.9" rx="0.12"/></g>':fe([],t.window??"planned"),a=de([4,6,3.4],[4.6,1.62,3.3],.6),c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",s,"Your app (workflow view)"),...rn(t),G("pipe-power",Te([[2.3,7.6,.72],[3.9,7.6,.72],[3.9,6.9,.72]]),t["pipe-power"]??"planned","Runs"),Oi("server",3.2,5.2,t.server??"planned",e.framework),G("pipe-serve",a,t["pipe-serve"]??"planned","Serves the page"),Ri("command",.7,7,t.command??"planned",e.caption.match(/(?:npm|pnpm|yarn|bun) run \w+/)?.[0]??"npm run dev"),...ue(e,[[9.6,6.6]])],o=[];return t["pipe-serve"]==="active"&&n&&o.push(Ve(a,"spark",1.6,!0,!0)),{parts:c,fx:o,viewBox:""}}function Fi(e,n){let t=e.parts,r=e.provider==="github"?"github":"google",s=de([11.6,1.9,2.6],[9.9,4.7,2.2],1),a=de([9.9,4.7,2.2],[5.4,1.62,3.2],.6),c=`${s} ${a.replace(/^M[^Q]+/,"")}`,o=t["pipe-app"]==="active"||t.gateway==="active",d=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),pt("auth",11.6,1.9,t.auth??"planned",t.auth==="planned"?0:2,0,J.supabase),G("pipe-provider",s,t["pipe-provider"]??"planned",`${r==="github"?"GitHub":"Google"} to gateway`),G("pipe-app",a,t["pipe-app"]??"planned","Gateway to app"),Li("gateway",8.4,4.4,t.gateway??"planned",r,o&&n?"cycle":t["pipe-app"]==="done"||t.gateway==="done"?"open":"closed"),...ue(e,[[4.2,7.9],[7.4,7.3]])],p=[];return o&&n&&r==="github"&&p.push(Ii(10.9,5,.7)),o&&n&&p.push(Ne(c,"user","#f5f5f7",{count:1,dur:3.6,travel:.7,landing:l=>Le(b(5.4,1.62,3.2),l,3.6,.7,"rgba(245,245,247,0.8)",30)})),{parts:d,fx:p,viewBox:""}}function zi(e,n){let t=e.parts,r=t.db==="planned"?0:t.db==="active"?2:3,s=t.schema==="done"?4:t.schema==="active"?2:0,a=de([5.6,1.62,3],[10.6,5.2,.7+Math.max(r,1)*.95],1.2),c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),G("pipe-db",a,t["pipe-db"]??"planned","App to database"),pt("db",10.6,5.2,t.db??"planned",r,s,J.supabase),...ue(e,[[2.4,7.4],[5.6,7.9]])],o=[];if((t.db==="active"||t["pipe-db"]==="active")&&n){let d=.7+Math.max(r,1)*.95,p=l=>`${Le(b(10.6,5.2,d),l,3.4,.55,"rgba(62,207,142,0.9)",44)}${Hi(10.6,5.2,r,l,3.4,.55)}`;o.push(Ne(a,"record","#3ECF8E",{count:2,dur:3.4,travel:.55,landing:p}))}return{parts:c,fx:o,viewBox:""}}function Hi(e,n,t,r,s,a){let c=1.55*C*1.2247,o=1.55*C*.7071;return Array.from({length:Math.max(t,1)},(d,p)=>{let l=Math.max(t,1)-1-p,[u,h]=b(e,n,.7+l*.95+.75),f=Math.min(a+.03+p*.06,.9);return`<path d="M${m(u-c)} ${m(h+.18*C)} A${m(c)} ${m(o)} 0 0 0 ${m(u+c)} ${m(h+.18*C)}" fill="none" stroke="#7dffc4" stroke-width="2.4" stroke-linecap="round" opacity="0"><animate attributeName="opacity" values="0;0;1;0;0" keyTimes="0;${m(f)};${m(f+.04)};${m(Math.min(f+.2,.98))};1" dur="${s}s" begin="${r}" repeatCount="indefinite"/></path>`}).join("")}function Zt(e,n,t,r,s){return{id:e,label:r,state:s,svg:`${Z(n,t,.9,.9,.7)}${S(n,t,.7,.9,.9,.9,"post")}${Ke(n+.45,t+.45,2.3,r)}`}}function Bi(e,n){let t=e.parts,r=Te([[1.6,7.6,.75],[9.4,7.6,.75],[9.4,6.2,.75]]),s=Te([[1.6,3,.75],[9.4,3,.75],[9.4,4.4,.75]]),a=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),G("path-other",s,t["path-other"]??"planned","Others cannot read"),G("path-owner",r,t["path-owner"]??"planned","Owner can read"),Zt("other",.6,2.5,"Other user","done"),xi("rule",5.4,2.2,t.rule??"planned"),pt("db",10.8,5.3,t.db??"done",3,4,J.supabase),Zt("owner",.6,7.1,"Owner","done"),...ue(e,[[4.4,9.1],[7.4,.6]])],c=[];return(t["path-owner"]==="active"||t["path-owner"]==="done")&&c.push(Ve(r,"user",2.4,t["path-owner"]==="active",n)),(t["path-other"]==="active"||t["path-other"]==="done"||t["path-other"]==="failed")&&c.push(Ve(s,t["path-other"]==="failed"?"leak":"blocked",2.4,t["path-other"]==="active",n,t["path-other"]==="failed"?void 0:.42)),{parts:a,fx:c,viewBox:""}}function Yi(e,n){let t=e.parts,r=Te([[6.6,1.9,.72],[7.4,1.9,.72],[7.4,4.6,.72]]),s=de([7.5,5.4,2.3],[15.3,-1.3,.75],2.6),a=[ie("platform",0,0,10,8,"This computer",t.platform??"done"),Si("preview",12.6,-3.6,5.4,4.6,"Preview",t.preview??"planned",J.vercel),me(e,t.window??"done",fe([{path:"app",kind:"modified"}],"done",5.4),"Your app (demo)",1,5.4),G("push",r,t.build==="planned"?"planned":"done","Push"),Ai("build",6.4,4.6,t.build??"planned"),G("flight",s,t.flight??"planned","Build and upload"),...ue(e,[[17.2,-2.9]])],c=[];return t.build==="active"&&n&&c.push(Ne(r,"commit","#3fb950",{count:2,dur:2.8,travel:.6})),(t.flight==="active"||t.preview==="active")&&n&&(c.push(tn(6.8,4.5,2.2,b(15.3,-.6,.9),7)),c.push(`<g class="hype">${Gi(12.6,-3.6,5.4,4.6,"0s",7,.66)}${Le(b(15.3,-1.3,.7),"0s",7,.67,"rgba(245,245,247,0.85)",52)}</g>`)),{parts:a,fx:c,viewBox:""}}function Gi(e,n,t,r,s,a,c){let d=e+(t-2.2)/2,p=n+(r-2.2)/2-.3,l=b(d+2.2/2,p+2.2/2,.7+2.4),u=[b(d,p+2.2,.7),b(d+2.2,p+2.2,.7),l],h=[b(d+2.2,p,.7),b(d+2.2,p+2.2,.7),l],f=Math.max(u[0][1],u[1][1],h[0][1]),g="vx-sweep",w=v=>`<rect x="${m(Math.min(u[0][0],h[0][0])-4)}" y="${m(f)}" width="${m(Math.abs(h[0][0]-u[0][0])+60)}" height="26" fill="url(#sc-sweep-v)"><animate attributeName="y" values="${m(f)};${m(f)};${m(l[1]-26)};${m(l[1]-26)}" keyTimes="0;${c};${m(Math.min(c+.24,.98))};1" dur="${a}s" begin="${v}" repeatCount="indefinite"/></rect>`;return`<clipPath id="${g}"><polygon points="${U(u)}"/><polygon points="${U(h)}"/></clipPath><g clip-path="url(#${g})">${w(s)}</g>`}function Qi(e,n){let t=e.parts,r=[11.35,3.2,1.08],s=de([6.4,1.62,3],r,1.6),a=t.event==="active"||t.posthog==="active",c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"done",fe([{path:"instrumentation.ts",kind:"added"}],"done",6),"Your app (demo)",1.5,6),{id:"insights",label:"PostHog insight",state:t.posthog??"planned",svg:Wi(7.6,6.6,t.posthog==="done"?"done":a&&n?"live":"idle")},G("event",s,t.event??"planned","Event to PostHog"),Jt("posthog","PostHog project",t.posthog??"planned",10.1,2.2,J.posthog,"#F54E00",2),...ue(e,[[4.4,7.8]])],o=[];return a&&n&&o.push(nn(9.8,4.7)),a&&n&&o.push(Ne(s,"event","#F54E00",{count:3,dur:3.3,travel:.5,landing:d=>Le(b(...r),d,3.3,.5,"rgba(245,78,0,0.9)",52)})),{parts:c,fx:o,viewBox:""}}function Wi(e,n,t){let a="M0.25 1.35 L0.7 1.15 L1.05 1.22 L1.45 0.88 L1.85 0.95 L2.3 0.5",c=t==="live"?`<path class="ins-line" d="${a}" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"><animate attributeName="stroke-dashoffset" values="1;1;0;0" keyTimes="0;0.5;0.8;1" dur="3.3s" repeatCount="indefinite"/></path><circle class="ins-dot" cx="2.3" cy="0.5" r="0.07" opacity="0"><animate attributeName="opacity" values="0;0;1;1;0" keyTimes="0;0.78;0.82;0.95;1" dur="3.3s" repeatCount="indefinite"/></circle>`:`<path class="ins-line" d="${a}" opacity="${t==="done"?1:.35}"/>${t==="done"?'<circle class="ins-dot" cx="2.3" cy="0.5" r="0.07"/>':""}`;return`<g class="insight">${Z(e+.9,n+.5,.6,.4,.7)}${S(e+1.1,n+.45,.7,.4,.3,.6,"stand")}${S(e,n,1.3,2.6,.12,1.7,"card")}<g transform="${j("front",e,n+.12,1.3+1.7)}"><rect class="ins-bg" x="0.1" y="0.1" width="${2.6-.2}" height="${1.7-.2}" rx="0.08"/><rect class="ins-title" x="0.25" y="0.22" width="0.9" height="0.1" rx="0.05"/><path class="ins-grid" d="M0.25 0.7 H2.35 M0.25 1.05 H2.35 M0.25 1.4 H2.35"/>${c}</g></g>`}function Vi(e,n){let t=e.parts,r=e.provider&&he[e.provider]?e.provider:"supabase",s=he[r],[a,c,o]=[10.1,2.2,2.1],d=[a+(o+.5)/2,c+1,1.08],p=de([6.4,1.62,3],d,1.6),l=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"done",fe([{path:`${r}.ts`,kind:"added"}],"done",6),"Your app (demo)",1.5,6),G("link",p,t.link??"planned",`App to ${s.name}`),Jt("provider",s.name,t.provider??"planned",a,c,q(r),s.brand,o),...ue(e,[[3.4,7.6]])],u=[],h=(t.link==="active"||t.provider==="active")&&n;return h&&r==="github"&&u.push(tn(7,4.6,.7,b(d[0],d[1],1.5),7),`<g class="hype">${Le(b(...d),"0s",7,.66,s.brand,52)}</g>`),h&&r==="posthog"&&u.push(nn(9.8,4.7)),h&&r!=="github"&&u.push(Ne(p,s.payload,s.brand,{count:2,dur:3.2,travel:.55,landing:f=>Le(b(...d),f,3.2,.55,s.brand,52)})),{parts:l,fx:u,viewBox:""}}function Zi(e){let n=Ni();W={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};let t;switch(e.kind){case"start":t=Ui(e,n);break;case"auth":t=Fi(e,n);break;case"db":t=zi(e,n);break;case"security":t=Bi(e,n);break;case"deploy":t=Yi(e,n);break;case"monitor":t=Qi(e,n);break;case"connect":t=Vi(e,n);break;default:t=Pi(e,n)}let r=W;W=null;let s={x:34,top:58,bottom:26};return t.viewBox=`${m(r.x0-s.x)} ${m(r.y0-s.top)} ${m(r.x1-r.x0+s.x*2)} ${m(r.y1-r.y0+s.top+s.bottom)}`,t}var sn="http://www.w3.org/2000/svg";function Qe(e,n,t={}){let r=document.createElementNS(sn,"g");r.setAttribute("data-sig",e);for(let[s,a]of Object.entries(t))r.setAttribute(s,a);return r.innerHTML=n,r}var qi='<defs><filter id="sc-soft" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="6"/></filter><filter id="sc-glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter><linearGradient id="sc-sheen" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.6"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-sweep-v" x1="0" y1="1" x2="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.6" stop-color="#fff" stop-opacity="0.75"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-floor" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#1f1f25"/><stop offset="1" stop-color="#17171c"/></linearGradient></defs>';function an(e,n){let t=Zi(e),r=document.createElementNS(sn,"svg");r.setAttribute("class",`scene is-${e.phase} kind-${e.kind}${e.demo?" is-demo":""}`),r.setAttribute("viewBox",t.viewBox),r.setAttribute("role","group"),r.setAttribute("aria-label","Workflow view: an illustration of the steps, not your app"),r.setAttribute("data-slot",`scene-${e.kind}`);let s=a=>{let c=a.target.closest?.("[data-part]");c&&n(c.getAttribute("data-part")??"")};r.addEventListener("click",s),r.addEventListener("keydown",a=>{let c=a.key;(c==="Enter"||c===" ")&&(a.preventDefault(),s(a))}),r.appendChild(Qe("defs",qi));for(let a of t.parts){let c=e.focus===a.id,o=e.selected===a.id,p={class:`part p-${a.state}${c?" is-focus":""}${o?" is-selected":""}`,"data-part":a.id};a.inert||Object.assign(p,{tabindex:"0",role:"button","aria-label":`${a.label}: ${gt[a.state]}`}),r.appendChild(Qe(`${a.id}|${a.state}|${c}|${o}|${Ki(a.svg)}`,a.svg,p))}return r.appendChild(Qe(`fx|${t.fx.join("").length}|${t.fx.map(a=>a.slice(0,40)).join("|")}`,t.fx.join(""),{class:"fx","pointer-events":"none"})),r.appendChild(Qe(`payoff|${e.phase}`,e.phase==="done"?_i(e):"",{class:"fx-payoff","pointer-events":"none"})),r}function Ki(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n<<5)+n+e.charCodeAt(t)|0;return(n>>>0).toString(36)}function _i(e){let[n,t]=e.kind==="deploy"?b(15.3,-1.3,1.6):e.kind==="monitor"||e.kind==="connect"?b(11.35,3.2,2):b(5.5,1.6,3.2);return`<circle class="ring" cx="${m(n)}" cy="${m(t)}" r="120"/><circle class="ring two" cx="${m(n)}" cy="${m(t)}" r="120"/>`}var gt={planned:"planned",idle:"not run",active:"working now",done:"done, with evidence",failed:"failed",waiting:"waiting for you"};function xe(e){return e==="active"?"active":e==="done"?"done":e==="failed"?"failed":e==="skipped"||e==="unknown"?"idle":"planned"}var Xi=[[/tsc|typecheck/i,"Types"],[/test/i,"Tests"],[/preview still loads|page loads/i,"Page loads"],[/answers/i,"Answers"]];function ln(e){return Xi.find(([n])=>n.test(e))?.[1]??e}function Ji(e){return e.state==="waiting_for_user"?"wait":te(e.state)?e.state==="succeeded"?"done":e.state==="cancelled"||e.state==="partially_completed"&&!e.checks.some(n=>n.status==="failed")&&!e.steps.some(n=>n.state==="failed")?"stopped":"fail":"work"}function er(e,n){let t=w=>n.steps.find(v=>v.id===w),r=e.work.preview?.state==="ready"&&!!e.work.preview.url,s=n.steps.find(w=>w.state==="active"),a=Ji(n),c=n.state==="waiting_for_user"&&n.waiting?`Waiting for you: ${n.waiting.title.toLowerCase()}`:s?`${s.label}${s.detail?` \xB7 ${s.detail}`:""}`:n.result?.title??"Working";if(n.actionId==="preview.start"){let w=t("page"),v=n.checks.find($=>$.id==="page"),L=n.state==="waiting_for_user"?"waiting":w?.state==="done"?"done":w?.state==="failed"?"failed":t("answer")?.state==="active"||w?.state==="active"||t("answer")?.state==="done"?"active":"planned";return{kind:"start",phase:a,focus:n.state==="waiting_for_user"?"window":t("find")?.state==="active"?"command":t("start")?.state==="active"?"server":t("answer")?.state==="active"||w?.state==="active"?"window":null,parts:{platform:"done",command:xe(t("find")?.state),server:t("answer")?.state==="failed"?"failed":xe(t("start")?.state),"pipe-power":xe(t("start")?.state),"pipe-serve":t("answer")?.state==="active"?"active":xe(t("answer")?.state),window:L,"pipe-live":w?.state==="done"&&r?"done":"planned",port:w?.state==="done"&&r?"done":"planned"},files:[],checks:[{id:"page",label:"Page loads",status:v?v.status==="passed"?"passed":"failed":w?.state==="active"?"active":"pending"}],live:r,framework:e.work.facts?.framework??null,caption:c.replace(/(npm|pnpm|yarn|bun) run (\w+)/,"$1 run $2"),selected:e.work.selectedPart}}let o=t("edit"),d=t("check"),p=t("preview"),l=[...e.work.events].reverse().find(w=>w.type==="check.started"),h=(n.plan?.checks??[]).map(w=>{let v=/preview still loads/i.test(w),L=n.checks.find(y=>v?y.id==="page":y.command===w),$=!L&&(v?p?.state==="active":d?.state==="active"&&l?.payload.command===w);return{id:v?"page":w.replace(/\W+/g,"-"),label:ln(w),status:L?L.status==="passed"?"passed":L.status==="failed"?"failed":"not_run":$?"active":te(n.state)?"not_run":"pending"}}),f=t("read")?.state==="active"||o?.state==="active"?"active":o?.state==="failed"?"failed":n.changes.length&&!n.reverted?"done":o?.state==="done"?"idle":"planned",g=h.find(w=>w.status==="active");return{kind:"ui",phase:a,focus:o?.state==="active"||t("read")?.state==="active"?"window":g?`check:${g.id}`:p?.state==="active"?"port":null,parts:{platform:"done",agent:xe(o?.state),beam:o?.state==="active"?"active":o?.state==="done"?"idle":xe(o?.state),window:f,"pipe-live":p?.state==="done"&&r?"done":p?.state==="active"?"active":p?.state==="failed"?"failed":"planned",port:p?.state==="done"&&r?"done":p?.state==="failed"?"failed":"planned"},files:n.reverted?[]:n.changes.map(w=>({path:w.path,kind:w.kind})),checks:h,agent:n.agent?{id:n.agent.cliId,label:ft(e,n.agent.cliId)}:void 0,live:r,caption:c,selected:e.work.selectedPart}}function ft(e,n){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function tr(e,n,t){let r=n==="preview.start";return{kind:r?"start":"ui",phase:"plan",focus:null,parts:{platform:"done"},files:[],checks:r?[{id:"page",label:"Page loads",status:"pending"}]:t.checks.map(s=>({id:s.replace(/\W+/g,"-"),label:ln(s),status:"pending"})),agent:r?void 0:{id:e.cliId,label:ft(e,e.cliId)},live:e.work.preview?.state==="ready",framework:e.work.facts?.framework??null,caption:"The plan. Nothing has run yet.",selected:e.work.selectedPart}}var ht=[{kind:"ui",key:"ui",title:"Change something in my app",text:"Claude Code eats its tokens and builds the change into the app; when the checks pass, it polishes the window."},{kind:"auth",provider:"google",key:"auth",title:"Add Google sign-in",text:"A gateway opens beside the app; a test user signs in with Google and comes back into the app."},{kind:"auth",provider:"github",key:"auth-github",title:"Add GitHub sign-in",text:"The same gateway with GitHub: a test user signs in with GitHub and comes back into the app."},{kind:"db",key:"db",title:"Connect a database",text:"The database settles in layers, its tables appear as compartments, and one test record travels to it and back."},{kind:"security",key:"security",title:"Fix an access issue",text:"The affected path is marked, the rule takes shape, then the owner\u2019s path and the blocked path are tested separately."},{kind:"monitor",key:"monitor",title:"Add product analytics",text:"An app event travels to PostHog, and the check waits for PostHog to show it arrived."},{kind:"deploy",key:"deploy",title:"Create a preview deployment",text:"The change is pushed to GitHub, built and uploaded to a Vercel preview, and checked there."},{kind:"connect",key:"connect",title:"Connect a provider",text:"Every provider VibeRaven works with, in its own colours, with what it really receives from your app."}],nr={auth:{plan:{},work:{gateway:"active","pipe-provider":"done","pipe-app":"active",auth:"done",window:"idle"},wait:{gateway:"waiting","pipe-provider":"planned",auth:"done",window:"idle"},fail:{gateway:"done","pipe-provider":"done","pipe-app":"failed",auth:"done",window:"failed"},done:{gateway:"done","pipe-provider":"done","pipe-app":"done",auth:"done",window:"done"},stopped:{}},db:{plan:{},work:{db:"active",schema:"active",window:"idle"},wait:{db:"waiting",window:"idle"},fail:{db:"done",schema:"done","pipe-db":"failed",window:"failed"},done:{db:"done",schema:"done","pipe-db":"done",window:"done"},stopped:{}},security:{plan:{db:"done"},work:{rule:"active",db:"done","path-owner":"planned","path-other":"planned"},wait:{rule:"waiting",db:"done"},fail:{rule:"done",db:"done","path-owner":"done","path-other":"failed"},done:{rule:"done",db:"done","path-owner":"done","path-other":"done"},stopped:{}},deploy:{plan:{},work:{build:"done",flight:"active",preview:"active"},wait:{build:"done",flight:"planned",preview:"waiting"},fail:{build:"done",flight:"done",preview:"failed"},done:{build:"done",flight:"done",preview:"done"},stopped:{}},monitor:{plan:{},work:{posthog:"active",event:"active",window:"done"},wait:{posthog:"waiting",event:"planned",window:"done"},fail:{posthog:"done",event:"failed",window:"done"},done:{posthog:"done",event:"done",window:"done"},stopped:{}},connect:{plan:{},work:{provider:"active",link:"active",window:"done"},wait:{provider:"waiting",link:"planned",window:"done"},fail:{provider:"done",link:"failed",window:"done"},done:{provider:"done",link:"done",window:"done"},stopped:{}},ui:{plan:{},work:{agent:"active",beam:"active",window:"active"},wait:{agent:"waiting",window:"idle"},fail:{agent:"done",beam:"idle",window:"failed"},done:{agent:"done",beam:"idle",window:"done","pipe-live":"done",port:"done"},stopped:{}},start:{plan:{},work:{},wait:{},fail:{},done:{},stopped:{}}},ir={ui:["Types","Page loads"],auth:["Sign in","Sign out"],db:["Write","Read back"],security:["Owner reads","Others blocked"],deploy:["Preview answers"],monitor:["Event arrived"],connect:["Connected"]};function rr(e,n,t,r){let s=nr[n][t],a=c=>t==="done"?"passed":t==="fail"?c===0?"passed":"failed":t==="work"&&c===0?"active":"pending";return{kind:n,phase:t,focus:Object.entries(s).find(([,c])=>c==="active"||c==="waiting"||c==="failed")?.[0]??null,parts:{platform:"done",...s},framework:e.work.facts?.framework??null,provider:r,files:n==="ui"&&(t==="done"||t==="fail")?[{path:"app/page.tsx",kind:"modified"},{path:"components/Hero.tsx",kind:"modified"}]:n==="auth"&&(t==="done"||t==="fail")?[{path:"app/login/page.tsx",kind:"added"}]:n==="db"&&t==="done"?[{path:"app/notes/actions.ts",kind:"added"}]:[],checks:(ir[n]??[]).map((c,o)=>({id:`demo-${o}`,label:c,status:a(o)})),live:!1,caption:t==="plan"?"Planned scene":t==="work"?"Working (simulated)":t==="wait"?"Waiting for you (simulated)":t==="fail"?"A check failed (simulated)":"Done (simulated)",demo:!0,selected:e.work.selectedPart}}function sr(e,n,t){let r=n.selected;if(!r)return null;let s=n.parts[r]??(r.startsWith("check:")?(()=>{let o=n.checks.find(d=>`check:${d.id}`===r);return o?.status==="passed"?"done":o?.status==="failed"?"failed":o?.status==="active"?"active":"planned"})():"planned"),a=[],c=r;if(n.demo)c=r,a.push(i("p",{},"Demo scene. Nothing here is your app or a real result."));else if(r==="window")c="Your app, as drawn in the workflow",a.push(i("p",{},"A drawing of the work, not a screenshot. The real app is in the live window.")),t?.changes.length&&a.push(i("ul",{class:"insp-files"},...t.changes.map(o=>i("li",{},i("code",{},o.path),i("span",{class:"add"},`+${o.additions}`),i("span",{class:"del"},`\u2212${o.deletions}`))))),t?.waiting&&a.push(i("p",{class:"insp-wait"},t.waiting.detail));else if(r==="agent"&&t?.agent)c=ft(e,t.agent.cliId),a.push(i("p",{},`Coding agent on this computer, access: ${t.agent.accessMode}.`)),t.result?.agentAnswer&&a.push(i("div",{class:"insp-answer",html:X(t.result.agentAnswer.slice(0,900))}));else if(r.startsWith("check:")){let o=n.checks.find(p=>`check:${p.id}`===r),d=t?.checks.find(p=>p.id===o?.id||p.command?.replace(/\W+/g,"-")===o?.id);c=o?.label??"Check",a.push(i("p",{},d?`${d.status==="passed"?"Passed":d.status==="failed"?"Failed":"Not run"}${d.command?` \xB7 ${d.command}`:""}`:"Not run yet.")),d?.detail&&a.push(i("pre",{class:"insp-pre"},d.detail))}else r==="port"||r==="pipe-live"?(c="Live preview",a.push(i("p",{},e.work.preview?.url?`${e.work.preview.url} \xB7 ${e.work.preview.state}`:"Not running."))):r==="server"||r==="command"?(c=r==="server"?"Dev server":"Run command",a.push(i("p",{},e.work.preview?.command??"npm run dev")),e.work.preview?.log&&a.push(i("pre",{class:"insp-pre"},e.work.preview.log.trim().split(`
7
+ `)}function si(e,n){let t=e.find(s=>s.provider?.nextFix?.id===n.id);if(t)return t;let r=`${n.title} ${n.detail??""}`.toLowerCase();return e.find(s=>r.includes(s.name.toLowerCase())||r.includes(`${s.id}/`))}function Ot(e){let[n,t]=[e.slice(0,e.lastIndexOf(":")),e.slice(e.lastIndexOf(":")+1)];return`${n.split("/").pop()??n}:${t}`}function ai(e){return!e.project.empty&&!!e.project.project?.scannedAt}function oi(e){return e.busy.scan||e.scan?.state==="running"}function R(e){let n=ai(e),t=oi(e),s=ve(e.project,e.catalog,e.verified).filter(y=>y.step!=="absent"),a=n?e.project.missionCards?.blockers??[]:[],c=new Map((e.project.missionCards?.planSteps??[]).map(y=>[y.id,y])),o=a.map(y=>{let k=si(s,y),{summary:E,evidence:A}=ii(y.detail),I=c.get(y.id),H=Dt({...y,asksFirst:y.asksFirst??I?.asksFirst,actionDestination:y.actionDestination??I?.actionDestination,requiresUserAction:y.requiresUserAction===!0||I?.requiresUserAction===!0});return{id:y.id,title:y.title,severity:y.severity,summary:E,evidence:A,locations:ni(y.detail),service:k?{id:k.id,name:k.name,mark:He(k)}:null,dashboard:H==="provider-action",actionDestination:H,prompt:ri({...y,asksFirst:y.asksFirst??I?.asksFirst},k,H)}}),d=new Map;for(let y of o){let k=y.service?.id??"app",E=d.get(k)??{key:k,name:y.service?.name??"Your code",mark:y.service?.mark??null,findings:[]};E.findings.push(y),d.set(k,E)}let p=y=>Math.min(...y.findings.map(k=>Ie[k.severity])),l=[...d.values()].map(y=>({...y,findings:[...y.findings].sort((k,E)=>Ie[k.severity]-Ie[E.severity])})).sort((y,k)=>p(y)-p(k)||k.findings.length-y.findings.length),u=l.flatMap(y=>y.findings),h=u.filter(y=>!y.dashboard).sort((y,k)=>Ie[y.severity]-Ie[k.severity]),f={critical:0,warning:0,info:0};for(let y of o)f[y.severity]+=1;let g=s.map(y=>{let k=o.filter(it=>it.service?.id===y.id),E=k.filter(it=>it.severity==="critical").length,A=e.verified[y.id],I="pending",H="Unknown \xB7 not checked yet";return t?H="Checking":n&&(E?(I="fail",H=`Repo checks \xB7 ${E} blocker${E===1?"":"s"}`):k.length?(I="warn",H=`${k.length} to review`):(I="pass",H="Repo checks \xB7 no blockers found")),{id:y.id,name:y.name,area:y.area,mark:He(y),tone:I,stateText:H,findings:k.length,verified:A}}),w=h.find(y=>y.id===e.flow.fixId)??null,b=[];for(let y of s){let k=e.verified[y.id];b.push({id:`live:${y.id}`,label:`Check ${y.name} live`,detail:k?`Recorded ${y.name} check (${k.at}): ${k.summary}`:`Your agent reads your real ${y.name} project and confirms it matches the code.`,kind:"live",done:k?.ok===!0,doneBy:"viberaven",providerId:y.id});let E=y.provider?.cockpit?.proof.checks.filter(A=>A.source==="dashboard"&&A.status!=="yes")??[];for(let A of E){let I=`dash:${y.id}:${A.label}`;b.push({id:I,label:A.label==="Production secret proof"?`Production keys for ${y.name} are set where you deploy`:`${y.name}: ${A.label}`,detail:A.label==="Production secret proof"?`The keys your app reads for ${y.name} go in your hosting provider's environment settings for production. VibeRaven cannot see your dashboards, so you tick this.`:`VibeRaven cannot see your ${y.name} dashboard, so you tick this.`,kind:"dashboard",done:e.flow.checklist[I]===!0,doneBy:"you",providerId:y.id,href:Pt[y.id]})}}for(let y of u.filter(k=>k.dashboard))b.push({id:`finding:${y.id}`,label:y.title,detail:`${y.summary} This clears when the next check no longer finds it.`,kind:"finding",done:!1,doneBy:"viberaven",providerId:y.service?.id,href:y.service?Pt[y.service.id]:void 0});let L=h.filter(y=>y.severity==="critical").length,$={app:!0,work:!0,findings:n,fix:n&&h.length>0,recheck:n&&e.flow.recheck!==null,ready:n&&L===0};return{scanned:n,scanning:t,services:g,findings:o,groups:l,fixable:h,counts:f,current:w,checklist:b,gateClear:n&&e.project.gate?.status==="clear",available:$}}function lt(e){return e.scanned?e.findings.length===0||!e.available.fix?"ready":"findings":"app"}function Rt(e,n){let t=n.flow.recheck,r=e.checklist.filter(s=>!s.done).length;return{work:"",app:e.scanning?"Checking now":e.services.length?`${e.services.length} service${e.services.length===1?"":"s"} found`:"No services found",findings:e.scanned?e.findings.length===0?"Nothing found":[e.counts.critical?`${e.counts.critical} critical`:null,`${e.findings.length} total`].filter(Boolean).join(" \xB7 "):"After the check",fix:e.scanned?e.fixable.length===0?"Nothing to fix in code":`${e.fixable.length} to fix`:"After the check",recheck:t?t.status==="running"?"Checking now":t.status==="fixed"?"Last fix held":t.status==="open"?"Still open":"Did not finish":"After a fix",ready:e.scanned?e.available.ready?e.gateClear?"No blockers found":r?`${r} step${r===1?"":"s"} left`:"Checklist done":"After the critical fixes":"After the check"}}var Be='<svg class="brand-raven" width="24" height="20" viewBox="0 0 796 667" aria-hidden="true" focusable="false"><path fill-rule="evenodd" fill="currentColor" d="M177.0 347.5 L170.0 352.0 L152.5 365.5 L142.0 375.5 L141.5 375.5 L141.5 376.0 L133.5 383.5 L133.5 384.0 L120.5 397.5 L96.5 427.5 L95.5 429.5 L84.0 445.0 L65.5 472.5 L65.0 474.0 L56.0 487.5 L55.5 489.0 L49.5 498.0 L43.0 509.5 L38.0 517.0 L37.0 519.5 L36.0 520.5 L35.5 522.0 L31.5 528.0 L30.0 531.5 L27.5 535.0 L26.5 537.5 L24.0 541.0 L18.5 552.0 L17.5 553.0 L2.0 584.0 L2.0 585.0 L0.0 589.0 L1.0 589.0 L10.0 583.0 L13.5 580.0 L20.0 576.0 L21.5 574.5 L23.0 574.0 L31.0 568.0 L47.5 557.0 L50.5 555.5 L52.0 554.0 L74.0 539.5 L75.5 538.0 L83.5 533.0 L85.0 531.5 L94.5 525.0 L100.5 520.0 L108.0 512.5 L121.0 496.0 L123.5 492.0 L130.0 478.0 L130.0 477.0 L133.0 470.5 L133.5 468.0 L136.5 461.5 L139.0 453.5 L140.0 452.0 L142.5 444.5 L143.5 443.0 L144.0 440.5 L147.0 434.0 L151.0 421.5 L152.0 420.0 L154.0 413.5 L156.0 409.5 L158.0 402.5 L161.0 396.0 L162.0 392.0 L163.0 390.5 L163.0 389.0 L164.0 387.5 L168.0 375.0 L169.0 373.5 L170.0 369.0 L171.0 367.5 L175.0 355.0 L176.0 353.5 L176.0 352.0 L177.5 348.0 Z M763.0 175.5 L732.0 140.0 L703.5 118.0 L652.0 93.5 L604.5 79.5 L586.0 56.5 L562.0 38.5 L525.0 19.5 L483.5 5.0 L455.5 0.5 L426.5 0.0 L383.5 6.0 L333.0 23.0 L275.0 55.5 L237.0 86.0 L302.0 77.5 L238.5 129.0 L199.5 169.5 L136.5 254.5 L67.0 356.5 L296.5 247.0 L232.5 314.0 L201.5 357.0 L110.0 552.5 L69.0 666.5 L211.0 526.0 L264.5 479.0 L323.0 433.0 L206.0 633.5 L288.5 587.0 L349.0 547.5 L417.0 497.0 L471.5 450.5 L529.0 392.5 L499.5 279.5 L501.0 275.0 L544.5 251.5 L605.5 229.5 L658.5 223.0 L725.5 221.0 L701.5 210.0 L655.5 197.0 L515.0 178.5 L549.5 171.0 L594.0 166.0 L649.5 175.0 L692.5 189.0 L718.5 201.0 L747.0 217.5 L795.0 252.0 L784.0 214.0 Z M436.5 73.5 L437.0 73.0 L438.0 73.0 L438.5 73.5 L439.5 73.5 L440.0 74.0 L441.5 74.0 L442.0 74.5 L443.0 74.5 L443.5 75.0 L445.0 75.0 L445.5 75.5 L446.0 75.5 L446.5 76.0 L448.0 76.0 L448.5 76.5 L449.0 76.5 L449.5 77.0 L451.0 77.0 L451.5 77.5 L452.0 77.5 L452.5 78.0 L453.5 78.0 L454.0 78.5 L454.5 78.5 L455.0 79.0 L456.0 79.0 L456.5 79.5 L457.5 79.5 L458.0 80.0 L459.0 80.0 L459.5 80.5 L460.5 80.5 L461.0 81.0 L461.5 81.0 L462.0 81.5 L463.0 81.5 L463.5 82.0 L464.5 82.0 L465.0 82.5 L465.5 82.5 L466.0 83.0 L467.0 83.0 L467.5 83.5 L468.5 83.5 L469.0 84.0 L469.5 84.0 L470.0 84.5 L471.0 84.5 L471.5 85.0 L472.5 85.0 L473.0 85.5 L473.5 85.5 L474.0 86.0 L475.0 86.0 L475.5 86.5 L476.5 86.5 L477.0 87.0 L477.5 87.0 L478.0 87.5 L478.5 87.5 L479.0 88.0 L480.0 88.0 L480.5 88.5 L481.0 88.5 L481.5 89.0 L482.5 89.0 L483.0 89.5 L483.5 89.5 L484.0 90.0 L484.5 90.0 L485.0 90.5 L486.0 90.5 L486.5 91.0 L487.5 91.0 L488.0 91.5 L488.5 91.5 L489.0 92.0 L489.5 92.0 L490.0 92.5 L491.0 92.5 L491.5 93.0 L492.0 93.0 L492.5 93.5 L493.5 93.5 L494.0 94.0 L494.5 94.0 L495.0 94.5 L495.5 94.5 L496.0 95.0 L496.5 95.0 L497.0 95.5 L497.5 95.5 L498.0 96.0 L499.0 96.0 L499.5 96.5 L500.0 96.5 L500.5 97.0 L501.0 97.0 L501.5 97.5 L502.0 97.5 L502.5 98.0 L503.5 98.0 L504.0 98.5 L504.5 98.5 L505.0 99.0 L506.0 99.0 L506.5 99.5 L507.0 99.5 L507.5 100.0 L508.0 100.0 L508.5 100.5 L509.0 100.5 L509.5 101.0 L510.5 101.0 L511.0 101.5 L511.5 101.5 L512.0 102.0 L512.5 102.0 L513.0 102.5 L513.5 102.5 L514.0 103.0 L514.5 103.0 L515.0 103.5 L515.5 103.5 L516.0 104.0 L516.5 104.0 L517.0 104.5 L517.5 104.5 L518.0 105.0 L518.5 105.0 L519.0 105.5 L519.5 105.5 L520.0 106.0 L521.0 106.0 L521.5 106.5 L522.0 106.5 L522.5 107.0 L523.0 107.0 L523.5 107.5 L524.0 107.5 L524.5 108.0 L525.0 108.0 L525.5 108.5 L526.0 108.5 L526.5 109.0 L527.0 109.0 L527.5 109.5 L528.0 109.5 L528.5 110.0 L529.0 110.0 L529.5 110.5 L530.0 110.5 L530.5 111.0 L531.0 111.0 L531.5 111.5 L532.0 111.5 L532.5 112.0 L533.0 112.0 L533.5 112.5 L534.0 112.5 L534.5 113.0 L535.0 113.0 L535.5 113.5 L536.0 113.5 L536.5 114.0 L537.0 114.0 L537.5 114.5 L538.0 114.5 L539.0 115.5 L539.0 116.0 L538.0 117.0 L537.0 117.0 L536.5 117.5 L536.0 117.5 L535.5 118.0 L535.0 118.0 L534.5 118.5 L533.5 118.5 L533.0 119.0 L532.5 119.0 L532.0 119.5 L531.0 119.5 L530.5 120.0 L530.0 120.0 L529.5 120.5 L528.5 120.5 L528.0 121.0 L527.5 121.0 L527.0 121.5 L526.5 121.5 L526.0 122.0 L525.5 122.0 L525.0 122.5 L524.0 122.5 L523.5 123.0 L523.0 123.0 L522.5 123.5 L521.5 123.5 L521.0 124.0 L520.5 124.0 L520.0 124.5 L519.0 124.5 L518.5 125.0 L518.0 125.0 L517.5 125.5 L516.5 125.5 L516.0 126.0 L515.0 126.0 L514.5 126.5 L513.5 126.5 L513.0 127.0 L512.5 127.0 L512.0 127.5 L511.0 127.5 L510.5 128.0 L510.0 128.0 L509.5 128.5 L508.5 128.5 L508.0 129.0 L507.0 129.0 L506.5 129.5 L505.0 129.5 L504.5 130.0 L504.0 130.0 L503.5 130.5 L502.0 130.5 L501.5 131.0 L500.0 131.0 L499.5 131.5 L496.5 131.5 L496.0 132.0 L491.5 132.0 L491.0 131.5 L488.5 131.5 L488.0 131.0 L487.0 131.0 L486.5 130.5 L485.5 130.5 L485.0 130.0 L484.0 130.0 L483.5 129.5 L483.0 129.5 L482.5 129.0 L482.0 129.0 L481.5 128.5 L481.0 128.5 L480.5 128.0 L480.0 128.0 L479.0 127.0 L478.5 127.0 L477.5 126.0 L477.0 126.0 L475.5 124.5 L475.0 124.5 L470.0 119.5 L470.0 119.0 L468.0 117.0 L468.0 116.5 L466.5 115.0 L466.5 114.5 L464.5 112.5 L464.5 112.0 L463.0 110.5 L463.0 110.0 L461.5 108.5 L461.5 108.0 L460.0 106.5 L460.0 106.0 L458.5 104.5 L458.5 104.0 L457.0 102.5 L457.0 102.0 L455.5 100.5 L455.5 100.0 L454.0 98.5 L454.0 98.0 L452.5 96.5 L452.5 96.0 L451.5 95.0 L451.5 94.5 L450.0 93.0 L450.0 92.5 L448.5 91.0 L448.5 90.5 L447.0 89.0 L447.0 88.5 L446.0 87.5 L446.0 87.0 L444.5 85.5 L444.5 85.0 L443.0 83.5 L443.0 83.0 L442.0 82.0 L442.0 81.5 L440.5 80.0 L440.5 79.5 L439.5 78.5 L439.5 78.0 L438.5 77.0 L438.5 76.5 L437.5 75.5 L437.5 75.0 L436.5 74.0 Z"/></svg>';var ct=new Map,Ft=()=>{};function dt(e){return`vr-canvas:${e}`}function je(e){let n=ct.get(e);if(n)return n;let t={pan:{x:0,y:0},zoom:1,cards:{}};try{let r=localStorage.getItem(dt(e));if(r){let s=JSON.parse(r);t={pan:s.pan??t.pan,zoom:Ht(s.zoom??1),cards:s.cards??{}}}}catch{}return ct.set(e,t),t}function zt(e){try{localStorage.setItem(dt(e),JSON.stringify(je(e)))}catch{}}function Ht(e){return Math.min(1.6,Math.max(.5,Math.round(e*100)/100))}function li(e){return`translate(${e.pan.x}px, ${e.pan.y}px) scale(${e.zoom})`}function ci(e,n){let t=e.cards[n];return t?`translate(${t.x}px, ${t.y}px)`:void 0}function di(e){return e.zoom!==1||e.pan.x!==0||e.pan.y!==0||Object.keys(e.cards).length>0}function Ye(e){return e.querySelector(".board")}function ke(e){let n=Ye(e);if(!n)return;let t=je(n.dataset.layoutKey??"default");n.style.transform=li(t);for(let r of Array.from(n.querySelectorAll("[data-card]")))r.style.transform=ci(t,r.dataset.card??"")??"";e.classList.toggle("is-moved",di(t)),Ft(n)}function Ge(e,n){let t=Ye(e);if(!t)return;let r=t.dataset.layoutKey??"default",s=je(r);s.zoom=Ht(s.zoom*n),ke(e),zt(r)}function Bt(e){let n=Ye(e);if(!n)return;let t=n.dataset.layoutKey??"default";ct.set(t,{pan:{x:0,y:0},zoom:1,cards:{}}),ke(e);try{localStorage.removeItem(dt(t))}catch{}}var Ut=new WeakSet;function Yt(e,n){if(Ft=n,Ut.has(e)){ke(e);return}Ut.add(e);let t=null,r=0;e.addEventListener("pointerdown",a=>{if(a.button!==0)return;let c=a.target;if(c.closest("button, a, input, select, textarea, pre, form, iframe, .canvas-tools, .pr-checks, .shelf"))return;let o=Ye(e);if(!o)return;let d=o.dataset.layoutKey??"default",p=je(d),l=c.closest("[data-card]"),u=l?.dataset.card??"";t={kind:l?"card":"pan",id:u,key:d,startX:a.clientX,startY:a.clientY,origin:l?{...p.cards[u]??{x:0,y:0}}:{...p.pan},moved:!1,pointer:a.pointerId,target:l??e}}),e.addEventListener("pointermove",a=>{if(!t||a.pointerId!==t.pointer)return;let c=a.clientX-t.startX,o=a.clientY-t.startY;if(!t.moved){if(Math.hypot(c,o)<4)return;t.moved=!0,e.setPointerCapture?.(t.pointer),e.classList.add("is-dragging"),t.target.classList.add("is-lifted")}let d=je(t.key);t.kind==="pan"?d.pan={x:Math.round(t.origin.x+c),y:Math.round(t.origin.y+o)}:d.cards[t.id]={x:Math.round(t.origin.x+c/d.zoom),y:Math.round(t.origin.y+o/d.zoom)},r||(r=requestAnimationFrame(()=>{r=0,ke(e)}))});let s=a=>{!t||a.pointerId!==t.pointer||(t.moved&&(e.releasePointerCapture?.(t.pointer),e.classList.remove("is-dragging"),t.target.classList.remove("is-lifted"),ke(e),zt(t.key)),t=null)};e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("wheel",a=>{!a.ctrlKey&&!a.metaKey||(a.preventDefault(),Ge(e,a.deltaY<0?1.1:1/1.1))},{passive:!1}),ke(e)}var B={claude:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgYXJpYS1oaWRkZW49InRydWUiPg0KICA8dGl0bGU+Q2xhdWRlIENvZGU8L3RpdGxlPg0KICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMC45OTggMTAuOTQ5SDI0djMuMTAyaC0zdjMuMDI4aC0xLjQ4N1YyMEgxOHYtMi45MjFoLTEuNDg3VjIwSDE1di0yLjkyMUg5VjIwSDcuNDg4di0yLjkyMUg2VjIwSDQuNDg3di0yLjkyMUgzVjE0LjA1SDBWMTAuOTVoM1Y1aDE3Ljk5OHY1Ljk0OXpNNiAxMC45NDloMS40ODhWOC4xMDJINnYyLjg0N3pt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5LjMyUTEyIDIxLjUxIDEyIDI0cTAtMi40OS45My00LjY4Ljk2LTIuMTkgMi41OC0zLjgxdDMuODEtMi41NVEyMS41MSAxMiAyNCAxMnEtMi40OSAwLTQuNjgtLjkzYTEyLjMgMTIuMyAwIDAgMS0zLjgxLTIuNTggMTIuMyAxMi4zIDAgMCAxLTIuNTgtMy44MVExMiAyLjQ5IDEyIDBxMCAyLjQ5LS45NiA0LjY4LS45MyAyLjE5LTIuNTUgMy44MWExMi4zIDEyLjMgMCAwIDEtMy44MSAyLjU4UTIuNDkgMTIgMCAxMnEyLjQ5IDAgNC42OC45NiAyLjE5LjkzIDMuODEgMi41NXQyLjU1IDMuODEiLz4NCjwvc3ZnPg0K"};var ee=new Set(["succeeded","partially_completed","failed","cancelled","interrupted"]),Gt=600;function ui(e){let n=e.trim().toLowerCase();return/^(?:please\s+)?(?:show|run|start|open|launch)\s+(?:me\s+)?(?:my\s+|the\s+)?(?:app|preview|site)\b\.?$/.test(n)?"preview.start":/^(?:please\s+)?fix\s+(?:the\s+|my\s+|all\s+)?(?:findings?|blockers?|issues?)\b\.?$/.test(n)?"findings.fix":"app.change"}function Qt(e,n){let t=null,r=null,s=()=>e.get().work;async function a(){try{let f=await S.actions(e.get().cliId);e.work({offers:f.actions,facts:f.facts,preview:f.preview}),f.activeRunId&&f.activeRunId!==s().run?.id&&await p(f.activeRunId)}catch{}}async function c(){try{e.work({history:(await S.runs()).runs})}catch{}}function o(f){let g=e.get().work.run;g&&g.id!==f.run.id||e.work(w=>{let b=w.run?.id===f.run.id,L=b?w.cursor:0,$=f.events.filter(y=>y.seq>L);return{run:f.run,events:[...b?w.events:[],...$].slice(-300),cursor:$.length?$[$.length-1].seq:L}})}async function d(f){if(t!==f){t=f;try{for(;s().run?.id===f;){let g;try{g=await S.run(f,s().cursor)}catch{await new Promise(b=>window.setTimeout(b,Gt*2));continue}let w=s().run?.state;if(o(g),g.events.some(b=>b.type==="preview.refreshed"||b.type==="preview.ready")&&await l(),ee.has(g.run.state)){w&&!ee.has(w)&&(await Promise.all([a(),c(),l()]),g.run.changes.length&&await n.refreshProject().catch(()=>{}));break}await new Promise(b=>window.setTimeout(b,Gt))}}finally{t===f&&(t=null)}}}async function p(f){let g=await S.run(f,0);e.work({run:g.run,events:g.events,cursor:g.events.at(-1)?.seq??0,plan:null,diff:null,error:null}),n.goToStep("work"),ee.has(g.run.state)||d(f)}async function l(){try{let f=await S.preview();e.work({preview:f}),f.state==="starting"&&u()}catch{}}function u(){r===null&&(r=window.setTimeout(()=>{r=null,l()},900))}let h={async loadWork(){await Promise.all([a(),c()])},setRequest(f){e.get().work.request=f},async submitRequest(f){let g=f.trim();if(!g){document.getElementById("shelf-input")?.focus();return}let w=ui(g);if(w==="findings.fix"){n.goToStep("findings");return}await h.planAction(w,w==="app.change"?g:void 0)},runOffer(f){if(f.id==="findings.fix"){n.goToStep("findings");return}if(f.id==="agent.connect"||f.unblock==="connect-agent"){n.openAgents();return}if(f.id==="app.change"){n.openCatalog(!1),queueMicrotask(()=>document.getElementById("shelf-input")?.focus());return}f.availability==="ready"&&(n.openCatalog(!1),h.planAction(f.id))},async planAction(f,g){let w=e.get();if(w.work.run&&!ee.has(w.work.run.state)){n.goToStep("work");return}e.work({busy:!0,error:null});try{let{plan:b}=await S.planAction({actionId:f,request:g,cliId:w.cliId,accessMode:w.accessMode,modelId:w.modelId||void 0});e.work({plan:{actionId:f,request:g,plan:b},run:null,events:[],cursor:0,diff:null,gallery:null,selectedPart:null}),n.goToStep("work"),queueMicrotask(()=>document.getElementById("work-start")?.focus({preventScroll:!0}))}catch(b){e.toast(b instanceof Error?b.message:String(b),"err")}finally{e.work({busy:!1})}},async setWorkAccess(f){n.setAccessMode(f);let g=s().plan;g&&await h.planAction(g.actionId,g.request)},async startPlanned(){let f=s().plan,g=e.get();if(!(!f||g.work.busy)&&!(f.actionId==="app.change"&&!g.probes[g.cliId]?.ready&&(await n.testConnection(),!e.get().probes[e.get().cliId]?.ready))){e.work({busy:!0,error:null});try{let w=await S.startRun({actionId:f.actionId,request:f.request,cliId:g.cliId,accessMode:g.accessMode,modelId:g.modelId||void 0,planRevision:f.plan.revision});e.work({plan:null,run:w.run,events:w.events,cursor:w.events.at(-1)?.seq??0,request:f.actionId==="app.change"?"":s().request,selectedPart:null}),d(w.run.id),f.actionId==="preview.start"&&u()}catch(w){let b=w instanceof Error?w.message:String(w);e.work({error:b}),/plan changed/i.test(b)&&await h.planAction(f.actionId,f.request)}finally{e.work({busy:!1})}}},async cancelRun(){let f=s().run;if(!(!f||ee.has(f.state)))try{await S.cancelRun(f.id)}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},closeWork(){e.work({plan:null,diff:null,error:null,gallery:null,selectedPart:null,...s().run&&!ee.has(s().run.state)?{}:{run:null,events:[],cursor:0}}),n.goToStep("app")},newChange(){e.work({plan:null,run:null,events:[],cursor:0,diff:null,error:null,gallery:null,selectedPart:null}),n.goToStep("app"),queueMicrotask(()=>document.getElementById("shelf-input")?.focus())},async showDiff(){let f=s().run;if(f){if(s().diff?.runId===f.id){e.work({diff:null});return}try{e.work({diff:{runId:f.id,files:(await S.runDiff(f.id)).files}})}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}}},async undoRun(){let f=s().run;if(f)try{let g=await S.revertRun(f.id);g.run&&e.work({run:g.run,diff:null}),e.toast(g.skipped.length?`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}. ${g.skipped.length} left as ${g.skipped.length===1?"it is":"they are"}: Review shows why.`:`Put back ${g.restored.length} file${g.restored.length===1?"":"s"}.`,g.skipped.length?"err":"ok"),await Promise.all([l(),n.refreshProject().catch(()=>{}),c()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}},async restoreFile(f){let g=s().run;if(g)try{let w=await S.restoreFile(g.id,f);e.work({run:w.run??g,diff:{runId:g.id,files:(await S.runDiff(g.id)).files}}),e.toast(`Put back ${f.split("/").pop()}. A copy of it as it was is kept with the run.`,"ok"),await Promise.all([l(),n.refreshProject().catch(()=>{})])}catch(w){e.toast(w instanceof Error?w.message:String(w),"err")}},async stopPreview(){try{e.work({preview:await S.stopPreview(),previewExpanded:!1}),await a()}catch(f){e.toast(f instanceof Error?f.message:String(f),"err")}},reloadPreview(){let f=document.getElementById("app-frame");f&&(f.src=f.src)},selectPart(f){e.work({selectedPart:s().selectedPart===f?null:f})},showGallery(f,g,w){if(s().run&&!ee.has(s().run.state)){n.goToStep("work");return}n.openCatalog(!1),e.work({gallery:{kind:f,phase:g,provider:w},plan:null,run:null,events:[],cursor:0,diff:null,selectedPart:null}),n.goToStep("work")},async resumeRun(){let f=s().run;if(!(!f||f.state!=="waiting_for_user"||s().busy)){e.work({busy:!0});try{o(await S.resumeRun(f.id));let g=s().run;g&&!ee.has(g.state)?d(g.id):await Promise.all([a(),c(),l()])}catch(g){e.toast(g instanceof Error?g.message:String(g),"err")}finally{e.work({busy:!1})}}},toggleCatalog(f){n.openCatalog(f??e.get().drawer!=="actions")},togglePreviewExpanded(f){let g=f??!s().previewExpanded;e.work({previewExpanded:g}),queueMicrotask(()=>document.getElementById(g?"preview-collapse":"preview-expand")?.focus({preventScroll:!0}))}};return h}function te(e){return e!==void 0&&ee.has(e)}var C=24,le=.8660254,ce=.5,Wt={x:470,y:120},W=null;function v(e,n,t){let r=[Wt.x+(e-n)*le*C,Wt.y+(e+n)*ce*C-t*C];return W&&(W.x0=Math.min(W.x0,r[0]),W.x1=Math.max(W.x1,r[0]),W.y0=Math.min(W.y0,r[1]),W.y1=Math.max(W.y1,r[1])),r}function U(e){return e.map(([n,t])=>`${n.toFixed(1)},${t.toFixed(1)}`).join(" ")}function m(e){return e.toFixed(1)}function j(e,n,t,r){let[s,a]=v(n,t,r);return e==="front"?`matrix(${m(le*C)} ${m(ce*C)} 0 ${C} ${m(s)} ${m(a)})`:e==="side"?`matrix(${m(le*C)} ${m(-ce*C)} 0 ${C} ${m(s)} ${m(a)})`:`matrix(${m(le*C)} ${m(ce*C)} ${m(-le*C)} ${m(ce*C)} ${m(s)} ${m(a)})`}function x(e,n,t,r,s,a,c){let o=[v(e,n,t+a),v(e+r,n,t+a),v(e+r,n+s,t+a),v(e,n+s,t+a)],d=[v(e,n+s,t+a),v(e+r,n+s,t+a),v(e+r,n+s,t),v(e,n+s,t)],p=[v(e+r,n,t+a),v(e+r,n+s,t+a),v(e+r,n+s,t),v(e+r,n,t)],l=U([v(e,n+s,t+a),v(e+r,n+s,t+a),v(e+r,n,t+a)]);return`<g class="box ${c}"><polygon class="f-left" points="${U(d)}"/><polygon class="f-right" points="${U(p)}"/><polygon class="f-top" points="${U(o)}"/><polyline class="edge" points="${l}"/></g>`}function pi(e,n,t,r,s,a,c=0){let[o,d]=v(e,n,t+s),p=r*C*1.2247,l=r*C*.7071,u=d+s*C;return`<g class="cyl ${a}" style="animation-delay:${c}ms"><path class="f-left" d="M${m(o-p)} ${m(d)} L${m(o-p)} ${m(u)} A${m(p)} ${m(l)} 0 0 0 ${m(o+p)} ${m(u)} L${m(o+p)} ${m(d)} Z"/><ellipse class="f-top" cx="${m(o)}" cy="${m(d)}" rx="${m(p)}" ry="${m(l)}"/></g>`}function Z(e,n,t,r,s=0){return`<polygon class="shadow" points="${U([v(e+.3,n+.3,s),v(e+t+.5,n+.3,s),v(e+t+.5,n+r+.6,s),v(e+.3,n+r+.6,s)])}"/>`}function de(e,n,t=2){let[r,s]=v(...e),[a,c]=v(...n),o=(r+a)/2,d=Math.min(s,c)-t*C;return`M${m(r)} ${m(s)} Q${m(o)} ${m(d)} ${m(a)} ${m(c)}`}function Te(e){return e.map((n,t)=>`${t?"L":"M"}${m(v(...n)[0])} ${m(v(...n)[1])}`).join(" ")}function Ke(e,n,t,r,s=""){let[a,c]=v(e,n,t),o=Math.max(26,r.length*5.6+14);return`<g class="tag ${s}" transform="translate(${m(a)} ${m(c)})"><rect x="${m(-o/2)}" y="-9.5" width="${m(o)}" height="18" rx="9"/><text x="0" y="3.2" text-anchor="middle">${ut(r)}</text></g>`}function ut(e){return e.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}var Vt=/d="([^"]+)"/.exec(Be)?.[1]??"",gi="data:image/svg+xml;base64,"+qt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>');function qt(e){return btoa(e)}function ie(e,n,t,r,s,a,c,o){let d=[];for(let h=1;h<r;h+=1)d.push(`<path class="grid" d="M${h} 0 L${h} ${s}"/>`);for(let h=1;h<s;h+=1)d.push(`<path class="grid" d="M0 ${h} L${r} ${h}"/>`);let p=Vt&&!o?`<g transform="${j("front",n+.5,t+s,.62)}"><g transform="scale(0.00105 0.00105) translate(0 -620)"><path class="raven" d="${Vt}"/></g></g>`:"",l=o?`<g transform="${j("front",n+.45,t+s,.62)}"><image href="${o}" x="0" y="-0.55" width="0.5" height="0.5"/></g>`:"",u=U([v(n,t+s,.7),v(n,t,.7),v(n+r,t,.7),v(n+r,t+s,.7),v(n,t+s,.7)]);return{id:e,label:a,state:c,svg:`${x(n,t,0,r,s,.7,"ground")}<g transform="${j("top",n,t,.7)}" class="grid-lines">${d.join("")}</g><polyline class="rim" points="${u}"/>${p}${l}<g transform="${j("front",n+(o?1.25:1.7),t+s,.7)}"><text class="ground-label" x="0" y="0.47">${ut(a.toUpperCase())}</text></g>`}}function hi(e,n,t,r,s,a,c,o){let l=`<rect class="win-face" x="0" y="0" width="${r}" height="${s}" rx="0.18"/><rect class="win-bar" x="0" y="0" width="${r}" height="0.62" rx="0.18"/><circle class="dot" cx="0.42" cy="0.31" r="0.1"/><circle class="dot" cx="0.74" cy="0.31" r="0.1"/><circle class="dot" cx="1.06" cy="0.31" r="0.1"/><rect class="win-url" x="1.5" y="0.17" width="${Math.max(1,r-2.3)}" height="0.28" rx="0.14"/>`;return{id:e,label:o,state:a,svg:`${Z(n,t,r,.32,.7)}${x(n,t,.7,r,.32,s,"frame")}<g transform="${j("front",n,t+.32,.7+s)}" class="win">${l}<g class="win-content">${c}</g><rect class="win-outline" x="0" y="0" width="${r}" height="${s}" rx="0.18" pathLength="1"/></g>`}}function ne(e,n="0 0 24 24"){return`data:image/svg+xml;base64,${qt(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${n}">${e}</svg>`)}`}var ge='fill="none" stroke="#f5f5f7" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"',oe={code:ne(`<path ${ge} d="M8.5 7 3.5 12l5 5M15.5 7l5 5-5 5"/>`),tests:ne(`<path ${ge} d="M9 3h6M10 3v6l-5 9a2 2 0 0 0 1.7 3h10.6a2 2 0 0 0 1.7-3l-5-9V3M7.5 15h9"/>`),page:ne(`<path ${ge} d="M6 3h8.5L19 7.5V21H6zM14 3v5h5M9 12.5h7M9 16.5h5"/>`),preview:ne(`<path ${ge} d="M3 5h18v12H3zM9 21h6M12 17v4"/><path fill="#f5f5f7" d="M10 8.5v5l4.3-2.5z"/>`),check:ne(`<path ${ge} d="M4.5 12.5l4.5 4.5 10-10"/>`),user:ne(`<circle ${ge} cx="12" cy="8" r="3.6"/><path ${ge} d="M4.8 20c.9-3.6 3.8-5.6 7.2-5.6s6.3 2 7.2 5.6"/>`)},fi=ne('<rect width="24" height="24" rx="4" fill="#CB3837"/><path fill="#fff" d="M5 7h14v10h-3.5V10.5h-3V17H5z"/>'),mi=ne('<circle cx="12" cy="12" r="11" fill="#000" stroke="#f5f5f7" stroke-width="1.2"/><path d="M8.4 16.8V7.2l8.4 11.4" fill="none" stroke="#f5f5f7" stroke-width="1.7" stroke-linejoin="round"/><path d="M15.6 7.2v6.6" stroke="#f5f5f7" stroke-width="1.7"/>'),wi=ne('<path fill="#bd34fe" d="M21.5 3.5 12.6 21a.6.6 0 0 1-1.1 0L2.5 3.5a.6.6 0 0 1 .6-.8l8.8 1.6h.2l8.8-1.6a.6.6 0 0 1 .6.8z"/><path fill="#ffd62e" d="M16.2 2.3 9.6 3.6a.3.3 0 0 0-.2.3l-.4 6.8a.3.3 0 0 0 .3.3l1.8-.4a.3.3 0 0 1 .4.4l-.5 2.6a.3.3 0 0 0 .4.3l1.1-.3a.3.3 0 0 1 .4.3l-.9 4.2c0 .3.3.4.5.2l.1-.2 3.9-7.8a.3.3 0 0 0-.3-.4l-1.9.4a.3.3 0 0 1-.3-.4l1.2-4.3a.3.3 0 0 0-.3-.4z"/>'),yi={claude:"#D97757",codex:"#2563eb",gemini:"#4285F4"};function bi(e){return e==="Next.js"?mi:e==="Vite"?wi:oe.code}function vi(e){return/type/i.test(e)?oe.code:/test/i.test(e)?oe.tests:/page|load|answer/i.test(e)?oe.page:/sign|user|owner|other/i.test(e)?oe.user:oe.check}function _e(e){let{x:n,y:t,size:r}=e,s=e.h??.5,a=e.grounded?.7:e.z??1.5,c=r*.5,o=n+(r-c)/2,d=t+(r-c)/2,[p,l]=v(n+r/2,t+r/2,.7),u=r*.68,h=(r-u)/2,f=u*.62,g=e.grounded?Z(n,t,r,r,.7):`<ellipse class="shadow soft" cx="${m(p)}" cy="${m(l)}" rx="${m(r*.85*C)}" ry="${m(r*.48*C)}"/>${e.floating?"":x(o,d,.7,c,c,Math.max(.2,a-.7-.25),"pedestal")}`;return`<g class="unit-wrap ${e.cls??""}" style="--brand:${e.brand??"rgba(255,255,255,0.35)"}">${g}<g class="${e.grounded?"still":"hover"}">${x(n,t,a,r,r,s,"unit")}<g transform="${j("top",n,t,a+s)}"><rect class="unit-plate" x="${m(h)}" y="${m(h)}" width="${m(u)}" height="${m(u)}" rx="${m(u*.22)}"/><rect class="unit-ring" x="${m(h)}" y="${m(h)}" width="${m(u)}" height="${m(u)}" rx="${m(u*.22)}"/><image href="${e.mark}" x="${m(h+(u-f)/2)}" y="${m(h+(u-f)/2)}" width="${m(f)}" height="${m(f)}"/></g><g transform="${j("front",n,t+r,a+s)}"><rect class="unit-led" x="${m(r*.18)}" y="${m(s*.42)}" width="${m(r*.64)}" height="0.11" rx="0.055"/></g></g></g>`}function ki(e,n,t,r,s,a,c,o="#D97757",d=null,p=!1){let l=_e({x:n,y:t,size:1.8,z:r,h:.55,mark:a,brand:o,floating:!0}),u=d==="claude"&&!p?Kt(n+.1,t+.55,r+.55):d==="codex"?$i(n+.3,t+.5,r+.55):"";return{id:e,label:c,state:s,svg:u?l.replace(/<\/g><\/g>$/,`${u}</g></g>`):l}}function Mi(e,n,t,r,s){return{id:e,label:s,state:r,svg:`${_e({x:n,y:t,size:1.25,z:1.6,h:.42,mark:vi(s)})}${Ke(n+.62,t+.62,3.05,s,"tag-check")}`}}function G(e,n,t,r){return{id:e,label:r,state:t,svg:`<path class="pipe-base" d="${n}"/><path class="pipe" d="${n}" pathLength="1"/><path class="pipe-flow" d="${n}"/>`}}function Ve(e,n,t,r,s,a){if(!s)return`<circle class="token ${n}" r="5" cx="0" cy="0"><animateMotion dur="0.01s" fill="freeze" path="${e}" keyPoints="${a??1};${a??1}" keyTimes="0;1" calcMode="linear"/></circle>`;let c=a!==void 0?`keyPoints="0;${a};${a}" keyTimes="0;0.7;1" calcMode="linear"`:"";return`<g class="token-g ${n}"><circle class="token-halo" r="9"/><circle class="token" r="4.5"/><animateMotion dur="${t}s" ${r?'repeatCount="indefinite"':'fill="freeze"'} ${c} path="${e}"/></g>`}function Li(e,n,t,r){return{id:e,label:"Live preview",state:r,svg:`${_e({x:n,y:t,size:1.2,z:1.25,h:.4,mark:oe.preview,brand:"#6fd08c"})}${Ke(n+.6,t+.6,3.15,r==="done"?"LIVE":"PREVIEW","tag-port")}`}}function pt(e,n,t,r,s,a,c){let o=[],d=[];for(let h=0;h<3;h+=1){if(h>=s&&r!=="planned")continue;let f=.7+h*.95;if(o.push(pi(n,t,f,1.55,.75,`layer${h<s?"":" ghost"}`,h*160)),h<s){let[g,w]=v(n,t,f+.75),b=1.55*C*1.2247,L=1.55*C*.7071;d.push(`<path class="seam" style="animation-delay:${h*200}ms" d="M${m(g-b)} ${m(w+.18*C)} A${m(b)} ${m(L)} 0 0 0 ${m(g+b)} ${m(w+.18*C)}"/>`)}}let p=.7+Math.min(Math.max(s,1),3)*.95-.2,l=[];for(let h=0;h<a;h+=1)l.push(`<rect class="table" x="${-.95+h%2*1}" y="${-.95+Math.floor(h/2)*1}" width="0.85" height="0.85" rx="0.12" style="animation-delay:${h*140}ms"/>`);let u=s?`<g transform="${j("front",n-.45,t+1.35,1.55)}"><rect class="brand-badge" x="0" y="0" width="0.9" height="0.9" rx="0.22"/><image href="${c}" x="0.17" y="0.17" width="0.56" height="0.56"/></g>`:"";return{id:e,label:"Supabase database",state:r,svg:`<g class="brand-supabase" style="--brand:#3ECF8E">${Z(n-1.6,t-1.6,3.2,3.2,.7)}${o.join("")}${d.join("")}<g transform="${j("top",n,t,p)}">${l.join("")}</g>${u}</g>`}}function xi(e,n,t,r,s,a){let c=s==="github"?["g-dark","g-light"]:["g-blue","g-green"],o=p=>{let[l,u]=_t(p,0,0);return`${m(l)} ${m(u)}`},d=(p,l)=>{let u=a==="cycle"?`<animateTransform attributeName="transform" type="translate" values="0 0;0 0;${o(p)};${o(p)};0 0;0 0" keyTimes="0;0.16;0.28;0.5;0.62;1" calcMode="spline" keySplines="0 0 1 1;0.4 0 0.2 1;0 0 1 1;0.4 0 0.2 1;0 0 1 1" dur="3.6s" repeatCount="indefinite"/>`:"";return`<g${a==="open"?` transform="translate(${o(p)})"`:""}>${x(l,t+.28,.7,.9,.12,2.5,`door ${s}`)}${u}</g>`};return{id:e,label:s==="github"?"GitHub sign-in gateway":"Google sign-in gateway",state:r,svg:`<g class="brand-${s}" style="--brand:${s==="github"?"#f0f6fc":"#4285F4"}">${Z(n,t,3,.8,.7)}${x(n,t,.7,.6,.7,2.6,"pillar")}${d(-.82,n+.6)}${d(.82,n+1.5)}${x(n+2.4,t,.7,.6,.7,2.6,"pillar")}${x(n-.02,t-.02,3.3,.64,.74,.16,`cap ${c[0]}`)}${x(n+2.38,t-.02,3.3,.64,.74,.16,`cap ${c[1]}`)}${x(n-.1,t-.05,3.46,3.2,.8,.6,"lintel")}${Xt(`gate-${s}`,q(s),n+.85,t+.5,4.06,1.5)}</g>`}}function Si(e,n,t,r){return{id:e,label:"Access rule",state:r,svg:`${x(n,t,.7,.35,1.8,1.1,"bar")}<g transform="${j("side",n+.35,t,1.8)}"><path class="bar-stripes" d="M0.2 0.2 L0.6 0.9 M0.7 0.2 L1.1 0.9 M1.2 0.2 L1.6 0.9"/></g>`}}function Ai(e,n,t,r,s,a,c,o){let d=ie(e,n,t,r,s,a,c,o),p=2.2,l=n+(r-p)/2,u=t+(s-p)/2-.3,h=v(l+p/2,u+p/2,.7+2.4),f=U([v(l,u+p,.7),v(l+p,u+p,.7),h]),g=U([v(l+p,u,.7),v(l+p,u+p,.7),h]),w=`<g class="pyramid">${Z(l,u,p,p,.7)}<polygon class="f-left" points="${f}"/><polygon class="f-right" points="${g}"/><polyline class="edge" points="${U([v(l,u+p,.7),h,v(l+p,u,.7)])}"/></g>`;return{...d,svg:`<g class="pad brand-vercel" style="--brand:#f5f5f7">${d.svg}${w}</g>`}}function Ci(e,n,t,r){return{id:e,label:"GitHub repository",state:r,svg:`<g class="brand-github" style="--brand:#f0f6fc">${Z(n,t,2.1,1.7,.7)}${x(n,t,.7,2.1,1.7,1.5,"vault")}<g transform="${j("top",n,t,2.2)}"><rect class="unit-plate" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><rect class="unit-ring" x="0.35" y="0.25" width="1.2" height="1.2" rx="0.28"/><image href="${J.github}" x="0.6" y="0.5" width="0.7" height="0.7"/></g><g transform="${j("front",n,t+1.7,2.2)}"><g class="gitgraph"><path d="M0.25 0.55 H1.85"/><path class="branch" d="M0.65 0.55 C0.9 0.55 0.9 1.05 1.15 1.05 H1.55"/><circle cx="0.35" cy="0.55" r="0.09"/><circle cx="0.8" cy="0.55" r="0.09"/><circle cx="1.3" cy="0.55" r="0.09"/><circle class="tip" cx="1.8" cy="0.55" r="0.1"/><circle class="branch-dot" cx="1.5" cy="1.05" r="0.09"/></g></g></g>`}}function Kt(e,n,t,r=.066){let a=(o,d,p,l,u)=>x(e+o*r,n,t+(20-l)*r,(d-o)*r,.55,(l-p)*r,u),c=`<g transform="${j("front",e+3*r,n+.55,t+15*r)}"><rect class="cc-eye" x="${m(3*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/><rect class="cc-eye" x="${m(13.510000000000002*r)}" y="${m(3.0999999999999996*r)}" width="${m(1.49*r)}" height="${m(2.85*r)}"/></g>`;return`<g class="critter"><g class="cc-legs a">${a(4.49,6,17,20,"cc cc-leg")}${a(15,16.51,17,20,"cc cc-leg")}</g><g class="cc-legs b">${a(7.49,9,17,20,"cc cc-leg")}${a(18,19.51,17,20,"cc cc-leg")}</g><g class="cc-torso">${a(0,3,10.95,14.05,"cc")}${a(3,21,5,17,"cc")}${a(21,24,10.95,14.05,"cc")}${c}</g></g>`}function $i(e,n,t){let a=`<g class="cx-legs">${x(e+.2,n+.14,t,.24,.32,.26,"cx cx-leg")}${x(e+.76,n+.14,t,.24,.32,.26,"cx cx-leg")}</g>`,c=t+.26+.95,o=`<g transform="${j("front",e+.12,n+.62,c-.12)}"><rect class="cx-screen" x="0" y="0" width="0.96" height="0.6" rx="0.1"/><path class="cx-prompt" d="M0.16 0.17 L0.34 0.3 L0.16 0.43"/><rect class="cx-cursor" x="0.42" y="0.37" width="0.22" height="0.07" rx="0.02"/></g>`,d=`<g class="cx-torso">${x(e-.16,n+.18,t+.52,.16,.26,.42,"cx cx-arm a")}${x(e,n,t+.26,1.2,.62,.95,"cx cx-body")}${x(e+.18,n+.08,c,1.2-.36,.62-.16,.18,"cx cx-cap")}${o}${x(e+1.2,n+.18,t+.52,.16,.26,.42,"cx cx-arm b")}</g>`;return`<g class="codex-bot">${a}${d}</g>`}function Ii(e,n){if(e==="gemini"){let r="M0 -11 Q0 0 11 0 Q0 0 0 11 Q0 0 -11 0 Q0 0 0 -11Z";return`<g class="gm-shots">${[0,1,2].map(s=>`<g class="gm-shot s${s}"><g class="gm-spin"><path d="${r}"/></g><animateMotion dur="0.9s" begin="${m(-s*.3)}s" repeatCount="indefinite" path="${n}"/></g>`).join("")}</g>`}return`<g class="cx-shots">${[16,10,20,12].map((r,s)=>`<g class="cx-shot"><rect x="${m(-r/2)}" y="-2.5" width="${r}" height="5" rx="2.5"/><animateMotion dur="0.7s" begin="${m(-s*.175)}s" repeatCount="indefinite" path="${n}"/></g>`).join("")}</g>`}function ji(e,n=7,t=1.3){let r=[];for(let s=0;s<n;s+=1){let a=e[0]-150+s*46,c=e[1]-190-s%3*18,o=`M${m(a)} ${m(c)} Q${m((a+e[0])/2+(s%2?40:-30))} ${m(c+30)} ${m(e[0])} ${m(e[1])}`;r.push(`<g class="tok"><rect x="-4" y="-4" width="8" height="8" rx="2"/><animateMotion dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite" path="${o}"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.85;1" dur="${t}s" begin="${m(-s*(t/n))}s" repeatCount="indefinite"/></g>`)}return`<g class="hype tokens">${r.join("")}</g>`}function _t(e,n,t){return[(e-n)*le*C,(e+n)*ce*C-t*C]}function We(e,n){let t=e.replace("#",""),r=t.length===3?t.split("").map(c=>c+c).join(""):t;return`rgb(${[0,2,4].map(c=>parseInt(r.slice(c,c+2),16)).map(c=>n<=1?Math.round(c*n):Math.round(c+(255-c)*(n-1))).join(",")})`}function V(e,n,t,r,s=""){let a=(h,f,g)=>_t(h-e/2,f-n/2,g),c=[a(0,0,t),a(e,0,t),a(e,n,t),a(0,n,t)],o=[a(0,n,t),a(e,n,t),a(e,n,0),a(0,n,0)],d=[a(e,0,t),a(e,n,t),a(e,n,0),a(e,0,0)],[p,l]=a(0,0,t),u=s?`<g transform="matrix(${m(le*C)} ${m(ce*C)} ${m(-le*C)} ${m(ce*C)} ${m(p)} ${m(l)})">${s}</g>`:"";return`<polygon points="${U(o)}" fill="${We(r,.72)}"/><polygon points="${U(d)}" fill="${We(r,.52)}"/><polygon points="${U(c)}" fill="${We(r,1.12)}"/>${u}<polyline points="${U([a(0,n,t),a(e,n,t),a(e,0,t)])}" fill="none" stroke="rgba(255,255,255,0.45)" stroke-width="0.8"/>`}function Ti(e,n,t=0){switch(e){case"card":return V(.95,.62,.09,"#635BFF",'<rect x="0.06" y="0.14" width="0.83" height="0.09" fill="rgba(255,255,255,0.75)"/><rect x="0.12" y="0.34" width="0.18" height="0.14" rx="0.03" fill="#f2c15f"/>');case"envelope":return V(.95,.62,.1,"#f2f2f5",'<path d="M0.05 0.05 L0.475 0.36 L0.9 0.05" fill="none" stroke="#9b9ba5" stroke-width="0.04"/>');case"app":return V(.72,.72,.5,"#2c2c34",'<rect x="0.08" y="0.08" width="0.56" height="0.56" rx="0.06" fill="#0e0e12"/><circle cx="0.16" cy="0.16" r="0.03" fill="#f4715f"/><circle cx="0.24" cy="0.16" r="0.03" fill="#f2c15f"/><rect x="0.14" y="0.28" width="0.44" height="0.08" rx="0.03" fill="rgba(255,255,255,0.35)"/>');case"user":return V(.46,.46,.46,"#f5f5f7",'<circle cx="0.23" cy="0.18" r="0.07" fill="#55555f"/><path d="M0.1 0.38 Q0.23 0.22 0.36 0.38" fill="#55555f"/>');case"commit":return V(.44,.44,.44,"#3fb950",'<circle cx="0.22" cy="0.22" r="0.08" fill="none" stroke="#0d1117" stroke-width="0.05"/>');case"event":return V(.42,.42,.42,["#F54E00","#F9BD2B","#1D4AFF"][t%3]);case"record":return V(.5,.5,.36,n,'<rect x="0.08" y="0.12" width="0.34" height="0.06" fill="rgba(255,255,255,0.55)"/><rect x="0.08" y="0.26" width="0.24" height="0.06" fill="rgba(255,255,255,0.35)"/>');default:return V(.48,.48,.48,n)}}function Ne(e,n,t,r={}){let s=r.count??2,a=r.dur??3.2,c=r.travel??.55,o=[];for(let d=0;d<s;d+=1){let p=`${m(-d*(a/s))}s`;o.push(`<g class="pl"><g>${Ti(n,t,d)}</g><animateMotion dur="${a}s" begin="${p}" repeatCount="indefinite" path="${e}" keyPoints="0;1;1" keyTimes="0;${c};1" calcMode="spline" keySplines="0.45 0 0.25 1;0 0 1 1"/><animate attributeName="opacity" values="0;1;1;0;0" keyTimes="0;0.06;${m(c-.03)};${c};1" dur="${a}s" begin="${p}" repeatCount="indefinite"/></g>`),r.landing&&o.push(r.landing(p))}return`<g class="hype">${o.join("")}</g>`}function Le(e,n,t,r,s,a=34){let c=Math.min(r+.22,.99);return`<ellipse cx="${m(e[0])}" cy="${m(e[1])}" rx="${a*.4}" ry="${m(a*.4*.42)}" fill="none" stroke="${s}" stroke-width="2" opacity="0"><animate attributeName="rx" values="${a*.4};${a*.4};${a};${a}" keyTimes="0;${r};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="ry" values="${m(a*.4*.42)};${m(a*.4*.42)};${m(a*.42)};${m(a*.42)}" keyTimes="0;${r};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/><animate attributeName="opacity" values="0;0;0.9;0;0" keyTimes="0;${r};${m(r+.02)};${m(c)};1" dur="${t}s" begin="${n}" repeatCount="indefinite"/></ellipse>`}function Xt(e,n,t,r,s,a,c=.28,o=10){let d=[];for(let u=o-1;u>=0;u-=1){let h=c*u/(o-1);d.push(`<g transform="${j("front",t,r-h,s+a)}"><image class="${u===0?"emb-face":"emb-side"}" href="${n}" x="0" y="0" width="${a}" height="${a}"/></g>`)}let p=`emb-${e.replace(/[^a-z0-9-]/gi,"")}`,l=`<g transform="${j("front",t,r,s+a)}"><mask id="${p}" maskUnits="userSpaceOnUse" x="-1" y="-1" width="${a+2}" height="${a+2}" style="mask-type:alpha"><image href="${n}" x="0" y="0" width="${a}" height="${a}"/></mask><g mask="url(#${p})"><rect class="emb-sheen" x="${m(-a*.6)}" y="0" width="${m(a*.45)}" height="${a}"><animateTransform attributeName="transform" type="translate" values="0 0;${m(a*1.9)} 0;${m(a*1.9)} 0" keyTimes="0;0.3;1" dur="4.8s" repeatCount="indefinite"/></rect></g></g>`;return`<g class="emblem">${d.join("")}${l}</g>`}function Jt(e,n,t,r,s,a,c,o=1.5){let d=o+.5,p=`${Z(r,s,d,1.25,.7)}${x(r,s,.7,d,1.25,.34,"plinth")}<g transform="${j("front",r,s+1.25,1.04)}"><rect class="unit-led" x="${m(d*.15)}" y="0.13" width="${m(d*.7)}" height="0.09" rx="0.045"/></g>`;return{id:e,label:n,state:t,svg:`<g class="unit-wrap emblem-unit" style="--brand:${c}">${p}<g class="emb-float">${Xt(e,a,r+.25,s+.8,1.06,o)}</g></g>`}}var he={supabase:{name:"Supabase",brand:"#3ECF8E",payload:"record",verb:"Records reach the database"},vercel:{name:"Vercel",brand:"#f5f5f7",payload:"app",verb:"The app reaches Vercel"},github:{name:"GitHub",brand:"#f0f6fc",payload:"commit",verb:"Commits reach the repository"},stripe:{name:"Stripe",brand:"#635BFF",payload:"card",verb:"A test payment reaches Stripe"},sentry:{name:"Sentry",brand:"#8B5CF6",payload:"event",verb:"A test error reaches Sentry"},posthog:{name:"PostHog",brand:"#F54E00",payload:"event",verb:"Events reach PostHog"},clerk:{name:"Clerk",brand:"#6C47FF",payload:"user",verb:"A test user signs in with Clerk"},authjs:{name:"Auth.js",brand:"#a855f7",payload:"user",verb:"A test user signs in"},resend:{name:"Resend",brand:"#f5f5f7",payload:"envelope",verb:"A test email reaches Resend"},upstash:{name:"Upstash",brand:"#00E9A3",payload:"record",verb:"Keys reach Redis"},neon:{name:"Neon",brand:"#00E599",payload:"record",verb:"Rows reach Postgres"},railway:{name:"Railway",brand:"#f5f5f7",payload:"app",verb:"The app reaches Railway"},render:{name:"Render",brand:"#f5f5f7",payload:"app",verb:"The app reaches Render"},cloudflare:{name:"Cloudflare",brand:"#F38020",payload:"cube",verb:"Traffic reaches the edge"},google:{name:"Google",brand:"#4285F4",payload:"user",verb:"A test user signs in with Google"}};function q(e){return e==="google"?gi:J[e]??oe.check}function Ze(e){return e.map(n=>n.toFixed(3)).join(";")}function N(e,n,t,r){return e.startsWith("transform-")?`<animateTransform attributeName="transform" type="${e.slice(10)}" values="${n.join(";")}" keyTimes="${Ze(t)}" dur="${r}s" repeatCount="indefinite"/>`:`<animate attributeName="${e}" values="${n.join(";")}" keyTimes="${Ze(t)}" dur="${r}s" repeatCount="indefinite"/>`}function qe(e,n,t,r,s){return`<g transform="translate(${m(e[0])} ${m(e[1])})"><g>${N("transform-scale",n.map(a=>`${a} ${a}`),t,r)}<g transform="translate(${m(-e[0])} ${m(-e[1])})">${s}</g></g></g>`}function ae(e,n){return`${m(n[0]-e[0])} ${m(n[1]-e[1])}`}function Me(e,n,t,r=7){let s=`M0 ${-r} L${r*.25} ${-r*.25} L${r} 0 L${r*.25} ${r*.25} L0 ${r} L${-r*.25} ${r*.25} L${-r} 0 L${-r*.25} ${-r*.25} Z`,a=Math.max(.001,n-.02),c=Math.min(.998,n+.08);return`<g transform="translate(${m(e[0])} ${m(e[1])})"><path class="sparkle" d="${s}" opacity="0">${N("opacity",["0","0","1","0","0"],[0,a,n,c,1],t)}</path></g>`}function en(e,n,t,r){let s=Array.from({length:5},(o,d)=>`<g class="oc-tent t${d%2}">${x(e+.06+d*.25,n+.5,t,.19,.34,.44,"oc")}${x(e+.06+d*.25,n+.84,t,.19,.14,.12,"oc")}</g>`).join(""),a=`<g transform="${j("front",e,n+1.3,t+1.44)}"><rect class="oc-face" x="0.12" y="0.14" width="1.06" height="0.74" rx="0.12"/><rect class="oc-eye" x="0.3" y="0.32" width="0.18" height="0.26"/><rect class="oc-eye" x="0.82" y="0.32" width="0.18" height="0.26"/><rect class="oc-shine" x="0.36" y="0.35" width="0.06" height="0.07"/><rect class="oc-shine" x="0.88" y="0.35" width="0.06" height="0.07"/><rect class="oc-mouth" x="0.6" y="0.68" width="0.1" height="0.04"/></g>`,c=v(e+1.4,n+.78,t+1.05);return`<g class="octocat">${s}${x(e-.2,n+.66,t+.6,.2,.24,.46,"oc")}${x(e,n+.3,t+.44,1.3,1,1,"oc")}${x(e+.04,n+.45,t+1.44,.3,.3,.28,"oc")}${x(e+.96,n+.45,t+1.44,.3,.3,.28,"oc")}${a}${r(x(e+1.3,n+.66,t+.6,.2,.24,.46,"oc"),c)}</g>`}function tn(e,n,t,r,s=7,a=1.3){let c=v(e+.65,n+.8,t),o=v(e+.65,n+.8,t+1.1+1.3*a),d=v(e-1.6,n+.4,t+3.2),p=v(e+2.9,n+1.2,t+3),l=v(e+.65+.95*a,n+.8,t+1.5*a),u=[(l[0]+r[0])/2,Math.min(l[1],r[1])-70],h=(y,k)=>`<g>${N("transform-rotate",["0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"-70 "+m(k[0])+" "+m(k[1]),"45 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1]),"0 "+m(k[0])+" "+m(k[1])],[0,.44,.5,.54,.6,1],s)}${y}</g>`,f=`<g>${N("transform-translate",["0 0","0 0","0 -9","0 0","0 -6","0 0","0 0"],[0,.62,.66,.7,.73,.76,1],s)}${en(e,n,t,h)}</g>`,g=qe(c,[0,0,1.15*a,a,a,0,0],[0,.02,.08,.11,.8,.86,1],s,f),w=(y,k)=>`<g transform="translate(${m(y[0])} ${m(y[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.12,.14,.355,.37,1],s)}${N("transform-translate",["0 0","0 0",ae(y,o),ae(y,o)],[0,.12,.36,1],s)}${V(.42,.42,.42,k,'<circle cx="0.21" cy="0.21" r="0.08" fill="none" stroke="rgba(0,0,0,0.55)" stroke-width="0.05"/>')}</g></g>`,b=`<g transform="translate(${m(o[0])} ${m(o[1]-6)})"><circle class="burst" r="2" opacity="0">${N("opacity",["0","0","1","0","0"],[0,.355,.365,.43,1],s)}<animate attributeName="r" values="2;2;26;26" keyTimes="${Ze([0,.355,.43,1])}" dur="${s}s" repeatCount="indefinite"/></circle></g>`,L=`<g transform="translate(${m(o[0])} ${m(o[1])})"><g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.365,.38,.655,.67,1],s)}${N("transform-translate",["0 0","0 0",ae(o,l),ae(o,l),ae(o,u),ae(o,r),ae(o,r)],[0,.44,.5,.53,.595,.66,1],s)}${qe([0,0],[0,0,1.25,1,1],[0,.365,.4,.43,1],s,V(.5,.5,.5,"#8957e5",'<path d="M0.12 0.12 L0.12 0.38 M0.12 0.18 Q0.25 0.3 0.38 0.38" fill="none" stroke="#fff" stroke-width="0.05" stroke-linecap="round"/><circle cx="0.12" cy="0.12" r="0.05" fill="#fff"/><circle cx="0.38" cy="0.38" r="0.05" fill="#fff"/>'))}</g></g>`,$=`<g transform="translate(${m(o[0])} ${m(o[1]-34)})" opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.38,.4,.5,.52,1],s)}<rect class="say" x="-30" y="-10" width="60" height="20" rx="10"/><text class="say-text" x="0" y="4" text-anchor="middle">merged!</text></g>`;return`<g class="hype skit">${g}${w(d,"#3fb950")}${w(p,"#2f81f7")}${b}${L}${$}</g>`}function Ni(e,n,t,r=7.2){let s=v(e+.65,n+.8,t),a=(o,d)=>{let p=l=>`${l} ${m(d[0])} ${m(d[1])}`;return`<g>${N("transform-rotate",[p(0),p(0),p(-80),p(-40),p(-80),p(-40),p(-80),p(0),p(0),p(-110),p(0),p(0)],[0,.08,.11,.14,.17,.2,.23,.27,.58,.61,.66,1],r)}${o}</g>`},c=`<g>${N("transform-translate",["0 0","0 0","0 -12","0 0","0 -8","0 0","0 0"],[0,.58,.61,.64,.67,.7,1],r)}${en(e,n,t,a)}</g>`;return`<g class="hype skit">${qe(s,[0,0,1.12,1,1,0,0],[0,.02,.06,.08,.84,.9,1],r,c)}</g>`}function Di(e,n,t,r){let s=[];for(let h=0;h<5;h+=1)s.push(x(e-.04+h*.25,n+.04,t+2.25,.2,.3,.2+h%2*.18,"mx-spike"));for(let h=0;h<4;h+=1)s.push(x(e+1.16,n+.06,t+.45+h*.42,.2+h%2*.1,.3,.2,"mx-spike")),s.push(x(e-.3-h%2*.08,n+.06,t+.6+h*.42,.24+h%2*.08,.3,.2,"mx-spike"));let a=`${x(e-.08,n,t+.3,1.26,.42,1.95,"mx-spike")}${s.join("")}`,c=`${x(e+.16,n+.45,t,.3,.34,.32,"mx-leg")}${x(e+.64,n+.45,t,.3,.34,.32,"mx-leg")}`,o=`${x(e+.05,n+.35,t+.3,1,.62,.86,"mx-body")}<g transform="${j("front",e+.05,n+.97,t+1.16)}"><rect class="mx-belly" x="0.2" y="0.1" width="0.6" height="0.66" rx="0.22"/></g>`,d=`<g transform="${j("front",e,n+1.05,t+1.95)}"><rect class="mx-eye" x="0.2" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-eye" x="0.7" y="0.3" width="0.2" height="0.07" rx="0.03"/><rect class="mx-brow" x="0.17" y="0.19" width="0.26" height="0.05"/><rect class="mx-brow" x="0.67" y="0.19" width="0.26" height="0.05"/></g>`,p=`${x(e,n+.3,t+1.15,1.1,.75,.8,"mx-face")}${d}${x(e+.3,n+1.05,t+1.2,.5,.34,.36,"mx-snout")}${x(e+.46,n+1.39,t+1.38,.18,.08,.15,"mx-nose")}`,l=`${x(e-.06,n+.24,t+1.95,1.22,.92,.06,"mx-hat")}${x(e+.14,n+.38,t+2.01,.82,.62,.3,"mx-hat")}${x(e+.49,n+.38,t+2.31,.12,.62,.05,"mx-hat-ridge")}`,u=v(e+1.14,n+.63,t+1.12);return`<g class="hog">${a}${c}${x(e-.13,n+.5,t+.62,.18,.26,.52,"mx-body")}${o}${p}${l}${r(x(e+1.05,n+.5,t+.62,.18,.26,.52,"mx-body"),u)}</g>`}function nn(e,n,t=8){let s=($,y)=>{let k=E=>`${E} ${m(y[0])} ${m(y[1])}`;return`<g>${N("transform-rotate",[k(0),k(0),k(-150),k(-150),k(-10),k(-10),k(-160),k(-110),k(-160),k(-110),k(0),k(0)],[0,.18,.22,.3,.34,.45,.48,.52,.56,.6,.64,1],t)}${$}</g>`},a=`<g>${N("transform-translate",["0 0","0 0","0 3","0 0","0 0","0 -16","0 0","0 -12","0 0","0 0"],[0,.3,.33,.37,.48,.52,.56,.6,.64,1],t)}${Di(e,n,.7,s)}</g>`,c=qe(v(e+.55,n+.7,.7),[0,0,1.12,1,1,0,0],[0,.02,.08,.11,.78,.84,1],t,a),o=e+1.75,d=n+.7,p=`0 ${m(-1.6*C)}`,l=$=>["#55555f","#55555f","#F54E00","#F54E00","#55555f","#55555f"].map(y=>y==="#55555f"?y:We(y,$)).join(";"),u=($,y)=>`<polygon class="mx-flag" points="${U($)}"><animate attributeName="fill" values="${l(y)}" keyTimes="${Ze([0,.32,.42,.86,.9,1])}" dur="${t}s" repeatCount="indefinite"/></polygon>`,h=.7+.3,f=[v(o+.1,d+.06,h+.45),v(o+.85,d+.06,h+.45),v(o+.85,d+.06,h),v(o+.1,d+.06,h)],g=[v(o+.1,d,h+.45),v(o+.85,d,h+.45),v(o+.85,d+.06,h+.45),v(o+.1,d+.06,h+.45)],w=`<g>${N("transform-translate",["0 0","0 0",p,p,"0 0","0 0"],[0,.32,.42,.86,.94,1],t)}${u(f,1)}${u(g,1.2)}<g transform="${j("front",o+.1,d+.06,h+.45)}"><text class="flag-text" x="0.38" y="0.31" text-anchor="middle" opacity="0">ON${N("opacity",["0","0","1","1","0","0"],[0,.42,.45,.84,.86,1],t)}</text></g></g>`,b=`${Z(o,d,.12,.12,.7)}${x(o,d,.7,.1,.1,2.55,"mx-pole")}${x(o-.08,d-.08,.7,.26,.26,.08,"mx-pole")}${x(o-.03,d-.03,3.25,.16,.16,.08,"mx-pole")}`,L=[Me(v(o+.6,d,3.4),.43,t),Me(v(o+1,d,2.9),.46,t,5),Me(v(o+.2,d,3.6),.49,t,5)].join("");return`<g class="hype skit">${c}${b}${w}${L}</g>`}function Ei(e,n=7){let t=v(...e),r=v(e[0]+1.75,e[1]+.3,e[2]+1.2),s=v(3,2,.7),a=v(6.8,2,.7),c=(A,I)=>`${m((A[0]+I[0])/2-t[0])} ${m(Math.min(A[1],I[1])-40-t[1])}`,o=A=>ae(t,A),d=["0 0","0 0",c(t,s),o(s),o(a),o(s),o(a),c(a,t),"0 0","0 -10","0 0","0 0"],p=[0,.08,.14,.2,.36,.5,.64,.72,.8,.84,.88,1],l=["0 0","5 -3","0 -7","-5 -3"],u=["0 0"],h=[0];for(let A=0;.2+A*.022<=.64;A+=1)u.push(l[A%4]),h.push(Number((.2+A*.022).toFixed(3)));u.push("0 0"),h.push(1);let f=[[-6,0],[4,-.27],[10,-.54],[-2,-.81]].map(([A,I],H)=>`<circle class="bubble" cx="${m(r[0]+A)}" cy="${m(r[1]-6)}" r="${2.2+H%2*1.4}"><animate attributeName="cy" values="${m(r[1]-6)};${m(r[1]-34)}" dur="1.08s" begin="${I}s" repeatCount="indefinite"/><animate attributeName="opacity" values="0;1;1;0" keyTimes="0;0.15;0.7;1" dur="1.08s" begin="${I}s" repeatCount="indefinite"/></circle>`).join(""),g=A=>`<g opacity="0">${N("opacity",["0","0","1","1","0","0"],[0,.19,.2,.64,.65,1],n)}${A}</g>`,w=`<g>${N("transform-translate",u,h,n)}${g(`<g transform="translate(${m(r[0])} ${m(r[1])})">${V(.56,.3,.32,"#f2c15f",'<circle cx="0.14" cy="0.1" r="0.035" fill="#c99528"/><circle cx="0.32" cy="0.2" r="0.03" fill="#c99528"/><circle cx="0.44" cy="0.08" r="0.03" fill="#c99528"/>')}<ellipse class="foam" cx="-2" cy="-9" rx="9" ry="4"/></g>`)}</g>`,b=`<g>${N("transform-translate",d,p,n)}<g class="critter is-busy">${Kt(...e).replace('<g class="critter">',"<g>")}</g>${g(f)}${w}</g>`,L=A=>.2+(A-2.07)/3.8*.16,$=[[2.4,3.9],[3.2,3.6],[4.1,4.1],[4.9,3.7],[5.7,4]],y=$.map(([A,I])=>{let H=L(A);return`<g class="smudge">${N("opacity",["1","1","0","0","1","1"],[0,H,H+.03,.9,.98,1],n)}<ellipse cx="${A}" cy="${I}" rx="0.42" ry="0.24"/><ellipse cx="${m(A+.3)}" cy="${m(I-.16)}" rx="0.2" ry="0.13"/><path class="streak" d="M${m(A-.4)} ${m(I+.2)} q0.3 -0.25 0.75 -0.1"/></g>`}).join(""),k=[...$.map(([A,I])=>Me(v(2+A,1.62,5.3-I+.2),L(A)+.02,n,9)),Me(v(4.4,1.62,3.9),.7,n,10),Me(v(7.6,1.62,3.2),.74,n,8)].join("");return`<g class="hype skit">${`<g transform="${j("front",2,1.62,5.3)}"><clipPath id="polish-clip"><rect width="7" height="4.6" rx="0.18"/></clipPath><g clip-path="url(#polish-clip)">${y}<g transform="skewX(-22)"><rect x="-1.6" y="-0.5" width="1.3" height="5.6" fill="url(#sc-sheen)" opacity="0">${N("transform-translate",["0 0","0 0","11 0","11 0"],[0,.66,.8,1],n)}${N("opacity",["0","0","0.9","0.9","0","0"],[0,.655,.67,.79,.8,1],n)}</rect></g></g></g>`}${k}${b}</g>`}var Pi=()=>typeof matchMedia!="function"||!matchMedia("(prefers-reduced-motion: reduce)").matches;function fe(e,n,t=7){let r=[];if(!e.length){let s=n==="active"?" sketch":"",a=(t-1.1)/2;return r.push(`<rect class="ghost-panel${s}" x="0.4" y="1" width="${t-.8}" height="0.85" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="0.4" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.push(`<rect class="ghost-panel${s}" x="${.7+a}" y="2.1" width="${a}" height="1.9" rx="0.12" pathLength="1"/>`),r.join("")}return e.slice(0,3).forEach((s,a)=>{let c=1+a*1.05,o=s.path.split("/").pop()??s.path;r.push(`<g class="panel-in" style="animation-delay:${a*90}ms"><rect class="panel ${s.kind}" x="0.4" y="${c}" width="${t-.8}" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="${c+.22}" width="${Math.min(t-2,1.2+o.length*.16)}" height="0.12" rx="0.06"/><text class="panel-name" x="0.65" y="${c+.66}">${ut(o)}</text></g>`)}),e.length>3&&r.push(`<text class="panel-name more" x="0.65" y="${1+3*1.05+.4}">+${e.length-3} more</text>`),r.join("")}function Oi(e){return e==="passed"?"done":e==="failed"?"failed":e==="active"?"active":e==="not_run"?"idle":"planned"}var rn=[[8.2,7.6],[9.9,6.5],[11.5,5.3]];function ue(e,n=rn){return e.checks.slice(0,n.length).map((t,r)=>Mi(`check:${t.id}`,n[r][0],n[r][1],Oi(t.status),t.label))}function me(e,n,t,r,s=2,a=7){return hi("window",s,1.3,a,4.6,n,t,r)}function sn(e){return[G("pipe-live",Te([[9.15,1.85,.72],[10.9,1.85,.72],[10.9,2.7,.72]]),e["pipe-live"]??"planned","To the live preview"),Li("port",10.4,2.7,e.port??"planned")]}function Ri(e,n){let t=e.parts,r=e.agent?B[e.agent.id]:B.claude,s=!e.agent||e.agent.id==="claude",a=de([2.6,4.8,5],[5.2,1.62,3.4],.5),c=s&&n&&e.phase==="done"&&t.agent==="done",o=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned"),"Your app (workflow view)"),...sn(t),G("beam",a,t.beam??"planned","Agent at work"),...ue(e,e.postSlots??rn),ki("agent",1.4,4.2,3.8,t.agent??"planned",r,e.agent?.label??"Coding agent",yi[e.agent?.id??"claude"],s?"claude":e.agent?.id==="codex"?"codex":null,c)],d=[];return t.beam==="active"&&n&&(s?d.push(Ve(a,"spark",.55,!0,!0),ji(v(2.45,4.75,5.05),8,.9)):d.push(Ii(e.agent?.id??"codex",a))),c&&d.push(Ei([1.5,4.75,4.35])),{parts:o,fx:d,viewBox:""}}function Ui(e,n,t,r,s){let a=[.5,.9,1.3,1.7].map(c=>`<rect class="vent" x="0.25" y="${c}" width="1" height="0.14" rx="0.07"/>`).join("");return{id:e,label:s?`${s} dev server`:"Dev server",state:r,svg:`<g class="unit-wrap" style="--brand:rgba(255,255,255,0.4)">${Z(n,t,1.5,1.5,.7)}${x(n,t,.7,1.5,1.5,2.6,"tower")}<g transform="${j("top",n,t,3.3)}"><rect class="unit-plate" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><rect class="unit-ring" x="0.25" y="0.25" width="1" height="1" rx="0.22"/><image href="${bi(s)}" x="0.42" y="0.42" width="0.66" height="0.66"/></g><g transform="${j("front",n,t+1.5,3.3)}">${a}<rect class="tower-led" x="0.25" y="2.2" width="0.5" height="0.16" rx="0.08"/></g></g>`}}function Fi(e,n,t,r,s){return{id:e,label:"Run command",state:r,svg:`${_e({x:n,y:t,size:1.5,h:.75,mark:fi,brand:"#CB3837",grounded:!0})}${Ke(n+.75,t+.75,2.55,s,"tag-cmd")}`}}function zi(e,n){let t=e.parts,s=t.window==="waiting"?'<g class="key-sign"><circle cx="3.5" cy="2.5" r="0.85"/><path d="M3.1 2.5 h0.9 m-0.3 0 v0.35 m-0.25 -0.35 v0.25"/></g>':t.window==="done"?'<g class="panel-in"><rect class="panel modified" x="0.4" y="1" width="6.2" height="0.85" rx="0.12"/><rect class="panel-line" x="0.65" y="1.3" width="3" height="0.12" rx="0.06"/></g><g class="panel-in" style="animation-delay:90ms"><rect class="panel" x="0.4" y="2.1" width="2.95" height="1.9" rx="0.12"/><rect class="panel" x="3.65" y="2.1" width="2.95" height="1.9" rx="0.12"/></g>':fe([],t.window??"planned"),a=de([4,6,3.4],[4.6,1.62,3.3],.6),c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",s,"Your app (workflow view)"),...sn(t),G("pipe-power",Te([[2.3,7.6,.72],[3.9,7.6,.72],[3.9,6.9,.72]]),t["pipe-power"]??"planned","Runs"),Ui("server",3.2,5.2,t.server??"planned",e.framework),G("pipe-serve",a,t["pipe-serve"]??"planned","Serves the page"),Fi("command",.7,7,t.command??"planned",e.caption.match(/(?:npm|pnpm|yarn|bun) run \w+/)?.[0]??"npm run dev"),...ue(e,[[9.6,6.6]])],o=[];return t["pipe-serve"]==="active"&&n&&o.push(Ve(a,"spark",1.6,!0,!0)),{parts:c,fx:o,viewBox:""}}function Hi(e,n){let t=e.parts,r=e.provider==="github"?"github":"google",s=de([11.6,1.9,2.6],[9.9,4.7,2.2],1),a=de([9.9,4.7,2.2],[5.4,1.62,3.2],.6),c=`${s} ${a.replace(/^M[^Q]+/,"")}`,o=t["pipe-app"]==="active"||t.gateway==="active",d=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),pt("auth",11.6,1.9,t.auth??"planned",t.auth==="planned"?0:2,0,J.supabase),G("pipe-provider",s,t["pipe-provider"]??"planned",`${r==="github"?"GitHub":"Google"} to gateway`),G("pipe-app",a,t["pipe-app"]??"planned","Gateway to app"),xi("gateway",8.4,4.4,t.gateway??"planned",r,o&&n?"cycle":t["pipe-app"]==="done"||t.gateway==="done"?"open":"closed"),...ue(e,[[4.2,7.9],[7.4,7.3]])],p=[];return o&&n&&r==="github"&&p.push(Ni(10.9,5,.7)),o&&n&&p.push(Ne(c,"user","#f5f5f7",{count:1,dur:3.6,travel:.7,landing:l=>Le(v(5.4,1.62,3.2),l,3.6,.7,"rgba(245,245,247,0.8)",30)})),{parts:d,fx:p,viewBox:""}}function Bi(e,n){let t=e.parts,r=t.db==="planned"?0:t.db==="active"?2:3,s=t.schema==="done"?4:t.schema==="active"?2:0,a=de([5.6,1.62,3],[10.6,5.2,.7+Math.max(r,1)*.95],1.2),c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"planned",fe(e.files,t.window??"planned",6),"Your app (demo)",1.5,6),G("pipe-db",a,t["pipe-db"]??"planned","App to database"),pt("db",10.6,5.2,t.db??"planned",r,s,J.supabase),...ue(e,[[2.4,7.4],[5.6,7.9]])],o=[];if((t.db==="active"||t["pipe-db"]==="active")&&n){let d=.7+Math.max(r,1)*.95,p=l=>`${Le(v(10.6,5.2,d),l,3.4,.55,"rgba(62,207,142,0.9)",44)}${Yi(10.6,5.2,r,l,3.4,.55)}`;o.push(Ne(a,"record","#3ECF8E",{count:2,dur:3.4,travel:.55,landing:p}))}return{parts:c,fx:o,viewBox:""}}function Yi(e,n,t,r,s,a){let c=1.55*C*1.2247,o=1.55*C*.7071;return Array.from({length:Math.max(t,1)},(d,p)=>{let l=Math.max(t,1)-1-p,[u,h]=v(e,n,.7+l*.95+.75),f=Math.min(a+.03+p*.06,.9);return`<path d="M${m(u-c)} ${m(h+.18*C)} A${m(c)} ${m(o)} 0 0 0 ${m(u+c)} ${m(h+.18*C)}" fill="none" stroke="#7dffc4" stroke-width="2.4" stroke-linecap="round" opacity="0"><animate attributeName="opacity" values="0;0;1;0;0" keyTimes="0;${m(f)};${m(f+.04)};${m(Math.min(f+.2,.98))};1" dur="${s}s" begin="${r}" repeatCount="indefinite"/></path>`}).join("")}function Zt(e,n,t,r,s){return{id:e,label:r,state:s,svg:`${Z(n,t,.9,.9,.7)}${x(n,t,.7,.9,.9,.9,"post")}${Ke(n+.45,t+.45,2.3,r)}`}}function Gi(e,n){let t=e.parts,r=Te([[1.6,7.6,.75],[9.4,7.6,.75],[9.4,6.2,.75]]),s=Te([[1.6,3,.75],[9.4,3,.75],[9.4,4.4,.75]]),a=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),G("path-other",s,t["path-other"]??"planned","Others cannot read"),G("path-owner",r,t["path-owner"]??"planned","Owner can read"),Zt("other",.6,2.5,"Other user","done"),Si("rule",5.4,2.2,t.rule??"planned"),pt("db",10.8,5.3,t.db??"done",3,4,J.supabase),Zt("owner",.6,7.1,"Owner","done"),...ue(e,[[4.4,9.1],[7.4,.6]])],c=[];return(t["path-owner"]==="active"||t["path-owner"]==="done")&&c.push(Ve(r,"user",2.4,t["path-owner"]==="active",n)),(t["path-other"]==="active"||t["path-other"]==="done"||t["path-other"]==="failed")&&c.push(Ve(s,t["path-other"]==="failed"?"leak":"blocked",2.4,t["path-other"]==="active",n,t["path-other"]==="failed"?void 0:.42)),{parts:a,fx:c,viewBox:""}}function Qi(e,n){let t=e.parts,r=Te([[6.6,1.9,.72],[7.4,1.9,.72],[7.4,4.6,.72]]),s=de([7.5,5.4,2.3],[15.3,-1.3,.75],2.6),a=[ie("platform",0,0,10,8,"This computer",t.platform??"done"),Ai("preview",12.6,-3.6,5.4,4.6,"Preview",t.preview??"planned",J.vercel),me(e,t.window??"done",fe([{path:"app",kind:"modified"}],"done",5.4),"Your app (demo)",1,5.4),G("push",r,t.build==="planned"?"planned":"done","Push"),Ci("build",6.4,4.6,t.build??"planned"),G("flight",s,t.flight??"planned","Build and upload"),...ue(e,[[17.2,-2.9]])],c=[];return t.build==="active"&&n&&c.push(Ne(r,"commit","#3fb950",{count:2,dur:2.8,travel:.6})),(t.flight==="active"||t.preview==="active")&&n&&(c.push(tn(6.8,4.5,2.2,v(15.3,-.6,.9),7)),c.push(`<g class="hype">${Wi(12.6,-3.6,5.4,4.6,"0s",7,.66)}${Le(v(15.3,-1.3,.7),"0s",7,.67,"rgba(245,245,247,0.85)",52)}</g>`)),{parts:a,fx:c,viewBox:""}}function Wi(e,n,t,r,s,a,c){let d=e+(t-2.2)/2,p=n+(r-2.2)/2-.3,l=v(d+2.2/2,p+2.2/2,.7+2.4),u=[v(d,p+2.2,.7),v(d+2.2,p+2.2,.7),l],h=[v(d+2.2,p,.7),v(d+2.2,p+2.2,.7),l],f=Math.max(u[0][1],u[1][1],h[0][1]),g="vx-sweep",w=b=>`<rect x="${m(Math.min(u[0][0],h[0][0])-4)}" y="${m(f)}" width="${m(Math.abs(h[0][0]-u[0][0])+60)}" height="26" fill="url(#sc-sweep-v)"><animate attributeName="y" values="${m(f)};${m(f)};${m(l[1]-26)};${m(l[1]-26)}" keyTimes="0;${c};${m(Math.min(c+.24,.98))};1" dur="${a}s" begin="${b}" repeatCount="indefinite"/></rect>`;return`<clipPath id="${g}"><polygon points="${U(u)}"/><polygon points="${U(h)}"/></clipPath><g clip-path="url(#${g})">${w(s)}</g>`}function Vi(e,n){let t=e.parts,r=[11.35,3.2,1.08],s=de([6.4,1.62,3],r,1.6),a=t.event==="active"||t.posthog==="active",c=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"done",fe([{path:"instrumentation.ts",kind:"added"}],"done",6),"Your app (demo)",1.5,6),{id:"insights",label:"PostHog insight",state:t.posthog??"planned",svg:Zi(7.6,6.6,t.posthog==="done"?"done":a&&n?"live":"idle")},G("event",s,t.event??"planned","Event to PostHog"),Jt("posthog","PostHog project",t.posthog??"planned",10.1,2.2,J.posthog,"#F54E00",2),...ue(e,[[4.4,7.8]])],o=[];return a&&n&&o.push(nn(9.8,4.7)),a&&n&&o.push(Ne(s,"event","#F54E00",{count:3,dur:3.3,travel:.5,landing:d=>Le(v(...r),d,3.3,.5,"rgba(245,78,0,0.9)",52)})),{parts:c,fx:o,viewBox:""}}function Zi(e,n,t){let a="M0.25 1.35 L0.7 1.15 L1.05 1.22 L1.45 0.88 L1.85 0.95 L2.3 0.5",c=t==="live"?`<path class="ins-line" d="${a}" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"><animate attributeName="stroke-dashoffset" values="1;1;0;0" keyTimes="0;0.5;0.8;1" dur="3.3s" repeatCount="indefinite"/></path><circle class="ins-dot" cx="2.3" cy="0.5" r="0.07" opacity="0"><animate attributeName="opacity" values="0;0;1;1;0" keyTimes="0;0.78;0.82;0.95;1" dur="3.3s" repeatCount="indefinite"/></circle>`:`<path class="ins-line" d="${a}" opacity="${t==="done"?1:.35}"/>${t==="done"?'<circle class="ins-dot" cx="2.3" cy="0.5" r="0.07"/>':""}`;return`<g class="insight">${Z(e+.9,n+.5,.6,.4,.7)}${x(e+1.1,n+.45,.7,.4,.3,.6,"stand")}${x(e,n,1.3,2.6,.12,1.7,"card")}<g transform="${j("front",e,n+.12,1.3+1.7)}"><rect class="ins-bg" x="0.1" y="0.1" width="${2.6-.2}" height="${1.7-.2}" rx="0.08"/><rect class="ins-title" x="0.25" y="0.22" width="0.9" height="0.1" rx="0.05"/><path class="ins-grid" d="M0.25 0.7 H2.35 M0.25 1.05 H2.35 M0.25 1.4 H2.35"/>${c}</g></g>`}function qi(e,n){let t=e.parts,r=e.provider&&he[e.provider]?e.provider:"supabase",s=he[r],[a,c,o]=[10.1,2.2,2.1],d=[a+(o+.5)/2,c+1,1.08],p=de([6.4,1.62,3],d,1.6),l=[ie("platform",0,0,13,10,"This computer",t.platform??"done"),me(e,t.window??"done",fe([{path:`${r}.ts`,kind:"added"}],"done",6),"Your app (demo)",1.5,6),G("link",p,t.link??"planned",`App to ${s.name}`),Jt("provider",s.name,t.provider??"planned",a,c,q(r),s.brand,o),...ue(e,[[3.4,7.6]])],u=[],h=(t.link==="active"||t.provider==="active")&&n;return h&&r==="github"&&u.push(tn(7,4.6,.7,v(d[0],d[1],1.5),7),`<g class="hype">${Le(v(...d),"0s",7,.66,s.brand,52)}</g>`),h&&r==="posthog"&&u.push(nn(9.8,4.7)),h&&r!=="github"&&u.push(Ne(p,s.payload,s.brand,{count:2,dur:3.2,travel:.55,landing:f=>Le(v(...d),f,3.2,.55,s.brand,52)})),{parts:l,fx:u,viewBox:""}}function Ki(e){let n=Pi();W={x0:1/0,y0:1/0,x1:-1/0,y1:-1/0};let t;switch(e.kind){case"start":t=zi(e,n);break;case"auth":t=Hi(e,n);break;case"db":t=Bi(e,n);break;case"security":t=Gi(e,n);break;case"deploy":t=Qi(e,n);break;case"monitor":t=Vi(e,n);break;case"connect":t=qi(e,n);break;default:t=Ri(e,n)}let r=W;W=null;let s={x:34,top:58,bottom:26};return t.viewBox=`${m(r.x0-s.x)} ${m(r.y0-s.top)} ${m(r.x1-r.x0+s.x*2)} ${m(r.y1-r.y0+s.top+s.bottom)}`,t}var an="http://www.w3.org/2000/svg";function Qe(e,n,t={}){let r=document.createElementNS(an,"g");r.setAttribute("data-sig",e);for(let[s,a]of Object.entries(t))r.setAttribute(s,a);return r.innerHTML=n,r}var _i='<defs><filter id="sc-soft" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="6"/></filter><filter id="sc-glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter><linearGradient id="sc-sheen" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.6"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-sweep-v" x1="0" y1="1" x2="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.6" stop-color="#fff" stop-opacity="0.75"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="sc-floor" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#1f1f25"/><stop offset="1" stop-color="#17171c"/></linearGradient></defs>';function on(e,n){let t=Ki(e),r=document.createElementNS(an,"svg");r.setAttribute("class",`scene is-${e.phase} kind-${e.kind}${e.demo?" is-demo":""}`),r.setAttribute("viewBox",t.viewBox),r.setAttribute("role","group"),r.setAttribute("aria-label","Workflow view: an illustration of the steps, not your app"),r.setAttribute("data-slot",`scene-${e.kind}`);let s=a=>{let c=a.target.closest?.("[data-part]");c&&n(c.getAttribute("data-part")??"")};r.addEventListener("click",s),r.addEventListener("keydown",a=>{let c=a.key;(c==="Enter"||c===" ")&&(a.preventDefault(),s(a))}),r.appendChild(Qe("defs",_i));for(let a of t.parts){let c=e.focus===a.id,o=e.selected===a.id,p={class:`part p-${a.state}${c?" is-focus":""}${o?" is-selected":""}`,"data-part":a.id};a.inert||Object.assign(p,{tabindex:"0",role:"button","aria-label":`${a.label}: ${gt[a.state]}`}),r.appendChild(Qe(`${a.id}|${a.state}|${c}|${o}|${Xi(a.svg)}`,a.svg,p))}return r.appendChild(Qe(`fx|${t.fx.join("").length}|${t.fx.map(a=>a.slice(0,40)).join("|")}`,t.fx.join(""),{class:"fx","pointer-events":"none"})),r.appendChild(Qe(`payoff|${e.phase}`,e.phase==="done"?Ji(e):"",{class:"fx-payoff","pointer-events":"none"})),r}function Xi(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n<<5)+n+e.charCodeAt(t)|0;return(n>>>0).toString(36)}function Ji(e){let[n,t]=e.kind==="deploy"?v(15.3,-1.3,1.6):e.kind==="monitor"||e.kind==="connect"?v(11.35,3.2,2):v(5.5,1.6,3.2);return`<circle class="ring" cx="${m(n)}" cy="${m(t)}" r="120"/><circle class="ring two" cx="${m(n)}" cy="${m(t)}" r="120"/>`}var gt={planned:"planned",idle:"not run",active:"working now",done:"done, with evidence",failed:"failed",waiting:"waiting for you"};function xe(e){return e==="active"?"active":e==="done"?"done":e==="failed"?"failed":e==="skipped"||e==="unknown"?"idle":"planned"}var er=[[/tsc|typecheck/i,"Types"],[/test/i,"Tests"],[/preview still loads|page loads/i,"Page loads"],[/answers/i,"Answers"]];function cn(e){return er.find(([n])=>n.test(e))?.[1]??e}function tr(e){return e.state==="waiting_for_user"?"wait":te(e.state)?e.state==="succeeded"?"done":e.state==="cancelled"||e.state==="partially_completed"&&!e.checks.some(n=>n.status==="failed")&&!e.steps.some(n=>n.state==="failed")?"stopped":"fail":"work"}function nr(e,n){let t=w=>n.steps.find(b=>b.id===w),r=e.work.preview?.state==="ready"&&!!e.work.preview.url,s=n.steps.find(w=>w.state==="active"),a=tr(n),c=n.state==="waiting_for_user"&&n.waiting?`Waiting for you: ${n.waiting.title.toLowerCase()}`:s?`${s.label}${s.detail?` \xB7 ${s.detail}`:""}`:n.result?.title??"Working";if(n.actionId==="preview.start"){let w=t("page"),b=n.checks.find($=>$.id==="page"),L=n.state==="waiting_for_user"?"waiting":w?.state==="done"?"done":w?.state==="failed"?"failed":t("answer")?.state==="active"||w?.state==="active"||t("answer")?.state==="done"?"active":"planned";return{kind:"start",phase:a,focus:n.state==="waiting_for_user"?"window":t("find")?.state==="active"?"command":t("start")?.state==="active"?"server":t("answer")?.state==="active"||w?.state==="active"?"window":null,parts:{platform:"done",command:xe(t("find")?.state),server:t("answer")?.state==="failed"?"failed":xe(t("start")?.state),"pipe-power":xe(t("start")?.state),"pipe-serve":t("answer")?.state==="active"?"active":xe(t("answer")?.state),window:L,"pipe-live":w?.state==="done"&&r?"done":"planned",port:w?.state==="done"&&r?"done":"planned"},files:[],checks:[{id:"page",label:"Page loads",status:b?b.status==="passed"?"passed":"failed":w?.state==="active"?"active":"pending"}],live:r,framework:e.work.facts?.framework??null,caption:c.replace(/(npm|pnpm|yarn|bun) run (\w+)/,"$1 run $2"),selected:e.work.selectedPart}}let o=t("edit"),d=t("check"),p=t("preview"),l=[...e.work.events].reverse().find(w=>w.type==="check.started"),h=(n.plan?.checks??[]).map(w=>{let b=/preview still loads/i.test(w),L=n.checks.find(y=>b?y.id==="page":y.command===w),$=!L&&(b?p?.state==="active":d?.state==="active"&&l?.payload.command===w);return{id:b?"page":w.replace(/\W+/g,"-"),label:cn(w),status:L?L.status==="passed"?"passed":L.status==="failed"?"failed":"not_run":$?"active":te(n.state)?"not_run":"pending"}}),f=t("read")?.state==="active"||o?.state==="active"?"active":o?.state==="failed"?"failed":n.changes.length&&!n.reverted?"done":o?.state==="done"?"idle":"planned",g=h.find(w=>w.status==="active");return{kind:"ui",phase:a,focus:o?.state==="active"||t("read")?.state==="active"?"window":g?`check:${g.id}`:p?.state==="active"?"port":null,parts:{platform:"done",agent:xe(o?.state),beam:o?.state==="active"?"active":o?.state==="done"?"idle":xe(o?.state),window:f,"pipe-live":p?.state==="done"&&r?"done":p?.state==="active"?"active":p?.state==="failed"?"failed":"planned",port:p?.state==="done"&&r?"done":p?.state==="failed"?"failed":"planned"},files:n.reverted?[]:n.changes.map(w=>({path:w.path,kind:w.kind})),checks:h,agent:n.agent?{id:n.agent.cliId,label:ft(e,n.agent.cliId)}:void 0,live:r,caption:c,selected:e.work.selectedPart}}function ft(e,n){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function ir(e,n,t){let r=n==="preview.start";return{kind:r?"start":"ui",phase:"plan",focus:null,parts:{platform:"done"},files:[],checks:r?[{id:"page",label:"Page loads",status:"pending"}]:t.checks.map(s=>({id:s.replace(/\W+/g,"-"),label:cn(s),status:"pending"})),agent:r?void 0:{id:e.cliId,label:ft(e,e.cliId)},live:e.work.preview?.state==="ready",framework:e.work.facts?.framework??null,caption:"The plan. Nothing has run yet.",selected:e.work.selectedPart}}var ht=[{kind:"ui",key:"ui",title:"Change something in my app",text:"Claude Code eats its tokens and builds the change into the app; when the checks pass, it polishes the window."},{kind:"auth",provider:"google",key:"auth",title:"Add Google sign-in",text:"A gateway opens beside the app; a test user signs in with Google and comes back into the app."},{kind:"auth",provider:"github",key:"auth-github",title:"Add GitHub sign-in",text:"The same gateway with GitHub: a test user signs in with GitHub and comes back into the app."},{kind:"db",key:"db",title:"Connect a database",text:"The database settles in layers, its tables appear as compartments, and one test record travels to it and back."},{kind:"security",key:"security",title:"Fix an access issue",text:"The affected path is marked, the rule takes shape, then the owner\u2019s path and the blocked path are tested separately."},{kind:"monitor",key:"monitor",title:"Add product analytics",text:"An app event travels to PostHog, and the check waits for PostHog to show it arrived."},{kind:"deploy",key:"deploy",title:"Create a preview deployment",text:"The change is pushed to GitHub, built and uploaded to a Vercel preview, and checked there."},{kind:"connect",key:"connect",title:"Connect a provider",text:"Every provider VibeRaven works with, in its own colours, with what it really receives from your app."}],rr={auth:{plan:{},work:{gateway:"active","pipe-provider":"done","pipe-app":"active",auth:"done",window:"idle"},wait:{gateway:"waiting","pipe-provider":"planned",auth:"done",window:"idle"},fail:{gateway:"done","pipe-provider":"done","pipe-app":"failed",auth:"done",window:"failed"},done:{gateway:"done","pipe-provider":"done","pipe-app":"done",auth:"done",window:"done"},stopped:{}},db:{plan:{},work:{db:"active",schema:"active",window:"idle"},wait:{db:"waiting",window:"idle"},fail:{db:"done",schema:"done","pipe-db":"failed",window:"failed"},done:{db:"done",schema:"done","pipe-db":"done",window:"done"},stopped:{}},security:{plan:{db:"done"},work:{rule:"active",db:"done","path-owner":"planned","path-other":"planned"},wait:{rule:"waiting",db:"done"},fail:{rule:"done",db:"done","path-owner":"done","path-other":"failed"},done:{rule:"done",db:"done","path-owner":"done","path-other":"done"},stopped:{}},deploy:{plan:{},work:{build:"done",flight:"active",preview:"active"},wait:{build:"done",flight:"planned",preview:"waiting"},fail:{build:"done",flight:"done",preview:"failed"},done:{build:"done",flight:"done",preview:"done"},stopped:{}},monitor:{plan:{},work:{posthog:"active",event:"active",window:"done"},wait:{posthog:"waiting",event:"planned",window:"done"},fail:{posthog:"done",event:"failed",window:"done"},done:{posthog:"done",event:"done",window:"done"},stopped:{}},connect:{plan:{},work:{provider:"active",link:"active",window:"done"},wait:{provider:"waiting",link:"planned",window:"done"},fail:{provider:"done",link:"failed",window:"done"},done:{provider:"done",link:"done",window:"done"},stopped:{}},ui:{plan:{},work:{agent:"active",beam:"active",window:"active"},wait:{agent:"waiting",window:"idle"},fail:{agent:"done",beam:"idle",window:"failed"},done:{agent:"done",beam:"idle",window:"done","pipe-live":"done",port:"done"},stopped:{}},start:{plan:{},work:{},wait:{},fail:{},done:{},stopped:{}}},sr={ui:["Types","Page loads"],auth:["Sign in","Sign out"],db:["Write","Read back"],security:["Owner reads","Others blocked"],deploy:["Preview answers"],monitor:["Event arrived"],connect:["Connected"]};function ar(e,n,t,r){let s=rr[n][t],a=c=>t==="done"?"passed":t==="fail"?c===0?"passed":"failed":t==="work"&&c===0?"active":"pending";return{kind:n,phase:t,focus:Object.entries(s).find(([,c])=>c==="active"||c==="waiting"||c==="failed")?.[0]??null,parts:{platform:"done",...s},framework:e.work.facts?.framework??null,provider:r,files:n==="ui"&&(t==="done"||t==="fail")?[{path:"app/page.tsx",kind:"modified"},{path:"components/Hero.tsx",kind:"modified"}]:n==="auth"&&(t==="done"||t==="fail")?[{path:"app/login/page.tsx",kind:"added"}]:n==="db"&&t==="done"?[{path:"app/notes/actions.ts",kind:"added"}]:[],checks:(sr[n]??[]).map((c,o)=>({id:`demo-${o}`,label:c,status:a(o)})),live:!1,caption:t==="plan"?"Planned scene":t==="work"?"Working (simulated)":t==="wait"?"Waiting for you (simulated)":t==="fail"?"A check failed (simulated)":"Done (simulated)",demo:!0,selected:e.work.selectedPart}}function or(e,n,t){let r=n.selected;if(!r)return null;let s=n.parts[r]??(r.startsWith("check:")?(()=>{let o=n.checks.find(d=>`check:${d.id}`===r);return o?.status==="passed"?"done":o?.status==="failed"?"failed":o?.status==="active"?"active":"planned"})():"planned"),a=[],c=r;if(n.demo)c=r,a.push(i("p",{},"Demo scene. Nothing here is your app or a real result."));else if(r==="window")c="Your app, as drawn in the workflow",a.push(i("p",{},"A drawing of the work, not a screenshot. The real app is in the live window.")),t?.changes.length&&a.push(i("ul",{class:"insp-files"},...t.changes.map(o=>i("li",{},i("code",{},o.path),i("span",{class:"add"},`+${o.additions}`),i("span",{class:"del"},`\u2212${o.deletions}`))))),t?.waiting&&a.push(i("p",{class:"insp-wait"},t.waiting.detail));else if(r==="agent"&&t?.agent)c=ft(e,t.agent.cliId),a.push(i("p",{},`Coding agent on this computer, access: ${t.agent.accessMode}.`)),t.result?.agentAnswer&&a.push(i("div",{class:"insp-answer",html:X(t.result.agentAnswer.slice(0,900))}));else if(r.startsWith("check:")){let o=n.checks.find(p=>`check:${p.id}`===r),d=t?.checks.find(p=>p.id===o?.id||p.command?.replace(/\W+/g,"-")===o?.id);c=o?.label??"Check",a.push(i("p",{},d?`${d.status==="passed"?"Passed":d.status==="failed"?"Failed":"Not run"}${d.command?` \xB7 ${d.command}`:""}`:"Not run yet.")),d?.detail&&a.push(i("pre",{class:"insp-pre"},d.detail))}else r==="port"||r==="pipe-live"?(c="Live preview",a.push(i("p",{},e.work.preview?.url?`${e.work.preview.url} \xB7 ${e.work.preview.state}`:"Not running."))):r==="server"||r==="command"?(c=r==="server"?"Dev server":"Run command",a.push(i("p",{},e.work.preview?.command??"npm run dev")),e.work.preview?.log&&a.push(i("pre",{class:"insp-pre"},e.work.preview.log.trim().split(`
8
8
  `).slice(-8).join(`
9
- `)))):r==="platform"?(c="This computer",a.push(i("p",{},`${e.project.project?.path??""} \xB7 nothing leaves this machine, nothing is deployed.`))):r==="beam"&&(c="Agent at work",a.push(i("p",{},t?`${t.changes.length} file${t.changes.length===1?"":"s"} changed so far.`:"")));return i("aside",{class:"scene-inspect","aria-live":"polite"},i("header",{},i("strong",{},c),i("span",{class:`insp-state is-${s}`},gt[s]??String(s))),...a)}function cn(e,n){let t=e.work.gallery,r=e.work.run,s=e.work.plan,a=t?rr(e,t.kind,t.phase,t.provider):s?tr(e,s.actionId,s.plan):r?er(e,r):null;if(!a)return null;let c=a.phase==="work",o=a.phase==="done"?"pass":a.phase==="fail"?"fail":a.phase==="wait"?"wait":a.phase==="work"?"work":"plan";return i("section",{class:`scene-stage is-${a.phase}`,dataset:{slot:"scene-stage"},"aria-label":"Workflow view"},i("header",{class:"scene-head",dataset:{sig:`${a.demo}|${a.kind}`}},i("span",{class:`scene-tag${a.demo?" is-demo":""}`},a.demo?"Demo \xB7 simulated":"Workflow view"),i("span",{class:"scene-note"},a.demo?"A preview of a planned action. It does not run and is not your app.":"A drawing of the real steps. Your app itself is in the live window.")),an(a,d=>n.selectPart(d)),i("p",{class:`scene-caption is-${o}`,role:"status",dataset:{sig:`${a.caption}|${o}|${r?.createdAt??""}`}},i("i",{"aria-hidden":"true"}),i("span",{},a.caption),c&&r?i("span",{class:"work-elapsed",dataset:{since:r.createdAt}}):null,!c&&r&&!a.demo?i("span",{class:"scene-when"},F(r.updatedAt)):null),sr(e,a,t?null:r))}function dn(e,n){return e.work.gallery?null:i("section",{class:"live-window",dataset:{slot:"live-window"},"aria-label":"Your app, live"},i("header",{dataset:{sig:"live-head"}},i("strong",{},"Your app"),i("span",{},"real, on this computer")),Xe(e,n))}var ar={ui:"App change",auth:"Google sign-in","auth-github":"GitHub sign-in",db:"Database",security:"Access fix",deploy:"Deploy",monitor:"Analytics",connect:"Any provider"},or="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f2c15f" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>'),on="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>');function lr(e){return{ui:B.claude,auth:q("google"),"auth-github":q("github"),db:q("supabase"),security:or,deploy:q("vercel"),monitor:q("posthog"),connect:on}[e]??on}var cr={plan:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-dasharray="2 2" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="3"/></svg>',work:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 2a6 6 0 1 1-6 6"/></svg>',wait:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><rect x="4" y="3" width="2.6" height="10" rx="1"/><rect x="9.4" y="3" width="2.6" height="10" rx="1"/></svg>',fail:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',done:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>'};function dr(e){return e.kind==="auth"?e.provider==="github"?"auth-github":"auth":e.kind}function un(e,n){let t=e.work.gallery,r=dr(t),s=ht.find(d=>d.key===r)??ht[0],a=[["plan","Plan"],["work","Working"],["wait","Waiting"],["fail","Failed"],["done","Done"]],c=t.provider&&he[t.provider]?t.provider:"supabase";return[i("p",{class:"work-eyebrow is-plan"},i("i",{"aria-hidden":"true"}),"Demo \xB7 not built yet"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},t.kind==="connect"?`Connect ${he[c].name}`:s.title),i("p",{class:"wline"},t.kind==="connect"?`${he[c].verb}. A preview; nothing here touches your app.`:"A preview of how it will look. Nothing here touches your app."),i("div",{class:"wgallery",role:"radiogroup","aria-label":"Scene"},...ht.map(d=>i("button",{type:"button",role:"radio","aria-checked":String(d.key===r),class:`wscene${d.key===r?" on":""}`,on:{click:()=>n.showGallery(d.kind,t.phase,d.kind==="connect"?c:d.provider)}},i("span",{class:"wscene-mark"},i("img",{src:lr(d.key),alt:"",width:22,height:22})),i("span",{},ar[d.key])))),t.kind==="connect"?i("div",{class:"wproviders",role:"radiogroup","aria-label":"Provider"},...Object.entries(he).map(([d,p])=>i("button",{type:"button",role:"radio","aria-checked":String(d===c),title:p.name,class:`wprov${d===c?" on":""}`,on:{click:()=>n.showGallery("connect",t.phase,d)}},i("img",{src:q(d),alt:p.name,width:20,height:20})))):null,i("div",{class:"wphases",role:"radiogroup","aria-label":"Demo state"},...a.map(([d,p])=>i("button",{type:"button",role:"radio","aria-checked":String(t.phase===d),class:`wphase is-${d}${t.phase===d?" on":""}`,title:p,on:{click:()=>n.showGallery(t.kind,d,t.provider)}},i("span",{class:"wphase-ico",html:cr[d]}),p))),i("button",{class:"wlink",on:{click:()=>n.closeWork()}},"Close the demo")].filter(d=>d!==null)}var ur={"auth.google":{kind:"auth",provider:"google"},"auth.github":{kind:"auth",provider:"github"},"supabase.connect":{kind:"db"},"data.feature":{kind:"db"},"access.rule":{kind:"security"},"config.fix":{kind:"security"},"deploy.preview":{kind:"deploy"},"monitoring.add":{kind:"monitor"},"payments.add":{kind:"connect",provider:"stripe"},"email.transactional":{kind:"connect",provider:"resend"},"integration.add":{kind:"connect",provider:"supabase"}},M={spark:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',play:'<svg viewBox="0 0 16 16" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M4.5 2.8v10.4L13 8z"/></svg>',grid:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>',fix:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',plug:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',reload:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',out:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',expand:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"/></svg>',collapse:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5 14 2M6.5 9.5 2 14"/></svg>',stop:'<svg viewBox="0 0 16 16" width="11" height="11" aria-hidden="true"><rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor"/></svg>',check:'<svg viewBox="0 0 16 16" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',cross:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',dash:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 8h8"/></svg>',undo:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5.5 3.5 2.5 6.5l3 3"/><path d="M2.5 6.5h7a4 4 0 0 1 0 8H7"/></svg>',diff:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',plus:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M8 3v10M3 8h10"/></svg>',monitor:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.5" y="2.5" width="13" height="8.5" rx="1.6"/><path d="M5.5 14h5M8 11v3"/></svg>',shield:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>',nodeploy:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V5M4.5 8.5 8 5l3.5 3.5"/><path d="M2.5 2.5l11 11"/></svg>',eye:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/></svg>',pencil:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.8 2.7a1.7 1.7 0 0 1 2.5 2.5L5.6 12.9 2.5 13.5l.6-3.1z"/></svg>',bolt:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 1.5 3.5 9H8l-1 5.5L12.5 7H8z"/></svg>',key:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="5" cy="8" r="3"/><path d="M8 8h6.5M12 8v2.5M14 8v1.5"/></svg>',bigCheck:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>',bigCross:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/></svg>',bigBang:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v9M12 18.5v.5"/></svg>',bigStop:'<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="5" y="5" width="14" height="14" rx="3" fill="currentColor"/></svg>'};function se(e){return i("span",{class:"ico",html:e})}function Ee(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??(e.cliId==="claude"?"Claude Code":e.cliId==="gemini"?"Gemini":"Codex")}function fn(e){if(!e)return"";try{let n=new URL(e);return`${n.hostname}:${n.port}`}catch{return e}}function pr(e){let n=c=>e.work.offers.find(o=>o.id===c),t=[],r=n("preview.start");r&&r.availability==="ready"&&t.push(r);let s=n("agent.connect");s&&s.availability==="needs_connection"&&t.push(s);let a=n("findings.fix");return a&&a.availability==="ready"&&t.push(a),t.slice(0,3)}function gr(e,n){return e.id==="preview.start"?{label:"Show my app",svg:M.play}:e.id==="agent.connect"?{label:`Connect ${Ee(n)}`,svg:M.plug}:e.id==="findings.fix"?{label:n.work.facts?.fixable?`Fix ${n.work.facts.fixable} finding${n.work.facts.fixable===1?"":"s"}`:"Fix findings",svg:M.fix}:{label:e.name,svg:M.arrow}}function mn(e,n,t){let r=!!(e.work.run&&!te(e.work.run.state)),s=r||e.work.busy||e.setup.running,a=pr(e),c=e.work.offers.filter(d=>d.availability==="ready"||d.availability==="already_configured").length,o=i("input",{id:"shelf-input",class:"shelf-input",type:"text",autocomplete:"off",spellcheck:!0,maxlength:1200,value:e.work.request,placeholder:r?e.work.run?.agent?`${Ee(e)} is working on your last request\u2026`:"Starting your app\u2026":"What should change in your app?","aria-label":"Describe a change to your app",disabled:s,on:{input:d=>n.setRequest(d.target.value)}});return i("form",{class:`shelf${r?" is-running":""}`,dataset:{slot:"shelf"},"aria-label":"Ask for a change",on:{submit:d=>{d.preventDefault(),n.submitRequest(d.currentTarget.querySelector("#shelf-input")?.value??"")}}},i("div",{class:"shelf-box",dataset:{sig:JSON.stringify([s,r,e.work.request==="",Ee(e)])}},i("span",{class:"shelf-spark",html:M.spark}),o,i("button",{class:"shelf-go",type:"submit",disabled:s},e.work.busy?i("span",{class:"spin","aria-hidden":"true"}):null,"Plan it",e.work.busy?null:se(M.arrow))),i("div",{class:"shelf-row",dataset:{sig:JSON.stringify([a.map(d=>[d.id,d.availability]),c,s,t,e.work.facts?.fixable,Ee(e)])}},...a.map(d=>{let p=gr(d,e);return i("button",{type:"button",class:`shelf-chip${d.id==="preview.start"?" is-main":""}`,title:d.reason,disabled:s&&d.id!=="agent.connect",on:{click:()=>n.runOffer(d)}},se(p.svg),p.label)}),i("button",{id:"shelf-all",type:"button",class:"shelf-chip is-quiet",on:{click:()=>n.toggleCatalog(!0)}},se(M.grid),"All actions",i("span",{class:"shelf-count"},String(e.work.offers.length||28))),i("span",{class:"shelf-note"},t)))}function wn(e){let n=e.work.run;if(!n?.agent)return null;let t=n.agent.cliId,r=!te(n.state),s=n.steps.find(p=>p.id==="edit"),a=n.changes.length,c=r?"work":n.state==="succeeded"?"pass":n.state==="failed"?"fail":"warn",o=r?s?.state==="active"?a?`Editing \xB7 ${a} file${a===1?"":"s"} so far`:"Reading and editing":n.state==="verifying"?"Done editing \xB7 checks running":"Getting ready":a?`Changed ${a} file${a===1?"":"s"}`:"No files changed",d=e.agents.find(p=>p.id===t)?.label.replace(/ CLI$/,"")??(t==="claude"?"Claude Code":t==="gemini"?"Gemini":"Codex");return i("li",{class:`node is-agent is-${c}`,dataset:{card:"agent",provider:"agent",sig:JSON.stringify([t,c,o,n.agent.accessMode])}},i("span",{class:"node-head"},i("img",{src:B[t],alt:"",width:18,height:18}),i("span",{class:"node-name"},d)),i("code",{class:"node-detail"},`coding agent \xB7 ${n.agent.accessMode}`),i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},o),i("span",{class:"node-verdict"},r?"Working":c==="pass"?"Done":c==="fail"?"Failed":"Review")))}function Xe(e,n){let t=e.work.preview,r=t?.state??"idle",s=t?.url,a=r==="ready"&&!!s,c=t?.embeddable!==!1,o=a?"Live":r==="starting"?"Starting":r==="failed"?"Did not start":r==="unavailable"?"No dev script":"Not running",d=i("div",{class:"screen-bar",dataset:{sig:JSON.stringify([r,s,o])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"screen-url"},a?fn(s):t?.command??"your app"),i("span",{class:`screen-live is-${r}`},i("i",{"aria-hidden":"true"}),o)),p;if(a&&c&&!e.work.previewExpanded)p=i("div",{class:"screen-body is-live",dataset:{sig:`live|${s}|${t?.revision??0}`}},i("p",{class:"screen-wait"},"Updating\u2026"),i("iframe",{id:"app-frame",src:s,title:"Your app, running on this computer",tabindex:-1,sandbox:"allow-scripts allow-same-origin allow-forms",loading:"eager",referrerpolicy:"no-referrer",on:{load:l=>l.target.classList.add("is-loaded")}}),i("button",{type:"button",class:"screen-open","aria-label":"Try your app in the large view",on:{click:()=>n.togglePreviewExpanded(!0)}},i("span",{},se(M.expand),"Try it")));else if(a&&e.work.previewExpanded)p=i("div",{class:"screen-body is-placeholder",dataset:{sig:"expanded"}},i("p",{},"Open in the large view"));else if(a&&!c)p=i("div",{class:"screen-body is-placeholder",dataset:{sig:`noframe|${s}`}},i("p",{},"This app does not allow being shown inside another page."),i("a",{class:"screen-cta",href:s,target:"_blank",rel:"noreferrer"},se(M.out),"Open in a browser tab"));else if(r==="starting")p=i("div",{class:"screen-body is-skeleton",dataset:{sig:"starting"}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),i("span",{class:"sk sk-3"}),i("p",{},`Starting ${t?.command??"your app"}\u2026`));else if(r==="failed")p=i("div",{class:"screen-body is-placeholder is-failed",dataset:{sig:`failed|${t?.error}`}},i("p",{},t?.reason??t?.error??"The app did not start."));else if(r==="unavailable")p=i("div",{class:"screen-body is-placeholder",dataset:{sig:"unavailable"}},i("p",{},"No dev, start or preview script in package.json."));else{let l=e.work.offers.find(u=>u.id==="preview.start")?.availability==="ready";p=i("div",{class:"screen-body is-placeholder is-idle",dataset:{sig:`idle|${l}`}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),l?i("button",{type:"button",class:"screen-cta",on:{click:()=>void n.planAction("preview.start")}},se(M.play),"Show my app"):i("p",{},"Not running"))}return i("div",{class:`screen is-${r}`,dataset:{slot:"screen"}},d,p)}function yn(e){let n=e.work.run,t=n?.changes??[],r=!!(n&&t.length&&!n.reverted);return i("ul",{class:"app-files",hidden:!r,dataset:{slot:"files"},"aria-label":"Files changed by the run"},...r?t.slice(0,5).map(s=>i("li",{class:`is-${s.kind}`,dataset:{sig:JSON.stringify(s)}},i("code",{title:s.path},s.path.split("/").pop()??s.path),i("span",{class:"add"},`+${s.additions}`),i("span",{class:"del"},`\u2212${s.deletions}`))):[],...r&&t.length>5?[i("li",{class:"more",dataset:{sig:`more${t.length}`}},`+${t.length-5} more`)]:[])}function vn(e,n){let t=e.work.preview;return!e.work.previewExpanded||t?.state!=="ready"||!t.url?[]:[i("section",{class:"appwin",role:"dialog","aria-label":"Your app, live",dataset:{slot:"appwin"}},i("header",{class:"appwin-bar",dataset:{sig:JSON.stringify([t.url,t.revision])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"appwin-url"},i("i",{"aria-hidden":"true"}),fn(t.url)),i("span",{class:"appwin-note"},"Your app, running on this computer"),i("span",{class:"spacer"}),i("button",{type:"button",class:"appwin-tool",title:"Reload","aria-label":"Reload the app",on:{click:()=>n.reloadPreview()},html:M.reload}),i("a",{class:"appwin-tool",href:t.url,target:"_blank",rel:"noreferrer",title:"Open in a browser tab","aria-label":"Open in a browser tab",html:M.out}),i("button",{type:"button",class:"appwin-tool",title:"Stop the app","aria-label":"Stop the app",on:{click:()=>void n.stopPreview()},html:M.stop}),i("button",{id:"preview-collapse",type:"button",class:"appwin-tool is-close",title:"Back to the board","aria-label":"Back to the board",on:{click:()=>n.togglePreviewExpanded(!1)},html:M.collapse})),i("div",{class:"appwin-body",dataset:{sig:`${t.url}|${t.revision}`}},i("iframe",{id:"app-frame",src:t.url,title:"Your app, running on this computer",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-modals",referrerpolicy:"no-referrer"})))]}var De={discovering:"Getting ready",planning:"Planning",running:"Working",verifying:"Checking",waiting_for_user:"Waiting for you",succeeded:"Done",partially_completed:"Needs a look",failed:"Did not finish",cancelled:"Stopped",interrupted:"Interrupted"};function Je(e,n){return i("p",{class:`work-eyebrow is-${n}`},i("i",{"aria-hidden":"true"}),e)}function Oe(e,n){return e.length>n?`${e.slice(0,n-1)}\u2026`:e}function re(e,n,t,r=""){return i("span",{class:`wchip${r?` is-${r}`:""}`,title:t??n},typeof e=="string"?se(e):e,n)}function K(e,n,t,r={}){return i("button",{id:r.id,type:"button",class:`wtile${r.primary?" is-primary":""}${r.danger?" is-danger":""}`,disabled:r.disabled,"aria-pressed":r.pressed===void 0?void 0:String(r.pressed),on:{click:t}},i("span",{class:"wtile-ico",html:e}),i("span",{class:"wtile-label"},n),r.note?i("span",{class:"wtile-note"},r.note):null)}function pn(e){let n=e==="pass"?M.bigCheck:e==="fail"?M.bigCross:e==="warn"?M.bigBang:e==="wait"?M.key:M.bigStop;return i("span",{class:`wbadge is-${e}`,html:n})}function hr(e,n){let t=B[n]??B.claude;return re(i("img",{src:t,alt:"",width:14,height:14}),e.agents.find(r=>r.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex"))}function fr(e,n){let t=e.work.plan,r=t.plan,s=t.actionId==="app.change",a=e.probes[e.cliId]?.ready===!0,c=e.busy.probe===e.cliId,o=r.checks.length?r.checks.map(u=>u.replace("The preview still loads","page loads")).join(" + "):"no checks",d=s?[re(M.monitor,"This computer",r.target),hr(e,e.cliId),re(M.shield,Oe(o,28),`Then checks: ${r.checks.join(", ")||"nothing (no typecheck or test script)"}`),re(M.nodeploy,"No deploy",`Will not: ${r.willNot.join(", ")}`)]:[re(M.play,e.work.facts?.previewCommand??"npm run dev"),re(M.monitor,"This computer"),re(M.nodeploy,"No installs",`Will not: ${r.willNot.join(", ")}`)],p=(u,h,f,g)=>i("button",{type:"button",role:"radio","aria-checked":String(e.accessMode===u),class:`wmode${e.accessMode===u?" on":""}`,title:g,disabled:e.work.busy,on:{click:()=>void n.setWorkAccess(u)}},i("span",{class:"wmode-ico",html:h}),f),l=!s||a?K(M.play,s?e.accessMode==="ask"?"Get a plan":"Make the change":"Start the app",()=>void n.startPlanned(),{id:"work-start",primary:!0,disabled:e.work.busy}):K(M.plug,c?"Testing\u2026":`Connect ${Ee(e)}`,()=>void n.testConnection(e.cliId),{id:"work-start",primary:!0,disabled:c});return[Je("Plan \xB7 nothing runs until you start","plan"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s?Oe(r.outcome,90):"Show my app"),i("div",{class:"wchips"},...d),s?i("div",{class:"wmodes",role:"radiogroup","aria-label":"What the agent may do"},p("ask",M.eye,"Ask","Plan only. The agent edits nothing."),p("approve",M.pencil,"Edit","The agent edits files in this project."),p("full",M.bolt,"Full","Full local access. Still explains anything destructive.")):null,e.work.error?i("p",{class:"work-error",role:"alert"},e.work.error):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["go",s,a,c,e.accessMode,e.work.busy,e.cliId])}},l),i("button",{class:"wlink",on:{click:()=>s?n.newChange():n.closeWork()}},s?"Change the request":"Cancel")].filter(u=>u!==null)}var mr={done:M.check,failed:M.cross,skipped:M.dash,unknown:"?"};function gn(e,n){return i("ol",{class:`work-steps${n?" is-compact":""}`,dataset:{slot:"steps"}},...e.steps.map(t=>i("li",{class:`work-step is-${t.state}`,dataset:{sig:JSON.stringify([t.state,t.detail,n,t.id==="edit"?e.changes.map(r=>`${r.path}:${r.additions}:${r.deletions}`):0])}},i("span",{class:"work-mark","aria-hidden":"true",html:mr[t.state]??""}),i("div",{class:"work-step-copy"},i("span",{class:"work-step-label"},t.label),(!n||t.state==="active"||t.state==="failed")&&t.detail?i("span",{class:"work-step-detail"},t.detail):null,t.id==="edit"&&e.changes.length?i("ul",{class:"work-files"},...e.changes.slice(0,n?3:8).map(r=>i("li",{class:`is-${r.kind}`},i("code",{},r.path),i("span",{class:"add"},`+${r.additions}`),i("span",{class:"del"},`\u2212${r.deletions}`)))):null))))}function wr(e){return e.checks.length?i("div",{class:"wchips"},...e.checks.map(n=>re(n.status==="passed"?M.check:n.status==="failed"?M.cross:M.dash,n.label.replace("The preview still loads","Page loads").replace("The page loads","Page loads"),n.detail??n.command,n.status==="passed"?"pass":n.status==="failed"?"fail":""))):null}function yr(e){return e.split(`
9
+ `)))):r==="platform"?(c="This computer",a.push(i("p",{},`${e.project.project?.path??""} \xB7 nothing leaves this machine, nothing is deployed.`))):r==="beam"&&(c="Agent at work",a.push(i("p",{},t?`${t.changes.length} file${t.changes.length===1?"":"s"} changed so far.`:"")));return i("aside",{class:"scene-inspect","aria-live":"polite"},i("header",{},i("strong",{},c),i("span",{class:`insp-state is-${s}`},gt[s]??String(s))),...a)}function dn(e,n){let t=e.work.gallery,r=e.work.run,s=e.work.plan,a=t?ar(e,t.kind,t.phase,t.provider):s?ir(e,s.actionId,s.plan):r?nr(e,r):null;if(!a)return null;let c=a.phase==="work",o=a.phase==="done"?"pass":a.phase==="fail"?"fail":a.phase==="wait"?"wait":a.phase==="work"?"work":"plan";return i("section",{class:`scene-stage is-${a.phase}`,dataset:{slot:"scene-stage"},"aria-label":"Workflow view"},i("header",{class:"scene-head",dataset:{sig:`${a.demo}|${a.kind}`}},i("span",{class:`scene-tag${a.demo?" is-demo":""}`},a.demo?"Demo \xB7 simulated":"Workflow view"),i("span",{class:"scene-note"},a.demo?"A preview of a planned action. It does not run and is not your app.":"A drawing of the real steps. Your app itself is in the live window.")),on(a,d=>n.selectPart(d)),i("p",{class:`scene-caption is-${o}`,role:"status",dataset:{sig:`${a.caption}|${o}|${r?.createdAt??""}`}},i("i",{"aria-hidden":"true"}),i("span",{},a.caption),c&&r?i("span",{class:"work-elapsed",dataset:{since:r.createdAt}}):null,!c&&r&&!a.demo?i("span",{class:"scene-when"},F(r.updatedAt)):null),or(e,a,t?null:r))}function un(e,n){return e.work.gallery?null:i("section",{class:"live-window",dataset:{slot:"live-window"},"aria-label":"Your app, live"},i("header",{dataset:{sig:"live-head"}},i("strong",{},"Your app"),i("span",{},"real, on this computer")),Xe(e,n))}var lr={ui:"App change",auth:"Google sign-in","auth-github":"GitHub sign-in",db:"Database",security:"Access fix",deploy:"Deploy",monitor:"Analytics",connect:"Any provider"},cr="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f2c15f" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>'),ln="data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="#f5f5f7" stroke-width="1.4" stroke-linecap="round"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>');function dr(e){return{ui:B.claude,auth:q("google"),"auth-github":q("github"),db:q("supabase"),security:cr,deploy:q("vercel"),monitor:q("posthog"),connect:ln}[e]??ln}var ur={plan:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-dasharray="2 2" aria-hidden="true"><rect x="2.5" y="2.5" width="11" height="11" rx="3"/></svg>',work:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 2a6 6 0 1 1-6 6"/></svg>',wait:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><rect x="4" y="3" width="2.6" height="10" rx="1"/><rect x="9.4" y="3" width="2.6" height="10" rx="1"/></svg>',fail:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',done:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>'};function pr(e){return e.kind==="auth"?e.provider==="github"?"auth-github":"auth":e.kind}function pn(e,n){let t=e.work.gallery,r=pr(t),s=ht.find(d=>d.key===r)??ht[0],a=[["plan","Plan"],["work","Working"],["wait","Waiting"],["fail","Failed"],["done","Done"]],c=t.provider&&he[t.provider]?t.provider:"supabase";return[i("p",{class:"work-eyebrow is-plan"},i("i",{"aria-hidden":"true"}),"Demo \xB7 not built yet"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},t.kind==="connect"?`Connect ${he[c].name}`:s.title),i("p",{class:"wline"},t.kind==="connect"?`${he[c].verb}. A preview; nothing here touches your app.`:"A preview of how it will look. Nothing here touches your app."),i("div",{class:"wgallery",role:"radiogroup","aria-label":"Scene"},...ht.map(d=>i("button",{type:"button",role:"radio","aria-checked":String(d.key===r),class:`wscene${d.key===r?" on":""}`,on:{click:()=>n.showGallery(d.kind,t.phase,d.kind==="connect"?c:d.provider)}},i("span",{class:"wscene-mark"},i("img",{src:dr(d.key),alt:"",width:22,height:22})),i("span",{},lr[d.key])))),t.kind==="connect"?i("div",{class:"wproviders",role:"radiogroup","aria-label":"Provider"},...Object.entries(he).map(([d,p])=>i("button",{type:"button",role:"radio","aria-checked":String(d===c),title:p.name,class:`wprov${d===c?" on":""}`,on:{click:()=>n.showGallery("connect",t.phase,d)}},i("img",{src:q(d),alt:p.name,width:20,height:20})))):null,i("div",{class:"wphases",role:"radiogroup","aria-label":"Demo state"},...a.map(([d,p])=>i("button",{type:"button",role:"radio","aria-checked":String(t.phase===d),class:`wphase is-${d}${t.phase===d?" on":""}`,title:p,on:{click:()=>n.showGallery(t.kind,d,t.provider)}},i("span",{class:"wphase-ico",html:ur[d]}),p))),i("button",{class:"wlink",on:{click:()=>n.closeWork()}},"Close the demo")].filter(d=>d!==null)}var gr={"auth.google":{kind:"auth",provider:"google"},"auth.github":{kind:"auth",provider:"github"},"supabase.connect":{kind:"db"},"data.feature":{kind:"db"},"access.rule":{kind:"security"},"config.fix":{kind:"security"},"deploy.preview":{kind:"deploy"},"monitoring.add":{kind:"monitor"},"payments.add":{kind:"connect",provider:"stripe"},"email.transactional":{kind:"connect",provider:"resend"},"integration.add":{kind:"connect",provider:"supabase"}},M={spark:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',play:'<svg viewBox="0 0 16 16" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M4.5 2.8v10.4L13 8z"/></svg>',grid:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1.2"/><rect x="9" y="2" width="5" height="5" rx="1.2"/><rect x="2" y="9" width="5" height="5" rx="1.2"/><rect x="9" y="9" width="5" height="5" rx="1.2"/></svg>',fix:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',plug:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',reload:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',out:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',expand:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"/></svg>',collapse:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 6.5h-4v-4M2.5 9.5h4v4M9.5 6.5 14 2M6.5 9.5 2 14"/></svg>',stop:'<svg viewBox="0 0 16 16" width="11" height="11" aria-hidden="true"><rect x="3" y="3" width="10" height="10" rx="2" fill="currentColor"/></svg>',check:'<svg viewBox="0 0 16 16" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',cross:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 4l8 8M12 4l-8 8"/></svg>',dash:'<svg viewBox="0 0 16 16" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M4 8h8"/></svg>',undo:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5.5 3.5 2.5 6.5l3 3"/><path d="M2.5 6.5h7a4 4 0 0 1 0 8H7"/></svg>',diff:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',plus:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M8 3v10M3 8h10"/></svg>',monitor:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.5" y="2.5" width="13" height="8.5" rx="1.6"/><path d="M5.5 14h5M8 11v3"/></svg>',shield:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 1.8 2.8 3.6v4.1c0 3.1 2.2 5.4 5.2 6.5 3-1.1 5.2-3.4 5.2-6.5V3.6z"/><path d="M5.8 8l1.6 1.6L10.4 6.4"/></svg>',nodeploy:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V5M4.5 8.5 8 5l3.5 3.5"/><path d="M2.5 2.5l11 11"/></svg>',eye:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/></svg>',pencil:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.8 2.7a1.7 1.7 0 0 1 2.5 2.5L5.6 12.9 2.5 13.5l.6-3.1z"/></svg>',bolt:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 1.5 3.5 9H8l-1 5.5L12.5 7H8z"/></svg>',key:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="5" cy="8" r="3"/><path d="M8 8h6.5M12 8v2.5M14 8v1.5"/></svg>',bigCheck:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg>',bigCross:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/></svg>',bigBang:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" aria-hidden="true"><path d="M12 5v9M12 18.5v.5"/></svg>',bigStop:'<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><rect x="5" y="5" width="14" height="14" rx="3" fill="currentColor"/></svg>'};function se(e){return i("span",{class:"ico",html:e})}function Ee(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??(e.cliId==="claude"?"Claude Code":e.cliId==="gemini"?"Gemini":"Codex")}function mn(e){if(!e)return"";try{let n=new URL(e);return`${n.hostname}:${n.port}`}catch{return e}}function hr(e){let n=c=>e.work.offers.find(o=>o.id===c),t=[],r=n("preview.start");r&&r.availability==="ready"&&t.push(r);let s=n("agent.connect");s&&s.availability==="needs_connection"&&t.push(s);let a=n("findings.fix");return a&&a.availability==="ready"&&t.push(a),t.slice(0,3)}function fr(e,n){return e.id==="preview.start"?{label:"Show my app",svg:M.play}:e.id==="agent.connect"?{label:`Connect ${Ee(n)}`,svg:M.plug}:e.id==="findings.fix"?{label:n.work.facts?.fixable?`Fix ${n.work.facts.fixable} finding${n.work.facts.fixable===1?"":"s"}`:"Fix findings",svg:M.fix}:{label:e.name,svg:M.arrow}}function wn(e,n,t){let r=!!(e.work.run&&!te(e.work.run.state)),s=r||e.work.busy||e.setup.running,a=hr(e),c=e.work.offers.filter(d=>d.availability==="ready"||d.availability==="already_configured").length,o=i("input",{id:"shelf-input",class:"shelf-input",type:"text",autocomplete:"off",spellcheck:!0,maxlength:1200,value:e.work.request,placeholder:r?e.work.run?.agent?`${Ee(e)} is working on your last request\u2026`:"Starting your app\u2026":"What should change in your app?","aria-label":"Describe a change to your app",disabled:s,on:{input:d=>n.setRequest(d.target.value)}});return i("form",{class:`shelf${r?" is-running":""}`,dataset:{slot:"shelf"},"aria-label":"Ask for a change",on:{submit:d=>{d.preventDefault(),n.submitRequest(d.currentTarget.querySelector("#shelf-input")?.value??"")}}},i("div",{class:"shelf-box",dataset:{sig:JSON.stringify([s,r,e.work.request==="",Ee(e)])}},i("span",{class:"shelf-spark",html:M.spark}),o,i("button",{class:"shelf-go",type:"submit",disabled:s},e.work.busy?i("span",{class:"spin","aria-hidden":"true"}):null,"Plan it",e.work.busy?null:se(M.arrow))),i("div",{class:"shelf-row",dataset:{sig:JSON.stringify([a.map(d=>[d.id,d.availability]),c,s,t,e.work.facts?.fixable,Ee(e)])}},...a.map(d=>{let p=fr(d,e);return i("button",{type:"button",class:`shelf-chip${d.id==="preview.start"?" is-main":""}`,title:d.reason,disabled:s&&d.id!=="agent.connect",on:{click:()=>n.runOffer(d)}},se(p.svg),p.label)}),i("button",{id:"shelf-all",type:"button",class:"shelf-chip is-quiet",on:{click:()=>n.toggleCatalog(!0)}},se(M.grid),"All actions",i("span",{class:"shelf-count"},String(e.work.offers.length||28))),i("span",{class:"shelf-note"},t)))}function yn(e){let n=e.work.run;if(!n?.agent)return null;let t=n.agent.cliId,r=!te(n.state),s=n.steps.find(p=>p.id==="edit"),a=n.changes.length,c=r?"work":n.state==="succeeded"?"pass":n.state==="failed"?"fail":"warn",o=r?s?.state==="active"?a?`Editing \xB7 ${a} file${a===1?"":"s"} so far`:"Reading and editing":n.state==="verifying"?"Done editing \xB7 checks running":"Getting ready":a?`Changed ${a} file${a===1?"":"s"}`:"No files changed",d=e.agents.find(p=>p.id===t)?.label.replace(/ CLI$/,"")??(t==="claude"?"Claude Code":t==="gemini"?"Gemini":"Codex");return i("li",{class:`node is-agent is-${c}`,dataset:{card:"agent",provider:"agent",sig:JSON.stringify([t,c,o,n.agent.accessMode])}},i("span",{class:"node-head"},i("img",{src:B[t],alt:"",width:18,height:18}),i("span",{class:"node-name"},d)),i("code",{class:"node-detail"},`coding agent \xB7 ${n.agent.accessMode}`),i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},o),i("span",{class:"node-verdict"},r?"Working":c==="pass"?"Done":c==="fail"?"Failed":"Review")))}function Xe(e,n){let t=e.work.preview,r=t?.state??"idle",s=t?.url,a=r==="ready"&&!!s,c=t?.embeddable!==!1,o=a?"Live":r==="starting"?"Starting":r==="failed"?"Did not start":r==="unavailable"?"No dev script":"Not running",d=i("div",{class:"screen-bar",dataset:{sig:JSON.stringify([r,s,o])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"screen-url"},a?mn(s):t?.command??"your app"),i("span",{class:`screen-live is-${r}`},i("i",{"aria-hidden":"true"}),o)),p;if(a&&c&&!e.work.previewExpanded)p=i("div",{class:"screen-body is-live",dataset:{sig:`live|${s}|${t?.revision??0}`}},i("p",{class:"screen-wait"},"Updating\u2026"),i("iframe",{id:"app-frame",src:s,title:"Your app, running on this computer",tabindex:-1,sandbox:"allow-scripts allow-same-origin allow-forms",loading:"eager",referrerpolicy:"no-referrer",on:{load:l=>l.target.classList.add("is-loaded")}}),i("button",{type:"button",class:"screen-open","aria-label":"Try your app in the large view",on:{click:()=>n.togglePreviewExpanded(!0)}},i("span",{},se(M.expand),"Try it")));else if(a&&e.work.previewExpanded)p=i("div",{class:"screen-body is-placeholder",dataset:{sig:"expanded"}},i("p",{},"Open in the large view"));else if(a&&!c)p=i("div",{class:"screen-body is-placeholder",dataset:{sig:`noframe|${s}`}},i("p",{},"This app does not allow being shown inside another page."),i("a",{class:"screen-cta",href:s,target:"_blank",rel:"noreferrer"},se(M.out),"Open in a browser tab"));else if(r==="starting")p=i("div",{class:"screen-body is-skeleton",dataset:{sig:"starting"}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),i("span",{class:"sk sk-3"}),i("p",{},`Starting ${t?.command??"your app"}\u2026`));else if(r==="failed")p=i("div",{class:"screen-body is-placeholder is-failed",dataset:{sig:`failed|${t?.error}`}},i("p",{},t?.reason??t?.error??"The app did not start."));else if(r==="unavailable")p=i("div",{class:"screen-body is-placeholder",dataset:{sig:"unavailable"}},i("p",{},"No dev, start or preview script in package.json."));else{let l=e.work.offers.find(u=>u.id==="preview.start")?.availability==="ready";p=i("div",{class:"screen-body is-placeholder is-idle",dataset:{sig:`idle|${l}`}},i("span",{class:"sk sk-1"}),i("span",{class:"sk sk-2"}),l?i("button",{type:"button",class:"screen-cta",on:{click:()=>void n.planAction("preview.start")}},se(M.play),"Show my app"):i("p",{},"Not running"))}return i("div",{class:`screen is-${r}`,dataset:{slot:"screen"}},d,p)}function bn(e){let n=e.work.run,t=n?.changes??[],r=!!(n&&t.length&&!n.reverted);return i("ul",{class:"app-files",hidden:!r,dataset:{slot:"files"},"aria-label":"Files changed by the run"},...r?t.slice(0,5).map(s=>i("li",{class:`is-${s.kind}`,dataset:{sig:JSON.stringify(s)}},i("code",{title:s.path},s.path.split("/").pop()??s.path),i("span",{class:"add"},`+${s.additions}`),i("span",{class:"del"},`\u2212${s.deletions}`))):[],...r&&t.length>5?[i("li",{class:"more",dataset:{sig:`more${t.length}`}},`+${t.length-5} more`)]:[])}function vn(e,n){let t=e.work.preview;return!e.work.previewExpanded||t?.state!=="ready"||!t.url?[]:[i("section",{class:"appwin",role:"dialog","aria-label":"Your app, live",dataset:{slot:"appwin"}},i("header",{class:"appwin-bar",dataset:{sig:JSON.stringify([t.url,t.revision])}},i("span",{class:"screen-dots","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{class:"appwin-url"},i("i",{"aria-hidden":"true"}),mn(t.url)),i("span",{class:"appwin-note"},"Your app, running on this computer"),i("span",{class:"spacer"}),i("button",{type:"button",class:"appwin-tool",title:"Reload","aria-label":"Reload the app",on:{click:()=>n.reloadPreview()},html:M.reload}),i("a",{class:"appwin-tool",href:t.url,target:"_blank",rel:"noreferrer",title:"Open in a browser tab","aria-label":"Open in a browser tab",html:M.out}),i("button",{type:"button",class:"appwin-tool",title:"Stop the app","aria-label":"Stop the app",on:{click:()=>void n.stopPreview()},html:M.stop}),i("button",{id:"preview-collapse",type:"button",class:"appwin-tool is-close",title:"Back to the board","aria-label":"Back to the board",on:{click:()=>n.togglePreviewExpanded(!1)},html:M.collapse})),i("div",{class:"appwin-body",dataset:{sig:`${t.url}|${t.revision}`}},i("iframe",{id:"app-frame",src:t.url,title:"Your app, running on this computer",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-modals",referrerpolicy:"no-referrer"})))]}var De={discovering:"Getting ready",planning:"Planning",running:"Working",verifying:"Checking",waiting_for_user:"Waiting for you",succeeded:"Done",partially_completed:"Needs a look",failed:"Did not finish",cancelled:"Stopped",interrupted:"Interrupted"};function Je(e,n){return i("p",{class:`work-eyebrow is-${n}`},i("i",{"aria-hidden":"true"}),e)}function Oe(e,n){return e.length>n?`${e.slice(0,n-1)}\u2026`:e}function re(e,n,t,r=""){return i("span",{class:`wchip${r?` is-${r}`:""}`,title:t??n},typeof e=="string"?se(e):e,n)}function K(e,n,t,r={}){return i("button",{id:r.id,type:"button",class:`wtile${r.primary?" is-primary":""}${r.danger?" is-danger":""}`,disabled:r.disabled,"aria-pressed":r.pressed===void 0?void 0:String(r.pressed),on:{click:t}},i("span",{class:"wtile-ico",html:e}),i("span",{class:"wtile-label"},n),r.note?i("span",{class:"wtile-note"},r.note):null)}function gn(e){let n=e==="pass"?M.bigCheck:e==="fail"?M.bigCross:e==="warn"?M.bigBang:e==="wait"?M.key:M.bigStop;return i("span",{class:`wbadge is-${e}`,html:n})}function mr(e,n){let t=B[n]??B.claude;return re(i("img",{src:t,alt:"",width:14,height:14}),e.agents.find(r=>r.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex"))}function wr(e,n){let t=e.work.plan,r=t.plan,s=t.actionId==="app.change",a=e.probes[e.cliId]?.ready===!0,c=e.busy.probe===e.cliId,o=r.checks.length?r.checks.map(u=>u.replace("The preview still loads","page loads")).join(" + "):"no checks",d=s?[re(M.monitor,"This computer",r.target),mr(e,e.cliId),re(M.shield,Oe(o,28),`Then checks: ${r.checks.join(", ")||"nothing (no typecheck or test script)"}`),re(M.nodeploy,"No deploy",`Will not: ${r.willNot.join(", ")}`)]:[re(M.play,e.work.facts?.previewCommand??"npm run dev"),re(M.monitor,"This computer"),re(M.nodeploy,"No installs",`Will not: ${r.willNot.join(", ")}`)],p=(u,h,f,g)=>i("button",{type:"button",role:"radio","aria-checked":String(e.accessMode===u),class:`wmode${e.accessMode===u?" on":""}`,title:g,disabled:e.work.busy,on:{click:()=>void n.setWorkAccess(u)}},i("span",{class:"wmode-ico",html:h}),f),l=!s||a?K(M.play,s?e.accessMode==="ask"?"Get a plan":"Make the change":"Start the app",()=>void n.startPlanned(),{id:"work-start",primary:!0,disabled:e.work.busy}):K(M.plug,c?"Testing\u2026":`Connect ${Ee(e)}`,()=>void n.testConnection(e.cliId),{id:"work-start",primary:!0,disabled:c});return[Je("Plan \xB7 nothing runs until you start","plan"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s?Oe(r.outcome,90):"Show my app"),i("div",{class:"wchips"},...d),s?i("div",{class:"wmodes",role:"radiogroup","aria-label":"What the agent may do"},p("ask",M.eye,"Ask","Plan only. The agent edits nothing."),p("approve",M.pencil,"Edit","The agent edits files in this project."),p("full",M.bolt,"Full","Full local access. Still explains anything destructive.")):null,e.work.error?i("p",{class:"work-error",role:"alert"},e.work.error):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["go",s,a,c,e.accessMode,e.work.busy,e.cliId])}},l),i("button",{class:"wlink",on:{click:()=>s?n.newChange():n.closeWork()}},s?"Change the request":"Cancel")].filter(u=>u!==null)}var yr={done:M.check,failed:M.cross,skipped:M.dash,unknown:"?"};function hn(e,n){return i("ol",{class:`work-steps${n?" is-compact":""}`,dataset:{slot:"steps"}},...e.steps.map(t=>i("li",{class:`work-step is-${t.state}`,dataset:{sig:JSON.stringify([t.state,t.detail,n,t.id==="edit"?e.changes.map(r=>`${r.path}:${r.additions}:${r.deletions}`):0])}},i("span",{class:"work-mark","aria-hidden":"true",html:yr[t.state]??""}),i("div",{class:"work-step-copy"},i("span",{class:"work-step-label"},t.label),(!n||t.state==="active"||t.state==="failed")&&t.detail?i("span",{class:"work-step-detail"},t.detail):null,t.id==="edit"&&e.changes.length?i("ul",{class:"work-files"},...e.changes.slice(0,n?3:8).map(r=>i("li",{class:`is-${r.kind}`},i("code",{},r.path),i("span",{class:"add"},`+${r.additions}`),i("span",{class:"del"},`\u2212${r.deletions}`)))):null))))}function br(e){return e.checks.length?i("div",{class:"wchips"},...e.checks.map(n=>re(n.status==="passed"?M.check:n.status==="failed"?M.cross:M.dash,n.label.replace("The preview still loads","Page loads").replace("The page loads","Page loads"),n.detail??n.command,n.status==="passed"?"pass":n.status==="failed"?"fail":""))):null}function vr(e){return e.split(`
10
10
  `).map(n=>{let t=ye(n);return n.startsWith("+++")||n.startsWith("---")||n.startsWith("@@")?`<span class="hd">${t}</span>`:n.startsWith("+")?`<span class="add">${t}</span>`:n.startsWith("-")?`<span class="del">${t}</span>`:t}).join(`
11
- `)}function vr(e,n){let t=e.work.run,r=!te(t.state),s=t.state==="waiting_for_user"&&t.waiting?t.waiting:null,a=s?"wait":r?"work":t.state==="succeeded"?"pass":t.state==="failed"||t.state==="interrupted"?"fail":t.state==="cancelled"?"stop":"warn",c=t.steps.find(w=>w.state==="active"),o=t.actionId==="app.change",d=e.work.preview,p=d?.state==="ready"&&!!d.url,l=t.result,u=e.work.diff?.runId===t.id;if(s)return[Je("Waiting for you","wait"),i("div",{class:"whead"},pn("wait"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s.title)),i("p",{class:"wline"},s.missing?.length?`Add ${s.missing.length===1?"this":"these"} to .env.local, save, then check again. Test values are fine here.`:s.detail),s.missing?.length?i("div",{class:"wchips"},...s.missing.map(w=>re(M.key,w,w,"wait"))):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["resume",t.id,s.action,e.work.busy])}},K(M.reload,s.action,()=>void n.resumeRun(),{id:"work-resume",primary:!0,disabled:e.work.busy})),i("button",{class:"wlink is-danger",on:{click:()=>void n.cancelRun()}},"Stop")].filter(w=>w!==null);if(r)return[Je(`${De[t.state]}`,"work"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},o?Oe(t.inputs.request??"",80):"Starting your app"),i("p",{class:"work-live",role:"status","aria-live":"polite"},i("span",{class:"work-pulse","aria-hidden":"true"}),c?.label??De[t.state],i("span",{class:"work-elapsed",dataset:{since:t.createdAt}})),gn(t,!0),i("div",{class:"wtiles is-one",dataset:{sig:`stop|${t.id}`}},K(M.bigStop,"Stop",()=>void n.cancelRun(),{danger:!0,note:o?"Keeps what already changed":void 0}))];let h=[];p&&h.push(K(M.play,"Try it",()=>n.togglePreviewExpanded(!0),{id:"work-try",primary:!0})),!o&&(t.state==="failed"||t.state==="cancelled")?h.push(K(M.reload,"Try again",()=>void n.planAction("preview.start"),{id:"work-retry",primary:!0})):o&&!p&&e.work.offers.find(w=>w.id==="preview.start")?.availability==="ready"&&h.push(K(M.play,"Show my app",()=>void n.planAction("preview.start"),{id:"work-try",primary:!0})),o&&t.changes.length&&h.push(K(M.diff,u?"Hide change":"Review",()=>void n.showDiff(),{pressed:u}));let f=t.changes.filter(w=>w.owner==="agent");o&&f.length&&!t.reverted&&h.push(br(t,f.length,n)),o&&h.push(K(M.plus,"New",()=>n.newChange()));let g=[gn(t,!1),l?.unknowns?.length?i("section",{class:"work-unknowns","aria-label":"Not checked"},i("h2",{},"Not checked"),i("ul",{},...l.unknowns.map(w=>i("li",{},w)))):null,...t.checks.filter(w=>w.status==="failed"&&w.detail).map(w=>i("pre",{class:"work-detail"},w.detail)),l?.agentAnswer?i("div",{class:"agent-reply-body",html:X(l.agentAnswer)}):null].filter(w=>w!==null);return[Je(`${De[t.state]} \xB7 ${F(t.updatedAt)}`,a==="stop"?"plan":a),i("div",{class:"whead"},pn(a),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},l?.title??De[t.state])),l?.summary?i("p",{class:"wline"},Oe(l.summary,140)):null,wr(t),t.reverted?i("p",{class:"work-hint"},`Undone: ${t.reverted.restored.length} file${t.reverted.restored.length===1?"":"s"} put back${t.reverted.skipped.length?`, ${t.reverted.skipped.length} left as they were`:""}.`):null,h.length?i("div",{class:`wtiles${h.length===1?" is-one":""}`,dataset:{sig:JSON.stringify(["done",t.id,t.state,p,u,f.length,!!t.reverted,h.length])}},...h):null,u?i("section",{class:"work-diff","aria-label":"The change"},...e.work.diff.files.length?e.work.diff.files.map(w=>kr(t,w,n)):[i("p",{class:"work-hint"},"Nothing left to show: the files match where the run started.")]):null,i("details",{class:"wdetails"},i("summary",{},"Details"),...g)].filter(w=>w!==null)}var Se=null;function br(e,n,t){let r=Se===e.id,s=`the ${n} file${n===1?"":"s"} proven to be the agent\u2019s own edit${n===1?"":"s"}`,a=K(M.undo,r?"Sure?":"Undo",()=>{if(Se!==e.id){Se=e.id,a.querySelector(".wtile-label").textContent="Sure?",a.classList.add("is-danger"),a.title=`Put back ${s}. Click again.`,window.setTimeout(()=>{Se===e.id&&(Se=null,a.querySelector(".wtile-label").textContent="Undo",a.classList.remove("is-danger"))},6e3);return}Se=null,t.undoRun()},{danger:r,note:n<e.changes.length?`${n} of ${e.changes.length} files`:void 0});return a.title=`Put back ${s}. Anything else that changed is left alone.`,a}var Ae=null;function kr(e,n,t){let r=e.changes.find(p=>p.path===n.path),s=e.restoredFiles?.includes(n.path),a=!!(r&&r.owner!=="agent"&&!s&&!e.reverted?.restored.includes(n.path)),c=`${e.id}:${n.path}`,o=a?i("button",{type:"button",class:`wlink diff-restore${Ae===c?" is-danger":""}`,title:"Put this file back to how it was when the run started. Any edits in it, yours included, go too; VibeRaven keeps a copy of it as it is now.",on:{click:p=>{if(Ae!==c){Ae=c,p.currentTarget.textContent="Sure? Put it back",p.currentTarget.classList.add("is-danger"),window.setTimeout(()=>{Ae===c&&(Ae=null)},6e3);return}Ae=null,t.restoreFile(n.path)}}},"Put back"):null,d=s?"Put back by you":a?"Not undone automatically":null;return i("div",{class:"work-diff-file"},i("h3",{},n.path,d?i("span",{class:`diff-note${a?" is-warn":""}`,title:a?"It changed during the run, but VibeRaven cannot prove it was only the agent\u2019s edit, so Undo leaves it alone.":void 0},d):null,o),i("pre",{class:"out diff",tabindex:0,html:yr(n.diff)}))}function bn(e,n){return e.work.gallery?un(e,n):e.work.plan?fr(e,n):e.work.run?vr(e,n):[i("h1",{id:"stage-heading",tabindex:-1},"Nothing running"),i("p",{class:"stage-sub"},"Describe a change in the box under your app, or pick an action."),Mr(e)].filter(t=>t!==null)}function Mr(e){return e.work.history.length?i("section",{class:"work-history","aria-label":"Earlier runs"},i("h2",{},"Earlier"),i("ul",{},...e.work.history.slice(0,6).map(n=>i("li",{class:`is-${n.state}`},i("strong",{},n.inputs?.request?Oe(n.inputs.request,70):n.actionId==="preview.start"?"Show my app":n.actionId),i("span",{},`${De[n.state]??n.state} \xB7 ${F(n.createdAt)}${n.changes?` \xB7 ${n.changes} file${n.changes===1?"":"s"}`:""}`))))):null}var Lr={ready:"Ready",needs_connection:"Needs a connection",needs_information:"Waiting",guided:"Guided",unsupported:"Not for this app",already_configured:"Done",planned:"Planned"},wt={db:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><ellipse cx="8" cy="3.8" rx="5" ry="1.9"/><path d="M3 3.8v8.4c0 1 2.2 1.9 5 1.9s5-.9 5-1.9V3.8M3 8c0 1 2.2 1.9 5 1.9s5-.9 5-1.9"/></svg>',lock:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.6"/><path d="M5.3 7V5a2.7 2.7 0 0 1 5.4 0v2"/></svg>',link:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M6.6 9.4l2.8-2.8M7 4.5l1-1a2.8 2.8 0 0 1 4 4l-1 1M9 11.5l-1 1a2.8 2.8 0 0 1-4-4l1-1"/></svg>',gear:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><circle cx="8" cy="8" r="2.2"/><path d="M8 1.8v1.8M8 12.4v1.8M1.8 8h1.8M12.4 8h1.8M3.6 3.6l1.3 1.3M11.1 11.1l1.3 1.3M12.4 3.6l-1.3 1.3M4.9 11.1l-1.3 1.3"/></svg>',route:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="3.5" cy="12.5" r="1.6"/><circle cx="12.5" cy="3.5" r="1.6"/><path d="M5 12.5h4.5a2.5 2.5 0 0 0 0-5h-3a2.5 2.5 0 0 1 0-5H11"/></svg>',tag:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 2.5h5.2l5.8 5.8-5.2 5.2-5.8-5.8z"/><circle cx="5.3" cy="5.3" r="1"/></svg>',gauge:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M2.5 11.5a5.5 5.5 0 1 1 11 0"/><path d="M8 11.5l2.6-3.4"/></svg>',search:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="7" cy="7" r="4.2"/><path d="M10.2 10.2l3.3 3.3"/></svg>',upload:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 10.5V2.8M4.8 6 8 2.8 11.2 6M2.8 10.8v1.6c0 .7.6 1.3 1.3 1.3h7.8c.7 0 1.3-.6 1.3-1.3v-1.6"/></svg>',play:M.play.replace('width="13" height="13"',""),spark:M.spark.replace('width="16" height="16"',""),shield:M.shield.replace('width="13" height="13"',""),key:M.key.replace('width="15" height="15"',""),plug:M.plug.replace('width="13" height="13"',""),reload:M.reload.replace('width="13" height="13"',""),plus:M.plus.replace('width="14" height="14"',""),monitor:M.monitor.replace('width="13" height="13"',"")},xr={"preview.start":{icon:"play"},"app.change":{icon:"spark"},"findings.fix":{icon:"shield"},"supabase.connect":{brand:"supabase"},"auth.google":{brand:"google"},"auth.github":{brand:"github"},"data.feature":{icon:"db"},"db.drift":{icon:"db"},"secret.exposed":{icon:"key"},"auth.callback":{icon:"link"},"config.fix":{icon:"gear"},"deploy.preview":{brand:"vercel"},"flow.verify":{icon:"route"},"auth.email":{brand:"resend"},"access.rule":{icon:"lock"},"storage.uploads":{icon:"upload"},"email.transactional":{brand:"resend"},"payments.add":{brand:"stripe"},"webhook.connect":{icon:"plug"},"release.prepare":{icon:"tag"},"config.env":{icon:"gear"},"monitoring.add":{brand:"sentry"},"improve.performance":{icon:"gauge"},"improve.seo":{icon:"search"},"task.custom":{icon:"spark"},"app.starter":{icon:"plus"},"integration.add":{icon:"plug"},"change.recheck":{icon:"reload"}};function hn(e,n){let t=xr[n.id]??{icon:"spark"},r=n.id==="agent.connect"?i("img",{src:B[e.cliId]??B.claude,alt:""}):t.brand?i("img",{src:q(t.brand),alt:""}):i("span",{class:"act-ico",html:wt[t.icon??"spark"]??wt.spark});return i("span",{class:"act-art","aria-hidden":"true"},r)}var Pe="All",yt="";function mt(e){let n=yt.trim().toLowerCase();e.querySelectorAll("[data-act]").forEach(r=>{let s=Pe==="All"||r.dataset.family===Pe,a=!n||(r.dataset.search??"").includes(n);r.hidden=!(s&&a)}),e.querySelectorAll("[data-act-group]").forEach(r=>{let s=r.querySelectorAll("[data-act]:not([hidden])").length;r.hidden=!s;let a=r.querySelector(".act-count");a&&(a.textContent=String(s))});let t=e.querySelector(".act-empty");t&&(t.hidden=!!e.querySelector("[data-act]:not([hidden])")),e.querySelectorAll(".act-chip").forEach(r=>r.setAttribute("aria-pressed",String(r.dataset.family===Pe)))}function kn(e,n){let t=["All","Build","Connect","Data","Security","Release","Business","Improve"],r=e.work.offers,s=r.filter(l=>l.executable),a=r.filter(l=>!l.executable),c=l=>`${l.name} ${l.outcome} ${l.family}`.toLowerCase(),o=l=>{let u=l.availability==="already_configured",h=l.availability==="needs_connection"?"Connect":l.id==="app.change"?"Describe it":l.id==="findings.fix"?"Open findings":l.id==="agent.connect"?"Agents":"Start",f=!u&&(l.availability==="ready"||l.availability==="needs_connection"||l.id==="app.change"||l.id==="findings.fix"),g=u?"Done":l.availability==="ready"?"Ready":l.availability==="needs_connection"?"Needs your agent":Lr[l.availability]??"Waiting";return i("li",{class:"act-row",dataset:{act:l.id,family:l.family,search:c(l)},title:l.reason},hn(e,l),i("div",{},i("h5",{},l.name),i("p",{},l.outcome)),i("div",{class:"act-side"},i("span",{class:`act-status is-${u?"done":l.availability}`},i("i",{"aria-hidden":"true"}),g),f?i("button",{type:"button",class:`act-go${l.availability==="ready"||l.id==="app.change"?" is-primary":""}`,on:{click:()=>{n.toggleCatalog(!1),n.runOffer(l)}}},h,se(M.arrow)):null))},d=l=>{let u=ur[l.id];return i("li",{class:"act-item",dataset:{act:l.id,family:l.family,search:c(l)},title:`${l.outcome} ${l.reason}`},hn(e,l),i("strong",{},l.name),u?i("button",{type:"button",class:"act-peek",title:"A simulated preview of how this action will look. It does not run.",on:{click:()=>n.showGallery(u.kind,"work",u.provider)}},"Preview",se(M.arrow)):i("span",{class:"act-soon"},l.availability==="unsupported"?"Not for this app":"Soon"))},p=i("div",{class:"act-catalog"},i("div",{class:"act-tools"},i("label",{class:"act-search"},i("span",{class:"act-search-ico",html:wt.search}),i("input",{type:"search",placeholder:"Find an action",value:yt,"aria-label":"Find an action",on:{input:l=>{yt=l.target.value,mt(p)}}})),i("div",{class:"act-chips",role:"group","aria-label":"Kind of action"},...t.map(l=>i("button",{type:"button",class:"act-chip",dataset:{family:l},"aria-pressed":String(l===Pe),on:{click:()=>{Pe=l,mt(p)}}},l)))),i("section",{class:"act-group",dataset:{actGroup:"ready"},"aria-label":"Ready now"},i("div",{class:"act-head"},i("h4",{},"Ready now"),i("span",{},i("b",{class:"act-count"},String(s.length))," work in this version")),i("ul",{class:"act-rows"},...s.map(o))),i("section",{class:"act-group",dataset:{actGroup:"coming"},"aria-label":"Coming next"},i("div",{class:"act-head"},i("h4",{},"Coming next"),i("span",{},i("b",{class:"act-count"},String(a.length))," planned. Preview shows how one will look; it does not run.")),i("ul",{class:"act-items"},...a.map(d))),i("p",{class:"act-empty",hidden:!0},"No action matches. Try another word, or describe the change in the box under your app."));return mt(p),p}var P={check:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',back:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 8H3M7 4L3 8l4 4"/></svg>',copy:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.6"/><path d="M10.5 5.5V3.6c0-.6-.5-1.1-1.1-1.1H3.6c-.6 0-1.1.5-1.1 1.1v5.8c0 .6.5 1.1 1.1 1.1h1.9"/></svg>',more:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.4"/><circle cx="8" cy="8" r="1.4"/><circle cx="13" cy="8" r="1.4"/></svg>',out:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',scan:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5V3.5C2 2.7 2.7 2 3.5 2H5M11 2h1.5c.8 0 1.5.7 1.5 1.5V5M14 11v1.5c0 .8-.7 1.5-1.5 1.5H11M5 14H3.5C2.7 14 2 13.3 2 12.5V11"/><circle cx="7.6" cy="7.6" r="2.4"/><path d="M9.4 9.4 11 11"/></svg>',fix:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',recheck:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 0 1-9.6 3.7M2.5 8a5.5 5.5 0 0 1 9.6-3.7"/><path d="M12.5 1.8v2.7H9.8M3.5 14.2v-2.7h2.7"/></svg>',launch:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5v11M3 3h8.5l-1.8 2.8L11.5 8.6H3"/></svg>',pr:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="4" cy="3.5" r="1.6"/><circle cx="4" cy="12.5" r="1.6"/><circle cx="12" cy="12.5" r="1.6"/><path d="M4 5.1v5.8M12 10.9V6.5a2 2 0 0 0-2-2H7.5M9 3 7.5 4.5 9 6"/></svg>',zoomIn:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>',zoomOut:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M3.5 8h9"/></svg>',reset:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 6V2.5H6M13.5 10v3.5H10M2.5 2.5l4 4M13.5 13.5l-4-4"/></svg>',app:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="2.5" width="12.4" height="11" rx="2"/><path d="M1.8 5.5h12.4M6 8.4 4.6 9.8 6 11.2M10 8.4l1.4 1.4-1.4 1.4"/></svg>'},Sr={critical:"Critical",warning:"Important",info:"Nice to have"};function we(e){return i("span",{class:"ico",html:e})}function Re(e){return(e||"Project").replace(/^@[^/]+\//,"").split(/[-_\s]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function pe(e){let n=e.project.project;return(n?.name&&n.name!=="Project"?n.name:(n?.path??"").split(/[\\/]/).filter(Boolean).pop())||"your-app"}function et(e,n=e.cliId){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function Ln(e,n){let t=e.project.project,r=e.project.releases?.[0],s=Sn(e,R(e));return i("header",{class:"top",dataset:{slot:"top"}},i("span",{class:"brand","aria-label":"VibeRaven"},i("span",{class:"brand-mark","aria-hidden":"true",html:Be}),i("span",{class:"brand-word","aria-hidden":"true"},"VibeRaven")),i("span",{class:"top-project"},i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("strong",{},Re(pe(e))),i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("code",{},[r?.branch,t?.version?`v${t.version.replace(/^v/,"")}`:null].filter(Boolean).join(" \xB7 ")||"local")),i("span",{class:"spacer"}),Ar(e,n),i("span",{class:`top-verdict is-${s.tone}`},i("i",{"aria-hidden":"true"}),s.text),i("div",{class:"more-wrap"},i("button",{id:"open-more",class:`quiet more-button${e.moreOpen?" on":""}`,"aria-haspopup":"menu","aria-expanded":String(e.moreOpen),"aria-controls":"more-menu",on:{click:()=>n.toggleMore()}},"More",we(P.more)),e.moreOpen?Cr(e,n):null))}function Ar(e,n){let t=R(e),r=e.flow.step,s=(a,c,o,d,p={})=>i("button",{id:a,class:"top-tab","aria-current":o?"page":void 0,disabled:p.disabled,on:{click:d}},c,p.count?i("span",{class:"top-tab-count"},String(p.count)):null);return i("nav",{class:"top-tabs","aria-label":"Views"},s("tab-stack","Stack",r==="app"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("app")}),s("tab-findings","Findings",r==="findings"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("findings")},{disabled:!t.available.findings,count:t.findings.length}),s("tab-terminal","Agents",e.drawer==="terminal",()=>n.openMore("terminal")),s("tab-releases","Releases",e.drawer==="releases",()=>n.openMore("releases")))}function Cr(e,n){let t=e.agents.filter(s=>e.probes[s.id]?.ready).length,r=[{id:"services",label:"Services",note:"Browse, add and check services live"},{id:"terminal",label:"Coding agents",note:t?`${t} connected`:"Install, sign in, test"},{id:"chat",label:"Agent chat",note:"Ask your agent anything about this app"},{id:"releases",label:"Releases",note:(e.project.releases??[]).length?"History and diffs":"Compare any two commits"}];return i("div",{id:"more-menu",class:"more-menu",role:"menu","aria-label":"More",on:{keydown:s=>{let a=s.key;if(a!=="ArrowDown"&&a!=="ArrowUp")return;s.preventDefault();let c=Array.from(s.currentTarget.querySelectorAll('[role="menuitem"]')),o=c.indexOf(document.activeElement);c[(o+(a==="ArrowDown"?1:-1)+c.length)%c.length]?.focus()}}},...r.map(s=>i("button",{role:"menuitem",class:"more-item",on:{click:()=>n.openMore(s.id)}},i("strong",{},s.label),i("span",{},s.note))))}function xn(e,n,t){let r=Rt(n,e),s=e.flow.step,a=n.scanning||e.setup.running,c=()=>{s==="fix"&&n.current?t.checkAgain():n.available.recheck?t.goToStep("recheck"):t.checkMyApp()},o=[{key:"scan",id:"check-my-app",label:n.scanning?"Scanning":"Scan",svg:P.scan,meta:r.app,current:s==="app",disabled:a,passed:n.scanned,onClick:()=>void t.checkMyApp()},{key:"fix",label:"Fix",svg:P.fix,meta:r.fix,current:s==="fix",disabled:!n.available.fix||a,passed:!1,onClick:()=>t.goToStep("fix")},{key:"recheck",label:"Re-check",svg:P.recheck,meta:r.recheck,current:s==="recheck",disabled:!n.scanned||a,passed:e.flow.recheck?.status==="fixed",onClick:c},{key:"ready",label:"Launch",svg:P.launch,meta:r.ready,current:s==="ready",disabled:!n.available.ready,passed:!1,onClick:()=>t.goToStep("ready")}];return i("nav",{class:`rail${n.scanning?" is-scanning":""}`,"aria-label":"Launch path",dataset:{slot:"rail"}},i("ol",{},...o.map(d=>i("li",{class:`rail-step is-${d.current?"current":d.disabled?"locked":d.passed?"passed":"open"}`},i("button",{id:d.id,class:"rail-button",title:d.meta,"aria-current":d.current?"step":void 0,disabled:d.disabled,on:{click:d.onClick}},i("span",{class:"rail-mark","aria-hidden":"true",html:d.svg}),i("span",{class:"rail-copy"},i("span",{class:"rail-label"},d.label),i("span",{class:"rail-meta"},d.meta)),d.key==="scan"&&n.scanning?i("i",{class:"rail-time","aria-hidden":"true"}):null)))))}function Sn(e,n){if(n.scanning)return{text:"Checking your app",tone:"pending"};if(!n.scanned)return{text:"Not checked yet",tone:"pending"};if(n.counts.critical)return{text:`${n.counts.critical} blocker${n.counts.critical===1?"":"s"}`,tone:"fail"};if(n.findings.length)return{text:`${n.findings.length} to review`,tone:"warn"};let t=n.checklist.filter(s=>!s.done).length,r=t?` \xB7 ${t} unknown${t===1?"":"s"}`:"";return{text:n.gateClear?`No blockers in repo checks${r}`:"No blockers in repo checks",tone:"pass"}}var $r={pending:"Unknown",pass:"Repo checked",warn:"Review",fail:"Blockers"};function Ir(e){let n=e.stateText.replace(/^(Repo checks|Unknown)\s*·\s*/,"")||e.stateText;return n.charAt(0).toUpperCase()+n.slice(1)}function Mn(e,n=null){return i("li",{class:`node is-${e.tone}${e.id===n?" is-focus":""}`,dataset:{provider:e.id,card:e.id,sig:JSON.stringify([e.id,e.tone,e.stateText,e.mark,e.id===n])}},i("span",{class:"node-head"},e.mark?i("img",{src:e.mark,alt:"",width:18,height:18}):i("span",{class:"node-fallback"},e.name.slice(0,1)),i("span",{class:"node-name"},e.name)),e.area?i("code",{class:"node-detail"},e.area.toLowerCase()):null,i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},Ir(e)),i("span",{class:"node-verdict"},$r[e.tone])))}function jr(){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("class","board-lines"),e.setAttribute("aria-hidden","true"),e.setAttribute("data-sig","lines"),e}function Tr(e,n,t){let r=e.project.project,s=Sn(e,n),a=wn(e),c=!!(e.work.run&&!te(e.work.run.state)),o=n.services.length<=3,d=o?[]:n.services.filter((w,v)=>v%2===0),p=o?n.services:n.services.filter((w,v)=>v%2===1),l=n.scanned?[r?.archetype&&r.archetype!=="unknown"?r.archetype:null,r?.scannedAt?`Checked ${F(r.scannedAt)}`:null,typeof e.project.gate?.score=="number"?`Heuristic repo-check score ${e.project.gate.score} of 100`:null].filter(w=>!!w):[],u=e.flow.step==="app"?null:e.flow.step==="fix"?n.current?.service?.id??null:e.contextProviderId,h=n.services.length>0||!!a,f=[...a&&!o?[a]:[],...d.map(w=>Mn(w,u))],g=[...a&&o?[a]:[],...p.map(w=>Mn(w,u))];return i("figure",{class:`board has-screen${n.scanning?" is-scanning":""}${c?" is-working":""}${h?o?" is-side":"":" is-solo"}`,dataset:{slot:"board",lines:h?"1":"",layoutKey:e.project.project?.path||pe(e)},"aria-label":`${Re(pe(e))} and the services found in its code`},jr(),i("ul",{class:"board-col left",hidden:!f.length,dataset:{slot:"left"}},...f),i("div",{class:`board-app is-${s.tone}${c?" is-working":""}`,dataset:{card:"app",slot:"app"}},i("span",{class:"node-head",dataset:{sig:`head|${pe(e)}`}},we(P.app),i("span",{class:"node-name"},Re(pe(e)))),i("code",{class:"board-app-name",dataset:{sig:`name|${pe(e)}|${e.project.releases?.[0]?.branch??""}`}},[pe(e),e.project.releases?.[0]?.branch].filter(Boolean).join(" \xB7 ")),Xe(e,t),i("p",{class:"board-status",dataset:{sig:`status|${s.text}`}},i("strong",{},s.text)),yn(e),i("ul",{class:"board-checks",hidden:!l.length,dataset:{sig:`checks|${l.join("|")}`}},...l.map(w=>i("li",{},i("i",{"aria-hidden":"true"}),w)))),i("ul",{class:"board-col right",hidden:!g.length,dataset:{slot:"right"}},...g))}function tt(e){let n=e.querySelector(".board-lines"),t=e.querySelector(".board-app");if(!n||!t)return;let r=e.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;if(!r.width||!s)return;let c=r.width/s;if(n.setAttribute("viewBox",`0 0 ${Math.round(s)} ${Math.round(a)}`),n.setAttribute("width",String(Math.round(s))),n.setAttribute("height",String(Math.round(a))),getComputedStyle(n).display==="none"){n.innerHTML="";return}let o=t.getBoundingClientRect(),d=o.left+o.width/2,p=Array.from(e.querySelectorAll(".node")),l=f=>(f-r.left)/c,u=f=>(f-r.top)/c,h=p.map((f,g)=>{let w=f.getBoundingClientRect(),v=w.left+w.width/2<d,L=l(v?o.left:o.right),$=u(o.top+o.height/2)+(g%4-1.5)*Math.min(22,o.height/c/7),y=l(v?w.right:w.left),k=u(w.top+w.height/2),E=(L+y)/2,A=/is-(work|pass|warn|fail|pending)/.exec(f.className)?.[1]??"pending",I=`M ${L.toFixed(1)} ${$.toFixed(1)} C ${E.toFixed(1)} ${$.toFixed(1)} ${E.toFixed(1)} ${k.toFixed(1)} ${y.toFixed(1)} ${k.toFixed(1)}`;return`<path class="line is-${A}" d="${I}"/><path class="pulse is-${A}" pathLength="1" style="animation-delay:${(g*.6).toFixed(2)}s" d="${I}"/>`});n.innerHTML=h.join("")}function _(e,n){let t=[i("h1",{id:"stage-heading",tabindex:-1},e)];return n&&t.push(i("p",{class:"stage-sub"},n)),t}function z(e,n,t={}){return i("div",{class:"primary-row"},i("button",{id:t.id??"primary-action",class:"primary",disabled:t.disabled,on:{click:n}},t.busy?i("span",{class:"spin","aria-hidden":"true"}):null,e,t.busy?null:we(P.arrow)),t.note?i("span",{class:"primary-note"},t.note):null)}function vt(e,n,t={}){return i("button",{class:"quiet",disabled:t.disabled,on:{click:n}},t.icon?we(t.icon):null,e)}function An(e){return i("span",{class:`sev is-${e.severity}`},i("i",{"aria-hidden":"true"}),Sr[e.severity])}function Cn(e,n=!1){if(!e.locations.length)return null;let[t,...r]=e.locations;return i("span",{class:"where"},i("code",{title:e.locations.join(`
12
- `)},n?t:Ot(t)),r.length?i("span",{class:"where-more"},`+${r.length} more`):null)}function Nr(e,n){let t=e.project.project,r=n.services.length,s=n.scanning?"Reading your code and the services it uses. Nothing leaves this computer.":r?`${r} service${r===1?"":"s"} found in this code.`:"No hosted services found in this code yet.",a=n.scanning?"Checking on this computer, offline.":n.scanned?`Last check ${F(t.scannedAt)} \xB7 runs on this computer, offline`:"Press Scan to check your app. It runs on this computer, offline.";return[i("h1",{id:"stage-heading",tabindex:-1,class:"sr-only"},Re(pe(e))),i("p",{class:"sr-only",role:"status"},`${s} ${a}`)]}function Dr(e,n){let t=e.project.project;return n.scanning?"Checking on this computer, offline.":n.scanned&&t?.scannedAt?`Last check ${F(t.scannedAt)} \xB7 everything runs on this computer`:"Everything runs on this computer."}function Er(e,n,t){let r=n.fixable[0],s=e.project.project?.scannedAt;if(!n.findings.length)return[..._("Nothing to fix",`The check ${s?F(s):""} found no blockers in this code.`),z("Go to the launch checklist",()=>t.goToStep("ready"))];let a=[n.counts.critical?`${n.counts.critical} critical`:null,n.counts.warning?`${n.counts.warning} important`:null,n.counts.info?`${n.counts.info} nice to have`:null].filter(Boolean).join(", "),c=(o,d,p)=>o?i("span",{class:`fchip is-${d}`},i("i",{"aria-hidden":"true"}),`${o} ${p}`):null;return[i("h1",{id:"stage-heading",tabindex:-1},`${n.findings.length} finding${n.findings.length===1?"":"s"}`),i("div",{class:"fchips"},c(n.counts.critical,"critical","critical"),c(n.counts.warning,"warning","important"),c(n.counts.info,"info","nice to have"),i("span",{class:"fchip is-time"},`Checked ${s?F(s):"just now"}`)),i("div",{class:"findings"},...n.groups.map(o=>i("section",{class:"group","aria-label":o.name},i("header",{class:"group-head"},o.mark?i("img",{src:o.mark,alt:"",width:22,height:22}):i("span",{class:"group-code","aria-hidden":"true"},"</>"),i("h2",{},o.name),i("span",{class:"group-count"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>{let p=d.id===r?.id,l=[i("span",{class:"finding-main"},i("span",{class:"finding-title"},d.title),i("span",{class:"finding-meta"},An(d),d.dashboard?i("span",{class:"finding-tag"},"In your dashboard"):d.actionDestination==="manual-review"?i("span",{class:"finding-tag"},"Check by hand"):Cn(d))),d.dashboard?null:i("span",{class:"finding-go"},p?"Fix first":"Fix")];return i("li",{},d.dashboard?i("div",{class:`finding is-${d.severity} is-static`,dataset:{provider:d.service?.id??""}},...l):i("button",{class:`finding is-${d.severity}${p?" is-first":""}`,dataset:{provider:d.service?.id??""},on:{click:()=>t.fixFinding(d.id)}},...l))}))))),r?i("div",{class:"wtiles is-one findings-go"},i("button",{id:"fix-first",type:"button",class:"wtile is-primary",title:r.title,on:{click:()=>t.fixFinding()}},i("span",{class:"wtile-ico",html:P.fix}),i("span",{class:"wtile-label"},r.severity==="critical"?"Fix the first blocker":"Fix the first finding"))):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Review the remaining provider and live-evidence steps."})]}function Pr(e,n,t){let r=e.agents.filter(s=>s.installed);return r.length?i("div",{class:"agent-choice",role:"radiogroup","aria-label":"Coding agent"},...r.map(s=>{let a=e.probes[s.id],c=s.id===e.cliId;return i("button",{role:"radio","aria-checked":String(c),class:`agent-option${c?" on":""}`,disabled:t,on:{click:()=>n.selectCli(s.id)}},i("i",{class:a?.ready?"ok":a?"no":"","aria-hidden":"true"}),s.label.replace(/ CLI$/,""))})):null}function Or(e,n,t){let r=n.current;if(!r)return[..._("Nothing to fix in code","Choose a finding to review, or inspect the remaining checklist steps."),z("Go to the launch checklist",()=>t.goToStep("ready"))];let s=n.fixable.findIndex(h=>h.id===r.id),a=e.flow.handoff?.findingId===r.id?e.flow.handoff:null,c=et(e),o=e.probes[e.cliId],d=e.agents.filter(h=>h.installed),p=a?.status==="running",l=e.busy.probe===e.cliId,u;return p?u=z(`${c} is working`,()=>{},{disabled:!0,busy:!0,note:"It edits files in this repo. You review the change."}):a?.status==="done"?u=z("Check again",()=>void t.checkAgain(),{id:"check-again",note:"Runs the same local check to see if the fix held."}):d.length?o?.ready?u=z(a?.status==="failed"?`Send to ${c} again`:`Send to ${c}`,()=>void t.sendFix(),{id:"send-fix",note:e.accessMode==="ask"?"Ask mode is on: the agent will only plan, not edit. Change it in More, Agent chat.":`${c} edits files in this repo. You review the change.`}):u=z(l?`Connecting ${c}`:`Connect ${c}`,()=>void t.testConnection(e.cliId),{disabled:l,busy:l,note:o?o.message:`VibeRaven runs ${c} on this computer with your own sign-in.`}):u=z("Copy the prompt",()=>void t.copyFix(),{note:"No coding agent found on this computer. Paste it into any agent."}),[..._(r.title),i("div",{class:"fix-meta"},An(r),i("span",{class:"fix-count"},`Blocker ${s+1} of ${n.fixable.length}${r.service?` \xB7 ${r.service.name}`:""}`),Cn(r,!0)),r.summary?i("p",{class:"fix-summary"},r.summary):null,r.evidence.length?i("ul",{class:"fix-evidence"},...r.evidence.slice(0,4).map(h=>i("li",{},h))):null,i("section",{class:"prompt","aria-label":"Prompt for your agent"},i("header",{},i("h2",{},"Prompt for your agent"),vt("Copy",()=>void t.copyFix(),{icon:P.copy})),i("pre",{tabindex:0},r.prompt)),Pr(e,t,p||e.busy.chat),p?i("p",{class:"working-line",role:"status"},i("span",{dataset:{working:"1"}},`${c} is working\u2026`),i("button",{class:"quiet stop",on:{click:()=>void t.stop()}},"Stop")):null,a&&a.status!=="running"?i("section",{class:`agent-reply is-${a.status}`,"aria-label":`${et(e,a.cliId)} replied`},i("h2",{},a.status==="done"?`${et(e,a.cliId)} replied`:`${et(e,a.cliId)} did not finish`),i("div",{class:"agent-reply-body",html:X(a.output)})):null,u,i("div",{class:"quiet-row"},vt("Back to findings",()=>t.goToStep("findings"),{icon:P.back}),a?.status!=="done"?vt("Fixed it yourself? Check again",()=>void t.checkAgain(),{disabled:p||n.scanning}):null)].filter(h=>h!==null)}function Rr(e,n,t){let r=e.flow.recheck;if(!r)return[..._("Nothing to check yet","Fix a blocker first, then check again here."),z("Back to findings",()=>t.goToStep("findings"))];let s=typeof r.scoreBefore=="number"&&typeof r.scoreAfter=="number"&&r.scoreBefore!==r.scoreAfter?i("p",{class:"score-move"},`Heuristic repo-check score ${r.scoreBefore} \u2192 ${r.scoreAfter}`):null;if(r.status==="running")return[..._("Checking again",`Running the same local check to see if \u201C${r.title}\u201D is gone.`),i("div",{class:"recheck-meter",role:"status"},i("span",{class:"spin"}),"Reading the repo"),z("Checking",()=>{},{disabled:!0,busy:!0})];if(r.status==="fixed"){let a=n.fixable.find(c=>c.id===r.nextId);return[..._("Scenario passed locally",`\u201C${r.title}\u201D no longer shows up in the check.`),s,i("p",{class:"recheck-next",role:"status"},a?`Next: ${a.title}`:"That was the last blocker in the code."),a?z("Next blocker",()=>t.fixFinding(a.id),{note:"Moving on by itself in a moment."}):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Moving on by itself in a moment."})].filter(c=>c!==null)}return r.status==="open"?[..._("Still open",`The check still finds \u201C${r.title}\u201D.`),r.message?i("p",{class:"fix-summary"},r.message):null,s,z("Back to the fix",()=>t.fixFinding(r.findingId))].filter(a=>a!==null):[..._("The check did not finish",r.message??""),z("Check again",()=>void t.checkAgain())]}function Ur(e,n,t){if(!n.checklist.length)return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist"),i("p",{class:"empty-line"},"No dashboard steps found for this app: VibeRaven found no hosted services in the code."));let r=n.checklist.filter(s=>!s.done).length;return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist",i("span",{class:"checklist-count"},r?`${r} left`:"All done")),i("ul",{},...n.checklist.map(s=>i("li",{class:`check-item${s.done?" is-done":""}`},s.doneBy==="you"?i("button",{class:"tick",role:"checkbox","aria-checked":String(s.done),"aria-label":s.label,on:{click:()=>t.toggleChecklistItem(s.id)},html:s.done?P.check:""}):i("span",{class:`tick is-auto${s.done?" on":""}`,"aria-hidden":"true",html:s.done?P.check:""}),i("div",{class:"check-copy"},i("strong",{},s.label),i("span",{},s.detail),i("span",{class:"check-who"},s.doneBy==="you"?"You confirm this":s.kind==="live"?"VibeRaven confirms this with your agent":"VibeRaven confirms this on the next check")),s.kind==="live"&&!s.done&&s.providerId?i("button",{class:"quiet",disabled:e.busy.chat||!e.probes[e.cliId]?.ready,title:e.probes[e.cliId]?.ready?void 0:"Connect a coding agent first",on:{click:()=>void t.verifyById(s.providerId)}},"Check live"):s.href?i("a",{class:"quiet",href:s.href,target:"_blank",rel:"noreferrer"},"Open dashboard",we(P.out)):null))))}function Fr(e,n){let t=e.fullCheck.status,r=ve(t?.usage),s=t?.account?t.account.plan==="pro"?"Pro plan":"Free plan":null;return i("section",{class:"final","aria-label":"Full check"},i("h2",{},"Optional deeper repository review"),i("p",{},"A hosted model reviews selected repository context after you preview and confirm the upload. This does not verify live deployment behavior or capacity."),i("p",{class:"final-quota"},[s,r??"Free accounts get 2 full checks. Pro gets 50 a month."].filter(Boolean).join(" \xB7 ")),i("button",{id:"run-full-check",class:"primary",disabled:e.fullCheck.step==="running",on:{click:()=>void n.openFullCheck()}},"Run full check",we(P.arrow)),e.fullCheck.saved?i("button",{id:"show-last-full-check",class:"quiet",on:{click:()=>n.showSavedFullCheck()}},`Show last full check (score ${e.fullCheck.saved.score}, ${ot(e.fullCheck.saved.checkedAt)})`):null)}function zr(e,n,t){if(!n.available.ready)return[..._("Not yet","Fix the critical blockers first. The launch checklist opens when none are left."),z("Back to findings",()=>t.goToStep("findings"))];let r=n.findings.filter(o=>!o.dashboard).length,s=n.gateClear?"No blockers found within tested scope":"No critical blockers left",a=n.checklist.filter(o=>!o.done).length,c=n.gateClear?a?`${a} unknown${a===1?"":"s"}: the checklist items below, which VibeRaven cannot test from this computer.`:"The listed checks are recorded or marked done by you. This is not confirmation that production is ready.":`The repository checks found no critical blockers.${r?` ${r} other finding${r===1?" is":"s are"} still open in Findings.`:""} Review the remaining findings and live-evidence checklist.`;return[..._(s,c),n.services.length?i("ul",{class:"strip","aria-label":"Services"},...n.services.map(o=>i("li",{class:`strip-item is-${o.tone}`},o.mark?i("img",{src:o.mark,alt:"",width:20,height:20}):null,o.name))):null,i("div",{class:"ready-grid"},Ur(e,n,t),Fr(e,t))].filter(o=>o!==null)}function Hr(e,n){let t=e.prChecks;if(!t.status)return null;let r=t.status.exists,s=`git add ${t.status.path} && git commit -m "Check pull requests with VibeRaven"`,a=null;if(t.open){let c=t.written?[i("h3",{},"Workflow added"),i("p",{},"Commit and push it. From the next pull request on, VibeRaven comments with what the change added and what it fixed."),i("pre",{class:"pr-command",tabindex:0},s),t.status.onGithub?null:i("p",{class:"pr-muted"},"This repository has no GitHub remote yet. The check runs once it is on GitHub."),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-copy",class:"btn sm primary",on:{click:()=>void n.copyPrCommit()}},"Copy command"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Done"))]:r?[i("h3",{},"Pull request checks are set up"),i("p",{},`The workflow is in ${t.status.path}. Once it is pushed, each pull request gets one comment with what it added and fixed.`),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Close"))]:[i("h3",{},"Check every pull request"),i("p",{},"VibeRaven adds one file to this repo, ",i("code",{},t.status.path),". Each pull request then gets one comment: what the change added and what it fixed."),i("ul",{class:"pr-points"},i("li",{},"Runs in your own GitHub Actions: private repos work and the code is never uploaded."),i("li",{},"Advice by default. It only blocks a merge if you turn that on.")),t.error?i("p",{class:"pr-error",role:"alert"},t.error):null,i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm primary",disabled:t.busy,on:{click:()=>void n.addPrChecks()}},t.busy?"Adding\u2026":"Add the workflow"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Not now"))];a=i("div",{id:"pr-checks-card",class:"pr-card",role:"dialog","aria-labelledby":"pr-checks-button"},...c)}return i("div",{class:"pr-checks"},i("button",{id:"pr-checks-button",class:`pr-checks-button${r?" is-on":""}`,"aria-expanded":String(t.open),"aria-controls":"pr-checks-card",on:{click:()=>n.togglePrChecks()}},we(P.pr),r?"Pull request checks added":"Check every pull request"),a)}function Br(){let e=t=>t.currentTarget.closest(".canvas"),n=(t,r,s,a="")=>i("button",{class:`canvas-tool${a}`,title:t,"aria-label":t,html:r,on:{click:c=>{let o=e(c);o&&s(o)}}});return i("div",{class:"canvas-tools",dataset:{sig:"tools"}},n("Zoom in",P.zoomIn,t=>Ge(t,1.15)),n("Zoom out",P.zoomOut,t=>Ge(t,1/1.15)),n("Reset layout",P.reset,t=>Bt(t)," is-reset"))}var bt=null;function $n(e,n){let t=R(e),r=e.flow.step,s=bt!==null&&bt!==r;bt=r;let a=r==="app"?Nr(e,t):r==="work"?bn(e,n):r==="findings"?Er(e,t,n):r==="fix"?Or(e,t,n):r==="recheck"?Rr(e,t,n):zr(e,t,n),c=r!=="app",o=r==="work"?cn(e,n):null;return i("main",{class:`stage${c?" has-panel":""}${o?" is-work":""}`,dataset:{slot:"stage",step:r}},e.scan?.state==="error"?i("p",{class:"stage-alert",role:"alert"},e.scan.error??"The first check did not finish."):null,o?i("div",{class:"canvas is-scene",dataset:{slot:"canvas-scene"}},o,dn(e,n)):i("div",{class:"canvas",dataset:{slot:"canvas"}},Tr(e,t,n),Br(),Hr(e,n),mn(e,n,Dr(e,t))),i("div",{class:`stage-body step-${r}${c?" panel":""}${s?" arrive":""}`,dataset:{slot:`body-${r}`}},c?i("button",{class:"panel-close","aria-label":"Close panel",title:"Close",on:{click:()=>r==="work"?n.closeWork():n.goToStep("app")},html:'<svg width="14" height="14" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>'}):null,...a))}function In(e){return R(e)}function Tn(e,n){let t=Array.from(e.children);n.forEach((r,s)=>{let a=t[s];if(!a){e.appendChild(r);return}let c=r.dataset?.sig;if(c&&a.dataset?.sig===c&&a.tagName===r.tagName)return;let o=r.dataset?.slot;if(o&&a.dataset?.slot===o&&a.tagName===r.tagName){for(let d of Array.from(a.attributes))r.hasAttribute(d.name)||a.removeAttribute(d.name);for(let d of Array.from(r.attributes))a.getAttribute(d.name)!==d.value&&a.setAttribute(d.name,d.value);Tn(a,Array.from(r.children));return}e.replaceChild(r,a)});for(let r of Array.from(e.children).slice(n.length))r.remove()}var kt=new WeakMap;function Yr(e){for(let n of Array.from(e.querySelectorAll(".canvas")))Yt(n,tt);for(let n of Array.from(e.querySelectorAll('.board[data-lines="1"]'))){if(kt.has(n)){requestAnimationFrame(()=>tt(n));continue}let t=()=>tt(n);if(requestAnimationFrame(t),typeof ResizeObserver<"u"){let r=new ResizeObserver(t);r.observe(n),kt.set(n,r)}else kt.set(n,{disconnect(){}})}}function Nn(e,n,t){let r=n.get(),s=e.contains(document.activeElement)?document.activeElement:null,a=s?.id,c=s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement?[s.selectionStart,s.selectionEnd]:null,o=In(r);if(Tn(e,[Ln(r,t),xn(r,o,t),$n(r,t),...r.agentOpen?[i("div",{class:"sheet-veil",on:{click:()=>t.toggleAgent()}}),Vr(r,n,t)]:[],...r.drawer?[i("div",{class:"drawer-veil",on:{click:()=>t.toggleDrawer(null)}}),qr(r,n,t)]:[],...$t(r,t),...vn(r,t),es(r)]),Yr(e),a&&document.activeElement?.id!==a){let d=document.getElementById(a);d?.focus({preventScroll:!0}),c&&(d instanceof HTMLTextAreaElement||d instanceof HTMLInputElement)&&d.setSelectionRange(...c)}}function Gr(e,n,t){let r=be(e.project,e.catalog,e.verified),s=r.filter(o=>o.step!=="absent"),a=r.filter(o=>o.step==="absent"),c=e.setup.running||e.busy.chat||e.busy.scan;return i("div",{},e.setup.open?Nt(e,n,t):null,i("section",{class:"block","aria-label":"In your app"},i("div",{class:"block-head"},i("h4",{},"In your app"),i("button",{id:"connect-my-app",class:"btn sm",disabled:c,on:{click:()=>t.openStackSetup()}},"Set up with your agent")),s.length?i("div",{class:"rail-grid"},...s.map(o=>Wr(o,e,t))):i("p",{class:"drawer-empty"},"No services found in this code yet.")),a.length?i("section",{class:"block","aria-label":"Available services"},i("div",{class:"block-head"},i("h4",{},"Available"),i("span",{class:"block-meta"},"Your accounts, your choice of providers")),i("div",{class:"rail-grid"},...a.map(o=>i("article",{class:"slab available"},i("div",{class:"face"},i("div",{class:"face-logo"},i("img",{src:He(o),alt:"",loading:"lazy"})),i("h3",{class:"face-name"},o.name),i("div",{class:"face-area"},o.area)),i("div",{class:"slab-act"},i("button",{class:"btn library-add",disabled:c,"aria-label":`Add ${o.name} to setup`,on:{click:()=>{t.openStackSetup(),n.get().setup.selected.includes(o.id)||t.toggleSetupProvider(o.id),document.getElementById("stack-setup-heading")?.focus()}}},"+ Add to setup")))))):null)}function Qr(e){return e.step==="ready"?{text:`Agent reported checks passed ${e.verified?F(e.verified.at):""}.`,tone:"g"}:e.step==="verified"?{text:e.verified?.ok?`Agent check ${e.verified?F(e.verified.at):""}.`:"Agent check found issues.",tone:e.verified?.ok?"g":"a"}:e.step==="mcp"?{text:"Agent integration configured. Live check needed.",tone:"a"}:e.step==="in_repo"?{text:e.hasRecipe?"Found in your code. Not connected.":"Found in your code.",tone:"a"}:{text:"Not in this app.",tone:""}}function Wr(e,n,t){let r=n.busy.tile===e.id,s=r||n.setup.running||n.busy.chat,a=Qr(e),c=e.step==="ready"?i("span",{class:"tag acid"},"Agent checked"):e.step==="verified"?i("span",{class:"tag"},e.verified?.ok?"Checked":"Issues"):e.step==="mcp"?i("span",{class:"tag"},"Configured"):i("span",{class:"tag"},"In code"),o=e.step==="in_repo"&&e.hasRecipe?i("button",{class:"btn primary",disabled:s,on:{click:()=>t.connect(e)}},r?i("span",{class:"spin"}):null,r?"Configuring\u2026":"Configure agent"):e.step==="in_repo"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},"Check with agent"):e.step==="mcp"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check live"):i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check again"),d=Xr(e.logoUrl)??"#9a9a9a";return i("article",{class:`slab${e.step==="ready"?" ready":""}${r?" scanning":""}`,dataset:{provider:e.id},style:{"--brand":d}},i("div",{class:"face"},i("div",{class:"face-top"},c),i("div",{class:"face-logo"},i("img",{src:e.logoUrl,alt:"",loading:"lazy"})),i("div",{class:"face-name"},e.name),i("div",{class:"face-area"},e.area)),i("div",{class:`slab-status ${a.tone}`},i("i",{class:a.tone}),i("span",{class:"txt"},a.text),e.fixes>0?i("button",{class:"fixlink",on:{click:()=>t.focusBlockers(e.id)}},`${e.fixes} to fix`):null),i("div",{class:"slab-act"},o))}var T={close:'<svg width="12" height="12" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>',reload:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',send:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg>',stop:'<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><rect x="2" y="2" width="10" height="10" rx="2" fill="currentColor"/></svg>',spark:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',plug:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',diff:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',terminal:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 4.5 6 8l-3.5 3.5M8 12h5.5"/></svg>',download:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2.5v8M4.5 7 8 10.5 11.5 7M3 13.5h10"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',tag:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M2 2.5h5.5l6.5 6.5-5 5-6.5-6.5z"/><circle cx="5" cy="5.5" r="1" fill="currentColor"/></svg>',book:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5h7.5a2 2 0 0 1 2 2v9H5a2 2 0 0 1-2-2z"/><path d="M3 11.5a2 2 0 0 1 2-2h7.5"/></svg>'};function Q(e){return i("span",{class:"ico",html:e})}function Ue(e){return B[e]??B.claude}function nt(e){return e.replace(/ CLI$/,"").replace("Claude Code","Claude")}function Dn(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??e.cliId}function Vr(e,n,t){let r=e.agents.find(g=>g.id===e.cliId),s=e.probes[e.cliId],a=s?.ready===!0,c=e.busy.probe===e.cliId,o=e.setup.running||e.busy.chat,d=r?.modelOptions??(r?.models??[]).map(g=>({id:g,label:g})),p=nt(Dn(e)),l=[[T.spark,"What does this app need next?"],[T.plug,"Check my service connections"],[T.diff,"Explain what changed since the last release"]],u=i("div",{class:"thread"},e.messages.length?e.messages.map(g=>Zr(g,e,t)):i("div",{class:"chat-welcome"},i("span",{class:"chat-welcome-mark"},i("img",{src:Ue(e.cliId),alt:"",width:28,height:28})),i("h3",{},"What should we work on?"),i("p",{},`${p} works in this project on your computer.`),i("div",{class:"chat-suggest"},...l.map(([g,w])=>i("button",{class:"chat-suggestion",disabled:!a||o,on:{click:()=>t.send(w)}},Q(g),i("span",{},w))))),e.busy.chat?i("div",{class:"working"},i("span",{class:"chat-typing","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{dataset:{working:"1"}},`${p} is working\u2026`),i("button",{class:"btn sm stop",on:{click:()=>t.stop()}},i("i",{class:"sq"}),"Stop")):null,e.busy.chat?i("div",{class:"slow-run hint",hidden:!e.workingSince||Date.now()-e.workingSince<6e4,dataset:{slowRun:"1"}},i("p",{},"Taking longer than usual. A sign-in prompt may be waiting in your agent."),i("button",{class:"btn sm",on:{click:()=>t.toggleDrawer("terminal")}},"Open agents")):null);(e.messages.length||e.busy.chat)&&queueMicrotask(()=>{u.scrollTop=u.scrollHeight});let h=e.contextProviderId?be(e.project,e.catalog,e.verified).find(g=>g.id===e.contextProviderId):null,f=i("textarea",{id:"agent-composer",placeholder:a?`Ask ${p} about this app, or say what to change\u2026`:`Connect ${p} to start chatting.`,rows:2,value:e.draft,disabled:o,on:{input:g=>{n.get().draft=g.target.value},keydown:g=>{let w=g;w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),t.send(w.target.value))}}});return i("aside",{id:"agent-panel",class:"side chat","aria-label":"Coding agent"},i("header",{class:"chat-head"},i("div",{class:"chat-agents",role:"radiogroup","aria-label":"Coding agent"},...e.agents.map(g=>{let w=e.probes[g.id],v=g.id===e.cliId,L=w?.ready?"ok":g.installed?"wait":"off";return i("button",{role:"radio","aria-checked":String(v),class:`chat-agent${v?" on":""}`,disabled:o,title:g.installed?w?.ready?"Connected":"Installed, not tested yet":"Not installed",on:{click:()=>t.selectCli(g.id)}},i("img",{src:Ue(g.id),alt:"",width:16,height:16}),nt(g.label),i("i",{class:`chat-dot is-${L}`,"aria-hidden":"true"}))})),i("button",{class:"chat-close","aria-label":"Close chat",title:"Close",on:{click:()=>t.toggleAgent()},html:T.close})),i("div",{class:"chat-meta"},i("span",{class:`chat-status${a?" is-ok":""}`,role:"status"},c?i("span",{class:"spin"}):i("i",{"aria-hidden":"true"}),c?"Checking\u2026":a?"Connected":r&&!r.installed?"Not installed":"Not connected"),d.length?i("label",{class:"chat-model",title:"Model"},i("span",{class:"chat-model-label"},"Model"),i("select",{id:"agent-model",disabled:o,on:{change:g=>n.set({modelId:g.target.value})}},i("option",{value:"",selected:!e.modelId},"Default"),e.modelId&&!d.some(g=>g.id===e.modelId)?i("option",{value:e.modelId,selected:!0},e.modelId):null,...d.map(g=>i("option",{value:g.id,selected:g.id===e.modelId},g.label)))):null,i("button",{id:"agent-test-connection",class:"chat-icon",title:a?"Test the connection again":"Test the connection","aria-label":a?"Test again":"Test connection",disabled:c||o,on:{click:()=>t.testConnection(e.cliId)},html:T.reload})),u,s&&!s.ready?i("div",{class:"chat-connect"},i("p",{},s.message),i("div",{class:"chat-connect-row"},i("button",{class:"btn sm primary",disabled:c,on:{click:()=>t.testConnection(e.cliId)}},Q(T.reload),"Test again"),i("button",{class:"btn sm ghost",on:{click:()=>t.toggleDrawer("terminal")}},Q(T.terminal),"Set up"))):null,i("div",{class:"composer"},h?i("span",{class:"chip"},h.logoUrl?i("img",{src:h.logoUrl,alt:""}):null,h.name,i("button",{title:"Remove context","aria-label":"Remove context",on:{click:()=>n.set({contextProviderId:null})},html:T.close})):null,f,i("div",{class:"row"},i("label",{class:"chat-access",title:"What the agent may do"},i("select",{id:"agent-access","aria-label":"Agent access",disabled:o,on:{change:g=>t.setAccessMode(g.target.value)}},...["ask","approve","full"].map(g=>i("option",{value:g,selected:g===e.accessMode},g==="ask"?"Ask \xB7 plan only":g==="approve"?"Edit files":"Full access")))),e.busy.chat?i("button",{class:"btn send stop",title:"Stop","aria-label":"Stop",on:{click:()=>t.stop()},html:T.stop}):i("button",{class:"btn send",title:"Send","aria-label":"Send",disabled:!a||e.setup.running,on:{click:()=>t.send(f.value)},html:T.send}))))}function En(e,n,t=Date.now()){for(let c of Array.from(e.querySelectorAll(".work-elapsed[data-since]"))){let o=Date.parse(c.dataset.since??"");Number.isFinite(o)&&(c.textContent=`${Math.max(0,Math.floor((t-o)/1e3))}s`)}if(!n)return;let r=Math.max(0,Math.floor((t-n)/1e3)),s=e.querySelector("[data-working]");s&&(s.textContent=`${s.textContent?.split(" \xB7")[0]??"Working\u2026"} \xB7 ${r}s`);let a=e.querySelector("[data-slow-run]");a&&(a.hidden=r<60)}function Zr(e,n,t){if(e.role==="me")return i("div",{class:"msg me"},i("div",{class:"body",html:`<p>${ye(e.text)}</p>`}));if(e.role==="system")return i("div",{class:"msg sys"},i("div",{class:"body",html:X(e.text)}),e.card?jn(e,n,t):null);let r=n.agents.find(a=>a.id===e.cliId),s=e.role==="error"?"Something went wrong":r?nt(r.label):"Agent";return i("div",{class:`msg ${e.role==="error"?"err":"agent"}`},i("div",{class:"who"},e.role==="error"?i("span",{class:"msg-avatar is-err"},"!"):i("span",{class:"msg-avatar"},i("img",{src:Ue(e.cliId??n.cliId),alt:"",width:14,height:14})),s,i("span",{class:"t"},F(e.at))),i("div",{class:"body",html:X(e.text)}),e.card?jn(e,n,t):null)}function jn(e,n,t){return i("div",{class:"card"},i("span",{},e.card.providerId?i("img",{src:be(n.project,n.catalog,n.verified).find(r=>r.id===e.card?.providerId)?.logoUrl??"",alt:""}):null,e.card.label),e.card.action==="verify"&&e.card.providerId?i("button",{class:"btn sm primary",disabled:n.busy.chat||n.setup.running,on:{click:()=>t.verifyById(e.card.providerId)}},"Verify live"):e.card.action==="recheck"?i("button",{class:"btn sm",disabled:n.busy.scan,on:{click:()=>t.recheck()}},"Re-check"):null)}function qr(e,n,t){let r=e.drawer==="terminal"?Kr(e,t):e.drawer==="services"?Gr(e,n,t):e.drawer==="actions"?kn(e,t):_r(e,n,t),s=e.drawer==="terminal"?"Coding agents":e.drawer==="services"?"Services":e.drawer==="actions"?"Actions":"Releases",a=e.drawer==="terminal"?"Connect one, then it can work on your app. Installed is not the same as connected.":e.drawer==="services"?"What your app runs on, and what you could add. Check a service live through your agent.":e.drawer==="actions"?"What VibeRaven can do in this project. An action only starts when it has a real way to run here.":"Every tagged point, and what changed between any two.";return i("div",{class:"drawer",dataset:{drawer:e.drawer??""},role:"dialog","aria-modal":"true","aria-labelledby":"drawer-heading",on:{keydown:c=>{let o=c;if(o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t.toggleDrawer(null)),o.key!=="Tab")return;let d=Array.from(c.currentTarget.querySelectorAll("*")).filter(u=>u.matches('button:not(:disabled), input:not(:disabled), a[href], select:not(:disabled), [tabindex="0"]')),p=d[0],l=d[d.length-1];o.shiftKey&&document.activeElement===p&&(o.preventDefault(),l?.focus()),!o.shiftKey&&document.activeElement===l&&(o.preventDefault(),p?.focus())}}},i("div",{class:"drawer-head"},i("div",{class:"drawer-title"},i("h3",{id:"drawer-heading"},s),i("p",{},a)),i("button",{id:"drawer-close",class:"drawer-x","aria-label":"Close",title:"Close",on:{click:()=>t.toggleDrawer(null)},html:T.close})),i("div",{class:"drawer-body"},r))}function Mt(e,n,t,r,...s){return i("li",{class:`step${t?" done":""}`},i("span",{class:"step-n","aria-hidden":"true"},t?"\u2713":String(e)),i("div",{class:"step-body"},i("div",{class:"step-title"},n,i("span",{class:`step-state${t?" ok":""}`},t?"Done":"Not confirmed")),i("p",{},r),s.some(Boolean)?i("div",{class:"row step-row"},...s):null))}function Kr(e,n){return i("div",{},i("div",{class:"agent-cards"},...e.agents.map(t=>{let r=e.probes[t.id],s=r?.ready===!0,a=e.busy.probe===t.id,c=e.cliId===t.id,o=s?"Connected":t.installed?"Installed \xB7 not tested":"Not installed",d=s?"green":t.installed?"amber":"gray",p=s?c?i("button",{class:"agent-cta is-on",disabled:!0},Q(T.spark),"In use"):i("button",{class:"agent-cta",on:{click:()=>n.selectCli(t.id)}},Q(T.arrow),"Use this agent"):t.installed?i("button",{class:"agent-cta is-primary",disabled:a,on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):Q(T.plug),a?"Testing\u2026":"Connect"):i("button",{class:"agent-cta is-primary",on:{click:()=>n.runSetup(t.id,"install")}},Q(T.download),"Install");return i("section",{class:`block agent-block agent-card${s?" is-connected":""}${c?" is-selected":""}`,"aria-label":t.label},i("div",{class:"agent-card-head"},i("span",{class:"agent-card-mark"},i("img",{src:Ue(t.id),alt:"",width:26,height:26})),i("div",{class:"agent-card-name"},i("h4",{},nt(t.label)),i("span",{class:`pill ${d}`},i("i"),o)),i("a",{class:"agent-card-docs",href:t.setup.docsUrl,target:"_blank",rel:"noreferrer",title:"Docs","aria-label":`${t.label} docs`,html:T.book})),s?i("p",{class:"agent-card-note"},r?.message??"Signed in and answering."):null,i("div",{class:"agent-card-actions"},p,s?i("button",{class:"agent-cta is-quiet",disabled:a,title:"Test again",on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):Q(T.reload),"Test"):null,!s&&t.installed?i("button",{class:"agent-cta is-quiet",on:{click:()=>n.openTerminal(t.id,"sign-in")}},Q(T.terminal),"Sign in"):null),s?null:i("details",{class:"agent-how"},i("summary",{},"How to connect"),i("ol",{class:"steps"},Mt(1,"Install the CLI",t.installed,t.installed?`Found on this computer as ${t.command}.`:`Install command: ${t.setup.installCommand}`),Mt(2,"Sign in to your account",s,`Sign in with ${t.setup.signInCommand}. VibeRaven cannot read your CLI session.`),Mt(3,"Test the connection",s,r?.message??`VibeRaven runs ${t.setup.verifyCommand} and reads the result.`))))})),i("details",{class:"agent-output"},i("summary",{},Q(T.terminal),"Output from the last step"),i("pre",{class:"out",dataset:{terminalOut:"1"}},e.terminalOutput||"Nothing yet. Install, sign in or test an agent and its output appears here.")))}function _r(e,n,t){let r=e.project.releases??[],s=i("input",{id:"release-from",class:"sel","aria-label":"From revision",placeholder:"Tag, commit or branch",value:e.compare.from,on:{input:d=>{n.get().compare.from=d.target.value}}}),a=i("input",{id:"release-to",class:"sel","aria-label":"To revision",placeholder:"HEAD",value:e.compare.to,on:{input:d=>{n.get().compare.to=d.target.value}}}),c=e.compare.result,o=c?.stats;return i("div",{class:"releases"},i("section",{class:"rel-section","aria-label":"Release history"},i("h4",{class:"rel-title"},Q(T.tag),"Release points",i("span",{class:"rel-count"},String(r.length))),r.length?i("ul",{class:"rel-cards"},...r.map(d=>i("li",{class:`rel-card${d.tone==="current"?" is-current":""}`},i("div",{class:"rel-card-top"},i("span",{class:"rel-tag"},d.label),i("span",{class:`rel-badge is-${d.tone}`},d.tone==="current"?"Current":d.tone==="prod"?"Released":"Planned")),i("p",{class:"rel-sum"},d.summary),i("p",{class:"rel-meta"},`${d.meta} \xB7 ${d.branch}`),i("button",{class:"rel-compare",on:{click:()=>{n.set({compare:{...n.get().compare,from:d.id}}),document.getElementById("release-from")?.focus()}}},Q(T.diff),"Compare from here")))):i("div",{class:"rel-empty"},i("p",{},"No tags yet."),i("code",{},"git tag v1.0.0"),i("p",{},"You can still compare any branch or commit below."))),i("section",{class:"rel-section","aria-label":"Compare"},i("h4",{class:"rel-title"},Q(T.diff),"Compare two points"),i("div",{class:"rel-compare-row"},i("label",{class:"rel-field"},i("span",{},"From"),s),i("span",{class:"rel-arrow",html:T.arrow}),i("label",{class:"rel-field"},i("span",{},"To"),a)),e.compare.error?i("p",{class:"compare-error",role:"alert"},e.compare.error):null,c?i("div",{class:"diff-result"},i("div",{class:"diff-stats"},i("span",{class:"diff-range"},`${c.fromLabel} \u2192 ${c.toLabel}`),o?i("span",{},`${o.files??0} file${o.files===1?"":"s"}`):null,o?i("span",{class:"add"},`+${o.insertions??0}`):null,o?i("span",{class:"del"},`\u2212${o.deletions??0}`):null),i("pre",{class:"out diff",tabindex:0,role:"region","aria-label":"Diff output",html:Jr(c.diff)})):null,i("div",{class:"rel-actions"},i("button",{class:"wtile",disabled:e.busy.compare,on:{click:()=>t.compare(s.value,a.value)}},i("span",{class:"wtile-ico",html:T.diff}),i("span",{class:"wtile-label"},e.busy.compare?"Reading\u2026":"Show the diff"),i("span",{class:"wtile-note"},"Straight from git, nothing sent")),i("button",{class:"wtile",disabled:e.busy.chat||e.setup.running,on:{click:()=>t.explainDiff(s.value,a.value)}},i("span",{class:"wtile-ico"},i("img",{src:Ue(e.cliId),alt:"",width:16,height:16})),i("span",{class:"wtile-label"},`Explain with ${Dn(e)}`),i("span",{class:"wtile-note"},"Plain words, risks first")))))}function Xr(e){let n=/cdn\.simpleicons\.org\/[a-z0-9.-]+\/([0-9a-f]{6})/i.exec(e);if(!n)return null;let t=n[1].toLowerCase();return t==="ffffff"?"#c8c8c8":`#${t}`}function Jr(e){return e.split(`
11
+ `)}function kr(e,n){let t=e.work.run,r=!te(t.state),s=t.state==="waiting_for_user"&&t.waiting?t.waiting:null,a=s?"wait":r?"work":t.state==="succeeded"?"pass":t.state==="failed"||t.state==="interrupted"?"fail":t.state==="cancelled"?"stop":"warn",c=t.steps.find(w=>w.state==="active"),o=t.actionId==="app.change",d=e.work.preview,p=d?.state==="ready"&&!!d.url,l=t.result,u=e.work.diff?.runId===t.id;if(s)return[Je("Waiting for you","wait"),i("div",{class:"whead"},gn("wait"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},s.title)),i("p",{class:"wline"},s.missing?.length?`Add ${s.missing.length===1?"this":"these"} to .env.local, save, then check again. Test values are fine here.`:s.detail),s.missing?.length?i("div",{class:"wchips"},...s.missing.map(w=>re(M.key,w,w,"wait"))):null,i("div",{class:"wtiles is-one",dataset:{sig:JSON.stringify(["resume",t.id,s.action,e.work.busy])}},K(M.reload,s.action,()=>void n.resumeRun(),{id:"work-resume",primary:!0,disabled:e.work.busy})),i("button",{class:"wlink is-danger",on:{click:()=>void n.cancelRun()}},"Stop")].filter(w=>w!==null);if(r)return[Je(`${De[t.state]}`,"work"),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},o?Oe(t.inputs.request??"",80):"Starting your app"),i("p",{class:"work-live",role:"status","aria-live":"polite"},i("span",{class:"work-pulse","aria-hidden":"true"}),c?.label??De[t.state],i("span",{class:"work-elapsed",dataset:{since:t.createdAt}})),hn(t,!0),i("div",{class:"wtiles is-one",dataset:{sig:`stop|${t.id}`}},K(M.bigStop,"Stop",()=>void n.cancelRun(),{danger:!0,note:o?"Keeps what already changed":void 0}))];let h=[];p&&h.push(K(M.play,"Try it",()=>n.togglePreviewExpanded(!0),{id:"work-try",primary:!0})),!o&&(t.state==="failed"||t.state==="cancelled")?h.push(K(M.reload,"Try again",()=>void n.planAction("preview.start"),{id:"work-retry",primary:!0})):o&&!p&&e.work.offers.find(w=>w.id==="preview.start")?.availability==="ready"&&h.push(K(M.play,"Show my app",()=>void n.planAction("preview.start"),{id:"work-try",primary:!0})),o&&t.changes.length&&h.push(K(M.diff,u?"Hide change":"Review",()=>void n.showDiff(),{pressed:u}));let f=t.changes.filter(w=>w.owner==="agent");o&&f.length&&!t.reverted&&h.push(Mr(t,f.length,n)),o&&h.push(K(M.plus,"New",()=>n.newChange()));let g=[hn(t,!1),l?.unknowns?.length?i("section",{class:"work-unknowns","aria-label":"Not checked"},i("h2",{},"Not checked"),i("ul",{},...l.unknowns.map(w=>i("li",{},w)))):null,...t.checks.filter(w=>w.status==="failed"&&w.detail).map(w=>i("pre",{class:"work-detail"},w.detail)),l?.agentAnswer?i("div",{class:"agent-reply-body",html:X(l.agentAnswer)}):null].filter(w=>w!==null);return[Je(`${De[t.state]} \xB7 ${F(t.updatedAt)}`,a==="stop"?"plan":a),i("div",{class:"whead"},gn(a),i("h1",{id:"stage-heading",tabindex:-1,class:"wtitle"},l?.title??De[t.state])),l?.summary?i("p",{class:"wline"},Oe(l.summary,140)):null,br(t),t.reverted?i("p",{class:"work-hint"},`Undone: ${t.reverted.restored.length} file${t.reverted.restored.length===1?"":"s"} put back${t.reverted.skipped.length?`, ${t.reverted.skipped.length} left as they were`:""}.`):null,h.length?i("div",{class:`wtiles${h.length===1?" is-one":""}`,dataset:{sig:JSON.stringify(["done",t.id,t.state,p,u,f.length,!!t.reverted,h.length])}},...h):null,u?i("section",{class:"work-diff","aria-label":"The change"},...e.work.diff.files.length?e.work.diff.files.map(w=>Lr(t,w,n)):[i("p",{class:"work-hint"},"Nothing left to show: the files match where the run started.")]):null,i("details",{class:"wdetails"},i("summary",{},"Details"),...g)].filter(w=>w!==null)}var Se=null;function Mr(e,n,t){let r=Se===e.id,s=`the ${n} file${n===1?"":"s"} proven to be the agent\u2019s own edit${n===1?"":"s"}`,a=K(M.undo,r?"Sure?":"Undo",()=>{if(Se!==e.id){Se=e.id,a.querySelector(".wtile-label").textContent="Sure?",a.classList.add("is-danger"),a.title=`Put back ${s}. Click again.`,window.setTimeout(()=>{Se===e.id&&(Se=null,a.querySelector(".wtile-label").textContent="Undo",a.classList.remove("is-danger"))},6e3);return}Se=null,t.undoRun()},{danger:r,note:n<e.changes.length?`${n} of ${e.changes.length} files`:void 0});return a.title=`Put back ${s}. Anything else that changed is left alone.`,a}var Ae=null;function Lr(e,n,t){let r=e.changes.find(p=>p.path===n.path),s=e.restoredFiles?.includes(n.path),a=!!(r&&r.owner!=="agent"&&!s&&!e.reverted?.restored.includes(n.path)),c=`${e.id}:${n.path}`,o=a?i("button",{type:"button",class:`wlink diff-restore${Ae===c?" is-danger":""}`,title:"Put this file back to how it was when the run started. Any edits in it, yours included, go too; VibeRaven keeps a copy of it as it is now.",on:{click:p=>{if(Ae!==c){Ae=c,p.currentTarget.textContent="Sure? Put it back",p.currentTarget.classList.add("is-danger"),window.setTimeout(()=>{Ae===c&&(Ae=null)},6e3);return}Ae=null,t.restoreFile(n.path)}}},"Put back"):null,d=s?"Put back by you":a?"Not undone automatically":null;return i("div",{class:"work-diff-file"},i("h3",{},n.path,d?i("span",{class:`diff-note${a?" is-warn":""}`,title:a?"It changed during the run, but VibeRaven cannot prove it was only the agent\u2019s edit, so Undo leaves it alone.":void 0},d):null,o),i("pre",{class:"out diff",tabindex:0,html:vr(n.diff)}))}function kn(e,n){return e.work.gallery?pn(e,n):e.work.plan?wr(e,n):e.work.run?kr(e,n):[i("h1",{id:"stage-heading",tabindex:-1},"Nothing running"),i("p",{class:"stage-sub"},"Describe a change in the box under your app, or pick an action."),xr(e)].filter(t=>t!==null)}function xr(e){return e.work.history.length?i("section",{class:"work-history","aria-label":"Earlier runs"},i("h2",{},"Earlier"),i("ul",{},...e.work.history.slice(0,6).map(n=>i("li",{class:`is-${n.state}`},i("strong",{},n.inputs?.request?Oe(n.inputs.request,70):n.actionId==="preview.start"?"Show my app":n.actionId),i("span",{},`${De[n.state]??n.state} \xB7 ${F(n.createdAt)}${n.changes?` \xB7 ${n.changes} file${n.changes===1?"":"s"}`:""}`))))):null}var Sr={ready:"Ready",needs_connection:"Needs a connection",needs_information:"Waiting",guided:"Guided",unsupported:"Not for this app",already_configured:"Done",planned:"Planned"},wt={db:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><ellipse cx="8" cy="3.8" rx="5" ry="1.9"/><path d="M3 3.8v8.4c0 1 2.2 1.9 5 1.9s5-.9 5-1.9V3.8M3 8c0 1 2.2 1.9 5 1.9s5-.9 5-1.9"/></svg>',lock:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.6"/><path d="M5.3 7V5a2.7 2.7 0 0 1 5.4 0v2"/></svg>',link:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M6.6 9.4l2.8-2.8M7 4.5l1-1a2.8 2.8 0 0 1 4 4l-1 1M9 11.5l-1 1a2.8 2.8 0 0 1-4-4l1-1"/></svg>',gear:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><circle cx="8" cy="8" r="2.2"/><path d="M8 1.8v1.8M8 12.4v1.8M1.8 8h1.8M12.4 8h1.8M3.6 3.6l1.3 1.3M11.1 11.1l1.3 1.3M12.4 3.6l-1.3 1.3M4.9 11.1l-1.3 1.3"/></svg>',route:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="3.5" cy="12.5" r="1.6"/><circle cx="12.5" cy="3.5" r="1.6"/><path d="M5 12.5h4.5a2.5 2.5 0 0 0 0-5h-3a2.5 2.5 0 0 1 0-5H11"/></svg>',tag:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 2.5h5.2l5.8 5.8-5.2 5.2-5.8-5.8z"/><circle cx="5.3" cy="5.3" r="1"/></svg>',gauge:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M2.5 11.5a5.5 5.5 0 1 1 11 0"/><path d="M8 11.5l2.6-3.4"/></svg>',search:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><circle cx="7" cy="7" r="4.2"/><path d="M10.2 10.2l3.3 3.3"/></svg>',upload:'<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 10.5V2.8M4.8 6 8 2.8 11.2 6M2.8 10.8v1.6c0 .7.6 1.3 1.3 1.3h7.8c.7 0 1.3-.6 1.3-1.3v-1.6"/></svg>',play:M.play.replace('width="13" height="13"',""),spark:M.spark.replace('width="16" height="16"',""),shield:M.shield.replace('width="13" height="13"',""),key:M.key.replace('width="15" height="15"',""),plug:M.plug.replace('width="13" height="13"',""),reload:M.reload.replace('width="13" height="13"',""),plus:M.plus.replace('width="14" height="14"',""),monitor:M.monitor.replace('width="13" height="13"',"")},Ar={"preview.start":{icon:"play"},"app.change":{icon:"spark"},"findings.fix":{icon:"shield"},"supabase.connect":{brand:"supabase"},"auth.google":{brand:"google"},"auth.github":{brand:"github"},"data.feature":{icon:"db"},"db.drift":{icon:"db"},"secret.exposed":{icon:"key"},"auth.callback":{icon:"link"},"config.fix":{icon:"gear"},"deploy.preview":{brand:"vercel"},"flow.verify":{icon:"route"},"auth.email":{brand:"resend"},"access.rule":{icon:"lock"},"storage.uploads":{icon:"upload"},"email.transactional":{brand:"resend"},"payments.add":{brand:"stripe"},"webhook.connect":{icon:"plug"},"release.prepare":{icon:"tag"},"config.env":{icon:"gear"},"monitoring.add":{brand:"sentry"},"improve.performance":{icon:"gauge"},"improve.seo":{icon:"search"},"task.custom":{icon:"spark"},"app.starter":{icon:"plus"},"integration.add":{icon:"plug"},"change.recheck":{icon:"reload"}};function fn(e,n){let t=Ar[n.id]??{icon:"spark"},r=n.id==="agent.connect"?i("img",{src:B[e.cliId]??B.claude,alt:""}):t.brand?i("img",{src:q(t.brand),alt:""}):i("span",{class:"act-ico",html:wt[t.icon??"spark"]??wt.spark});return i("span",{class:"act-art","aria-hidden":"true"},r)}var Pe="All",yt="";function mt(e){let n=yt.trim().toLowerCase();e.querySelectorAll("[data-act]").forEach(r=>{let s=Pe==="All"||r.dataset.family===Pe,a=!n||(r.dataset.search??"").includes(n);r.hidden=!(s&&a)}),e.querySelectorAll("[data-act-group]").forEach(r=>{let s=r.querySelectorAll("[data-act]:not([hidden])").length;r.hidden=!s;let a=r.querySelector(".act-count");a&&(a.textContent=String(s))});let t=e.querySelector(".act-empty");t&&(t.hidden=!!e.querySelector("[data-act]:not([hidden])")),e.querySelectorAll(".act-chip").forEach(r=>r.setAttribute("aria-pressed",String(r.dataset.family===Pe)))}function Mn(e,n){let t=["All","Build","Connect","Data","Security","Release","Business","Improve"],r=e.work.offers,s=r.filter(l=>l.executable),a=r.filter(l=>!l.executable),c=l=>`${l.name} ${l.outcome} ${l.family}`.toLowerCase(),o=l=>{let u=l.availability==="already_configured",h=l.availability==="needs_connection"?"Connect":l.id==="app.change"?"Describe it":l.id==="findings.fix"?"Open findings":l.id==="agent.connect"?"Agents":"Start",f=!u&&(l.availability==="ready"||l.availability==="needs_connection"||l.id==="app.change"||l.id==="findings.fix"),g=u?"Done":l.availability==="ready"?"Ready":l.availability==="needs_connection"?"Needs your agent":Sr[l.availability]??"Waiting";return i("li",{class:"act-row",dataset:{act:l.id,family:l.family,search:c(l)},title:l.reason},fn(e,l),i("div",{},i("h5",{},l.name),i("p",{},l.outcome)),i("div",{class:"act-side"},i("span",{class:`act-status is-${u?"done":l.availability}`},i("i",{"aria-hidden":"true"}),g),f?i("button",{type:"button",class:`act-go${l.availability==="ready"||l.id==="app.change"?" is-primary":""}`,on:{click:()=>{n.toggleCatalog(!1),n.runOffer(l)}}},h,se(M.arrow)):null))},d=l=>{let u=gr[l.id];return i("li",{class:"act-item",dataset:{act:l.id,family:l.family,search:c(l)},title:`${l.outcome} ${l.reason}`},fn(e,l),i("strong",{},l.name),u?i("button",{type:"button",class:"act-peek",title:"A simulated preview of how this action will look. It does not run.",on:{click:()=>n.showGallery(u.kind,"work",u.provider)}},"Preview",se(M.arrow)):i("span",{class:"act-soon"},l.availability==="unsupported"?"Not for this app":"Soon"))},p=i("div",{class:"act-catalog"},i("div",{class:"act-tools"},i("label",{class:"act-search"},i("span",{class:"act-search-ico",html:wt.search}),i("input",{type:"search",placeholder:"Find an action",value:yt,"aria-label":"Find an action",on:{input:l=>{yt=l.target.value,mt(p)}}})),i("div",{class:"act-chips",role:"group","aria-label":"Kind of action"},...t.map(l=>i("button",{type:"button",class:"act-chip",dataset:{family:l},"aria-pressed":String(l===Pe),on:{click:()=>{Pe=l,mt(p)}}},l)))),i("section",{class:"act-group",dataset:{actGroup:"ready"},"aria-label":"Ready now"},i("div",{class:"act-head"},i("h4",{},"Ready now"),i("span",{},i("b",{class:"act-count"},String(s.length))," work in this version")),i("ul",{class:"act-rows"},...s.map(o))),i("section",{class:"act-group",dataset:{actGroup:"coming"},"aria-label":"Coming next"},i("div",{class:"act-head"},i("h4",{},"Coming next"),i("span",{},i("b",{class:"act-count"},String(a.length))," planned. Preview shows how one will look; it does not run.")),i("ul",{class:"act-items"},...a.map(d))),i("p",{class:"act-empty",hidden:!0},"No action matches. Try another word, or describe the change in the box under your app."));return mt(p),p}var P={check:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',back:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 8H3M7 4L3 8l4 4"/></svg>',copy:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.6"/><path d="M10.5 5.5V3.6c0-.6-.5-1.1-1.1-1.1H3.6c-.6 0-1.1.5-1.1 1.1v5.8c0 .6.5 1.1 1.1 1.1h1.9"/></svg>',more:'<svg viewBox="0 0 16 16" width="14" height="14" fill="currentColor" aria-hidden="true"><circle cx="3" cy="8" r="1.4"/><circle cx="8" cy="8" r="1.4"/><circle cx="13" cy="8" r="1.4"/></svg>',out:'<svg viewBox="0 0 16 16" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 3H3v10h10v-3M9 3h4v4M13 3L7.5 8.5"/></svg>',scan:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 5V3.5C2 2.7 2.7 2 3.5 2H5M11 2h1.5c.8 0 1.5.7 1.5 1.5V5M14 11v1.5c0 .8-.7 1.5-1.5 1.5H11M5 14H3.5C2.7 14 2 13.3 2 12.5V11"/><circle cx="7.6" cy="7.6" r="2.4"/><path d="M9.4 9.4 11 11"/></svg>',fix:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.8 2.3a3.4 3.4 0 0 0-3.9 4.5L2.4 10.3a1.4 1.4 0 0 0 2 2l3.5-3.5a3.4 3.4 0 0 0 4.5-3.9l-2 2-1.8-.5-.5-1.8z"/></svg>',recheck:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 0 1-9.6 3.7M2.5 8a5.5 5.5 0 0 1 9.6-3.7"/><path d="M12.5 1.8v2.7H9.8M3.5 14.2v-2.7h2.7"/></svg>',launch:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5v11M3 3h8.5l-1.8 2.8L11.5 8.6H3"/></svg>',pr:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="4" cy="3.5" r="1.6"/><circle cx="4" cy="12.5" r="1.6"/><circle cx="12" cy="12.5" r="1.6"/><path d="M4 5.1v5.8M12 10.9V6.5a2 2 0 0 0-2-2H7.5M9 3 7.5 4.5 9 6"/></svg>',zoomIn:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9"/></svg>',zoomOut:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" aria-hidden="true"><path d="M3.5 8h9"/></svg>',reset:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 6V2.5H6M13.5 10v3.5H10M2.5 2.5l4 4M13.5 13.5l-4-4"/></svg>',app:'<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="1.8" y="2.5" width="12.4" height="11" rx="2"/><path d="M1.8 5.5h12.4M6 8.4 4.6 9.8 6 11.2M10 8.4l1.4 1.4-1.4 1.4"/></svg>'},Cr={critical:"Critical",warning:"Important",info:"Nice to have"};function we(e){return i("span",{class:"ico",html:e})}function Re(e){return(e||"Project").replace(/^@[^/]+\//,"").split(/[-_\s]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function pe(e){let n=e.project.project;return(n?.name&&n.name!=="Project"?n.name:(n?.path??"").split(/[\\/]/).filter(Boolean).pop())||"your-app"}function et(e,n=e.cliId){return e.agents.find(t=>t.id===n)?.label.replace(/ CLI$/,"")??(n==="claude"?"Claude Code":n==="gemini"?"Gemini":"Codex")}function xn(e,n){let t=e.project.project,r=e.project.releases?.[0],s=An(e,R(e));return i("header",{class:"top",dataset:{slot:"top"}},i("span",{class:"brand","aria-label":"VibeRaven"},i("span",{class:"brand-mark","aria-hidden":"true",html:Be}),i("span",{class:"brand-word","aria-hidden":"true"},"VibeRaven")),i("span",{class:"top-project"},i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("strong",{},Re(pe(e))),i("span",{class:"top-sep","aria-hidden":"true"},"/"),i("code",{},[r?.branch,t?.version?`v${t.version.replace(/^v/,"")}`:null].filter(Boolean).join(" \xB7 ")||"local")),i("span",{class:"spacer"}),$r(e,n),i("span",{class:`top-verdict is-${s.tone}`},i("i",{"aria-hidden":"true"}),s.text),i("div",{class:"more-wrap"},i("button",{id:"open-more",class:`quiet more-button${e.moreOpen?" on":""}`,"aria-haspopup":"menu","aria-expanded":String(e.moreOpen),"aria-controls":"more-menu",on:{click:()=>n.toggleMore()}},"More",we(P.more)),e.moreOpen?Ir(e,n):null))}function $r(e,n){let t=R(e),r=e.flow.step,s=(a,c,o,d,p={})=>i("button",{id:a,class:"top-tab","aria-current":o?"page":void 0,disabled:p.disabled,on:{click:d}},c,p.count?i("span",{class:"top-tab-count"},String(p.count)):null);return i("nav",{class:"top-tabs","aria-label":"Views"},s("tab-stack","Stack",r==="app"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("app")}),s("tab-findings","Findings",r==="findings"&&!e.drawer,()=>{e.drawer&&n.toggleDrawer(null),n.goToStep("findings")},{disabled:!t.available.findings,count:t.findings.length}),s("tab-terminal","Agents",e.drawer==="terminal",()=>n.openMore("terminal")),s("tab-releases","Releases",e.drawer==="releases",()=>n.openMore("releases")))}function Ir(e,n){let t=e.agents.filter(s=>e.probes[s.id]?.ready).length,r=[{id:"services",label:"Services",note:"Browse, add and check services live"},{id:"terminal",label:"Coding agents",note:t?`${t} connected`:"Install, sign in, test"},{id:"chat",label:"Agent chat",note:"Ask your agent anything about this app"},{id:"releases",label:"Releases",note:(e.project.releases??[]).length?"History and diffs":"Compare any two commits"}];return i("div",{id:"more-menu",class:"more-menu",role:"menu","aria-label":"More",on:{keydown:s=>{let a=s.key;if(a!=="ArrowDown"&&a!=="ArrowUp")return;s.preventDefault();let c=Array.from(s.currentTarget.querySelectorAll('[role="menuitem"]')),o=c.indexOf(document.activeElement);c[(o+(a==="ArrowDown"?1:-1)+c.length)%c.length]?.focus()}}},...r.map(s=>i("button",{role:"menuitem",class:"more-item",on:{click:()=>n.openMore(s.id)}},i("strong",{},s.label),i("span",{},s.note))))}function Sn(e,n,t){let r=Rt(n,e),s=e.flow.step,a=n.scanning||e.setup.running,c=()=>{s==="fix"&&n.current?t.checkAgain():n.available.recheck?t.goToStep("recheck"):t.checkMyApp()},o=[{key:"scan",id:"check-my-app",label:n.scanning?"Scanning":"Scan",svg:P.scan,meta:r.app,current:s==="app",disabled:a,passed:n.scanned,onClick:()=>void t.checkMyApp()},{key:"fix",label:"Fix",svg:P.fix,meta:r.fix,current:s==="fix",disabled:!n.available.fix||a,passed:!1,onClick:()=>t.goToStep("fix")},{key:"recheck",label:"Re-check",svg:P.recheck,meta:r.recheck,current:s==="recheck",disabled:!n.scanned||a,passed:e.flow.recheck?.status==="fixed",onClick:c},{key:"ready",label:"Launch",svg:P.launch,meta:r.ready,current:s==="ready",disabled:!n.available.ready,passed:!1,onClick:()=>t.goToStep("ready")}];return i("nav",{class:`rail${n.scanning?" is-scanning":""}`,"aria-label":"Launch path",dataset:{slot:"rail"}},i("ol",{},...o.map(d=>i("li",{class:`rail-step is-${d.current?"current":d.disabled?"locked":d.passed?"passed":"open"}`},i("button",{id:d.id,class:"rail-button",title:d.meta,"aria-current":d.current?"step":void 0,disabled:d.disabled,on:{click:d.onClick}},i("span",{class:"rail-mark","aria-hidden":"true",html:d.svg}),i("span",{class:"rail-copy"},i("span",{class:"rail-label"},d.label),i("span",{class:"rail-meta"},d.meta)),d.key==="scan"&&n.scanning?i("i",{class:"rail-time","aria-hidden":"true"}):null)))))}function An(e,n){if(n.scanning)return{text:"Checking your app",tone:"pending"};if(!n.scanned)return{text:"Not checked yet",tone:"pending"};if(n.counts.critical)return{text:`${n.counts.critical} blocker${n.counts.critical===1?"":"s"}`,tone:"fail"};if(n.findings.length)return{text:`${n.findings.length} to review`,tone:"warn"};let t=n.checklist.filter(s=>!s.done).length,r=t?` \xB7 ${t} unknown${t===1?"":"s"}`:"";return{text:n.gateClear?`No blockers in repo checks${r}`:"No blockers in repo checks",tone:"pass"}}var jr={pending:"Unknown",pass:"Repo checked",warn:"Review",fail:"Blockers"};function Tr(e){let n=e.stateText.replace(/^(Repo checks|Unknown)\s*·\s*/,"")||e.stateText;return n.charAt(0).toUpperCase()+n.slice(1)}function Ln(e,n=null){return i("li",{class:`node is-${e.tone}${e.id===n?" is-focus":""}`,dataset:{provider:e.id,card:e.id,sig:JSON.stringify([e.id,e.tone,e.stateText,e.mark,e.id===n])}},i("span",{class:"node-head"},e.mark?i("img",{src:e.mark,alt:"",width:18,height:18}):i("span",{class:"node-fallback"},e.name.slice(0,1)),i("span",{class:"node-name"},e.name)),e.area?i("code",{class:"node-detail"},e.area.toLowerCase()):null,i("span",{class:"node-state"},i("i",{"aria-hidden":"true"}),i("span",{class:"node-text"},Tr(e)),i("span",{class:"node-verdict"},jr[e.tone])))}function Nr(){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("class","board-lines"),e.setAttribute("aria-hidden","true"),e.setAttribute("data-sig","lines"),e}function Dr(e,n,t){let r=e.project.project,s=An(e,n),a=yn(e),c=!!(e.work.run&&!te(e.work.run.state)),o=n.services.length<=3,d=o?[]:n.services.filter((w,b)=>b%2===0),p=o?n.services:n.services.filter((w,b)=>b%2===1),l=n.scanned?[r?.archetype&&r.archetype!=="unknown"?r.archetype:null,r?.scannedAt?`Checked ${F(r.scannedAt)}`:null,typeof e.project.gate?.score=="number"?`Heuristic repo-check score ${e.project.gate.score} of 100`:null].filter(w=>!!w):[],u=e.flow.step==="app"?null:e.flow.step==="fix"?n.current?.service?.id??null:e.contextProviderId,h=n.services.length>0||!!a,f=[...a&&!o?[a]:[],...d.map(w=>Ln(w,u))],g=[...a&&o?[a]:[],...p.map(w=>Ln(w,u))];return i("figure",{class:`board has-screen${n.scanning?" is-scanning":""}${c?" is-working":""}${h?o?" is-side":"":" is-solo"}`,dataset:{slot:"board",lines:h?"1":"",layoutKey:e.project.project?.path||pe(e)},"aria-label":`${Re(pe(e))} and the services found in its code`},Nr(),i("ul",{class:"board-col left",hidden:!f.length,dataset:{slot:"left"}},...f),i("div",{class:`board-app is-${s.tone}${c?" is-working":""}`,dataset:{card:"app",slot:"app"}},i("span",{class:"node-head",dataset:{sig:`head|${pe(e)}`}},we(P.app),i("span",{class:"node-name"},Re(pe(e)))),i("code",{class:"board-app-name",dataset:{sig:`name|${pe(e)}|${e.project.releases?.[0]?.branch??""}`}},[pe(e),e.project.releases?.[0]?.branch].filter(Boolean).join(" \xB7 ")),Xe(e,t),i("p",{class:"board-status",dataset:{sig:`status|${s.text}`}},i("strong",{},s.text)),bn(e),i("ul",{class:"board-checks",hidden:!l.length,dataset:{sig:`checks|${l.join("|")}`}},...l.map(w=>i("li",{},i("i",{"aria-hidden":"true"}),w)))),i("ul",{class:"board-col right",hidden:!g.length,dataset:{slot:"right"}},...g))}function tt(e){let n=e.querySelector(".board-lines"),t=e.querySelector(".board-app");if(!n||!t)return;let r=e.getBoundingClientRect(),s=e.offsetWidth,a=e.offsetHeight;if(!r.width||!s)return;let c=r.width/s;if(n.setAttribute("viewBox",`0 0 ${Math.round(s)} ${Math.round(a)}`),n.setAttribute("width",String(Math.round(s))),n.setAttribute("height",String(Math.round(a))),getComputedStyle(n).display==="none"){n.innerHTML="";return}let o=t.getBoundingClientRect(),d=o.left+o.width/2,p=Array.from(e.querySelectorAll(".node")),l=f=>(f-r.left)/c,u=f=>(f-r.top)/c,h=p.map((f,g)=>{let w=f.getBoundingClientRect(),b=w.left+w.width/2<d,L=l(b?o.left:o.right),$=u(o.top+o.height/2)+(g%4-1.5)*Math.min(22,o.height/c/7),y=l(b?w.right:w.left),k=u(w.top+w.height/2),E=(L+y)/2,A=/is-(work|pass|warn|fail|pending)/.exec(f.className)?.[1]??"pending",I=`M ${L.toFixed(1)} ${$.toFixed(1)} C ${E.toFixed(1)} ${$.toFixed(1)} ${E.toFixed(1)} ${k.toFixed(1)} ${y.toFixed(1)} ${k.toFixed(1)}`;return`<path class="line is-${A}" d="${I}"/><path class="pulse is-${A}" pathLength="1" style="animation-delay:${(g*.6).toFixed(2)}s" d="${I}"/>`});n.innerHTML=h.join("")}function _(e,n){let t=[i("h1",{id:"stage-heading",tabindex:-1},e)];return n&&t.push(i("p",{class:"stage-sub"},n)),t}function z(e,n,t={}){return i("div",{class:"primary-row"},i("button",{id:t.id??"primary-action",class:"primary",disabled:t.disabled,on:{click:n}},t.busy?i("span",{class:"spin","aria-hidden":"true"}):null,e,t.busy?null:we(P.arrow)),t.note?i("span",{class:"primary-note"},t.note):null)}function bt(e,n,t={}){return i("button",{class:"quiet",disabled:t.disabled,on:{click:n}},t.icon?we(t.icon):null,e)}function Cn(e){return i("span",{class:`sev is-${e.severity}`},i("i",{"aria-hidden":"true"}),Cr[e.severity])}function $n(e,n=!1){if(!e.locations.length)return null;let[t,...r]=e.locations;return i("span",{class:"where"},i("code",{title:e.locations.join(`
12
+ `)},n?t:Ot(t)),r.length?i("span",{class:"where-more"},`+${r.length} more`):null)}function Er(e,n){let t=e.project.project,r=n.services.length,s=n.scanning?"Reading your code and the services it uses. Nothing leaves this computer.":r?`${r} service${r===1?"":"s"} found in this code.`:"No hosted services found in this code yet.",a=n.scanning?"Checking on this computer, offline.":n.scanned?`Last check ${F(t.scannedAt)} \xB7 runs on this computer, offline`:"Press Scan to check your app. It runs on this computer, offline.";return[i("h1",{id:"stage-heading",tabindex:-1,class:"sr-only"},Re(pe(e))),i("p",{class:"sr-only",role:"status"},`${s} ${a}`)]}function Pr(e,n){let t=e.project.project;return n.scanning?"Checking on this computer, offline.":n.scanned&&t?.scannedAt?`Last check ${F(t.scannedAt)} \xB7 everything runs on this computer`:"Everything runs on this computer."}function Or(e,n,t){let r=n.fixable[0],s=e.project.project?.scannedAt;if(!n.findings.length)return[..._("Nothing to fix",`The check ${s?F(s):""} found no blockers in this code.`),z("Go to the launch checklist",()=>t.goToStep("ready"))];let a=[n.counts.critical?`${n.counts.critical} critical`:null,n.counts.warning?`${n.counts.warning} important`:null,n.counts.info?`${n.counts.info} nice to have`:null].filter(Boolean).join(", "),c=(o,d,p)=>o?i("span",{class:`fchip is-${d}`},i("i",{"aria-hidden":"true"}),`${o} ${p}`):null;return[i("h1",{id:"stage-heading",tabindex:-1},`${n.findings.length} finding${n.findings.length===1?"":"s"}`),i("div",{class:"fchips"},c(n.counts.critical,"critical","critical"),c(n.counts.warning,"warning","important"),c(n.counts.info,"info","nice to have"),i("span",{class:"fchip is-time"},`Checked ${s?F(s):"just now"}`)),i("div",{class:"findings"},...n.groups.map(o=>i("section",{class:"group","aria-label":o.name},i("header",{class:"group-head"},o.mark?i("img",{src:o.mark,alt:"",width:22,height:22}):i("span",{class:"group-code","aria-hidden":"true"},"</>"),i("h2",{},o.name),i("span",{class:"group-count"},String(o.findings.length))),i("ul",{},...o.findings.map(d=>{let p=d.id===r?.id,l=[i("span",{class:"finding-main"},i("span",{class:"finding-title"},d.title),i("span",{class:"finding-meta"},Cn(d),d.dashboard?i("span",{class:"finding-tag"},"In your dashboard"):d.actionDestination==="manual-review"?i("span",{class:"finding-tag"},"Check by hand"):$n(d))),d.dashboard?null:i("span",{class:"finding-go"},p?"Fix first":"Fix")];return i("li",{},d.dashboard?i("div",{class:`finding is-${d.severity} is-static`,dataset:{provider:d.service?.id??""}},...l):i("button",{class:`finding is-${d.severity}${p?" is-first":""}`,dataset:{provider:d.service?.id??""},on:{click:()=>t.fixFinding(d.id)}},...l))}))))),r?i("div",{class:"wtiles is-one findings-go"},i("button",{id:"fix-first",type:"button",class:"wtile is-primary",title:r.title,on:{click:()=>t.fixFinding()}},i("span",{class:"wtile-ico",html:P.fix}),i("span",{class:"wtile-label"},r.severity==="critical"?"Fix the first blocker":"Fix the first finding"))):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Review the remaining provider and live-evidence steps."})]}function Rr(e,n,t){let r=e.agents.filter(s=>s.installed);return r.length?i("div",{class:"agent-choice",role:"radiogroup","aria-label":"Coding agent"},...r.map(s=>{let a=e.probes[s.id],c=s.id===e.cliId;return i("button",{role:"radio","aria-checked":String(c),class:`agent-option${c?" on":""}`,disabled:t,on:{click:()=>n.selectCli(s.id)}},i("i",{class:a?.ready?"ok":a?"no":"","aria-hidden":"true"}),s.label.replace(/ CLI$/,""))})):null}function Ur(e,n,t){let r=n.current;if(!r)return[..._("Nothing to fix in code","Choose a finding to review, or inspect the remaining checklist steps."),z("Go to the launch checklist",()=>t.goToStep("ready"))];let s=n.fixable.findIndex(h=>h.id===r.id),a=e.flow.handoff?.findingId===r.id?e.flow.handoff:null,c=et(e),o=e.probes[e.cliId],d=e.agents.filter(h=>h.installed),p=a?.status==="running",l=e.busy.probe===e.cliId,u;return p?u=z(`${c} is working`,()=>{},{disabled:!0,busy:!0,note:"It edits files in this repo. You review the change."}):a?.status==="done"?u=z("Check again",()=>void t.checkAgain(),{id:"check-again",note:"Runs the same local check to see if the fix held."}):d.length?o?.ready?u=z(a?.status==="failed"?`Send to ${c} again`:`Send to ${c}`,()=>void t.sendFix(),{id:"send-fix",note:e.accessMode==="ask"?"Ask mode is on: the agent will only plan, not edit. Change it in More, Agent chat.":`${c} edits files in this repo. You review the change.`}):u=z(l?`Connecting ${c}`:`Connect ${c}`,()=>void t.testConnection(e.cliId),{disabled:l,busy:l,note:o?o.message:`VibeRaven runs ${c} on this computer with your own sign-in.`}):u=z("Copy the prompt",()=>void t.copyFix(),{note:"No coding agent found on this computer. Paste it into any agent."}),[..._(r.title),i("div",{class:"fix-meta"},Cn(r),i("span",{class:"fix-count"},`Blocker ${s+1} of ${n.fixable.length}${r.service?` \xB7 ${r.service.name}`:""}`),$n(r,!0)),r.summary?i("p",{class:"fix-summary"},r.summary):null,r.evidence.length?i("ul",{class:"fix-evidence"},...r.evidence.slice(0,4).map(h=>i("li",{},h))):null,i("section",{class:"prompt","aria-label":"Prompt for your agent"},i("header",{},i("h2",{},"Prompt for your agent"),bt("Copy",()=>void t.copyFix(),{icon:P.copy})),i("pre",{tabindex:0},r.prompt)),Rr(e,t,p||e.busy.chat),p?i("p",{class:"working-line",role:"status"},i("span",{dataset:{working:"1"}},`${c} is working\u2026`),i("button",{class:"quiet stop",on:{click:()=>void t.stop()}},"Stop")):null,a&&a.status!=="running"?i("section",{class:`agent-reply is-${a.status}`,"aria-label":`${et(e,a.cliId)} replied`},i("h2",{},a.status==="done"?`${et(e,a.cliId)} replied`:`${et(e,a.cliId)} did not finish`),i("div",{class:"agent-reply-body",html:X(a.output)})):null,u,i("div",{class:"quiet-row"},bt("Back to findings",()=>t.goToStep("findings"),{icon:P.back}),a?.status!=="done"?bt("Fixed it yourself? Check again",()=>void t.checkAgain(),{disabled:p||n.scanning}):null)].filter(h=>h!==null)}function Fr(e,n,t){let r=e.flow.recheck;if(!r)return[..._("Nothing to check yet","Fix a blocker first, then check again here."),z("Back to findings",()=>t.goToStep("findings"))];let s=typeof r.scoreBefore=="number"&&typeof r.scoreAfter=="number"&&r.scoreBefore!==r.scoreAfter?i("p",{class:"score-move"},`Heuristic repo-check score ${r.scoreBefore} \u2192 ${r.scoreAfter}`):null;if(r.status==="running")return[..._("Checking again",`Running the same local check to see if \u201C${r.title}\u201D is gone.`),i("div",{class:"recheck-meter",role:"status"},i("span",{class:"spin"}),"Reading the repo"),z("Checking",()=>{},{disabled:!0,busy:!0})];if(r.status==="fixed"){let a=n.fixable.find(c=>c.id===r.nextId);return[..._("Scenario passed locally",`\u201C${r.title}\u201D no longer shows up in the check.`),s,i("p",{class:"recheck-next",role:"status"},a?`Next: ${a.title}`:"That was the last blocker in the code."),a?z("Next blocker",()=>t.fixFinding(a.id),{note:"Moving on by itself in a moment."}):z("Go to the launch checklist",()=>t.goToStep("ready"),{note:"Moving on by itself in a moment."})].filter(c=>c!==null)}return r.status==="open"?[..._("Still open",`The check still finds \u201C${r.title}\u201D.`),r.message?i("p",{class:"fix-summary"},r.message):null,s,z("Back to the fix",()=>t.fixFinding(r.findingId))].filter(a=>a!==null):[..._("The check did not finish",r.message??""),z("Check again",()=>void t.checkAgain())]}function zr(e,n,t){if(!n.checklist.length)return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist"),i("p",{class:"empty-line"},"No dashboard steps found for this app: VibeRaven found no hosted services in the code."));let r=n.checklist.filter(s=>!s.done).length;return i("section",{class:"checklist","aria-label":"Launch checklist"},i("h2",{},"Launch checklist",i("span",{class:"checklist-count"},r?`${r} left`:"All done")),i("ul",{},...n.checklist.map(s=>i("li",{class:`check-item${s.done?" is-done":""}`},s.doneBy==="you"?i("button",{class:"tick",role:"checkbox","aria-checked":String(s.done),"aria-label":s.label,on:{click:()=>t.toggleChecklistItem(s.id)},html:s.done?P.check:""}):i("span",{class:`tick is-auto${s.done?" on":""}`,"aria-hidden":"true",html:s.done?P.check:""}),i("div",{class:"check-copy"},i("strong",{},s.label),i("span",{},s.detail),i("span",{class:"check-who"},s.doneBy==="you"?"You confirm this":s.kind==="live"?"VibeRaven confirms this with your agent":"VibeRaven confirms this on the next check")),s.kind==="live"&&!s.done&&s.providerId?i("button",{class:"quiet",disabled:e.busy.chat||!e.probes[e.cliId]?.ready,title:e.probes[e.cliId]?.ready?void 0:"Connect a coding agent first",on:{click:()=>void t.verifyById(s.providerId)}},"Check live"):s.href?i("a",{class:"quiet",href:s.href,target:"_blank",rel:"noreferrer"},"Open dashboard",we(P.out)):null))))}function Hr(e,n){let t=e.fullCheck.status,r=be(t?.usage),s=t?.account?t.account.plan==="pro"?"Pro plan":"Free plan":null;return i("section",{class:"final","aria-label":"Full check"},i("h2",{},"Optional deeper repository review"),i("p",{},"A hosted model reviews selected repository context after you preview and confirm the upload. This does not verify live deployment behavior or capacity."),i("p",{class:"final-quota"},[s,r??"Free accounts get 2 full checks. Pro gets 50 a month."].filter(Boolean).join(" \xB7 ")),i("button",{id:"run-full-check",class:"primary",disabled:e.fullCheck.step==="running",on:{click:()=>void n.openFullCheck()}},"Run full check",we(P.arrow)),e.fullCheck.saved?i("button",{id:"show-last-full-check",class:"quiet",on:{click:()=>n.showSavedFullCheck()}},`Show last full check (score ${e.fullCheck.saved.score}, ${ot(e.fullCheck.saved.checkedAt)})`):null)}function Br(e,n,t){if(!n.available.ready)return[..._("Not yet","Fix the critical blockers first. The launch checklist opens when none are left."),z("Back to findings",()=>t.goToStep("findings"))];let r=n.findings.filter(o=>!o.dashboard).length,s=n.gateClear?"No blockers found within tested scope":"No critical blockers left",a=n.checklist.filter(o=>!o.done).length,c=n.gateClear?a?`${a} unknown${a===1?"":"s"}: the checklist items below, which VibeRaven cannot test from this computer.`:"The listed checks are recorded or marked done by you. This is not confirmation that production is ready.":`The repository checks found no critical blockers.${r?` ${r} other finding${r===1?" is":"s are"} still open in Findings.`:""} Review the remaining findings and live-evidence checklist.`;return[..._(s,c),n.services.length?i("ul",{class:"strip","aria-label":"Services"},...n.services.map(o=>i("li",{class:`strip-item is-${o.tone}`},o.mark?i("img",{src:o.mark,alt:"",width:20,height:20}):null,o.name))):null,i("div",{class:"ready-grid"},zr(e,n,t),Hr(e,t))].filter(o=>o!==null)}function Yr(e,n){let t=e.prChecks;if(!t.status)return null;let r=t.status.exists,s=`git add ${t.status.path} && git commit -m "Check pull requests with VibeRaven"`,a=null;if(t.open){let c=t.written?[i("h3",{},"Workflow added"),i("p",{},"Commit and push it. From the next pull request on, VibeRaven comments with what the change added and what it fixed."),i("pre",{class:"pr-command",tabindex:0},s),t.status.onGithub?null:i("p",{class:"pr-muted"},"This repository has no GitHub remote yet. The check runs once it is on GitHub."),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-copy",class:"btn sm primary",on:{click:()=>void n.copyPrCommit()}},"Copy command"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Done"))]:r?[i("h3",{},"Pull request checks are set up"),i("p",{},`The workflow is in ${t.status.path}. Once it is pushed, each pull request gets one comment with what it added and fixed.`),i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Close"))]:[i("h3",{},"Check every pull request"),i("p",{},"VibeRaven adds one file to this repo, ",i("code",{},t.status.path),". Each pull request then gets one comment: what the change added and what it fixed."),i("ul",{class:"pr-points"},i("li",{},"Runs in your own GitHub Actions: private repos work and the code is never uploaded."),i("li",{},"Advice by default. It only blocks a merge if you turn that on.")),t.error?i("p",{class:"pr-error",role:"alert"},t.error):null,i("div",{class:"pr-actions"},i("button",{id:"pr-checks-action",class:"btn sm primary",disabled:t.busy,on:{click:()=>void n.addPrChecks()}},t.busy?"Adding\u2026":"Add the workflow"),i("button",{class:"btn sm",on:{click:()=>n.togglePrChecks(!1)}},"Not now"))];a=i("div",{id:"pr-checks-card",class:"pr-card",role:"dialog","aria-labelledby":"pr-checks-button"},...c)}return i("div",{class:"pr-checks"},i("button",{id:"pr-checks-button",class:`pr-checks-button${r?" is-on":""}`,"aria-expanded":String(t.open),"aria-controls":"pr-checks-card",on:{click:()=>n.togglePrChecks()}},we(P.pr),r?"Pull request checks added":"Check every pull request"),a)}function Gr(){let e=t=>t.currentTarget.closest(".canvas"),n=(t,r,s,a="")=>i("button",{class:`canvas-tool${a}`,title:t,"aria-label":t,html:r,on:{click:c=>{let o=e(c);o&&s(o)}}});return i("div",{class:"canvas-tools",dataset:{sig:"tools"}},n("Zoom in",P.zoomIn,t=>Ge(t,1.15)),n("Zoom out",P.zoomOut,t=>Ge(t,1/1.15)),n("Reset layout",P.reset,t=>Bt(t)," is-reset"))}var vt=null;function In(e,n){let t=R(e),r=e.flow.step,s=vt!==null&&vt!==r;vt=r;let a=r==="app"?Er(e,t):r==="work"?kn(e,n):r==="findings"?Or(e,t,n):r==="fix"?Ur(e,t,n):r==="recheck"?Fr(e,t,n):Br(e,t,n),c=r!=="app",o=r==="work"?dn(e,n):null;return i("main",{class:`stage${c?" has-panel":""}${o?" is-work":""}`,dataset:{slot:"stage",step:r}},e.scan?.state==="error"?i("p",{class:"stage-alert",role:"alert"},e.scan.error??"The first check did not finish."):null,o?i("div",{class:"canvas is-scene",dataset:{slot:"canvas-scene"}},o,un(e,n)):i("div",{class:"canvas",dataset:{slot:"canvas"}},Dr(e,t,n),Gr(),Yr(e,n),wn(e,n,Pr(e,t))),i("div",{class:`stage-body step-${r}${c?" panel":""}${s?" arrive":""}`,dataset:{slot:`body-${r}`}},c?i("button",{class:"panel-close","aria-label":"Close panel",title:"Close",on:{click:()=>r==="work"?n.closeWork():n.goToStep("app")},html:'<svg width="14" height="14" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>'}):null,...a))}function jn(e){return R(e)}function Nn(e,n){let t=Array.from(e.children);n.forEach((r,s)=>{let a=t[s];if(!a){e.appendChild(r);return}let c=r.dataset?.sig;if(c&&a.dataset?.sig===c&&a.tagName===r.tagName)return;let o=r.dataset?.slot;if(o&&a.dataset?.slot===o&&a.tagName===r.tagName){for(let d of Array.from(a.attributes))r.hasAttribute(d.name)||a.removeAttribute(d.name);for(let d of Array.from(r.attributes))a.getAttribute(d.name)!==d.value&&a.setAttribute(d.name,d.value);Nn(a,Array.from(r.children));return}e.replaceChild(r,a)});for(let r of Array.from(e.children).slice(n.length))r.remove()}var kt=new WeakMap;function Qr(e){for(let n of Array.from(e.querySelectorAll(".canvas")))Yt(n,tt);for(let n of Array.from(e.querySelectorAll('.board[data-lines="1"]'))){if(kt.has(n)){requestAnimationFrame(()=>tt(n));continue}let t=()=>tt(n);if(requestAnimationFrame(t),typeof ResizeObserver<"u"){let r=new ResizeObserver(t);r.observe(n),kt.set(n,r)}else kt.set(n,{disconnect(){}})}}function Dn(e,n,t){let r=n.get(),s=e.contains(document.activeElement)?document.activeElement:null,a=s?.id,c=s instanceof HTMLTextAreaElement||s instanceof HTMLInputElement?[s.selectionStart,s.selectionEnd]:null,o=jn(r);if(Nn(e,[xn(r,t),Sn(r,o,t),In(r,t),...r.agentOpen?[i("div",{class:"sheet-veil",on:{click:()=>t.toggleAgent()}}),qr(r,n,t)]:[],...r.drawer?[i("div",{class:"drawer-veil",on:{click:()=>t.toggleDrawer(null)}}),_r(r,n,t)]:[],...$t(r,t),...vn(r,t),ns(r)]),Qr(e),a&&document.activeElement?.id!==a){let d=document.getElementById(a);d?.focus({preventScroll:!0}),c&&(d instanceof HTMLTextAreaElement||d instanceof HTMLInputElement)&&d.setSelectionRange(...c)}}function Wr(e,n,t){let r=ve(e.project,e.catalog,e.verified),s=r.filter(o=>o.step!=="absent"),a=r.filter(o=>o.step==="absent"),c=e.setup.running||e.busy.chat||e.busy.scan;return i("div",{},e.setup.open?Nt(e,n,t):null,i("section",{class:"block","aria-label":"In your app"},i("div",{class:"block-head"},i("h4",{},"In your app"),i("button",{id:"connect-my-app",class:"btn sm",disabled:c,on:{click:()=>t.openStackSetup()}},"Set up with your agent")),s.length?i("div",{class:"rail-grid"},...s.map(o=>Zr(o,e,t))):i("p",{class:"drawer-empty"},"No services found in this code yet.")),a.length?i("section",{class:"block","aria-label":"Available services"},i("div",{class:"block-head"},i("h4",{},"Available"),i("span",{class:"block-meta"},"Your accounts, your choice of providers")),i("div",{class:"rail-grid"},...a.map(o=>i("article",{class:"slab available"},i("div",{class:"face"},i("div",{class:"face-logo"},i("img",{src:He(o),alt:"",loading:"lazy"})),i("h3",{class:"face-name"},o.name),i("div",{class:"face-area"},o.area)),i("div",{class:"slab-act"},i("button",{class:"btn library-add",disabled:c,"aria-label":`Add ${o.name} to setup`,on:{click:()=>{t.openStackSetup(),n.get().setup.selected.includes(o.id)||t.toggleSetupProvider(o.id),document.getElementById("stack-setup-heading")?.focus()}}},"+ Add to setup")))))):null)}function Vr(e){return e.step==="ready"?{text:`Agent reported checks passed ${e.verified?F(e.verified.at):""}.`,tone:"g"}:e.step==="verified"?{text:e.verified?.ok?`Agent check ${e.verified?F(e.verified.at):""}.`:"Agent check found issues.",tone:e.verified?.ok?"g":"a"}:e.step==="mcp"?{text:"Agent integration configured. Live check needed.",tone:"a"}:e.step==="in_repo"?{text:e.hasRecipe?"Found in your code. Not connected.":"Found in your code.",tone:"a"}:{text:"Not in this app.",tone:""}}function Zr(e,n,t){let r=n.busy.tile===e.id,s=r||n.setup.running||n.busy.chat,a=Vr(e),c=e.step==="ready"?i("span",{class:"tag acid"},"Agent checked"):e.step==="verified"?i("span",{class:"tag"},e.verified?.ok?"Checked":"Issues"):e.step==="mcp"?i("span",{class:"tag"},"Configured"):i("span",{class:"tag"},"In code"),o=e.step==="in_repo"&&e.hasRecipe?i("button",{class:"btn primary",disabled:s,on:{click:()=>t.connect(e)}},r?i("span",{class:"spin"}):null,r?"Configuring\u2026":"Configure agent"):e.step==="in_repo"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},"Check with agent"):e.step==="mcp"?i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check live"):i("button",{class:"btn",disabled:s,on:{click:()=>t.verify(e)}},r?i("span",{class:"spin"}):null,r?"Checking\u2026":"Check again"),d=es(e.logoUrl)??"#9a9a9a";return i("article",{class:`slab${e.step==="ready"?" ready":""}${r?" scanning":""}`,dataset:{provider:e.id},style:{"--brand":d}},i("div",{class:"face"},i("div",{class:"face-top"},c),i("div",{class:"face-logo"},i("img",{src:e.logoUrl,alt:"",loading:"lazy"})),i("div",{class:"face-name"},e.name),i("div",{class:"face-area"},e.area)),i("div",{class:`slab-status ${a.tone}`},i("i",{class:a.tone}),i("span",{class:"txt"},a.text),e.fixes>0?i("button",{class:"fixlink",on:{click:()=>t.focusBlockers(e.id)}},`${e.fixes} to fix`):null),i("div",{class:"slab-act"},o))}var T={close:'<svg width="12" height="12" viewBox="0 0 14 14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="M3 3l8 8M11 3l-8 8"/></svg>',reload:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.5 8a5.5 5.5 0 1 1-1.6-3.9M13.5 2.5v3h-3"/></svg>',send:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5"/></svg>',stop:'<svg width="14" height="14" viewBox="0 0 14 14" aria-hidden="true"><rect x="2" y="2" width="10" height="10" rx="2" fill="currentColor"/></svg>',spark:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M8 1.8v3.4M8 10.8v3.4M1.8 8h3.4M10.8 8h3.4M3.6 3.6l2 2M10.4 10.4l2 2M12.4 3.6l-2 2M5.6 10.4l-2 2"/></svg>',plug:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M6 2v3M10 2v3M4.5 5h7v2.5a3.5 3.5 0 0 1-7 0zM8 11v3"/></svg>',diff:'<svg viewBox="0 0 16 16" width="15" height="15" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M5 2.5v6M2 5.5h6M9 11.5h5"/><rect x="1.5" y="1.5" width="13" height="13" rx="2.5"/></svg>',terminal:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.5 4.5 6 8l-3.5 3.5M8 12h5.5"/></svg>',download:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2.5v8M4.5 7 8 10.5 11.5 7M3 13.5h10"/></svg>',arrow:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8h10M9 4l4 4-4 4"/></svg>',tag:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M2 2.5h5.5l6.5 6.5-5 5-6.5-6.5z"/><circle cx="5" cy="5.5" r="1" fill="currentColor"/></svg>',book:'<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" aria-hidden="true"><path d="M3 2.5h7.5a2 2 0 0 1 2 2v9H5a2 2 0 0 1-2-2z"/><path d="M3 11.5a2 2 0 0 1 2-2h7.5"/></svg>'};function Q(e){return i("span",{class:"ico",html:e})}function Ue(e){return B[e]??B.claude}function nt(e){return e.replace(/ CLI$/,"").replace("Claude Code","Claude")}function En(e){return e.agents.find(n=>n.id===e.cliId)?.label.replace(/ CLI$/,"")??e.cliId}function qr(e,n,t){let r=e.agents.find(g=>g.id===e.cliId),s=e.probes[e.cliId],a=s?.ready===!0,c=e.busy.probe===e.cliId,o=e.setup.running||e.busy.chat,d=r?.modelOptions??(r?.models??[]).map(g=>({id:g,label:g})),p=nt(En(e)),l=[[T.spark,"What does this app need next?"],[T.plug,"Check my service connections"],[T.diff,"Explain what changed since the last release"]],u=i("div",{class:"thread"},e.messages.length?e.messages.map(g=>Kr(g,e,t)):i("div",{class:"chat-welcome"},i("span",{class:"chat-welcome-mark"},i("img",{src:Ue(e.cliId),alt:"",width:28,height:28})),i("h3",{},"What should we work on?"),i("p",{},`${p} works in this project on your computer.`),i("div",{class:"chat-suggest"},...l.map(([g,w])=>i("button",{class:"chat-suggestion",disabled:!a||o,on:{click:()=>t.send(w)}},Q(g),i("span",{},w))))),e.busy.chat?i("div",{class:"working"},i("span",{class:"chat-typing","aria-hidden":"true"},i("i"),i("i"),i("i")),i("span",{dataset:{working:"1"}},`${p} is working\u2026`),i("button",{class:"btn sm stop",on:{click:()=>t.stop()}},i("i",{class:"sq"}),"Stop")):null,e.busy.chat?i("div",{class:"slow-run hint",hidden:!e.workingSince||Date.now()-e.workingSince<6e4,dataset:{slowRun:"1"}},i("p",{},"Taking longer than usual. A sign-in prompt may be waiting in your agent."),i("button",{class:"btn sm",on:{click:()=>t.toggleDrawer("terminal")}},"Open agents")):null);(e.messages.length||e.busy.chat)&&queueMicrotask(()=>{u.scrollTop=u.scrollHeight});let h=e.contextProviderId?ve(e.project,e.catalog,e.verified).find(g=>g.id===e.contextProviderId):null,f=i("textarea",{id:"agent-composer",placeholder:a?`Ask ${p} about this app, or say what to change\u2026`:`Connect ${p} to start chatting.`,rows:2,value:e.draft,disabled:o,on:{input:g=>{n.get().draft=g.target.value},keydown:g=>{let w=g;w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),t.send(w.target.value))}}});return i("aside",{id:"agent-panel",class:"side chat","aria-label":"Coding agent"},i("header",{class:"chat-head"},i("div",{class:"chat-agents",role:"radiogroup","aria-label":"Coding agent"},...e.agents.map(g=>{let w=e.probes[g.id],b=g.id===e.cliId,L=w?.ready?"ok":g.installed?"wait":"off";return i("button",{role:"radio","aria-checked":String(b),class:`chat-agent${b?" on":""}`,disabled:o,title:g.installed?w?.ready?"Connected":"Installed, not tested yet":"Not installed",on:{click:()=>t.selectCli(g.id)}},i("img",{src:Ue(g.id),alt:"",width:16,height:16}),nt(g.label),i("i",{class:`chat-dot is-${L}`,"aria-hidden":"true"}))})),i("button",{class:"chat-close","aria-label":"Close chat",title:"Close",on:{click:()=>t.toggleAgent()},html:T.close})),i("div",{class:"chat-meta"},i("span",{class:`chat-status${a?" is-ok":""}`,role:"status"},c?i("span",{class:"spin"}):i("i",{"aria-hidden":"true"}),c?"Checking\u2026":a?"Connected":r&&!r.installed?"Not installed":"Not connected"),d.length?i("label",{class:"chat-model",title:"Model"},i("span",{class:"chat-model-label"},"Model"),i("select",{id:"agent-model",disabled:o,on:{change:g=>n.set({modelId:g.target.value})}},i("option",{value:"",selected:!e.modelId},"Default"),e.modelId&&!d.some(g=>g.id===e.modelId)?i("option",{value:e.modelId,selected:!0},e.modelId):null,...d.map(g=>i("option",{value:g.id,selected:g.id===e.modelId},g.label)))):null,i("button",{id:"agent-test-connection",class:"chat-icon",title:a?"Test the connection again":"Test the connection","aria-label":a?"Test again":"Test connection",disabled:c||o,on:{click:()=>t.testConnection(e.cliId)},html:T.reload})),u,s&&!s.ready?i("div",{class:"chat-connect"},i("p",{},s.message),i("div",{class:"chat-connect-row"},i("button",{class:"btn sm primary",disabled:c,on:{click:()=>t.testConnection(e.cliId)}},Q(T.reload),"Test again"),i("button",{class:"btn sm ghost",on:{click:()=>t.toggleDrawer("terminal")}},Q(T.terminal),"Set up"))):null,i("div",{class:"composer"},h?i("span",{class:"chip"},h.logoUrl?i("img",{src:h.logoUrl,alt:""}):null,h.name,i("button",{title:"Remove context","aria-label":"Remove context",on:{click:()=>n.set({contextProviderId:null})},html:T.close})):null,f,i("div",{class:"row"},i("label",{class:"chat-access",title:"What the agent may do"},i("select",{id:"agent-access","aria-label":"Agent access",disabled:o,on:{change:g=>t.setAccessMode(g.target.value)}},...["ask","approve","full"].map(g=>i("option",{value:g,selected:g===e.accessMode},g==="ask"?"Ask \xB7 plan only":g==="approve"?"Edit files":"Full access")))),e.busy.chat?i("button",{class:"btn send stop",title:"Stop","aria-label":"Stop",on:{click:()=>t.stop()},html:T.stop}):i("button",{class:"btn send",title:"Send","aria-label":"Send",disabled:!a||e.setup.running,on:{click:()=>t.send(f.value)},html:T.send}))))}function Pn(e,n,t=Date.now()){for(let c of Array.from(e.querySelectorAll(".work-elapsed[data-since]"))){let o=Date.parse(c.dataset.since??"");Number.isFinite(o)&&(c.textContent=`${Math.max(0,Math.floor((t-o)/1e3))}s`)}if(!n)return;let r=Math.max(0,Math.floor((t-n)/1e3)),s=e.querySelector("[data-working]");s&&(s.textContent=`${s.textContent?.split(" \xB7")[0]??"Working\u2026"} \xB7 ${r}s`);let a=e.querySelector("[data-slow-run]");a&&(a.hidden=r<60)}function Kr(e,n,t){if(e.role==="me")return i("div",{class:"msg me"},i("div",{class:"body",html:`<p>${ye(e.text)}</p>`}));if(e.role==="system")return i("div",{class:"msg sys"},i("div",{class:"body",html:X(e.text)}),e.card?Tn(e,n,t):null);let r=n.agents.find(a=>a.id===e.cliId),s=e.role==="error"?"Something went wrong":r?nt(r.label):"Agent";return i("div",{class:`msg ${e.role==="error"?"err":"agent"}`},i("div",{class:"who"},e.role==="error"?i("span",{class:"msg-avatar is-err"},"!"):i("span",{class:"msg-avatar"},i("img",{src:Ue(e.cliId??n.cliId),alt:"",width:14,height:14})),s,i("span",{class:"t"},F(e.at))),i("div",{class:"body",html:X(e.text)}),e.card?Tn(e,n,t):null)}function Tn(e,n,t){return i("div",{class:"card"},i("span",{},e.card.providerId?i("img",{src:ve(n.project,n.catalog,n.verified).find(r=>r.id===e.card?.providerId)?.logoUrl??"",alt:""}):null,e.card.label),e.card.action==="verify"&&e.card.providerId?i("button",{class:"btn sm primary",disabled:n.busy.chat||n.setup.running,on:{click:()=>t.verifyById(e.card.providerId)}},"Verify live"):e.card.action==="recheck"?i("button",{class:"btn sm",disabled:n.busy.scan,on:{click:()=>t.recheck()}},"Re-check"):null)}function _r(e,n,t){let r=e.drawer==="terminal"?Xr(e,t):e.drawer==="services"?Wr(e,n,t):e.drawer==="actions"?Mn(e,t):Jr(e,n,t),s=e.drawer==="terminal"?"Coding agents":e.drawer==="services"?"Services":e.drawer==="actions"?"Actions":"Releases",a=e.drawer==="terminal"?"Connect one, then it can work on your app. Installed is not the same as connected.":e.drawer==="services"?"What your app runs on, and what you could add. Check a service live through your agent.":e.drawer==="actions"?"What VibeRaven can do in this project. An action only starts when it has a real way to run here.":"Every tagged point, and what changed between any two.";return i("div",{class:"drawer",dataset:{drawer:e.drawer??""},role:"dialog","aria-modal":"true","aria-labelledby":"drawer-heading",on:{keydown:c=>{let o=c;if(o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),t.toggleDrawer(null)),o.key!=="Tab")return;let d=Array.from(c.currentTarget.querySelectorAll("*")).filter(u=>u.matches('button:not(:disabled), input:not(:disabled), a[href], select:not(:disabled), [tabindex="0"]')),p=d[0],l=d[d.length-1];o.shiftKey&&document.activeElement===p&&(o.preventDefault(),l?.focus()),!o.shiftKey&&document.activeElement===l&&(o.preventDefault(),p?.focus())}}},i("div",{class:"drawer-head"},i("div",{class:"drawer-title"},i("h3",{id:"drawer-heading"},s),i("p",{},a)),i("button",{id:"drawer-close",class:"drawer-x","aria-label":"Close",title:"Close",on:{click:()=>t.toggleDrawer(null)},html:T.close})),i("div",{class:"drawer-body"},r))}function Mt(e,n,t,r,...s){return i("li",{class:`step${t?" done":""}`},i("span",{class:"step-n","aria-hidden":"true"},t?"\u2713":String(e)),i("div",{class:"step-body"},i("div",{class:"step-title"},n,i("span",{class:`step-state${t?" ok":""}`},t?"Done":"Not confirmed")),i("p",{},r),s.some(Boolean)?i("div",{class:"row step-row"},...s):null))}function Xr(e,n){return i("div",{},i("div",{class:"agent-cards"},...e.agents.map(t=>{let r=e.probes[t.id],s=r?.ready===!0,a=e.busy.probe===t.id,c=e.cliId===t.id,o=s?"Connected":t.installed?"Installed \xB7 not tested":"Not installed",d=s?"green":t.installed?"amber":"gray",p=s?c?i("button",{class:"agent-cta is-on",disabled:!0},Q(T.spark),"In use"):i("button",{class:"agent-cta",on:{click:()=>n.selectCli(t.id)}},Q(T.arrow),"Use this agent"):t.installed?i("button",{class:"agent-cta is-primary",disabled:a,on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):Q(T.plug),a?"Testing\u2026":"Connect"):i("button",{class:"agent-cta is-primary",on:{click:()=>n.runSetup(t.id,"install")}},Q(T.download),"Install");return i("section",{class:`block agent-block agent-card${s?" is-connected":""}${c?" is-selected":""}`,"aria-label":t.label},i("div",{class:"agent-card-head"},i("span",{class:"agent-card-mark"},i("img",{src:Ue(t.id),alt:"",width:26,height:26})),i("div",{class:"agent-card-name"},i("h4",{},nt(t.label)),i("span",{class:`pill ${d}`},i("i"),o)),i("a",{class:"agent-card-docs",href:t.setup.docsUrl,target:"_blank",rel:"noreferrer",title:"Docs","aria-label":`${t.label} docs`,html:T.book})),s?i("p",{class:"agent-card-note"},r?.message??"Signed in and answering."):null,i("div",{class:"agent-card-actions"},p,s?i("button",{class:"agent-cta is-quiet",disabled:a,title:"Test again",on:{click:()=>n.testConnection(t.id)}},a?i("span",{class:"spin"}):Q(T.reload),"Test"):null,!s&&t.installed?i("button",{class:"agent-cta is-quiet",on:{click:()=>n.openTerminal(t.id,"sign-in")}},Q(T.terminal),"Sign in"):null),s?null:i("details",{class:"agent-how"},i("summary",{},"How to connect"),i("ol",{class:"steps"},Mt(1,"Install the CLI",t.installed,t.installed?`Found on this computer as ${t.command}.`:`Install command: ${t.setup.installCommand}`),Mt(2,"Sign in to your account",s,`Sign in with ${t.setup.signInCommand}. VibeRaven cannot read your CLI session.`),Mt(3,"Test the connection",s,r?.message??`VibeRaven runs ${t.setup.verifyCommand} and reads the result.`))))})),i("details",{class:"agent-output"},i("summary",{},Q(T.terminal),"Output from the last step"),i("pre",{class:"out",dataset:{terminalOut:"1"}},e.terminalOutput||"Nothing yet. Install, sign in or test an agent and its output appears here.")))}function Jr(e,n,t){let r=e.project.releases??[],s=i("input",{id:"release-from",class:"sel","aria-label":"From revision",placeholder:"Tag, commit or branch",value:e.compare.from,on:{input:d=>{n.get().compare.from=d.target.value}}}),a=i("input",{id:"release-to",class:"sel","aria-label":"To revision",placeholder:"HEAD",value:e.compare.to,on:{input:d=>{n.get().compare.to=d.target.value}}}),c=e.compare.result,o=c?.stats;return i("div",{class:"releases"},i("section",{class:"rel-section","aria-label":"Release history"},i("h4",{class:"rel-title"},Q(T.tag),"Release points",i("span",{class:"rel-count"},String(r.length))),r.length?i("ul",{class:"rel-cards"},...r.map(d=>i("li",{class:`rel-card${d.tone==="current"?" is-current":""}`},i("div",{class:"rel-card-top"},i("span",{class:"rel-tag"},d.label),i("span",{class:`rel-badge is-${d.tone}`},d.tone==="current"?"Current":d.tone==="prod"?"Released":"Planned")),i("p",{class:"rel-sum"},d.summary),i("p",{class:"rel-meta"},`${d.meta} \xB7 ${d.branch}`),i("button",{class:"rel-compare",on:{click:()=>{n.set({compare:{...n.get().compare,from:d.id}}),document.getElementById("release-from")?.focus()}}},Q(T.diff),"Compare from here")))):i("div",{class:"rel-empty"},i("p",{},"No tags yet."),i("code",{},"git tag v1.0.0"),i("p",{},"You can still compare any branch or commit below."))),i("section",{class:"rel-section","aria-label":"Compare"},i("h4",{class:"rel-title"},Q(T.diff),"Compare two points"),i("div",{class:"rel-compare-row"},i("label",{class:"rel-field"},i("span",{},"From"),s),i("span",{class:"rel-arrow",html:T.arrow}),i("label",{class:"rel-field"},i("span",{},"To"),a)),e.compare.error?i("p",{class:"compare-error",role:"alert"},e.compare.error):null,c?i("div",{class:"diff-result"},i("div",{class:"diff-stats"},i("span",{class:"diff-range"},`${c.fromLabel} \u2192 ${c.toLabel}`),o?i("span",{},`${o.files??0} file${o.files===1?"":"s"}`):null,o?i("span",{class:"add"},`+${o.insertions??0}`):null,o?i("span",{class:"del"},`\u2212${o.deletions??0}`):null),i("pre",{class:"out diff",tabindex:0,role:"region","aria-label":"Diff output",html:ts(c.diff)})):null,i("div",{class:"rel-actions"},i("button",{class:"wtile",disabled:e.busy.compare,on:{click:()=>t.compare(s.value,a.value)}},i("span",{class:"wtile-ico",html:T.diff}),i("span",{class:"wtile-label"},e.busy.compare?"Reading\u2026":"Show the diff"),i("span",{class:"wtile-note"},"Straight from git, nothing sent")),i("button",{class:"wtile",disabled:e.busy.chat||e.setup.running,on:{click:()=>t.explainDiff(s.value,a.value)}},i("span",{class:"wtile-ico"},i("img",{src:Ue(e.cliId),alt:"",width:16,height:16})),i("span",{class:"wtile-label"},`Explain with ${En(e)}`),i("span",{class:"wtile-note"},"Plain words, risks first")))))}function es(e){let n=/cdn\.simpleicons\.org\/[a-z0-9.-]+\/([0-9a-f]{6})/i.exec(e);if(!n)return null;let t=n[1].toLowerCase();return t==="ffffff"?"#c8c8c8":`#${t}`}function ts(e){return e.split(`
13
13
  `).map(n=>{let t=ye(n);return n.startsWith("+++")||n.startsWith("---")||n.startsWith("diff ")||n.startsWith("@@")?`<span class="hd">${t}</span>`:n.startsWith("+")?`<span class="add">${t}</span>`:n.startsWith("-")?`<span class="del">${t}</span>`:t}).join(`
14
- `)}function es(e){return i("div",{class:"toasts"},...e.toasts.map(n=>i("div",{class:`toast${n.kind==="err"?" err":""}`},n.text)))}function Lt(e){let n=e.filter(t=>t.detected);return(n.length?n:e.filter(t=>["github","supabase","vercel"].includes(t.id))).map(t=>t.id)}function ts(e,n){return[n==="ask"?"Plan the setup of this app. Do not edit files, write configuration, provision resources, or change providers.":"Set up the selected services for this app using the current access mode.","Selected services:",...e.map(t=>`- ${t.name} (${t.area}): ${t.detected?"already detected; preserve and complete the existing integration":"requested addition; inspect the app before choosing the minimal integration"}. ${t.note??""}`),"First inspect the repo and reuse its existing architecture, accounts, and integrations. Do not replace an existing provider or add unselected services.","Shared MCP recipes may be available in .mcp.json. Check whether your CLI loads them. In editing modes, adapt the selected recipes to its project-local native configuration if necessary, preserving other entries. If a restart or authorization is required, report that as a remaining step; do not pretend the tools are available.","Use available provider MCP tools to inspect configuration. For repo work, use official SDKs, wire the necessary integration, and add placeholder variable names to .env.example. Never invent real secrets or print secret values.","If sign-in, account selection, a paid resource, broader permissions, or dashboard access is needed, stop that step and give the owner the exact next action. Do not purchase services, make financial transactions, push commits, publish packages, create releases, deploy, or alter production data as part of setup.","Run relevant local checks. Report separately: repo changes, provider evidence actually observed, and remaining user actions. MCP configuration alone does not prove a live connection. Do not claim the app is production-ready.","Keep the summary short and name the files changed."].join(`
15
- `)}async function Pn(e){let{providers:n,mode:t,connect:r,runAgent:s,onProgress:a,cancelled:c}=e;if(!n.length)throw new Error("Select at least one service.");let o=()=>{if(c())throw new Error("Setup stopped. Configuration already written is kept; no further steps will run.")};for(let p of n)if(o(),t==="ask")a({id:p.id,state:"pending",label:`${p.name} \xB7 planning only`});else if(p.mcpConfigured)a({id:p.id,state:"configured",label:`${p.name} \xB7 MCP configuration found`});else if(p.hasRecipe){a({id:p.id,state:"working",label:`${p.name} \xB7 preparing MCP configuration`});let l=await r(p.id);if(o(),!l.ok)throw new Error(`${p.name}: ${l.message}`);a({id:p.id,state:"configured",label:`${p.name} \xB7 shared MCP recipe saved`})}else a({id:p.id,state:"pending",label:`${p.name} \xB7 agent will inspect setup options`});o(),a({id:"agent",state:"working",label:t==="ask"?"Agent is preparing your plan":"Agent is working through your stack"});let d=await s(ts(n,t));if(o(),!d)throw new Error("The agent did not complete the setup task. Review its output and try again.");a({id:"agent",state:"review",label:t==="ask"?"Plan returned \xB7 review it in the agent panel":"Setup response returned \xB7 review changes and remaining steps"})}function On(e,n){if(e.length>1e3)return null;let t=new URLSearchParams(e.replace(/^[#?]/,"")).get("stack");return t===null?null:[...new Set(t.split(",").filter(r=>n.includes(r)))]}function ns(){let e=document.getElementById("vr-state");if(!e?.textContent)throw new Error("Missing initial state");return JSON.parse(e.textContent)}function Rn(e,n){let t=(e??"").trim();return t.length>n?`\u2026${t.slice(-n)}`:t}function Y(e){return e instanceof Error?e.message:String(e)}function is(e){let n=!1,t=new Set;function r(l=!1){e.set({agentOpen:!0,drawer:null}),document.getElementById(l?"agent-test-connection":"agent-composer")?.focus({preventScroll:!0}),document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})}async function s(){let[l,u,h]=await Promise.all([x.project(),x.catalog().catch(()=>({providers:[]})),x.verified().catch(()=>({verified:{}}))]);e.set({project:l,catalog:u.providers,verified:h.verified})}async function a(l,u,h){let f=e.get();if(f.busy.chat)return null;let g=f.probes[l.cliId];if(r(!g?.ready),!g?.ready)return e.toast(`Test the ${l.cliId} connection first.`,"err"),null;e.push({role:"me",text:u});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},draft:"",workingSince:Date.now(),runId:w});try{let L=(await x.chat({...l,runId:w})).agentRun,$=L.output?.trim(),y=L.timedOut||L.exitCode!==null&&L.exitCode!==0||/Stopped by user/.test(L.stderr??"");if(!$&&/Stopped by user/.test(L.stderr??""))return e.push({role:"system",text:"Stopped."}),null;let k=$||(L.timedOut?`${l.cliId} did not finish in time and was stopped. Try a smaller task, or switch to ask mode for a read-only answer.`:`${l.cliId} exited with code ${L.exitCode??"unknown"} and no answer.
14
+ `)}function ns(e){return i("div",{class:"toasts"},...e.toasts.map(n=>i("div",{class:`toast${n.kind==="err"?" err":""}`},n.text)))}function Lt(e){let n=e.filter(t=>t.detected);return(n.length?n:e.filter(t=>["github","supabase","vercel"].includes(t.id))).map(t=>t.id)}function is(e,n){return[n==="ask"?"Plan the setup of this app. Do not edit files, write configuration, provision resources, or change providers.":"Set up the selected services for this app using the current access mode.","Selected services:",...e.map(t=>`- ${t.name} (${t.area}): ${t.detected?"already detected; preserve and complete the existing integration":"requested addition; inspect the app before choosing the minimal integration"}. ${t.note??""}`),"First inspect the repo and reuse its existing architecture, accounts, and integrations. Do not replace an existing provider or add unselected services.","Shared MCP recipes may be available in .mcp.json. Check whether your CLI loads them. In editing modes, adapt the selected recipes to its project-local native configuration if necessary, preserving other entries. If a restart or authorization is required, report that as a remaining step; do not pretend the tools are available.","Use available provider MCP tools to inspect configuration. For repo work, use official SDKs, wire the necessary integration, and add placeholder variable names to .env.example. Never invent real secrets or print secret values.","If sign-in, account selection, a paid resource, broader permissions, or dashboard access is needed, stop that step and give the owner the exact next action. Do not purchase services, make financial transactions, push commits, publish packages, create releases, deploy, or alter production data as part of setup.","Run relevant local checks. Report separately: repo changes, provider evidence actually observed, and remaining user actions. MCP configuration alone does not prove a live connection. Do not claim the app is production-ready.","Keep the summary short and name the files changed."].join(`
15
+ `)}async function On(e){let{providers:n,mode:t,connect:r,runAgent:s,onProgress:a,cancelled:c}=e;if(!n.length)throw new Error("Select at least one service.");let o=()=>{if(c())throw new Error("Setup stopped. Configuration already written is kept; no further steps will run.")};for(let p of n)if(o(),t==="ask")a({id:p.id,state:"pending",label:`${p.name} \xB7 planning only`});else if(p.mcpConfigured)a({id:p.id,state:"configured",label:`${p.name} \xB7 MCP configuration found`});else if(p.hasRecipe){a({id:p.id,state:"working",label:`${p.name} \xB7 preparing MCP configuration`});let l=await r(p.id);if(o(),!l.ok)throw new Error(`${p.name}: ${l.message}`);a({id:p.id,state:"configured",label:`${p.name} \xB7 shared MCP recipe saved`})}else a({id:p.id,state:"pending",label:`${p.name} \xB7 agent will inspect setup options`});o(),a({id:"agent",state:"working",label:t==="ask"?"Agent is preparing your plan":"Agent is working through your stack"});let d=await s(is(n,t));if(o(),!d)throw new Error("The agent did not complete the setup task. Review its output and try again.");a({id:"agent",state:"review",label:t==="ask"?"Plan returned \xB7 review it in the agent panel":"Setup response returned \xB7 review changes and remaining steps"})}function Rn(e,n){if(e.length>1e3)return null;let t=new URLSearchParams(e.replace(/^[#?]/,"")).get("stack");return t===null?null:[...new Set(t.split(",").filter(r=>n.includes(r)))]}function rs(){let e=document.getElementById("vr-state");if(!e?.textContent)throw new Error("Missing initial state");return JSON.parse(e.textContent)}function Un(e,n){let t=(e??"").trim();return t.length>n?`\u2026${t.slice(-n)}`:t}function Y(e){return e instanceof Error?e.message:String(e)}function ss(e){let n=!1,t=new Set;function r(l=!1){e.set({agentOpen:!0,drawer:null}),document.getElementById(l?"agent-test-connection":"agent-composer")?.focus({preventScroll:!0}),document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})}async function s(){let[l,u,h]=await Promise.all([S.project(),S.catalog().catch(()=>({providers:[]})),S.verified().catch(()=>({verified:{}}))]);e.set({project:l,catalog:u.providers,verified:h.verified})}async function a(l,u,h){let f=e.get();if(f.busy.chat)return null;let g=f.probes[l.cliId];if(r(!g?.ready),!g?.ready)return e.toast(`Test the ${l.cliId} connection first.`,"err"),null;e.push({role:"me",text:u});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},draft:"",workingSince:Date.now(),runId:w});try{let L=(await S.chat({...l,runId:w})).agentRun,$=L.output?.trim(),y=L.timedOut||L.exitCode!==null&&L.exitCode!==0||/Stopped by user/.test(L.stderr??"");if(!$&&/Stopped by user/.test(L.stderr??""))return e.push({role:"system",text:"Stopped."}),null;let k=$||(L.timedOut?`${l.cliId} did not finish in time and was stopped. Try a smaller task, or switch to ask mode for a read-only answer.`:`${l.cliId} exited with code ${L.exitCode??"unknown"} and no answer.
16
16
 
17
- ${Rn(L.stderr,1200)}`);return!$||y?e.push({role:"error",text:k,cliId:l.cliId}):e.push({role:"agent",text:k,cliId:l.cliId,card:h}),(l.taskKind==="fix"||l.taskKind==="plan")&&await s().catch(()=>{}),y||!$?null:k}catch(v){return e.push({role:"error",text:Y(v)}),null}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}}function c(){queueMicrotask(()=>document.getElementById("stage-heading")?.focus({preventScroll:!0}))}function o(){let l=e.get();return{cliId:l.cliId,accessMode:l.accessMode,modelId:l.modelId||void 0}}let d=Qt(e,{goToStep:l=>p.goToStep(l),testConnection:()=>p.testConnection(e.get().cliId),openAgents:()=>p.openMore("terminal"),openCatalog:l=>{l?(e.set({drawer:"actions",agentOpen:!1,moreOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))):e.get().drawer==="actions"&&e.set({drawer:null})},setAccessMode:l=>p.setAccessMode(l),refreshProject:s}),p={...At(e),...d,setSection(l){e.get().setup.running||(e.set(u=>({section:l,setup:{...u.setup,open:!1}})),document.getElementById(`tab-${l}`)?.focus({preventScroll:!0}))},toggleAgent(){let l=!e.get().agentOpen;e.set({agentOpen:l}),document.getElementById(l?"agent-composer":"open-more")?.focus({preventScroll:!0}),l&&document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})},openStackSetup(){let l=e.get();e.set({section:"stack",drawer:"services",moreOpen:!1,setup:{...l.setup,open:!0,initialized:l.setup.initialized||l.catalog.length>0,selected:l.setup.initialized?l.setup.selected:Lt(l.catalog)}}),document.getElementById("stack-setup-heading")?.focus({preventScroll:!0})},toggleSetupProvider(l){let u=e.get();if(u.setup.running)return;let h=u.setup.selected.includes(l)?u.setup.selected.filter(f=>f!==l):[...u.setup.selected,l];e.set({setup:{...u.setup,initialized:!0,selected:h,progress:[],error:null}})},async startStackSetup(){let l=e.get();if(l.setup.running||l.busy.chat||l.busy.tile||l.busy.scan)return;if(r(!l.probes[l.cliId]?.ready),!l.probes[l.cliId]?.ready){e.toast(`Connect ${l.cliId} in the agent panel first.`,"err");return}let u=l.catalog.filter(f=>l.setup.selected.includes(f.id));if(!u.length){e.toast("Select at least one service.","err");return}let h=o();n=!1,e.set({setup:{...l.setup,running:!0,progress:[],error:null}});try{await Pn({providers:u,mode:h.accessMode,connect:f=>x.connectMcp(f),cancelled:()=>n,onProgress:f=>e.set(g=>({setup:{...g.setup,progress:[...g.setup.progress.filter(w=>w.id!==f.id),f]}})),runAgent:f=>a({...h,taskKind:h.accessMode==="ask"?"plan":"fix",prompt:f},`${h.accessMode==="ask"?"Plan":"Set up"} my stack: ${u.map(g=>g.name).join(", ")}`,{label:"Review the response, then check your app",action:"recheck"})})}catch(f){e.set(g=>({setup:{...g.setup,error:Y(f)}}))}finally{await s().catch(()=>{}),e.set(f=>({setup:{...f.setup,running:!1}}))}},async stop(){e.get().setup.running&&(n=!0);let l=e.get().runId;if(l)try{await x.stop(l),e.toast("Stopped.")}catch(u){e.toast(Y(u),"err")}},async recheck(){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.scan)){e.set({busy:{...e.get().busy,scan:!0}});try{await x.scan(),await s(),e.toast("Check finished.")}catch(l){e.toast(`Check failed: ${Y(l)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},toggleDrawer(l){let u=e.get().drawer;e.set(h=>({drawer:h.drawer===l?null:l})),document.getElementById(e.get().drawer?"drawer-close":"open-more")?.focus({preventScroll:!0})},selectCli(l){if(e.get().setup.running||e.get().busy.chat)return;e.set({cliId:l,modelId:""}),d.loadWork(),e.get().agents.find(h=>h.id===l)?.installed&&!e.get().probes[l]&&p.testConnection(l)},setAccessMode(l){e.get().setup.running||e.get().busy.chat||e.set({accessMode:l})},async testConnection(l,u){if(!t.has(l)){t.add(l),e.set({busy:{...e.get().busy,probe:l}});try{let h=await x.probe(l);e.set(f=>({probes:{...f.probes,[l]:h},terminalOutput:h.output||h.message})),u?.silent||e.toast(h.message,h.ready?"ok":"err"),d.loadWork()}catch(h){e.set(f=>{let g={...f.probes};return delete g[l],{probes:g}}),e.toast(Y(h),"err")}finally{t.delete(l),e.set(h=>({busy:{...h.busy,probe:h.busy.probe===l?null:h.busy.probe}}))}}},async runSetup(l,u){e.set({terminalOutput:`$ ${u}\u2026`});try{let h=await x.runSetup(l,u);e.set({terminalOutput:`$ ${h.command}
18
- ${h.output}`.trim()});let f=await x.agents();e.set({agents:f.agents.filter(g=>g.id==="codex"||g.id==="claude"||g.id==="gemini")})}catch(h){e.set({terminalOutput:Y(h)})}},async openTerminal(l,u){try{let h=await x.openTerminal(l,u);e.set({terminalOutput:`Opened a terminal with: ${h.command}
19
- Sign in there, then press Test connection.`})}catch(h){e.toast(Y(h),"err")}},async send(l){if(e.get().setup.running)return;let u=l.trim();if(!u)return;let h=e.get(),f=h.contextProviderId?h.catalog.find(g=>g.id===h.contextProviderId):null;await a({...o(),prompt:u,taskKind:"analyze",provider:f?{id:f.id,name:f.name,area:f.area}:void 0},u)},async connect(l){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.tile)){r(),e.set({busy:{...e.get().busy,tile:l.id}});try{let u=await x.connectMcp(l.id);e.toast(u.message,u.ok?"ok":"err"),await s(),u.ok&&e.push({role:"system",text:`${u.message} ${l.note??""}`.trim(),card:{providerId:l.id,label:`${l.name} \xB7 MCP configured`,action:"verify"}})}catch(u){e.toast(Y(u),"err")}finally{e.set({busy:{...e.get().busy,tile:null}})}}},async verify(l){return p.verifyById(l.id)},async verifyById(l){let u=e.get();if(u.setup.running||u.busy.chat||u.busy.tile)return;let f=(u.catalog.find(v=>v.id===l)??u.project.providers.find(v=>v.id===l))?.name??l,g=u.probes[u.cliId];if(r(!g?.ready),!g?.ready){e.toast(`Test the ${u.cliId} connection first.`,"err");return}e.push({role:"me",text:`Check ${f} live`});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,tile:l,chat:!0},workingSince:Date.now(),runId:w});try{let v=await x.verify({providerId:l,...o(),runId:w}),L=v.agentRun.output?.trim()||v.agentRun.stderr?.trim()||"No output.";e.push({role:"agent",text:L,cliId:u.cliId,card:{providerId:l,label:v.verified.ok?`${f} \xB7 verified live`:`${f} \xB7 issues found`}}),await s()}catch(v){e.push({role:"error",text:Y(v)})}finally{e.set({busy:{...e.get().busy,tile:null,chat:!1},workingSince:null,runId:null})}},async addProvider(l){e.get().setup.running||await a({...o(),taskKind:"fix",provider:{id:l.id,name:l.name,area:l.area},prompt:`Add ${l.name} (${l.area}) to this app. Install the official SDK, wire the minimal integration the app needs, add the required keys to .env.example with placeholder values, and never invent real secrets. Then tell me exactly which dashboard steps remain.`},`Add ${l.name} to this app`,{providerId:l.id,label:`${l.name} \xB7 added to repo`,action:"recheck"})},async fix(l,u){if(e.get().setup.running)return;let h=u?.provider?.nextFix?.id===l.id&&u.provider.nextFix.prompt?u.provider.nextFix.prompt:`Fix this production blocker in the repo now: ${l.title}. ${l.detail??""} Make the minimal change, then summarize what you changed and which files.`,f=l.asksFirst?`${l.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.
17
+ ${Un(L.stderr,1200)}`);return!$||y?e.push({role:"error",text:k,cliId:l.cliId}):e.push({role:"agent",text:k,cliId:l.cliId,card:h}),(l.taskKind==="fix"||l.taskKind==="plan")&&await s().catch(()=>{}),y||!$?null:k}catch(b){return e.push({role:"error",text:Y(b)}),null}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}}function c(){queueMicrotask(()=>document.getElementById("stage-heading")?.focus({preventScroll:!0}))}function o(){let l=e.get();return{cliId:l.cliId,accessMode:l.accessMode,modelId:l.modelId||void 0}}let d=Qt(e,{goToStep:l=>p.goToStep(l),testConnection:()=>p.testConnection(e.get().cliId),openAgents:()=>p.openMore("terminal"),openCatalog:l=>{l?(e.set({drawer:"actions",agentOpen:!1,moreOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))):e.get().drawer==="actions"&&e.set({drawer:null})},setAccessMode:l=>p.setAccessMode(l),refreshProject:s}),p={...At(e),...d,setSection(l){e.get().setup.running||(e.set(u=>({section:l,setup:{...u.setup,open:!1}})),document.getElementById(`tab-${l}`)?.focus({preventScroll:!0}))},toggleAgent(){let l=!e.get().agentOpen;e.set({agentOpen:l}),document.getElementById(l?"agent-composer":"open-more")?.focus({preventScroll:!0}),l&&document.getElementById("agent-panel")?.scrollIntoView?.({behavior:"smooth",block:"nearest"})},openStackSetup(){let l=e.get();e.set({section:"stack",drawer:"services",moreOpen:!1,setup:{...l.setup,open:!0,initialized:l.setup.initialized||l.catalog.length>0,selected:l.setup.initialized?l.setup.selected:Lt(l.catalog)}}),document.getElementById("stack-setup-heading")?.focus({preventScroll:!0})},toggleSetupProvider(l){let u=e.get();if(u.setup.running)return;let h=u.setup.selected.includes(l)?u.setup.selected.filter(f=>f!==l):[...u.setup.selected,l];e.set({setup:{...u.setup,initialized:!0,selected:h,progress:[],error:null}})},async startStackSetup(){let l=e.get();if(l.setup.running||l.busy.chat||l.busy.tile||l.busy.scan)return;if(r(!l.probes[l.cliId]?.ready),!l.probes[l.cliId]?.ready){e.toast(`Connect ${l.cliId} in the agent panel first.`,"err");return}let u=l.catalog.filter(f=>l.setup.selected.includes(f.id));if(!u.length){e.toast("Select at least one service.","err");return}let h=o();n=!1,e.set({setup:{...l.setup,running:!0,progress:[],error:null}});try{await On({providers:u,mode:h.accessMode,connect:f=>S.connectMcp(f),cancelled:()=>n,onProgress:f=>e.set(g=>({setup:{...g.setup,progress:[...g.setup.progress.filter(w=>w.id!==f.id),f]}})),runAgent:f=>a({...h,taskKind:h.accessMode==="ask"?"plan":"fix",prompt:f},`${h.accessMode==="ask"?"Plan":"Set up"} my stack: ${u.map(g=>g.name).join(", ")}`,{label:"Review the response, then check your app",action:"recheck"})})}catch(f){e.set(g=>({setup:{...g.setup,error:Y(f)}}))}finally{await s().catch(()=>{}),e.set(f=>({setup:{...f.setup,running:!1}}))}},async stop(){e.get().setup.running&&(n=!0);let l=e.get().runId;if(l)try{await S.stop(l),e.toast("Stopped.")}catch(u){e.toast(Y(u),"err")}},async recheck(){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.scan)){e.set({busy:{...e.get().busy,scan:!0}});try{await S.scan(),await s(),e.toast("Check finished.")}catch(l){e.toast(`Check failed: ${Y(l)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},toggleDrawer(l){let u=e.get().drawer;e.set(h=>({drawer:h.drawer===l?null:l})),document.getElementById(e.get().drawer?"drawer-close":"open-more")?.focus({preventScroll:!0})},selectCli(l){if(e.get().setup.running||e.get().busy.chat)return;e.set({cliId:l,modelId:""}),d.loadWork(),e.get().agents.find(h=>h.id===l)?.installed&&!e.get().probes[l]&&p.testConnection(l)},setAccessMode(l){e.get().setup.running||e.get().busy.chat||e.set({accessMode:l})},async testConnection(l,u){if(!t.has(l)){t.add(l),e.set({busy:{...e.get().busy,probe:l}});try{let h=await S.probe(l);e.set(f=>({probes:{...f.probes,[l]:h},terminalOutput:h.output||h.message})),u?.silent||e.toast(h.message,h.ready?"ok":"err"),d.loadWork()}catch(h){e.set(f=>{let g={...f.probes};return delete g[l],{probes:g}}),e.toast(Y(h),"err")}finally{t.delete(l),e.set(h=>({busy:{...h.busy,probe:h.busy.probe===l?null:h.busy.probe}}))}}},async runSetup(l,u){e.set({terminalOutput:`$ ${u}\u2026`});try{let h=await S.runSetup(l,u);e.set({terminalOutput:`$ ${h.command}
18
+ ${h.output}`.trim()});let f=await S.agents();e.set({agents:f.agents.filter(g=>g.id==="codex"||g.id==="claude"||g.id==="gemini")})}catch(h){e.set({terminalOutput:Y(h)})}},async openTerminal(l,u){try{let h=await S.openTerminal(l,u);e.set({terminalOutput:`Opened a terminal with: ${h.command}
19
+ Sign in there, then press Test connection.`})}catch(h){e.toast(Y(h),"err")}},async send(l){if(e.get().setup.running)return;let u=l.trim();if(!u)return;let h=e.get(),f=h.contextProviderId?h.catalog.find(g=>g.id===h.contextProviderId):null;await a({...o(),prompt:u,taskKind:"analyze",provider:f?{id:f.id,name:f.name,area:f.area}:void 0},u)},async connect(l){if(!(e.get().setup.running||e.get().busy.chat||e.get().busy.tile)){r(),e.set({busy:{...e.get().busy,tile:l.id}});try{let u=await S.connectMcp(l.id);e.toast(u.message,u.ok?"ok":"err"),await s(),u.ok&&e.push({role:"system",text:`${u.message} ${l.note??""}`.trim(),card:{providerId:l.id,label:`${l.name} \xB7 MCP configured`,action:"verify"}})}catch(u){e.toast(Y(u),"err")}finally{e.set({busy:{...e.get().busy,tile:null}})}}},async verify(l){return p.verifyById(l.id)},async verifyById(l){let u=e.get();if(u.setup.running||u.busy.chat||u.busy.tile)return;let f=(u.catalog.find(b=>b.id===l)??u.project.providers.find(b=>b.id===l))?.name??l,g=u.probes[u.cliId];if(r(!g?.ready),!g?.ready){e.toast(`Test the ${u.cliId} connection first.`,"err");return}e.push({role:"me",text:`Check ${f} live`});let w=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,tile:l,chat:!0},workingSince:Date.now(),runId:w});try{let b=await S.verify({providerId:l,...o(),runId:w}),L=b.agentRun.output?.trim()||b.agentRun.stderr?.trim()||"No output.";e.push({role:"agent",text:L,cliId:u.cliId,card:{providerId:l,label:b.verified.ok?`${f} \xB7 verified live`:`${f} \xB7 issues found`}}),await s()}catch(b){e.push({role:"error",text:Y(b)})}finally{e.set({busy:{...e.get().busy,tile:null,chat:!1},workingSince:null,runId:null})}},async addProvider(l){e.get().setup.running||await a({...o(),taskKind:"fix",provider:{id:l.id,name:l.name,area:l.area},prompt:`Add ${l.name} (${l.area}) to this app. Install the official SDK, wire the minimal integration the app needs, add the required keys to .env.example with placeholder values, and never invent real secrets. Then tell me exactly which dashboard steps remain.`},`Add ${l.name} to this app`,{providerId:l.id,label:`${l.name} \xB7 added to repo`,action:"recheck"})},async fix(l,u){if(e.get().setup.running)return;let h=u?.provider?.nextFix?.id===l.id&&u.provider.nextFix.prompt?u.provider.nextFix.prompt:`Fix this production blocker in the repo now: ${l.title}. ${l.detail??""} Make the minimal change, then summarize what you changed and which files.`,f=l.asksFirst?`${l.asksFirst} Tell the user this before you change anything, and make the change only if they confirm.
20
20
  ${h}`:h;await a({...o(),taskKind:"fix",provider:u?{id:u.id,name:u.name,area:u.area}:void 0,prompt:f},`Fix: ${l.title}`,{providerId:u?.id,label:"Re-check to update the score",action:"recheck"})},async explain(l,u){e.get().setup.running||await a({...o(),taskKind:"analyze",provider:u?{id:u.id,name:u.name,area:u.area}:void 0,prompt:`This blocker needs dashboard work: ${l.title}. ${l.detail??""} Give me the exact steps: which page, which button, which value. If a provider MCP is available, do the read-only parts yourself first.`},`Steps for: ${l.title}`)},async fixAll(){if(e.get().setup.running)return;let{missionCards:l}=e.get().project,u=l.blockers.filter(h=>!h.asksFirst&&l.planSteps.some(f=>f.id===h.id&&!f.requiresUserAction&&!f.asksFirst));u.length&&await a({...o(),taskKind:"fix",prompt:`Fix these production blockers in the repo, one by one, minimal changes each:
21
21
  ${u.map((h,f)=>`${f+1}. ${h.title}`).join(`
22
22
  `)}
23
- After each, note the files touched. Do not claim production-ready; I will re-check.`},`Fix all ${u.length} repo blockers`,{label:"Re-check to update the score",action:"recheck"})},focusBlockers(l){if(!R(e.get()).available.findings)return;e.set(h=>({section:"findings",drawer:null,contextProviderId:l,setup:{...h.setup,open:!1},flow:{...h.flow,step:"findings"}}));let u=Array.from(document.querySelectorAll(".finding")).find(h=>h.dataset.provider===l)??document.getElementById("stage-heading");u?.focus({preventScroll:!0}),u?.scrollIntoView?.({behavior:"smooth",block:"center"})},async compare(l,u){if(!l.trim()||!u.trim()){e.set({compare:{...e.get().compare,error:"Both refs are required."}});return}e.set({busy:{...e.get().busy,compare:!0},compare:{...e.get().compare,from:l,to:u,error:null}});try{let h=await x.compare(l.trim(),u.trim());e.set({compare:{from:l,to:u,result:h,error:null}})}catch(h){e.set({compare:{from:l,to:u,result:null,error:Y(h)}})}finally{e.set({busy:{...e.get().busy,compare:!1}})}},async explainDiff(l,u){e.get().setup.running||await a({...o(),taskKind:"diff",release:{id:`${l.trim()}..${u.trim()}`,label:`${l.trim()} \u2192 ${u.trim()}`},prompt:`Explain what changed between ${l.trim()} and ${u.trim()} in this repo, in plain words. Call out anything risky for production: auth, database writes, webhooks, env, payments.`},`Explain ${l.trim()} \u2192 ${u.trim()}`)},goToStep(l){let u=R(e.get());u.available[l]&&(l==="fix"&&!u.current&&e.flow({fixId:u.fixable[0]?.id??null,handoff:null}),e.flow({step:l}),c())},async checkMyApp(){let l=e.get();if(!(l.busy.scan||l.setup.running)){e.set({busy:{...l.busy,scan:!0}});try{await x.scan(),await s();let u=R(e.get());e.flow({step:lt(u),fixId:null,handoff:null,recheck:null}),c()}catch(u){e.toast(`The check did not finish: ${Y(u)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},fixFinding(l){let u=R(e.get()),h=l?u.fixable.find(f=>f.id===l):u.fixable[0];h&&(e.flow({step:"fix",fixId:h.id,handoff:e.get().flow.handoff?.findingId===h.id?e.get().flow.handoff:null}),c())},async sendFix(){let l=e.get(),u=R(l).current;if(!u||l.busy.chat||l.setup.running||!l.probes[l.cliId]?.ready&&(await p.testConnection(l.cliId),!e.get().probes[l.cliId]?.ready))return;let h=e.get().cliId,f=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},workingSince:Date.now(),runId:f}),e.flow({handoff:{findingId:u.id,cliId:h,status:"running",output:""}}),e.push({role:"me",text:`Fix: ${u.title}`});try{let w=(await x.chat({...o(),runId:f,taskKind:"fix",prompt:u.prompt,displayPrompt:`Fix: ${u.title}`,provider:u.service?{id:u.service.id,name:u.service.name,area:""}:void 0})).agentRun,v=/Stopped by user/.test(w.stderr??""),L=w.timedOut||v||w.exitCode!==null&&w.exitCode!==0||!w.output?.trim(),$=w.output?.trim()||(v?"Stopped.":w.timedOut?`${h} did not finish in time and was stopped.`:`${h} exited with code ${w.exitCode??"unknown"} and no answer.
23
+ After each, note the files touched. Do not claim production-ready; I will re-check.`},`Fix all ${u.length} repo blockers`,{label:"Re-check to update the score",action:"recheck"})},focusBlockers(l){if(!R(e.get()).available.findings)return;e.set(h=>({section:"findings",drawer:null,contextProviderId:l,setup:{...h.setup,open:!1},flow:{...h.flow,step:"findings"}}));let u=Array.from(document.querySelectorAll(".finding")).find(h=>h.dataset.provider===l)??document.getElementById("stage-heading");u?.focus({preventScroll:!0}),u?.scrollIntoView?.({behavior:"smooth",block:"center"})},async compare(l,u){if(!l.trim()||!u.trim()){e.set({compare:{...e.get().compare,error:"Both refs are required."}});return}e.set({busy:{...e.get().busy,compare:!0},compare:{...e.get().compare,from:l,to:u,error:null}});try{let h=await S.compare(l.trim(),u.trim());e.set({compare:{from:l,to:u,result:h,error:null}})}catch(h){e.set({compare:{from:l,to:u,result:null,error:Y(h)}})}finally{e.set({busy:{...e.get().busy,compare:!1}})}},async explainDiff(l,u){e.get().setup.running||await a({...o(),taskKind:"diff",release:{id:`${l.trim()}..${u.trim()}`,label:`${l.trim()} \u2192 ${u.trim()}`},prompt:`Explain what changed between ${l.trim()} and ${u.trim()} in this repo, in plain words. Call out anything risky for production: auth, database writes, webhooks, env, payments.`},`Explain ${l.trim()} \u2192 ${u.trim()}`)},goToStep(l){let u=R(e.get());u.available[l]&&(l==="fix"&&!u.current&&e.flow({fixId:u.fixable[0]?.id??null,handoff:null}),e.flow({step:l}),c())},async checkMyApp(){let l=e.get();if(!(l.busy.scan||l.setup.running)){e.set({busy:{...l.busy,scan:!0}});try{await S.scan(),await s();let u=R(e.get());e.flow({step:lt(u),fixId:null,handoff:null,recheck:null}),c()}catch(u){e.toast(`The check did not finish: ${Y(u)}`,"err")}finally{e.set({busy:{...e.get().busy,scan:!1}})}}},fixFinding(l){let u=R(e.get()),h=l?u.fixable.find(f=>f.id===l):u.fixable[0];h&&(e.flow({step:"fix",fixId:h.id,handoff:e.get().flow.handoff?.findingId===h.id?e.get().flow.handoff:null}),c())},async sendFix(){let l=e.get(),u=R(l).current;if(!u||l.busy.chat||l.setup.running||!l.probes[l.cliId]?.ready&&(await p.testConnection(l.cliId),!e.get().probes[l.cliId]?.ready))return;let h=e.get().cliId,f=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`;e.set({busy:{...e.get().busy,chat:!0},workingSince:Date.now(),runId:f}),e.flow({handoff:{findingId:u.id,cliId:h,status:"running",output:""}}),e.push({role:"me",text:`Fix: ${u.title}`});try{let w=(await S.chat({...o(),runId:f,taskKind:"fix",prompt:u.prompt,displayPrompt:`Fix: ${u.title}`,provider:u.service?{id:u.service.id,name:u.service.name,area:""}:void 0})).agentRun,b=/Stopped by user/.test(w.stderr??""),L=w.timedOut||b||w.exitCode!==null&&w.exitCode!==0||!w.output?.trim(),$=w.output?.trim()||(b?"Stopped.":w.timedOut?`${h} did not finish in time and was stopped.`:`${h} exited with code ${w.exitCode??"unknown"} and no answer.
24
24
 
25
- ${Rn(w.stderr,1200)}`);e.flow({handoff:{findingId:u.id,cliId:h,status:L?"failed":"done",output:$}}),e.push({role:L?"error":"agent",text:$,cliId:h})}catch(g){e.flow({handoff:{findingId:u.id,cliId:h,status:"failed",output:Y(g)}})}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}},async copyFix(){let l=R(e.get()).current;if(l)try{await navigator.clipboard.writeText(l.prompt),e.toast("Prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the prompt and copy it by hand.","err")}},async checkAgain(){let l=e.get(),u=R(l).current;if(!u||l.busy.scan)return;let h=l.project.gate?.score;e.flow({step:"recheck",recheck:{findingId:u.id,title:u.title,status:"running",scoreBefore:h}}),e.set({busy:{...e.get().busy,scan:!0}}),c();try{await x.scan(),await s();let f=R(e.get()),g=f.findings.find(L=>L.id===u.id),w=e.get().project.gate?.score;if(g){e.flow({recheck:{findingId:u.id,title:u.title,status:"open",message:g.summary,scoreBefore:h,scoreAfter:w}});return}let v=f.fixable[0]??null;e.flow({recheck:{findingId:u.id,title:u.title,status:"fixed",nextId:v?.id??null,scoreBefore:h,scoreAfter:w}}),window.setTimeout(()=>{let L=e.get().flow;if(L.step!=="recheck"||L.recheck?.findingId!==u.id||L.recheck.status!=="fixed")return;let $=R(e.get());v&&$.fixable.some(y=>y.id===v.id)?e.flow({step:"fix",fixId:v.id,handoff:null}):e.flow({step:"ready",fixId:null,handoff:null}),c()},1600)}catch(f){e.flow({recheck:{findingId:u.id,title:u.title,status:"error",message:Y(f),scoreBefore:h}})}finally{e.set({busy:{...e.get().busy,scan:!1}})}},toggleChecklistItem(l){let u={...e.get().flow.checklist,[l]:!e.get().flow.checklist[l]};e.flow({checklist:u})},togglePrChecks(l){let u=l??!e.get().prChecks.open;e.set(h=>({prChecks:{...h.prChecks,open:u,error:null}})),u?queueMicrotask(()=>document.getElementById("pr-checks-action")?.focus({preventScroll:!0})):document.getElementById("pr-checks-button")?.focus({preventScroll:!0})},async addPrChecks(){if(!e.get().prChecks.busy){e.set(l=>({prChecks:{...l.prChecks,busy:!0,error:null}}));try{let l=await x.addGithubWorkflow();e.set(u=>({prChecks:{...u.prChecks,status:l.status,written:l.written,busy:!1}})),queueMicrotask(()=>document.getElementById("pr-checks-copy")?.focus({preventScroll:!0}))}catch(l){e.set(u=>({prChecks:{...u.prChecks,busy:!1,error:Y(l)}}))}}},async copyPrCommit(){let l=e.get().prChecks.status?.path??".github/workflows/viberaven.yml";try{await navigator.clipboard.writeText(`git add ${l} && git commit -m "Check pull requests with VibeRaven"`),e.toast("Copied. Run it, then push.")}catch{e.toast("Could not copy. Select the command and copy it by hand.","err")}},toggleMore(l){let u=l??!e.get().moreOpen;e.set({moreOpen:u}),u?queueMicrotask(()=>document.querySelector('#more-menu [role="menuitem"]')?.focus({preventScroll:!0})):document.getElementById("open-more")?.focus({preventScroll:!0})},openMore(l){if(e.set({moreOpen:!1}),l==="chat"){r();return}if(l==="services"){e.set({drawer:"services",agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}));return}e.set({drawer:l,agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))}};return p}function rs(){let e=document.getElementById("app");if(!e)return;let n=jt(ns()),t=is(n),r=()=>Nn(e,n,t);n.subscribe(r),r(),document.addEventListener("keydown",c=>{let o=n.get().fullCheck.step;if(c.key==="Escape"&&o!=="closed"){o!=="running"&&t.closeFullCheck();return}if(c.key==="Escape"&&n.get().moreOpen){t.toggleMore(!1);return}if(c.key==="Escape"&&n.get().prChecks.open){t.togglePrChecks(!1);return}if(c.key==="Escape"&&n.get().agentOpen){t.toggleAgent();return}c.key==="Escape"&&n.get().drawer&&t.toggleDrawer(null)}),document.addEventListener("pointerdown",c=>{!n.get().moreOpen||c.target?.closest("#more-menu, #open-more")||n.set({moreOpen:!1})});let s=()=>{let c=n.get();if(!c.catalog.length||c.setup.running||c.busy.chat)return;let o=On(window.location.hash,c.catalog.map(d=>d.id));o!==null&&(n.set({section:"stack",drawer:"services",agentOpen:!1,moreOpen:!1,setup:{...c.setup,open:!0,initialized:!0,selected:o,progress:[],error:null}}),history.replaceState(null,"",window.location.pathname+window.location.search),document.getElementById("stack-setup-heading")?.focus())};window.addEventListener("hashchange",s),x.catalog().then(c=>{n.set(o=>({catalog:c.providers,setup:o.setup.open&&!o.setup.initialized?{...o.setup,initialized:!0,selected:Lt(c.providers)}:o.setup})),s()}).catch(()=>{}),x.verified().then(c=>n.set({verified:c.verified})).catch(()=>{}),t.loadSavedFullCheck(),t.loadWork(),x.githubWorkflow().then(c=>n.set(o=>({prChecks:{...o.prChecks,status:c}}))).catch(()=>{}),x.agents().then(c=>{n.set({agents:c.agents.filter(d=>d.id==="codex"||d.id==="claude"||d.id==="gemini")});let o=c.agents.find(d=>d.id===n.get().cliId);if(o&&!o.installed){let d=c.agents.find(p=>p.installed);d&&n.set({cliId:d.id})}t.testConnection(n.get().cliId,{silent:!0})}).catch(()=>{});let a=async()=>{try{let c=await x.scanStatus();if(n.set({scan:c}),c.state==="running")window.setTimeout(a,1500);else if(c.state==="done"&&n.get().project.empty){let o=await x.project();n.set({project:o}),n.get().flow.step==="app"&&n.flow({step:lt(R(n.get()))})}}catch{}};a(),window.setInterval(()=>{En(document,n.get().workingSince)},1e3)}rs();})();
25
+ ${Un(w.stderr,1200)}`);e.flow({handoff:{findingId:u.id,cliId:h,status:L?"failed":"done",output:$}}),e.push({role:L?"error":"agent",text:$,cliId:h})}catch(g){e.flow({handoff:{findingId:u.id,cliId:h,status:"failed",output:Y(g)}})}finally{e.set({busy:{...e.get().busy,chat:!1},workingSince:null,runId:null})}},async copyFix(){let l=R(e.get()).current;if(l)try{await navigator.clipboard.writeText(l.prompt),e.toast("Prompt copied. Paste it into your coding agent.")}catch{e.toast("Could not copy. Select the prompt and copy it by hand.","err")}},async checkAgain(){let l=e.get(),u=R(l).current;if(!u||l.busy.scan)return;let h=l.project.gate?.score;e.flow({step:"recheck",recheck:{findingId:u.id,title:u.title,status:"running",scoreBefore:h}}),e.set({busy:{...e.get().busy,scan:!0}}),c();try{await S.scan(),await s();let f=R(e.get()),g=f.findings.find(L=>L.id===u.id),w=e.get().project.gate?.score;if(g){e.flow({recheck:{findingId:u.id,title:u.title,status:"open",message:g.summary,scoreBefore:h,scoreAfter:w}});return}let b=f.fixable[0]??null;e.flow({recheck:{findingId:u.id,title:u.title,status:"fixed",nextId:b?.id??null,scoreBefore:h,scoreAfter:w}}),window.setTimeout(()=>{let L=e.get().flow;if(L.step!=="recheck"||L.recheck?.findingId!==u.id||L.recheck.status!=="fixed")return;let $=R(e.get());b&&$.fixable.some(y=>y.id===b.id)?e.flow({step:"fix",fixId:b.id,handoff:null}):e.flow({step:"ready",fixId:null,handoff:null}),c()},1600)}catch(f){e.flow({recheck:{findingId:u.id,title:u.title,status:"error",message:Y(f),scoreBefore:h}})}finally{e.set({busy:{...e.get().busy,scan:!1}})}},toggleChecklistItem(l){let u={...e.get().flow.checklist,[l]:!e.get().flow.checklist[l]};e.flow({checklist:u})},togglePrChecks(l){let u=l??!e.get().prChecks.open;e.set(h=>({prChecks:{...h.prChecks,open:u,error:null}})),u?queueMicrotask(()=>document.getElementById("pr-checks-action")?.focus({preventScroll:!0})):document.getElementById("pr-checks-button")?.focus({preventScroll:!0})},async addPrChecks(){if(!e.get().prChecks.busy){e.set(l=>({prChecks:{...l.prChecks,busy:!0,error:null}}));try{let l=await S.addGithubWorkflow();e.set(u=>({prChecks:{...u.prChecks,status:l.status,written:l.written,busy:!1}})),queueMicrotask(()=>document.getElementById("pr-checks-copy")?.focus({preventScroll:!0}))}catch(l){e.set(u=>({prChecks:{...u.prChecks,busy:!1,error:Y(l)}}))}}},async copyPrCommit(){let l=e.get().prChecks.status?.path??".github/workflows/viberaven.yml";try{await navigator.clipboard.writeText(`git add ${l} && git commit -m "Check pull requests with VibeRaven"`),e.toast("Copied. Run it, then push.")}catch{e.toast("Could not copy. Select the command and copy it by hand.","err")}},toggleMore(l){let u=l??!e.get().moreOpen;e.set({moreOpen:u}),u?queueMicrotask(()=>document.querySelector('#more-menu [role="menuitem"]')?.focus({preventScroll:!0})):document.getElementById("open-more")?.focus({preventScroll:!0})},openMore(l){if(e.set({moreOpen:!1}),l==="chat"){r();return}if(l==="services"){e.set({drawer:"services",agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}));return}e.set({drawer:l,agentOpen:!1}),queueMicrotask(()=>document.getElementById("drawer-close")?.focus({preventScroll:!0}))}};return p}function as(){let e=document.getElementById("app");if(!e)return;let n=jt(rs()),t=ss(n),r=()=>Dn(e,n,t);n.subscribe(r),r(),document.addEventListener("keydown",c=>{let o=n.get().fullCheck.step;if(c.key==="Escape"&&o!=="closed"){o!=="running"&&t.closeFullCheck();return}if(c.key==="Escape"&&n.get().moreOpen){t.toggleMore(!1);return}if(c.key==="Escape"&&n.get().prChecks.open){t.togglePrChecks(!1);return}if(c.key==="Escape"&&n.get().agentOpen){t.toggleAgent();return}c.key==="Escape"&&n.get().drawer&&t.toggleDrawer(null)}),document.addEventListener("pointerdown",c=>{!n.get().moreOpen||c.target?.closest("#more-menu, #open-more")||n.set({moreOpen:!1})});let s=()=>{let c=n.get();if(!c.catalog.length||c.setup.running||c.busy.chat)return;let o=Rn(window.location.hash,c.catalog.map(d=>d.id));o!==null&&(n.set({section:"stack",drawer:"services",agentOpen:!1,moreOpen:!1,setup:{...c.setup,open:!0,initialized:!0,selected:o,progress:[],error:null}}),history.replaceState(null,"",window.location.pathname+window.location.search),document.getElementById("stack-setup-heading")?.focus())};window.addEventListener("hashchange",s),S.catalog().then(c=>{n.set(o=>({catalog:c.providers,setup:o.setup.open&&!o.setup.initialized?{...o.setup,initialized:!0,selected:Lt(c.providers)}:o.setup})),s()}).catch(()=>{}),S.verified().then(c=>n.set({verified:c.verified})).catch(()=>{}),t.loadSavedFullCheck(),t.loadWork(),S.githubWorkflow().then(c=>n.set(o=>({prChecks:{...o.prChecks,status:c}}))).catch(()=>{}),S.agents().then(c=>{n.set({agents:c.agents.filter(d=>d.id==="codex"||d.id==="claude"||d.id==="gemini")});let o=c.agents.find(d=>d.id===n.get().cliId);if(o&&!o.installed){let d=c.agents.find(p=>p.installed);d&&n.set({cliId:d.id})}t.testConnection(n.get().cliId,{silent:!0})}).catch(()=>{});let a=async()=>{try{let c=await S.scanStatus();if(n.set({scan:c}),c.state==="running")window.setTimeout(a,1500);else if(c.state==="done"&&n.get().project.empty){let o=await S.project();n.set({project:o}),n.get().flow.step==="app"&&n.flow({step:lt(R(n.get()))})}}catch{}};a(),window.setInterval(()=>{Pn(document,n.get().workingSince)},1e3)}as();})();