zdashboard 2.12.1 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/cli.js +6 -4
  2. package/dist/cli.js.map +1 -1
  3. package/dist/web/assets/Assistant-Bold-gm-uSS1B.woff2 +0 -0
  4. package/dist/web/assets/Assistant-Medium-DrcxCXg3.woff2 +0 -0
  5. package/dist/web/assets/Assistant-Regular-DVxZuzxb.woff2 +0 -0
  6. package/dist/web/assets/Assistant-SemiBold-SCI4bEL9.woff2 +0 -0
  7. package/dist/web/assets/{CodeViewer-Dxlw7RnH.js → DiagramViewer-CQYfB79k.js} +50 -49
  8. package/dist/web/assets/{FileIcon-DEXf9oCF.js → FileIcon-KX0Rfn5x.js} +1 -1
  9. package/dist/web/assets/{FilterPills-BZwzyDRQ.js → FilterPills-D2zZaent.js} +1 -1
  10. package/dist/web/assets/Sidebar-B6Pvc7pb.js +1 -0
  11. package/dist/web/assets/Sidebar-Cg5Nabqa.js +1 -0
  12. package/dist/web/assets/Workspace-5hZEbEDw.js +1 -0
  13. package/dist/web/assets/Workspace-BzLI5G5q.js +1 -0
  14. package/dist/web/assets/{Workspace-D71kFE3G.js → Workspace-CpV2wf10.js} +2 -2
  15. package/dist/web/assets/Workspace-DbRd77b0.js +1 -0
  16. package/dist/web/assets/cynefin-OW5HDTMX-BLthHq8j.js +3387 -0
  17. package/dist/web/assets/excalidraw-CbfdidzT.css +1 -0
  18. package/dist/web/assets/excalidraw-Duf4g83v.js +591 -0
  19. package/dist/web/assets/{index-DJiq_38M.js → index-BxPRo4R9.js} +50 -45
  20. package/dist/web/assets/index-D7HrI6pR.js +1 -0
  21. package/dist/web/assets/{index-Bd4-oORn.css → index-DJ7iFi2B.css} +1 -1
  22. package/dist/web/assets/{usePluginData-BmlgMZle.js → usePluginData-BaCM6nnK.js} +1 -1
  23. package/dist/web/assets/{vendor-react-CDaMBvJU.js → vendor-react-OhDMXABq.js} +1 -1
  24. package/dist/web/assets/vendor-ui-D8qdFUhC.js +42 -0
  25. package/dist/web/assets/web-C7ddFKgL.js +2 -0
  26. package/dist/web/assets/web-CBXj6xFf.js +2 -0
  27. package/dist/web/assets/web-CmZk5ox_.js +2 -0
  28. package/dist/web/assets/web-oi27dtPg.js +2 -0
  29. package/dist/web/index.html +5 -4
  30. package/package.json +3 -2
  31. package/dist/web/assets/Sidebar-BLjYbvRT.js +0 -1
  32. package/dist/web/assets/Sidebar-CttCg64y.js +0 -1
  33. package/dist/web/assets/Workspace-B5Nn0L3J.js +0 -1
  34. package/dist/web/assets/Workspace-Cf7ZMclE.js +0 -1
  35. package/dist/web/assets/Workspace-Cn_qfesY.js +0 -1
  36. package/dist/web/assets/vendor-ui-dpI0b3Ao.js +0 -42
  37. package/dist/web/assets/web-5OFeHrya.js +0 -2
  38. package/dist/web/assets/web-C47Nea8q.js +0 -2
  39. package/dist/web/assets/web-ONYPO1IN.js +0 -2
  40. package/dist/web/assets/web-vocphEUd.js +0 -2
  41. /package/dist/web/assets/{CodeViewer-BTcE7LSd.css → DiagramViewer-BTcE7LSd.css} +0 -0
