kcode-cli 1.3.17 → 1.3.19

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.
@@ -0,0 +1 @@
1
+ import{u as A,a as B,b as I,c as E,d as G,e as K,f as R,g as m,i as r,h as n,L as W,M as v,B as u,F as H,T as N,I as q,j as J,S as O,k as Q,s as j,l as y,m as U,n as V,o as X,p as Y,t as i}from"./index-ZtG0ehHM.js";import{D as Z}from"./datetime-D2JCa3fE.js";var ee=i('<div class="mt-20 w-full flex flex-col gap-4"><div class="flex gap-2 items-center justify-between pl-3"><div class="text-14-medium text-text-strong"></div></div><ul class="flex flex-col gap-2">'),te=i('<div class="mt-30 mx-auto flex flex-col items-center gap-3"><div class="text-12-regular text-text-weak">'),re=i('<div class="mt-30 mx-auto flex flex-col items-center gap-3"><div class="flex flex-col gap-1 items-center justify-center"><div class="text-14-medium text-text-strong"></div><div class="text-12-regular text-text-weak">'),ae=i('<div class="mx-auto mt-55 w-full md:w-auto px-4">'),le=i('<div class="flex min-w-0 w-full items-center justify-between gap-3 text-left"><span class="min-w-0 truncate text-14-mono"></span><div class="shrink-0 text-14-regular text-text-weak">'),ne=i('<li class="flex items-center gap-2">');function oe(){const p=A(),w=B(),b=I(),P=E(),c=G(),C=K(),a=Q(),[g,S]=R(!1),D=m(()=>p.data.path.home),F=m(()=>new Set(c.projects.hidden())),M=e=>{const t=D();return!t||!e.startsWith(t)?e:"~"+e.slice(t.length)},T=m(()=>new Map(p.data.project.map(e=>[e.worktree,e]))),k=m(()=>{const e=T();return c.projects.recent().filter(t=>!F().has(t.worktree)).slice().slice(0,5).map(t=>{const l=e.get(t.worktree),s=t.touchedAt??l?.time.updated??l?.time.created;return{worktree:t.worktree,relativeTime:s?Z.fromMillis(s).toRelative():void 0}})});async function $(e,t=!0){const l=await w.projects.open(e);return l.status==="missing"?(j({variant:"error",title:a.t("toast.project.reloadFailed.title",{project:U(e)}),description:y(l.error,a.t)}),!1):(t&&(c.projects.touch(e),b(`/${V(e)}`)),!0)}const h=X({onPendingChange:S,task:async()=>{try{const e=await Y({withPriority:w.projects.withPriority,platform:P,client:C.client,title:a.t("command.project.open")});if(!e)return;await $(e)}catch(e){j({variant:"error",title:a.t("toast.project.openFailed.title"),description:y(e,a.t)})}}});function z(e){c.projects.hide(e)}return(()=>{var e=ae();return r(e,n(W,{class:"md:w-xl opacity-12"}),null),r(e,n(O,{get children(){return[n(v,{get when(){return k().length>0},get children(){var t=ee(),l=t.firstChild,s=l.firstChild,f=l.nextSibling;return r(s,()=>a.t("home.recentProjects")),r(l,n(u,{icon:"folder-add-left",size:"normal",class:"pl-2 pr-3",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),r(f,n(H,{get each(){return k()},children:d=>(()=>{var x=ne();return r(x,n(u,{size:"large",variant:"ghost",class:"min-w-0 flex-1 px-3",onClick:()=>void $(d.worktree),get children(){var o=le(),_=o.firstChild,L=_.nextSibling;return r(_,()=>M(d.worktree)),r(L,()=>d.relativeTime),o}}),null),r(x,n(N,{get value(){return a.t("common.delete")},placement:"top",get children(){return n(q,{icon:"trash",variant:"ghost",class:"size-10 shrink-0 rounded-md",get"aria-label"(){return a.t("common.delete")},onClick:o=>{o.preventDefault(),o.stopPropagation(),z(d.worktree)}})}}),null),x})()})),t}}),n(v,{get when(){return!p.ready},get children(){var t=te(),l=t.firstChild;return r(l,()=>a.t("common.loading")),r(t,n(u,{class:"px-3",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),t}}),n(v,{when:!0,get children(){var t=re(),l=t.firstChild,s=l.firstChild,f=s.nextSibling;return r(t,n(J,{name:"folder-add-left",size:"large"}),l),r(s,()=>a.t("home.empty.title")),r(f,()=>a.t("home.empty.description")),r(t,n(u,{class:"px-3 mt-1",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),t}})]}}),null),e})()}export{oe as default};