loki-mode 10.10.2 → 10.10.3
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/SKILL.md +2 -2
- package/VERSION +1 -1
- package/dashboard/__init__.py +1 -1
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/v10/BOARD.md +2 -0
- package/docs/v10/FAILURE-CLASSES.md +13 -0
- package/docs/v10/PROGRESS.md +9 -0
- package/docs/v10/cp-redesign/PARITY.md +188 -0
- package/docs/v10/cp-redesign/legacy/INDEX.md +1167 -0
- package/loki-ts/dist/loki.js +616 -614
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/packages/control-plane/dist/server.js +417 -336
- package/packages/control-plane/src/server/diffstat.ts +77 -0
- package/packages/control-plane/src/server/repos.ts +5 -2
- package/packages/control-plane/src/server/routes/index.ts +1 -1
- package/packages/control-plane/src/server/runs.ts +3 -1
- package/packages/control-plane/ui/dist/assets/index-D27veKDf.js +152 -0
- package/packages/control-plane/ui/dist/index.html +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-BvbxMtZO.js → AdminPage-Dyx5OHmP.js} +1 -1
- package/web-app/dist/assets/{Avatar-Dc7Scg02.js → Avatar-WVxt-kYj.js} +1 -1
- package/web-app/dist/assets/{Badge-BmVuOqbM.js → Badge-16vWJ-6u.js} +1 -1
- package/web-app/dist/assets/{Button-DvzqhxRU.js → Button-CWVPIMTW.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-D8AZo7Ha.js → CockpitPage-D5WhogJK.js} +1 -1
- package/web-app/dist/assets/{ComparePage-NmqaTXDz.js → ComparePage-CjJfjxcT.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-PGl8Kzoq.js → ErrorBoundary-CNnObh81.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-2NY4n9gv.js → EvidenceReceiptPanel-Cn1PE_JV.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-DBO_LHHM.js → GitHubIssuesPanel-CcH9neSU.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-K7m9uJ1N.js → GitHubPRsPanel-C-n6inCN.js} +1 -1
- package/web-app/dist/assets/{HomePage-qNQzAJxM.js → HomePage-BZ7PCPFR.js} +2 -2
- package/web-app/dist/assets/{LoginPage-esu3OK65.js → LoginPage-CJsigIUa.js} +1 -1
- package/web-app/dist/assets/{MagicPage-CCdVvXrA.js → MagicPage-ClZaKmXT.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-bEvugU2t.js → MetricsPage-ELQn9-cf.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-BlEjQ1wX.js → NotFoundPage-Dc_zp3RF.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-Bnug_Yzv.js → ProjectPage-B5K1NDuH.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-M8r1vfpn.js → ProjectsPage-C2l5SiIN.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-NqAJpB48.js → SettingsPage-DkDNp6Pd.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-8FggxL1P.js → ShowcasePage-1zasFSKz.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-3Sz3kFOO.js → SystemSettingsPage-hIm_4NUx.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-nV-6vdWM.js → TeamsPage-DUb_TA22.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-Brbc_VR9.js → TemplatesPage-B1mj-eA4.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-D1yta5ac.js → TerminalOutput-BX1UwelI.js} +1 -1
- package/web-app/dist/assets/{activity-oEeKuqFe.js → activity-B8APKMuh.js} +1 -1
- package/web-app/dist/assets/{bell-3NJtqBRR.js → bell-BS8WL-tI.js} +1 -1
- package/web-app/dist/assets/{bot-CuvJZ6x1.js → bot-e9I6yy12.js} +1 -1
- package/web-app/dist/assets/{check-n4289IZw.js → check-BbgR7Ovw.js} +1 -1
- package/web-app/dist/assets/{chevron-left-CmQeio7h.js → chevron-left-BcDqv7aX.js} +1 -1
- package/web-app/dist/assets/{circle-alert-CmmVW-Pd.js → circle-alert-BnDT8wxe.js} +1 -1
- package/web-app/dist/assets/{clock-QFqk7GlA.js → clock-LPz79lks.js} +1 -1
- package/web-app/dist/assets/{cloud-BNkSokmq.js → cloud-BcgBi5T1.js} +1 -1
- package/web-app/dist/assets/{code-xml-nWeketqj.js → code-xml-5zcykgva.js} +1 -1
- package/web-app/dist/assets/{database-C83MXTmJ.js → database-D9KLqhHq.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-Blg6TO4y.js → dollar-sign-CrINoZ4o.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-Tk11oUzm.js → file-code-corner-CA7G72ip.js} +1 -1
- package/web-app/dist/assets/{file-plus-DF_eyA6I.js → file-plus-D8tHdHn_.js} +1 -1
- package/web-app/dist/assets/{globe-D5hDqqmn.js → globe-CT0Ts5bO.js} +1 -1
- package/web-app/dist/assets/{hammer-C2hm9lzl.js → hammer-tUpu0LJk.js} +1 -1
- package/web-app/dist/assets/{index-pMxOIwXq.js → index-DdjeiWUI.js} +3 -3
- package/web-app/dist/assets/{layers-XWQKGXg0.js → layers-BzzJ7w3C.js} +1 -1
- package/web-app/dist/assets/{loader-circle-BRuvorm2.js → loader-circle-BBdMdxIV.js} +1 -1
- package/web-app/dist/assets/{lock-BSGvQf5v.js → lock-Cg9DkEh7.js} +1 -1
- package/web-app/dist/assets/{package-3FJYUYgJ.js → package-DHs8IEJR.js} +1 -1
- package/web-app/dist/assets/{plus-CeIx6g9P.js → plus-70JSAqB1.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-ChutW42g.js → refresh-cw-DjggkboT.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-BdSjUAk-.js → rotate-ccw-c1NNyyL5.js} +1 -1
- package/web-app/dist/assets/{scroll-text-BjFqxpw3.js → scroll-text-B49wQrJ2.js} +1 -1
- package/web-app/dist/assets/{server-C7UEKdol.js → server-BHKG-dDi.js} +1 -1
- package/web-app/dist/assets/{shield-alert-DY8fpEs7.js → shield-alert-Dx9MoBGm.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-Cz1san1g.js → thumbs-up-frEbS59j.js} +1 -1
- package/web-app/dist/assets/{trash-2-D2MvGYeP.js → trash-2-1Gd8pXFG.js} +1 -1
- package/web-app/dist/assets/{trending-down-CxO3OYOB.js → trending-down-BpUeO-FP.js} +1 -1
- package/web-app/dist/assets/{trending-up-DCHKPJLe.js → trending-up-CvhWp8qO.js} +1 -1
- package/web-app/dist/assets/{upload-CdPJpSHC.js → upload-DZuMugqd.js} +1 -1
- package/web-app/dist/assets/{usePolling-DAH6K3ST.js → usePolling-D5KUSkfs.js} +1 -1
- package/web-app/dist/assets/{user-Byyt01W4.js → user-BF9vws84.js} +1 -1
- package/web-app/dist/index.html +1 -1
- package/packages/control-plane/ui/dist/assets/index-BrA22FUs.js +0 -152
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,r,j as e,U as w,X as $,h as D,y as H,a as A,x as q,p as K,g as O,M as X,R as Y,l as G,a1 as J,a2 as Q}from"./index-
|
|
1
|
+
import{c as M,r,j as e,U as w,X as $,h as D,y as H,a as A,x as q,p as K,g as O,M as X,R as Y,l as G,a1 as J,a2 as Q}from"./index-DdjeiWUI.js";import{B as k}from"./Button-CWVPIMTW.js";import{U as I,M as W,A as S}from"./Avatar-WVxt-kYj.js";import{L as Z}from"./lock-Cg9DkEh7.js";import{A as b}from"./activity-B8APKMuh.js";import{U as ee}from"./user-BF9vws84.js";import{C as R}from"./clock-LPz79lks.js";import{F as te}from"./file-code-corner-CA7G72ip.js";import{F as se}from"./file-plus-D8tHdHn_.js";import{H as ae}from"./hammer-tUpu0LJk.js";import{P as re}from"./plus-70JSAqB1.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as F,r as n,j as e,p as M,w as B,R as D,u as O,a as G,X as z,y as Y,F as C,v as Q,J as H,A as q,m as I,i as V}from"./index-
|
|
1
|
+
import{c as F,r as n,j as e,p as M,w as B,R as D,u as O,a as G,X as z,y as Y,F as C,v as Q,J as H,A as q,m as I,i as V}from"./index-DdjeiWUI.js";import{B as N}from"./Button-CWVPIMTW.js";import{u as J}from"./usePolling-D5KUSkfs.js";import{C as K}from"./chevron-left-BcDqv7aX.js";import{C as T}from"./clock-LPz79lks.js";import{L as X}from"./layers-BzzJ7w3C.js";import{C as S}from"./check-BbgR7Ovw.js";import{P}from"./package-DHs8IEJR.js";import{G as Z}from"./globe-CT0Ts5bO.js";import{S as ee}from"./server-BHKG-dDi.js";import{B as te}from"./bot-e9I6yy12.js";import{D as se}from"./database-D9KLqhHq.js";import{P as ie}from"./plus-70JSAqB1.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as j,r as i,j as e}from"./index-
|
|
1
|
+
import{c as j,r as i,j as e}from"./index-DdjeiWUI.js";import{L as w}from"./lock-Cg9DkEh7.js";/**
|
|
2
2
|
* @license lucide-react v0.577.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-BZ7PCPFR.js","assets/usePolling-D5KUSkfs.js","assets/ErrorBoundary-CNnObh81.js","assets/TerminalOutput-BX1UwelI.js","assets/lock-Cg9DkEh7.js","assets/EvidenceReceiptPanel-Cn1PE_JV.js","assets/Badge-16vWJ-6u.js","assets/clock-LPz79lks.js","assets/circle-alert-BnDT8wxe.js","assets/check-BbgR7Ovw.js","assets/package-DHs8IEJR.js","assets/cloud-BcgBi5T1.js","assets/code-xml-5zcykgva.js","assets/hammer-tUpu0LJk.js","assets/layers-BzzJ7w3C.js","assets/bell-BS8WL-tI.js","assets/file-code-corner-CA7G72ip.js","assets/ProjectPage-B5K1NDuH.js","assets/Button-CWVPIMTW.js","assets/file-plus-D8tHdHn_.js","assets/activity-B8APKMuh.js","assets/scroll-text-B49wQrJ2.js","assets/bot-e9I6yy12.js","assets/loader-circle-BBdMdxIV.js","assets/dollar-sign-CrINoZ4o.js","assets/refresh-cw-DjggkboT.js","assets/globe-CT0Ts5bO.js","assets/trash-2-1Gd8pXFG.js","assets/thumbs-up-frEbS59j.js","assets/upload-DZuMugqd.js","assets/plus-70JSAqB1.js","assets/rotate-ccw-c1NNyyL5.js","assets/trending-up-CvhWp8qO.js","assets/trending-down-BpUeO-FP.js","assets/server-BHKG-dDi.js","assets/ProjectPage-9CEnUXvW.css","assets/CockpitPage-D5WhogJK.js","assets/ProjectsPage-C2l5SiIN.js","assets/TemplatesPage-B1mj-eA4.js","assets/chevron-left-BcDqv7aX.js","assets/database-D9KLqhHq.js","assets/SettingsPage-DkDNp6Pd.js","assets/TeamsPage-DUb_TA22.js","assets/Avatar-WVxt-kYj.js","assets/user-BF9vws84.js","assets/AdminPage-Dyx5OHmP.js","assets/shield-alert-Dx9MoBGm.js","assets/SystemSettingsPage-hIm_4NUx.js","assets/MetricsPage-ELQn9-cf.js","assets/MagicPage-ClZaKmXT.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var bg=Object.defineProperty;var Sg=(i,o,r)=>o in i?bg(i,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[o]=r;var _u=(i,o,r)=>Sg(i,typeof o!="symbol"?o+"":o,r);(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))s(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&s(p)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function s(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();function xg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var er={exports:{}},Nu={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -353,7 +353,7 @@ Please change the parent <Route path="${G}"> to <Route path="${G==="/"?"*":`${G}
|
|
|
353
353
|
*
|
|
354
354
|
* This source code is licensed under the ISC license.
|
|
355
355
|
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const Ib=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Wb=$("zap",Ib),wr="/lab/".replace(/\/$/,""),rc=`${window.location.origin}${wr}/api`,Pb=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${wr}/ws`,ix=wr;function my(){const i={"Content-Type":"application/json"};try{const o=localStorage.getItem("pl_auth_token");o&&(i.Authorization=`Bearer ${o}`)}catch{}return i}async function H(i,o){const r=await fetch(`${rc}${i}`,{...o,headers:{...my(),...o==null?void 0:o.headers}});if(!r.ok){const d=await r.text().catch(()=>"");throw new Error(`API error ${r.status}: ${r.statusText}${d?` - ${d}`:""}`)}if(!(r.headers.get("content-type")||"").includes("application/json"))throw new Error("API endpoint not available. Please restart the server with the latest version.");return r.json()}const _n={listProofs:()=>H("/proofs"),proofsSummary:()=>H("/proofs/summary"),getProof:i=>H(`/proofs/${encodeURIComponent(i)}`),startSession:i=>H("/session/start",{method:"POST",body:JSON.stringify(i)}),quickStart:(i,o="claude")=>H("/session/quick-start",{method:"POST",body:JSON.stringify({prompt:i,provider:o})}),stopSession:()=>H("/session/stop",{method:"POST"}),pauseSession:()=>H("/session/pause",{method:"POST"}),resumeSession:()=>H("/session/resume",{method:"POST"}),getPrdPrefill:()=>H("/session/prd-prefill"),getStatus:()=>H("/session/status"),getAgents:()=>H("/session/agents"),getLogs:(i=200)=>H(`/session/logs?lines=${i}`),getMemorySummary:()=>H("/session/memory"),getChecklist:()=>H("/session/checklist"),getFiles:()=>H("/session/files"),getFileContent:i=>H(`/session/files/content?path=${encodeURIComponent(i)}`),getSessionFileContent:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/file?path=${encodeURIComponent(o)}`),getTemplates:()=>H("/templates"),getTemplateContent:i=>H(`/templates/${encodeURIComponent(i)}`),planSession:(i,o)=>H("/session/plan",{method:"POST",body:JSON.stringify({prd:i,provider:o})}),generateReport:(i="markdown")=>H("/session/report",{method:"POST",body:JSON.stringify({format:i})}),shareSession:()=>H("/session/share",{method:"POST"}),getCurrentProvider:()=>H("/provider/current"),setProvider:i=>H("/provider/set",{method:"POST",body:JSON.stringify({provider:i})}),getMetrics:()=>H("/session/metrics"),getSessionsHistory:()=>H("/sessions/history"),getSessionDetail:i=>H(`/sessions/${encodeURIComponent(i)}`),deleteSession:i=>H(`/sessions/${encodeURIComponent(i)}`,{method:"DELETE"}),onboardRepo:i=>H("/session/onboard",{method:"POST",body:JSON.stringify({path:i})}),saveSessionFile:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"PUT",body:JSON.stringify({path:o,content:r})}),createSessionFile:(i,o,r="")=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"POST",body:JSON.stringify({path:o,content:r})}),deleteSessionFile:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"DELETE",body:JSON.stringify({path:o})}),createSessionDirectory:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/directory`,{method:"POST",body:JSON.stringify({path:o})}),reviewProject:i=>H(`/sessions/${encodeURIComponent(i)}/review`,{method:"POST"}),testProject:i=>H(`/sessions/${encodeURIComponent(i)}/test`,{method:"POST"}),explainProject:i=>H(`/sessions/${encodeURIComponent(i)}/explain`,{method:"POST"}),exportProject:i=>H(`/sessions/${encodeURIComponent(i)}/export`,{method:"POST"}),fixProject:i=>H(`/sessions/${encodeURIComponent(i)}/fix`,{method:"POST"}),chatMessage:(i,o,r="quick")=>H(`/sessions/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify({message:o,mode:r})}),chatStart:(i,o,r="quick",s)=>H(`/sessions/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify({message:o,mode:r,history:s})}),chatPoll:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}`),chatStreamUrl:(i,o)=>`${rc}/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}/stream`,chatCancel:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}/cancel`,{method:"POST"}),getPreviewInfo:i=>H(`/sessions/${encodeURIComponent(i)}/preview-info`),devserver:{start:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/devserver/start`,{method:"POST",body:JSON.stringify({command:o||null})}),stop:i=>H(`/sessions/${encodeURIComponent(i)}/devserver/stop`,{method:"POST"}),status:i=>H(`/sessions/${encodeURIComponent(i)}/devserver/status`)},getSecrets:()=>H("/secrets"),setSecret:(i,o)=>H("/secrets",{method:"POST",body:JSON.stringify({key:i,value:o})}),deleteSecret:i=>H(`/secrets/${encodeURIComponent(i)}`,{method:"DELETE"}),getServices:i=>H(`/sessions/${encodeURIComponent(i)}/services`),getTeams:()=>H("/teams"),createTeam:i=>H("/teams",{method:"POST",body:JSON.stringify({name:i})}),getTeamMembers:i=>H(`/teams/${encodeURIComponent(i)}/members`),addTeamMember:(i,o,r)=>H(`/teams/${encodeURIComponent(i)}/members`,{method:"POST",body:JSON.stringify({email:o,role:r})}),getCost:()=>H("/cost"),getCostTimeline:()=>H("/cost/timeline"),getAuditLog:()=>H("/audit-log"),getServiceLogs:(i,o,r=50)=>H(`/sessions/${encodeURIComponent(i)}/devserver/logs?${new URLSearchParams({...o?{service:o}:{},tail:String(r)}).toString()}`),getCheckpoints:i=>H(`/sessions/${encodeURIComponent(i)}/checkpoints`),restoreCheckpoint:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/checkpoints/${encodeURIComponent(o)}/restore`,{method:"POST"}),previewChanges:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/preview`,{method:"POST",body:JSON.stringify({message:o})}),searchFiles:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/files/search?q=${encodeURIComponent(o)}`),restartService:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/devserver/restart-service`,{method:"POST",body:JSON.stringify({service:o})}),deployProject:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/deploy`,{method:"POST",body:JSON.stringify({platform:o})}),githubPush:i=>H(`/sessions/${encodeURIComponent(i)}/github/push`,{method:"POST"}),getGitHubIssues:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/issues?${new URLSearchParams({...o?{state:o}:{},...r?{limit:String(r)}:{}}).toString()}`),getGitHubIssue:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/issues/${o}`),fixGitHubIssue:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/issues/${o}/fix`,{method:"POST"}),getGitHubPRs:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/prs?${new URLSearchParams({...o?{state:o}:{},...r?{limit:String(r)}:{}}).toString()}`),getGitHubPR:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}`),getGitHubPRDiff:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/diff`),reviewGitHubPR:(i,o,r,s)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/review`,{method:"POST",body:JSON.stringify({action:r,body:s})}),mergeGitHubPR:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/merge`,{method:"POST",body:JSON.stringify({method:r})}),getWorkflowRuns:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs?${new URLSearchParams({...o?{limit:String(o)}:{}}).toString()}`),getWorkflowRunDetail:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}`),getWorkflowRunLogs:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/logs`),getWorkflows:i=>H(`/sessions/${encodeURIComponent(i)}/github/actions/workflows`),dispatchWorkflow:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/dispatch`,{method:"POST",body:JSON.stringify({workflow:o,ref:r})}),rerunWorkflow:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/rerun`,{method:"POST"}),cancelWorkflow:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/cancel`,{method:"POST"}),importGitHubRepo:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/import`,{method:"POST",body:JSON.stringify({repo:o,...r?{branch:r}:{}})}),getDeployStatus:()=>H("/deploy/status"),connectVercel:i=>H("/deploy/vercel/token",{method:"POST",body:JSON.stringify({token:i})}),connectNetlify:i=>H("/deploy/netlify/token",{method:"POST",body:JSON.stringify({token:i})}),disconnectPlatform:i=>H(`/deploy/${encodeURIComponent(i)}/disconnect`,{method:"POST"}),getMe:()=>H("/auth/me"),getGitHubAuthUrl:()=>H("/auth/github/url"),getGoogleAuthUrl:()=>H("/auth/google/url"),githubCallback:(i,o)=>H("/auth/github/callback",{method:"POST",body:JSON.stringify({code:i,state:o})}),googleCallback:(i,o,r)=>H("/auth/google/callback",{method:"POST",body:JSON.stringify({code:i,state:o,redirect_uri:r||`${window.location.origin}${window.location.pathname}`})}),git:{status:i=>H(`/sessions/${encodeURIComponent(i)}/git/status`),log:(i,o=20)=>H(`/sessions/${encodeURIComponent(i)}/git/log?limit=${o}`),branches:i=>H(`/sessions/${encodeURIComponent(i)}/git/branches`),commit:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/git/commit`,{method:"POST",body:JSON.stringify({message:o,files:r})}),createBranch:(i,o,r=!0)=>H(`/sessions/${encodeURIComponent(i)}/git/branch`,{method:"POST",body:JSON.stringify({name:o,checkout:r})}),checkoutBranch:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/git/checkout`,{method:"POST",body:JSON.stringify({name:o})}),push:i=>H(`/sessions/${encodeURIComponent(i)}/git/push`,{method:"POST"}),pr:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/git/pr`,{method:"POST",body:JSON.stringify({title:o,body:r})})},generateDocs:i=>H(`/sessions/${encodeURIComponent(i)}/docs/generate`,{method:"POST"}),getDocsStatus:i=>H(`/sessions/${encodeURIComponent(i)}/docs/status`),getDocFiles:i=>H(`/sessions/${encodeURIComponent(i)}/docs/files`),getDocFileContent:async(i,o)=>{const r=await fetch(`${rc}/sessions/${encodeURIComponent(i)}/docs/files/${encodeURIComponent(o)}`,{headers:my()});if(!r.ok)throw new Error(`API error ${r.status}: ${r.statusText}`);return r.text()},chatImageUpload:async(i,o)=>{const r=new FormData;r.append("image",o);const s=await fetch(`${rc}/sessions/${encodeURIComponent(i)}/chat/image`,{method:"POST",headers:{...(()=>{const d={};try{const m=localStorage.getItem("pl_auth_token");m&&(d.Authorization=`Bearer ${m}`)}catch{}return d})()},body:r});if(!s.ok){const d=await s.text().catch(()=>"");throw new Error(`API error ${s.status}: ${s.statusText}${d?` - ${d}`:""}`)}return s.json()}};class eS{constructor(o){_u(this,"ws",null);_u(this,"listeners",new Map);_u(this,"reconnectTimer",null);_u(this,"url");this.url=o||Pb}connect(){var o;((o=this.ws)==null?void 0:o.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.emit("connected",{message:"WebSocket connected"})},this.ws.onmessage=r=>{try{const s=JSON.parse(r.data);if(s.type==="ping"){this.send({type:"pong"});return}this.emit(s.type,s.data||s)}catch{}},this.ws.onclose=()=>{this.emit("disconnected",{}),this.scheduleReconnect()},this.ws.onerror=()=>{var r;(r=this.ws)==null||r.close()})}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},3e3))}on(o,r){return this.listeners.has(o)||this.listeners.set(o,new Set),this.listeners.get(o).add(r),()=>{var s;return(s=this.listeners.get(o))==null?void 0:s.delete(r)}}emit(o,r){var s,d;(s=this.listeners.get(o))==null||s.forEach(m=>m(r)),(d=this.listeners.get("*"))==null||d.forEach(m=>m({type:o,data:r}))}send(o){var r;((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(o))}disconnect(){var o;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(o=this.ws)==null||o.close(),this.ws=null}}const rr="pl_auth_token",yy=g.createContext({user:null,loading:!0,login:()=>{},logout:()=>{},isLocalMode:!0});function tS(i,o,r){o(!1),r({email:i.sub||i.email||"",name:i.name||"",avatar_url:i.avatar||"",authenticated:!0})}function lS({children:i}){const[o,r]=g.useState(null),[s,d]=g.useState(!0),[m,p]=g.useState(!0),S=Tr(),C=kt();g.useEffect(()=>{let j=!1;async function U(){const B=new URLSearchParams(window.location.search),D=B.get("token"),q=B.get("code");if(D)localStorage.setItem(rr,D),window.history.replaceState({},"",window.location.pathname);else if(q)try{const G=sessionStorage.getItem("pl_oauth_provider")||"github",F=sessionStorage.getItem("pl_oauth_state")||"";sessionStorage.removeItem("pl_oauth_state"),sessionStorage.removeItem("pl_oauth_provider");let ee;if(G==="google"?ee=await _n.googleCallback(q,F):ee=await _n.githubCallback(q,F),!j){localStorage.setItem(rr,ee.token),window.history.replaceState({},"",window.location.pathname),p(!1),r({email:ee.user.email,name:ee.user.name,avatar_url:ee.user.avatar_url,authenticated:!0}),d(!1);return}}catch{window.history.replaceState({},"",window.location.pathname)}try{const G=await _n.getMe();if(j)return;G.local_mode?(p(!0),r(null)):G.authenticated?tS(G,p,r):(p(!1),r(null))}catch{if(j)return;p(!0),r(null)}finally{j||d(!1)}}return U(),()=>{j=!0}},[]);const z=g.useCallback(j=>{j==="github"?_n.getGitHubAuthUrl().then(U=>{try{const D=new URL(U.url).searchParams.get("state");D&&(sessionStorage.setItem("pl_oauth_state",D),sessionStorage.setItem("pl_oauth_provider","github"))}catch{}window.location.href=U.url}).catch(()=>{}):j==="google"&&_n.getGoogleAuthUrl().then(U=>{try{const D=new URL(U.url).searchParams.get("state");D&&(sessionStorage.setItem("pl_oauth_state",D),sessionStorage.setItem("pl_oauth_provider","google"))}catch{}window.location.href=U.url}).catch(()=>{})},[]),x=g.useCallback(()=>{localStorage.removeItem(rr),r(null),C.pathname!=="/login"&&S("/login",{replace:!0})},[S,C.pathname]),y=g.useMemo(()=>({user:o,loading:s,login:z,logout:x,isLocalMode:m}),[o,s,z,x,m]);return h.jsx(yy.Provider,{value:y,children:i})}function vy(){return g.useContext(yy)}function aS(){const[i,o]=g.useState(()=>typeof window>"u"?"light":localStorage.getItem("pl_theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"));g.useEffect(()=>{document.documentElement.classList.toggle("dark",i==="dark"),localStorage.setItem("pl_theme",i)},[i]);const r=g.useCallback(()=>{o(s=>s==="light"?"dark":"light")},[]);return{theme:i,toggleTheme:r,isDark:i==="dark"}}const gy="pl_discovered_features";function py(){try{const i=localStorage.getItem(gy);if(i)return new Set(JSON.parse(i))}catch{}return new Set}function nS(i){try{localStorage.setItem(gy,JSON.stringify([...i]))}catch{}}function uS(i){const o=py();o.has(i)||(o.add(i),nS(o),window.dispatchEvent(new CustomEvent("pl_feature_discovered",{detail:i})))}function iS({feature:i,className:o=""}){const[r,s]=g.useState(!0);return g.useEffect(()=>{s(py().has(i))},[i]),g.useEffect(()=>{const d=m=>{m.detail===i&&s(!0)};return window.addEventListener("pl_feature_discovered",d),()=>window.removeEventListener("pl_feature_discovered",d)},[i]),r?null:h.jsxs("span",{className:`relative inline-flex ${o}`,"aria-hidden":"true",children:[h.jsx("span",{className:"absolute inline-flex h-2.5 w-2.5 rounded-full bg-primary/40 animate-ping"}),h.jsx("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-primary"})]})}const by="pl_getting_started_steps",C0="pl_getting_started_dismissed",R0="pl_getting_started_collapsed",z0=[{id:"create_project",label:"Create your first project",description:"Describe what you want to build or pick a template to get started.",icon:ry},{id:"try_chat",label:"Try the AI chat",description:"Ask the AI to modify, explain, or improve your code.",icon:Ar},{id:"preview_app",label:"Preview your app",description:"Open the Preview tab to see your application running live.",icon:sy},{id:"explore_templates",label:"Explore templates",description:"Browse the template gallery for inspiration and quick starts.",icon:Or},{id:"deploy_app",label:"Deploy your app",description:"Push your project live with one click using the Deploy tab.",icon:jr}];function O0(){try{const i=localStorage.getItem(by);if(i)return new Set(JSON.parse(i))}catch{}return new Set}function cS(i){try{localStorage.setItem(by,JSON.stringify([...i]))}catch{}}function oS(){const[i,o]=g.useState(!1),[r,s]=g.useState(!1),[d,m]=g.useState(new Set);g.useEffect(()=>{try{if(localStorage.getItem(C0)==="1"){o(!0);return}s(localStorage.getItem(R0)==="1")}catch{}m(O0())},[]),g.useEffect(()=>{const U=()=>m(O0());return window.addEventListener("pl_step_complete",U),()=>window.removeEventListener("pl_step_complete",U)},[]);const p=g.useCallback(U=>{m(B=>{const D=new Set(B);return D.has(U)?D.delete(U):D.add(U),cS(D),D})},[]),S=()=>{o(!0);try{localStorage.setItem(C0,"1")}catch{}},C=()=>{s(U=>{const B=!U;try{localStorage.setItem(R0,B?"1":"0")}catch{}return B})};if(i)return null;const z=d.size,x=z0.length,y=z/x*100,j=z===x;return h.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[h.jsxs("button",{onClick:C,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-hover transition-colors",children:[h.jsx(ib,{size:16,className:"text-primary flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-heading font-bold text-ink",children:"Getting Started"}),h.jsxs("span",{className:"text-[11px] text-muted-accessible font-mono",children:[z,"/",x]})]}),h.jsx("div",{className:"h-1 bg-border rounded-full mt-1.5 overflow-hidden",children:h.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-500",style:{width:`${y}%`}})})]}),h.jsx("div",{className:"flex items-center gap-1",children:r?h.jsx(R2,{size:14,className:"text-muted"}):h.jsx(cy,{size:14,className:"text-muted"})})]}),!r&&h.jsxs("div",{className:"border-t border-border",children:[h.jsx("div",{className:"px-3 py-2 space-y-0.5",children:z0.map(U=>{const B=d.has(U.id),D=U.icon;return h.jsxs("button",{onClick:()=>p(U.id),className:`w-full flex items-start gap-3 px-3 py-2.5 rounded-lg text-left transition-colors ${B?"opacity-60 hover:opacity-80":"hover:bg-hover"}`,children:[h.jsx("div",{className:"mt-0.5 flex-shrink-0",children:B?h.jsx(w2,{size:16,className:"text-success"}):h.jsx(B2,{size:16,className:"text-border"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:`text-xs font-medium ${B?"text-muted line-through":"text-ink"}`,children:U.label}),!B&&h.jsx("p",{className:"text-[11px] text-muted-accessible mt-0.5 leading-relaxed",children:U.description})]}),h.jsx(D,{size:14,className:`flex-shrink-0 mt-0.5 ${B?"text-muted":"text-primary/50"}`})]},U.id)})}),h.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border",children:[j?h.jsx("span",{className:"text-xs text-success font-medium",children:"All done -- you are ready to build!"}):h.jsx("span",{className:"text-[11px] text-muted",children:"Complete each step to learn the basics."}),h.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors",children:[h.jsx(ja,{size:11}),"Dismiss"]})]})]})]})}const A0="pl_sidebar_collapsed",sS=[{to:"/",label:"Home",icon:eb},{to:"/projects",label:"Projects",icon:Z2},{to:"/templates",label:"Templates",icon:Or,discoveryFeature:"templates"},{to:"/showcase",label:"Showcase",icon:Mr},{to:"/magic",label:"Magic",icon:Kb},{to:"/metrics",label:"Metrics",icon:N2},{to:"/compare",label:"Compare",icon:W2},{to:"/teams",label:"Teams",icon:Vb}],rS=[{to:"/settings",label:"Settings",icon:hy},{to:"/admin",label:"Admin",icon:zb},{to:"/admin/settings",label:"System",icon:$b}];function fS(){const[i,o]=g.useState(typeof window<"u"?window.innerWidth<768:!1);return g.useEffect(()=>{const r=()=>o(window.innerWidth<768);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),i}function dS({wsConnected:i,version:o,onOpenDocs:r}){const s=fS(),d=kt(),{theme:m,toggleTheme:p}=aS(),[S,C]=g.useState(!1),[z,x]=g.useState(()=>{try{return localStorage.getItem(A0)==="1"}catch{return!1}});g.useEffect(()=>{try{localStorage.setItem(A0,z?"1":"0")}catch{}},[z]),g.useEffect(()=>{s&&C(!1)},[d.pathname,s]);const y=s?S:!z,j=y?240:64,U=D=>["flex items-center gap-3 px-3 py-2 text-sm transition-colors rounded-[5px]",!y&&"justify-center",D?"bg-[#553DE9]/8 text-[#553DE9] font-medium border-l-2 border-[#553DE9]":"text-[#36342E] hover:bg-[#F8F4F0]"].filter(Boolean).join(" "),B=h.jsxs("aside",{className:"flex flex-col h-full border-r border-[#ECEAE3] bg-white transition-[width] duration-200",style:{width:j,minWidth:j},children:[h.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-[#ECEAE3]",children:[y&&h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-heading text-lg font-bold leading-tight text-[#36342E]",children:"Purple Lab"}),h.jsx("span",{className:"text-xs text-[#6B6960]",children:"Powered by Loki"})]}),s?h.jsx("button",{type:"button","aria-label":S?"Close menu":"Open menu",title:S?"Close menu":"Open menu",onClick:()=>C(!S),className:"inline-flex items-center justify-center w-7 h-7 rounded-[3px] text-[#939084] hover:bg-[#F8F4F0] transition-colors",children:S?h.jsx(ja,{size:16}):h.jsx(rb,{size:16})}):h.jsx("button",{type:"button","aria-label":z?"Expand sidebar":"Collapse sidebar",title:z?"Expand sidebar":"Collapse sidebar",onClick:()=>x(!z),className:"inline-flex items-center justify-center w-7 h-7 rounded-[3px] text-[#939084] hover:bg-[#F8F4F0] transition-colors",children:z?h.jsx(xb,{size:16}):h.jsx(bb,{size:16})})]}),h.jsxs("nav",{className:"flex-1 px-2 py-3 flex flex-col gap-1","aria-label":"Main navigation",children:[sS.map(D=>h.jsxs(dc,{to:D.to,end:D.to==="/",className:({isActive:q})=>U(q),title:y?void 0:D.label,onClick:()=>{D.discoveryFeature&&uS(D.discoveryFeature)},children:[h.jsxs("div",{className:"relative",children:[h.jsx(D.icon,{size:18}),D.discoveryFeature&&h.jsx(iS,{feature:D.discoveryFeature,className:"absolute -top-1 -right-1"})]}),y&&h.jsx("span",{children:D.label})]},D.to)),h.jsx("div",{className:"my-2 border-t border-[#ECEAE3]"}),rS.map(D=>h.jsxs(dc,{to:D.to,className:({isActive:q})=>U(q),title:y?void 0:D.label,children:[h.jsx(D.icon,{size:18}),y&&h.jsx("span",{children:D.label})]},D.to)),y&&h.jsx("div",{className:"mt-3 px-1",children:h.jsx(oS,{})})]}),h.jsxs("div",{className:"px-3 py-3 border-t border-[#ECEAE3] flex flex-col gap-2",children:[h.jsx(hS,{collapsed:!y}),h.jsxs("div",{className:["flex items-center gap-2 text-xs",!y&&"justify-center"].filter(Boolean).join(" "),children:[h.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${i?"bg-[#1FC5A8]":"bg-[#C45B5B]"}`}),y&&h.jsx("span",{className:"text-[#6B6960]",children:i?"Connected":"Disconnected"})]}),y&&o&&h.jsxs("span",{className:"text-xs text-[#6B6960]",children:["v",o]}),h.jsxs("button",{onClick:p,title:m==="dark"?"Light mode":"Dark mode",className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),children:[m==="dark"?h.jsx(Lb,{size:14}):h.jsx(yb,{size:14}),y&&h.jsx("span",{children:m==="dark"?"Light Mode":"Dark Mode"})]}),h.jsxs("button",{onClick:r,className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),title:y?void 0:"Help & Docs",children:[h.jsx(oy,{size:14}),y&&h.jsx("span",{children:"Help & Docs"})]}),h.jsxs("a",{href:"https://www.autonomi.dev/docs",target:"_blank",rel:"noopener noreferrer",className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),title:y?void 0:"Documentation",children:[h.jsx(iy,{size:14}),y&&h.jsx("span",{children:"Docs"})]})]})]});return s&&S?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40 bg-ink/20",onClick:()=>C(!1)}),h.jsx("div",{className:"fixed inset-y-0 left-0 z-50",children:B})]}):B}function hS({collapsed:i}){const{user:o,logout:r,isLocalMode:s}=vy(),[d,m]=g.useState(!1),p=g.useRef(null);return g.useEffect(()=>{function S(C){p.current&&!p.current.contains(C.target)&&m(!1)}if(d)return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[d]),s||!o?h.jsxs("div",{className:["flex items-center gap-2 text-xs",i&&"justify-center"].filter(Boolean).join(" "),title:i?"Local Mode":void 0,children:[h.jsx(hb,{size:14,className:"text-[#939084] flex-shrink-0"}),!i&&h.jsx("span",{className:"text-[#939084]",children:"Local Mode"})]}):h.jsxs("div",{className:"relative",ref:p,"data-testid":"user-section",children:[h.jsxs("button",{type:"button",onClick:()=>m(!d),className:["flex items-center gap-2 w-full text-left text-xs rounded-[3px] py-1 px-1 hover:bg-[#F8F4F0] transition-colors",i&&"justify-center"].filter(Boolean).join(" "),title:i?o.name||o.email:void 0,children:[o.avatar_url?h.jsx("img",{src:o.avatar_url,alt:"",className:"w-5 h-5 rounded-full flex-shrink-0"}):h.jsx("div",{className:"w-5 h-5 rounded-full bg-[#553DE9] flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",children:(o.name||o.email||"?")[0].toUpperCase()}),!i&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-[#36342E] truncate flex-1",children:o.name||o.email}),h.jsx(cy,{size:12,className:`text-[#939084] transition-transform ${d?"":"rotate-180"}`})]})]}),d&&h.jsxs("div",{className:"absolute bottom-full left-0 mb-1 w-48 bg-white border border-[#ECEAE3] rounded-lg shadow-lg py-1 z-50",children:[h.jsxs("div",{className:"px-3 py-2 border-b border-[#ECEAE3]",children:[h.jsx("p",{className:"text-xs font-medium text-[#36342E] truncate",children:o.name}),h.jsx("p",{className:"text-xs text-[#939084] truncate",children:o.email})]}),h.jsxs(dc,{to:"/settings",onClick:()=>m(!1),className:"flex items-center gap-2 px-3 py-2 text-xs text-[#36342E] hover:bg-[#F8F4F0] transition-colors",children:[h.jsx(hy,{size:14}),"Settings"]}),h.jsxs("button",{type:"button",onClick:()=>{m(!1),r()},className:"flex items-center gap-2 px-3 py-2 text-xs text-[#C45B5B] hover:bg-[#F8F4F0] transition-colors w-full text-left",children:[h.jsx(ob,{size:14}),"Sign out"]})]})]})}const Nn=[];function mS(i){if(i.key==="Escape"&&Nn.length>0){i.preventDefault(),i.stopPropagation();const o=Nn[Nn.length-1];o()}}let j0=!1;function yS(){j0||(document.addEventListener("keydown",mS),j0=!0)}function vS(i,o){const r=g.useRef(o);r.current=o;const s=g.useCallback(()=>{r.current()},[]);g.useEffect(()=>{if(i)return yS(),Nn.push(s),()=>{const d=Nn.indexOf(s);d!==-1&&Nn.splice(d,1)}},[i,s])}const M0=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function gS(i){const o=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{if(!i)return;r.current=document.activeElement;const s=o.current;if(!s)return;const d=s.querySelectorAll(M0);d.length>0&&requestAnimationFrame(()=>d[0].focus());const m=p=>{if(p.key!=="Tab")return;const S=s.querySelectorAll(M0);if(S.length===0)return;const C=S[0],z=S[S.length-1];p.shiftKey?document.activeElement===C&&(p.preventDefault(),z.focus()):document.activeElement===z&&(p.preventDefault(),C.focus())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),r.current&&typeof r.current.focus=="function"&&r.current.focus()}},[i]),o}const w0="pl_onboarding_complete",zu=[{icon:ry,title:"Write your spec",description:"Describe what you want to build, or choose a template to get started quickly."},{icon:qb,title:"Use the terminal",description:"Run commands directly in the integrated terminal to install dependencies or debug."},{icon:sy,title:"Preview in real-time",description:"Switch to the Preview tab to see your app running with live reload."},{icon:Ar,title:"Iterate with AI Chat",description:"Ask the AI to modify, fix, or explain your code in the chat panel."}];function pS(){const[i,o]=g.useState(!1),[r,s]=g.useState(0),d=gS(i);vS(i,()=>{i&&m()}),g.useEffect(()=>{try{localStorage.getItem(w0)!=="1"&&o(!0)}catch{}},[]);const m=()=>{o(!1);try{localStorage.setItem(w0,"1")}catch{}},p=()=>{r<zu.length-1?s(r+1):m()};if(!i)return null;const S=zu[r],C=S.icon;return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/30",children:h.jsxs("div",{ref:d,className:"bg-card rounded-card shadow-card-hover border border-border w-full max-w-sm mx-4",children:[h.jsxs("div",{className:"flex items-center justify-between px-5 pt-5 pb-2",children:[h.jsxs("span",{className:"text-[11px] font-mono text-muted-accessible",children:[r+1," / ",zu.length]}),h.jsx("button",{onClick:m,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Skip onboarding",children:h.jsx(ja,{size:14})})]}),h.jsxs("div",{className:"px-5 pb-4 text-center",children:[h.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:h.jsx(C,{size:24,className:"text-primary"})}),h.jsx("h3",{className:"text-sm font-heading font-bold text-ink mb-1",children:S.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed",children:S.description})]}),h.jsx("div",{className:"flex items-center justify-center gap-1.5 pb-4",children:zu.map((z,x)=>h.jsx("div",{className:`w-1.5 h-1.5 rounded-full transition-colors ${x===r?"bg-primary":"bg-border"}`},x))}),h.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border",children:[h.jsx("button",{onClick:m,className:"text-xs text-muted hover:text-ink transition-colors",children:"Skip"}),h.jsx("button",{onClick:p,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:r<zu.length-1?h.jsxs(h.Fragment,{children:["Next",h.jsx(uy,{size:12})]}):"Get Started"})]})]})})}const D0="pl_product_tour_complete",bS=[{target:'[data-tour="input-box"]',title:"Describe what you want to build",description:"Type a plain-English description of your project here. The more detail you give, the better the result. You can also paste a spec / PRD or select a template.",position:"bottom"},{target:'[data-tour="template-gallery"]',title:"Start from a template",description:"Browse ready-made templates for SaaS apps, landing pages, dashboards, and more. Each template gives you a head start with a proven structure.",position:"bottom"},{target:'[data-tour="build-progress"]',title:"Watch your project come to life",description:"Once you start a build, this bar tracks each phase: planning, building, testing, and reviewing. You will see real-time progress and cost estimates.",position:"bottom"},{target:'[data-tour="preview-tab"]',title:"Preview your running app",description:"Switch to the Preview tab to see your application running live. Changes appear in real time as the AI iterates on your code.",position:"bottom"},{target:'[data-tour="deploy-tab"]',title:"Deploy with one click",description:"When you are happy with the result, head to the Deploy tab to push your project live. Supports Vercel, Netlify, and GitHub Pages.",position:"bottom"}];function SS(i){const o=document.querySelector(i);return o?o.getBoundingClientRect():null}function xS(i,o){if(!i)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const r=16,s={position:"fixed",zIndex:60};switch(o){case"bottom":s.top=i.bottom+r,s.left=i.left+i.width/2,s.transform="translateX(-50%)";break;case"top":s.bottom=window.innerHeight-i.top+r,s.left=i.left+i.width/2,s.transform="translateX(-50%)";break;case"left":s.top=i.top+i.height/2,s.right=window.innerWidth-i.left+r,s.transform="translateY(-50%)";break;case"right":s.top=i.top+i.height/2,s.left=i.right+r,s.transform="translateY(-50%)";break}return s}function ES({steps:i=bS,onComplete:o}){const[r,s]=g.useState(!1),[d,m]=g.useState(0),[p,S]=g.useState(null),C=g.useRef(0);g.useEffect(()=>{try{if(localStorage.getItem(D0)!=="1"){const B=setTimeout(()=>s(!0),800);return()=>clearTimeout(B)}}catch{}},[]),g.useEffect(()=>{if(!r||!i[d])return;const B=()=>{const D=SS(i[d].target);S(D),C.current=requestAnimationFrame(B)};return B(),()=>cancelAnimationFrame(C.current)},[r,d,i]);const z=g.useCallback(()=>{s(!1);try{localStorage.setItem(D0,"1")}catch{}o==null||o()},[o]),x=g.useCallback(()=>{d<i.length-1?m(B=>B+1):z()},[d,i.length,z]),y=g.useCallback(()=>{m(B=>Math.max(0,B-1))},[]);if(g.useEffect(()=>{if(!r)return;const B=D=>{D.key==="Escape"&&z(),D.key==="ArrowRight"&&x(),D.key==="ArrowLeft"&&y()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[r,z,x,y]),!r||!i[d])return null;const j=i[d],U=8;return h.jsxs("div",{className:"fixed inset-0 z-[55]","aria-modal":"true",role:"dialog",children:[h.jsxs("svg",{className:"absolute inset-0 w-full h-full",onClick:z,style:{zIndex:55},children:[h.jsx("defs",{children:h.jsxs("mask",{id:"tour-spotlight",children:[h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),p&&h.jsx("rect",{x:p.left-U,y:p.top-U,width:p.width+U*2,height:p.height+U*2,rx:"8",fill:"black"})]})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"rgba(0,0,0,0.55)",mask:"url(#tour-spotlight)"})]}),p&&h.jsx("div",{className:"absolute border-2 border-primary rounded-lg pointer-events-none shadow-[0_0_20px_rgba(85,61,233,0.3)]",style:{left:p.left-U,top:p.top-U,width:p.width+U*2,height:p.height+U*2,zIndex:56}}),h.jsxs("div",{className:"w-80 bg-card rounded-xl shadow-2xl border border-border p-0 overflow-hidden",style:{...xS(p,j.position),zIndex:57},onClick:B=>B.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pt-4 pb-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Mr,{size:14,className:"text-primary"}),h.jsxs("span",{className:"text-[11px] font-mono text-muted-accessible",children:["Step ",d+1," of ",i.length]})]}),h.jsx("button",{onClick:z,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Skip tour",children:h.jsx(ja,{size:14})})]}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsx("h3",{className:"text-sm font-heading font-bold text-ink mb-1",children:j.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed",children:j.description})]}),h.jsx("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:i.map((B,D)=>h.jsx("button",{onClick:()=>m(D),className:`w-2 h-2 rounded-full transition-all ${D===d?"bg-primary scale-110":D<d?"bg-primary/40":"bg-border"}`,"aria-label":`Go to step ${D+1}`},D))}),h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-border bg-hover/30",children:[h.jsxs("button",{onClick:z,className:"flex items-center gap-1 text-xs text-muted hover:text-ink transition-colors",children:[h.jsx(Mb,{size:12}),"Skip tour"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[d>0&&h.jsxs("button",{onClick:y,className:"flex items-center gap-1 px-3 py-1.5 text-xs font-medium rounded-btn text-ink hover:bg-hover transition-colors",children:[h.jsx(ny,{size:12}),"Back"]}),h.jsx("button",{onClick:x,className:"flex items-center gap-1 px-4 py-1.5 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:d<i.length-1?h.jsxs(h.Fragment,{children:["Next",h.jsx(uy,{size:12})]}):"Let's go!"})]})]})]})]})}const U0="pl_whats_new_version",fr="10.10.2",TS=[{icon:Mr,title:"Product Tour",description:"New step-by-step guided tour for first-time users. Highlights key UI areas so you never feel lost."},{icon:gb,title:"Contextual Help Tooltips",description:"Hover over the help icons next to complex features to learn what they do without leaving the page."},{icon:fy,title:"Enhanced Keyboard Shortcuts",description:'Press "?" to open the shortcuts overlay. Shortcuts are now grouped by category with search and filtering.'},{icon:Wb,title:"Getting Started Checklist",description:"A friendly checklist guides you through your first project, from writing a spec to deploying your app."},{icon:Ab,title:"In-App Documentation",description:"Browse Quick Start guides, FAQ, and template docs right inside Purple Lab, no context switching required."}];function _S(){const[i,o]=g.useState(!1);g.useEffect(()=>{try{if(localStorage.getItem(U0)!==fr){const d=setTimeout(()=>o(!0),1200);return()=>clearTimeout(d)}}catch{}},[]);const r=()=>{o(!1);try{localStorage.setItem(U0,fr)}catch{}};return i?h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/30",onClick:r,children:h.jsxs("div",{className:"bg-card rounded-xl shadow-2xl border border-border w-full max-w-md mx-4 overflow-hidden",onClick:s=>s.stopPropagation(),children:[h.jsxs("div",{className:"relative px-6 pt-6 pb-4 text-center border-b border-border bg-gradient-to-b from-primary/5 to-transparent",children:[h.jsx("button",{onClick:r,className:"absolute top-4 right-4 text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Close",children:h.jsx(ja,{size:14})}),h.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3",children:h.jsx(J2,{size:24,className:"text-primary"})}),h.jsx("h2",{className:"text-lg font-heading font-bold text-ink",children:"What's New"}),h.jsxs("p",{className:"text-xs text-muted-accessible mt-1",children:["Purple Lab v",fr]})]}),h.jsx("div",{className:"px-4 py-4 space-y-3 max-h-[320px] overflow-y-auto terminal-scroll",children:TS.map(s=>{const d=s.icon;return h.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg hover:bg-hover transition-colors",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:h.jsx(d,{size:16,className:"text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"text-sm font-medium text-ink",children:s.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed mt-0.5",children:s.description})]})]},s.title)})}),h.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[h.jsxs("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-primary hover:text-primary-hover transition-colors",children:["Full changelog",h.jsx(k2,{size:11})]}),h.jsx("button",{onClick:r,className:"px-5 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:"Got it!"})]})]})}):null}const dr=[{id:"quick-start",title:"Quick Start",icon:jr,content:`# Quick Start
|
|
356
|
+
*/const Ib=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Wb=$("zap",Ib),wr="/lab/".replace(/\/$/,""),rc=`${window.location.origin}${wr}/api`,Pb=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${wr}/ws`,ix=wr;function my(){const i={"Content-Type":"application/json"};try{const o=localStorage.getItem("pl_auth_token");o&&(i.Authorization=`Bearer ${o}`)}catch{}return i}async function H(i,o){const r=await fetch(`${rc}${i}`,{...o,headers:{...my(),...o==null?void 0:o.headers}});if(!r.ok){const d=await r.text().catch(()=>"");throw new Error(`API error ${r.status}: ${r.statusText}${d?` - ${d}`:""}`)}if(!(r.headers.get("content-type")||"").includes("application/json"))throw new Error("API endpoint not available. Please restart the server with the latest version.");return r.json()}const _n={listProofs:()=>H("/proofs"),proofsSummary:()=>H("/proofs/summary"),getProof:i=>H(`/proofs/${encodeURIComponent(i)}`),startSession:i=>H("/session/start",{method:"POST",body:JSON.stringify(i)}),quickStart:(i,o="claude")=>H("/session/quick-start",{method:"POST",body:JSON.stringify({prompt:i,provider:o})}),stopSession:()=>H("/session/stop",{method:"POST"}),pauseSession:()=>H("/session/pause",{method:"POST"}),resumeSession:()=>H("/session/resume",{method:"POST"}),getPrdPrefill:()=>H("/session/prd-prefill"),getStatus:()=>H("/session/status"),getAgents:()=>H("/session/agents"),getLogs:(i=200)=>H(`/session/logs?lines=${i}`),getMemorySummary:()=>H("/session/memory"),getChecklist:()=>H("/session/checklist"),getFiles:()=>H("/session/files"),getFileContent:i=>H(`/session/files/content?path=${encodeURIComponent(i)}`),getSessionFileContent:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/file?path=${encodeURIComponent(o)}`),getTemplates:()=>H("/templates"),getTemplateContent:i=>H(`/templates/${encodeURIComponent(i)}`),planSession:(i,o)=>H("/session/plan",{method:"POST",body:JSON.stringify({prd:i,provider:o})}),generateReport:(i="markdown")=>H("/session/report",{method:"POST",body:JSON.stringify({format:i})}),shareSession:()=>H("/session/share",{method:"POST"}),getCurrentProvider:()=>H("/provider/current"),setProvider:i=>H("/provider/set",{method:"POST",body:JSON.stringify({provider:i})}),getMetrics:()=>H("/session/metrics"),getSessionsHistory:()=>H("/sessions/history"),getSessionDetail:i=>H(`/sessions/${encodeURIComponent(i)}`),deleteSession:i=>H(`/sessions/${encodeURIComponent(i)}`,{method:"DELETE"}),onboardRepo:i=>H("/session/onboard",{method:"POST",body:JSON.stringify({path:i})}),saveSessionFile:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"PUT",body:JSON.stringify({path:o,content:r})}),createSessionFile:(i,o,r="")=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"POST",body:JSON.stringify({path:o,content:r})}),deleteSessionFile:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/file`,{method:"DELETE",body:JSON.stringify({path:o})}),createSessionDirectory:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/directory`,{method:"POST",body:JSON.stringify({path:o})}),reviewProject:i=>H(`/sessions/${encodeURIComponent(i)}/review`,{method:"POST"}),testProject:i=>H(`/sessions/${encodeURIComponent(i)}/test`,{method:"POST"}),explainProject:i=>H(`/sessions/${encodeURIComponent(i)}/explain`,{method:"POST"}),exportProject:i=>H(`/sessions/${encodeURIComponent(i)}/export`,{method:"POST"}),fixProject:i=>H(`/sessions/${encodeURIComponent(i)}/fix`,{method:"POST"}),chatMessage:(i,o,r="quick")=>H(`/sessions/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify({message:o,mode:r})}),chatStart:(i,o,r="quick",s)=>H(`/sessions/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify({message:o,mode:r,history:s})}),chatPoll:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}`),chatStreamUrl:(i,o)=>`${rc}/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}/stream`,chatCancel:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/${encodeURIComponent(o)}/cancel`,{method:"POST"}),getPreviewInfo:i=>H(`/sessions/${encodeURIComponent(i)}/preview-info`),devserver:{start:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/devserver/start`,{method:"POST",body:JSON.stringify({command:o||null})}),stop:i=>H(`/sessions/${encodeURIComponent(i)}/devserver/stop`,{method:"POST"}),status:i=>H(`/sessions/${encodeURIComponent(i)}/devserver/status`)},getSecrets:()=>H("/secrets"),setSecret:(i,o)=>H("/secrets",{method:"POST",body:JSON.stringify({key:i,value:o})}),deleteSecret:i=>H(`/secrets/${encodeURIComponent(i)}`,{method:"DELETE"}),getServices:i=>H(`/sessions/${encodeURIComponent(i)}/services`),getTeams:()=>H("/teams"),createTeam:i=>H("/teams",{method:"POST",body:JSON.stringify({name:i})}),getTeamMembers:i=>H(`/teams/${encodeURIComponent(i)}/members`),addTeamMember:(i,o,r)=>H(`/teams/${encodeURIComponent(i)}/members`,{method:"POST",body:JSON.stringify({email:o,role:r})}),getCost:()=>H("/cost"),getCostTimeline:()=>H("/cost/timeline"),getAuditLog:()=>H("/audit-log"),getServiceLogs:(i,o,r=50)=>H(`/sessions/${encodeURIComponent(i)}/devserver/logs?${new URLSearchParams({...o?{service:o}:{},tail:String(r)}).toString()}`),getCheckpoints:i=>H(`/sessions/${encodeURIComponent(i)}/checkpoints`),restoreCheckpoint:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/checkpoints/${encodeURIComponent(o)}/restore`,{method:"POST"}),previewChanges:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/chat/preview`,{method:"POST",body:JSON.stringify({message:o})}),searchFiles:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/files/search?q=${encodeURIComponent(o)}`),restartService:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/devserver/restart-service`,{method:"POST",body:JSON.stringify({service:o})}),deployProject:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/deploy`,{method:"POST",body:JSON.stringify({platform:o})}),githubPush:i=>H(`/sessions/${encodeURIComponent(i)}/github/push`,{method:"POST"}),getGitHubIssues:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/issues?${new URLSearchParams({...o?{state:o}:{},...r?{limit:String(r)}:{}}).toString()}`),getGitHubIssue:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/issues/${o}`),fixGitHubIssue:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/issues/${o}/fix`,{method:"POST"}),getGitHubPRs:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/prs?${new URLSearchParams({...o?{state:o}:{},...r?{limit:String(r)}:{}}).toString()}`),getGitHubPR:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}`),getGitHubPRDiff:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/diff`),reviewGitHubPR:(i,o,r,s)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/review`,{method:"POST",body:JSON.stringify({action:r,body:s})}),mergeGitHubPR:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/prs/${o}/merge`,{method:"POST",body:JSON.stringify({method:r})}),getWorkflowRuns:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs?${new URLSearchParams({...o?{limit:String(o)}:{}}).toString()}`),getWorkflowRunDetail:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}`),getWorkflowRunLogs:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/logs`),getWorkflows:i=>H(`/sessions/${encodeURIComponent(i)}/github/actions/workflows`),dispatchWorkflow:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/dispatch`,{method:"POST",body:JSON.stringify({workflow:o,ref:r})}),rerunWorkflow:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/rerun`,{method:"POST"}),cancelWorkflow:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/github/actions/runs/${o}/cancel`,{method:"POST"}),importGitHubRepo:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/github/import`,{method:"POST",body:JSON.stringify({repo:o,...r?{branch:r}:{}})}),getDeployStatus:()=>H("/deploy/status"),connectVercel:i=>H("/deploy/vercel/token",{method:"POST",body:JSON.stringify({token:i})}),connectNetlify:i=>H("/deploy/netlify/token",{method:"POST",body:JSON.stringify({token:i})}),disconnectPlatform:i=>H(`/deploy/${encodeURIComponent(i)}/disconnect`,{method:"POST"}),getMe:()=>H("/auth/me"),getGitHubAuthUrl:()=>H("/auth/github/url"),getGoogleAuthUrl:()=>H("/auth/google/url"),githubCallback:(i,o)=>H("/auth/github/callback",{method:"POST",body:JSON.stringify({code:i,state:o})}),googleCallback:(i,o,r)=>H("/auth/google/callback",{method:"POST",body:JSON.stringify({code:i,state:o,redirect_uri:r||`${window.location.origin}${window.location.pathname}`})}),git:{status:i=>H(`/sessions/${encodeURIComponent(i)}/git/status`),log:(i,o=20)=>H(`/sessions/${encodeURIComponent(i)}/git/log?limit=${o}`),branches:i=>H(`/sessions/${encodeURIComponent(i)}/git/branches`),commit:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/git/commit`,{method:"POST",body:JSON.stringify({message:o,files:r})}),createBranch:(i,o,r=!0)=>H(`/sessions/${encodeURIComponent(i)}/git/branch`,{method:"POST",body:JSON.stringify({name:o,checkout:r})}),checkoutBranch:(i,o)=>H(`/sessions/${encodeURIComponent(i)}/git/checkout`,{method:"POST",body:JSON.stringify({name:o})}),push:i=>H(`/sessions/${encodeURIComponent(i)}/git/push`,{method:"POST"}),pr:(i,o,r)=>H(`/sessions/${encodeURIComponent(i)}/git/pr`,{method:"POST",body:JSON.stringify({title:o,body:r})})},generateDocs:i=>H(`/sessions/${encodeURIComponent(i)}/docs/generate`,{method:"POST"}),getDocsStatus:i=>H(`/sessions/${encodeURIComponent(i)}/docs/status`),getDocFiles:i=>H(`/sessions/${encodeURIComponent(i)}/docs/files`),getDocFileContent:async(i,o)=>{const r=await fetch(`${rc}/sessions/${encodeURIComponent(i)}/docs/files/${encodeURIComponent(o)}`,{headers:my()});if(!r.ok)throw new Error(`API error ${r.status}: ${r.statusText}`);return r.text()},chatImageUpload:async(i,o)=>{const r=new FormData;r.append("image",o);const s=await fetch(`${rc}/sessions/${encodeURIComponent(i)}/chat/image`,{method:"POST",headers:{...(()=>{const d={};try{const m=localStorage.getItem("pl_auth_token");m&&(d.Authorization=`Bearer ${m}`)}catch{}return d})()},body:r});if(!s.ok){const d=await s.text().catch(()=>"");throw new Error(`API error ${s.status}: ${s.statusText}${d?` - ${d}`:""}`)}return s.json()}};class eS{constructor(o){_u(this,"ws",null);_u(this,"listeners",new Map);_u(this,"reconnectTimer",null);_u(this,"url");this.url=o||Pb}connect(){var o;((o=this.ws)==null?void 0:o.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{this.emit("connected",{message:"WebSocket connected"})},this.ws.onmessage=r=>{try{const s=JSON.parse(r.data);if(s.type==="ping"){this.send({type:"pong"});return}this.emit(s.type,s.data||s)}catch{}},this.ws.onclose=()=>{this.emit("disconnected",{}),this.scheduleReconnect()},this.ws.onerror=()=>{var r;(r=this.ws)==null||r.close()})}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},3e3))}on(o,r){return this.listeners.has(o)||this.listeners.set(o,new Set),this.listeners.get(o).add(r),()=>{var s;return(s=this.listeners.get(o))==null?void 0:s.delete(r)}}emit(o,r){var s,d;(s=this.listeners.get(o))==null||s.forEach(m=>m(r)),(d=this.listeners.get("*"))==null||d.forEach(m=>m({type:o,data:r}))}send(o){var r;((r=this.ws)==null?void 0:r.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(o))}disconnect(){var o;this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(o=this.ws)==null||o.close(),this.ws=null}}const rr="pl_auth_token",yy=g.createContext({user:null,loading:!0,login:()=>{},logout:()=>{},isLocalMode:!0});function tS(i,o,r){o(!1),r({email:i.sub||i.email||"",name:i.name||"",avatar_url:i.avatar||"",authenticated:!0})}function lS({children:i}){const[o,r]=g.useState(null),[s,d]=g.useState(!0),[m,p]=g.useState(!0),S=Tr(),C=kt();g.useEffect(()=>{let j=!1;async function U(){const B=new URLSearchParams(window.location.search),D=B.get("token"),q=B.get("code");if(D)localStorage.setItem(rr,D),window.history.replaceState({},"",window.location.pathname);else if(q)try{const G=sessionStorage.getItem("pl_oauth_provider")||"github",F=sessionStorage.getItem("pl_oauth_state")||"";sessionStorage.removeItem("pl_oauth_state"),sessionStorage.removeItem("pl_oauth_provider");let ee;if(G==="google"?ee=await _n.googleCallback(q,F):ee=await _n.githubCallback(q,F),!j){localStorage.setItem(rr,ee.token),window.history.replaceState({},"",window.location.pathname),p(!1),r({email:ee.user.email,name:ee.user.name,avatar_url:ee.user.avatar_url,authenticated:!0}),d(!1);return}}catch{window.history.replaceState({},"",window.location.pathname)}try{const G=await _n.getMe();if(j)return;G.local_mode?(p(!0),r(null)):G.authenticated?tS(G,p,r):(p(!1),r(null))}catch{if(j)return;p(!0),r(null)}finally{j||d(!1)}}return U(),()=>{j=!0}},[]);const z=g.useCallback(j=>{j==="github"?_n.getGitHubAuthUrl().then(U=>{try{const D=new URL(U.url).searchParams.get("state");D&&(sessionStorage.setItem("pl_oauth_state",D),sessionStorage.setItem("pl_oauth_provider","github"))}catch{}window.location.href=U.url}).catch(()=>{}):j==="google"&&_n.getGoogleAuthUrl().then(U=>{try{const D=new URL(U.url).searchParams.get("state");D&&(sessionStorage.setItem("pl_oauth_state",D),sessionStorage.setItem("pl_oauth_provider","google"))}catch{}window.location.href=U.url}).catch(()=>{})},[]),x=g.useCallback(()=>{localStorage.removeItem(rr),r(null),C.pathname!=="/login"&&S("/login",{replace:!0})},[S,C.pathname]),y=g.useMemo(()=>({user:o,loading:s,login:z,logout:x,isLocalMode:m}),[o,s,z,x,m]);return h.jsx(yy.Provider,{value:y,children:i})}function vy(){return g.useContext(yy)}function aS(){const[i,o]=g.useState(()=>typeof window>"u"?"light":localStorage.getItem("pl_theme")||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"));g.useEffect(()=>{document.documentElement.classList.toggle("dark",i==="dark"),localStorage.setItem("pl_theme",i)},[i]);const r=g.useCallback(()=>{o(s=>s==="light"?"dark":"light")},[]);return{theme:i,toggleTheme:r,isDark:i==="dark"}}const gy="pl_discovered_features";function py(){try{const i=localStorage.getItem(gy);if(i)return new Set(JSON.parse(i))}catch{}return new Set}function nS(i){try{localStorage.setItem(gy,JSON.stringify([...i]))}catch{}}function uS(i){const o=py();o.has(i)||(o.add(i),nS(o),window.dispatchEvent(new CustomEvent("pl_feature_discovered",{detail:i})))}function iS({feature:i,className:o=""}){const[r,s]=g.useState(!0);return g.useEffect(()=>{s(py().has(i))},[i]),g.useEffect(()=>{const d=m=>{m.detail===i&&s(!0)};return window.addEventListener("pl_feature_discovered",d),()=>window.removeEventListener("pl_feature_discovered",d)},[i]),r?null:h.jsxs("span",{className:`relative inline-flex ${o}`,"aria-hidden":"true",children:[h.jsx("span",{className:"absolute inline-flex h-2.5 w-2.5 rounded-full bg-primary/40 animate-ping"}),h.jsx("span",{className:"relative inline-flex h-2.5 w-2.5 rounded-full bg-primary"})]})}const by="pl_getting_started_steps",C0="pl_getting_started_dismissed",R0="pl_getting_started_collapsed",z0=[{id:"create_project",label:"Create your first project",description:"Describe what you want to build or pick a template to get started.",icon:ry},{id:"try_chat",label:"Try the AI chat",description:"Ask the AI to modify, explain, or improve your code.",icon:Ar},{id:"preview_app",label:"Preview your app",description:"Open the Preview tab to see your application running live.",icon:sy},{id:"explore_templates",label:"Explore templates",description:"Browse the template gallery for inspiration and quick starts.",icon:Or},{id:"deploy_app",label:"Deploy your app",description:"Push your project live with one click using the Deploy tab.",icon:jr}];function O0(){try{const i=localStorage.getItem(by);if(i)return new Set(JSON.parse(i))}catch{}return new Set}function cS(i){try{localStorage.setItem(by,JSON.stringify([...i]))}catch{}}function oS(){const[i,o]=g.useState(!1),[r,s]=g.useState(!1),[d,m]=g.useState(new Set);g.useEffect(()=>{try{if(localStorage.getItem(C0)==="1"){o(!0);return}s(localStorage.getItem(R0)==="1")}catch{}m(O0())},[]),g.useEffect(()=>{const U=()=>m(O0());return window.addEventListener("pl_step_complete",U),()=>window.removeEventListener("pl_step_complete",U)},[]);const p=g.useCallback(U=>{m(B=>{const D=new Set(B);return D.has(U)?D.delete(U):D.add(U),cS(D),D})},[]),S=()=>{o(!0);try{localStorage.setItem(C0,"1")}catch{}},C=()=>{s(U=>{const B=!U;try{localStorage.setItem(R0,B?"1":"0")}catch{}return B})};if(i)return null;const z=d.size,x=z0.length,y=z/x*100,j=z===x;return h.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-sm overflow-hidden",children:[h.jsxs("button",{onClick:C,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-hover transition-colors",children:[h.jsx(ib,{size:16,className:"text-primary flex-shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-heading font-bold text-ink",children:"Getting Started"}),h.jsxs("span",{className:"text-[11px] text-muted-accessible font-mono",children:[z,"/",x]})]}),h.jsx("div",{className:"h-1 bg-border rounded-full mt-1.5 overflow-hidden",children:h.jsx("div",{className:"h-full bg-primary rounded-full transition-all duration-500",style:{width:`${y}%`}})})]}),h.jsx("div",{className:"flex items-center gap-1",children:r?h.jsx(R2,{size:14,className:"text-muted"}):h.jsx(cy,{size:14,className:"text-muted"})})]}),!r&&h.jsxs("div",{className:"border-t border-border",children:[h.jsx("div",{className:"px-3 py-2 space-y-0.5",children:z0.map(U=>{const B=d.has(U.id),D=U.icon;return h.jsxs("button",{onClick:()=>p(U.id),className:`w-full flex items-start gap-3 px-3 py-2.5 rounded-lg text-left transition-colors ${B?"opacity-60 hover:opacity-80":"hover:bg-hover"}`,children:[h.jsx("div",{className:"mt-0.5 flex-shrink-0",children:B?h.jsx(w2,{size:16,className:"text-success"}):h.jsx(B2,{size:16,className:"text-border"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:`text-xs font-medium ${B?"text-muted line-through":"text-ink"}`,children:U.label}),!B&&h.jsx("p",{className:"text-[11px] text-muted-accessible mt-0.5 leading-relaxed",children:U.description})]}),h.jsx(D,{size:14,className:`flex-shrink-0 mt-0.5 ${B?"text-muted":"text-primary/50"}`})]},U.id)})}),h.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border",children:[j?h.jsx("span",{className:"text-xs text-success font-medium",children:"All done -- you are ready to build!"}):h.jsx("span",{className:"text-[11px] text-muted",children:"Complete each step to learn the basics."}),h.jsxs("button",{onClick:S,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors",children:[h.jsx(ja,{size:11}),"Dismiss"]})]})]})]})}const A0="pl_sidebar_collapsed",sS=[{to:"/",label:"Home",icon:eb},{to:"/projects",label:"Projects",icon:Z2},{to:"/templates",label:"Templates",icon:Or,discoveryFeature:"templates"},{to:"/showcase",label:"Showcase",icon:Mr},{to:"/magic",label:"Magic",icon:Kb},{to:"/metrics",label:"Metrics",icon:N2},{to:"/compare",label:"Compare",icon:W2},{to:"/teams",label:"Teams",icon:Vb}],rS=[{to:"/settings",label:"Settings",icon:hy},{to:"/admin",label:"Admin",icon:zb},{to:"/admin/settings",label:"System",icon:$b}];function fS(){const[i,o]=g.useState(typeof window<"u"?window.innerWidth<768:!1);return g.useEffect(()=>{const r=()=>o(window.innerWidth<768);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),i}function dS({wsConnected:i,version:o,onOpenDocs:r}){const s=fS(),d=kt(),{theme:m,toggleTheme:p}=aS(),[S,C]=g.useState(!1),[z,x]=g.useState(()=>{try{return localStorage.getItem(A0)==="1"}catch{return!1}});g.useEffect(()=>{try{localStorage.setItem(A0,z?"1":"0")}catch{}},[z]),g.useEffect(()=>{s&&C(!1)},[d.pathname,s]);const y=s?S:!z,j=y?240:64,U=D=>["flex items-center gap-3 px-3 py-2 text-sm transition-colors rounded-[5px]",!y&&"justify-center",D?"bg-[#553DE9]/8 text-[#553DE9] font-medium border-l-2 border-[#553DE9]":"text-[#36342E] hover:bg-[#F8F4F0]"].filter(Boolean).join(" "),B=h.jsxs("aside",{className:"flex flex-col h-full border-r border-[#ECEAE3] bg-white transition-[width] duration-200",style:{width:j,minWidth:j},children:[h.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-[#ECEAE3]",children:[y&&h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"font-heading text-lg font-bold leading-tight text-[#36342E]",children:"Purple Lab"}),h.jsx("span",{className:"text-xs text-[#6B6960]",children:"Powered by Loki"})]}),s?h.jsx("button",{type:"button","aria-label":S?"Close menu":"Open menu",title:S?"Close menu":"Open menu",onClick:()=>C(!S),className:"inline-flex items-center justify-center w-7 h-7 rounded-[3px] text-[#939084] hover:bg-[#F8F4F0] transition-colors",children:S?h.jsx(ja,{size:16}):h.jsx(rb,{size:16})}):h.jsx("button",{type:"button","aria-label":z?"Expand sidebar":"Collapse sidebar",title:z?"Expand sidebar":"Collapse sidebar",onClick:()=>x(!z),className:"inline-flex items-center justify-center w-7 h-7 rounded-[3px] text-[#939084] hover:bg-[#F8F4F0] transition-colors",children:z?h.jsx(xb,{size:16}):h.jsx(bb,{size:16})})]}),h.jsxs("nav",{className:"flex-1 px-2 py-3 flex flex-col gap-1","aria-label":"Main navigation",children:[sS.map(D=>h.jsxs(dc,{to:D.to,end:D.to==="/",className:({isActive:q})=>U(q),title:y?void 0:D.label,onClick:()=>{D.discoveryFeature&&uS(D.discoveryFeature)},children:[h.jsxs("div",{className:"relative",children:[h.jsx(D.icon,{size:18}),D.discoveryFeature&&h.jsx(iS,{feature:D.discoveryFeature,className:"absolute -top-1 -right-1"})]}),y&&h.jsx("span",{children:D.label})]},D.to)),h.jsx("div",{className:"my-2 border-t border-[#ECEAE3]"}),rS.map(D=>h.jsxs(dc,{to:D.to,className:({isActive:q})=>U(q),title:y?void 0:D.label,children:[h.jsx(D.icon,{size:18}),y&&h.jsx("span",{children:D.label})]},D.to)),y&&h.jsx("div",{className:"mt-3 px-1",children:h.jsx(oS,{})})]}),h.jsxs("div",{className:"px-3 py-3 border-t border-[#ECEAE3] flex flex-col gap-2",children:[h.jsx(hS,{collapsed:!y}),h.jsxs("div",{className:["flex items-center gap-2 text-xs",!y&&"justify-center"].filter(Boolean).join(" "),children:[h.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${i?"bg-[#1FC5A8]":"bg-[#C45B5B]"}`}),y&&h.jsx("span",{className:"text-[#6B6960]",children:i?"Connected":"Disconnected"})]}),y&&o&&h.jsxs("span",{className:"text-xs text-[#6B6960]",children:["v",o]}),h.jsxs("button",{onClick:p,title:m==="dark"?"Light mode":"Dark mode",className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),children:[m==="dark"?h.jsx(Lb,{size:14}):h.jsx(yb,{size:14}),y&&h.jsx("span",{children:m==="dark"?"Light Mode":"Dark Mode"})]}),h.jsxs("button",{onClick:r,className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),title:y?void 0:"Help & Docs",children:[h.jsx(oy,{size:14}),y&&h.jsx("span",{children:"Help & Docs"})]}),h.jsxs("a",{href:"https://www.autonomi.dev/docs",target:"_blank",rel:"noopener noreferrer",className:["flex items-center gap-2 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",!y&&"justify-center"].filter(Boolean).join(" "),title:y?void 0:"Documentation",children:[h.jsx(iy,{size:14}),y&&h.jsx("span",{children:"Docs"})]})]})]});return s&&S?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40 bg-ink/20",onClick:()=>C(!1)}),h.jsx("div",{className:"fixed inset-y-0 left-0 z-50",children:B})]}):B}function hS({collapsed:i}){const{user:o,logout:r,isLocalMode:s}=vy(),[d,m]=g.useState(!1),p=g.useRef(null);return g.useEffect(()=>{function S(C){p.current&&!p.current.contains(C.target)&&m(!1)}if(d)return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[d]),s||!o?h.jsxs("div",{className:["flex items-center gap-2 text-xs",i&&"justify-center"].filter(Boolean).join(" "),title:i?"Local Mode":void 0,children:[h.jsx(hb,{size:14,className:"text-[#939084] flex-shrink-0"}),!i&&h.jsx("span",{className:"text-[#939084]",children:"Local Mode"})]}):h.jsxs("div",{className:"relative",ref:p,"data-testid":"user-section",children:[h.jsxs("button",{type:"button",onClick:()=>m(!d),className:["flex items-center gap-2 w-full text-left text-xs rounded-[3px] py-1 px-1 hover:bg-[#F8F4F0] transition-colors",i&&"justify-center"].filter(Boolean).join(" "),title:i?o.name||o.email:void 0,children:[o.avatar_url?h.jsx("img",{src:o.avatar_url,alt:"",className:"w-5 h-5 rounded-full flex-shrink-0"}):h.jsx("div",{className:"w-5 h-5 rounded-full bg-[#553DE9] flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",children:(o.name||o.email||"?")[0].toUpperCase()}),!i&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-[#36342E] truncate flex-1",children:o.name||o.email}),h.jsx(cy,{size:12,className:`text-[#939084] transition-transform ${d?"":"rotate-180"}`})]})]}),d&&h.jsxs("div",{className:"absolute bottom-full left-0 mb-1 w-48 bg-white border border-[#ECEAE3] rounded-lg shadow-lg py-1 z-50",children:[h.jsxs("div",{className:"px-3 py-2 border-b border-[#ECEAE3]",children:[h.jsx("p",{className:"text-xs font-medium text-[#36342E] truncate",children:o.name}),h.jsx("p",{className:"text-xs text-[#939084] truncate",children:o.email})]}),h.jsxs(dc,{to:"/settings",onClick:()=>m(!1),className:"flex items-center gap-2 px-3 py-2 text-xs text-[#36342E] hover:bg-[#F8F4F0] transition-colors",children:[h.jsx(hy,{size:14}),"Settings"]}),h.jsxs("button",{type:"button",onClick:()=>{m(!1),r()},className:"flex items-center gap-2 px-3 py-2 text-xs text-[#C45B5B] hover:bg-[#F8F4F0] transition-colors w-full text-left",children:[h.jsx(ob,{size:14}),"Sign out"]})]})]})}const Nn=[];function mS(i){if(i.key==="Escape"&&Nn.length>0){i.preventDefault(),i.stopPropagation();const o=Nn[Nn.length-1];o()}}let j0=!1;function yS(){j0||(document.addEventListener("keydown",mS),j0=!0)}function vS(i,o){const r=g.useRef(o);r.current=o;const s=g.useCallback(()=>{r.current()},[]);g.useEffect(()=>{if(i)return yS(),Nn.push(s),()=>{const d=Nn.indexOf(s);d!==-1&&Nn.splice(d,1)}},[i,s])}const M0=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function gS(i){const o=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{if(!i)return;r.current=document.activeElement;const s=o.current;if(!s)return;const d=s.querySelectorAll(M0);d.length>0&&requestAnimationFrame(()=>d[0].focus());const m=p=>{if(p.key!=="Tab")return;const S=s.querySelectorAll(M0);if(S.length===0)return;const C=S[0],z=S[S.length-1];p.shiftKey?document.activeElement===C&&(p.preventDefault(),z.focus()):document.activeElement===z&&(p.preventDefault(),C.focus())};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m),r.current&&typeof r.current.focus=="function"&&r.current.focus()}},[i]),o}const w0="pl_onboarding_complete",zu=[{icon:ry,title:"Write your spec",description:"Describe what you want to build, or choose a template to get started quickly."},{icon:qb,title:"Use the terminal",description:"Run commands directly in the integrated terminal to install dependencies or debug."},{icon:sy,title:"Preview in real-time",description:"Switch to the Preview tab to see your app running with live reload."},{icon:Ar,title:"Iterate with AI Chat",description:"Ask the AI to modify, fix, or explain your code in the chat panel."}];function pS(){const[i,o]=g.useState(!1),[r,s]=g.useState(0),d=gS(i);vS(i,()=>{i&&m()}),g.useEffect(()=>{try{localStorage.getItem(w0)!=="1"&&o(!0)}catch{}},[]);const m=()=>{o(!1);try{localStorage.setItem(w0,"1")}catch{}},p=()=>{r<zu.length-1?s(r+1):m()};if(!i)return null;const S=zu[r],C=S.icon;return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/30",children:h.jsxs("div",{ref:d,className:"bg-card rounded-card shadow-card-hover border border-border w-full max-w-sm mx-4",children:[h.jsxs("div",{className:"flex items-center justify-between px-5 pt-5 pb-2",children:[h.jsxs("span",{className:"text-[11px] font-mono text-muted-accessible",children:[r+1," / ",zu.length]}),h.jsx("button",{onClick:m,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Skip onboarding",children:h.jsx(ja,{size:14})})]}),h.jsxs("div",{className:"px-5 pb-4 text-center",children:[h.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-4",children:h.jsx(C,{size:24,className:"text-primary"})}),h.jsx("h3",{className:"text-sm font-heading font-bold text-ink mb-1",children:S.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed",children:S.description})]}),h.jsx("div",{className:"flex items-center justify-center gap-1.5 pb-4",children:zu.map((z,x)=>h.jsx("div",{className:`w-1.5 h-1.5 rounded-full transition-colors ${x===r?"bg-primary":"bg-border"}`},x))}),h.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-border",children:[h.jsx("button",{onClick:m,className:"text-xs text-muted hover:text-ink transition-colors",children:"Skip"}),h.jsx("button",{onClick:p,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:r<zu.length-1?h.jsxs(h.Fragment,{children:["Next",h.jsx(uy,{size:12})]}):"Get Started"})]})]})})}const D0="pl_product_tour_complete",bS=[{target:'[data-tour="input-box"]',title:"Describe what you want to build",description:"Type a plain-English description of your project here. The more detail you give, the better the result. You can also paste a spec / PRD or select a template.",position:"bottom"},{target:'[data-tour="template-gallery"]',title:"Start from a template",description:"Browse ready-made templates for SaaS apps, landing pages, dashboards, and more. Each template gives you a head start with a proven structure.",position:"bottom"},{target:'[data-tour="build-progress"]',title:"Watch your project come to life",description:"Once you start a build, this bar tracks each phase: planning, building, testing, and reviewing. You will see real-time progress and cost estimates.",position:"bottom"},{target:'[data-tour="preview-tab"]',title:"Preview your running app",description:"Switch to the Preview tab to see your application running live. Changes appear in real time as the AI iterates on your code.",position:"bottom"},{target:'[data-tour="deploy-tab"]',title:"Deploy with one click",description:"When you are happy with the result, head to the Deploy tab to push your project live. Supports Vercel, Netlify, and GitHub Pages.",position:"bottom"}];function SS(i){const o=document.querySelector(i);return o?o.getBoundingClientRect():null}function xS(i,o){if(!i)return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};const r=16,s={position:"fixed",zIndex:60};switch(o){case"bottom":s.top=i.bottom+r,s.left=i.left+i.width/2,s.transform="translateX(-50%)";break;case"top":s.bottom=window.innerHeight-i.top+r,s.left=i.left+i.width/2,s.transform="translateX(-50%)";break;case"left":s.top=i.top+i.height/2,s.right=window.innerWidth-i.left+r,s.transform="translateY(-50%)";break;case"right":s.top=i.top+i.height/2,s.left=i.right+r,s.transform="translateY(-50%)";break}return s}function ES({steps:i=bS,onComplete:o}){const[r,s]=g.useState(!1),[d,m]=g.useState(0),[p,S]=g.useState(null),C=g.useRef(0);g.useEffect(()=>{try{if(localStorage.getItem(D0)!=="1"){const B=setTimeout(()=>s(!0),800);return()=>clearTimeout(B)}}catch{}},[]),g.useEffect(()=>{if(!r||!i[d])return;const B=()=>{const D=SS(i[d].target);S(D),C.current=requestAnimationFrame(B)};return B(),()=>cancelAnimationFrame(C.current)},[r,d,i]);const z=g.useCallback(()=>{s(!1);try{localStorage.setItem(D0,"1")}catch{}o==null||o()},[o]),x=g.useCallback(()=>{d<i.length-1?m(B=>B+1):z()},[d,i.length,z]),y=g.useCallback(()=>{m(B=>Math.max(0,B-1))},[]);if(g.useEffect(()=>{if(!r)return;const B=D=>{D.key==="Escape"&&z(),D.key==="ArrowRight"&&x(),D.key==="ArrowLeft"&&y()};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[r,z,x,y]),!r||!i[d])return null;const j=i[d],U=8;return h.jsxs("div",{className:"fixed inset-0 z-[55]","aria-modal":"true",role:"dialog",children:[h.jsxs("svg",{className:"absolute inset-0 w-full h-full",onClick:z,style:{zIndex:55},children:[h.jsx("defs",{children:h.jsxs("mask",{id:"tour-spotlight",children:[h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),p&&h.jsx("rect",{x:p.left-U,y:p.top-U,width:p.width+U*2,height:p.height+U*2,rx:"8",fill:"black"})]})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"rgba(0,0,0,0.55)",mask:"url(#tour-spotlight)"})]}),p&&h.jsx("div",{className:"absolute border-2 border-primary rounded-lg pointer-events-none shadow-[0_0_20px_rgba(85,61,233,0.3)]",style:{left:p.left-U,top:p.top-U,width:p.width+U*2,height:p.height+U*2,zIndex:56}}),h.jsxs("div",{className:"w-80 bg-card rounded-xl shadow-2xl border border-border p-0 overflow-hidden",style:{...xS(p,j.position),zIndex:57},onClick:B=>B.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pt-4 pb-1",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Mr,{size:14,className:"text-primary"}),h.jsxs("span",{className:"text-[11px] font-mono text-muted-accessible",children:["Step ",d+1," of ",i.length]})]}),h.jsx("button",{onClick:z,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Skip tour",children:h.jsx(ja,{size:14})})]}),h.jsxs("div",{className:"px-4 pb-3",children:[h.jsx("h3",{className:"text-sm font-heading font-bold text-ink mb-1",children:j.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed",children:j.description})]}),h.jsx("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:i.map((B,D)=>h.jsx("button",{onClick:()=>m(D),className:`w-2 h-2 rounded-full transition-all ${D===d?"bg-primary scale-110":D<d?"bg-primary/40":"bg-border"}`,"aria-label":`Go to step ${D+1}`},D))}),h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-border bg-hover/30",children:[h.jsxs("button",{onClick:z,className:"flex items-center gap-1 text-xs text-muted hover:text-ink transition-colors",children:[h.jsx(Mb,{size:12}),"Skip tour"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[d>0&&h.jsxs("button",{onClick:y,className:"flex items-center gap-1 px-3 py-1.5 text-xs font-medium rounded-btn text-ink hover:bg-hover transition-colors",children:[h.jsx(ny,{size:12}),"Back"]}),h.jsx("button",{onClick:x,className:"flex items-center gap-1 px-4 py-1.5 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:d<i.length-1?h.jsxs(h.Fragment,{children:["Next",h.jsx(uy,{size:12})]}):"Let's go!"})]})]})]})]})}const U0="pl_whats_new_version",fr="10.10.3",TS=[{icon:Mr,title:"Product Tour",description:"New step-by-step guided tour for first-time users. Highlights key UI areas so you never feel lost."},{icon:gb,title:"Contextual Help Tooltips",description:"Hover over the help icons next to complex features to learn what they do without leaving the page."},{icon:fy,title:"Enhanced Keyboard Shortcuts",description:'Press "?" to open the shortcuts overlay. Shortcuts are now grouped by category with search and filtering.'},{icon:Wb,title:"Getting Started Checklist",description:"A friendly checklist guides you through your first project, from writing a spec to deploying your app."},{icon:Ab,title:"In-App Documentation",description:"Browse Quick Start guides, FAQ, and template docs right inside Purple Lab, no context switching required."}];function _S(){const[i,o]=g.useState(!1);g.useEffect(()=>{try{if(localStorage.getItem(U0)!==fr){const d=setTimeout(()=>o(!0),1200);return()=>clearTimeout(d)}}catch{}},[]);const r=()=>{o(!1);try{localStorage.setItem(U0,fr)}catch{}};return i?h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/30",onClick:r,children:h.jsxs("div",{className:"bg-card rounded-xl shadow-2xl border border-border w-full max-w-md mx-4 overflow-hidden",onClick:s=>s.stopPropagation(),children:[h.jsxs("div",{className:"relative px-6 pt-6 pb-4 text-center border-b border-border bg-gradient-to-b from-primary/5 to-transparent",children:[h.jsx("button",{onClick:r,className:"absolute top-4 right-4 text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",title:"Close",children:h.jsx(ja,{size:14})}),h.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3",children:h.jsx(J2,{size:24,className:"text-primary"})}),h.jsx("h2",{className:"text-lg font-heading font-bold text-ink",children:"What's New"}),h.jsxs("p",{className:"text-xs text-muted-accessible mt-1",children:["Purple Lab v",fr]})]}),h.jsx("div",{className:"px-4 py-4 space-y-3 max-h-[320px] overflow-y-auto terminal-scroll",children:TS.map(s=>{const d=s.icon;return h.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg hover:bg-hover transition-colors",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:h.jsx(d,{size:16,className:"text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"text-sm font-medium text-ink",children:s.title}),h.jsx("p",{className:"text-xs text-muted-accessible leading-relaxed mt-0.5",children:s.description})]})]},s.title)})}),h.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-border",children:[h.jsxs("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-primary hover:text-primary-hover transition-colors",children:["Full changelog",h.jsx(k2,{size:11})]}),h.jsx("button",{onClick:r,className:"px-5 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:"Got it!"})]})]})}):null}const dr=[{id:"quick-start",title:"Quick Start",icon:jr,content:`# Quick Start
|
|
357
357
|
|
|
358
358
|
**1. Create a project**
|
|
359
359
|
Click "New Project" on the home page, or type a description in the input box and press Enter.
|
|
@@ -432,4 +432,4 @@ Reason, Act, Reflect, Verify -- the AI's thinking process. It plans what to do (
|
|
|
432
432
|
from { opacity: 0; transform: translateX(100%); }
|
|
433
433
|
to { opacity: 1; transform: translateX(0); }
|
|
434
434
|
}
|
|
435
|
-
`}),h.jsx("span",{className:`flex-shrink-0 mt-0.5 ${p.icon}`,children:h.jsx(p.IconComponent,{size:18})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:s}),d&&h.jsx("p",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-0.5",children:d})]}),h.jsx("button",{onClick:C,className:"flex-shrink-0 text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3] transition-colors","aria-label":"Dismiss notification",children:h.jsx(ja,{size:14})})]})}function LS({notifications:i,onDismiss:o}){return i.length===0?null:h.jsx("div",{className:"fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none","aria-live":"polite",children:i.map(r=>h.jsx(HS,{notification:r,onDismiss:o},r.id))})}const Ey=g.createContext({notify:()=>"",dismiss:()=>{},dismissAll:()=>{}});let BS=0;function qS({children:i}){const[o,r]=g.useState([]),s=g.useCallback(S=>{const C=`notif-${++BS}-${Date.now()}`,z={...S,id:C};if(r(x=>[...x,z]),document.hidden&&"Notification"in window)if(Notification.permission==="granted")try{new Notification(S.title,{body:S.message||""})}catch{}else Notification.permission!=="denied"&&Notification.requestPermission().then(x=>{if(x==="granted")try{new Notification(S.title,{body:S.message||""})}catch{}});return C},[]),d=g.useCallback(S=>{r(C=>C.filter(z=>z.id!==S))},[]),m=g.useCallback(()=>{r([])},[]),p=g.useMemo(()=>({notify:s,dismiss:d,dismissAll:m}),[s,d,m]);return h.jsxs(Ey.Provider,{value:p,children:[i,h.jsx(LS,{notifications:o,onDismiss:d})]})}function cx(){return g.useContext(Ey)}function mr({children:i}){const{user:o,loading:r,isLocalMode:s}=vy();return r?h.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):s?h.jsx(h.Fragment,{children:i}):o?h.jsx(h.Fragment,{children:i}):h.jsx(Mp,{to:"/login",replace:!0})}function hc({variant:i="text",width:o,height:r,className:s=""}){const d="animate-pulse bg-[#ECEAE3]/60 rounded";if(i==="circle"){const m=o||"2rem";return h.jsx("div",{className:`${d} rounded-full flex-shrink-0 ${s}`,style:{width:m,height:m}})}return i==="block"?h.jsx("div",{className:`${d} rounded-btn ${s}`,style:{width:o||"100%",height:r||"4rem"}}):h.jsx("div",{className:`${d} rounded-btn ${s}`,style:{width:o||"100%",height:r||"0.75rem"}})}function ox(){return h.jsx("div",{className:"p-4 space-y-3",children:[...Array(12)].map((i,o)=>h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(hc,{variant:"text",width:"1.5rem",height:"10px",className:"flex-shrink-0 opacity-40"}),h.jsx(hc,{variant:"text",width:`${20+Math.random()*60}%`,height:"10px"})]},o))})}typeof window<"u"&&window.addEventListener("beforeunload",i=>{delete i.returnValue});const YS=g.lazy(()=>dt(()=>import("./HomePage-
|
|
435
|
+
`}),h.jsx("span",{className:`flex-shrink-0 mt-0.5 ${p.icon}`,children:h.jsx(p.IconComponent,{size:18})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:s}),d&&h.jsx("p",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-0.5",children:d})]}),h.jsx("button",{onClick:C,className:"flex-shrink-0 text-[#939084] hover:text-[#36342E] dark:hover:text-[#E8E6E3] transition-colors","aria-label":"Dismiss notification",children:h.jsx(ja,{size:14})})]})}function LS({notifications:i,onDismiss:o}){return i.length===0?null:h.jsx("div",{className:"fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none","aria-live":"polite",children:i.map(r=>h.jsx(HS,{notification:r,onDismiss:o},r.id))})}const Ey=g.createContext({notify:()=>"",dismiss:()=>{},dismissAll:()=>{}});let BS=0;function qS({children:i}){const[o,r]=g.useState([]),s=g.useCallback(S=>{const C=`notif-${++BS}-${Date.now()}`,z={...S,id:C};if(r(x=>[...x,z]),document.hidden&&"Notification"in window)if(Notification.permission==="granted")try{new Notification(S.title,{body:S.message||""})}catch{}else Notification.permission!=="denied"&&Notification.requestPermission().then(x=>{if(x==="granted")try{new Notification(S.title,{body:S.message||""})}catch{}});return C},[]),d=g.useCallback(S=>{r(C=>C.filter(z=>z.id!==S))},[]),m=g.useCallback(()=>{r([])},[]),p=g.useMemo(()=>({notify:s,dismiss:d,dismissAll:m}),[s,d,m]);return h.jsxs(Ey.Provider,{value:p,children:[i,h.jsx(LS,{notifications:o,onDismiss:d})]})}function cx(){return g.useContext(Ey)}function mr({children:i}){const{user:o,loading:r,isLocalMode:s}=vy();return r?h.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):s?h.jsx(h.Fragment,{children:i}):o?h.jsx(h.Fragment,{children:i}):h.jsx(Mp,{to:"/login",replace:!0})}function hc({variant:i="text",width:o,height:r,className:s=""}){const d="animate-pulse bg-[#ECEAE3]/60 rounded";if(i==="circle"){const m=o||"2rem";return h.jsx("div",{className:`${d} rounded-full flex-shrink-0 ${s}`,style:{width:m,height:m}})}return i==="block"?h.jsx("div",{className:`${d} rounded-btn ${s}`,style:{width:o||"100%",height:r||"4rem"}}):h.jsx("div",{className:`${d} rounded-btn ${s}`,style:{width:o||"100%",height:r||"0.75rem"}})}function ox(){return h.jsx("div",{className:"p-4 space-y-3",children:[...Array(12)].map((i,o)=>h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(hc,{variant:"text",width:"1.5rem",height:"10px",className:"flex-shrink-0 opacity-40"}),h.jsx(hc,{variant:"text",width:`${20+Math.random()*60}%`,height:"10px"})]},o))})}typeof window<"u"&&window.addEventListener("beforeunload",i=>{delete i.returnValue});const YS=g.lazy(()=>dt(()=>import("./HomePage-BZ7PCPFR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),GS=g.lazy(()=>dt(()=>import("./ProjectPage-B5K1NDuH.js").then(i=>i.P),__vite__mapDeps([17,2,18,3,4,10,16,19,7,20,21,22,9,23,13,24,25,8,26,27,28,29,30,31,12,32,14,33,34,35]))),kS=g.lazy(()=>dt(()=>import("./CockpitPage-D5WhogJK.js"),__vite__mapDeps([36,2,28,9,7,24,29,23]))),VS=g.lazy(()=>dt(()=>import("./ProjectsPage-C2l5SiIN.js"),__vite__mapDeps([37,18,6,7,8,9,1,25,30,27]))),QS=g.lazy(()=>dt(()=>import("./TemplatesPage-B1mj-eA4.js"),__vite__mapDeps([38,18,1,39,7,14,9,10,26,34,22,40,30]))),XS=g.lazy(()=>dt(()=>import("./SettingsPage-DkDNp6Pd.js"),__vite__mapDeps([41,31,13,11,23,9,8]))),ZS=g.lazy(()=>dt(()=>import("./LoginPage-CJsigIUa.js"),[])),KS=g.lazy(()=>dt(()=>import("./TeamsPage-DUb_TA22.js"),__vite__mapDeps([42,18,43,4,20,44,7,16,19,13,30]))),JS=g.lazy(()=>dt(()=>import("./AdminPage-Dyx5OHmP.js"),__vite__mapDeps([45,18,32,7,43,20,25,26,39,9,24,44,40,4,21,46]))),$S=g.lazy(()=>dt(()=>import("./SystemSettingsPage-hIm_4NUx.js"),__vite__mapDeps([47,34,13,15,40,46]))),FS=g.lazy(()=>dt(()=>import("./MetricsPage-ELQn9-cf.js"),__vite__mapDeps([48,5,24,14,32,33]))),IS=g.lazy(()=>dt(()=>import("./ShowcasePage-1zasFSKz.js"),[])),WS=g.lazy(()=>dt(()=>import("./MagicPage-ClZaKmXT.js"),__vite__mapDeps([49,29,8,23,12]))),PS=g.lazy(()=>dt(()=>import("./ComparePage-CjJfjxcT.js"),[])),ex=g.lazy(()=>dt(()=>import("./NotFoundPage-Dc_zp3RF.js"),[]));function ft(){return h.jsxs("div",{className:"h-screen bg-[#FAF9F6] flex flex-col items-center justify-center gap-3",children:[h.jsx(hc,{variant:"block",width:"200px",height:"24px"}),h.jsx(hc,{variant:"text",width:"140px",height:"12px",className:"opacity-50"})]})}function tx(){return h.jsx(lS,{children:h.jsx(qS,{children:h.jsxs(Up,{children:[h.jsx(lt,{path:"/login",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(ZS,{})})}),h.jsx(lt,{path:"/project/:sessionId/cockpit",element:h.jsx(mr,{children:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(kS,{})})})}),h.jsx(lt,{path:"/project/:sessionId",element:h.jsx(mr,{children:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(GS,{})})})}),h.jsxs(lt,{element:h.jsx(mr,{children:h.jsx(DS,{})}),children:[h.jsx(lt,{path:"/",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(YS,{})})}),h.jsx(lt,{path:"/projects",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(VS,{})})}),h.jsx(lt,{path:"/templates",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(QS,{})})}),h.jsx(lt,{path:"/settings",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(XS,{})})}),h.jsx(lt,{path:"/teams",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(KS,{})})}),h.jsx(lt,{path:"/metrics",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(FS,{})})}),h.jsx(lt,{path:"/showcase",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(IS,{})})}),h.jsx(lt,{path:"/magic",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(WS,{})})}),h.jsx(lt,{path:"/compare",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(PS,{})})}),h.jsx(lt,{path:"/admin",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(JS,{})})}),h.jsx(lt,{path:"/admin/settings",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx($S,{})})}),h.jsx(lt,{path:"*",element:h.jsx(g.Suspense,{fallback:h.jsx(ft,{}),children:h.jsx(ex,{})})})]})]})})})}const lx="/lab/".replace(/\/$/,"")||"/";jg.createRoot(document.getElementById("root")).render(h.jsx(g.StrictMode,{children:h.jsx(u2,{basename:lx,children:h.jsx(tx,{})})}));export{gb as $,uy as A,iy as B,oy as C,bb as D,k2 as E,ry as F,F2 as G,ox as H,lb as I,ny as J,fy as K,Or as L,Ar as M,hc as N,ux as O,dy as P,Y2 as Q,jr as R,zb as S,Gb as T,Vb as U,eS as V,nx as W,ja as X,B2 as Y,Wb as Z,dt as _,_n as a,vy as a0,cx as a1,Z2 as a2,ty as a3,eb as a4,Kb as a5,Ub as b,$ as c,wS as d,ix as e,$b as f,cy as g,R2 as h,qb as i,h as j,H2 as k,w2 as l,Nb as m,gS as n,vS as o,N0 as p,j2 as q,g as r,Mb as s,hb as t,Tr as u,Mr as v,N2 as w,Ab as x,sy as y,hy as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-DdjeiWUI.js";function m(s,u=2e3,a=!0){const[c,l]=e.useState(null),[f,o]=e.useState(null),[i,d]=e.useState(!0),r=e.useRef(!0),n=e.useCallback(async()=>{try{const t=await s();r.current&&(l(t),o(null))}catch(t){r.current&&o(t instanceof Error?t.message:"Unknown error")}finally{r.current&&d(!1)}},[s]);return e.useEffect(()=>{if(r.current=!0,!a)return;n();const t=setInterval(n,u);return()=>{r.current=!1,clearInterval(t)}},[n,u,a]),{data:c,error:f,loading:i,refresh:n}}export{m as u};
|
package/web-app/dist/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
10
|
-
<script type="module" crossorigin src="/lab/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/lab/assets/index-DdjeiWUI.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/lab/assets/index-Cx7e1d6w.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body class="bg-background text-ink font-sans antialiased">
|