@tom2012/cc-web 1.5.52 → 1.5.53
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/README.md +1 -1
- package/frontend/dist/assets/{ChatView-BGrHsMR9.js → ChatView-Cgi84kDO.js} +1 -1
- package/frontend/dist/assets/{GraphPreview-CB0_XO4r.js → GraphPreview-BYVT_Zga.js} +1 -1
- package/frontend/dist/assets/{OfficePreview-1-i1sz5k.js → OfficePreview-Do7Ii81A.js} +3 -3
- package/frontend/dist/assets/{ProjectPage-Cur4elk1.js → ProjectPage-CleGlRT2.js} +28 -28
- package/frontend/dist/assets/{SettingsPage-DnAH9VWu.js → SettingsPage-iu4qlKY-.js} +4 -4
- package/frontend/dist/assets/{ShareViewPage-CcquAbhh.js → ShareViewPage-BH5DcBFe.js} +1 -1
- package/frontend/dist/assets/{SkillHubPage-CoM63_GP.js → SkillHubPage-Bepx_l5S.js} +2 -2
- package/frontend/dist/assets/{bot-Bhot_xL1.js → bot-Z56rh3I9.js} +1 -1
- package/frontend/dist/assets/{chevron-down-BLLGZF4Q.js → chevron-down-BMXEj6rp.js} +1 -1
- package/frontend/dist/assets/{download-dn65Yic6.js → download-C95LJc8e.js} +1 -1
- package/frontend/dist/assets/index-D7-ur8vw.css +1 -0
- package/frontend/dist/assets/{index-Dc8u1vU0.js → index-DY80zrkg.js} +2 -2
- package/frontend/dist/assets/{index-DnsaxfE4.js → index-rhAUZY9u.js} +1 -1
- package/frontend/dist/assets/{jszip.min-CzfLNkw8.js → jszip.min-DWTb7F2P.js} +1 -1
- package/frontend/dist/assets/{select-Bvlmfn-y.js → select-Dro06PdP.js} +1 -1
- package/frontend/dist/assets/{user-CljKCZZO.js → user-DVhuboyg.js} +1 -1
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-B13xy6Pb.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectPage-CleGlRT2.js","assets/select-Dro06PdP.js","assets/chevron-down-BMXEj6rp.js","assets/download-C95LJc8e.js","assets/bot-Z56rh3I9.js","assets/user-DVhuboyg.js","assets/ProjectPage-9CEnUXvW.css","assets/SettingsPage-iu4qlKY-.js","assets/SkillHubPage-Bepx_l5S.js","assets/ShareViewPage-BH5DcBFe.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var hw=Object.defineProperty;var pw=(e,t,n)=>t in e?hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qa=(e,t,n)=>pw(e,typeof t!="symbol"?t+"":t,n);function mw(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var BM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Cm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $M(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var bm={exports:{}},pa={},Tm={exports:{}},H={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -272,4 +272,4 @@ Error generating stack: `+o.message+`
|
|
|
272
272
|
|
|
273
273
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
274
274
|
|
|
275
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OR="DialogDescriptionWarning",IR=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yx(OR).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},VR=_x,FR=Vx,Xx=Fx,Qx=zx,Zx=$x,qx=Wx,zR=Gx;const lf=VR,BR=FR,Jx=p.forwardRef(({className:e,...t},n)=>h.jsx(Xx,{ref:n,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jx.displayName=Xx.displayName;const $a=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(BR,{children:[h.jsx(Jx,{}),h.jsxs(Qx,{ref:r,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(zR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(rf,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$a.displayName=Qx.displayName;const Ua=({className:e,...t})=>h.jsx("div",{className:q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ua.displayName="DialogHeader";const Wa=({className:e,...t})=>h.jsx("div",{className:q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wa.displayName="DialogFooter";const Ha=p.forwardRef(({className:e,...t},n)=>h.jsx(Zx,{ref:n,className:q("text-lg font-semibold leading-none tracking-tight",e),...t}));Ha.displayName=Zx.displayName;const Ga=p.forwardRef(({className:e,...t},n)=>h.jsx(qx,{ref:n,className:q("text-sm text-muted-foreground",e),...t}));Ga.displayName=qx.displayName;function $R({project:e,open:t,onOpenChange:n,onUpdated:r}){const[s,o]=p.useState([]),[i,a]=p.useState([]),[l,c]=p.useState(!1),[d,u]=p.useState(null);p.useEffect(()=>{if(!t)return;o(e.shares?[...e.shares]:[]),u(null);let g=!1;return ex().then(v=>{g||a(v)}).catch(()=>{}),()=>{g=!0}},[t,e.id]);const f=new Set(s.map(g=>g.username)),y=i.filter(g=>g!==e.owner&&!f.has(g)),w=g=>{o(v=>[...v,{username:g,permission:"view"}])},x=g=>{o(v=>v.filter(E=>E.username!==g))},S=g=>{o(v=>v.map(E=>E.username===g?{...E,permission:E.permission==="view"?"edit":"view"}:E))},m=async()=>{c(!0),u(null);try{const g=await tx(e.id,s);r(g),n(!1)}catch(g){u(g instanceof Error?g.message:"Failed to update shares")}finally{c(!1)}};return h.jsx(lf,{open:t,onOpenChange:n,children:h.jsxs($a,{className:"sm:max-w-md",children:[h.jsxs(Ua,{children:[h.jsxs(Ha,{className:"flex items-center gap-2",children:[h.jsx(vc,{className:"h-4 w-4"}),"共享设置"]}),h.jsx(Ga,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),h.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[s.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),s.map(g=>h.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[h.jsx("span",{className:"text-sm font-medium",children:g.username}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>S(g.username),className:"focus:outline-none",children:h.jsx(Zn,{variant:g.permission==="edit"?"default":"secondary",className:"cursor-pointer text-xs",children:g.permission==="edit"?"可编辑":"可见"})}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>x(g.username),children:h.jsx(vx,{className:"h-3.5 w-3.5"})})]})]},g.username))]}),y.length>0&&h.jsxs("div",{className:"border-t pt-3",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(g=>h.jsxs(oe,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>w(g),children:[h.jsx(fa,{className:"h-3 w-3"}),g]},g))})]}),d&&h.jsx("p",{className:"text-sm text-destructive",children:d}),h.jsxs(Wa,{children:[h.jsx(oe,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),h.jsx(oe,{onClick:()=>void m(),disabled:l,children:l?"保存中...":"保存"})]})]})})}function UR(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function WR({status:e}){return h.jsx("span",{className:q("inline-block w-2 h-2 rounded-full",{"bg-green-500":e==="running","bg-zinc-400":e==="stopped","bg-yellow-400 animate-pulse":e==="restarting"})})}const xm=j.memo(function({project:t,active:n=!1,statusStack:r=[],onDelete:s,onArchive:o,onUnarchive:i,onUpdated:a}){var g,v;const l=Aa(),[c,d]=p.useState(!1),u=!!t._sharedPermission,f=t._sharedPermission==="view",y=E=>{E.stopPropagation(),confirm(`Delete project "${t.name}"? This cannot be undone.`)&&s(t.id)},w=E=>{E.stopPropagation(),o(t.id)},x=E=>{E.stopPropagation(),i(t.id)},S=h.jsx(An.div,{whileHover:!t.archived&&!n?{y:-2}:{},transition:{duration:.2},children:h.jsxs(Zd,{className:q("group cursor-pointer transition-colors relative",t.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":n?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!t.archived&&l(`/projects/${t.id}`),children:[h.jsxs(qd,{className:"pb-2",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx(Jd,{className:q("text-base leading-tight",t.archived&&"text-muted-foreground"),children:t.name}),h.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!u&&h.jsxs(h.Fragment,{children:[t.archived?h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:x,title:"Restore project",children:h.jsx(LN,{className:"h-3.5 w-3.5"})}):h.jsxs(h.Fragment,{children:[h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:E=>{E.stopPropagation(),d(!0)},title:"共享设置",children:h.jsx(vc,{className:"h-3.5 w-3.5"})}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Archive project",children:h.jsx(_N,{className:"h-3.5 w-3.5"})})]}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:y,title:"Delete project",children:h.jsx(vx,{className:"h-3.5 w-3.5"})})]})})]}),h.jsx("div",{className:"flex items-center gap-1.5",children:t.archived?h.jsx(Zn,{variant:"secondary",className:"text-xs",children:"Archived"}):h.jsxs(h.Fragment,{children:[h.jsx(WR,{status:t.status}),h.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:t.status}),n&&r.length>0&&h.jsx("div",{className:"ml-auto",children:h.jsx(Kd,{mode:"wait",children:r.slice(-1).map(E=>h.jsx(An.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.25,ease:"easeOut"},children:h.jsx(Zn,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:UR(E.phase,E.detail)})},E.id))})})]})})]}),h.jsxs(ef,{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsx(yc,{className:"h-3.5 w-3.5 flex-shrink-0"}),h.jsx("span",{className:"truncate font-mono",children:t.folderPath})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Zn,{variant:"outline",className:"text-xs font-mono",children:t.cliTool??"claude"}),h.jsx(Zn,{variant:t.permissionMode==="unlimited"?"destructive":"secondary",className:"text-xs",children:t.permissionMode==="unlimited"?"Unlimited":"Limited"}),u&&h.jsxs(Zn,{variant:"outline",className:"text-xs gap-0.5",children:[f?h.jsx(VN,{className:"h-3 w-3"}):h.jsx(yx,{className:"h-3 w-3"}),f?"可见":"可编辑"]}),!u&&t.shares&&t.shares.length>0&&h.jsxs(Zn,{variant:"outline",className:"text-xs gap-0.5",children:[h.jsx(vc,{className:"h-3 w-3"}),t.shares.length]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleDateString()})]}),(t.tags??[]).length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(t.tags??[]).slice(0,3).map(E=>h.jsxs("span",{className:"px-1.5 py-0 rounded-full text-[10px] bg-muted text-muted-foreground border border-border",children:["#",E]},E)),(((g=t.tags)==null?void 0:g.length)??0)>3&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",(((v=t.tags)==null?void 0:v.length)??0)-3]})]})]})]})}),m=n&&!t.archived?h.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return h.jsxs(h.Fragment,{children:[m,!u&&a&&h.jsx($R,{project:t,open:c,onOpenChange:d,onUpdated:a})]})});function ew({onSelect:e}){const[t,n]=p.useState(""),[r,s]=p.useState(null),[o,i]=p.useState([]),[a,l]=p.useState(!0),[c,d]=p.useState(null),[u,f]=p.useState(!1),[y,w]=p.useState(""),[x,S]=p.useState(null),[m,g]=p.useState(!1),v=p.useRef(null),E=async D=>{l(!0),d(null);try{const L=await hx(D);n(L.path),s(L.parent),i(L.entries)}catch(L){d(L instanceof Error?L.message:"Failed to load directory")}finally{l(!1)}};p.useEffect(()=>{E()},[]),p.useEffect(()=>{u&&setTimeout(()=>{var D;return(D=v.current)==null?void 0:D.focus()},0)},[u]);const b=()=>{w(""),S(null),f(!0)},T=()=>{f(!1),w(""),S(null)},k=async()=>{const D=y.trim();if(D){g(!0),S(null);try{const{path:L}=await px(t,D);f(!1),w(""),await E(t),E(L)}catch(L){S(L instanceof Error?L.message:"Failed to create folder")}finally{g(!1)}}},C=D=>{D.key==="Enter"?(D.preventDefault(),k()):D.key==="Escape"&&T()},M=t.split("/").filter(Boolean),P=D=>{const L="/"+M.slice(0,D+1).join("/");E(L)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(oe,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void E(),title:"Home",children:h.jsx(BN,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:M.map((D,L)=>h.jsxs(j.Fragment,{children:[h.jsx(gx,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>P(L),children:D})]},L))}),h.jsxs(oe,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:b,disabled:u||a||!!c,title:"New folder",children:[h.jsx(zN,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!a&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void E(r),children:[h.jsx(ON,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(sm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:v,className:q("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",x&&"border-destructive"),placeholder:"Folder name",value:y,onChange:D=>{w(D.target.value),S(null)},onKeyDown:C,disabled:m}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void k(),disabled:!y.trim()||m,title:"Create",children:h.jsx(IN,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:T,disabled:m,title:"Cancel",children:h.jsx(rf,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),x&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:x}),o.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),o.map(D=>h.jsxs("button",{className:q("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",D.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{D.type==="dir"&&E(D.path)},disabled:D.type==="file",children:[D.type==="dir"?h.jsx(sm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(FN,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:D.name})]},D.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(oe,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const HR=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],wm={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function GR({open:e,onOpenChange:t,onCreated:n}){const[r,s]=p.useState("name"),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,d]=p.useState("claude"),[u,f]=p.useState("limited"),[y,w]=p.useState(!1),[x,S]=p.useState(null),m=()=>{s("name"),i(""),l(""),d("claude"),f("limited"),S(null),w(!1)},g=C=>{C||m(),t(C)},v=()=>{if(!o.trim()){S("Please enter a project name");return}S(null),s("folder")},E=C=>{l(C),s("settings")},b=async()=>{w(!0),S(null);try{const C=await nx({name:o.trim(),folderPath:a,permissionMode:u,cliTool:c});n(C),g(!1)}catch(C){S(C instanceof Error?C.message:"Failed to create project")}finally{w(!1)}},T={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},k=["name","folder","settings"];return h.jsx(lf,{open:e,onOpenChange:g,children:h.jsxs($a,{className:"sm:max-w-lg",children:[h.jsxs(Ua,{children:[h.jsx(Ha,{children:T[r]}),h.jsxs(Ga,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:k.map((C,M)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===C?"bg-primary":k.indexOf(r)>M?"bg-primary/40":"bg-muted"}`},C))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{htmlFor:"project-name",children:"Project Name"}),h.jsx(po,{id:"project-name",placeholder:"My Project",value:o,onChange:C=>i(C.target.value),onKeyDown:C=>{C.key==="Enter"&&v()},autoFocus:!0})]}),x&&h.jsx("p",{className:"text-sm text-destructive",children:x})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Working Directory"}),h.jsx(ew,{onSelect:E})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:HR.map(C=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===C.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:C.value,checked:c===C.value,onChange:()=>d(C.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:C.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:C.desc})]})]},C.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>f("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:wm[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>f("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:wm[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:a})]}),x&&h.jsx("p",{className:"text-sm text-destructive",children:x})]}),h.jsxs(Wa,{children:[r!=="name"&&h.jsx(oe,{variant:"outline",onClick:()=>s(r==="settings"?"folder":"name"),disabled:y,children:"Back"}),r==="name"&&h.jsx(oe,{onClick:v,children:"Next"}),r==="folder"&&h.jsx(oe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(oe,{onClick:()=>void b(),disabled:y,children:y?"Creating...":"Create Project"})]})]})})}function KR({open:e,onOpenChange:t,onOpened:n}){const[r,s]=p.useState(""),[o,i]=p.useState(!1),[a,l]=p.useState(null),c=()=>{s(""),l(null),i(!1)},d=f=>{f||c(),t(f)},u=async f=>{s(f),i(!0),l(null);try{const y=await rx(f);n(y),d(!1)}catch(y){l(y instanceof Error?y.message:"Failed to open project"),i(!1)}};return h.jsx(lf,{open:e,onOpenChange:d,children:h.jsxs($a,{className:"sm:max-w-lg",children:[h.jsxs(Ua,{children:[h.jsx(Ha,{children:"Open Existing Project"}),h.jsxs(Ga,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Project Folder"}),h.jsx(ew,{onSelect:f=>void u(f)})]}),a&&h.jsx("p",{className:"text-sm text-destructive",children:a}),r&&!a&&o&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(Wa,{children:h.jsx(oe,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"})})]})})}function YR(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const XR=e=>{switch(e){case"success":return qR;case"info":return eM;case"warning":return JR;case"error":return tM;default:return null}},QR=Array(12).fill(0),ZR=({visible:e,className:t})=>j.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},j.createElement("div",{className:"sonner-spinner"},QR.map((n,r)=>j.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),qR=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JR=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},j.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rM=()=>{const[e,t]=j.useState(document.hidden);return j.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Sc=1;class sM{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Sc++,i=this.toasts.find(l=>l.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...t,id:o,title:r}),{...l,...t,id:o,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async c=>{if(i=["resolve",c],j.isValidElement(c))o=!1,this.create({id:r,type:"default",message:c});else if(iM(c)&&!c.ok){o=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(c instanceof Error){o=!1;const u=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){o=!1;const u=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,y=typeof d=="object"&&!j.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Sc++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qe=new sM,oM=(e,t)=>{const n=(t==null?void 0:t.id)||Sc++;return qe.addToast({title:e,...t,id:n}),n},iM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",aM=oM,lM=()=>qe.toasts,uM=()=>qe.getActiveToasts(),Ri=Object.assign(aM,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:lM,getToasts:uM});YR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function oi(e){return e.label!==void 0}const cM=3,dM="24px",fM="16px",Sm=4e3,hM=356,pM=14,mM=45,gM=200;function It(...e){return e.filter(Boolean).join(" ")}function yM(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const vM=e=>{var t,n,r,s,o,i,a,l,c;const{invert:d,toast:u,unstyled:f,interacting:y,setHeights:w,visibleToasts:x,heights:S,index:m,toasts:g,expanded:v,removeToast:E,defaultRichColors:b,closeButton:T,style:k,cancelButtonStyle:C,actionButtonStyle:M,className:P="",descriptionClassName:D="",duration:L,position:Y,gap:ae,expandByDefault:pe,classNames:z,icons:te,closeButtonAriaLabel:N="Close toast"}=e,[_,V]=j.useState(null),[B,ne]=j.useState(null),[W,X]=j.useState(!1),[Q,fe]=j.useState(!1),[Qe,Z]=j.useState(!1),[Kt,Wn]=j.useState(!1),[Hn,A]=j.useState(!1),[G,we]=j.useState(0),[Ze,$e]=j.useState(0),Ue=j.useRef(u.duration||L||Sm),Et=j.useRef(null),se=j.useRef(null),xr=m===0,Ka=m+1<=x,st=u.type,wr=u.dismissible!==!1,ow=u.className||"",iw=u.descriptionClassName||"",jo=j.useMemo(()=>S.findIndex($=>$.toastId===u.id)||0,[S,u.id]),aw=j.useMemo(()=>{var $;return($=u.closeButton)!=null?$:T},[u.closeButton,T]),uf=j.useMemo(()=>u.duration||L||Sm,[u.duration,L]),Ya=j.useRef(0),Sr=j.useRef(0),cf=j.useRef(0),Er=j.useRef(null),[lw,uw]=Y.split("-"),df=j.useMemo(()=>S.reduce(($,Ne,Ie)=>Ie>=jo?$:$+Ne.height,0),[S,jo]),ff=rM(),cw=u.invert||d,Xa=st==="loading";Sr.current=j.useMemo(()=>jo*ae+df,[jo,df]),j.useEffect(()=>{Ue.current=uf},[uf]),j.useEffect(()=>{X(!0)},[]),j.useEffect(()=>{const $=se.current;if($){const Ne=$.getBoundingClientRect().height;return $e(Ne),w(Ie=>[{toastId:u.id,height:Ne,position:u.position},...Ie]),()=>w(Ie=>Ie.filter(ot=>ot.toastId!==u.id))}},[w,u.id]),j.useLayoutEffect(()=>{if(!W)return;const $=se.current,Ne=$.style.height;$.style.height="auto";const Ie=$.getBoundingClientRect().height;$.style.height=Ne,$e(Ie),w(ot=>ot.find(Me=>Me.toastId===u.id)?ot.map(Me=>Me.toastId===u.id?{...Me,height:Ie}:Me):[{toastId:u.id,height:Ie,position:u.position},...ot])},[W,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const an=j.useCallback(()=>{fe(!0),we(Sr.current),w($=>$.filter(Ne=>Ne.toastId!==u.id)),setTimeout(()=>{E(u)},gM)},[u,E,w,Sr]);j.useEffect(()=>{if(u.promise&&st==="loading"||u.duration===1/0||u.type==="loading")return;let $;return v||y||ff?(()=>{if(cf.current<Ya.current){const ot=new Date().getTime()-Ya.current;Ue.current=Ue.current-ot}cf.current=new Date().getTime()})():(()=>{Ue.current!==1/0&&(Ya.current=new Date().getTime(),$=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),an()},Ue.current))})(),()=>clearTimeout($)},[v,y,u,st,ff,an]),j.useEffect(()=>{u.delete&&(an(),u.onDismiss==null||u.onDismiss.call(u,u))},[an,u.delete]);function dw(){var $;if(te!=null&&te.loading){var Ne;return j.createElement("div",{className:It(z==null?void 0:z.loader,u==null||(Ne=u.classNames)==null?void 0:Ne.loader,"sonner-loader"),"data-visible":st==="loading"},te.loading)}return j.createElement(ZR,{className:It(z==null?void 0:z.loader,u==null||($=u.classNames)==null?void 0:$.loader),visible:st==="loading"})}const fw=u.icon||(te==null?void 0:te[st])||XR(st);var hf,pf;return j.createElement("li",{tabIndex:0,ref:se,className:It(P,ow,z==null?void 0:z.toast,u==null||(t=u.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[st],u==null||(n=u.classNames)==null?void 0:n[st]),"data-sonner-toast":"","data-rich-colors":(hf=u.richColors)!=null?hf:b,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":W,"data-promise":!!u.promise,"data-swiped":Hn,"data-removed":Q,"data-visible":Ka,"data-y-position":lw,"data-x-position":uw,"data-index":m,"data-front":xr,"data-swiping":Qe,"data-dismissible":wr,"data-type":st,"data-invert":cw,"data-swipe-out":Kt,"data-swipe-direction":B,"data-expanded":!!(v||pe&&W),"data-testid":u.testId,style:{"--index":m,"--toasts-before":m,"--z-index":g.length-m,"--offset":`${Q?G:Sr.current}px`,"--initial-height":pe?"auto":`${Ze}px`,...k,...u.style},onDragEnd:()=>{Z(!1),V(null),Er.current=null},onPointerDown:$=>{$.button!==2&&(Xa||!wr||(Et.current=new Date,we(Sr.current),$.target.setPointerCapture($.pointerId),$.target.tagName!=="BUTTON"&&(Z(!0),Er.current={x:$.clientX,y:$.clientY})))},onPointerUp:()=>{var $,Ne,Ie;if(Kt||!wr)return;Er.current=null;const ot=Number((($=se.current)==null?void 0:$.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ro=Number(((Ne=se.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Me=new Date().getTime()-((Ie=Et.current)==null?void 0:Ie.getTime()),ht=_==="x"?ot:Ro,Mo=Math.abs(ht)/Me;if(Math.abs(ht)>=mM||Mo>.11){we(Sr.current),u.onDismiss==null||u.onDismiss.call(u,u),ne(_==="x"?ot>0?"right":"left":Ro>0?"down":"up"),an(),Wn(!0);return}else{var kt,Ct;(kt=se.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Ct=se.current)==null||Ct.style.setProperty("--swipe-amount-y","0px")}A(!1),Z(!1),V(null)},onPointerMove:$=>{var Ne,Ie,ot;if(!Er.current||!wr||((Ne=window.getSelection())==null?void 0:Ne.toString().length)>0)return;const Me=$.clientY-Er.current.y,ht=$.clientX-Er.current.x;var Mo;const kt=(Mo=e.swipeDirections)!=null?Mo:yM(Y);!_&&(Math.abs(ht)>1||Math.abs(Me)>1)&&V(Math.abs(ht)>Math.abs(Me)?"x":"y");let Ct={x:0,y:0};const mf=Gn=>1/(1.5+Math.abs(Gn)/20);if(_==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&Me<0||kt.includes("bottom")&&Me>0)Ct.y=Me;else{const Gn=Me*mf(Me);Ct.y=Math.abs(Gn)<Math.abs(Me)?Gn:Me}}else if(_==="x"&&(kt.includes("left")||kt.includes("right")))if(kt.includes("left")&&ht<0||kt.includes("right")&&ht>0)Ct.x=ht;else{const Gn=ht*mf(ht);Ct.x=Math.abs(Gn)<Math.abs(ht)?Gn:ht}(Math.abs(Ct.x)>0||Math.abs(Ct.y)>0)&&A(!0),(Ie=se.current)==null||Ie.style.setProperty("--swipe-amount-x",`${Ct.x}px`),(ot=se.current)==null||ot.style.setProperty("--swipe-amount-y",`${Ct.y}px`)}},aw&&!u.jsx&&st!=="loading"?j.createElement("button",{"aria-label":N,"data-disabled":Xa,"data-close-button":!0,onClick:Xa||!wr?()=>{}:()=>{an(),u.onDismiss==null||u.onDismiss.call(u,u)},className:It(z==null?void 0:z.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(pf=te==null?void 0:te.close)!=null?pf:nM):null,(st||u.icon||u.promise)&&u.icon!==null&&((te==null?void 0:te[st])!==null||u.icon)?j.createElement("div",{"data-icon":"",className:It(z==null?void 0:z.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||dw():null,u.type!=="loading"?fw:null):null,j.createElement("div",{"data-content":"",className:It(z==null?void 0:z.content,u==null||(o=u.classNames)==null?void 0:o.content)},j.createElement("div",{"data-title":"",className:It(z==null?void 0:z.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?j.createElement("div",{"data-description":"",className:It(D,iw,z==null?void 0:z.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),j.isValidElement(u.cancel)?u.cancel:u.cancel&&oi(u.cancel)?j.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||C,onClick:$=>{oi(u.cancel)&&wr&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,$),an())},className:It(z==null?void 0:z.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,j.isValidElement(u.action)?u.action:u.action&&oi(u.action)?j.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||M,onClick:$=>{oi(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,$),!$.defaultPrevented&&an())},className:It(z==null?void 0:z.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Em(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xM(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?fM:dM;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const wM=j.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:d,mobileOffset:u,theme:f="light",richColors:y,duration:w,style:x,visibleToasts:S=cM,toastOptions:m,dir:g=Em(),gap:v=pM,icons:E,containerAriaLabel:b="Notifications"}=t,[T,k]=j.useState([]),C=j.useMemo(()=>r?T.filter(W=>W.toasterId===r):T.filter(W=>!W.toasterId),[T,r]),M=j.useMemo(()=>Array.from(new Set([o].concat(C.filter(W=>W.position).map(W=>W.position)))),[C,o]),[P,D]=j.useState([]),[L,Y]=j.useState(!1),[ae,pe]=j.useState(!1),[z,te]=j.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=j.useRef(null),_=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),V=j.useRef(null),B=j.useRef(!1),ne=j.useCallback(W=>{k(X=>{var Q;return(Q=X.find(fe=>fe.id===W.id))!=null&&Q.delete||qe.dismiss(W.id),X.filter(({id:fe})=>fe!==W.id)})},[]);return j.useEffect(()=>qe.subscribe(W=>{if(W.dismiss){requestAnimationFrame(()=>{k(X=>X.map(Q=>Q.id===W.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{Iy.flushSync(()=>{k(X=>{const Q=X.findIndex(fe=>fe.id===W.id);return Q!==-1?[...X.slice(0,Q),{...X[Q],...W},...X.slice(Q+1)]:[W,...X]})})})}),[T]),j.useEffect(()=>{if(f!=="system"){te(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:X})=>{te(X?"dark":"light")})}catch{W.addListener(({matches:Q})=>{try{te(Q?"dark":"light")}catch(fe){console.error(fe)}})}},[f]),j.useEffect(()=>{T.length<=1&&Y(!1)},[T]),j.useEffect(()=>{const W=X=>{var Q;if(i.every(Z=>X[Z]||X.code===Z)){var Qe;Y(!0),(Qe=N.current)==null||Qe.focus()}X.code==="Escape"&&(document.activeElement===N.current||(Q=N.current)!=null&&Q.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[i]),j.useEffect(()=>{if(N.current)return()=>{V.current&&(V.current.focus({preventScroll:!0}),V.current=null,B.current=!1)}},[N.current]),j.createElement("section",{ref:n,"aria-label":`${b} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((W,X)=>{var Q;const[fe,Qe]=W.split("-");return C.length?j.createElement("ol",{key:W,dir:g==="auto"?Em():g,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":fe,"data-x-position":Qe,style:{"--front-toast-height":`${((Q=P[0])==null?void 0:Q.height)||0}px`,"--width":`${hM}px`,"--gap":`${v}px`,...x,...xM(d,u)},onBlur:Z=>{B.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(B.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||B.current||(B.current=!0,V.current=Z.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{ae||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||pe(!0)},onPointerUp:()=>pe(!1)},C.filter(Z=>!Z.position&&X===0||Z.position===W).map((Z,Kt)=>{var Wn,Hn;return j.createElement(vM,{key:Z.id,icons:E,index:Kt,toast:Z,defaultRichColors:y,duration:(Wn=m==null?void 0:m.duration)!=null?Wn:w,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:s,visibleToasts:S,closeButton:(Hn=m==null?void 0:m.closeButton)!=null?Hn:l,interacting:ae,position:W,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,closeButtonAriaLabel:m==null?void 0:m.closeButtonAriaLabel,removeToast:ne,toasts:C.filter(A=>A.position==Z.position),heights:P.filter(A=>A.position==Z.position),setHeights:D,expandByDefault:a,gap:v,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),tw=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,nw=5,rw=3e3;function KM(e,t){const n=p.useRef(null),r=p.useRef(0),s=p.useRef(!0),o=p.useRef(!1),i=p.useRef(t);i.current=t;const a=p.useRef(!1),l=p.useCallback(w=>{var x;((x=n.current)==null?void 0:x.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(w))},[]),c=p.useCallback((w,x)=>{var S;((S=n.current)==null?void 0:S.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:w,rows:x})),a.current=!1):a.current=!0},[]),d=p.useCallback(w=>{l({type:"terminal_input",data:w})},[l]),u=p.useCallback((w,x)=>{l({type:"terminal_resize",cols:w,rows:x})},[l]),f=p.useCallback(()=>{l({type:"chat_subscribe"})},[l]),y=p.useCallback(()=>{if(!s.current||o.current)return;const w=vr();if(!w){window.location.href="/login";return}o.current=!0;const x=new WebSocket(`${tw}/ws/projects/${e}`);n.current=x,x.onopen=()=>{o.current=!1,r.current=0,x.send(JSON.stringify({type:"auth",token:w}))},x.onmessage=S=>{var g,v,E,b,T,k,C,M;let m;try{m=JSON.parse(S.data)}catch{return}switch(m.type){case"connected":a.current=!1,(v=(g=i.current).onConnected)==null||v.call(g);break;case"terminal_data":(b=(E=i.current).onTerminalData)==null||b.call(E,m.data);break;case"status":(k=(T=i.current).onStatus)==null||k.call(T,m.status);break;case"chat_message":{const P=m;(M=(C=i.current).onChatMessage)==null||M.call(C,P);break}case"error":console.error("[WS] Server error:",m.message);break}},x.onclose=()=>{o.current=!1,n.current=null,s.current&&r.current<nw&&(r.current++,setTimeout(y,rw))},x.onerror=S=>{o.current=!1,console.error("[WS] WebSocket error:",S)}},[e]);return p.useEffect(()=>(s.current=!0,y(),()=>{var w;s.current=!1,(w=n.current)==null||w.close(),n.current=null}),[y]),{subscribeTerminal:c,sendTerminalInput:d,sendTerminalResize:u,subscribeChatMessages:f}}function SM(e){const t=p.useRef(null),n=p.useRef(0),r=p.useRef(!0),s=p.useRef(!1),o=p.useRef(e);o.current=e;const i=p.useCallback(()=>{if(!r.current||s.current)return;const a=vr();if(!a)return;s.current=!0;const l=new WebSocket(`${tw}/ws/dashboard`);t.current=l,l.onopen=()=>{s.current=!1,n.current=0,l.send(JSON.stringify({type:"auth",token:a}))},l.onmessage=c=>{var d,u;try{const f=JSON.parse(c.data);f.type==="activity_update"?o.current.onActivityUpdate(f):f.type==="project_stopped"&&((u=(d=o.current).onProjectStopped)==null||u.call(d,f.projectId,f.projectName))}catch{}},l.onclose=()=>{s.current=!1,t.current=null,r.current&&n.current<nw&&(n.current++,setTimeout(i,rw))},l.onerror=c=>{s.current=!1,console.error("[DashboardWS] Error:",c)}},[]);p.useEffect(()=>(r.current=!0,i(),()=>{var a;r.current=!1,(a=t.current)==null||a.close(),t.current=null}),[i])}function EM(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}const km=5*36e5;function kM(e){if(!e||e.utilization===void 0||e.utilization<=0||!e.resetAt)return null;const t=new Date(e.resetAt).getTime()-Date.now();if(t<=0)return null;const n=km-t;return n<=0?null:Math.round(e.utilization/(n/km))}function ii({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",s=EM(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:q("font-medium",r),children:[n,"%"]}),s&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",s,")"]})]})}function CM({className:e}){const[t,n]=p.useState("loading"),[r,s]=p.useState(!1);p.useEffect(()=>{const f=async()=>{try{n(await dx())}catch{n(null)}};f();const y=setInterval(()=>void f(),5*60*1e3);return()=>clearInterval(y)},[]);const o=async()=>{s(!0);try{n(await fx())}catch{n(null)}finally{s(!1)}};if(t==="loading"||!t)return null;const i=!!t.fiveHour,a=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=i||a||l||c,u=kM(t.fiveHour);return h.jsxs("div",{className:q("flex items-center gap-1.5 text-xs",e),children:[u!==null&&h.jsxs("span",{className:q("font-medium",u<=100?"text-green-400":"text-orange-400"),title:`5h 使用进度:按当前速率,窗口结束时预计使用 ${u}%`,children:[u,"%"]}),t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(ii,{label:"5h",bucket:t.fiveHour}),a&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void o(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(KN,{className:q("h-3 w-3",r&&"animate-spin")})})]})}function bM(){const[e,t]=p.useState([]),[n,r]=p.useState(!1),[s,o]=p.useState(""),[i,a]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,y]=p.useState(""),[w,x]=p.useState(""),[S,m]=p.useState(""),g=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{ax().then(t).catch(()=>t([]))},[]),p.useEffect(()=>{n&&setTimeout(()=>{var k;return(k=g.current)==null?void 0:k.focus()},0)},[n]),p.useEffect(()=>{d&&setTimeout(()=>{var k;return(k=v.current)==null?void 0:k.focus()},0)},[d]);const E=async()=>{const k=i.trim();if(k)try{const C=await lx({label:s.trim()||k,command:k,...l?{parentId:l}:{}});t(M=>[...M,C]),o(""),a(""),c(""),r(!1)}catch(C){console.error("[GlobalShortcuts] Failed to add:",C)}},b=async k=>{try{await cx(k),t(C=>C.filter(M=>M.id!==k)),d===k&&u(null)}catch(C){console.error("[GlobalShortcuts] Failed to delete:",C)}},T=async()=>{const k=w.trim();if(!(!k||!d))try{const C=await ux(d,{label:f.trim()||k,command:k,parentId:S||null});t(M=>M.map(P=>P.id===d?C:P)),u(null)}catch(C){console.error("[GlobalShortcuts] Failed to save:",C)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(im,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(k=>!k),u(null)},className:q("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(fa,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:g,placeholder:"名称(可选)",value:s,onChange:k=>o(k.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:k=>a(k.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E()),k.key==="Escape"&&(r(!1),o(""),a(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:k=>c(k.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(k=>h.jsx("option",{value:k.id,children:k.label},k.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),o(""),a("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!i.trim(),className:q("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(im,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(k=>d===k.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:v,value:f,onChange:C=>y(C.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:w,onChange:C=>x(C.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),T()),C.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:S,onChange:C=>m(C.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(C=>C.id!==k.id).map(C=>h.jsx("option",{value:C.id,children:C.label},C.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void T(),disabled:!w.trim(),className:q("text-xs px-2.5 py-1 rounded transition-colors text-white",w.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},k.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:k.label}),k.parentId&&(()=>{const C=e.find(M=>M.id===k.parentId);return C?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx($l,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",C.label]})]}):null})(),!k.parentId&&k.label!==k.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:k.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(k.id),y(k.label),x(k.command),m(k.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(yx,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void b(k.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(rf,{className:"h-3.5 w-3.5"})})]})]},k.id))})]})}const sw=p.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function TM(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function PM(){return p.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>TM())}function NM({children:e}){const[t,n]=p.useState(()=>jP(Us.theme,"system")),r=PM(),s=t==="system"?r:t;p.useEffect(()=>{const i=document.documentElement;i.classList.remove("light","dark"),i.classList.add(s)},[s]);const o=i=>{n(i),Z0(Us.theme,i)};return h.jsx(sw.Provider,{value:{theme:t,resolved:s,setTheme:o},children:e})}function jM(){return p.useContext(sw)}function RM(){const{theme:e,setTheme:t}=jM(),n=[{value:"light",icon:ZN,label:"浅色"},{value:"dark",icon:GN,label:"深色"},{value:"system",icon:HN,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:s,label:o})=>h.jsx("button",{onClick:()=>t(r),className:q("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:h.jsx(s,{className:"h-3.5 w-3.5"})},r))})}function MM(){const e=Aa(),{projects:t,loading:n,error:r,fetchProjects:s,addProject:o,updateProject:i,removeProject:a}=_P(),l=hr(A=>A.clearToken),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[y,w]=p.useState(new Set),x=p.useRef(new Map),[S,m]=p.useState(new Map),g=p.useRef(0),[v,E]=p.useState(!!document.fullscreenElement),[b,T]=p.useState(!1),[k,C]=p.useState(""),[M,P]=p.useState([]),[D,L]=p.useState(!1);p.useEffect(()=>{if(!k.trim()||k.trim().length<2){P([]);return}const A=setTimeout(()=>{L(!0),mx(k).then(G=>P(G)).catch(()=>P([])).finally(()=>L(!1))},400);return()=>clearTimeout(A)},[k]);const Y=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};p.useEffect(()=>{const A=()=>E(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]),p.useEffect(()=>{s()},[s]),p.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]);const ae=2e3,pe=3,z=8e3,te=p.useCallback(A=>{const G=Date.now(),we=x.current;if(G-A.lastActivityAt<ae){w(se=>se.has(A.projectId)?se:new Set(se).add(A.projectId));const Ze=we.get(A.projectId)??[];let $e=!1;if(A.semantic){const se=Ze[Ze.length-1],xr=`${A.semantic.phase}:${A.semantic.detail??""}`,Ka=se?`${se.phase}:${se.detail??""}`:"";xr!==Ka?(Ze.push({id:g.current++,phase:A.semantic.phase,detail:A.semantic.detail,ts:G}),$e=!0):se&&(se.ts=G)}const Ue=Ze.filter(se=>G-se.ts<z),Et=Ue.length>pe?Ue.slice(-pe):Ue;Et.length!==Ze.length&&($e=!0),we.set(A.projectId,Et),$e&&m(new Map(we))}else w(Ze=>{if(!Ze.has(A.projectId))return Ze;const $e=new Set(Ze);return $e.delete(A.projectId),$e}),we.has(A.projectId)&&we.get(A.projectId).length>0&&(we.set(A.projectId,[]),m(new Map(we)))},[]),N=p.useCallback((A,G)=>{"Notification"in window&&Notification.permission==="granted"&&new Notification("Claude 已完成",{body:`项目「${G}」的任务已完成`,icon:"/terminal.svg"})},[]);SM({onActivityUpdate:te,onProjectStopped:N}),p.useEffect(()=>{const A=setInterval(()=>{const G=Date.now(),we=x.current;let Ze=!1;for(const[$e,Ue]of we){const Et=Ue.filter(se=>G-se.ts<z);Et.length!==Ue.length&&(we.set($e,Et),Ze=!0)}Ze&&m(new Map(we)),w($e=>{let Ue=!1;const Et=new Set($e);for(const se of $e){const xr=we.get(se);(!xr||xr.length===0)&&(Et.delete(se),Ue=!0)}return Ue?Et:$e})},3e3);return()=>clearInterval(A)},[]);const _=()=>{l(),e("/login")},V=A=>{o(A)},B=A=>{o(A)},ne=async A=>{try{await sx(A),a(A)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to delete project")}},W=async A=>{try{const G=await ox(A);i(G)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to archive project")}},X=async A=>{try{const G=await ix(A);i(G)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to restore project")}},Q=p.useMemo(()=>t.filter(A=>!A.archived),[t]),fe=p.useMemo(()=>t.filter(A=>A.archived),[t]),Qe=p.useMemo(()=>Array.from(new Set(t.flatMap(A=>A.tags??[]))),[t]),[Z,Kt]=p.useState([]),Wn=p.useMemo(()=>Z.length===0?Q:Q.filter(A=>Z.some(G=>{var we;return(we=A.tags)==null?void 0:we.includes(G)})),[Q,Z]),Hn={onDelete:A=>void ne(A),onArchive:A=>void W(A),onUnarchive:A=>void X(A),onUpdated:i};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(om,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(CM,{}),h.jsxs("div",{className:"relative",children:[h.jsx(YN,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),h.jsx(po,{placeholder:"搜索历史对话…",value:k,onChange:A=>C(A.target.value),className:"pl-8 h-8 text-xs w-48"}),k.trim().length>=2&&h.jsxs("div",{className:"absolute top-full mt-1 right-0 w-96 max-h-80 overflow-y-auto bg-popover border border-border rounded-lg shadow-xl z-50",children:[D&&h.jsx("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"搜索中…"}),!D&&M.length===0&&h.jsx("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"无结果"}),M.map((A,G)=>h.jsxs("button",{className:"w-full text-left px-4 py-2.5 hover:bg-muted transition-colors border-b border-border last:border-0",onClick:()=>{e(`/project/${A.projectId}`),C("")},children:[h.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:A.projectName}),h.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:new Date(A.startedAt).toLocaleDateString("zh-CN")})]}),h.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed line-clamp-2",children:A.snippet})]},G))]})]}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:h.jsx(QN,{className:"h-4 w-4"})}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(XN,{className:"h-4 w-4"})}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:Y,title:v?"Exit fullscreen":"Fullscreen",children:v?h.jsx(WN,{className:"h-4 w-4"}):h.jsx(UN,{className:"h-4 w-4"})}),h.jsx(RM,{}),h.jsxs(oe,{variant:"ghost",size:"sm",onClick:_,children:[h.jsx($N,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(oe,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(yc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(oe,{onClick:()=>d(!0),children:[h.jsx(fa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&h.jsx("div",{className:"text-center text-destructive py-12",children:r}),!n&&!r&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(om,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(oe,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(yc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(oe,{onClick:()=>d(!0),children:[h.jsx(fa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&Qe.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[Qe.map(A=>h.jsxs("button",{onClick:()=>Kt(G=>G.includes(A)?G.filter(we=>we!==A):[...G,A]),className:q("px-2 py-0.5 rounded-full text-xs border transition-colors",Z.includes(A)?"bg-blue-500/20 text-blue-400 border-blue-500/40":"bg-muted text-muted-foreground border-border hover:border-muted-foreground/40"),children:["#",A]},A)),Z.length>0&&h.jsx("button",{onClick:()=>Kt([]),className:"px-2 py-0.5 rounded-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:"清除"})]}),!n&&!r&&Wn.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Wn.map((A,G)=>h.jsx(An.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:G*.05,ease:"easeOut"},children:h.jsx(xm,{project:A,active:y.has(A.id),statusStack:S.get(A.id)??[],...Hn})},A.id))}),!n&&!r&&fe.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>T(A=>!A),children:[h.jsx(An.span,{animate:{rotate:b?90:0},transition:{duration:.2},children:h.jsx(gx,{className:"h-4 w-4"})}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:fe.length})]}),h.jsx(Kd,{children:b&&h.jsx(An.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:fe.map(A=>h.jsx(xm,{project:A,active:!1,...Hn},A.id))})})})]}),h.jsx(bM,{})]}),h.jsx(GR,{open:c,onOpenChange:d,onCreated:V}),h.jsx(KR,{open:u,onOpenChange:f,onOpened:B})]})}class AM extends j.Component{constructor(){super(...arguments);Qa(this,"state",{hasError:!1,error:null});Qa(this,"handleReset",()=>{var n,r;this.setState({hasError:!1,error:null}),(r=(n=this.props).onReset)==null||r.call(n)})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack),Ri.error(n.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:h.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[h.jsx("p",{children:"出错了"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}const DM=j.lazy(()=>Eo(()=>import("./ProjectPage-Cur4elk1.js").then(e=>e.P),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.ProjectPage}))),LM=j.lazy(()=>Eo(()=>import("./SettingsPage-DnAH9VWu.js"),__vite__mapDeps([7,1,2])).then(e=>({default:e.SettingsPage}))),_M=j.lazy(()=>Eo(()=>import("./SkillHubPage-CoM63_GP.js"),__vite__mapDeps([8,5,3,2])).then(e=>({default:e.SkillHubPage}))),OM=j.lazy(()=>Eo(()=>import("./ShareViewPage-CcquAbhh.js"),__vite__mapDeps([9,5,4])).then(e=>({default:e.ShareViewPage})));function IM(){return h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:h.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function ai({children:e}){const[t,n]=p.useState(!1),r=hr(o=>o.token),s=hr(o=>o.setToken);return p.useEffect(()=>{if(r){n(!0);return}da()?nf().then(o=>s(o)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),!t&&!r?null:r?h.jsx(h.Fragment,{children:e}):h.jsx(Qy,{to:"/login",replace:!0})}function VM(){return h.jsxs(NM,{children:[h.jsx(wM,{richColors:!0,position:"bottom-right"}),h.jsx(AM,{children:h.jsx(OE,{children:h.jsx(p.Suspense,{fallback:h.jsx(IM,{}),children:h.jsxs(DE,{children:[h.jsx(dn,{path:"/login",element:h.jsx(MN,{})}),h.jsx(dn,{path:"/",element:h.jsx(ai,{children:h.jsx(MM,{})})}),h.jsx(dn,{path:"/projects/:id",element:h.jsx(ai,{children:h.jsx(DM,{})})}),h.jsx(dn,{path:"/settings",element:h.jsx(ai,{children:h.jsx(LM,{})})}),h.jsx(dn,{path:"/skillhub",element:h.jsx(ai,{children:h.jsx(_M,{})})}),h.jsx(dn,{path:"/share/:token",element:h.jsx(OM,{})}),h.jsx(dn,{path:"*",element:h.jsx(Qy,{to:"/",replace:!0})})]})})})})]})}Zl.createRoot(document.getElementById("root")).render(h.jsx(j.StrictMode,{children:h.jsx(VM,{})}));export{PN as $,Kd as A,Ha as B,gx as C,lf as D,VN as E,yc as F,$l as G,Ga as H,po as I,Wa as J,oe as K,kn as L,WN as M,GP as N,HP as O,yx as P,XP as Q,j as R,Us as S,EN as T,IN as U,kN as V,CN as W,rf as X,bN as Y,im as Z,Eo as _,BM as a,BP as a0,NN as a1,$P as a2,Va as a3,oj as a4,Ul as a5,yr as a6,on as a7,Ln as a8,Fa as a9,_P as aA,go as aB,rN as aC,oN as aD,aN as aE,Zd as aF,qd as aG,Jd as aH,ef as aI,vx as aJ,wN as aK,sN as aL,uN as aM,dN as aN,hN as aO,iN as aP,fN as aQ,cN as aR,SN as aS,mo as aT,gd as aU,YP as aV,QP as aW,jN as aX,$M as aY,Cx as aa,ej as ab,SR as ac,Ax as ad,_j as ae,Ex as af,wx as ag,pN as ah,gN as ai,mN as aj,vN as ak,Aa as al,ON as am,Zn as an,CM as ao,RM as ap,xN as aq,lN as ar,FP as as,zP as at,YN as au,yN as av,HM as aw,KM as ax,om as ay,UM as az,vr as b,ee as c,JP as d,q as e,UN as f,Cm as g,ZP as h,jP as i,h as j,hx as k,KN as l,qP as m,sm as n,An as o,WP as p,ax as q,p as r,Z0 as s,Ri as t,jM as u,fa as v,eN as w,KP as x,$a as y,Ua as z};
|
|
275
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},OR="DialogDescriptionWarning",IR=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Yx(OR).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},VR=_x,FR=Vx,Xx=Fx,Qx=zx,Zx=$x,qx=Wx,zR=Gx;const lf=VR,BR=FR,Jx=p.forwardRef(({className:e,...t},n)=>h.jsx(Xx,{ref:n,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jx.displayName=Xx.displayName;const $a=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(BR,{children:[h.jsx(Jx,{}),h.jsxs(Qx,{ref:r,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(zR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(rf,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$a.displayName=Qx.displayName;const Ua=({className:e,...t})=>h.jsx("div",{className:q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ua.displayName="DialogHeader";const Wa=({className:e,...t})=>h.jsx("div",{className:q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wa.displayName="DialogFooter";const Ha=p.forwardRef(({className:e,...t},n)=>h.jsx(Zx,{ref:n,className:q("text-lg font-semibold leading-none tracking-tight",e),...t}));Ha.displayName=Zx.displayName;const Ga=p.forwardRef(({className:e,...t},n)=>h.jsx(qx,{ref:n,className:q("text-sm text-muted-foreground",e),...t}));Ga.displayName=qx.displayName;function $R({project:e,open:t,onOpenChange:n,onUpdated:r}){const[s,o]=p.useState([]),[i,a]=p.useState([]),[l,c]=p.useState(!1),[d,u]=p.useState(null);p.useEffect(()=>{if(!t)return;o(e.shares?[...e.shares]:[]),u(null);let g=!1;return ex().then(v=>{g||a(v)}).catch(()=>{}),()=>{g=!0}},[t,e.id]);const f=new Set(s.map(g=>g.username)),y=i.filter(g=>g!==e.owner&&!f.has(g)),w=g=>{o(v=>[...v,{username:g,permission:"view"}])},x=g=>{o(v=>v.filter(E=>E.username!==g))},S=g=>{o(v=>v.map(E=>E.username===g?{...E,permission:E.permission==="view"?"edit":"view"}:E))},m=async()=>{c(!0),u(null);try{const g=await tx(e.id,s);r(g),n(!1)}catch(g){u(g instanceof Error?g.message:"Failed to update shares")}finally{c(!1)}};return h.jsx(lf,{open:t,onOpenChange:n,children:h.jsxs($a,{className:"sm:max-w-md",children:[h.jsxs(Ua,{children:[h.jsxs(Ha,{className:"flex items-center gap-2",children:[h.jsx(vc,{className:"h-4 w-4"}),"共享设置"]}),h.jsx(Ga,{children:"选择用户并设置权限:可见(只读)或可编辑(读写+终端)"})]}),h.jsxs("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:[s.length===0&&h.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"尚未共享给任何用户"}),s.map(g=>h.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[h.jsx("span",{className:"text-sm font-medium",children:g.username}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("button",{onClick:()=>S(g.username),className:"focus:outline-none",children:h.jsx(Zn,{variant:g.permission==="edit"?"default":"secondary",className:"cursor-pointer text-xs",children:g.permission==="edit"?"可编辑":"可见"})}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>x(g.username),children:h.jsx(vx,{className:"h-3.5 w-3.5"})})]})]},g.username))]}),y.length>0&&h.jsxs("div",{className:"border-t pt-3",children:[h.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"添加用户"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:y.map(g=>h.jsxs(oe,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>w(g),children:[h.jsx(fa,{className:"h-3 w-3"}),g]},g))})]}),d&&h.jsx("p",{className:"text-sm text-destructive",children:d}),h.jsxs(Wa,{children:[h.jsx(oe,{variant:"outline",onClick:()=>n(!1),disabled:l,children:"取消"}),h.jsx(oe,{onClick:()=>void m(),disabled:l,children:l?"保存中...":"保存"})]})]})})}function UR(e,t){switch(e){case"thinking":return"Thinking…";case"tool_use":return t?`${t}`:"Tool…";case"tool_result":return"Reading…";case"text":return"Writing…"}}function WR({status:e}){return h.jsx("span",{className:q("inline-block w-2 h-2 rounded-full",{"bg-green-500":e==="running","bg-zinc-400":e==="stopped","bg-yellow-400 animate-pulse":e==="restarting"})})}const xm=j.memo(function({project:t,active:n=!1,statusStack:r=[],onDelete:s,onArchive:o,onUnarchive:i,onUpdated:a}){var g,v;const l=Aa(),[c,d]=p.useState(!1),u=!!t._sharedPermission,f=t._sharedPermission==="view",y=E=>{E.stopPropagation(),confirm(`Delete project "${t.name}"? This cannot be undone.`)&&s(t.id)},w=E=>{E.stopPropagation(),o(t.id)},x=E=>{E.stopPropagation(),i(t.id)},S=h.jsx(An.div,{whileHover:!t.archived&&!n?{y:-2}:{},transition:{duration:.2},children:h.jsxs(Zd,{className:q("group cursor-pointer transition-colors relative",t.archived?"opacity-60 hover:opacity-80 hover:border-zinc-400":n?"border-transparent hover:border-transparent bg-transparent shadow-none":"hover:border-zinc-400 hover:shadow-md"),onClick:()=>!t.archived&&l(`/projects/${t.id}`),children:[h.jsxs(qd,{className:"pb-2",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2",children:[h.jsx(Jd,{className:q("text-base leading-tight",t.archived&&"text-muted-foreground"),children:t.name}),h.jsx("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:!u&&h.jsxs(h.Fragment,{children:[t.archived?h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:x,title:"Restore project",children:h.jsx(LN,{className:"h-3.5 w-3.5"})}):h.jsxs(h.Fragment,{children:[h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:E=>{E.stopPropagation(),d(!0)},title:"共享设置",children:h.jsx(vc,{className:"h-3.5 w-3.5"})}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:w,title:"Archive project",children:h.jsx(_N,{className:"h-3.5 w-3.5"})})]}),h.jsx(oe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:y,title:"Delete project",children:h.jsx(vx,{className:"h-3.5 w-3.5"})})]})})]}),h.jsx("div",{className:"flex items-center gap-1.5",children:t.archived?h.jsx(Zn,{variant:"secondary",className:"text-xs",children:"Archived"}):h.jsxs(h.Fragment,{children:[h.jsx(WR,{status:t.status}),h.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:t.status}),n&&r.length>0&&h.jsx("div",{className:"ml-auto",children:h.jsx(Kd,{mode:"wait",children:r.slice(-1).map(E=>h.jsx(An.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.25,ease:"easeOut"},children:h.jsx(Zn,{variant:"outline",className:"text-xs font-normal whitespace-nowrap",children:UR(E.phase,E.detail)})},E.id))})})]})})]}),h.jsxs(ef,{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[h.jsx(yc,{className:"h-3.5 w-3.5 flex-shrink-0"}),h.jsx("span",{className:"truncate font-mono",children:t.folderPath})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Zn,{variant:"outline",className:"text-xs font-mono",children:t.cliTool??"claude"}),h.jsx(Zn,{variant:t.permissionMode==="unlimited"?"destructive":"secondary",className:"text-xs",children:t.permissionMode==="unlimited"?"Unlimited":"Limited"}),u&&h.jsxs(Zn,{variant:"outline",className:"text-xs gap-0.5",children:[f?h.jsx(VN,{className:"h-3 w-3"}):h.jsx(yx,{className:"h-3 w-3"}),f?"可见":"可编辑"]}),!u&&t.shares&&t.shares.length>0&&h.jsxs(Zn,{variant:"outline",className:"text-xs gap-0.5",children:[h.jsx(vc,{className:"h-3 w-3"}),t.shares.length]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.createdAt).toLocaleDateString()})]}),(t.tags??[]).length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[(t.tags??[]).slice(0,3).map(E=>h.jsxs("span",{className:"px-1.5 py-0 rounded-full text-[10px] bg-muted text-muted-foreground border border-border",children:["#",E]},E)),(((g=t.tags)==null?void 0:g.length)??0)>3&&h.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["+",(((v=t.tags)==null?void 0:v.length)??0)-3]})]})]})]})}),m=n&&!t.archived?h.jsx("div",{className:"card-active-glow rounded-lg",children:S}):S;return h.jsxs(h.Fragment,{children:[m,!u&&a&&h.jsx($R,{project:t,open:c,onOpenChange:d,onUpdated:a})]})});function ew({onSelect:e}){const[t,n]=p.useState(""),[r,s]=p.useState(null),[o,i]=p.useState([]),[a,l]=p.useState(!0),[c,d]=p.useState(null),[u,f]=p.useState(!1),[y,w]=p.useState(""),[x,S]=p.useState(null),[m,g]=p.useState(!1),v=p.useRef(null),E=async D=>{l(!0),d(null);try{const L=await hx(D);n(L.path),s(L.parent),i(L.entries)}catch(L){d(L instanceof Error?L.message:"Failed to load directory")}finally{l(!1)}};p.useEffect(()=>{E()},[]),p.useEffect(()=>{u&&setTimeout(()=>{var D;return(D=v.current)==null?void 0:D.focus()},0)},[u]);const b=()=>{w(""),S(null),f(!0)},T=()=>{f(!1),w(""),S(null)},k=async()=>{const D=y.trim();if(D){g(!0),S(null);try{const{path:L}=await px(t,D);f(!1),w(""),await E(t),E(L)}catch(L){S(L instanceof Error?L.message:"Failed to create folder")}finally{g(!1)}}},C=D=>{D.key==="Enter"?(D.preventDefault(),k()):D.key==="Escape"&&T()},M=t.split("/").filter(Boolean),P=D=>{const L="/"+M.slice(0,D+1).join("/");E(L)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(oe,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void E(),title:"Home",children:h.jsx(BN,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:M.map((D,L)=>h.jsxs(j.Fragment,{children:[h.jsx(gx,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>P(L),children:D})]},L))}),h.jsxs(oe,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:b,disabled:u||a||!!c,title:"New folder",children:[h.jsx(zN,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!a&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void E(r),children:[h.jsx(ON,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(sm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:v,className:q("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",x&&"border-destructive"),placeholder:"Folder name",value:y,onChange:D=>{w(D.target.value),S(null)},onKeyDown:C,disabled:m}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void k(),disabled:!y.trim()||m,title:"Create",children:h.jsx(IN,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:T,disabled:m,title:"Cancel",children:h.jsx(rf,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),x&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:x}),o.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),o.map(D=>h.jsxs("button",{className:q("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",D.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{D.type==="dir"&&E(D.path)},disabled:D.type==="file",children:[D.type==="dir"?h.jsx(sm,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(FN,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:D.name})]},D.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(oe,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const HR=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],wm={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function GR({open:e,onOpenChange:t,onCreated:n}){const[r,s]=p.useState("name"),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,d]=p.useState("claude"),[u,f]=p.useState("limited"),[y,w]=p.useState(!1),[x,S]=p.useState(null),m=()=>{s("name"),i(""),l(""),d("claude"),f("limited"),S(null),w(!1)},g=C=>{C||m(),t(C)},v=()=>{if(!o.trim()){S("Please enter a project name");return}S(null),s("folder")},E=C=>{l(C),s("settings")},b=async()=>{w(!0),S(null);try{const C=await nx({name:o.trim(),folderPath:a,permissionMode:u,cliTool:c});n(C),g(!1)}catch(C){S(C instanceof Error?C.message:"Failed to create project")}finally{w(!1)}},T={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},k=["name","folder","settings"];return h.jsx(lf,{open:e,onOpenChange:g,children:h.jsxs($a,{className:"sm:max-w-lg",children:[h.jsxs(Ua,{children:[h.jsx(Ha,{children:T[r]}),h.jsxs(Ga,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:k.map((C,M)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===C?"bg-primary":k.indexOf(r)>M?"bg-primary/40":"bg-muted"}`},C))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{htmlFor:"project-name",children:"Project Name"}),h.jsx(po,{id:"project-name",placeholder:"My Project",value:o,onChange:C=>i(C.target.value),onKeyDown:C=>{C.key==="Enter"&&v()},autoFocus:!0})]}),x&&h.jsx("p",{className:"text-sm text-destructive",children:x})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Working Directory"}),h.jsx(ew,{onSelect:E})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:HR.map(C=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===C.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:C.value,checked:c===C.value,onChange:()=>d(C.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:C.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:C.desc})]})]},C.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>f("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:wm[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>f("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:wm[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:a})]}),x&&h.jsx("p",{className:"text-sm text-destructive",children:x})]}),h.jsxs(Wa,{children:[r!=="name"&&h.jsx(oe,{variant:"outline",onClick:()=>s(r==="settings"?"folder":"name"),disabled:y,children:"Back"}),r==="name"&&h.jsx(oe,{onClick:v,children:"Next"}),r==="folder"&&h.jsx(oe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(oe,{onClick:()=>void b(),disabled:y,children:y?"Creating...":"Create Project"})]})]})})}function KR({open:e,onOpenChange:t,onOpened:n}){const[r,s]=p.useState(""),[o,i]=p.useState(!1),[a,l]=p.useState(null),c=()=>{s(""),l(null),i(!1)},d=f=>{f||c(),t(f)},u=async f=>{s(f),i(!0),l(null);try{const y=await rx(f);n(y),d(!1)}catch(y){l(y instanceof Error?y.message:"Failed to open project"),i(!1)}};return h.jsx(lf,{open:e,onOpenChange:d,children:h.jsxs($a,{className:"sm:max-w-lg",children:[h.jsxs(Ua,{children:[h.jsx(Ha,{children:"Open Existing Project"}),h.jsxs(Ga,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(kn,{children:"Project Folder"}),h.jsx(ew,{onSelect:f=>void u(f)})]}),a&&h.jsx("p",{className:"text-sm text-destructive",children:a}),r&&!a&&o&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(Wa,{children:h.jsx(oe,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"})})]})})}function YR(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const XR=e=>{switch(e){case"success":return qR;case"info":return eM;case"warning":return JR;case"error":return tM;default:return null}},QR=Array(12).fill(0),ZR=({visible:e,className:t})=>j.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},j.createElement("div",{className:"sonner-spinner"},QR.map((n,r)=>j.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),qR=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),JR=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nM=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},j.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rM=()=>{const[e,t]=j.useState(document.hidden);return j.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Sc=1;class sM{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Sc++,i=this.toasts.find(l=>l.id===o),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map(l=>l.id===o?(this.publish({...l,...t,id:o,title:r}),{...l,...t,id:o,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,i;const a=s.then(async c=>{if(i=["resolve",c],j.isValidElement(c))o=!1,this.create({id:r,type:"default",message:c});else if(iM(c)&&!c.ok){o=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(c instanceof Error){o=!1;const u=typeof n.error=="function"?await n.error(c):n.error,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:f,...w})}else if(n.success!==void 0){o=!1;const u=typeof n.success=="function"?await n.success(c):n.success,f=typeof n.description=="function"?await n.description(c):n.description,w=typeof u=="object"&&!j.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:f,...w})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){o=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,y=typeof d=="object"&&!j.isValidElement(d)?d:{message:d};this.create({id:r,type:"error",description:u,...y})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Sc++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qe=new sM,oM=(e,t)=>{const n=(t==null?void 0:t.id)||Sc++;return qe.addToast({title:e,...t,id:n}),n},iM=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",aM=oM,lM=()=>qe.toasts,uM=()=>qe.getActiveToasts(),Ri=Object.assign(aM,{success:qe.success,info:qe.info,warning:qe.warning,error:qe.error,custom:qe.custom,message:qe.message,promise:qe.promise,dismiss:qe.dismiss,loading:qe.loading},{getHistory:lM,getToasts:uM});YR("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function oi(e){return e.label!==void 0}const cM=3,dM="24px",fM="16px",Sm=4e3,hM=356,pM=14,mM=45,gM=200;function It(...e){return e.filter(Boolean).join(" ")}function yM(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const vM=e=>{var t,n,r,s,o,i,a,l,c;const{invert:d,toast:u,unstyled:f,interacting:y,setHeights:w,visibleToasts:x,heights:S,index:m,toasts:g,expanded:v,removeToast:E,defaultRichColors:b,closeButton:T,style:k,cancelButtonStyle:C,actionButtonStyle:M,className:P="",descriptionClassName:D="",duration:L,position:Y,gap:ae,expandByDefault:pe,classNames:z,icons:te,closeButtonAriaLabel:N="Close toast"}=e,[_,V]=j.useState(null),[B,ne]=j.useState(null),[W,X]=j.useState(!1),[Q,fe]=j.useState(!1),[Qe,Z]=j.useState(!1),[Kt,Wn]=j.useState(!1),[Hn,A]=j.useState(!1),[G,we]=j.useState(0),[Ze,$e]=j.useState(0),Ue=j.useRef(u.duration||L||Sm),Et=j.useRef(null),se=j.useRef(null),xr=m===0,Ka=m+1<=x,st=u.type,wr=u.dismissible!==!1,ow=u.className||"",iw=u.descriptionClassName||"",jo=j.useMemo(()=>S.findIndex($=>$.toastId===u.id)||0,[S,u.id]),aw=j.useMemo(()=>{var $;return($=u.closeButton)!=null?$:T},[u.closeButton,T]),uf=j.useMemo(()=>u.duration||L||Sm,[u.duration,L]),Ya=j.useRef(0),Sr=j.useRef(0),cf=j.useRef(0),Er=j.useRef(null),[lw,uw]=Y.split("-"),df=j.useMemo(()=>S.reduce(($,Ne,Ie)=>Ie>=jo?$:$+Ne.height,0),[S,jo]),ff=rM(),cw=u.invert||d,Xa=st==="loading";Sr.current=j.useMemo(()=>jo*ae+df,[jo,df]),j.useEffect(()=>{Ue.current=uf},[uf]),j.useEffect(()=>{X(!0)},[]),j.useEffect(()=>{const $=se.current;if($){const Ne=$.getBoundingClientRect().height;return $e(Ne),w(Ie=>[{toastId:u.id,height:Ne,position:u.position},...Ie]),()=>w(Ie=>Ie.filter(ot=>ot.toastId!==u.id))}},[w,u.id]),j.useLayoutEffect(()=>{if(!W)return;const $=se.current,Ne=$.style.height;$.style.height="auto";const Ie=$.getBoundingClientRect().height;$.style.height=Ne,$e(Ie),w(ot=>ot.find(Me=>Me.toastId===u.id)?ot.map(Me=>Me.toastId===u.id?{...Me,height:Ie}:Me):[{toastId:u.id,height:Ie,position:u.position},...ot])},[W,u.title,u.description,w,u.id,u.jsx,u.action,u.cancel]);const an=j.useCallback(()=>{fe(!0),we(Sr.current),w($=>$.filter(Ne=>Ne.toastId!==u.id)),setTimeout(()=>{E(u)},gM)},[u,E,w,Sr]);j.useEffect(()=>{if(u.promise&&st==="loading"||u.duration===1/0||u.type==="loading")return;let $;return v||y||ff?(()=>{if(cf.current<Ya.current){const ot=new Date().getTime()-Ya.current;Ue.current=Ue.current-ot}cf.current=new Date().getTime()})():(()=>{Ue.current!==1/0&&(Ya.current=new Date().getTime(),$=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),an()},Ue.current))})(),()=>clearTimeout($)},[v,y,u,st,ff,an]),j.useEffect(()=>{u.delete&&(an(),u.onDismiss==null||u.onDismiss.call(u,u))},[an,u.delete]);function dw(){var $;if(te!=null&&te.loading){var Ne;return j.createElement("div",{className:It(z==null?void 0:z.loader,u==null||(Ne=u.classNames)==null?void 0:Ne.loader,"sonner-loader"),"data-visible":st==="loading"},te.loading)}return j.createElement(ZR,{className:It(z==null?void 0:z.loader,u==null||($=u.classNames)==null?void 0:$.loader),visible:st==="loading"})}const fw=u.icon||(te==null?void 0:te[st])||XR(st);var hf,pf;return j.createElement("li",{tabIndex:0,ref:se,className:It(P,ow,z==null?void 0:z.toast,u==null||(t=u.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[st],u==null||(n=u.classNames)==null?void 0:n[st]),"data-sonner-toast":"","data-rich-colors":(hf=u.richColors)!=null?hf:b,"data-styled":!(u.jsx||u.unstyled||f),"data-mounted":W,"data-promise":!!u.promise,"data-swiped":Hn,"data-removed":Q,"data-visible":Ka,"data-y-position":lw,"data-x-position":uw,"data-index":m,"data-front":xr,"data-swiping":Qe,"data-dismissible":wr,"data-type":st,"data-invert":cw,"data-swipe-out":Kt,"data-swipe-direction":B,"data-expanded":!!(v||pe&&W),"data-testid":u.testId,style:{"--index":m,"--toasts-before":m,"--z-index":g.length-m,"--offset":`${Q?G:Sr.current}px`,"--initial-height":pe?"auto":`${Ze}px`,...k,...u.style},onDragEnd:()=>{Z(!1),V(null),Er.current=null},onPointerDown:$=>{$.button!==2&&(Xa||!wr||(Et.current=new Date,we(Sr.current),$.target.setPointerCapture($.pointerId),$.target.tagName!=="BUTTON"&&(Z(!0),Er.current={x:$.clientX,y:$.clientY})))},onPointerUp:()=>{var $,Ne,Ie;if(Kt||!wr)return;Er.current=null;const ot=Number((($=se.current)==null?void 0:$.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ro=Number(((Ne=se.current)==null?void 0:Ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Me=new Date().getTime()-((Ie=Et.current)==null?void 0:Ie.getTime()),ht=_==="x"?ot:Ro,Mo=Math.abs(ht)/Me;if(Math.abs(ht)>=mM||Mo>.11){we(Sr.current),u.onDismiss==null||u.onDismiss.call(u,u),ne(_==="x"?ot>0?"right":"left":Ro>0?"down":"up"),an(),Wn(!0);return}else{var kt,Ct;(kt=se.current)==null||kt.style.setProperty("--swipe-amount-x","0px"),(Ct=se.current)==null||Ct.style.setProperty("--swipe-amount-y","0px")}A(!1),Z(!1),V(null)},onPointerMove:$=>{var Ne,Ie,ot;if(!Er.current||!wr||((Ne=window.getSelection())==null?void 0:Ne.toString().length)>0)return;const Me=$.clientY-Er.current.y,ht=$.clientX-Er.current.x;var Mo;const kt=(Mo=e.swipeDirections)!=null?Mo:yM(Y);!_&&(Math.abs(ht)>1||Math.abs(Me)>1)&&V(Math.abs(ht)>Math.abs(Me)?"x":"y");let Ct={x:0,y:0};const mf=Gn=>1/(1.5+Math.abs(Gn)/20);if(_==="y"){if(kt.includes("top")||kt.includes("bottom"))if(kt.includes("top")&&Me<0||kt.includes("bottom")&&Me>0)Ct.y=Me;else{const Gn=Me*mf(Me);Ct.y=Math.abs(Gn)<Math.abs(Me)?Gn:Me}}else if(_==="x"&&(kt.includes("left")||kt.includes("right")))if(kt.includes("left")&&ht<0||kt.includes("right")&&ht>0)Ct.x=ht;else{const Gn=ht*mf(ht);Ct.x=Math.abs(Gn)<Math.abs(ht)?Gn:ht}(Math.abs(Ct.x)>0||Math.abs(Ct.y)>0)&&A(!0),(Ie=se.current)==null||Ie.style.setProperty("--swipe-amount-x",`${Ct.x}px`),(ot=se.current)==null||ot.style.setProperty("--swipe-amount-y",`${Ct.y}px`)}},aw&&!u.jsx&&st!=="loading"?j.createElement("button",{"aria-label":N,"data-disabled":Xa,"data-close-button":!0,onClick:Xa||!wr?()=>{}:()=>{an(),u.onDismiss==null||u.onDismiss.call(u,u)},className:It(z==null?void 0:z.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(pf=te==null?void 0:te.close)!=null?pf:nM):null,(st||u.icon||u.promise)&&u.icon!==null&&((te==null?void 0:te[st])!==null||u.icon)?j.createElement("div",{"data-icon":"",className:It(z==null?void 0:z.icon,u==null||(s=u.classNames)==null?void 0:s.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||dw():null,u.type!=="loading"?fw:null):null,j.createElement("div",{"data-content":"",className:It(z==null?void 0:z.content,u==null||(o=u.classNames)==null?void 0:o.content)},j.createElement("div",{"data-title":"",className:It(z==null?void 0:z.title,u==null||(i=u.classNames)==null?void 0:i.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?j.createElement("div",{"data-description":"",className:It(D,iw,z==null?void 0:z.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),j.isValidElement(u.cancel)?u.cancel:u.cancel&&oi(u.cancel)?j.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||C,onClick:$=>{oi(u.cancel)&&wr&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,$),an())},className:It(z==null?void 0:z.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,j.isValidElement(u.action)?u.action:u.action&&oi(u.action)?j.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||M,onClick:$=>{oi(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,$),!$.defaultPrevented&&an())},className:It(z==null?void 0:z.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Em(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function xM(e,t){const n={};return[e,t].forEach((r,s)=>{const o=s===1,i=o?"--mobile-offset":"--offset",a=o?fM:dM;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const wM=j.forwardRef(function(t,n){const{id:r,invert:s,position:o="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:l,className:c,offset:d,mobileOffset:u,theme:f="light",richColors:y,duration:w,style:x,visibleToasts:S=cM,toastOptions:m,dir:g=Em(),gap:v=pM,icons:E,containerAriaLabel:b="Notifications"}=t,[T,k]=j.useState([]),C=j.useMemo(()=>r?T.filter(W=>W.toasterId===r):T.filter(W=>!W.toasterId),[T,r]),M=j.useMemo(()=>Array.from(new Set([o].concat(C.filter(W=>W.position).map(W=>W.position)))),[C,o]),[P,D]=j.useState([]),[L,Y]=j.useState(!1),[ae,pe]=j.useState(!1),[z,te]=j.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=j.useRef(null),_=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),V=j.useRef(null),B=j.useRef(!1),ne=j.useCallback(W=>{k(X=>{var Q;return(Q=X.find(fe=>fe.id===W.id))!=null&&Q.delete||qe.dismiss(W.id),X.filter(({id:fe})=>fe!==W.id)})},[]);return j.useEffect(()=>qe.subscribe(W=>{if(W.dismiss){requestAnimationFrame(()=>{k(X=>X.map(Q=>Q.id===W.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{Iy.flushSync(()=>{k(X=>{const Q=X.findIndex(fe=>fe.id===W.id);return Q!==-1?[...X.slice(0,Q),{...X[Q],...W},...X.slice(Q+1)]:[W,...X]})})})}),[T]),j.useEffect(()=>{if(f!=="system"){te(f);return}if(f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?te("dark"):te("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:X})=>{te(X?"dark":"light")})}catch{W.addListener(({matches:Q})=>{try{te(Q?"dark":"light")}catch(fe){console.error(fe)}})}},[f]),j.useEffect(()=>{T.length<=1&&Y(!1)},[T]),j.useEffect(()=>{const W=X=>{var Q;if(i.every(Z=>X[Z]||X.code===Z)){var Qe;Y(!0),(Qe=N.current)==null||Qe.focus()}X.code==="Escape"&&(document.activeElement===N.current||(Q=N.current)!=null&&Q.contains(document.activeElement))&&Y(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[i]),j.useEffect(()=>{if(N.current)return()=>{V.current&&(V.current.focus({preventScroll:!0}),V.current=null,B.current=!1)}},[N.current]),j.createElement("section",{ref:n,"aria-label":`${b} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((W,X)=>{var Q;const[fe,Qe]=W.split("-");return C.length?j.createElement("ol",{key:W,dir:g==="auto"?Em():g,tabIndex:-1,ref:N,className:c,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":fe,"data-x-position":Qe,style:{"--front-toast-height":`${((Q=P[0])==null?void 0:Q.height)||0}px`,"--width":`${hM}px`,"--gap":`${v}px`,...x,...xM(d,u)},onBlur:Z=>{B.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(B.current=!1,V.current&&(V.current.focus({preventScroll:!0}),V.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||B.current||(B.current=!0,V.current=Z.relatedTarget)},onMouseEnter:()=>Y(!0),onMouseMove:()=>Y(!0),onMouseLeave:()=>{ae||Y(!1)},onDragEnd:()=>Y(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||pe(!0)},onPointerUp:()=>pe(!1)},C.filter(Z=>!Z.position&&X===0||Z.position===W).map((Z,Kt)=>{var Wn,Hn;return j.createElement(vM,{key:Z.id,icons:E,index:Kt,toast:Z,defaultRichColors:y,duration:(Wn=m==null?void 0:m.duration)!=null?Wn:w,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:s,visibleToasts:S,closeButton:(Hn=m==null?void 0:m.closeButton)!=null?Hn:l,interacting:ae,position:W,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,closeButtonAriaLabel:m==null?void 0:m.closeButtonAriaLabel,removeToast:ne,toasts:C.filter(A=>A.position==Z.position),heights:P.filter(A=>A.position==Z.position),setHeights:D,expandByDefault:a,gap:v,expanded:L,swipeDirections:t.swipeDirections})})):null}))}),tw=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,nw=5,rw=3e3;function KM(e,t){const n=p.useRef(null),r=p.useRef(0),s=p.useRef(!0),o=p.useRef(!1),i=p.useRef(t);i.current=t;const a=p.useRef(!1),l=p.useCallback(w=>{var x;((x=n.current)==null?void 0:x.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(w))},[]),c=p.useCallback((w,x)=>{var S;((S=n.current)==null?void 0:S.readyState)===WebSocket.OPEN?(n.current.send(JSON.stringify({type:"terminal_subscribe",cols:w,rows:x})),a.current=!1):a.current=!0},[]),d=p.useCallback(w=>{l({type:"terminal_input",data:w})},[l]),u=p.useCallback((w,x)=>{l({type:"terminal_resize",cols:w,rows:x})},[l]),f=p.useCallback(()=>{l({type:"chat_subscribe"})},[l]),y=p.useCallback(()=>{if(!s.current||o.current)return;const w=vr();if(!w){window.location.href="/login";return}o.current=!0;const x=new WebSocket(`${tw}/ws/projects/${e}`);n.current=x,x.onopen=()=>{o.current=!1,r.current=0,x.send(JSON.stringify({type:"auth",token:w}))},x.onmessage=S=>{var g,v,E,b,T,k,C,M;let m;try{m=JSON.parse(S.data)}catch{return}switch(m.type){case"connected":a.current=!1,(v=(g=i.current).onConnected)==null||v.call(g);break;case"terminal_data":(b=(E=i.current).onTerminalData)==null||b.call(E,m.data);break;case"status":(k=(T=i.current).onStatus)==null||k.call(T,m.status);break;case"chat_message":{const P=m;(M=(C=i.current).onChatMessage)==null||M.call(C,P);break}case"error":console.error("[WS] Server error:",m.message);break}},x.onclose=()=>{o.current=!1,n.current=null,s.current&&r.current<nw&&(r.current++,setTimeout(y,rw))},x.onerror=S=>{o.current=!1,console.error("[WS] WebSocket error:",S)}},[e]);return p.useEffect(()=>(s.current=!0,y(),()=>{var w;s.current=!1,(w=n.current)==null||w.close(),n.current=null}),[y]),{subscribeTerminal:c,sendTerminalInput:d,sendTerminalResize:u,subscribeChatMessages:f}}function SM(e){const t=p.useRef(null),n=p.useRef(0),r=p.useRef(!0),s=p.useRef(!1),o=p.useRef(e);o.current=e;const i=p.useCallback(()=>{if(!r.current||s.current)return;const a=vr();if(!a)return;s.current=!0;const l=new WebSocket(`${tw}/ws/dashboard`);t.current=l,l.onopen=()=>{s.current=!1,n.current=0,l.send(JSON.stringify({type:"auth",token:a}))},l.onmessage=c=>{var d,u;try{const f=JSON.parse(c.data);f.type==="activity_update"?o.current.onActivityUpdate(f):f.type==="project_stopped"&&((u=(d=o.current).onProjectStopped)==null||u.call(d,f.projectId,f.projectName))}catch{}},l.onclose=()=>{s.current=!1,t.current=null,r.current&&n.current<nw&&(n.current++,setTimeout(i,rw))},l.onerror=c=>{s.current=!1,console.error("[DashboardWS] Error:",c)}},[]);p.useEffect(()=>(r.current=!0,i(),()=>{var a;r.current=!1,(a=t.current)==null||a.close(),t.current=null}),[i])}function EM(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}const km=5*36e5;function kM(e){if(!e||e.utilization===void 0||e.utilization<=0||!e.resetAt)return null;const t=new Date(e.resetAt).getTime()-Date.now();if(t<=0)return null;const n=km-t;return n<=0?null:Math.round(e.utilization/(n/km))}function ii({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",s=EM(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:q("font-medium",r),children:[n,"%"]}),s&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",s,")"]})]})}function CM({className:e}){const[t,n]=p.useState("loading"),[r,s]=p.useState(!1);p.useEffect(()=>{const f=async()=>{try{n(await dx())}catch{n(null)}};f();const y=setInterval(()=>void f(),5*60*1e3);return()=>clearInterval(y)},[]);const o=async()=>{s(!0);try{n(await fx())}catch{n(null)}finally{s(!1)}};if(t==="loading"||!t)return null;const i=!!t.fiveHour,a=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=i||a||l||c,u=kM(t.fiveHour);return h.jsxs("div",{className:q("flex items-center gap-1.5 text-xs",e),children:[u!==null&&h.jsxs("span",{className:q("font-medium",u<=100?"text-green-400":"text-orange-400"),title:`5h 使用进度:按当前速率,窗口结束时预计使用 ${u}%`,children:[u,"%"]}),t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(ii,{label:"5h",bucket:t.fiveHour}),a&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(ii,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void o(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(KN,{className:q("h-3 w-3",r&&"animate-spin")})})]})}function bM(){const[e,t]=p.useState([]),[n,r]=p.useState(!1),[s,o]=p.useState(""),[i,a]=p.useState(""),[l,c]=p.useState(""),[d,u]=p.useState(null),[f,y]=p.useState(""),[w,x]=p.useState(""),[S,m]=p.useState(""),g=p.useRef(null),v=p.useRef(null);p.useEffect(()=>{ax().then(t).catch(()=>t([]))},[]),p.useEffect(()=>{n&&setTimeout(()=>{var k;return(k=g.current)==null?void 0:k.focus()},0)},[n]),p.useEffect(()=>{d&&setTimeout(()=>{var k;return(k=v.current)==null?void 0:k.focus()},0)},[d]);const E=async()=>{const k=i.trim();if(k)try{const C=await lx({label:s.trim()||k,command:k,...l?{parentId:l}:{}});t(M=>[...M,C]),o(""),a(""),c(""),r(!1)}catch(C){console.error("[GlobalShortcuts] Failed to add:",C)}},b=async k=>{try{await cx(k),t(C=>C.filter(M=>M.id!==k)),d===k&&u(null)}catch(C){console.error("[GlobalShortcuts] Failed to delete:",C)}},T=async()=>{const k=w.trim();if(!(!k||!d))try{const C=await ux(d,{label:f.trim()||k,command:k,parentId:S||null});t(M=>M.map(P=>P.id===d?C:P)),u(null)}catch(C){console.error("[GlobalShortcuts] Failed to save:",C)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(im,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(k=>!k),u(null)},className:q("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(fa,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:g,placeholder:"名称(可选)",value:s,onChange:k=>o(k.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:i,onChange:k=>a(k.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:k=>{k.key==="Enter"&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E()),k.key==="Escape"&&(r(!1),o(""),a(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:k=>c(k.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(k=>h.jsx("option",{value:k.id,children:k.label},k.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),o(""),a("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!i.trim(),className:q("text-sm px-3 py-1 rounded transition-colors text-white",i.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(im,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(k=>d===k.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:v,value:f,onChange:C=>y(C.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:w,onChange:C=>x(C.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),T()),C.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:S,onChange:C=>m(C.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(C=>C.id!==k.id).map(C=>h.jsx("option",{value:C.id,children:C.label},C.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void T(),disabled:!w.trim(),className:q("text-xs px-2.5 py-1 rounded transition-colors text-white",w.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},k.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:k.label}),k.parentId&&(()=>{const C=e.find(M=>M.id===k.parentId);return C?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx($l,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",C.label]})]}):null})(),!k.parentId&&k.label!==k.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:k.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(k.id),y(k.label),x(k.command),m(k.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(yx,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void b(k.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(rf,{className:"h-3.5 w-3.5"})})]})]},k.id))})]})}const sw=p.createContext({theme:"system",resolved:"dark",setTheme:()=>{}});function TM(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function PM(){return p.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>TM())}function NM({children:e}){const[t,n]=p.useState(()=>jP(Us.theme,"system")),r=PM(),s=t==="system"?r:t;p.useEffect(()=>{const i=document.documentElement;i.classList.remove("light","dark"),i.classList.add(s)},[s]);const o=i=>{n(i),Z0(Us.theme,i)};return h.jsx(sw.Provider,{value:{theme:t,resolved:s,setTheme:o},children:e})}function jM(){return p.useContext(sw)}function RM(){const{theme:e,setTheme:t}=jM(),n=[{value:"light",icon:ZN,label:"浅色"},{value:"dark",icon:GN,label:"深色"},{value:"system",icon:HN,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:s,label:o})=>h.jsx("button",{onClick:()=>t(r),className:q("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:o,children:h.jsx(s,{className:"h-3.5 w-3.5"})},r))})}function MM(){const e=Aa(),{projects:t,loading:n,error:r,fetchProjects:s,addProject:o,updateProject:i,removeProject:a}=_P(),l=hr(A=>A.clearToken),[c,d]=p.useState(!1),[u,f]=p.useState(!1),[y,w]=p.useState(new Set),x=p.useRef(new Map),[S,m]=p.useState(new Map),g=p.useRef(0),[v,E]=p.useState(!!document.fullscreenElement),[b,T]=p.useState(!1),[k,C]=p.useState(""),[M,P]=p.useState([]),[D,L]=p.useState(!1);p.useEffect(()=>{if(!k.trim()||k.trim().length<2){P([]);return}const A=setTimeout(()=>{L(!0),mx(k).then(G=>P(G)).catch(()=>P([])).finally(()=>L(!1))},400);return()=>clearTimeout(A)},[k]);const Y=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};p.useEffect(()=>{const A=()=>E(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]),p.useEffect(()=>{s()},[s]),p.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]);const ae=2e3,pe=3,z=8e3,te=p.useCallback(A=>{const G=Date.now(),we=x.current;if(G-A.lastActivityAt<ae){w(se=>se.has(A.projectId)?se:new Set(se).add(A.projectId));const Ze=we.get(A.projectId)??[];let $e=!1;if(A.semantic){const se=Ze[Ze.length-1],xr=`${A.semantic.phase}:${A.semantic.detail??""}`,Ka=se?`${se.phase}:${se.detail??""}`:"";xr!==Ka?(Ze.push({id:g.current++,phase:A.semantic.phase,detail:A.semantic.detail,ts:G}),$e=!0):se&&(se.ts=G)}const Ue=Ze.filter(se=>G-se.ts<z),Et=Ue.length>pe?Ue.slice(-pe):Ue;Et.length!==Ze.length&&($e=!0),we.set(A.projectId,Et),$e&&m(new Map(we))}else w(Ze=>{if(!Ze.has(A.projectId))return Ze;const $e=new Set(Ze);return $e.delete(A.projectId),$e}),we.has(A.projectId)&&we.get(A.projectId).length>0&&(we.set(A.projectId,[]),m(new Map(we)))},[]),N=p.useCallback((A,G)=>{"Notification"in window&&Notification.permission==="granted"&&new Notification("Claude 已完成",{body:`项目「${G}」的任务已完成`,icon:"/terminal.svg"})},[]);SM({onActivityUpdate:te,onProjectStopped:N}),p.useEffect(()=>{const A=setInterval(()=>{const G=Date.now(),we=x.current;let Ze=!1;for(const[$e,Ue]of we){const Et=Ue.filter(se=>G-se.ts<z);Et.length!==Ue.length&&(we.set($e,Et),Ze=!0)}Ze&&m(new Map(we)),w($e=>{let Ue=!1;const Et=new Set($e);for(const se of $e){const xr=we.get(se);(!xr||xr.length===0)&&(Et.delete(se),Ue=!0)}return Ue?Et:$e})},3e3);return()=>clearInterval(A)},[]);const _=()=>{l(),e("/login")},V=A=>{o(A)},B=A=>{o(A)},ne=async A=>{try{await sx(A),a(A)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to delete project")}},W=async A=>{try{const G=await ox(A);i(G)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to archive project")}},X=async A=>{try{const G=await ix(A);i(G)}catch(G){Ri.error(G instanceof Error?G.message:"Failed to restore project")}},Q=p.useMemo(()=>t.filter(A=>!A.archived),[t]),fe=p.useMemo(()=>t.filter(A=>A.archived),[t]),Qe=p.useMemo(()=>Array.from(new Set(t.flatMap(A=>A.tags??[]))),[t]),[Z,Kt]=p.useState([]),Wn=p.useMemo(()=>Z.length===0?Q:Q.filter(A=>Z.some(G=>{var we;return(we=A.tags)==null?void 0:we.includes(G)})),[Q,Z]),Hn={onDelete:A=>void ne(A),onArchive:A=>void W(A),onUnarchive:A=>void X(A),onUpdated:i};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(om,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(CM,{}),h.jsxs("div",{className:"relative",children:[h.jsx(YN,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),h.jsx(po,{placeholder:"搜索历史对话…",value:k,onChange:A=>C(A.target.value),className:"pl-8 h-8 text-xs w-48"}),k.trim().length>=2&&h.jsxs("div",{className:"absolute top-full mt-1 right-0 w-96 max-h-80 overflow-y-auto bg-popover border border-border rounded-lg shadow-xl z-50",children:[D&&h.jsx("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"搜索中…"}),!D&&M.length===0&&h.jsx("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"无结果"}),M.map((A,G)=>h.jsxs("button",{className:"w-full text-left px-4 py-2.5 hover:bg-muted transition-colors border-b border-border last:border-0",onClick:()=>{e(`/project/${A.projectId}`),C("")},children:[h.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:A.projectName}),h.jsx("span",{className:"text-[10px] text-muted-foreground flex-shrink-0",children:new Date(A.startedAt).toLocaleDateString("zh-CN")})]}),h.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed line-clamp-2",children:A.snippet})]},G))]})]}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>e("/skillhub"),title:"SkillHub",children:h.jsx(QN,{className:"h-4 w-4"})}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(XN,{className:"h-4 w-4"})}),h.jsx(oe,{variant:"ghost",size:"sm",onClick:Y,title:v?"Exit fullscreen":"Fullscreen",children:v?h.jsx(WN,{className:"h-4 w-4"}):h.jsx(UN,{className:"h-4 w-4"})}),h.jsx(RM,{}),h.jsxs(oe,{variant:"ghost",size:"sm",onClick:_,children:[h.jsx($N,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(oe,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(yc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(oe,{onClick:()=>d(!0),children:[h.jsx(fa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),n&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),r&&h.jsx("div",{className:"text-center text-destructive py-12",children:r}),!n&&!r&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(om,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(oe,{variant:"outline",onClick:()=>f(!0),children:[h.jsx(yc,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(oe,{onClick:()=>d(!0),children:[h.jsx(fa,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!n&&!r&&Qe.length>0&&h.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-4",children:[Qe.map(A=>h.jsxs("button",{onClick:()=>Kt(G=>G.includes(A)?G.filter(we=>we!==A):[...G,A]),className:q("px-2 py-0.5 rounded-full text-xs border transition-colors",Z.includes(A)?"bg-blue-500/20 text-blue-400 border-blue-500/40":"bg-muted text-muted-foreground border-border hover:border-muted-foreground/40"),children:["#",A]},A)),Z.length>0&&h.jsx("button",{onClick:()=>Kt([]),className:"px-2 py-0.5 rounded-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:"清除"})]}),!n&&!r&&Wn.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Wn.map((A,G)=>h.jsx(An.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.3,delay:G*.05,ease:"easeOut"},children:h.jsx(xm,{project:A,active:y.has(A.id),statusStack:S.get(A.id)??[],...Hn})},A.id))}),!n&&!r&&fe.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>T(A=>!A),children:[h.jsx(An.span,{animate:{rotate:b?90:0},transition:{duration:.2},children:h.jsx(gx,{className:"h-4 w-4"})}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:fe.length})]}),h.jsx(Kd,{children:b&&h.jsx(An.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:fe.map(A=>h.jsx(xm,{project:A,active:!1,...Hn},A.id))})})})]}),h.jsx(bM,{})]}),h.jsx(GR,{open:c,onOpenChange:d,onCreated:V}),h.jsx(KR,{open:u,onOpenChange:f,onOpened:B})]})}class AM extends j.Component{constructor(){super(...arguments);Qa(this,"state",{hasError:!1,error:null});Qa(this,"handleReset",()=>{var n,r;this.setState({hasError:!1,error:null}),(r=(n=this.props).onReset)==null||r.call(n)})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){console.error("[ErrorBoundary]",n,r.componentStack),Ri.error(n.message||"Something went wrong")}render(){return this.state.hasError?this.props.fallback?this.props.fallback:h.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 p-4 text-sm text-muted-foreground",children:[h.jsx("p",{children:"出错了"}),h.jsx("button",{onClick:this.handleReset,className:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted transition-colors",children:"重新加载"})]}):this.props.children}}const DM=j.lazy(()=>Eo(()=>import("./ProjectPage-CleGlRT2.js").then(e=>e.P),__vite__mapDeps([0,1,2,3,4,5,6])).then(e=>({default:e.ProjectPage}))),LM=j.lazy(()=>Eo(()=>import("./SettingsPage-iu4qlKY-.js"),__vite__mapDeps([7,1,2])).then(e=>({default:e.SettingsPage}))),_M=j.lazy(()=>Eo(()=>import("./SkillHubPage-Bepx_l5S.js"),__vite__mapDeps([8,5,3,2])).then(e=>({default:e.SkillHubPage}))),OM=j.lazy(()=>Eo(()=>import("./ShareViewPage-BH5DcBFe.js"),__vite__mapDeps([9,5,4])).then(e=>({default:e.ShareViewPage})));function IM(){return h.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:h.jsx("span",{className:"text-muted-foreground text-sm",children:"Loading…"})})}function ai({children:e}){const[t,n]=p.useState(!1),r=hr(o=>o.token),s=hr(o=>o.setToken);return p.useEffect(()=>{if(r){n(!0);return}da()?nf().then(o=>s(o)).catch(()=>{}).finally(()=>n(!0)):n(!0)},[]),!t&&!r?null:r?h.jsx(h.Fragment,{children:e}):h.jsx(Qy,{to:"/login",replace:!0})}function VM(){return h.jsxs(NM,{children:[h.jsx(wM,{richColors:!0,position:"bottom-right"}),h.jsx(AM,{children:h.jsx(OE,{children:h.jsx(p.Suspense,{fallback:h.jsx(IM,{}),children:h.jsxs(DE,{children:[h.jsx(dn,{path:"/login",element:h.jsx(MN,{})}),h.jsx(dn,{path:"/",element:h.jsx(ai,{children:h.jsx(MM,{})})}),h.jsx(dn,{path:"/projects/:id",element:h.jsx(ai,{children:h.jsx(DM,{})})}),h.jsx(dn,{path:"/settings",element:h.jsx(ai,{children:h.jsx(LM,{})})}),h.jsx(dn,{path:"/skillhub",element:h.jsx(ai,{children:h.jsx(_M,{})})}),h.jsx(dn,{path:"/share/:token",element:h.jsx(OM,{})}),h.jsx(dn,{path:"*",element:h.jsx(Qy,{to:"/",replace:!0})})]})})})})]})}Zl.createRoot(document.getElementById("root")).render(h.jsx(j.StrictMode,{children:h.jsx(VM,{})}));export{PN as $,Kd as A,oe as B,gx as C,WP as D,VN as E,yc as F,ax as G,$l as H,po as I,KP as J,lf as K,$a as L,WN as M,Ua as N,Ha as O,yx as P,Ga as Q,j as R,Us as S,kn as T,Wa as U,GP as V,HP as W,rf as X,XP as Y,im as Z,Eo as _,BM as a,BP as a0,NN as a1,$P as a2,Va as a3,oj as a4,Ul as a5,yr as a6,on as a7,Ln as a8,Fa as a9,_P as aA,go as aB,rN as aC,oN as aD,aN as aE,Zd as aF,qd as aG,Jd as aH,ef as aI,vx as aJ,wN as aK,sN as aL,uN as aM,dN as aN,hN as aO,iN as aP,fN as aQ,cN as aR,SN as aS,mo as aT,gd as aU,YP as aV,QP as aW,jN as aX,$M as aY,Cx as aa,ej as ab,SR as ac,Ax as ad,_j as ae,Ex as af,wx as ag,pN as ah,gN as ai,mN as aj,vN as ak,Aa as al,ON as am,Zn as an,CM as ao,RM as ap,xN as aq,lN as ar,FP as as,zP as at,YN as au,yN as av,HM as aw,KM as ax,om as ay,UM as az,vr as b,ee as c,JP as d,q as e,UN as f,Cm as g,ZP as h,jP as i,h as j,hx as k,KN as l,qP as m,sm as n,An as o,EN as p,IN as q,p as r,Z0 as s,Ri as t,jM as u,fa as v,eN as w,kN as x,CN as y,bN as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aY as Nl,a as re}from"./index-
|
|
1
|
+
import{aY as Nl,a as re}from"./index-DY80zrkg.js";import{a as Rl}from"./jszip.min-DWTb7F2P.js";function kl(e,n){for(var t=0;t<n.length;t++){const i=n[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Ye={},aa="1.13.8",_c=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ni=Array.prototype,ca=Object.prototype,Ec=typeof Symbol<"u"?Symbol.prototype:null,Ol=ni.push,Et=ni.slice,ft=ca.toString,Il=ca.hasOwnProperty,Uu=typeof ArrayBuffer<"u",Ll=typeof DataView<"u",Ml=Array.isArray,wc=Object.keys,Fc=Object.create,Ac=Uu&&ArrayBuffer.isView,ql=isNaN,Pl=isFinite,Tu=!{toString:null}.propertyIsEnumerable("toString"),Cc=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Xl=Math.pow(2,53)-1;function Re(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),i=Array(t),r=0;r<t;r++)i[r]=arguments[r+n];switch(n){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i);case 2:return e.call(this,arguments[0],arguments[1],i)}var a=Array(n+1);for(r=0;r<n;r++)a[r]=arguments[r];return a[n]=i,e.apply(this,a)}}function _n(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function _u(e){return e===null}function oa(e){return e===void 0}function ua(e){return e===!0||e===!1||ft.call(e)==="[object Boolean]"}function Eu(e){return!!(e&&e.nodeType===1)}function We(e){var n="[object "+e+"]";return function(t){return ft.call(t)===n}}const ti=We("String"),sa=We("Number"),wu=We("Date"),Fu=We("RegExp"),Au=We("Error"),da=We("Symbol"),la=We("ArrayBuffer");var Cu=We("Function"),jl=_c.document&&_c.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof jl!="function"&&(Cu=function(e){return typeof e=="function"||!1});const Be=Cu,Bu=We("Object");var Wu=Ll&&(!/\[native code\]/.test(String(DataView))||Bu(new DataView(new ArrayBuffer(8)))),fa=typeof Map<"u"&&Bu(new Map),Vl=We("DataView");function Hl(e){return e!=null&&Be(e.getInt8)&&la(e.buffer)}const ht=Wu?Hl:Vl,En=Ml||We("Array");function wn(e,n){return e!=null&&Il.call(e,n)}var Jr=We("Arguments");(function(){Jr(arguments)||(Jr=function(e){return wn(e,"callee")})})();const ii=Jr;function Su(e){return!da(e)&&Pl(e)&&!isNaN(parseFloat(e))}function ha(e){return sa(e)&&ql(e)}function ga(e){return function(){return e}}function Nu(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Xl}}function Ru(e){return function(n){return n==null?void 0:n[e]}}const jt=Ru("byteLength"),$l=Nu(jt);var zl=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Gl(e){return Ac?Ac(e)&&!ht(e):$l(e)&&zl.test(ft.call(e))}const pa=Uu?Gl:ga(!1),Ce=Ru("length");function Ql(e){for(var n={},t=e.length,i=0;i<t;++i)n[e[i]]=!0;return{contains:function(r){return n[r]===!0},push:function(r){return n[r]=!0,e.push(r)}}}function ku(e,n){n=Ql(n);var t=Cc.length,i=e.constructor,r=Be(i)&&i.prototype||ca,a="constructor";for(wn(e,a)&&!n.contains(a)&&n.push(a);t--;)a=Cc[t],a in e&&e[a]!==r[a]&&!n.contains(a)&&n.push(a)}function ye(e){if(!_n(e))return[];if(wc)return wc(e);var n=[];for(var t in e)wn(e,t)&&n.push(t);return Tu&&ku(e,n),n}function Ou(e){if(e==null)return!0;var n=Ce(e);return typeof n=="number"&&(En(e)||ti(e)||ii(e))?n===0:Ce(ye(e))===0}function ma(e,n){var t=ye(n),i=t.length;if(e==null)return!i;for(var r=Object(e),a=0;a<i;a++){var c=t[a];if(n[c]!==r[c]||!(c in r))return!1}return!0}function ce(e){if(e instanceof ce)return e;if(!(this instanceof ce))return new ce(e);this._wrapped=e}ce.VERSION=aa;ce.prototype.value=function(){return this._wrapped};ce.prototype.valueOf=ce.prototype.toJSON=ce.prototype.value;ce.prototype.toString=function(){return String(this._wrapped)};function Bc(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,jt(e))}var Wc="[object DataView]";function Iu(e,n){for(var t=[{a:e,b:n}],i=[],r=[];t.length;){var a=t.pop();if(a===!0){i.pop(),r.pop();continue}if(e=a.a,n=a.b,e===n){if(e!==0||1/e===1/n)continue;return!1}if(e==null||n==null)return!1;if(e!==e){if(n!==n)continue;return!1}var c=typeof e;if(c!=="function"&&c!=="object"&&typeof n!="object")return!1;e instanceof ce&&(e=e._wrapped),n instanceof ce&&(n=n._wrapped);var u=ft.call(e);if(u!==ft.call(n))return!1;if(Wu&&u=="[object Object]"&&ht(e)){if(!ht(n))return!1;u=Wc}switch(u){case"[object RegExp]":case"[object String]":if(""+e==""+n)continue;return!1;case"[object Number]":t.push({a:+e,b:+n});continue;case"[object Date]":case"[object Boolean]":if(+e==+n)continue;return!1;case"[object Symbol]":if(Ec.valueOf.call(e)===Ec.valueOf.call(n))continue;return!1;case"[object ArrayBuffer]":case Wc:t.push({a:Bc(e),b:Bc(n)});continue}var o=u==="[object Array]";if(!o&&pa(e)){var s=jt(e);if(s!==jt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)continue;o=!0}if(!o){if(typeof e!="object"||typeof n!="object")return!1;var d=e.constructor,h=n.constructor;if(d!==h&&!(Be(d)&&d instanceof d&&Be(h)&&h instanceof h)&&"constructor"in e&&"constructor"in n)return!1}for(var g=i.length;g--;)if(i[g]===e){if(r[g]===n)break;return!1}if(!(g>=0))if(i.push(e),r.push(n),t.push(!0),o){if(g=e.length,g!==n.length)return!1;for(;g--;)t.push({a:e[g],b:n[g]})}else{var y=ye(e),D;if(g=y.length,ye(n).length!==g)return!1;for(;g--;){if(D=y[g],!wn(n,D))return!1;t.push({a:e[D],b:n[D]})}}}return!0}function nt(e){if(!_n(e))return[];var n=[];for(var t in e)n.push(t);return Tu&&ku(e,n),n}function ba(e){var n=Ce(e);return function(t){if(t==null)return!1;var i=nt(t);if(Ce(i))return!1;for(var r=0;r<n;r++)if(!Be(t[e[r]]))return!1;return e!==qu||!Be(t[Da])}}var Da="forEach",Lu="has",ya=["clear","delete"],Mu=["get",Lu,"set"],Yl=ya.concat(Da,Mu),qu=ya.concat(Mu),Kl=["add"].concat(ya,Da,Lu);const Pu=fa?ba(Yl):We("Map"),Xu=fa?ba(qu):We("WeakMap"),ju=fa?ba(Kl):We("Set"),Vu=We("WeakSet");function On(e){for(var n=ye(e),t=n.length,i=Array(t),r=0;r<t;r++)i[r]=e[n[r]];return i}function Hu(e){for(var n=ye(e),t=n.length,i=Array(t),r=0;r<t;r++)i[r]=[n[r],e[n[r]]];return i}function va(e){for(var n={},t=ye(e),i=0,r=t.length;i<r;i++)n[e[t[i]]]=t[i];return n}function gt(e){var n=[];for(var t in e)Be(e[t])&&n.push(t);return n.sort()}function xa(e,n){return function(t){var i=arguments.length;if(n&&(t=Object(t)),i<2||t==null)return t;for(var r=1;r<i;r++)for(var a=arguments[r],c=e(a),u=c.length,o=0;o<u;o++){var s=c[o];(!n||t[s]===void 0)&&(t[s]=a[s])}return t}}const Ua=xa(nt),Gn=xa(ye),Ta=xa(nt,!0);function Zl(){return function(){}}function $u(e){if(!_n(e))return{};if(Fc)return Fc(e);var n=Zl();n.prototype=e;var t=new n;return n.prototype=null,t}function zu(e,n){var t=$u(e);return n&&Gn(t,n),t}function Gu(e){return _n(e)?En(e)?e.slice():Ua({},e):e}function Qu(e,n){return n(e),e}function _a(e){return En(e)?e:[e]}ce.toPath=_a;function wt(e){return ce.toPath(e)}function Ea(e,n){for(var t=n.length,i=0;i<t;i++){if(e==null)return;e=e[n[i]]}return t?e:void 0}function wa(e,n,t){var i=Ea(e,wt(n));return oa(i)?t:i}function Yu(e,n){n=wt(n);for(var t=n.length,i=0;i<t;i++){var r=n[i];if(!wn(e,r))return!1;e=e[r]}return!!t}function ri(e){return e}function Sn(e){return e=Gn({},e),function(n){return ma(n,e)}}function ai(e){return e=wt(e),function(n){return Ea(n,e)}}function Ft(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(i){return e.call(n,i)};case 3:return function(i,r,a){return e.call(n,i,r,a)};case 4:return function(i,r,a,c){return e.call(n,i,r,a,c)}}return function(){return e.apply(n,arguments)}}function Ku(e,n,t){return e==null?ri:Be(e)?Ft(e,n,t):_n(e)&&!En(e)?Sn(e):ai(e)}function ci(e,n){return Ku(e,n,1/0)}ce.iteratee=ci;function Le(e,n,t){return ce.iteratee!==ci?ce.iteratee(e,n):Ku(e,n,t)}function Zu(e,n,t){n=Le(n,t);for(var i=ye(e),r=i.length,a={},c=0;c<r;c++){var u=i[c];a[u]=n(e[u],u,e)}return a}function Fa(){}function Ju(e){return e==null?Fa:function(n){return wa(e,n)}}function es(e,n,t){var i=Array(Math.max(0,e));n=Ft(n,t,1);for(var r=0;r<e;r++)i[r]=n(r);return i}function Vt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const Qn=Date.now||function(){return new Date().getTime()};function ns(e){var n=function(a){return e[a]},t="(?:"+ye(e).join("|")+")",i=RegExp(t),r=RegExp(t,"g");return function(a){return a=a==null?"":""+a,i.test(a)?a.replace(r,n):a}}const ts={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},is=ns(ts),Jl=va(ts),rs=ns(Jl),as=ce.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ji=/(.)^/,ef={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},nf=/\\|'|\r|\n|\u2028|\u2029/g;function tf(e){return"\\"+ef[e]}var rf=/^\s*(\w|\$)+\s*$/;function cs(e,n,t){!n&&t&&(n=t),n=Ta({},n,ce.templateSettings);var i=RegExp([(n.escape||ji).source,(n.interpolate||ji).source,(n.evaluate||ji).source].join("|")+"|$","g"),r=0,a="__p+='";e.replace(i,function(s,d,h,g,y){return a+=e.slice(r,y).replace(nf,tf),r=y+s.length,d?a+=`'+
|
|
2
2
|
((__t=(`+d+`))==null?'':_.escape(__t))+
|
|
3
3
|
'`:h?a+=`'+
|
|
4
4
|
((__t=(`+h+`))==null?'':__t)+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ot,a as vt}from"./index-
|
|
1
|
+
import{g as Ot,a as vt}from"./index-DY80zrkg.js";function Bt(ct,wt){for(var _=0;_<wt.length;_++){const N=wt[_];if(typeof N!="string"&&!Array.isArray(N)){for(const w in N)if(w!=="default"&&!(w in ct)){const u=Object.getOwnPropertyDescriptor(N,w);u&&Object.defineProperty(ct,w,u.get?u:{enumerable:!0,get:()=>N[w]})}}}return Object.freeze(Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"}))}function yt(ct){throw new Error('Could not dynamically require "'+ct+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zt={exports:{}};/*!
|
|
2
2
|
|
|
3
3
|
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
4
4
|
<http://stuartk.com/jszip>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ft,r as a,aT as J,a6 as K,a4 as tt,j as y,a7 as F,a8 as z,ab as Fe,e as re,a3 as jt,R as ge,aU as dt,aB as Lt,a5 as ut,aa as to,ac as no,ae as oo,ad as ro,af as so,ag as io,
|
|
1
|
+
import{c as ft,r as a,aT as J,a6 as K,a4 as tt,j as y,a7 as F,a8 as z,ab as Fe,e as re,a3 as jt,R as ge,aU as dt,aB as Lt,a5 as ut,aa as to,ac as no,ae as oo,ad as ro,af as so,ag as io,q as co}from"./index-DY80zrkg.js";import{C as kt}from"./chevron-down-BMXEj6rp.js";/**
|
|
2
2
|
* @license lucide-react v0.309.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/frontend/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/terminal.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>CC Web</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DY80zrkg.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D7-ur8vw.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|