import{m,n as Q,u as Z,r as o,j as e,P as X,F as L,o as ee,p as te,L as T}from"./index-B1SopS7p.js";import{A as w}from"./arrow-right-BGdoQViA.js";import{S as re}from"./search-Cdnx4iUA.js";import{R as ae}from"./refresh-cw-D7WRiVbA.js";/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const se=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],V=m("book-open",se);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ie=[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ne=m("clock-3",ie);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const de=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],oe=m("folder",de);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const le=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],ce=m("graduation-cap",le);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ge=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],xe=m("life-buoy",ge);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const me=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],$=m("pin-off",me);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const he=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],B=m("pin",he);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const be=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ue=m("sparkles",be),q="scipion.home.pins.v1",G="scipion.home.lastOpenedProjectId.v1";function ye(t){return Array.isArray(t)?t.map(r=>{var h,u,d,j;const l=String((u=(h=r==null?void 0:r.id)!=null?h:r==null?void 0:r.projectId)!=null?u:"").trim(),b=String((j=(d=r==null?void 0:r.name)!=null?d:r==null?void 0:r.title)!=null?j:"").trim();return!l||!b?null:{id:l,name:b,description:typeof(r==null?void 0:r.description)=="string"?r.description:void 0,createdAt:typeof(r==null?void 0:r.createdAt)=="string"?r.createdAt:typeof(r==null?void 0:r.created_at)=="string"?r.created_at:void 0,updatedAt:typeof(r==null?void 0:r.updatedAt)=="string"?r.updatedAt:typeof(r==null?void 0:r.updated_at)=="string"?r.updated_at:void 0,status:typeof(r==null?void 0:r.status)=="string"?r.status:void 0}}).filter(Boolean):[]}function ke(){try{const t=localStorage.getItem(q);if(!t)return[];const r=JSON.parse(t);return Array.isArray(r)?r.map(l=>String(l)).filter(l=>l.trim().length>0):[]}catch(t){return[]}}function je(t){try{localStorage.setItem(q,JSON.stringify(t))}catch(r){}}function pe(){try{const t=localStorage.getItem(G),r=String(t!=null?t:"").trim();return r||null}catch(t){return null}}function fe(t){try{localStorage.setItem(G,String(t))}catch(r){}}function M(t){if(!t)return"—";const r=new Date(t);if(Number.isNaN(r.getTime()))return"—";try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}catch(l){return r.toISOString()}}function s(...t){return t.filter(Boolean).join(" ")}function K(t){switch(t){case"indigo":return s("bg-indigo-50 ring-indigo-200 text-indigo-700","dark:bg-indigo-950/30 dark:ring-indigo-800 dark:text-indigo-200");case"violet":return s("bg-violet-50 ring-violet-200 text-violet-700","dark:bg-violet-950/30 dark:ring-violet-800 dark:text-violet-200");case"emerald":return s("bg-emerald-50 ring-emerald-200 text-emerald-700","dark:bg-emerald-950/30 dark:ring-emerald-800 dark:text-emerald-200");case"amber":return s("bg-amber-50 ring-amber-200 text-amber-700","dark:bg-amber-950/30 dark:ring-amber-800 dark:text-amber-200");case"sky":return s("bg-sky-50 ring-sky-200 text-sky-700","dark:bg-sky-950/30 dark:ring-sky-800 dark:text-sky-200");case"rose":return s("bg-rose-50 ring-rose-200 text-rose-700","dark:bg-rose-950/30 dark:ring-rose-800 dark:text-rose-200");default:return s("bg-gray-100 ring-gray-200 text-gray-900","dark:bg-slate-800 dark:ring-gray-700 dark:text-white")}}const W="subpixel-antialiased [text-rendering:optimizeLegibility]";function H(t){return e.jsxs("section",{className:s(W,"overflow-hidden rounded-[10px] border","border-gray-300/85 bg-white shadow-[0_1px_2px_rgba(15,23,42,0.03)]","dark:border-gray-700 dark:bg-slate-900",t.className),children:[t.title||t.subtitle||t.right?e.jsxs("div",{className:s("flex flex-col gap-3 border-b px-5 py-4","border-gray-200/90 dark:border-gray-700","md:flex-row md:items-start md:justify-between md:gap-6","lg:px-6"),children:[e.jsxs("div",{className:"min-w-0",children:[t.title?e.jsx("h2",{className:"text-[15px] font-semibold tracking-[0.01em] text-gray-950 dark:text-white",children:t.title}):null,t.subtitle?e.jsx("p",{className:"mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300",children:t.subtitle}):null]}),t.right?e.jsx("div",{className:"shrink-0",children:t.right}):null]}):null,e.jsx("div",{className:s("p-5 lg:p-6",t.bodyClassName),children:t.children})]})}function k(t){return e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.14em] text-gray-500 dark:text-gray-400",children:t.children})}function N(t){const r=e.jsxs("div",{className:s("group flex items-start gap-3 rounded-2xl px-3 py-3 transition","hover:bg-white/90 dark:hover:bg-slate-900/90"),children:[e.jsx("div",{className:s("mt-0.5 flex h-10 w-10 items-center justify-center rounded-xl ring-1",K(t.tone)),children:t.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-gray-950 dark:text-white",children:t.title}),e.jsx(w,{className:"h-4 w-4 text-gray-400 transition group-hover:translate-x-0.5 group-hover:text-gray-700 dark:text-gray-500 dark:group-hover:text-gray-200"})]}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300",children:t.description})]})]});return t.to?e.jsx(T,{to:t.to,className:"block",children:r}):e.jsx("button",{type:"button",onClick:t.onClick,className:"block w-full text-left",children:r})}function C(t){return e.jsxs("div",{className:s("rounded-2xl border px-4 py-3","border-gray-300/70 bg-white/80","dark:border-gray-700 dark:bg-slate-900/80"),children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.12em] text-gray-500 dark:text-gray-400",children:[t.icon?e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:t.icon}):null,e.jsx("span",{children:t.label})]}),e.jsx("div",{className:"mt-1 text-sm font-semibold text-gray-950 dark:text-white",children:t.value})]})}function O(t){const r=e.jsxs("div",{className:s("group flex items-center justify-between gap-3 rounded-2xl px-3 py-3 transition","hover:bg-gray-100/80 dark:hover:bg-slate-800/70"),children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:s("flex h-9 w-9 shrink-0 items-center justify-center rounded-xl ring-1",K(t.tone)),children:t.icon}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-semibold text-gray-950 dark:text-white",children:t.title}),e.jsx("div",{className:"truncate text-sm text-gray-700 dark:text-gray-300",children:t.subtitle})]})]}),e.jsx(w,{className:"h-4 w-4 shrink-0 text-gray-400 transition group-hover:translate-x-0.5 group-hover:text-gray-700 dark:group-hover:text-gray-200"})]});if(t.href){const l=t.openInNewTab!==!1;return e.jsx("a",{href:t.href,target:l?"_blank":void 0,rel:l?"noreferrer":void 0,children:r})}return t.to?e.jsx(T,{to:t.to,children:r}):e.jsx("div",{children:r})}function _e(){const t=Q(),r=Z(),[l,b]=o.useState(!1),[h,u]=o.useState(null),[d,j]=o.useState([]),[x,J]=o.useState(()=>ke()),[R,Y]=o.useState("");o.useEffect(()=>{je(x)},[x]);const S=o.useCallback(async()=>{b(!0),u(null);try{const a=await t.fetchList(),i=ye(a);i.sort((n,c)=>{var z,F,D,U;const g=new Date((F=(z=n.updatedAt)!=null?z:n.createdAt)!=null?F:0).getTime();return new Date((U=(D=c.updatedAt)!=null?D:c.createdAt)!=null?U:0).getTime()-g}),j(i)}catch(a){const i=typeof(a==null?void 0:a.message)=="string"&&a.message.trim()?a.message:"Failed to load projects";u(i)}finally{b(!1)}},[t]);o.useEffect(()=>{S()},[S]);const E=o.useCallback(a=>{J(i=>{const n=String(a);return i.some(g=>String(g)===n)?i.filter(g=>String(g)!==n):[n,...i].slice(0,12)})},[]),p=o.useCallback(a=>{fe(a),r(`/project/load/${encodeURIComponent(String(a))}`)},[r]),y=R.trim().toLowerCase(),f=o.useMemo(()=>y?d.filter(a=>{var c,g;const i=((c=a.name)!=null?c:"").toLowerCase(),n=((g=a.description)!=null?g:"").toLowerCase();return i.includes(y)||n.includes(y)||String(a.id).includes(y)}):d,[d,y]),P=o.useMemo(()=>{const a=new Set(x.map(String));return f.filter(i=>a.has(String(i.id)))},[f,x]),_=o.useMemo(()=>{const a=new Set(x.map(String));return f.filter(i=>!a.has(String(i.id))).slice(0,10)},[f,x]),A=o.useMemo(()=>{var c;const a=d.length,i=x.length,n=d.length>0?M((c=d[0].updatedAt)!=null?c:d[0].createdAt):"—";return{total:a,pinned:i,lastUpdated:n}},[d,x.length]),v=o.useMemo(()=>pe(),[]),I=o.useMemo(()=>{var i;return v&&d.some(n=>String(n.id)===String(v))?String(v):(i=d[0])==null?void 0:i.id},[v,d]);return d.length>0,e.jsxs(e.Fragment,{children:[e.jsx(X,{title:"Scipion",description:"Scipion Home"}),e.jsxs("div",{className:s(W,"grid grid-cols-12 gap-4 md:gap-6"),children:[e.jsx("div",{className:"col-span-12",children:e.jsx(H,{className:"overflow-hidden",children:e.jsxs("div",{className:"grid gap-6 xl:grid-cols-12",children:[e.jsx("div",{className:"xl:col-span-8",children:e.jsxs("div",{className:s("rounded-[10px] border px-5 py-5","border-indigo-200/70 bg-gradient-to-br from-indigo-50 via-white to-sky-50","dark:border-indigo-900/50 dark:bg-gradient-to-br dark:from-slate-900 dark:via-slate-900 dark:to-slate-950","lg:px-6 lg:py-6"),children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-[10px] border border-indigo-200/80 bg-white/80 px-3 py-1 text-xs font-semibold tracking-[0.02em] text-black-700 dark:border-indigo-800 dark:bg-slate-900/80 dark:text-indigo-200",children:[e.jsx(ue,{className:"h-3.5 w-3.5"}),"Scipion v4.0.0 — Flavius"]}),e.jsx("h1",{className:"mt-4 text-2xl font-bold tracking-[-0.02em] text-gray-950 dark:text-white md:text-[2.2rem]",children:"Welcome back"}),e.jsx("p",{className:"mt-3 max-w-3xl text-sm leading-7 text-gray-700 dark:text-gray-300 md:text-base",children:"Start from where you left off, jump into your projects, and keep the most important workspace actions close at hand without overloading the page."}),e.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[e.jsxs("button",{type:"button",onClick:()=>I?p(I):r("/projects"),className:s("inline-flex items-center gap-2 rounded-[10px] px-4 py-2.5 text-sm font-semibold transition","text-white shadow-sm hover:shadow-md hover:brightness-[0.98]","bg-gradient-to-r from-indigo-600 via-sky-600 to-cyan-600"),children:[e.jsx(w,{className:"h-4 w-4"}),I?"Open last project":"Open projects"]}),e.jsxs("a",{href:"https://scipion-em.github.io/docs/release-3.0.0/index.html",target:"_blank",rel:"noreferrer",className:s("inline-flex items-center gap-2 rounded-[10px] border px-4 py-2.5 text-sm font-semibold transition","border-gray-300/80 bg-white text-gray-950 hover:bg-gray-50","dark:border-gray-700 dark:bg-slate-900 dark:text-white dark:hover:bg-slate-800/80"),children:[e.jsx(V,{className:"h-4 w-4"}),"Release notes"]})]}),e.jsxs("div",{className:"mt-6 border-t border-white/70 pt-4 dark:border-slate-800",children:[e.jsx(k,{children:"Workspace actions"}),e.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-1 sm:grid-cols-2",children:[e.jsx(N,{title:"Projects",description:"Browse your projects, open a workflow, or manage tags.",icon:e.jsx(L,{className:"h-4 w-4"}),tone:"indigo",to:"/projects"}),e.jsx(N,{title:"Workflows",description:"Load workflow templates and jump directly into execution.",icon:e.jsx(ee,{className:"h-4 w-4"}),tone:"violet",to:"/workflows"}),e.jsx(N,{title:"Plugins",description:"Install, uninstall or update available Scipion plugins.",icon:e.jsx(oe,{className:"h-4 w-4"}),tone:"emerald",to:"/plugins"}),e.jsx(N,{title:"Settings",description:"User preferences, tags, instance configuration and environment values.",icon:e.jsx(te,{className:"h-4 w-4"}),tone:"amber",to:"/settings"})]})]})]})}),e.jsx("div",{className:"xl:col-span-4",children:e.jsxs("div",{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:s("rounded-[10px] border px-4 py-4","border-gray-300/80 bg-gray-50/75","dark:border-gray-700 dark:bg-slate-950/40"),children:[e.jsx(k,{children:"Workspace"}),e.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-3 sm:grid-cols-3 xl:grid-cols-1",children:[e.jsx(C,{label:"Projects",value:A.total,icon:e.jsx(L,{className:"h-4 w-4"})}),e.jsx(C,{label:"Pinned",value:A.pinned,icon:e.jsx(B,{className:"h-4 w-4"})}),e.jsx(C,{label:"Last update",value:A.lastUpdated,icon:e.jsx(ne,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mt-4 border-t border-gray-200/90 pt-4 dark:border-gray-800",children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"API status"}),e.jsx("span",{className:"font-semibold text-gray-950 dark:text-white",children:h?"Degraded":"OK"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:"Projects loaded"}),e.jsx("span",{className:"font-semibold text-gray-950 dark:text-white",children:l?"Loading…":String(d.length)})]})]}),h?e.jsx("div",{className:"mt-3 rounded-2xl border border-red-200/80 bg-red-50 px-4 py-3 text-sm leading-6 text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-200",children:h}):null]})]}),e.jsxs("div",{className:s("rounded-[10px] border px-4 py-4","border-gray-300/80 bg-gray-50/75","dark:border-gray-700 dark:bg-slate-950/40"),children:[e.jsx(k,{children:"Resources"}),e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsx(O,{title:"Quickstart",subtitle:"Get productive fast",icon:e.jsx(ce,{className:"h-4 w-4"}),tone:"violet",href:"https://scipion-em.github.io/docs/release-3.0.0/index.html",openInNewTab:!0}),e.jsx(O,{title:"Documentation",subtitle:"Browse full docs and tutorials",icon:e.jsx(V,{className:"h-4 w-4"}),tone:"sky",href:"https://scipion-em.github.io/docs/",openInNewTab:!0}),e.jsx(O,{title:"Support & diagnostics",subtitle:"Review settings and environment",icon:e.jsx(xe,{className:"h-4 w-4"}),tone:"rose",to:"/settings"})]})]})]})})]})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(H,{className:"border-gray-300/90 shadow-[0_8px_30px_rgba(15,23,42,0.04)] dark:shadow-none",title:"Projects",subtitle:"Pinned projects stay visible at the top. Recent projects remain the main working list.",right:e.jsxs("div",{className:"flex w-full flex-col gap-2 md:w-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative w-full md:w-[320px]",children:[e.jsx(re,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500 dark:text-gray-400"}),e.jsx("input",{value:R,onChange:a=>Y(a.target.value),placeholder:"Search projects…",className:s("w-full rounded-[10px] border py-2.5 pl-9 pr-3 text-sm font-medium outline-none transition","border-gray-300/80 bg-white text-gray-950 placeholder:text-gray-400","focus:border-indigo-500/40 focus:ring-2 focus:ring-indigo-500/10","dark:border-gray-700 dark:bg-slate-900 dark:text-white dark:placeholder:text-gray-500","dark:focus:border-indigo-400/40 dark:focus:ring-indigo-400/15")})]}),e.jsxs("button",{type:"button",onClick:()=>void S(),className:s("inline-flex items-center justify-center gap-2 rounded-[10px] border px-3 py-2.5 text-sm font-medium transition","border-gray-300/80 bg-white text-gray-950 hover:bg-gray-50","dark:border-gray-700 dark:bg-slate-900 dark:text-white dark:hover:bg-slate-800/80",l?"pointer-events-none opacity-70":""),children:[e.jsx(ae,{className:s("h-4 w-4 text-sky-700 dark:text-sky-300",l?"animate-spin":"")}),"Refresh"]}),e.jsxs(T,{to:"/projects",className:s("inline-flex items-center justify-center gap-2 rounded-[10px] border px-3 py-2.5 text-sm font-medium transition","border-gray-300/80 bg-white text-gray-950 hover:bg-gray-50","dark:border-gray-700 dark:bg-slate-900 dark:text-white dark:hover:bg-slate-800/80"),children:[e.jsx(L,{className:"h-4 w-4 text-indigo-700 dark:text-indigo-300"}),"View all"]})]}),children:l&&d.length===0?e.jsx("div",{className:"rounded-[10px] border border-gray-300/80 bg-white px-4 py-4 text-sm leading-6 text-gray-700 dark:border-gray-700 dark:bg-slate-900 dark:text-gray-300",children:"Loading projects…"}):_.length===0&&P.length===0?e.jsx("div",{className:"rounded-[10px] border border-gray-300/80 bg-white px-4 py-4 text-sm leading-6 text-gray-700 dark:border-gray-700 dark:bg-slate-900 dark:text-gray-300",children:"No projects match your search."}):e.jsxs("div",{className:"space-y-7",children:[e.jsxs("div",{children:[e.jsx("div",{className:"mb-3 flex items-center justify-between gap-3",children:e.jsxs("div",{children:[e.jsx(k,{children:"Pinned"}),e.jsx("div",{className:"mt-1 text-sm text-gray-700 dark:text-gray-300",children:"Your most used projects stay one click away."})]})}),P.length===0?e.jsx("div",{className:"rounded-[10px] border border-dashed border-gray-300/90 bg-gray-50/80 px-4 py-3 text-sm leading-6 text-gray-700 dark:border-gray-700 dark:bg-slate-950/40 dark:text-gray-300",children:"No pinned projects yet. Pin a project from the list below."}):e.jsx("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-3",children:P.map(a=>{var i,n;return e.jsxs("div",{className:s("flex items-center justify-between gap-3 rounded-[10px] border px-4 py-4 transition","border-gray-300/75 bg-gradient-to-br from-white to-gray-50 hover:border-gray-400","dark:border-gray-700 dark:bg-gradient-to-br dark:from-slate-900 dark:to-slate-950 dark:hover:border-gray-600"),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("button",{type:"button",onClick:()=>p(a.id),className:"block min-w-0 truncate text-left text-[15px] font-semibold text-gray-950 hover:underline dark:text-white",children:a.name}),e.jsx("div",{className:"mt-1 line-clamp-1 text-sm text-gray-700 dark:text-gray-300",children:(i=a.description)!=null&&i.trim()?a.description:"No description"}),e.jsxs("div",{className:"mt-2 text-xs font-medium  text-gray-500 dark:text-gray-400",children:["Updated ",M((n=a.updatedAt)!=null?n:a.createdAt)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>E(a.id),className:s("inline-flex items-center justify-center rounded-[10px] border p-2.5 transition","border-amber-300/70 bg-amber-50 hover:bg-amber-100","dark:border-amber-700 dark:bg-amber-950/20 dark:hover:bg-amber-950/35"),title:"Unpin",children:e.jsx($,{className:"h-4 w-4 text-amber-700 dark:text-amber-300"})}),e.jsxs("button",{type:"button",onClick:()=>p(a.id),className:s("inline-flex items-center gap-2 rounded-[10px] px-3.5 py-2.5 text-sm font-semibold transition","text-white shadow-sm hover:shadow-md hover:brightness-[0.98]","bg-gradient-to-r from-indigo-600 via-sky-600 to-cyan-600"),children:["Open",e.jsx(w,{className:"h-4 w-4"})]})]})]},a.id)})})]}),e.jsxs("div",{className:"border-t border-gray-200/90 pt-6 dark:border-gray-700",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx(k,{children:"Recent"}),e.jsx("div",{className:"mt-1 text-sm text-gray-700 dark:text-gray-300",children:"Jump back to where you left off."})]}),e.jsxs("div",{className:"overflow-hidden rounded-[10px] border border-gray-300/85 bg-white dark:border-gray-700 dark:bg-slate-900",children:[e.jsxs("div",{className:s("grid grid-cols-12 gap-0 px-4 py-3.5","bg-gray-50 text-gray-700 dark:bg-slate-800/70 dark:text-gray-200"),children:[e.jsx("div",{className:"col-span-5 text-xs font-semibold uppercase tracking-[0.12em]",children:"Project"}),e.jsx("div",{className:"col-span-4 hidden text-xs font-semibold uppercase tracking-[0.12em] md:block",children:"Description"}),e.jsx("div",{className:"col-span-3 text-right text-xs font-semibold uppercase tracking-[0.12em]",children:"Updated"})]}),e.jsxs("div",{className:"divide-y divide-gray-200/90 dark:divide-gray-700",children:[_.map(a=>{var n,c;const i=x.some(g=>String(g)===String(a.id));return e.jsxs("div",{className:s("grid grid-cols-12 items-center gap-0 px-4 py-4 transition","hover:bg-gray-50 dark:hover:bg-slate-800/60"),children:[e.jsx("div",{className:"col-span-5 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>E(a.id),className:s("inline-flex items-center justify-center rounded-[10px] p-2 transition",i?"bg-amber-50 text-amber-700 hover:bg-amber-100 dark:bg-amber-950/30 dark:text-amber-200 dark:hover:bg-amber-950/45":"bg-gray-100 text-gray-600 hover:bg-gray-200 dark:bg-slate-800 dark:text-gray-300 dark:hover:bg-slate-700"),title:i?"Unpin":"Pin",children:i?e.jsx($,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>p(a.id),className:"min-w-0 truncate text-left text-[15px] font-medium text-gray-950 hover:underline dark:text-white",children:a.name})]})}),e.jsx("div",{className:"col-span-4 hidden min-w-0 md:block",children:e.jsx("div",{className:"line-clamp-1 text-sm text-gray-700 dark:text-gray-300",children:(n=a.description)!=null&&n.trim()?a.description:"—"})}),e.jsx("div",{className:"col-span-3 text-right",children:e.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:M((c=a.updatedAt)!=null?c:a.createdAt)})})]},a.id)}),_.length===0?e.jsx("div",{className:"px-4 py-4 text-sm leading-6 text-gray-700 dark:text-gray-300",children:"No recent unpinned projects match your search."}):null]})]})]})]})})})]})]})}export{_e as default};