@@ -1 +1 @@
1
- import{j as o}from"./vendor-react-CDaMBvJU.js";import{u as r}from"./index-DJiq_38M.js";function a({className:s=""}){return o.jsx("span",{"data-testid":"refresh-spinner",role:"status","aria-label":"刷新中",className:`inline-block h-3 w-3 flex-none shrink-0 animate-spin rounded-[var(--radius-full)] border border-muted-foreground/25 border-t-muted-foreground ${s}`})}const i={".md":"md",".markdown":"md",".mdx":"md",".ts":"ts",".tsx":"tsx",".js":"js",".jsx":"jsx",".mjs":"mjs",".cjs":"mjs",".mts":"mjs",".cts":"mjs",".css":"css",".scss":"css",".less":"css",".html":"html",".htm":"html",".json":"json",".yaml":"json",".yml":"json",".toml":"json",".csv":"csv",".tsv":"csv",".sh":"sh",".bash":"sh",".zsh":"sh",".sql":"sh",".py":"py",".go":"py",".rs":"py",".java":"py",".svg":"svg",".png":"svg",".jpg":"svg",".jpeg":"svg",".gif":"svg",".webp":"svg",".ico":"svg"};function c(s){const e=s.toLowerCase();if(e==="justfile"||e==="makefile")return e;const n=s.lastIndexOf("."),t=n>=0?s.slice(n).toLowerCase():"";return i[t]??"unknown"}function u({name:s,active:e}){const{icon:n}=r(),t=n(c(s));return t?o.jsx("span",{className:`h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center ${e?"text-primary":"text-muted-foreground"}`,children:t}):null}export{u as F,a as R};
1
+ import{j as o}from"./vendor-react-OhDMXABq.js";import{u as r}from"./index-BxPRo4R9.js";function a({className:s=""}){return o.jsx("span",{"data-testid":"refresh-spinner",role:"status","aria-label":"刷新中",className:`inline-block h-3 w-3 flex-none shrink-0 animate-spin rounded-[var(--radius-full)] border border-muted-foreground/25 border-t-muted-foreground ${s}`})}const i={".md":"md",".markdown":"md",".mdx":"md",".ts":"ts",".tsx":"tsx",".js":"js",".jsx":"jsx",".mjs":"mjs",".cjs":"mjs",".mts":"mjs",".cts":"mjs",".css":"css",".scss":"css",".less":"css",".html":"html",".htm":"html",".json":"json",".yaml":"json",".yml":"json",".toml":"json",".csv":"csv",".tsv":"csv",".sh":"sh",".bash":"sh",".zsh":"sh",".sql":"sh",".py":"py",".go":"py",".rs":"py",".java":"py",".svg":"svg",".png":"svg",".jpg":"svg",".jpeg":"svg",".gif":"svg",".webp":"svg",".ico":"svg"};function c(s){const e=s.toLowerCase();if(e==="justfile"||e==="makefile")return e;const n=s.lastIndexOf("."),t=n>=0?s.slice(n).toLowerCase():"";return i[t]??"unknown"}function u({name:s,active:e}){const{icon:n}=r(),t=n(c(s));return t?o.jsx("span",{className:`h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center ${e?"text-primary":"text-muted-foreground"}`,children:t}):null}export{u as F,a as R};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-CDaMBvJU.js";import{d as n}from"./index-DJiq_38M.js";function b({items:l,value:d,onChange:p,ariaLabel:c,renderExtra:o,renderLabel:a,className:t,...u}){return e.jsx("div",{role:"group","aria-label":c,className:n("inline-flex items-center gap-1.5 flex-wrap",t),...u,children:l.map(r=>{const s=r.key===d;return e.jsxs("button",{type:"button","aria-pressed":s,onClick:()=>p(r.key),className:n("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-[var(--radius-full)] border text-xs transition-colors",s?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",r.className),children:[r.renderLabel?r.renderLabel(r):a?a(r):e.jsx("span",{children:r.label}),r.badge&&e.jsx("span",{className:"opacity-80",children:r.badge}),r.renderExtra?r.renderExtra(r):o==null?void 0:o(r)]},r.key)})})}export{b as F};
1
+ import{j as e}from"./vendor-react-OhDMXABq.js";import{d as n}from"./index-BxPRo4R9.js";function b({items:l,value:d,onChange:p,ariaLabel:c,renderExtra:o,renderLabel:a,className:t,...u}){return e.jsx("div",{role:"group","aria-label":c,className:n("inline-flex items-center gap-1.5 flex-wrap",t),...u,children:l.map(r=>{const s=r.key===d;return e.jsxs("button",{type:"button","aria-pressed":s,onClick:()=>p(r.key),className:n("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-[var(--radius-full)] border text-xs transition-colors",s?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",r.className),children:[r.renderLabel?r.renderLabel(r):a?a(r):e.jsx("span",{children:r.label}),r.badge&&e.jsx("span",{className:"opacity-80",children:r.badge}),r.renderExtra?r.renderExtra(r):o==null?void 0:o(r)]},r.key)})})}export{b as F};
@@ -0,0 +1 @@
1
+ import{r as L,j as e}from"./vendor-react-OhDMXABq.js";import{b as O,u as I,S as P,E as M,c as _,r as K,s as U}from"./index-BxPRo4R9.js";import{R as V,F as Y}from"./FileIcon-KX0Rfn5x.js";import{u as B}from"./usePluginData-BaCM6nnK.js";import{a as b}from"./fetchJson-D-dWeu1j.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";function h(r,n){return!n||r.name.toLowerCase().includes(n)?!0:(r.children??[]).some(l=>h(l,n))}const $="zd-view-collapse";function G(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;const n=r;return Array.isArray(n.wt)&&n.wt.every(l=>typeof l=="string")&&typeof n.root=="boolean"}const H=()=>K($,{wt:[],root:!1},G);function F(r){U($,JSON.stringify(r))}async function Q(){const r=await b("/__worktrees",{cache:"no-store"}),n={};await Promise.all(r.map(async i=>{const a=await b(`/__files?wt=${encodeURIComponent(i.path)}`,{cache:"no-store"});n[i.path]=a.tree??[]}));const l=await b("/__files",{cache:"no-store"});return{worktrees:r,wtTrees:n,rootTree:l.tree??[]}}function v({node:r,depth:n,filter:l,current:i,onSelectFile:a}){const{icon:f}=I(),d=r.children??[],p=!!l&&r.name.toLowerCase().includes(l)?d:d.filter(s=>h(s,l)),[x,g]=L.useState(!r.defaultCollapsed),o=l?!0:x;return!p.length&&l?null:e.jsxs("div",{children:[(()=>{const s=r.name.match(/^([a-z]+)(?: \((\d+)\))?$/),j=s?f(s[1]):void 0;return e.jsxs("button",{onClick:()=>g(u=>!u),"aria-expanded":o,className:"w-full flex items-center gap-1.5 px-2 py-1 text-sm text-foreground hover:bg-muted rounded-md mx-1",style:{paddingLeft:8+n*14,width:"calc(100% - 8px)"},children:[e.jsx("span",{className:`h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-transform ${o?"rotate-90":""}`,children:f("chevron-right")}),j?e.jsx("span",{className:"h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center text-muted-foreground",children:j}):e.jsx("span",{className:"h-3.5 w-3.5 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-colors",children:f(o?"folder-open":"folder")}),e.jsx("span",{className:"font-medium truncate",children:s?s[1]:r.name}),(s==null?void 0:s[2])&&e.jsx("span",{className:"ml-auto mr-1 shrink-0 rounded-full bg-muted px-1.5 text-xs font-mono text-muted-foreground",children:s[2]})]})})(),o&&p.map(s=>s.kind==="dir"?e.jsx(v,{node:s,depth:n+1,filter:l,current:i,onSelectFile:a},s.name+n):e.jsxs("button",{onClick:()=>s.path&&a(s.path),className:`w-full flex items-center gap-1.5 pr-2 py-1 text-sm hover:bg-muted rounded-md mx-1 ${i===s.path?"bg-primary/10 text-foreground font-medium":"text-muted-foreground"}`,style:{paddingLeft:20+n*14,width:"calc(100% - 8px)"},children:[e.jsx(Y,{name:s.name,active:i===s.path}),e.jsx("span",{className:"truncate",children:s.name})]},s.path))]})}function ne(){var C,E,R;const r=O(),n=r.params,l=n.get("file"),i=n.get("wt"),a=(n.get("filter")??"").toLowerCase(),f=n.get("card")==="dirty",{icon:d}=I(),[m,p]=L.useState(H),x=new Set(m.wt),g=m.root,o=B("view:sidebar-trees",Q,{subscribe:"files"}),s=((C=o.data)==null?void 0:C.worktrees)??[],j=((E=o.data)==null?void 0:E.wtTrees)??{},u=((R=o.data)==null?void 0:R.rootTree)??[],A=t=>{const c=new Set(m.wt);c.has(t)?c.delete(t):c.add(t);const w={...m,wt:[...c]};p(w),F(w)},W=()=>{const t={...m,root:!m.root};p(t),F(t)},D=t=>{r.navigate({filter:t.trim()?t:null},{replace:!0})},N=s.length>0,z=!!a&&(s.some(t=>(j[t.path]??[]).some(c=>h(c,a)))||u.some(t=>h(t,a))),k=!a&&!!o.data&&!N&&u.length===0,S=!!a&&!!o.data&&!z;return e.jsx("div",{className:"p-2 flex flex-col h-full",children:e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[e.jsxs("div",{className:"w-full flex items-center gap-2",children:[e.jsx("input",{value:a,onChange:t=>D(t.target.value),placeholder:"过滤…","data-testid":"view-filter-input",className:"w-full h-7 px-2 text-xs rounded border border-border bg-background focus:border-primary"}),o.refreshing&&e.jsx(V,{})]}),e.jsxs("div",{className:"py-1 flex-1 min-h-0 overflow-auto flex flex-col","data-testid":"view-tree-scroller",children:[o.loading&&!o.data&&e.jsx(P,{rows:6,className:"mx-1 mt-1"}),o.error&&e.jsx(M,{message:o.error,onRetry:o.reload}),k&&e.jsx(_,{title:"暂无可展示的规格文件",hint:"约定扫描目录:openspec / docs / .zdev/apply"}),S&&e.jsx(_,{title:"无匹配结果",hint:"调整或清空过滤词后重试"}),!!o.data&&!o.error&&!k&&!S&&e.jsxs(e.Fragment,{children:[N&&s.map(t=>{const w=(j[t.path]??[]).filter(y=>h(y,a));if(!w.length&&a)return null;const T=f&&t.dirty;return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>A(t.path),"aria-expanded":!x.has(t.path),"data-drill-dirty":T?"true":void 0,className:`w-full flex items-center gap-1 px-2 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md ${T?"bg-warning/10 ring-1 ring-warning":""}`,children:[e.jsx("span",{className:"h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-transform",children:d("chevron-right",x.has(t.path)?"":"rotate-90")}),e.jsx("span",{className:"h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground",children:d("git-branch")}),e.jsx("span",{className:"truncate",children:t.branch}),t.dirty&&e.jsx("span",{className:"ml-auto flex-none h-2 w-2 rounded-full bg-destructive shrink-0",title:"有未提交变更"})]}),!x.has(t.path)&&e.jsx("div",{className:"ml-2",children:w.map(y=>e.jsx(v,{node:y,depth:1,filter:a,current:i===t.path?l:null,onSelectFile:J=>r.navigate({wt:t.path,file:J})},y.name))})]},t.path)}),u.length>0&&(!a||u.some(t=>h(t,a)))&&e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:W,"aria-expanded":!g,className:"w-full flex items-center gap-1 px-2 py-1.5 text-sm font-medium text-foreground hover:bg-muted rounded-md",children:[e.jsx("span",{className:`h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground transition-transform ${g?"":"rotate-90"}`,children:d("chevron-right")}),e.jsx("span",{className:"h-3 w-3 shrink-0 inline-flex items-center justify-center text-muted-foreground",children:d("git-branch")}),e.jsx("span",{children:"当前分支"})]}),!g&&e.jsx("div",{className:"ml-2",children:u.filter(t=>h(t,a)).map(t=>e.jsx(v,{node:t,depth:1,filter:a,current:i?null:l,onSelectFile:c=>r.navigate({wt:null,file:c})},t.name))})]})]})]})]})})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{r as m,j as e}from"./vendor-react-OhDMXABq.js";import{R as b,F as k}from"./FileIcon-KX0Rfn5x.js";import{b as j,u as f,S,E as N,c as u,s as v,r as G}from"./index-BxPRo4R9.js";import{u as O}from"./usePluginData-BaCM6nnK.js";import{a as R}from"./fetchJson-D-dWeu1j.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";const x="zd-design-groups";function E(o){return!o||typeof o!="object"||Array.isArray(o)?!1:Object.values(o).every(a=>typeof a=="boolean")}const _=()=>G(x,{},E),w={page:"monitor",component:"blocks",icon:"shapes",token:"palette",md:"book-open",video:"video",audio:"audio-lines",pdf:"file-text",font:"type",diagram:"pen-tool"},I=[{key:"page",label:"页面"},{key:"component",label:"组件"},{key:"icon",label:"图标"},{key:"token",label:"Tokens"},{key:"md",label:"文档"},{key:"video",label:"视频"},{key:"audio",label:"音频"},{key:"pdf",label:"PDF"},{key:"font",label:"字体"},{key:"diagram",label:"图表"}];function U(){const o=j(),a=o.params,c=a.get("asset"),d=a.get("type"),r=a.get("folder");f();const t=O("design:/__design/assets",()=>R("/__design/assets",{cache:"no-store"}),{subscribe:"files"}),i=m.useMemo(()=>{const s=t.data;return s?I.map(l=>({...l,items:(s[l.key]??[]).filter(y=>!r||y.path.startsWith(r))})).filter(l=>l.items.length>0):[]},[t.data,r]),n=s=>o.navigate({type:s.type,asset:s.path}),[p,g]=m.useState(_),h=s=>{const l={...p,[s]:!(p[s]??!0)};g(l),v(x,JSON.stringify(l))};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"p-3 text-xs text-muted-foreground truncate flex-none flex items-center gap-2",children:["设计资产",t.refreshing&&e.jsx(b,{})]}),t.loading&&!t.data&&e.jsx(S,{rows:6,className:"mx-3"}),t.error&&e.jsx(N,{message:t.error,onRetry:t.reload}),!t.error&&(t.data||!t.loading)&&i.length===0&&(r?e.jsx(u,{title:"无匹配结果",hint:`目录过滤 "${r}" 无匹配资产,调整或清空后重试`}):e.jsx(u,{title:"未发现 .zdev/design 资产",hint:"运行 zdesign 生成"})),i.map(s=>e.jsx(P,{group:s,open:p[s.key]??!0,onToggle:()=>h(s.key),current:c&&d===s.key?c:null,onSelect:n},s.key))]})}function P({group:o,open:a,onToggle:c,current:d,onSelect:r}){const{icon:t}=f(),i=w[o.key];return e.jsxs("div",{className:"mb-1.5 px-1",children:[e.jsxs("button",{onClick:c,"aria-expanded":a,className:"w-full flex items-center gap-1.5 pt-2 pb-1 text-sm font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground rounded-md",children:[t("chevron-right",`h-3 w-3 shrink-0 transition-transform ${a?"rotate-90":""}`),i&&t(i,"h-3.5 w-3.5 shrink-0"),e.jsx("span",{className:"truncate",children:o.label}),e.jsx("span",{className:"ml-auto shrink-0 rounded-full bg-muted px-1.5 font-mono text-xs font-normal",children:o.items.length})]}),a&&o.items.map(n=>e.jsxs("button",{onClick:()=>r(n),className:`w-full text-left flex items-center gap-2 px-2.5 py-1.5 text-xs hover:bg-muted rounded-md ${d===n.path?"bg-primary/10 text-foreground font-medium":"text-muted-foreground"}`,children:[e.jsx(k,{name:n.name,active:d===n.path}),e.jsx("span",{className:"truncate",children:n.name}),n.ext&&e.jsx("span",{className:"ml-auto font-mono text-xs text-muted-foreground/60",children:n.ext})]},n.path))]})}export{U as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-react-OhDMXABq.js";import{d as g,u as h,a as j,b as v,E as N,S as y,f as w,P as _}from"./index-BxPRo4R9.js";import{u}from"./usePluginData-BaCM6nnK.js";import{a as m}from"./fetchJson-D-dWeu1j.js";import{m as n}from"./web-C7ddFKgL.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function k({value:i,className:l}){const r=Math.max(0,Math.min(100,i));return e.jsx("div",{className:g("rounded-[var(--radius-full)] bg-muted overflow-hidden",l),role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuetext":`${r}%`,children:e.jsx("div",{className:"h-full rounded-[var(--radius-full)] bg-primary transition-all",style:{width:`${r}%`}})})}function F(i){var d,c;const{icon:l}=h(),r=j(n.mode,"h-5 w-5"),x=v(),a=u("stats:/__stats/data",()=>m("/__stats/data",{cache:"no-store"}),{subscribe:"files"}),o=u("stats:/__detect",()=>m("/__detect",{cache:"no-store"}));if(a.error)return e.jsx("div",{className:"h-full flex flex-col",children:e.jsx(N,{message:a.error,onRetry:a.reload})});if(!a.data)return e.jsx("div",{className:"h-full p-6",children:e.jsx(y,{rows:8})});const s=a.data,f=Math.max(...s.byExt.map(t=>t.count),1),p=[{label:"文件",value:String(s.files),iconName:"file-text",drill:null},{label:"目录",value:String(s.dirs),iconName:"folder-tree",drill:null},{label:"总大小",value:w(s.totalSize),iconName:null,drill:null},{label:"Worktree",value:String(s.worktrees),iconName:"git-branch",drill:"worktree"},{label:"未提交",value:String(s.dirty??0),iconName:null,drill:"dirty"}],b=t=>x.navigate({p:"view",card:t});return e.jsx(_,{manifest:n,icon:r,breadcrumb:["插件",n.mode],children:e.jsxs("div",{className:"mx-auto h-full max-w-6xl overflow-auto rounded-lg border bg-background p-6 shadow-sm",children:[e.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:"后端 fs 扫描 + 前端渲染 · 改文件即时刷新 · 点击卡片跳转"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 mb-6",children:p.map(t=>e.jsxs("button",{type:"button",onClick:()=>t.drill&&b(t.drill),disabled:!t.drill,title:t.drill?`点击跳转至 ${t.label}`:void 0,className:`rounded-lg border bg-background p-4 text-left transition-colors ${t.drill?"hover:bg-muted/70 cursor-pointer":"cursor-default opacity-80"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-xl font-bold",children:t.value}),t.iconName&&l(t.iconName,"h-4 w-4 text-muted-foreground/50")]}),e.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:t.label})]},t.label))}),e.jsx("h2",{className:"text-xs font-medium text-muted-foreground mb-3",children:"文件类型 Top 10"}),e.jsx("div",{className:"space-y-2",children:s.byExt.map(t=>e.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.jsx("span",{className:"w-16 font-mono text-foreground truncate",children:t.ext}),e.jsx(k,{value:parseFloat((t.count/f*100).toFixed(1)),className:"flex-1 h-2"}),e.jsx("span",{className:"w-8 text-right font-mono text-muted-foreground",children:t.count})]},t.ext))}),e.jsxs("div",{className:"mt-5 flex items-center gap-2 text-xs",children:[o.error?e.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border text-muted-foreground border-border",children:"justfile 探测失败"}):e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${(d=o.data)!=null&&d.hasJust?"text-success border-success/30 bg-success/10":"text-muted-foreground border-border"}`,children:["justfile ",(c=o.data)!=null&&c.hasJust?"✓":"✗"]}),typeof s.dirty=="number"&&e.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded border ${s.dirty?"text-warning border-warning/30 bg-warning/10":"text-success border-success/30 bg-success/10"}`,children:s.dirty?`${s.dirty} 未提交`:"clean"}),e.jsxs("span",{className:"text-muted-foreground",children:["root: ",s.root]})]})]})})}export{F as default};
@@ -0,0 +1 @@
1
+ import{j as e,r as h}from"./vendor-react-OhDMXABq.js";import{F as M}from"./FilterPills-D2zZaent.js";import{E as $,u as k,a as A,b as P,P as L,c as U,r as T,s as W}from"./index-BxPRo4R9.js";import{u as v,R as y,D as z,C as D,M as H,I as J}from"./DiagramViewer-CQYfB79k.js";import{f as K,v as X}from"./fetchJson-D-dWeu1j.js";import{m as w}from"./web-CBXj6xFf.js";import"./vendor-ui-D8qdFUhC.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function B({path:t}){const[s,a]=v(),c="/__design/asset?path="+encodeURIComponent(t)+(s?"&v="+s:"");return e.jsxs("div",{className:"relative h-full",children:[e.jsx("div",{className:"absolute right-3 top-3 z-10",children:e.jsx(y,{onClick:a})}),e.jsx("iframe",{src:c,title:"预览",className:"w-full h-full border-0 bg-white"})]})}const C=/^(#|rgb|rgba|hsl|hsla|oklch|oklab|color\()/i,R=/font|family|type/i;function G(t){const s=t.match(/--[A-Za-z0-9_-]+\s*:\s*[^;}\n]+/g)??[];if(!s.length)return[];const a=r=>{const o=r.indexOf(":"),x=r.slice(0,o).trim(),g=r.slice(o+1).trim();return{name:x,value:g}},c=r=>/^(#([0-9a-fA-F]{3,8})\b|rgb|rgba|hsl|hsla|oklch|oklab|color\()/i.test(r),i=r=>R.test(r),u=s.map(a),d=u.filter(r=>c(r.value)),m=u.filter(r=>!c(r.value)&&i(r.name)),l=u.filter(r=>!c(r.value)&&!i(r.name)),n=[];return d.length&&n.push({label:`配色 · ${d.length}`,items:d}),m.length&&n.push({label:`字体 · ${m.length}`,items:m}),l.length&&n.push({label:`其他 · ${l.length}`,items:l}),n}function Y({path:t}){const[s,a]=h.useState(null),[c,i]=h.useState(null),[u,d]=v(),m=h.useRef(null);return h.useEffect(()=>{let l=!1;const n=m.current!==t;m.current=t,n?(a(null),i(null)):s===null&&i(null);async function r(){try{const o=await K("/__design/asset?path="+encodeURIComponent(t),{cache:"no-store"});if(l)return;a(G(o)),i(null)}catch(o){l||i(X(o))}}return r(),()=>{l=!0}},[t,u]),c&&s===null?e.jsx("div",{className:"h-full flex flex-col p-4",children:e.jsx($,{message:c,onRetry:d})}):s===null?e.jsx("p",{className:"p-3 text-xs text-muted-foreground",children:"解析中…"}):s.length?e.jsxs("div",{className:"relative p-8 flex flex-col gap-7",children:[e.jsx("div",{className:"absolute right-6 top-4 z-10",children:e.jsx(y,{onClick:d})}),s.map(l=>{const n=l.items.some(o=>C.test(o.value)),r=l.items.some(o=>R.test(o.name));return e.jsxs("section",{children:[e.jsx("div",{className:"mb-3 text-sm font-semibold uppercase text-muted-foreground",children:l.label}),n?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(var(--token-card-min-w), 1fr))"},children:l.items.filter(o=>C.test(o.value)).map(({name:o,value:x})=>e.jsxs("div",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsx("div",{className:"h-[var(--design-preview-h)] border-b",style:{background:x}}),e.jsx("div",{className:"px-2.5 pt-2 font-mono text-sm break-all",children:o}),e.jsx("div",{className:"px-2.5 pb-2 text-xs text-muted-foreground",children:x})]},o))}):r?e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(var(--token-card-min-w), 1fr))"},children:l.items.map(({name:o,value:x})=>e.jsxs("div",{className:"overflow-hidden rounded-lg border bg-background",children:[e.jsx("div",{className:"grid h-[var(--design-preview-h)] place-items-center text-2xl",style:{fontFamily:x},children:"Aa"}),e.jsx("div",{className:"px-2.5 font-mono text-sm",children:o})]},o))}):e.jsx("div",{className:"flex flex-col gap-1",children:l.items.map(({name:o,value:x})=>e.jsxs("div",{className:"flex justify-between gap-3 px-2.5 py-1.5 rounded border bg-background text-xs",children:[e.jsx("span",{className:"font-mono",children:o}),e.jsx("span",{className:"text-muted-foreground",children:x})]},o))})]},l.label)})]}):e.jsx("p",{className:"p-3 text-xs",children:"未发现 CSS 变量"})}const p=t=>"/__design/asset?path="+encodeURIComponent(t);function V(){const[t,s]=v();return{bust:a=>t?`${a}&v=${t}`:a,refresh:s}}function j({onClick:t}){return e.jsx("div",{className:"absolute right-3 top-3 z-10",children:e.jsx(y,{onClick:t})})}function Z({path:t}){return e.jsx(H,{path:t,resolve:p})}function q({path:t}){return e.jsx(J,{path:t,resolve:p})}function Q({path:t}){return e.jsx(D,{path:t,resolve:p})}function ee({path:t}){return e.jsx(z,{path:t,resolve:p})}function te({path:t}){const{bust:s,refresh:a}=V();return e.jsxs("div",{className:"relative grid place-items-center p-8",children:[e.jsx(j,{onClick:a}),e.jsx("video",{src:s(p(t)),controls:!0,className:"max-w-full max-h-[80vh] rounded border"})]})}function se({path:t}){const{bust:s,refresh:a}=V();return e.jsxs("div",{className:"relative grid place-items-center p-8",children:[e.jsx(j,{onClick:a}),e.jsx("audio",{src:s(p(t)),controls:!0,className:"w-full max-w-2xl"})]})}function ne({path:t}){const{bust:s,refresh:a}=V();return e.jsxs("div",{className:"relative grid place-items-center p-8 h-full",children:[e.jsx(j,{onClick:a}),e.jsx("iframe",{src:s(p(t)),title:"PDF",className:"w-full h-full max-h-[80vh] rounded border bg-white"})]})}function re({path:t}){const[s,a]=v(),c=h.useRef(null),[i,u]=h.useState("");return h.useEffect(()=>{let d=!1;const m=c.current!==t;c.current=t;let l="",n=null;return m&&u(""),fetch(p(t)).then(r=>r.blob()).then(async r=>{var o;if(!d){if(l=URL.createObjectURL(r),n=new FontFace("zd-font-preview",`url(${l})`),await n.load(),d){(o=n.dispose)==null||o.call(n);return}document.fonts.add(n),u(t.split("/").pop()??t)}}).catch(()=>{d||u(t.split("/").pop()??t)}),()=>{var r;if(d=!0,n)try{document.fonts.delete(n),(r=n.dispose)==null||r.call(n)}catch{}l&&URL.revokeObjectURL(l)}},[t,s]),e.jsxs("div",{className:"relative h-full overflow-auto p-8 grid gap-6 place-content-center text-center",children:[e.jsx(j,{onClick:a}),e.jsx("div",{className:"text-xs text-muted-foreground font-mono break-all",children:t}),e.jsx("div",{className:"text-5xl",style:{fontFamily:i?"'zd-font-preview', serif":"serif"},children:"Aa 字体预览 0123"})]})}function oe({path:t}){const{icon:s}=k();return e.jsx("div",{className:"grid place-items-center h-full text-center text-muted-foreground",children:e.jsxs("div",{children:[s("image-off","h-10 w-10 mx-auto mb-3 opacity-50"),e.jsx("p",{children:"该格式无法预览"}),e.jsx("p",{className:"mt-1 font-mono text-xs break-all",children:t})]})})}const le={page:B,icon:q,token:Y,md:Z,video:te,audio:se,pdf:ne,component:Q,font:re,diagram:ee};function ae(t){return le[t]??oe}const E="zd-design-viewport",ie={mode:0,w:1024,h:768},ce=[0,768,375],S=280,F=3e3,_=400,I=3e3;function de(t){if(!t||typeof t!="object")return!1;const s=t,a=ce.includes(s.mode)||s.mode==="custom",c=typeof s.w=="number"&&Number.isFinite(s.w)&&s.w>=S&&s.w<=F,i=typeof s.h=="number"&&Number.isFinite(s.h)&&s.h>=_&&s.h<=I;return a&&c&&i}const ue=()=>T(E,{...ie},de);function N(t){W(E,JSON.stringify(t))}function me({mode:t,onMode:s,w:a,h:c,onW:i,onH:u}){const{icon:d}=k(),m=[{v:0,icon:d("monitor","h-3.5 w-3.5"),label:"桌面"},{v:768,icon:d("tablet","h-3.5 w-3.5"),label:"768"},{v:375,icon:d("smartphone","h-3.5 w-3.5"),label:"375"},{v:"custom",icon:d("sliders-horizontal","h-3.5 w-3.5"),label:"自定义"}],l="w-[var(--design-input-w)] h-7 px-1 text-center text-xs rounded border border-border bg-background text-foreground [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none focus:border-primary";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border p-0.5 bg-muted",children:e.jsx(M,{items:m.map(n=>({key:String(n.v),label:n.label,renderLabel:()=>e.jsxs(e.Fragment,{children:[n.icon,e.jsx("span",{className:"hidden sm:inline",children:n.label})]})})),value:String(t),onChange:n=>s(n==="0"?0:n==="custom"?"custom":Number(n)),ariaLabel:"视口模式"})}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx("input",{type:"number",value:a,min:S,max:F,step:8,onChange:n=>i(Number(n.target.value)),"aria-label":"自定义宽度",className:l}),e.jsx("span",{className:"text-muted-foreground/70",children:"×"}),e.jsx("input",{type:"number",value:c,min:_,max:I,step:8,onChange:n=>u(Number(n.target.value)),"aria-label":"自定义高度",className:l}),e.jsx("span",{className:"text-sm text-muted-foreground/70",children:"px"})]})]})}function Ne({params:t}){const{icon:s}=k(),a=A(w.mode,"h-5 w-5");P();const c=t.get("type")??"",i=t.get("asset"),[u,d]=h.useState(ue),m=b=>{const f={...u,mode:b};d(f),N(f)},l=b=>{const f={...u,w:b};d(f),N(f)},n=b=>{const f={...u,h:b};d(f),N(f)},{mode:r,w:o,h:x}=u,g=i?ae(c):null,O=r===0?"桌面":r==="custom"?`${o} × ${x}`:`${r}px`;return e.jsx(L,{manifest:w,icon:a,breadcrumb:["插件",w.mode,...c?[c]:[],...i?[i]:[]],children:e.jsx("div",{className:"mx-auto h-full flex flex-col bg-background border rounded-lg shadow-sm overflow-hidden",children:i&&g?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"h-[var(--design-toolbar-h)] flex-none flex items-center justify-between px-3.5 border-b bg-background text-xs",children:[e.jsx("span",{className:"font-mono truncate",children:i}),e.jsx("span",{className:"text-muted-foreground ml-3 flex-none",children:O}),e.jsx(me,{mode:r,onMode:m,w:o,h:x,onW:l,onH:n})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:c==="page"?e.jsx("div",{className:"mx-auto bg-background overflow-hidden",style:{maxWidth:r===0?void 0:r==="custom"?o:r,height:r==="custom"?x:"100%"},children:e.jsx(g,{path:i})}):e.jsx("div",{className:"mx-auto max-w-5xl h-full overflow-auto",children:e.jsx(g,{path:i})})})]}):e.jsx(U,{icon:s("palette","h-6 w-6"),title:"从左侧选择一个资产预览",hint:"点左侧折叠钮展开资产树 · 改文件即时刷新"})})})}export{Ne as default};
@@ -1,5 +1,5 @@
1
- import{r as h,d as S,j as f}from"./vendor-react-CDaMBvJU.js";import{u as ht,S as Le,E as gt,c as mt,B as $,a as pt,b as xt,P as Dt}from"./index-DJiq_38M.js";import{F as Me}from"./FilterPills-BZwzyDRQ.js";import{u as te}from"./vendor-ui-dpI0b3Ao.js";import{u as bt}from"./usePluginData-BmlgMZle.js";import{a as $e}from"./fetchJson-D-dWeu1j.js";import{m as ge}from"./web-vocphEUd.js";import"./client-Cw4K1Nx3.js";function x(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function re(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ft(t,e){const s=x(t);return isNaN(e)?re(t,NaN):(e&&s.setDate(s.getDate()+e),s)}function vt(t,e){const s=x(t);if(isNaN(e))return re(t,NaN);if(!e)return s;const r=s.getDate(),n=re(t,s.getTime());n.setMonth(s.getMonth()+e+1,0);const i=n.getDate();return r>=i?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function W(t,e){const{years:s=0,months:r=0,weeks:n=0,days:i=0,hours:c=0,minutes:o=0,seconds:d=0}=e,a=x(t),m=r||s?vt(a,r+s*12):a,_=i||n?Ft(m,i+n*7):m,v=o+c*60,b=(d+v*60)*1e3;return re(t,_.getTime()+b)}const yt=864e5,Et=6e4,Ct=36e5;function Ie(t){const e=x(t);return e.setHours(0,0,0,0),e}function Be(t){const e=x(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function jt(t,e){const s=Ie(t),r=Ie(e),n=+s-Be(s),i=+r-Be(r);return Math.round((n-i)/yt)}function G(t,e){const s=x(t),r=x(e),n=s.getTime()-r.getTime();return n<0?-1:n>0?1:n}function wt(t,e){const s=x(t),r=x(e),n=s.getFullYear()-r.getFullYear(),i=s.getMonth()-r.getMonth();return n*12+i}function At(t,e){const s=x(t),r=x(e);return s.getFullYear()-r.getFullYear()}function zt(t,e){const s=x(t),r=x(e),n=Pe(s,r),i=Math.abs(jt(s,r));s.setDate(s.getDate()-n*i);const c=+(Pe(s,r)===-n),o=n*(i-c);return o===0?0:o}function Pe(t,e){const s=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return s<0?-1:s>0?1:s}function ye(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ee(t,e){return+x(t)-+x(e)}function kt(t,e,s){const r=Ee(t,e)/Ct;return ye(s==null?void 0:s.roundingMethod)(r)}function Nt(t,e,s){const r=Ee(t,e)/Et;return ye(s==null?void 0:s.roundingMethod)(r)}function Rt(t){const e=x(t);return e.setHours(23,59,59,999),e}function St(t){const e=x(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function Ot(t){const e=x(t);return+Rt(e)==+St(e)}function Tt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(wt(s,r));let c;if(i<1)c=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-n*i);let o=G(s,r)===-n;Ot(x(t))&&i===1&&G(t,r)===1&&(o=!1),c=n*(i-Number(o))}return c===0?0:c}function Lt(t,e,s){const r=Ee(t,e)/1e3;return ye(s==null?void 0:s.roundingMethod)(r)}function Mt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(At(s,r));s.setFullYear(1584),r.setFullYear(1584);const c=G(s,r)===-n,o=n*(i-+c);return o===0?0:o}function $t(t){const e=x(t.start),s=x(t.end),r={},n=Mt(s,e);n&&(r.years=n);const i=W(e,{years:r.years}),c=Tt(s,i);c&&(r.months=c);const o=W(i,{months:r.months}),d=zt(s,o);d&&(r.days=d);const a=W(o,{days:r.days}),m=kt(s,a);m&&(r.hours=m);const _=W(a,{hours:r.hours}),v=Nt(s,_);v&&(r.minutes=v);const y=W(_,{minutes:r.minutes}),b=Lt(s,y);return b&&(r.seconds=b),r}const It=40,se=1e3;function Ze(t,e,s,r=It){return t-e-s<r}function Bt(t){return/^\[(ERROR|FATAL)\]/.test(t)||/^ERROR\b/.test(t)?"error":/^\[(WARN|WARNING)\]/.test(t)||/^WARN(ING)?\b/.test(t)?"warn":/^\[DEBUG\]/.test(t)||/^DEBUG\b/.test(t)?"info":/^\[(INFO|DOWNLOAD|PROGRESS)\]/.test(t)||/^INFO\b/.test(t)?"success":"plain"}function Fe(t){switch(Bt(t)){case"error":return"text-destructive";case"warn":return"text-warning";case"info":return"text-info";case"success":return"text-success";default:return"text-terminal-fg"}}function Pt(t,e){if(!e)return null;const s=t.toLowerCase(),r=e.toLowerCase(),n=[];let i=0,c=!1;for(;i<t.length;){const o=s.indexOf(r,i);if(o<0){n.push({text:t.slice(i),hit:!1});break}o>i&&n.push({text:t.slice(i,o),hit:!1}),n.push({text:t.slice(o,o+r.length),hit:!0}),c=!0,i=o+r.length}return c?n:null}var et={};const N=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],Zt=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class I{static escapeForHtml(e){return new I().escapeForHtml(e)}static linkify(e){return new I().linkify(e)}static ansiToHtml(e,s){return new I().ansiToHtml(e,s)}static ansiToJson(e,s){return new I().ansiToJson(e,s)}static ansiToText(e){return new I().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let i=0;i<8;++i)this.PALETTE_COLORS.push(N[n][i].color);let e=[0,95,135,175,215,255],s=(n,i,c)=>e[n]+", "+e[i]+", "+e[c];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let c=0;c<6;++c)this.PALETTE_COLORS.push(s(n,i,c));let r=8;for(let n=0;n<24;++n,r+=10)this.PALETTE_COLORS.push(r+", "+r+", "+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,s=>s=="&"?"&amp;":s=='"'?"&quot;":s=="<"?"&lt;":s==">"?"&gt;":"")}linkify(e){return e.replace(Zt,s=>`<a href="${s}">${s}</a>`)}ansiToHtml(e,s){return this.process(e,s,!0)}ansiToJson(e,s){return s=s||{},s.json=!0,s.clearLine=!1,this.process(e,s,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,s,r){let n=this,i=e.split(/\033\[/),c=i.shift();s==null&&(s={}),s.clearLine=/\r/.test(e);let o=i.map(d=>this.processChunk(d,s,r));if(s&&s.json){let d=n.processChunkJson("");return d.content=c,d.clearLine=s.clearLine,o.unshift(d),s.remove_empty&&(o=o.filter(a=>!a.isEmpty())),o}else o.unshift(c);return o.join("")}processChunkJson(e,s,r){s=typeof s>"u"?{}:s;let n=s.use_classes=typeof s.use_classes<"u"&&s.use_classes,i=s.key=n?"class":"color",c={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:s.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!c.content},o=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!o)return c;c.content=o[4];let d=o[2].split(";");if(o[1]!==""||o[3]!=="m"||!r)return c;let a=this;for(;d.length>0;){let m=d.shift(),_=parseInt(m);if(isNaN(_)||_===0)a.fg=a.bg=null,a.decorations=[];else if(_===1)a.decorations.push("bold");else if(_===2)a.decorations.push("dim");else if(_===3)a.decorations.push("italic");else if(_===4)a.decorations.push("underline");else if(_===5)a.decorations.push("blink");else if(_===7)a.decorations.push("reverse");else if(_===8)a.decorations.push("hidden");else if(_===9)a.decorations.push("strikethrough");else if(_===21)a.removeDecoration("bold");else if(_===22)a.removeDecoration("bold"),a.removeDecoration("dim");else if(_===23)a.removeDecoration("italic");else if(_===24)a.removeDecoration("underline");else if(_===25)a.removeDecoration("blink");else if(_===27)a.removeDecoration("reverse");else if(_===28)a.removeDecoration("hidden");else if(_===29)a.removeDecoration("strikethrough");else if(_===39)a.fg=null;else if(_===49)a.bg=null;else if(_>=30&&_<38)a.fg=N[0][_%10][i];else if(_>=90&&_<98)a.fg=N[1][_%10][i];else if(_>=40&&_<48)a.bg=N[0][_%10][i];else if(_>=100&&_<108)a.bg=N[1][_%10][i];else if(_===38||_===48){let v=_===38;if(d.length>=1){let y=d.shift();if(y==="5"&&d.length>=1){let b=parseInt(d.shift());if(b>=0&&b<=255)if(!n)this.PALETTE_COLORS||a.setupPalette(),v?a.fg=this.PALETTE_COLORS[b]:a.bg=this.PALETTE_COLORS[b];else{let w=b>=16?"ansi-palette-"+b:N[b>7?1:0][b%8].class;v?a.fg=w:a.bg=w}}else if(y==="2"&&d.length>=3){let b=parseInt(d.shift()),w=parseInt(d.shift()),B=parseInt(d.shift());if(b>=0&&b<=255&&w>=0&&w<=255&&B>=0&&B<=255){let A=b+", "+w+", "+B;n?v?(a.fg="ansi-truecolor",a.fg_truecolor=A):(a.bg="ansi-truecolor",a.bg_truecolor=A):v?a.fg=A:a.bg=A}}}}}return a.fg===null&&a.bg===null&&a.decorations.length===0||(c.fg=a.fg,c.bg=a.bg,c.fg_truecolor=a.fg_truecolor,c.bg_truecolor=a.bg_truecolor,c.decorations=a.decorations,c.decoration=a.decorations.slice(-1).pop()||null,c.was_processed=!0),c}processChunk(e,s,r){s=s||{};let n=this.processChunkJson(e,s,r),i=s.use_classes;if(n.decorations=n.decorations.filter(_=>{if(_==="reverse"){n.fg||(n.fg=N[0][7][i?"class":"color"]),n.bg||(n.bg=N[0][0][i?"class":"color"]);let v=n.fg;n.fg=n.bg,n.bg=v;let y=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=y,n.isInverted=!0,!1}return!0}),s.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let c=[],o=[],d=[],a={},m=_=>{let v=[],y;for(y in _)_.hasOwnProperty(y)&&v.push("data-"+y+'="'+this.escapeForHtml(_[y])+'"');return v.length>0?" "+v.join(" "):""};return n.isInverted&&(a["ansi-is-inverted"]="true"),n.fg&&(i?(c.push(n.fg+"-fg"),n.fg_truecolor!==null&&(a["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):c.push("color:rgb("+n.fg+")")),n.bg&&(i?(c.push(n.bg+"-bg"),n.bg_truecolor!==null&&(a["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):c.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(_=>{if(i){o.push("ansi-"+_);return}_==="bold"?o.push("font-weight:bold"):_==="dim"?o.push("opacity:0.5"):_==="italic"?o.push("font-style:italic"):_==="hidden"?o.push("visibility:hidden"):_==="strikethrough"?d.push("line-through"):d.push(_)}),d.length&&o.push("text-decoration:"+d.join(" ")),i?'<span class="'+c.concat(o).join(" ")+'"'+m(a)+">"+n.content+"</span>":'<span style="'+c.concat(o).join(";")+'"'+m(a)+">"+n.content+"</span>"}removeDecoration(e){const s=this.decorations.indexOf(e);s>=0&&this.decorations.splice(s,1)}}var Ht=I,ie={exports:{}};function Ce(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
1
+ import{r as h,c as S,j as f}from"./vendor-react-OhDMXABq.js";import{u as ht,S as Le,E as gt,c as mt,B as $,a as pt,b as xt,P as Dt}from"./index-BxPRo4R9.js";import{F as Me}from"./FilterPills-D2zZaent.js";import{u as te}from"./vendor-ui-D8qdFUhC.js";import{u as bt}from"./usePluginData-BaCM6nnK.js";import{a as $e}from"./fetchJson-D-dWeu1j.js";import{m as ge}from"./web-oi27dtPg.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function x(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function re(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Ft(t,e){const s=x(t);return isNaN(e)?re(t,NaN):(e&&s.setDate(s.getDate()+e),s)}function vt(t,e){const s=x(t);if(isNaN(e))return re(t,NaN);if(!e)return s;const r=s.getDate(),n=re(t,s.getTime());n.setMonth(s.getMonth()+e+1,0);const i=n.getDate();return r>=i?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function W(t,e){const{years:s=0,months:r=0,weeks:n=0,days:i=0,hours:c=0,minutes:o=0,seconds:d=0}=e,a=x(t),m=r||s?vt(a,r+s*12):a,_=i||n?Ft(m,i+n*7):m,v=o+c*60,b=(d+v*60)*1e3;return re(t,_.getTime()+b)}const yt=864e5,Et=6e4,Ct=36e5;function Ie(t){const e=x(t);return e.setHours(0,0,0,0),e}function Be(t){const e=x(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function jt(t,e){const s=Ie(t),r=Ie(e),n=+s-Be(s),i=+r-Be(r);return Math.round((n-i)/yt)}function G(t,e){const s=x(t),r=x(e),n=s.getTime()-r.getTime();return n<0?-1:n>0?1:n}function wt(t,e){const s=x(t),r=x(e),n=s.getFullYear()-r.getFullYear(),i=s.getMonth()-r.getMonth();return n*12+i}function At(t,e){const s=x(t),r=x(e);return s.getFullYear()-r.getFullYear()}function zt(t,e){const s=x(t),r=x(e),n=Pe(s,r),i=Math.abs(jt(s,r));s.setDate(s.getDate()-n*i);const c=+(Pe(s,r)===-n),o=n*(i-c);return o===0?0:o}function Pe(t,e){const s=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return s<0?-1:s>0?1:s}function ye(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Ee(t,e){return+x(t)-+x(e)}function kt(t,e,s){const r=Ee(t,e)/Ct;return ye(s==null?void 0:s.roundingMethod)(r)}function Nt(t,e,s){const r=Ee(t,e)/Et;return ye(s==null?void 0:s.roundingMethod)(r)}function Rt(t){const e=x(t);return e.setHours(23,59,59,999),e}function St(t){const e=x(t),s=e.getMonth();return e.setFullYear(e.getFullYear(),s+1,0),e.setHours(23,59,59,999),e}function Ot(t){const e=x(t);return+Rt(e)==+St(e)}function Tt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(wt(s,r));let c;if(i<1)c=0;else{s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-n*i);let o=G(s,r)===-n;Ot(x(t))&&i===1&&G(t,r)===1&&(o=!1),c=n*(i-Number(o))}return c===0?0:c}function Lt(t,e,s){const r=Ee(t,e)/1e3;return ye(s==null?void 0:s.roundingMethod)(r)}function Mt(t,e){const s=x(t),r=x(e),n=G(s,r),i=Math.abs(At(s,r));s.setFullYear(1584),r.setFullYear(1584);const c=G(s,r)===-n,o=n*(i-+c);return o===0?0:o}function $t(t){const e=x(t.start),s=x(t.end),r={},n=Mt(s,e);n&&(r.years=n);const i=W(e,{years:r.years}),c=Tt(s,i);c&&(r.months=c);const o=W(i,{months:r.months}),d=zt(s,o);d&&(r.days=d);const a=W(o,{days:r.days}),m=kt(s,a);m&&(r.hours=m);const _=W(a,{hours:r.hours}),v=Nt(s,_);v&&(r.minutes=v);const y=W(_,{minutes:r.minutes}),b=Lt(s,y);return b&&(r.seconds=b),r}const It=40,se=1e3;function Ze(t,e,s,r=It){return t-e-s<r}function Bt(t){return/^\[(ERROR|FATAL)\]/.test(t)||/^ERROR\b/.test(t)?"error":/^\[(WARN|WARNING)\]/.test(t)||/^WARN(ING)?\b/.test(t)?"warn":/^\[DEBUG\]/.test(t)||/^DEBUG\b/.test(t)?"info":/^\[(INFO|DOWNLOAD|PROGRESS)\]/.test(t)||/^INFO\b/.test(t)?"success":"plain"}function Fe(t){switch(Bt(t)){case"error":return"text-destructive";case"warn":return"text-warning";case"info":return"text-info";case"success":return"text-success";default:return"text-terminal-fg"}}function Pt(t,e){if(!e)return null;const s=t.toLowerCase(),r=e.toLowerCase(),n=[];let i=0,c=!1;for(;i<t.length;){const o=s.indexOf(r,i);if(o<0){n.push({text:t.slice(i),hit:!1});break}o>i&&n.push({text:t.slice(i,o),hit:!1}),n.push({text:t.slice(o,o+r.length),hit:!0}),c=!0,i=o+r.length}return c?n:null}var et={};const N=[[{color:"0, 0, 0",class:"ansi-black"},{color:"187, 0, 0",class:"ansi-red"},{color:"0, 187, 0",class:"ansi-green"},{color:"187, 187, 0",class:"ansi-yellow"},{color:"0, 0, 187",class:"ansi-blue"},{color:"187, 0, 187",class:"ansi-magenta"},{color:"0, 187, 187",class:"ansi-cyan"},{color:"255,255,255",class:"ansi-white"}],[{color:"85, 85, 85",class:"ansi-bright-black"},{color:"255, 85, 85",class:"ansi-bright-red"},{color:"0, 255, 0",class:"ansi-bright-green"},{color:"255, 255, 85",class:"ansi-bright-yellow"},{color:"85, 85, 255",class:"ansi-bright-blue"},{color:"255, 85, 255",class:"ansi-bright-magenta"},{color:"85, 255, 255",class:"ansi-bright-cyan"},{color:"255, 255, 255",class:"ansi-bright-white"}]],Zt=/(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&amp;|%[A-Fa-f0-9]{2})+)/gm;class I{static escapeForHtml(e){return new I().escapeForHtml(e)}static linkify(e){return new I().linkify(e)}static ansiToHtml(e,s){return new I().ansiToHtml(e,s)}static ansiToJson(e,s){return new I().ansiToJson(e,s)}static ansiToText(e){return new I().ansiToText(e)}constructor(){this.fg=this.bg=this.fg_truecolor=this.bg_truecolor=null,this.bright=0,this.decorations=[]}setupPalette(){this.PALETTE_COLORS=[];for(let n=0;n<2;++n)for(let i=0;i<8;++i)this.PALETTE_COLORS.push(N[n][i].color);let e=[0,95,135,175,215,255],s=(n,i,c)=>e[n]+", "+e[i]+", "+e[c];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let c=0;c<6;++c)this.PALETTE_COLORS.push(s(n,i,c));let r=8;for(let n=0;n<24;++n,r+=10)this.PALETTE_COLORS.push(r+", "+r+", "+r)}escapeForHtml(e){return e.replace(/[&<>\"]/gm,s=>s=="&"?"&amp;":s=='"'?"&quot;":s=="<"?"&lt;":s==">"?"&gt;":"")}linkify(e){return e.replace(Zt,s=>`<a href="${s}">${s}</a>`)}ansiToHtml(e,s){return this.process(e,s,!0)}ansiToJson(e,s){return s=s||{},s.json=!0,s.clearLine=!1,this.process(e,s,!0)}ansiToText(e){return this.process(e,{},!1)}process(e,s,r){let n=this,i=e.split(/\033\[/),c=i.shift();s==null&&(s={}),s.clearLine=/\r/.test(e);let o=i.map(d=>this.processChunk(d,s,r));if(s&&s.json){let d=n.processChunkJson("");return d.content=c,d.clearLine=s.clearLine,o.unshift(d),s.remove_empty&&(o=o.filter(a=>!a.isEmpty())),o}else o.unshift(c);return o.join("")}processChunkJson(e,s,r){s=typeof s>"u"?{}:s;let n=s.use_classes=typeof s.use_classes<"u"&&s.use_classes,i=s.key=n?"class":"color",c={content:e,fg:null,bg:null,fg_truecolor:null,bg_truecolor:null,isInverted:!1,clearLine:s.clearLine,decoration:null,decorations:[],was_processed:!1,isEmpty:()=>!c.content},o=e.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);if(!o)return c;c.content=o[4];let d=o[2].split(";");if(o[1]!==""||o[3]!=="m"||!r)return c;let a=this;for(;d.length>0;){let m=d.shift(),_=parseInt(m);if(isNaN(_)||_===0)a.fg=a.bg=null,a.decorations=[];else if(_===1)a.decorations.push("bold");else if(_===2)a.decorations.push("dim");else if(_===3)a.decorations.push("italic");else if(_===4)a.decorations.push("underline");else if(_===5)a.decorations.push("blink");else if(_===7)a.decorations.push("reverse");else if(_===8)a.decorations.push("hidden");else if(_===9)a.decorations.push("strikethrough");else if(_===21)a.removeDecoration("bold");else if(_===22)a.removeDecoration("bold"),a.removeDecoration("dim");else if(_===23)a.removeDecoration("italic");else if(_===24)a.removeDecoration("underline");else if(_===25)a.removeDecoration("blink");else if(_===27)a.removeDecoration("reverse");else if(_===28)a.removeDecoration("hidden");else if(_===29)a.removeDecoration("strikethrough");else if(_===39)a.fg=null;else if(_===49)a.bg=null;else if(_>=30&&_<38)a.fg=N[0][_%10][i];else if(_>=90&&_<98)a.fg=N[1][_%10][i];else if(_>=40&&_<48)a.bg=N[0][_%10][i];else if(_>=100&&_<108)a.bg=N[1][_%10][i];else if(_===38||_===48){let v=_===38;if(d.length>=1){let y=d.shift();if(y==="5"&&d.length>=1){let b=parseInt(d.shift());if(b>=0&&b<=255)if(!n)this.PALETTE_COLORS||a.setupPalette(),v?a.fg=this.PALETTE_COLORS[b]:a.bg=this.PALETTE_COLORS[b];else{let w=b>=16?"ansi-palette-"+b:N[b>7?1:0][b%8].class;v?a.fg=w:a.bg=w}}else if(y==="2"&&d.length>=3){let b=parseInt(d.shift()),w=parseInt(d.shift()),B=parseInt(d.shift());if(b>=0&&b<=255&&w>=0&&w<=255&&B>=0&&B<=255){let A=b+", "+w+", "+B;n?v?(a.fg="ansi-truecolor",a.fg_truecolor=A):(a.bg="ansi-truecolor",a.bg_truecolor=A):v?a.fg=A:a.bg=A}}}}}return a.fg===null&&a.bg===null&&a.decorations.length===0||(c.fg=a.fg,c.bg=a.bg,c.fg_truecolor=a.fg_truecolor,c.bg_truecolor=a.bg_truecolor,c.decorations=a.decorations,c.decoration=a.decorations.slice(-1).pop()||null,c.was_processed=!0),c}processChunk(e,s,r){s=s||{};let n=this.processChunkJson(e,s,r),i=s.use_classes;if(n.decorations=n.decorations.filter(_=>{if(_==="reverse"){n.fg||(n.fg=N[0][7][i?"class":"color"]),n.bg||(n.bg=N[0][0][i?"class":"color"]);let v=n.fg;n.fg=n.bg,n.bg=v;let y=n.fg_truecolor;return n.fg_truecolor=n.bg_truecolor,n.bg_truecolor=y,n.isInverted=!0,!1}return!0}),s.json)return n;if(n.isEmpty())return"";if(!n.was_processed)return n.content;let c=[],o=[],d=[],a={},m=_=>{let v=[],y;for(y in _)_.hasOwnProperty(y)&&v.push("data-"+y+'="'+this.escapeForHtml(_[y])+'"');return v.length>0?" "+v.join(" "):""};return n.isInverted&&(a["ansi-is-inverted"]="true"),n.fg&&(i?(c.push(n.fg+"-fg"),n.fg_truecolor!==null&&(a["ansi-truecolor-fg"]=n.fg_truecolor,n.fg_truecolor=null)):c.push("color:rgb("+n.fg+")")),n.bg&&(i?(c.push(n.bg+"-bg"),n.bg_truecolor!==null&&(a["ansi-truecolor-bg"]=n.bg_truecolor,n.bg_truecolor=null)):c.push("background-color:rgb("+n.bg+")")),n.decorations.forEach(_=>{if(i){o.push("ansi-"+_);return}_==="bold"?o.push("font-weight:bold"):_==="dim"?o.push("opacity:0.5"):_==="italic"?o.push("font-style:italic"):_==="hidden"?o.push("visibility:hidden"):_==="strikethrough"?d.push("line-through"):d.push(_)}),d.length&&o.push("text-decoration:"+d.join(" ")),i?'<span class="'+c.concat(o).join(" ")+'"'+m(a)+">"+n.content+"</span>":'<span style="'+c.concat(o).join(";")+'"'+m(a)+">"+n.content+"</span>"}removeDecoration(e){const s=this.decorations.indexOf(e);s>=0&&this.decorations.splice(s,1)}}var Ht=I,ie={exports:{}};function Ce(t){if(!t)return"";if(!/\r/.test(t))return t;for(t=t.replace(/\r+\n/gm,`
2
2
  `);/\r./.test(t);)t=t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm,function(e,s,r){return r+s.slice(r.length)});return t}function qt(t){for(var e=0,s=0;s<t.length;s++)t[e].length<=t[s].length&&(e=s);return e}function He(t){if(!/\r/.test(t))return t;for(var e=t.split("\r"),s=[];e.length>0;){var r=qt(e);s.push(e[r]),e=e.slice(r+1)}return s.join("\r")}function Yt(t){if(!t)return"";if(!/\r/.test(t))return t;if(!/\n/.test(t))return He(t);t=t.replace(/\r+\n/gm,`
3
3
  `);var e=t.lastIndexOf(`
4
4
  `);return Ce(t.slice(0,e))+`
5
- `+He(t.slice(e+1))}ie.exports=Ce;ie.exports.escapeCarriageReturn=Ce;ie.exports.escapeCarriageReturnSafe=Yt;var Jt=ie.exports,me,qe;function Wt(){return qe||(qe=1,me=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),me}var pe,Ye;function Gt(){return Ye||(Ye=1,pe=/[\0-\x1F\x7F-\x9F]/),pe}var xe,Je;function Ut(){return Je||(Je=1,xe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),xe}var De,We;function Vt(){return We||(We=1,De=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),De}var be,Ge;function Qt(){return Ge||(Ge=1,be=function(t){var e={};e.src_Any=Wt().source,e.src_Cc=Gt().source,e.src_Z=Ut().source,e.src_P=Vt().source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var s="[><|]";return e.src_pseudo_letter="(?:(?!"+s+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+s+"|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+s+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+").|;(?!"+e.src_ZCc+").|\\!+(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),be}function ve(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(s){s&&Object.keys(s).forEach(function(r){t[r]=s[r]})}),t}function ue(t){return Object.prototype.toString.call(t)}function Xt(t){return ue(t)==="[object String]"}function Kt(t){return ue(t)==="[object Object]"}function es(t){return ue(t)==="[object RegExp]"}function Ue(t){return ue(t)==="[object Function]"}function ts(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var tt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ss(t){return Object.keys(t||{}).reduce(function(e,s){return e||tt.hasOwnProperty(s)},!1)}var rs={"http:":{validate:function(t,e,s){var r=t.slice(e);return s.re.http||(s.re.http=new RegExp("^\\/\\/"+s.re.src_auth+s.re.src_host_port_strict+s.re.src_path,"i")),s.re.http.test(r)?r.match(s.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,s){var r=t.slice(e);return s.re.no_http||(s.re.no_http=new RegExp("^"+s.re.src_auth+"(?:localhost|(?:(?:"+s.re.src_domain+")\\.)+"+s.re.src_domain_root+")"+s.re.src_port+s.re.src_host_terminator+s.re.src_path,"i")),s.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(s.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,s){var r=t.slice(e);return s.re.mailto||(s.re.mailto=new RegExp("^"+s.re.src_email_name+"@"+s.re.src_host_strict,"i")),s.re.mailto.test(r)?r.match(s.re.mailto)[0].length:0}}},ns="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",is="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function us(t){t.__index__=-1,t.__text_cache__=""}function cs(t){return function(e,s){var r=e.slice(s);return t.test(r)?r.match(t)[0].length:0}}function Ve(){return function(t,e){e.normalize(t)}}function ne(t){var e=t.re=Qt()(t.__opts__),s=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||s.push(ns),s.push(e.src_xn),e.src_tlds=s.join("|");function r(o){return o.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];t.__compiled__={};function i(o,d){throw new Error('(LinkifyIt) Invalid schema "'+o+'": '+d)}Object.keys(t.__schemas__).forEach(function(o){var d=t.__schemas__[o];if(d!==null){var a={validate:null,link:null};if(t.__compiled__[o]=a,Kt(d)){es(d.validate)?a.validate=cs(d.validate):Ue(d.validate)?a.validate=d.validate:i(o,d),Ue(d.normalize)?a.normalize=d.normalize:d.normalize?i(o,d):a.normalize=Ve();return}if(Xt(d)){n.push(o);return}i(o,d)}}),n.forEach(function(o){t.__compiled__[t.__schemas__[o]]&&(t.__compiled__[o].validate=t.__compiled__[t.__schemas__[o]].validate,t.__compiled__[o].normalize=t.__compiled__[t.__schemas__[o]].normalize)}),t.__compiled__[""]={validate:null,normalize:Ve()};var c=Object.keys(t.__compiled__).filter(function(o){return o.length>0&&t.__compiled__[o]}).map(ts).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),us(t)}function os(t,e){var s=t.__index__,r=t.__last_index__,n=t.__text_cache__.slice(s,r);this.schema=t.__schema__.toLowerCase(),this.index=s+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Qe(t,e){var s=new os(t,e);return t.__compiled__[s.schema].normalize(s,t),s}function j(t,e){if(!(this instanceof j))return new j(t,e);e||ss(t)&&(e=t,t={}),this.__opts__=ve({},tt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ve({},rs,t),this.__compiled__={},this.__tlds__=is,this.__tlds_replaced__=!1,this.re={},ne(this)}j.prototype.add=function(e,s){return this.__schemas__[e]=s,ne(this),this};j.prototype.set=function(e){return this.__opts__=ve(this.__opts__,e),this};j.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var s,r,n,i,c,o,d,a,m;if(this.re.schema_test.test(e)){for(d=this.re.schema_search,d.lastIndex=0;(s=d.exec(e))!==null;)if(i=this.testSchemaAt(e,s[2],d.lastIndex),i){this.__schema__=s[2],this.__index__=s.index+s[1].length,this.__last_index__=s.index+s[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=r.index+r[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(m=e.indexOf("@"),m>=0&&(n=e.match(this.re.email_fuzzy))!==null&&(c=n.index+n[1].length,o=n.index+n[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=o))),this.__index__>=0};j.prototype.pretest=function(e){return this.re.pretest.test(e)};j.prototype.testSchemaAt=function(e,s,r){return this.__compiled__[s.toLowerCase()]?this.__compiled__[s.toLowerCase()].validate(e,r,this):0};j.prototype.match=function(e){var s=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Qe(this,s)),s=this.__last_index__);for(var n=s?e.slice(s):e;this.test(n);)r.push(Qe(this,s)),n=n.slice(this.__last_index__),s+=this.__last_index__;return r.length?r:null};j.prototype.tlds=function(e,s){return e=Array.isArray(e)?e:[e],s?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,i){return r!==i[n-1]}).reverse(),ne(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ne(this),this)};j.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};j.prototype.onCompile=function(){};var as=j,ls=S&&S.__createBinding||(Object.create?function(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}:function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]}),fs=S&&S.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_s=S&&S.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&ls(s,e,r[n]);return fs(s,e),s}}(),st=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(et,"__esModule",{value:!0});var ds=et.default=ys;const hs=st(Ht),gs=Jt,ms=st(as),R=_s(h);function ps(t,e=!1){return t=(0,gs.escapeCarriageReturn)(Es(t)),hs.default.ansiToJson(t,{json:!0,remove_empty:!0,use_classes:e})}function xs(t){let e="";return t.bg&&(e+=`${t.bg}-bg `),t.fg&&(e+=`${t.fg}-fg `),t.decoration&&(e+=`ansi-${t.decoration} `),e===""?null:(e=e.substring(0,e.length-1),e)}function Ds(t){const e={};switch(t.bg&&(e.backgroundColor=`rgb(${t.bg})`),t.fg&&(e.color=`rgb(${t.fg})`),t.decoration){case"bold":e.fontWeight="bold";break;case"dim":e.opacity="0.5";break;case"italic":e.fontStyle="italic";break;case"hidden":e.visibility="hidden";break;case"strikethrough":e.textDecoration="line-through";break;case"underline":e.textDecoration="underline";break;case"blink":e.textDecoration="blink";break}return e}function bs(t,e,s,r){const n=e?null:Ds(s),i=e?xs(s):null;return t?t==="fuzzy"?vs(s,r,n,i):Fs(s,r,n,i):R.createElement("span",{style:n,key:r,className:i},s.content)}function Fs(t,e,s,r){const n=[],i=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;let c=0,o;for(;(o=i.exec(t.content))!==null;){const[,d,a]=o,m=o.index+d.length;m>c&&n.push(t.content.substring(c,m));const _=a.startsWith("www.")?`http://${a}`:a;n.push(R.createElement("a",{key:c,href:_,target:"_blank"},`${a}`)),c=i.lastIndex}return c<t.content.length&&n.push(t.content.substring(c)),R.createElement("span",{style:s,key:e,className:r},n)}function vs(t,e,s,r){var n;const i=(0,ms.default)({fuzzyEmail:!1}).tlds(["io"],!0);if(!i.pretest(t.content))return R.createElement("span",{style:s,key:e,className:r},t.content);const c=i.match(t.content);if(!c)return R.createElement("span",{style:s,key:e,className:r},t.content);const o=[t.content.substring(0,(n=c[0])===null||n===void 0?void 0:n.index)];return c.forEach((d,a)=>{var m;o.push(R.createElement("a",{href:d.url,target:"_blank",key:a},t.content.substring(d.index,d.lastIndex))),c[a+1]&&o.push(t.content.substring(c[a].lastIndex,(m=c[a+1])===null||m===void 0?void 0:m.index))}),c[c.length-1].lastIndex!==t.content.length&&o.push(t.content.substring(c[c.length-1].lastIndex,t.content.length)),R.createElement("span",{style:s,key:e,className:r},o)}function ys(t){const{className:e,useClasses:s,children:r,linkify:n}=t;return R.createElement("code",{className:e},ps(r??"",s??!1).map(bs.bind(null,n??!1,s??!1)))}function Es(t){let e=t;do t=e,e=t.replace(/[^\n]\x08/gm,"");while(e.length<t.length);return t}const Cs=h.memo(function({line:e,query:s=""}){const r=e.text.replace(/\r?\n$/,""),n=s?Pt(r,s):null;return f.jsx("div",{className:"whitespace-pre-wrap break-all min-h-[1.25rem]",children:/\x1b\[/.test(r)?f.jsx(ds,{children:r}):n?n.map((i,c)=>i.hit?f.jsx("mark",{className:"bg-warning/40 text-inherit",children:i.text},c):f.jsx("span",{className:Fe(r),children:i.text},c)):f.jsx("span",{className:Fe(r),children:r})})}),js=[{key:"all",label:"全部"},{key:"text-info",label:"信息"},{key:"text-warning",label:"警告"},{key:"text-destructive",label:"错误"},{key:"text-success",label:"成功"}],Xe={start:"启动",stop:"停止",clear:"清屏"},ws=3e3;function As(t){const e=$t({start:0,end:t}),s=e.hours??0,r=e.minutes??0,n=e.seconds??0;return s===0&&r===0?`${n}s`:s===0?`${r}m${n}s`:`${s}h${r}m`}function Ke({startedAt:t,className:e}){const[,s]=h.useState(0);return h.useEffect(()=>{const r=setInterval(()=>s(n=>n+1),1e3);return()=>clearInterval(r)},[]),f.jsx("span",{className:e,children:As(Math.max(0,Date.now()-t))})}function zs({params:t,values:e,onChange:s,onSubmit:r,onCancel:n}){return f.jsxs("div",{"data-testid":"param-panel",onClick:i=>i.stopPropagation(),className:"flex flex-wrap items-center gap-2 px-3.5 py-2 border-b bg-card text-sm",children:[t.map(i=>f.jsxs("label",{className:"inline-flex items-center gap-1 text-xs",children:[f.jsx("span",{className:"font-mono text-muted-foreground",children:i}),f.jsx("input",{"aria-label":i,placeholder:i,value:e[i]??"",onChange:c=>s(i,c.target.value),className:"h-6 w-32 rounded-[var(--radius-md)] border bg-transparent px-1.5 font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"})]},i)),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm text-success",onClick:r,children:"启动"}),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:n,children:"取消"})]})}function ks({selected:t,onSelect:e}){const s=typeof e=="function",[r,n]=h.useState(null),i=s?t??null:r,c=u=>{s?e(u):n(u)},o=bt("just:/__just/recipes",()=>$e("/__just/recipes",{cache:"no-store"}),{subscribe:"plugin:just:state"}),d=o.data??[],a=!o.loading&&o.error===null&&d.length===0,[m,_]=h.useState(null);h.useEffect(()=>{if(!a){_(null);return}_(null);let u=!1;return $e("/__just/status",{cache:"no-store"}).then(l=>{u||_(l)}).catch(()=>{u||_({installed:!0,hasJustfile:!1})}),()=>{u=!0}},[a]);const[v,y]=h.useState({}),[b,w]=h.useState({}),B=h.useRef(""),A=h.useRef(null),O=i?b[i]??[]:[],{icon:T}=ht(),q=h.useRef(!0),L=h.useRef(0),[je,U]=h.useState(0),we=h.useRef(i);h.useEffect(()=>{we.current=i});const P=h.useRef(new Map),rt=h.useRef(0),Z=h.useRef(!1),M=h.useRef(null);h.useEffect(()=>{const u=()=>{var Te;Z.current=!1;const F=P.current;if(F.size===0)return;P.current=new Map;const p=new Map;for(const[k,H]of F)p.set(k,H.map(ee=>({seq:++rt.current,text:ee})));w(k=>{const H={...k};for(const[ee,dt]of p){const he=(H[ee]??[]).concat(dt);H[ee]=he.length>se?he.slice(-se):he}return H});const E=we.current,J=E?((Te=p.get(E))==null?void 0:Te.length)??0:0;if(J>0){const k=A.current;!k||Ze(k.scrollHeight,k.scrollTop,k.clientHeight)?q.current=!0:L.current+=J,U(L.current)}},l=()=>{Z.current&&(Z.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null),u())},g=()=>{Z.current||(Z.current=!0,typeof requestAnimationFrame=="function"&&requestAnimationFrame(l),M.current=setTimeout(l,50))};fetch("/__config").then(F=>F.json()).then(F=>{B.current=F.stopToken??""}).catch(()=>{});const D=new EventSource("/__just/logs");let C=!0;return D.onopen=()=>{if(C){C=!1;return}P.current.clear(),w({}),y({})},D.onmessage=F=>{try{const p=JSON.parse(F.data);if(p.type==="log"){const E=P.current.get(p.recipe);E?E.push(p.text):P.current.set(p.recipe,[p.text]),g()}else p.type==="clear"?(P.current.delete(p.recipe),w(E=>({...E,[p.recipe]:[]}))):p.type==="state"&&(y(E=>{var J;return{...E,[p.recipe]:{state:p.state,code:p.code,signal:p.signal,startedAt:p.startedAt??((J=E[p.recipe])==null?void 0:J.startedAt)??Date.now()}}}),oe(E=>E[p.recipe]?{...E,[p.recipe]:void 0}:E),p.state==="running"&&!s&&c(p.recipe))}catch{}},D.onerror=()=>{},()=>{D.close(),M.current!==null&&(clearTimeout(M.current),M.current=null),Z.current=!1}},[]);const Ae=h.useRef(i);h.useEffect(()=>{const u=A.current,l=Ae.current!==i;Ae.current=i,u&&(q.current||l)&&(q.current=!0,u.scrollTop=u.scrollHeight-u.clientHeight,L.current!==0&&(L.current=0,U(0)))},[O.length,i]);const nt=()=>{const u=A.current;if(!u)return;const l=Ze(u.scrollHeight,u.scrollTop,u.clientHeight);q.current=l,l&&L.current!==0&&(L.current=0,U(0))},it=()=>{const u=A.current;u&&(u.scrollTop=u.scrollHeight-u.clientHeight,q.current=!0,L.current=0,U(0))},[ce,ut]=h.useState(""),[V,ct]=h.useState("");h.useEffect(()=>{const u=setTimeout(()=>ct(ce),150);return()=>clearTimeout(u)},[ce]);const[Q,ot]=h.useState("all"),ze=h.useMemo(()=>{let u=O;if(Q!=="all"&&(u=u.filter(l=>Fe(l.text.replace(/\r?\n$/,""))===Q)),V){const l=V.toLowerCase();u=u.filter(g=>g.text.toLowerCase().includes(l))}return u},[O,Q,V]),[X,oe]=h.useState({}),ae=u=>oe(l=>l[u]?{...l,[u]:void 0}:l),Y=async(u,l,g)=>{u!=="clear"&&oe(D=>({...D,[l]:u}));try{const D=await fetch(`/__just/${u}`,{method:"POST",headers:{"x-stop-token":B.current,"Content-Type":"application/json"},body:JSON.stringify({recipe:l,...u==="start"&&g?{args:g}:{}})});if(!D.ok){let C="";try{const F=await D.json();typeof(F==null?void 0:F.error)=="string"&&F.error&&(C=`:${F.error}`)}catch{}return te.error(`just ${l} ${Xe[u]}失败${C||`(HTTP ${D.status})`}`),u!=="clear"&&ae(l),!1}return u==="clear"?(te.success(`已清屏 ${l}`),!0):(setTimeout(()=>ae(l),ws),te.success(u==="start"?`已启动 ${l}`:`已停止 ${l}`),!0)}catch{return te.error(`just ${l} ${Xe[u]}失败:网络异常`),u!=="clear"&&ae(l),!1}},le=d.map(u=>({...u,task:v[u.name]})),ke=le.filter(u=>{var l;return((l=u.task)==null?void 0:l.state)==="running"}).length,z=i?v[i]:void 0,fe=(z==null?void 0:z.state)==="running",[_e,de]=h.useState(null),[Ne,K]=h.useState({}),Re=u=>{var g;const l=((g=d.find(D=>D.name===u))==null?void 0:g.params)??[];if(l.length===0){Y("start",u);return}K(Object.fromEntries(l.map(D=>[D,""]))),de(u)},at=()=>{if(!_e)return;const u=Object.entries(Ne).filter(([,l])=>l!=="");Y("start",_e,u.length>0?Object.fromEntries(u):void 0),de(null),K({})},lt=()=>{de(null),K({})},Se=u=>{var l;return _e===u?f.jsx(zs,{params:((l=d.find(g=>g.name===u))==null?void 0:l.params)??[],values:Ne,onChange:(g,D)=>K(C=>({...C,[g]:D})),onSubmit:at,onCancel:lt}):null},Oe=(u,l,g)=>u?"bg-success animate-pulse":l?g!=null&&g.signal?"bg-muted-foreground":g!=null&&g.code?"bg-destructive":"bg-success/60":"bg-muted-foreground/30",ft={key:"__console__",label:"总控台",badge:f.jsx("span",{className:"font-mono opacity-80",children:ke>0?ke:""}),className:i===null?"":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",renderLabel:()=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx("span",{className:"h-3 w-3",children:T("monitor","h-3 w-3")}),f.jsx("span",{children:"总控台"})]})},_t=d.map(u=>{const l=v[u.name],g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=i===u.name;return{key:u.name,label:u.name,className:C?"":g?"border-success/40 bg-success/10 text-success hover:bg-success/20":"",renderLabel:()=>f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${Oe(g,D,l)}`}),f.jsx("span",{children:u.name})]}),renderExtra:()=>D&&!C?f.jsx("span",{className:`text-xs ${l!=null&&l.signal?"opacity-60":l!=null&&l.code?"text-destructive":"text-success"}`,children:l!=null&&l.signal?"停":l==null?void 0:l.code}):void 0}});return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-none flex items-center gap-1.5 flex-wrap px-3 py-2 border-b bg-background",children:f.jsx(Me,{items:[ft,..._t],value:i??"__console__",onChange:u=>c(u==="__console__"?null:u),ariaLabel:"任务筛选"})}),i===null?f.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o.loading&&!o.data?f.jsx(Le,{rows:4,className:"m-3"}):o.error?f.jsx(gt,{message:o.error,onRetry:o.reload}):le.length===0?m?f.jsx(mt,{title:m.installed?m.hasJustfile?"justfile 中未发现可运行 recipe":"未发现 justfile":"未安装 just",hint:m.installed?m.hasJustfile?"justfile 存在但未解析到可展示的 recipe,检查 recipe 定义":"在项目根目录放置 justfile,即可在这里查看与启停任务":"未检测到 just 命令,安装 just 后即可在这里查看与启停任务"}):f.jsx(Le,{rows:4,className:"m-3"}):f.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 grid gap-2.5 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start",children:le.map(u=>{const l=u.task,g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=(b[u.name]??[]).slice(-3).map(F=>F.text.replace(/\r?\n$/,"").replace(/\x1b\[[0-9;]*m/g,""));return f.jsxs("div",{onClick:()=>c(u.name),className:"group rounded-[var(--radius-lg)] border bg-card p-3 cursor-pointer hover:border-muted-foreground/40 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx("span",{className:`h-2 w-2 rounded-[var(--radius-full)] flex-none ${Oe(g,D,l)}`}),f.jsx("span",{className:"font-mono font-medium",children:u.name}),g&&f.jsx(Ke,{startedAt:l.startedAt,className:"text-success font-mono"}),D&&f.jsx("span",{className:`font-mono ${l.signal?"text-muted-foreground":l.code?"text-destructive":"text-success"}`,children:l.signal?"已停止":`exit ${l.code}`}),!l&&f.jsx("span",{className:"text-muted-foreground/60",children:"未运行"}),f.jsx("span",{className:"ml-auto flex items-center gap-1",onClick:F=>F.stopPropagation(),children:g?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Y("stop",u.name),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Re(u.name),children:[T(D?"rotate-cw":"play","h-2.5 w-2.5"),D?"重跑":"启动"]})})]}),Se(u.name),u.description&&f.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70 truncate",children:u.description}),f.jsx("div",{className:"mt-2 rounded bg-terminal-bg px-2 py-1.5 font-mono text-xs leading-relaxed text-terminal-fg/70 min-h-[3.4em]",children:C.length?C.map((F,p)=>f.jsx("div",{className:"truncate",children:F},p)):f.jsxs("span",{className:"text-terminal-fg/40",children:["$ just ",u.name," …"]})})]},u.name)})})}):f.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 h-8 border-b bg-background text-sm",children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${fe?"bg-success animate-pulse":"bg-muted-foreground"}`}),f.jsx("span",{className:"font-mono font-medium",children:i}),f.jsx("span",{className:"text-muted-foreground font-mono",children:fe?f.jsxs(f.Fragment,{children:["running · ",f.jsx(Ke,{startedAt:z.startedAt})]}):z!=null&&z.signal?"已停止":z?`exit ${z.code}`:"未运行"}),f.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[fe?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Y("stop",i),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Re(i),children:[T("rotate-cw","h-2.5 w-2.5"),z?"重跑":"启动"]}),f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:()=>Y("clear",i),disabled:!O.length,children:[T("eraser","h-2.5 w-2.5"),"清屏"]}),f.jsx("span",{className:"text-muted-foreground font-mono ml-1",children:O.length>=se?`${se}+ 行`:`${O.length} 行`})]})]}),Se(i),f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 py-1.5 border-b bg-background",children:[f.jsx("input",{value:ce,onChange:u=>ut(u.target.value),placeholder:"搜索日志…","aria-label":"搜索日志",className:"h-6 w-40 rounded-[var(--radius-md)] border bg-transparent px-2 text-xs font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"}),f.jsx(Me,{items:js,value:Q,onChange:ot,ariaLabel:"日志级别"})]}),f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:A,"data-testid":"log-scroll",role:"log","aria-live":"polite","aria-label":"日志输出",tabIndex:0,onScroll:nt,className:"h-full overflow-auto bg-terminal-bg p-3.5 font-mono text-xs leading-relaxed text-terminal-fg",children:[ze.length===0&&f.jsx("p",{className:"text-terminal-fg/50",children:O.length===0?`$ just ${i} · 等待输出…`:"无匹配行"}),ze.map(u=>f.jsx(Cs,{line:u,query:V},u.seq))]}),je>0&&f.jsxs("button",{type:"button",onClick:it,className:"absolute bottom-3 right-4 inline-flex items-center gap-1 h-7 px-3 rounded-[var(--radius-full)] border border-success/40 bg-success/10 text-success text-xs shadow-sm hover:bg-success/20 transition-colors",children:["↓ ",je," 行新输出"]})]})]})]})}function Is({params:t}){const e=pt(ge.mode,"h-5 w-5"),s=xt(),r=t.get("task")??t.get("recipe");return f.jsx(Dt,{manifest:ge,icon:e,breadcrumb:["插件",ge.mode,...r?[r]:[]],children:f.jsx("div",{className:"mx-auto h-full bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:f.jsx(ks,{selected:r,onSelect:n=>s.navigate(n?{recipe:n,task:null}:{recipe:null,task:null})})})})}export{Is as default};
5
+ `+He(t.slice(e+1))}ie.exports=Ce;ie.exports.escapeCarriageReturn=Ce;ie.exports.escapeCarriageReturnSafe=Yt;var Jt=ie.exports,me,qe;function Wt(){return qe||(qe=1,me=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),me}var pe,Ye;function Gt(){return Ye||(Ye=1,pe=/[\0-\x1F\x7F-\x9F]/),pe}var xe,Je;function Ut(){return Je||(Je=1,xe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),xe}var De,We;function Vt(){return We||(We=1,De=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/),De}var be,Ge;function Qt(){return Ge||(Ge=1,be=function(t){var e={};e.src_Any=Wt().source,e.src_Cc=Gt().source,e.src_Z=Ut().source,e.src_P=Vt().source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var s="[><|]";return e.src_pseudo_letter="(?:(?!"+s+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+s+"|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+s+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+").|;(?!"+e.src_ZCc+").|\\!+(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+s+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),be}function ve(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(s){s&&Object.keys(s).forEach(function(r){t[r]=s[r]})}),t}function ue(t){return Object.prototype.toString.call(t)}function Xt(t){return ue(t)==="[object String]"}function Kt(t){return ue(t)==="[object Object]"}function es(t){return ue(t)==="[object RegExp]"}function Ue(t){return ue(t)==="[object Function]"}function ts(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var tt={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ss(t){return Object.keys(t||{}).reduce(function(e,s){return e||tt.hasOwnProperty(s)},!1)}var rs={"http:":{validate:function(t,e,s){var r=t.slice(e);return s.re.http||(s.re.http=new RegExp("^\\/\\/"+s.re.src_auth+s.re.src_host_port_strict+s.re.src_path,"i")),s.re.http.test(r)?r.match(s.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,s){var r=t.slice(e);return s.re.no_http||(s.re.no_http=new RegExp("^"+s.re.src_auth+"(?:localhost|(?:(?:"+s.re.src_domain+")\\.)+"+s.re.src_domain_root+")"+s.re.src_port+s.re.src_host_terminator+s.re.src_path,"i")),s.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(s.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,s){var r=t.slice(e);return s.re.mailto||(s.re.mailto=new RegExp("^"+s.re.src_email_name+"@"+s.re.src_host_strict,"i")),s.re.mailto.test(r)?r.match(s.re.mailto)[0].length:0}}},ns="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",is="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function us(t){t.__index__=-1,t.__text_cache__=""}function cs(t){return function(e,s){var r=e.slice(s);return t.test(r)?r.match(t)[0].length:0}}function Ve(){return function(t,e){e.normalize(t)}}function ne(t){var e=t.re=Qt()(t.__opts__),s=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||s.push(ns),s.push(e.src_xn),e.src_tlds=s.join("|");function r(o){return o.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");var n=[];t.__compiled__={};function i(o,d){throw new Error('(LinkifyIt) Invalid schema "'+o+'": '+d)}Object.keys(t.__schemas__).forEach(function(o){var d=t.__schemas__[o];if(d!==null){var a={validate:null,link:null};if(t.__compiled__[o]=a,Kt(d)){es(d.validate)?a.validate=cs(d.validate):Ue(d.validate)?a.validate=d.validate:i(o,d),Ue(d.normalize)?a.normalize=d.normalize:d.normalize?i(o,d):a.normalize=Ve();return}if(Xt(d)){n.push(o);return}i(o,d)}}),n.forEach(function(o){t.__compiled__[t.__schemas__[o]]&&(t.__compiled__[o].validate=t.__compiled__[t.__schemas__[o]].validate,t.__compiled__[o].normalize=t.__compiled__[t.__schemas__[o]].normalize)}),t.__compiled__[""]={validate:null,normalize:Ve()};var c=Object.keys(t.__compiled__).filter(function(o){return o.length>0&&t.__compiled__[o]}).map(ts).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),us(t)}function os(t,e){var s=t.__index__,r=t.__last_index__,n=t.__text_cache__.slice(s,r);this.schema=t.__schema__.toLowerCase(),this.index=s+e,this.lastIndex=r+e,this.raw=n,this.text=n,this.url=n}function Qe(t,e){var s=new os(t,e);return t.__compiled__[s.schema].normalize(s,t),s}function j(t,e){if(!(this instanceof j))return new j(t,e);e||ss(t)&&(e=t,t={}),this.__opts__=ve({},tt,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ve({},rs,t),this.__compiled__={},this.__tlds__=is,this.__tlds_replaced__=!1,this.re={},ne(this)}j.prototype.add=function(e,s){return this.__schemas__[e]=s,ne(this),this};j.prototype.set=function(e){return this.__opts__=ve(this.__opts__,e),this};j.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var s,r,n,i,c,o,d,a,m;if(this.re.schema_test.test(e)){for(d=this.re.schema_search,d.lastIndex=0;(s=d.exec(e))!==null;)if(i=this.testSchemaAt(e,s[2],d.lastIndex),i){this.__schema__=s[2],this.__index__=s.index+s[1].length,this.__last_index__=s.index+s[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(a=e.search(this.re.host_fuzzy_test),a>=0&&(this.__index__<0||a<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=r.index+r[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(m=e.indexOf("@"),m>=0&&(n=e.match(this.re.email_fuzzy))!==null&&(c=n.index+n[1].length,o=n.index+n[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&o>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=o))),this.__index__>=0};j.prototype.pretest=function(e){return this.re.pretest.test(e)};j.prototype.testSchemaAt=function(e,s,r){return this.__compiled__[s.toLowerCase()]?this.__compiled__[s.toLowerCase()].validate(e,r,this):0};j.prototype.match=function(e){var s=0,r=[];this.__index__>=0&&this.__text_cache__===e&&(r.push(Qe(this,s)),s=this.__last_index__);for(var n=s?e.slice(s):e;this.test(n);)r.push(Qe(this,s)),n=n.slice(this.__last_index__),s+=this.__last_index__;return r.length?r:null};j.prototype.tlds=function(e,s){return e=Array.isArray(e)?e:[e],s?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,n,i){return r!==i[n-1]}).reverse(),ne(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,ne(this),this)};j.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};j.prototype.onCompile=function(){};var as=j,ls=S&&S.__createBinding||(Object.create?function(t,e,s,r){r===void 0&&(r=s);var n=Object.getOwnPropertyDescriptor(e,s);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[s]}}),Object.defineProperty(t,r,n)}:function(t,e,s,r){r===void 0&&(r=s),t[r]=e[s]}),fs=S&&S.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_s=S&&S.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(s){var r=[];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[r.length]=n);return r},t(e)};return function(e){if(e&&e.__esModule)return e;var s={};if(e!=null)for(var r=t(e),n=0;n<r.length;n++)r[n]!=="default"&&ls(s,e,r[n]);return fs(s,e),s}}(),st=S&&S.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(et,"__esModule",{value:!0});var ds=et.default=ys;const hs=st(Ht),gs=Jt,ms=st(as),R=_s(h);function ps(t,e=!1){return t=(0,gs.escapeCarriageReturn)(Es(t)),hs.default.ansiToJson(t,{json:!0,remove_empty:!0,use_classes:e})}function xs(t){let e="";return t.bg&&(e+=`${t.bg}-bg `),t.fg&&(e+=`${t.fg}-fg `),t.decoration&&(e+=`ansi-${t.decoration} `),e===""?null:(e=e.substring(0,e.length-1),e)}function Ds(t){const e={};switch(t.bg&&(e.backgroundColor=`rgb(${t.bg})`),t.fg&&(e.color=`rgb(${t.fg})`),t.decoration){case"bold":e.fontWeight="bold";break;case"dim":e.opacity="0.5";break;case"italic":e.fontStyle="italic";break;case"hidden":e.visibility="hidden";break;case"strikethrough":e.textDecoration="line-through";break;case"underline":e.textDecoration="underline";break;case"blink":e.textDecoration="blink";break}return e}function bs(t,e,s,r){const n=e?null:Ds(s),i=e?xs(s):null;return t?t==="fuzzy"?vs(s,r,n,i):Fs(s,r,n,i):R.createElement("span",{style:n,key:r,className:i},s.content)}function Fs(t,e,s,r){const n=[],i=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;let c=0,o;for(;(o=i.exec(t.content))!==null;){const[,d,a]=o,m=o.index+d.length;m>c&&n.push(t.content.substring(c,m));const _=a.startsWith("www.")?`http://${a}`:a;n.push(R.createElement("a",{key:c,href:_,target:"_blank"},`${a}`)),c=i.lastIndex}return c<t.content.length&&n.push(t.content.substring(c)),R.createElement("span",{style:s,key:e,className:r},n)}function vs(t,e,s,r){var n;const i=(0,ms.default)({fuzzyEmail:!1}).tlds(["io"],!0);if(!i.pretest(t.content))return R.createElement("span",{style:s,key:e,className:r},t.content);const c=i.match(t.content);if(!c)return R.createElement("span",{style:s,key:e,className:r},t.content);const o=[t.content.substring(0,(n=c[0])===null||n===void 0?void 0:n.index)];return c.forEach((d,a)=>{var m;o.push(R.createElement("a",{href:d.url,target:"_blank",key:a},t.content.substring(d.index,d.lastIndex))),c[a+1]&&o.push(t.content.substring(c[a].lastIndex,(m=c[a+1])===null||m===void 0?void 0:m.index))}),c[c.length-1].lastIndex!==t.content.length&&o.push(t.content.substring(c[c.length-1].lastIndex,t.content.length)),R.createElement("span",{style:s,key:e,className:r},o)}function ys(t){const{className:e,useClasses:s,children:r,linkify:n}=t;return R.createElement("code",{className:e},ps(r??"",s??!1).map(bs.bind(null,n??!1,s??!1)))}function Es(t){let e=t;do t=e,e=t.replace(/[^\n]\x08/gm,"");while(e.length<t.length);return t}const Cs=h.memo(function({line:e,query:s=""}){const r=e.text.replace(/\r?\n$/,""),n=s?Pt(r,s):null;return f.jsx("div",{className:"whitespace-pre-wrap break-all min-h-[1.25rem]",children:/\x1b\[/.test(r)?f.jsx(ds,{children:r}):n?n.map((i,c)=>i.hit?f.jsx("mark",{className:"bg-warning/40 text-inherit",children:i.text},c):f.jsx("span",{className:Fe(r),children:i.text},c)):f.jsx("span",{className:Fe(r),children:r})})}),js=[{key:"all",label:"全部"},{key:"text-info",label:"信息"},{key:"text-warning",label:"警告"},{key:"text-destructive",label:"错误"},{key:"text-success",label:"成功"}],Xe={start:"启动",stop:"停止",clear:"清屏"},ws=3e3;function As(t){const e=$t({start:0,end:t}),s=e.hours??0,r=e.minutes??0,n=e.seconds??0;return s===0&&r===0?`${n}s`:s===0?`${r}m${n}s`:`${s}h${r}m`}function Ke({startedAt:t,className:e}){const[,s]=h.useState(0);return h.useEffect(()=>{const r=setInterval(()=>s(n=>n+1),1e3);return()=>clearInterval(r)},[]),f.jsx("span",{className:e,children:As(Math.max(0,Date.now()-t))})}function zs({params:t,values:e,onChange:s,onSubmit:r,onCancel:n}){return f.jsxs("div",{"data-testid":"param-panel",onClick:i=>i.stopPropagation(),className:"flex flex-wrap items-center gap-2 px-3.5 py-2 border-b bg-card text-sm",children:[t.map(i=>f.jsxs("label",{className:"inline-flex items-center gap-1 text-xs",children:[f.jsx("span",{className:"font-mono text-muted-foreground",children:i}),f.jsx("input",{"aria-label":i,placeholder:i,value:e[i]??"",onChange:c=>s(i,c.target.value),className:"h-6 w-32 rounded-[var(--radius-md)] border bg-transparent px-1.5 font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"})]},i)),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm text-success",onClick:r,children:"启动"}),f.jsx($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:n,children:"取消"})]})}function ks({selected:t,onSelect:e}){const s=typeof e=="function",[r,n]=h.useState(null),i=s?t??null:r,c=u=>{s?e(u):n(u)},o=bt("just:/__just/recipes",()=>$e("/__just/recipes",{cache:"no-store"}),{subscribe:"plugin:just:state"}),d=o.data??[],a=!o.loading&&o.error===null&&d.length===0,[m,_]=h.useState(null);h.useEffect(()=>{if(!a){_(null);return}_(null);let u=!1;return $e("/__just/status",{cache:"no-store"}).then(l=>{u||_(l)}).catch(()=>{u||_({installed:!0,hasJustfile:!1})}),()=>{u=!0}},[a]);const[v,y]=h.useState({}),[b,w]=h.useState({}),B=h.useRef(""),A=h.useRef(null),O=i?b[i]??[]:[],{icon:T}=ht(),q=h.useRef(!0),L=h.useRef(0),[je,U]=h.useState(0),we=h.useRef(i);h.useEffect(()=>{we.current=i});const P=h.useRef(new Map),rt=h.useRef(0),Z=h.useRef(!1),M=h.useRef(null);h.useEffect(()=>{const u=()=>{var Te;Z.current=!1;const F=P.current;if(F.size===0)return;P.current=new Map;const p=new Map;for(const[k,H]of F)p.set(k,H.map(ee=>({seq:++rt.current,text:ee})));w(k=>{const H={...k};for(const[ee,dt]of p){const he=(H[ee]??[]).concat(dt);H[ee]=he.length>se?he.slice(-se):he}return H});const E=we.current,J=E?((Te=p.get(E))==null?void 0:Te.length)??0:0;if(J>0){const k=A.current;!k||Ze(k.scrollHeight,k.scrollTop,k.clientHeight)?q.current=!0:L.current+=J,U(L.current)}},l=()=>{Z.current&&(Z.current=!1,M.current!==null&&(clearTimeout(M.current),M.current=null),u())},g=()=>{Z.current||(Z.current=!0,typeof requestAnimationFrame=="function"&&requestAnimationFrame(l),M.current=setTimeout(l,50))};fetch("/__config").then(F=>F.json()).then(F=>{B.current=F.stopToken??""}).catch(()=>{});const D=new EventSource("/__just/logs");let C=!0;return D.onopen=()=>{if(C){C=!1;return}P.current.clear(),w({}),y({})},D.onmessage=F=>{try{const p=JSON.parse(F.data);if(p.type==="log"){const E=P.current.get(p.recipe);E?E.push(p.text):P.current.set(p.recipe,[p.text]),g()}else p.type==="clear"?(P.current.delete(p.recipe),w(E=>({...E,[p.recipe]:[]}))):p.type==="state"&&(y(E=>{var J;return{...E,[p.recipe]:{state:p.state,code:p.code,signal:p.signal,startedAt:p.startedAt??((J=E[p.recipe])==null?void 0:J.startedAt)??Date.now()}}}),oe(E=>E[p.recipe]?{...E,[p.recipe]:void 0}:E),p.state==="running"&&!s&&c(p.recipe))}catch{}},D.onerror=()=>{},()=>{D.close(),M.current!==null&&(clearTimeout(M.current),M.current=null),Z.current=!1}},[]);const Ae=h.useRef(i);h.useEffect(()=>{const u=A.current,l=Ae.current!==i;Ae.current=i,u&&(q.current||l)&&(q.current=!0,u.scrollTop=u.scrollHeight-u.clientHeight,L.current!==0&&(L.current=0,U(0)))},[O.length,i]);const nt=()=>{const u=A.current;if(!u)return;const l=Ze(u.scrollHeight,u.scrollTop,u.clientHeight);q.current=l,l&&L.current!==0&&(L.current=0,U(0))},it=()=>{const u=A.current;u&&(u.scrollTop=u.scrollHeight-u.clientHeight,q.current=!0,L.current=0,U(0))},[ce,ut]=h.useState(""),[V,ct]=h.useState("");h.useEffect(()=>{const u=setTimeout(()=>ct(ce),150);return()=>clearTimeout(u)},[ce]);const[Q,ot]=h.useState("all"),ze=h.useMemo(()=>{let u=O;if(Q!=="all"&&(u=u.filter(l=>Fe(l.text.replace(/\r?\n$/,""))===Q)),V){const l=V.toLowerCase();u=u.filter(g=>g.text.toLowerCase().includes(l))}return u},[O,Q,V]),[X,oe]=h.useState({}),ae=u=>oe(l=>l[u]?{...l,[u]:void 0}:l),Y=async(u,l,g)=>{u!=="clear"&&oe(D=>({...D,[l]:u}));try{const D=await fetch(`/__just/${u}`,{method:"POST",headers:{"x-stop-token":B.current,"Content-Type":"application/json"},body:JSON.stringify({recipe:l,...u==="start"&&g?{args:g}:{}})});if(!D.ok){let C="";try{const F=await D.json();typeof(F==null?void 0:F.error)=="string"&&F.error&&(C=`:${F.error}`)}catch{}return te.error(`just ${l} ${Xe[u]}失败${C||`(HTTP ${D.status})`}`),u!=="clear"&&ae(l),!1}return u==="clear"?(te.success(`已清屏 ${l}`),!0):(setTimeout(()=>ae(l),ws),te.success(u==="start"?`已启动 ${l}`:`已停止 ${l}`),!0)}catch{return te.error(`just ${l} ${Xe[u]}失败:网络异常`),u!=="clear"&&ae(l),!1}},le=d.map(u=>({...u,task:v[u.name]})),ke=le.filter(u=>{var l;return((l=u.task)==null?void 0:l.state)==="running"}).length,z=i?v[i]:void 0,fe=(z==null?void 0:z.state)==="running",[_e,de]=h.useState(null),[Ne,K]=h.useState({}),Re=u=>{var g;const l=((g=d.find(D=>D.name===u))==null?void 0:g.params)??[];if(l.length===0){Y("start",u);return}K(Object.fromEntries(l.map(D=>[D,""]))),de(u)},at=()=>{if(!_e)return;const u=Object.entries(Ne).filter(([,l])=>l!=="");Y("start",_e,u.length>0?Object.fromEntries(u):void 0),de(null),K({})},lt=()=>{de(null),K({})},Se=u=>{var l;return _e===u?f.jsx(zs,{params:((l=d.find(g=>g.name===u))==null?void 0:l.params)??[],values:Ne,onChange:(g,D)=>K(C=>({...C,[g]:D})),onSubmit:at,onCancel:lt}):null},Oe=(u,l,g)=>u?"bg-success animate-pulse":l?g!=null&&g.signal?"bg-muted-foreground":g!=null&&g.code?"bg-destructive":"bg-success/60":"bg-muted-foreground/30",ft={key:"__console__",label:"总控台",badge:f.jsx("span",{className:"font-mono opacity-80",children:ke>0?ke:""}),className:i===null?"":"border-border text-muted-foreground hover:text-foreground hover:border-muted-foreground/40",renderLabel:()=>f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx("span",{className:"h-3 w-3",children:T("monitor","h-3 w-3")}),f.jsx("span",{children:"总控台"})]})},_t=d.map(u=>{const l=v[u.name],g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=i===u.name;return{key:u.name,label:u.name,className:C?"":g?"border-success/40 bg-success/10 text-success hover:bg-success/20":"",renderLabel:()=>f.jsxs(f.Fragment,{children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${Oe(g,D,l)}`}),f.jsx("span",{children:u.name})]}),renderExtra:()=>D&&!C?f.jsx("span",{className:`text-xs ${l!=null&&l.signal?"opacity-60":l!=null&&l.code?"text-destructive":"text-success"}`,children:l!=null&&l.signal?"停":l==null?void 0:l.code}):void 0}});return f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsx("div",{className:"flex-none flex items-center gap-1.5 flex-wrap px-3 py-2 border-b bg-background",children:f.jsx(Me,{items:[ft,..._t],value:i??"__console__",onChange:u=>c(u==="__console__"?null:u),ariaLabel:"任务筛选"})}),i===null?f.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o.loading&&!o.data?f.jsx(Le,{rows:4,className:"m-3"}):o.error?f.jsx(gt,{message:o.error,onRetry:o.reload}):le.length===0?m?f.jsx(mt,{title:m.installed?m.hasJustfile?"justfile 中未发现可运行 recipe":"未发现 justfile":"未安装 just",hint:m.installed?m.hasJustfile?"justfile 存在但未解析到可展示的 recipe,检查 recipe 定义":"在项目根目录放置 justfile,即可在这里查看与启停任务":"未检测到 just 命令,安装 just 后即可在这里查看与启停任务"}):f.jsx(Le,{rows:4,className:"m-3"}):f.jsx("div",{className:"flex-1 min-h-0 overflow-auto p-3 grid gap-2.5 grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start",children:le.map(u=>{const l=u.task,g=(l==null?void 0:l.state)==="running",D=(l==null?void 0:l.state)==="exited",C=(b[u.name]??[]).slice(-3).map(F=>F.text.replace(/\r?\n$/,"").replace(/\x1b\[[0-9;]*m/g,""));return f.jsxs("div",{onClick:()=>c(u.name),className:"group rounded-[var(--radius-lg)] border bg-card p-3 cursor-pointer hover:border-muted-foreground/40 transition-colors",children:[f.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[f.jsx("span",{className:`h-2 w-2 rounded-[var(--radius-full)] flex-none ${Oe(g,D,l)}`}),f.jsx("span",{className:"font-mono font-medium",children:u.name}),g&&f.jsx(Ke,{startedAt:l.startedAt,className:"text-success font-mono"}),D&&f.jsx("span",{className:`font-mono ${l.signal?"text-muted-foreground":l.code?"text-destructive":"text-success"}`,children:l.signal?"已停止":`exit ${l.code}`}),!l&&f.jsx("span",{className:"text-muted-foreground/60",children:"未运行"}),f.jsx("span",{className:"ml-auto flex items-center gap-1",onClick:F=>F.stopPropagation(),children:g?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Y("stop",u.name),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[u.name],onClick:()=>Re(u.name),children:[T(D?"rotate-cw":"play","h-2.5 w-2.5"),D?"重跑":"启动"]})})]}),Se(u.name),u.description&&f.jsx("p",{className:"mt-1 text-sm text-muted-foreground/70 truncate",children:u.description}),f.jsx("div",{className:"mt-2 rounded bg-terminal-bg px-2 py-1.5 font-mono text-xs leading-relaxed text-terminal-fg/70 min-h-[3.4em]",children:C.length?C.map((F,p)=>f.jsx("div",{className:"truncate",children:F},p)):f.jsxs("span",{className:"text-terminal-fg/40",children:["$ just ",u.name," …"]})})]},u.name)})})}):f.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 h-8 border-b bg-background text-sm",children:[f.jsx("span",{className:`h-1.5 w-1.5 rounded-[var(--radius-full)] ${fe?"bg-success animate-pulse":"bg-muted-foreground"}`}),f.jsx("span",{className:"font-mono font-medium",children:i}),f.jsx("span",{className:"text-muted-foreground font-mono",children:fe?f.jsxs(f.Fragment,{children:["running · ",f.jsx(Ke,{startedAt:z.startedAt})]}):z!=null&&z.signal?"已停止":z?`exit ${z.code}`:"未运行"}),f.jsxs("span",{className:"ml-auto flex items-center gap-1",children:[fe?f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Y("stop",i),children:[T("square","h-2.5 w-2.5"),"停止"]}):f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",disabled:!!X[i],onClick:()=>Re(i),children:[T("rotate-cw","h-2.5 w-2.5"),z?"重跑":"启动"]}),f.jsxs($,{variant:"ghost",className:"h-6 gap-1 px-2 text-sm",onClick:()=>Y("clear",i),disabled:!O.length,children:[T("eraser","h-2.5 w-2.5"),"清屏"]}),f.jsx("span",{className:"text-muted-foreground font-mono ml-1",children:O.length>=se?`${se}+ 行`:`${O.length} 行`})]})]}),Se(i),f.jsxs("div",{className:"flex-none flex items-center gap-2 px-3.5 py-1.5 border-b bg-background",children:[f.jsx("input",{value:ce,onChange:u=>ut(u.target.value),placeholder:"搜索日志…","aria-label":"搜索日志",className:"h-6 w-40 rounded-[var(--radius-md)] border bg-transparent px-2 text-xs font-mono placeholder:text-muted-foreground/50 focus:border-muted-foreground/50"}),f.jsx(Me,{items:js,value:Q,onChange:ot,ariaLabel:"日志级别"})]}),f.jsxs("div",{className:"relative flex-1 min-h-0",children:[f.jsxs("div",{ref:A,"data-testid":"log-scroll",role:"log","aria-live":"polite","aria-label":"日志输出",tabIndex:0,onScroll:nt,className:"h-full overflow-auto bg-terminal-bg p-3.5 font-mono text-xs leading-relaxed text-terminal-fg",children:[ze.length===0&&f.jsx("p",{className:"text-terminal-fg/50",children:O.length===0?`$ just ${i} · 等待输出…`:"无匹配行"}),ze.map(u=>f.jsx(Cs,{line:u,query:V},u.seq))]}),je>0&&f.jsxs("button",{type:"button",onClick:it,className:"absolute bottom-3 right-4 inline-flex items-center gap-1 h-7 px-3 rounded-[var(--radius-full)] border border-success/40 bg-success/10 text-success text-xs shadow-sm hover:bg-success/20 transition-colors",children:["↓ ",je," 行新输出"]})]})]})]})}function Bs({params:t}){const e=pt(ge.mode,"h-5 w-5"),s=xt(),r=t.get("task")??t.get("recipe");return f.jsx(Dt,{manifest:ge,icon:e,breadcrumb:["插件",ge.mode,...r?[r]:[]],children:f.jsx("div",{className:"mx-auto h-full bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:f.jsx(ks,{selected:r,onSelect:n=>s.navigate(n?{recipe:n,task:null}:{recipe:null,task:null})})})})}export{Bs as default};
@@ -0,0 +1 @@
1
+ import{j as e,r as u}from"./vendor-react-OhDMXABq.js";import{u as C,R as M,C as g,M as O,I as W,D as V}from"./DiagramViewer-CQYfB79k.js";import{u as v,R as L,a as R,P as _,c as T}from"./index-BxPRo4R9.js";import{m as I}from"./web-CmZk5ox_.js";import"./vendor-ui-D8qdFUhC.js";import"./fetchJson-D-dWeu1j.js";import"./index-D7HrI6pR.js";import"./client-Cw4K1Nx3.js";function U({path:t,resolve:n}){const[o,r]=C(),m=t.split("/").pop(),c=n?n(t):"/"+encodeURI(t),d=o?`${c}${c.includes("?")?"&":"?"}v=${o}`:c;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex-none px-4 py-2 border-b text-xs flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-foreground",children:m}),e.jsx("div",{className:"ml-auto",children:e.jsx(M,{onClick:r})})]}),e.jsx("iframe",{src:d,title:m,className:"flex-1 min-h-0 w-full bg-background"})]})}function $({path:t}){const{icon:n}=v();return e.jsx("div",{className:"grid place-items-center h-full text-center text-muted-foreground",children:e.jsxs("div",{children:[n("file-question","h-10 w-10 mx-auto mb-3 opacity-50"),e.jsx("p",{children:"该格式无法预览"}),e.jsx("p",{className:"mt-1 font-mono text-xs break-all",children:t})]})})}const b=176,j=400,p=176,w="zd-outline-w",q=t=>Math.min(j,Math.max(b,t));function A(){try{const t=localStorage.getItem(w);if(t===null)return p;const n=Number(t);return Number.isFinite(n)&&n>=b&&n<=j?n:p}catch{return p}}function F({containerRef:t}){const{icon:n}=v(),[o,r]=u.useState([]),[m,c]=u.useState(null),[d,N]=u.useState(A),S=(s,l)=>{const i=q(s);if(N(i),l)try{localStorage.setItem(w,String(i))}catch{}},k=()=>{N(p);try{localStorage.removeItem(w)}catch{}};u.useEffect(()=>{const s=t.current;if(!s)return;let l=!1;const i=()=>{if(l)return;const x=s.querySelectorAll("h1[id], h2[id], h3[id]"),h=[];x.forEach(f=>{var y;h.push({id:f.id,text:((y=f.textContent)==null?void 0:y.trim())??"",level:parseInt(f.tagName[1],10)})}),r(h)};i();const a=new MutationObserver(i);return a.observe(s,{childList:!0,subtree:!0,characterData:!0}),()=>{l=!0,a.disconnect()}},[t]),u.useEffect(()=>{const s=t.current;if(!s||!o.length)return;const l=new IntersectionObserver(i=>{const a=i.filter(x=>x.isIntersecting);if(a.length){const x=a.reduce((h,f)=>h.boundingClientRect.top<f.boundingClientRect.top?h:f);c(x.target.id)}},{root:s,rootMargin:"-60px 0px -70% 0px",threshold:0});return o.forEach(({id:i})=>{const a=s.querySelector(`#${CSS.escape(i)}`);a&&l.observe(a)}),()=>l.disconnect()},[o,t]);const E=s=>{var i;const l=(i=t.current)==null?void 0:i.querySelector(`#${CSS.escape(s)}`);l==null||l.scrollIntoView({behavior:"smooth",block:"start"})};return o.length?e.jsxs("nav",{className:"hidden md:flex shrink-0 border-l py-2 overflow-hidden",style:{width:`${d}px`},"aria-label":"文档大纲",children:[e.jsx(L,{orientation:"vertical",invert:!0,min:b,max:j,value:d,onChange:S,onReset:k,label:"调整大纲宽度",className:"flex-none w-1.5 cursor-col-resize self-stretch"}),e.jsxs("div",{className:"flex-1 min-w-0 min-h-0 overflow-y-auto pl-3",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 text-sm font-medium text-muted-foreground uppercase tracking-wider",children:[n("file-text","h-3 w-3"),e.jsx("span",{children:"大纲"})]}),e.jsx("ul",{className:"space-y-0.5",children:o.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",title:s.text,onClick:()=>E(s.id),className:`w-full text-left text-sm leading-snug py-0.5 px-1.5 rounded line-clamp-2 transition-colors ${m===s.id?"bg-primary/10 text-foreground font-medium":"text-muted-foreground hover:bg-muted/70"}`,style:{paddingLeft:6+Math.min(s.level-1,2)*10},children:s.text||s.id})},s.id))})]})]}):null}function z(t){const n=t.slice(t.lastIndexOf("/")+1).toLowerCase();if(n==="justfile"||n==="makefile")return g;const o=n.lastIndexOf("."),r=o>=0?n.slice(o):"";return r===".md"||r===".markdown"?O:[".svg",".png",".jpg",".jpeg",".gif",".webp",".ico"].includes(r)?W:[".pdf",".html",".htm"].includes(r)?U:[".excalidraw",".drawio"].includes(r)?V:[".sql",".txt",".csv",".tsv",".json",".yaml",".yml",".xml",".py",".js",".ts",".java",".go",".rs",".rb",".php",".c",".cpp",".h",".cs",".swift",".kt",".scala",".sh",".bash",".zsh",".fish",".env",".gitignore",".dockerfile"].includes(r)?g:o===-1?g:$}function J({params:t}){const{icon:n}=v(),o=R(I.mode,"h-5 w-5"),r=t.get("file"),m=t.get("wt"),c=u.useRef(null),d=r?z(r):null;return u.useEffect(()=>{c.current&&(c.current.scrollTop=0)},[r]),e.jsx(_,{manifest:I,icon:o,breadcrumb:["插件",m??"当前分支",...r?[r]:[]],children:e.jsx("div",{className:"mx-auto h-full max-w-5xl bg-background border rounded-lg shadow-sm overflow-hidden flex flex-col",children:r&&d?e.jsxs("div",{className:"flex-1 min-h-0 flex overflow-hidden",children:[e.jsx("div",{ref:c,className:"flex-1 min-h-0 overflow-auto",children:e.jsx(d,{path:r})}),e.jsx(F,{containerRef:c})]}):e.jsx(T,{icon:n("eye","h-6 w-6"),title:"从左侧选择文件预览",hint:"支持 Markdown、图片、代码等格式"})})})}export{J as default};