@kabmo-labs/kabmo 0.38.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +420 -419
- package/dist/client/static/js/{CsvGrid-90zfbn7f.js → CsvGrid-t1n057vw.js} +1 -1
- package/dist/client/static/js/{DocxView-vwq2rf16.js → DocxView-c9g6teks.js} +1 -1
- package/dist/client/static/js/{DrawioView-bvx7eqcz.js → DrawioView-gd14j54m.js} +1 -1
- package/dist/client/static/js/{ImageView-q6xfmbrq.js → ImageView-57f1ecdp.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-qatdaw3n.js → LayoutWrapper-x7srbpz1.js} +1 -1
- package/dist/client/static/js/{Modal-6jx1fvfb.js → Modal-0bn3f77b.js} +1 -1
- package/dist/client/static/js/{PdfView-tkv2d2zs.js → PdfView-cybz0xbj.js} +1 -1
- package/dist/client/static/js/{SessionsView-rbnecykz.js → SessionsView-gx5q68tp.js} +1 -1
- package/dist/client/static/js/{SheetView-t08g8kdr.js → SheetView-1kk5y326.js} +1 -1
- package/dist/client/static/js/{SvgPreview-9vh6mdcp.js → SvgPreview-mp4tk37p.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-bxcn33e1.js → abnfDiagram-O67JEVCF-78qb3can.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-40ggw6e8.js → architectureDiagram-NJMV4G6O-n0fr4hb6.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-k41cvjrd.js → blockDiagram-BEXU5L5S-2xemfrzh.js} +1 -1
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-rdcmn6ac.js → c4Diagram-YGBWAQC7-zxfdx3eb.js} +1 -1
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-txbmbkxv.js → classDiagram-v2-NBCMYWYE-z9sasy3k.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-bxzh3qj1.js → cose-bilkent-JH36ORCC-9byp0czh.js} +1 -1
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-abx5343b.js → cynefinDiagram-VND7K2PF-gnm129fx.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-baj278kt.js → dagre-6A5THRUB-sc5tfv1w.js} +1 -1
- package/dist/client/static/js/{diagram-22UHCM2B-vqvhdc5m.js → diagram-22UHCM2B-hq11eek7.js} +1 -1
- package/dist/client/static/js/{diagram-3UASUU5V-w328rfx0.js → diagram-3UASUU5V-7bk532gd.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-zzcmwnm8.js → diagram-ATOU4E4O-yt8wxttm.js} +1 -1
- package/dist/client/static/js/{diagram-CDSNMT55-8yw39mmj.js → diagram-CDSNMT55-n3978w6p.js} +1 -1
- package/dist/client/static/js/{diagram-MLGK6HIB-zgc386pv.js → diagram-MLGK6HIB-004x4gyw.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-efmvvscm.js → diagram-MPIPVDR6-498nt489.js} +1 -1
- package/dist/client/static/js/{dockerfile-bp5dre33.js → dockerfile-6hbcmkc8.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-p66h0dzq.js → ebnfDiagram-ZINNZB2B-5fkmymqn.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-g0jjxcqd.js → elk-276RUBZZ-6xrfa2kd.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-39gat96z.js → erDiagram-OPXOYQCR-byz4zbkn.js} +1 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-s3fbfwrz.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-nsjv1zt4.js → ganttDiagram-FUAMR5RP-4fkw1k01.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-r4vnkcy3.js → gitGraphDiagram-X574FWY7-19g84yw8.js} +1 -1
- package/dist/client/static/js/{index-hzx81cjq.js → index-0v8b5pzb.js} +1 -1
- package/dist/client/static/js/{index-h8h5c2r8.js → index-1j1s91c4.js} +1 -1
- package/dist/client/static/js/{index-6ax2z70w.js → index-20vhkcb9.js} +1 -1
- package/dist/client/static/js/{index-st202rjv.js → index-3wpsr2bc.js} +7 -7
- package/dist/client/static/js/{index-73jwm4d5.js → index-3y6krykq.js} +1 -1
- package/dist/client/static/js/{index-1qszrvzk.js → index-4jbbdq6n.js} +1 -1
- package/dist/client/static/js/{index-tfsaj5d1.js → index-4qt2e84b.js} +1 -1
- package/dist/client/static/js/{index-da10qpns.js → index-57z8mtmx.js} +1 -1
- package/dist/client/static/js/{index-ha75kff0.js → index-5gn56236.js} +1 -1
- package/dist/client/static/js/{index-k9xsvab3.js → index-74scnfpk.js} +1 -1
- package/dist/client/static/js/{index-dkseg29t.js → index-7kafzae0.js} +2 -2
- package/dist/client/static/js/{index-ra38ggke.js → index-89a2702q.js} +1 -1
- package/dist/client/static/js/{index-tv61v3t3.js → index-8j90mdgz.js} +1 -1
- package/dist/client/static/js/{index-50z4ek83.js → index-baet2nv8.js} +1 -1
- package/dist/client/static/js/{index-a74k07z2.js → index-bhng2dax.js} +1 -1
- package/dist/client/static/js/{index-24yyj78e.js → index-cj9193d5.js} +1 -1
- package/dist/client/static/js/{index-5ebhb94w.js → index-dd4q54y0.js} +1 -1
- package/dist/client/static/js/{index-dfgdn3fj.js → index-e3w46vsc.js} +1 -1
- package/dist/client/static/js/{index-rgp69pa8.js → index-e99ec2f0.js} +1 -1
- package/dist/client/static/js/{index-2ndq1ngv.js → index-ehnztdd2.js} +1 -1
- package/dist/client/static/js/{index-rqrcw8nj.js → index-epbqzayj.js} +1 -1
- package/dist/client/static/js/{index-vnn7m9yp.js → index-fpf1jkwd.js} +1 -1
- package/dist/client/static/js/{index-vxd4gykh.js → index-g252205p.js} +1 -1
- package/dist/client/static/js/{index-11bdd235.js → index-gxtgyya0.js} +1 -1
- package/dist/client/static/js/{index-tzm90bsz.js → index-j314me09.js} +1 -1
- package/dist/client/static/js/{index-gwhx66f4.js → index-jbwns6sc.js} +1 -1
- package/dist/client/static/js/{index-c15r8jd3.js → index-kdgcbt17.js} +1 -1
- package/dist/client/static/js/{index-rf0p3v7q.js → index-m4bjsyj2.js} +1 -1
- package/dist/client/static/js/{index-2drjp9ks.js → index-pfwd0160.js} +1 -1
- package/dist/client/static/js/{index-e1pr3k50.js → index-qntytvt0.js} +1 -1
- package/dist/client/static/js/{index-z0cpp5bc.js → index-rgdhyry3.js} +1 -1
- package/dist/client/static/js/{index-9wtg6ywn.js → index-sjnnv1gd.js} +1 -1
- package/dist/client/static/js/{index-5y0bvq4q.js → index-zj45wj1x.js} +2 -2
- package/dist/client/static/js/{index-0kxqzafy.js → index-zw7qjx65.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-e39pvm4j.js → infoDiagram-VRGFBTTK-aw6ter0a.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rqhszgvp.js → ishikawaDiagram-OU5B5YK6-62gst5wh.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-wgy5qrsv.js → journeyDiagram-ZHPQQLJL-6kgv5a4j.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-b8bxn0h1.js → kanban-definition-PNTS6WVX-8p3515b7.js} +1 -1
- package/dist/client/static/js/{mermaid.core-vb5ehtre.js → mermaid.core-b6ga2y8y.js} +2 -2
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-t4p38s38.js → mindmap-definition-NLK3R4M7-na9e9b4a.js} +1 -1
- package/dist/client/static/js/one-dark-pro-xp6ssk4z.js +1 -0
- package/dist/client/static/js/one-light-xgab7b02.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-3gp4madx.js → pegDiagram-GJSIUBJH-d1hk7fnq.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-0cbm773h.js → pieDiagram-5QR66LMP-7b9f4x0y.js} +1 -1
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-jwg7fc9f.js → quadrantDiagram-O4NWA36T-q4wxgmhg.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-38xh691s.js → railroadDiagram-XR7U4H2S-jngq1qx4.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-gpddawxh.js → requirementDiagram-PLB6GJNP-6xph3b72.js} +1 -1
- package/dist/client/static/js/{rust-bx3ecv4n.js → rust-w6hen2h4.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s6t6bbhk.js → sankeyDiagram-IPEJSGJF-ncfzgdj8.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-wkq51pmb.js → sequenceDiagram-PO4LG4MO-sqz0yfg0.js} +1 -1
- package/dist/client/static/js/{sizeCapture-INFHLROL-xtwexf8k.js → sizeCapture-INFHLROL-vt8qp04d.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-jnwsqa7y.js → stateDiagram-v2-GCMORJYK-myjtrmfe.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-mnkkqcbx.js → swimlanes-2SLR337P-z9vx7z4j.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-6xmrz03n.js → swimlanesDiagram-TC7HE7FX-5vha7thx.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-rxq6heqh.js → timeline-definition-EJHVYXUP-z815np57.js} +1 -1
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dz94f57t.js → usecaseDiagram-POWQR4AR-06ntggng.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-5mmvkhsq.js → vennDiagram-UO4OBE2U-nmtaf5rp.js} +1 -1
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-dctdntpa.js → wardleyDiagram-VNRHLVJA-zgsxmak8.js} +1 -1
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-njyfrqkv.js → xychartDiagram-PMCCYNJV-8bg9qdra.js} +1 -1
- package/package.json +1 -1
- package/src/server/lib/changes/capture-bash.server.ts +69 -4
- package/src/server/lib/changes/capture-fs.server.ts +2 -2
- package/src/server/lib/changes/capture-races.test.ts +107 -0
- package/src/server/lib/changes/capture-scan.test.ts +157 -0
- package/src/server/lib/changes/capture-test-util.ts +1 -1
- package/src/server/lib/changes/capture-types.ts +3 -1
- package/src/server/lib/changes/capture-write.server.ts +50 -0
- package/src/server/lib/changes/capture.server.ts +32 -16
- package/src/server/lib/changes/capture.test.ts +48 -0
- package/src/server/lib/changes/journal.server.ts +3 -1
- package/src/server/lib/changes/omp-fallback.server.ts +48 -0
- package/src/server/lib/changes/omp-fallback.test.ts +75 -0
- package/src/server/lib/changes/reader.server.ts +28 -0
- package/src/server/lib/changes/scan.server.ts +51 -1
- package/src/server/lib/changes/sessions.server.ts +65 -0
- package/src/server/lib/changes/sessions.test.ts +52 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-f6jpcqyq.js +0 -1
- package/dist/client/static/js/one-dark-pro-dhybn1ff.js +0 -1
- package/dist/client/static/js/one-light-bqg77ay0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d,n,i,V,o,u,a,Ar,e,gr,ui,Gn,gp,we,S,bp,Rf,ir,or,s,Pa,Be,Oa,m,In,M,D,Xe,f,B,ie,et,ae,he,fe,Tn,Jt,Dn,Y,C,ut,va,F,gi,tn,b,ce,Tu,ro,J,at,it,pt,Ve,ge}from"./index-st202rjv.js";import{pp,fr}from"./index-tfsaj5d1.js";var Tt={name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]},_e=s(Tt);var At={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]},je=s(At);function Ue({message:t,hasStagedChanges:c,isBusy:l=!1,amend:r=!1,seeded:p=!1,onToggleAmend:h,onChangeMessage:g,onCommit:v}){let y=t.trim().length>0&&!l&&(r||c),L=r?"Rewrite the previous commit with this message":c?"Commit staged changes":"Stage changes first";return e("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[e("textarea",{value:t,onChange:(N)=>g(N.currentTarget.value),onKeyDown:(N)=>{if(N.key==="Enter"&&(N.metaKey||N.ctrlKey)&&y)N.preventDefault(),v()},placeholder:r?"New message for the previous commit (⌘/Ctrl+Enter to commit)":"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),e("div",{className:"flex items-center gap-2",children:[e("label",{className:"flex items-center gap-1.5 text-[11px] text-ink/70 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:r,onChange:(N)=>h?.(N.currentTarget.checked),className:`${ge} accent-ink cursor-pointer`}),"Amend"]}),r&&p&&e("span",{className:"text-[10px] text-ink/40",title:"The previous commit's message, loaded as an editable starting point",children:"previous message loaded"}),e("button",{type:"button",onClick:v,disabled:!y,title:L,className:"ml-auto flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(f,{size:12}),r?"Amend commit":"Commit"]})]})]})}function We({operation:t,conflicts:c,isBusy:l,onAbort:r,onContinue:p}){let h=ui[t],g=c.length,v=g===0,y=t!=="stash-pop";return e("div",{className:"border-t border-warning/30 bg-warning/5 p-3 flex flex-col gap-2",children:[e("div",{className:"flex items-center gap-2 text-xs text-ink",children:[e(D,{size:13,className:"text-warning flex-shrink-0"}),e("span",{className:"font-medium",children:[h.charAt(0).toUpperCase()+h.slice(1)," in progress"]}),e("span",{className:`font-mono tabular-nums text-[10px] ${v?"text-success":"text-warning"}`,children:v?"all conflicts resolved":`${g} conflict${g===1?"":"s"} left`})]}),!v&&e("div",{className:"max-h-20 overflow-y-auto scrollbar-overlay-container font-mono text-[10px] text-warning/90 space-y-0.5",children:c.map((L)=>e("div",{className:"truncate",title:L,children:L},L))}),e("div",{className:"flex items-stretch gap-2",children:[e("button",{type:"button",onClick:r,disabled:l,title:`Abort the ${h} and restore the previous state`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(tn,{size:12}),"Abort ",h]}),y&&e("button",{type:"button",onClick:p,disabled:l||!v,title:v?`Conclude the ${h}`:`Resolve all ${g} conflict(s) first`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-transparent bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Tn,{size:12}),"Continue ",h]})]})]})}function qe({branchRef:t,showBranchMenu:c,setShowBranchMenu:l,branch:r,branches:p,remoteBranches:h,onCheckout:g,onMerge:v,onOpenBranchPrompt:y,onManageBranches:L,optionsRef:N,showOptions:G,setShowOptions:R,onHistory:P,onGraph:T,viewMode:k,setViewMode:x,isBusy:w=!1,syncCount:E={ahead:0,behind:0},syncing:z=!1,onSync:I,onFetch:A,detached:H=!1}){return e("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[e("div",{className:"relative",ref:t,children:[e("button",{onClick:()=>l(!c),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",title:H?`Detached HEAD at ${r}`:`On branch ${r}`,children:[e(fe,{size:12,className:H?"text-warning":"text-ink/60"}),e("span",{className:`truncate max-w-[140px] ${H?"font-mono text-warning":""}`,children:r}),e(B,{size:12,className:"text-ink/40"})]}),c&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-56 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:e("div",{className:"max-h-48 scrollbar-overlay-container py-1",children:[p.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),p.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),h.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),h.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),e("div",{className:"w-full h-px bg-ink/10 my-1"}),e("button",{onClick:()=>{y(),l(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[e(Y,{size:12}),e("span",{children:"Create new branch..."})]}),e("button",{onClick:L,className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80",children:[e(gi,{size:12}),e("span",{children:"Manage branches..."})]})]})})]}),e("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:N,children:[e("button",{type:"button",onClick:A,disabled:w,title:"Fetch from all remotes and prune deleted branches","aria-label":"Fetch",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(Pa,{size:13})}),e("button",{type:"button",onClick:I,disabled:w,title:z?"Syncing with upstream…":E.ahead>0&&E.behind>0?`Pull ${E.behind} then push ${E.ahead} commit(s)`:E.ahead>0?`Push ${E.ahead} commit(s)`:E.behind>0?`Pull ${E.behind} commit(s)`:"Up to date — sync anyway","aria-label":"Sync with upstream","aria-busy":z,className:`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${z?"":"disabled:opacity-40"}`,children:[e(C,{size:13,className:z?"animate-spin":"","aria-hidden":"true"}),e("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",E.ahead," ↓",E.behind]})]}),e("button",{type:"button",onClick:P,title:"Commit History","aria-label":"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(In,{size:13})}),e("button",{type:"button",onClick:T,title:"Git Graph","aria-label":"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Tn,{size:13})}),e("button",{type:"button",onClick:()=>R(!G),title:"View Options","aria-label":"View Options","aria-expanded":G,className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Be,{size:13})}),G&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[e("button",{type:"button",onClick:()=>{x("flat"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(je,{size:12,className:"text-ink/60"}),e("span",{children:"View as List"})]}),k==="flat"&&e(f,{size:12,className:"text-ink"})]}),e("button",{type:"button",onClick:()=>{x("tree"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(_e,{size:12,className:"text-ink/60"}),e("span",{children:"View as Tree"})]}),k==="tree"&&e(f,{size:12,className:"text-ink"})]})]})]})]})}function Ke({activeRepo:t,repos:c,isRefreshing:l,rootPath:r,reposScanning:p,onSelectRepo:h,onRefresh:g,onRefreshRepos:v}){return e("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[e("div",{className:"flex items-center gap-1.5 min-w-0",children:[e(pp,{size:12,className:"text-ink/50 flex-shrink-0","aria-hidden":!0}),e(fr,{rootPath:r,activeRepo:t,onSelectRepo:h,repos:c,scanning:p,onRefreshRepos:v})]}),e("div",{className:"flex space-x-2 text-ink/40",children:e("button",{type:"button",onClick:g,title:"Refresh","aria-label":"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:e(ut,{size:14,className:l?"animate-spin":""})})})]})}function Te({change:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let h=Gn(t.status,c),{charStatus:g,colorClass:v}=h,y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"";return e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:c,status:g,repo:l||".",root:r}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e("span",{className:`font-bold font-mono text-[10px] w-3 flex-shrink-0 text-center ${v}`,title:`Status: ${h.label}`,children:g}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${v}`,title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:[!c&&e(d,{children:[e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("revert",t.file)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("stage",t.file)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}),c&&e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("unstage",t.file)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})]})})]})}function Ye({change:t,repo:c,rootPath:l,onResolve:r}){let[p,h]=n(!1),[g,v]=n(null),y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"",G=()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:!1,status:t.status,repo:c,root:l}}))},R=async()=>{let k=!p;if(h(k),k&&g===null){let x=new URLSearchParams({conflictMarkers:"1",file:t.file,repo:c||"."});if(l)x.set("root",l);try{let E=await(await fetch(`/api/fs/git?${x.toString()}`)).json();v(E.markers??{})}catch{v({})}}},P=g?.ours||"ours",T=g?.theirs||"theirs";return e("div",{className:"border-b border-warning/20 last:border-b-0",children:[e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-warning/5 cursor-pointer group text-[11px] transition-colors",onClick:G,children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e(Oa,{size:11,className:"text-warning flex-shrink-0"}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:"truncate text-warning",title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N}),gr(t.status)&&e("span",{className:"text-[10px] text-warning/70 font-mono flex-shrink-0",children:t.status})]}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),R()},title:p?"Hide resolve actions":"Show resolve actions","aria-label":p?"Hide resolve actions":"Show resolve actions","aria-expanded":p,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors flex-shrink-0",children:p?e(et,{size:11}):e(B,{size:11})})]}),p&&e("div",{className:"px-3 pb-2 pt-0.5 flex flex-wrap items-center gap-1.5",children:[e("button",{type:"button",onClick:()=>r(t.file,"ours"),title:`Take ${P} — \`git checkout --ours\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",P]}),e("button",{type:"button",onClick:()=>r(t.file,"theirs"),title:`Take ${T} — \`git checkout --theirs\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",T]}),e("button",{type:"button",onClick:()=>r(t.file,""),title:"Mark resolved: the file was edited by hand, this stages it",className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer flex items-center gap-1",children:[e(f,{size:10}),"mark resolved"]})]})]})}function Bt(t){let c={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let r of t){let p=r.file.replace(/^[./]+/,""),h=p.endsWith("/"),g=p.replace(/\/$/,"").split("/").filter(Boolean),v=c,y="";for(let L=0;L<g.length;L++){let N=g[L];y=y?`${y}/${N}`:N;let G=L===g.length-1;if(G&&!h)v.children.push({id:y,name:N,path:y,type:"file",change:r,children:[],changeCount:1});else{let P=v.children.find((T)=>T.type==="folder"&&T.name===N);if(!P)P={id:y,name:N,path:y,type:"folder",children:[],changeCount:0,change:G&&h?r:void 0},v.children.push(P);v=P}}}function l(r){if(r.type==="file")return 1;let p=r.change?1:0;for(let h of r.children)p+=l(h);return r.changeCount=p,r.children.sort((h,g)=>{if(h.type==="folder"&&g.type==="file")return-1;if(h.type==="file"&&g.type==="folder")return 1;return h.name.localeCompare(g.name)}),p}return l(c),c.children}function Ze(t){let{sessionId:c,ready:l,read:r}=bp(),p=u(()=>Bt(t),[t]),h=u(()=>{let R=new Set;function P(T){for(let k of T)if(k.type==="folder"){if(R.add(k.id),k.children&&k.children.length>0)P(k.children)}}return P(p),R},[p]),[g,v]=S("git.expandedFolders",[]),y=u(()=>new Set(g),[g]),L=o(null);i(()=>{if(!l||L.current===c)return;if(h.size===0)return;if(L.current=c,r("git.expandedFolders",[]).length>0)return;v(Array.from(h))},[l,c,h,r,v]);let N=a((R)=>{v((P)=>{let T=new Set(P);if(T.has(R))T.delete(R);else T.add(R);return Array.from(T)})},[v]),G=a((R)=>y.has(R),[y]);return{tree:p,expandedFolders:y,toggleFolder:N,isFolderOpen:G,expandAll:()=>v(Array.from(h)),collapseAll:()=>v([])}}function Ae({node:t,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g}){let v=t.type==="folder",y=v?l(t.id):!1;if(v)return e("div",{className:"select-none",children:[e("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:y?e(B,{size:12}):e(ie,{size:12})}),e(at,{name:t.name,isFolder:!0,isOpen:y,size:13,className:"flex-shrink-0"}),e("span",{className:"font-medium text-ink truncate",children:t.name}),e("span",{className:"text-[10px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]}),y&&t.children&&t.children.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map((k)=>e(Ae,{node:k,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g},k.id))})]});let L=t.change,N=Gn(L?.status||"M",c),{charStatus:G,colorClass:R}=N,P=L?L.file:t.path;return e("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:P,staged:c,status:G,repo:h||".",root:g}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:e("span",{className:`font-bold font-mono text-[10px] ${R}`,title:`Status: ${N.label}`,children:G})}),e(at,{name:t.name,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${R}`,title:P,children:t.name})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",P)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",P)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",P)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]})}function Fe({changes:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let{tree:h,isFolderOpen:g,toggleFolder:v}=Ze(t);if(h.length===0)return null;return e("div",{className:"py-0.5",children:h.map((y)=>e(Ae,{node:y,isStaged:c,isFolderOpen:g,toggleFolder:v,onAction:p,repo:l,rootPath:r},y.id))})}function Qe({changes:t,isLoading:c,viewMode:l,repo:r,rootPath:p,onAction:h,onResolve:g}){let[v,y]=S("git.stagedExpanded",!0),[L,N]=S("git.unstagedExpanded",!0),[G,R]=S("git.conflictsExpanded",!0),P=t.filter((x)=>gr(x.status)),T=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[0]!==" "&&w[0]!=="?"}),k=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[1]!==" "&&w[1]!=="?"||w==="??"});if(c&&t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})});if(t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})});return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"py-1",children:[P.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-warning/5 cursor-pointer transition-colors",onClick:()=>R(!G),children:e("div",{className:"flex items-center space-x-1 font-semibold text-warning text-xs",children:[e("span",{className:"w-3 text-center",children:G?"▾":"▸"}),e("span",{children:"Conflicts"}),e("span",{className:"text-warning/70 font-normal ml-1 border border-warning/30 rounded-full px-1.5 text-[10px] bg-paper",children:P.length})]})}),G&&P.map((x)=>e(Ye,{change:x,repo:r,rootPath:p,onResolve:g??(()=>{})},`conflict-${x.file}`))]}),T.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>y(!v),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:v?"▾":"▸"}),e("span",{children:"Staged Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:T.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:12})})})]}),v&&(l==="tree"?e(Fe,{changes:T,isStaged:!0,repo:r,rootPath:p,onAction:h}):T.map((x)=>e(Te,{change:x,isStaged:!0,repo:r,rootPath:p,onAction:h},x.file+"staged")))]}),k.length>0&&e("div",{children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>N(!L),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:L?"▾":"▸"}),e("span",{children:"Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:k.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:12})}),e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:12})})]})]}),L&&(l==="tree"?e(Fe,{changes:k,isStaged:!1,repo:r,rootPath:p,onAction:h}):k.map((x)=>e(Te,{change:x,isStaged:!1,repo:r,rootPath:p,onAction:h},x.file+"unstaged")))]})]})})}function Je({matches:t,loaded:c,total:l,hasMore:r,isFiltering:p}){if(p)return`${t} of ${c} loaded`;if(typeof l==="number"&&l>0)return r||c<l?`${c} of ${l}`:`${l} commits`;return r?`${c}+ commits`:`${c} commits`}function tt({isGraphMode:t,onToggleMode:c,searchQuery:l,onSearchChange:r,onRefresh:p,onClose:h,isRefreshing:g,totalCommits:v,loadedCount:y,totalCount:L,hasMore:N}){let G=Je({matches:v,loaded:y,total:L,hasMore:N,isFiltering:l.trim().length>0});return e("div",{className:`flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none
|
|
1
|
+
import{d,n,i,V,o,u,a,Ar,e,gr,ui,Gn,gp,we,S,bp,Rf,ir,or,s,Pa,Be,Oa,m,In,M,D,Xe,f,B,ie,et,ae,he,fe,Tn,Jt,Dn,Y,C,ut,va,F,gi,tn,b,ce,Tu,ro,J,at,it,pt,Ve,ge}from"./index-3wpsr2bc.js";import{pp,fr}from"./index-4qt2e84b.js";var Tt={name:"folder-tree",size:24,node:[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]},_e=s(Tt);var At={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]},je=s(At);function Ue({message:t,hasStagedChanges:c,isBusy:l=!1,amend:r=!1,seeded:p=!1,onToggleAmend:h,onChangeMessage:g,onCommit:v}){let y=t.trim().length>0&&!l&&(r||c),L=r?"Rewrite the previous commit with this message":c?"Commit staged changes":"Stage changes first";return e("div",{className:"border-t border-ink/10 bg-canvas/50 p-3 flex flex-col gap-2",children:[e("textarea",{value:t,onChange:(N)=>g(N.currentTarget.value),onKeyDown:(N)=>{if(N.key==="Enter"&&(N.metaKey||N.ctrlKey)&&y)N.preventDefault(),v()},placeholder:r?"New message for the previous commit (⌘/Ctrl+Enter to commit)":"Commit message (⌘/Ctrl+Enter to commit)",rows:5,className:"w-full resize-y min-h-[100px] max-h-[200px] bg-paper border border-ink/20 rounded px-2.5 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),e("div",{className:"flex items-center gap-2",children:[e("label",{className:"flex items-center gap-1.5 text-[11px] text-ink/70 cursor-pointer select-none",children:[e("input",{type:"checkbox",checked:r,onChange:(N)=>h?.(N.currentTarget.checked),className:`${ge} accent-ink cursor-pointer`}),"Amend"]}),r&&p&&e("span",{className:"text-[10px] text-ink/40",title:"The previous commit's message, loaded as an editable starting point",children:"previous message loaded"}),e("button",{type:"button",onClick:v,disabled:!y,title:L,className:"ml-auto flex items-center justify-center gap-1.5 px-3 py-1.5 rounded bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(f,{size:12}),r?"Amend commit":"Commit"]})]})]})}function We({operation:t,conflicts:c,isBusy:l,onAbort:r,onContinue:p}){let h=ui[t],g=c.length,v=g===0,y=t!=="stash-pop";return e("div",{className:"border-t border-warning/30 bg-warning/5 p-3 flex flex-col gap-2",children:[e("div",{className:"flex items-center gap-2 text-xs text-ink",children:[e(D,{size:13,className:"text-warning flex-shrink-0"}),e("span",{className:"font-medium",children:[h.charAt(0).toUpperCase()+h.slice(1)," in progress"]}),e("span",{className:`font-mono tabular-nums text-[10px] ${v?"text-success":"text-warning"}`,children:v?"all conflicts resolved":`${g} conflict${g===1?"":"s"} left`})]}),!v&&e("div",{className:"max-h-20 overflow-y-auto scrollbar-overlay-container font-mono text-[10px] text-warning/90 space-y-0.5",children:c.map((L)=>e("div",{className:"truncate",title:L,children:L},L))}),e("div",{className:"flex items-stretch gap-2",children:[e("button",{type:"button",onClick:r,disabled:l,title:`Abort the ${h} and restore the previous state`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(tn,{size:12}),"Abort ",h]}),y&&e("button",{type:"button",onClick:p,disabled:l||!v,title:v?`Conclude the ${h}`:`Resolve all ${g} conflict(s) first`,className:"flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded border border-transparent bg-ink text-canvas hover:bg-ink/90 transition-colors cursor-pointer text-xs font-medium disabled:opacity-40 disabled:cursor-not-allowed",children:[e(Tn,{size:12}),"Continue ",h]})]})]})}function qe({branchRef:t,showBranchMenu:c,setShowBranchMenu:l,branch:r,branches:p,remoteBranches:h,onCheckout:g,onMerge:v,onOpenBranchPrompt:y,onManageBranches:L,optionsRef:N,showOptions:G,setShowOptions:R,onHistory:P,onGraph:T,viewMode:k,setViewMode:x,isBusy:w=!1,syncCount:E={ahead:0,behind:0},syncing:z=!1,onSync:I,onFetch:A,detached:H=!1}){return e("div",{className:"p-3 border-b border-ink/10 bg-canvas/50 flex items-center justify-between",children:[e("div",{className:"relative",ref:t,children:[e("button",{onClick:()=>l(!c),className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 -ml-2 rounded transition-colors text-[11px] text-ink/80 font-medium",title:H?`Detached HEAD at ${r}`:`On branch ${r}`,children:[e(fe,{size:12,className:H?"text-warning":"text-ink/60"}),e("span",{className:`truncate max-w-[140px] ${H?"font-mono text-warning":""}`,children:r}),e(B,{size:12,className:"text-ink/40"})]}),c&&e("div",{className:"glass-popover absolute top-full left-0 mt-1 w-56 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:e("div",{className:"max-h-48 scrollbar-overlay-container py-1",children:[p.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Local"}),p.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),h.length>0&&e(d,{children:[e("div",{className:"px-3 py-1 text-[10px] uppercase tracking-wider text-ink/40 font-semibold",children:"Remote"}),h.map((O)=>e("div",{className:"flex items-center group/branch",children:[e("button",{onClick:()=>{g(O),l(!1)},className:"flex-1 min-w-0 text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("span",{className:"truncate",children:O}),r===O&&e(f,{size:12,className:"text-ink flex-shrink-0"})]}),r!==O&&e("button",{type:"button",onClick:()=>{v(O),l(!1)},title:`Merge ${O} into ${r}`,"aria-label":`Merge ${O} into ${r}`,className:"touch-visible opacity-0 group-hover/branch:opacity-100 px-2 py-2 text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors cursor-pointer flex-shrink-0",children:e(Tn,{size:12})})]},O))]}),e("div",{className:"w-full h-px bg-ink/10 my-1"}),e("button",{onClick:()=>{y(),l(!1)},className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80 italic",children:[e(Y,{size:12}),e("span",{children:"Create new branch..."})]}),e("button",{onClick:L,className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink/80",children:[e(gi,{size:12}),e("span",{children:"Manage branches..."})]})]})})]}),e("div",{className:"flex items-center space-x-2 text-ink/40 relative",ref:N,children:[e("button",{type:"button",onClick:A,disabled:w,title:"Fetch from all remotes and prune deleted branches","aria-label":"Fetch",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(Pa,{size:13})}),e("button",{type:"button",onClick:I,disabled:w,title:z?"Syncing with upstream…":E.ahead>0&&E.behind>0?`Pull ${E.behind} then push ${E.ahead} commit(s)`:E.ahead>0?`Push ${E.ahead} commit(s)`:E.behind>0?`Pull ${E.behind} commit(s)`:"Up to date — sync anyway","aria-label":"Sync with upstream","aria-busy":z,className:`flex items-center gap-1 p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors disabled:cursor-not-allowed ${z?"":"disabled:opacity-40"}`,children:[e(C,{size:13,className:z?"animate-spin":"","aria-hidden":"true"}),e("span",{className:"font-mono tabular-nums text-[10px]",children:["↑",E.ahead," ↓",E.behind]})]}),e("button",{type:"button",onClick:P,title:"Commit History","aria-label":"Commit History",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(In,{size:13})}),e("button",{type:"button",onClick:T,title:"Git Graph","aria-label":"Git Graph",className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Tn,{size:13})}),e("button",{type:"button",onClick:()=>R(!G),title:"View Options","aria-label":"View Options","aria-expanded":G,className:"p-1 rounded hover:text-ink hover:bg-ink/5 cursor-pointer transition-colors",children:e(Be,{size:13})}),G&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-36 bg-paper border border-ink/15 rounded-md shadow-lg z-50 py-1 font-mono text-xs",children:[e("button",{type:"button",onClick:()=>{x("flat"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(je,{size:12,className:"text-ink/60"}),e("span",{children:"View as List"})]}),k==="flat"&&e(f,{size:12,className:"text-ink"})]}),e("button",{type:"button",onClick:()=>{x("tree"),R(!1)},className:"w-full px-3 py-1.5 text-left text-ink hover:bg-ink/5 flex items-center justify-between transition-colors",children:[e("div",{className:"flex items-center space-x-1.5",children:[e(_e,{size:12,className:"text-ink/60"}),e("span",{children:"View as Tree"})]}),k==="tree"&&e(f,{size:12,className:"text-ink"})]})]})]})]})}function Ke({activeRepo:t,repos:c,isRefreshing:l,rootPath:r,reposScanning:p,onSelectRepo:h,onRefresh:g,onRefreshRepos:v}){return e("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[e("div",{className:"flex items-center gap-1.5 min-w-0",children:[e(pp,{size:12,className:"text-ink/50 flex-shrink-0","aria-hidden":!0}),e(fr,{rootPath:r,activeRepo:t,onSelectRepo:h,repos:c,scanning:p,onRefreshRepos:v})]}),e("div",{className:"flex space-x-2 text-ink/40",children:e("button",{type:"button",onClick:g,title:"Refresh","aria-label":"Refresh",className:"hover:text-ink cursor-pointer inline-flex",children:e(ut,{size:14,className:l?"animate-spin":""})})})]})}function Te({change:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let h=Gn(t.status,c),{charStatus:g,colorClass:v}=h,y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"";return e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-ink/5 cursor-pointer group text-[11px] transition-colors",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:c,status:g,repo:l||".",root:r}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e("span",{className:`font-bold font-mono text-[10px] w-3 flex-shrink-0 text-center ${v}`,title:`Status: ${h.label}`,children:g}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${v}`,title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:[!c&&e(d,{children:[e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("revert",t.file)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("stage",t.file)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}),c&&e("button",{type:"button",onClick:(R)=>{R.stopPropagation(),p("unstage",t.file)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})]})})]})}function Ye({change:t,repo:c,rootPath:l,onResolve:r}){let[p,h]=n(!1),[g,v]=n(null),y=t.file.split("/"),L=y.pop()||t.file,N=y.length>0?y.join("/"):"",G=()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.file,staged:!1,status:t.status,repo:c,root:l}}))},R=async()=>{let k=!p;if(h(k),k&&g===null){let x=new URLSearchParams({conflictMarkers:"1",file:t.file,repo:c||"."});if(l)x.set("root",l);try{let E=await(await fetch(`/api/fs/git?${x.toString()}`)).json();v(E.markers??{})}catch{v({})}}},P=g?.ours||"ours",T=g?.theirs||"theirs";return e("div",{className:"border-b border-warning/20 last:border-b-0",children:[e("div",{className:"flex items-center justify-between px-3 py-1 hover:bg-warning/5 cursor-pointer group text-[11px] transition-colors",onClick:G,children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-2",children:[e(Oa,{size:11,className:"text-warning flex-shrink-0"}),e(at,{name:L,size:12,className:"flex-shrink-0"}),e("span",{className:"truncate text-warning",title:t.file,children:L}),N&&e("span",{className:"text-[10px] text-ink/40 truncate ml-1",children:N}),gr(t.status)&&e("span",{className:"text-[10px] text-warning/70 font-mono flex-shrink-0",children:t.status})]}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),R()},title:p?"Hide resolve actions":"Show resolve actions","aria-label":p?"Hide resolve actions":"Show resolve actions","aria-expanded":p,className:"w-5 h-5 flex items-center justify-center rounded text-ink/40 hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors flex-shrink-0",children:p?e(et,{size:11}):e(B,{size:11})})]}),p&&e("div",{className:"px-3 pb-2 pt-0.5 flex flex-wrap items-center gap-1.5",children:[e("button",{type:"button",onClick:()=>r(t.file,"ours"),title:`Take ${P} — \`git checkout --ours\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",P]}),e("button",{type:"button",onClick:()=>r(t.file,"theirs"),title:`Take ${T} — \`git checkout --theirs\` then stage`,className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer max-w-[45%] truncate",children:["take ",T]}),e("button",{type:"button",onClick:()=>r(t.file,""),title:"Mark resolved: the file was edited by hand, this stages it",className:"px-2 py-0.5 text-[10px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer flex items-center gap-1",children:[e(f,{size:10}),"mark resolved"]})]})]})}function Bt(t){let c={id:"",name:"",path:"",type:"folder",children:[],changeCount:0};for(let r of t){let p=r.file.replace(/^[./]+/,""),h=p.endsWith("/"),g=p.replace(/\/$/,"").split("/").filter(Boolean),v=c,y="";for(let L=0;L<g.length;L++){let N=g[L];y=y?`${y}/${N}`:N;let G=L===g.length-1;if(G&&!h)v.children.push({id:y,name:N,path:y,type:"file",change:r,children:[],changeCount:1});else{let P=v.children.find((T)=>T.type==="folder"&&T.name===N);if(!P)P={id:y,name:N,path:y,type:"folder",children:[],changeCount:0,change:G&&h?r:void 0},v.children.push(P);v=P}}}function l(r){if(r.type==="file")return 1;let p=r.change?1:0;for(let h of r.children)p+=l(h);return r.changeCount=p,r.children.sort((h,g)=>{if(h.type==="folder"&&g.type==="file")return-1;if(h.type==="file"&&g.type==="folder")return 1;return h.name.localeCompare(g.name)}),p}return l(c),c.children}function Ze(t){let{sessionId:c,ready:l,read:r}=bp(),p=u(()=>Bt(t),[t]),h=u(()=>{let R=new Set;function P(T){for(let k of T)if(k.type==="folder"){if(R.add(k.id),k.children&&k.children.length>0)P(k.children)}}return P(p),R},[p]),[g,v]=S("git.expandedFolders",[]),y=u(()=>new Set(g),[g]),L=o(null);i(()=>{if(!l||L.current===c)return;if(h.size===0)return;if(L.current=c,r("git.expandedFolders",[]).length>0)return;v(Array.from(h))},[l,c,h,r,v]);let N=a((R)=>{v((P)=>{let T=new Set(P);if(T.has(R))T.delete(R);else T.add(R);return Array.from(T)})},[v]),G=a((R)=>y.has(R),[y]);return{tree:p,expandedFolders:y,toggleFolder:N,isFolderOpen:G,expandAll:()=>v(Array.from(h)),collapseAll:()=>v([])}}function Ae({node:t,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g}){let v=t.type==="folder",y=v?l(t.id):!1;if(v)return e("div",{className:"select-none",children:[e("div",{className:"flex items-center justify-between px-2 py-1 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>r(t.id),children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center text-ink/40 flex-shrink-0",children:y?e(B,{size:12}):e(ie,{size:12})}),e(at,{name:t.name,isFolder:!0,isOpen:y,size:13,className:"flex-shrink-0"}),e("span",{className:"font-medium text-ink truncate",children:t.name}),e("span",{className:"text-[10px] text-ink/40 font-normal px-1 py-0.2 bg-ink/5 rounded-full ml-1",children:t.changeCount})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",t.path)},title:`Discard changes in ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",t.path)},title:`Stage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",t.path)},title:`Unstage ${t.name}`,className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]}),y&&t.children&&t.children.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:t.children.map((k)=>e(Ae,{node:k,isStaged:c,isFolderOpen:l,toggleFolder:r,onAction:p,repo:h,rootPath:g},k.id))})]});let L=t.change,N=Gn(L?.status||"M",c),{charStatus:G,colorClass:R}=N,P=L?L.file:t.path;return e("div",{className:"flex items-center justify-between px-2 py-0.5 hover:bg-ink/5 cursor-pointer rounded group transition-colors text-[11px]",onClick:()=>{window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:P,staged:c,status:G,repo:h||".",root:g}}))},children:[e("div",{className:"flex items-center space-x-1.5 flex-1 min-w-0 pr-1",children:[e("span",{className:"w-3.5 h-3.5 flex items-center justify-center flex-shrink-0",children:e("span",{className:`font-bold font-mono text-[10px] ${R}`,title:`Status: ${N.label}`,children:G})}),e(at,{name:t.name,size:12,className:"flex-shrink-0"}),e("span",{className:`truncate ${R}`,title:P,children:t.name})]}),e("div",{className:"flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("div",{className:"flex items-center touch-visible opacity-0 group-hover:opacity-100 space-x-1",children:!c?e(d,{children:[e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("revert",P)},title:"Discard Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:11})}),e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("stage",P)},title:"Stage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:11})})]}):e("button",{type:"button",onClick:(k)=>{k.stopPropagation(),p("unstage",P)},title:"Unstage Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:11})})})})]})}function Fe({changes:t,isStaged:c,repo:l,rootPath:r,onAction:p}){let{tree:h,isFolderOpen:g,toggleFolder:v}=Ze(t);if(h.length===0)return null;return e("div",{className:"py-0.5",children:h.map((y)=>e(Ae,{node:y,isStaged:c,isFolderOpen:g,toggleFolder:v,onAction:p,repo:l,rootPath:r},y.id))})}function Qe({changes:t,isLoading:c,viewMode:l,repo:r,rootPath:p,onAction:h,onResolve:g}){let[v,y]=S("git.stagedExpanded",!0),[L,N]=S("git.unstagedExpanded",!0),[G,R]=S("git.conflictsExpanded",!0),P=t.filter((x)=>gr(x.status)),T=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[0]!==" "&&w[0]!=="?"}),k=t.filter((x)=>{if(gr(x.status))return!1;let w=x.status;return w&&w[1]!==" "&&w[1]!=="?"||w==="??"});if(c&&t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"Loading..."})});if(t.length===0)return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"p-4 text-center text-ink/40 italic",children:"No changes found."})});return e("div",{className:"flex-1 scrollbar-overlay-container font-mono text-[11px] text-ink/80",children:e("div",{className:"py-1",children:[P.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-warning/5 cursor-pointer transition-colors",onClick:()=>R(!G),children:e("div",{className:"flex items-center space-x-1 font-semibold text-warning text-xs",children:[e("span",{className:"w-3 text-center",children:G?"▾":"▸"}),e("span",{children:"Conflicts"}),e("span",{className:"text-warning/70 font-normal ml-1 border border-warning/30 rounded-full px-1.5 text-[10px] bg-paper",children:P.length})]})}),G&&P.map((x)=>e(Ye,{change:x,repo:r,rootPath:p,onResolve:g??(()=>{})},`conflict-${x.file}`))]}),T.length>0&&e("div",{className:"mb-2",children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>y(!v),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:v?"▾":"▸"}),e("span",{children:"Staged Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:T.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("unstage_all")},title:"Unstage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Jt,{size:12})})})]}),v&&(l==="tree"?e(Fe,{changes:T,isStaged:!0,repo:r,rootPath:p,onAction:h}):T.map((x)=>e(Te,{change:x,isStaged:!0,repo:r,rootPath:p,onAction:h},x.file+"staged")))]}),k.length>0&&e("div",{children:[e("div",{className:"flex items-center justify-between px-3 py-1 group hover:bg-ink/5 cursor-pointer transition-colors",onClick:()=>N(!L),children:[e("div",{className:"flex items-center space-x-1 font-semibold text-ink text-xs",children:[e("span",{className:"w-3 text-center",children:L?"▾":"▸"}),e("span",{children:"Changes"}),e("span",{className:"text-ink/40 font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] bg-paper",children:k.length})]}),e("div",{className:"touch-visible opacity-0 group-hover:opacity-100 flex items-center space-x-1 text-ink/40 flex-shrink-0",children:[e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("revert_all")},title:"Discard All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-error hover:bg-error/10 cursor-pointer transition-colors",children:e(tn,{size:12})}),e("button",{type:"button",onClick:(x)=>{x.stopPropagation(),h("stage_all")},title:"Stage All Changes",className:"w-5 h-5 flex items-center justify-center rounded hover:text-ink hover:bg-ink/10 cursor-pointer transition-colors",children:e(Y,{size:12})})]})]}),L&&(l==="tree"?e(Fe,{changes:k,isStaged:!1,repo:r,rootPath:p,onAction:h}):k.map((x)=>e(Te,{change:x,isStaged:!1,repo:r,rootPath:p,onAction:h},x.file+"unstaged")))]})]})})}function Je({matches:t,loaded:c,total:l,hasMore:r,isFiltering:p}){if(p)return`${t} of ${c} loaded`;if(typeof l==="number"&&l>0)return r||c<l?`${c} of ${l}`:`${l} commits`;return r?`${c}+ commits`:`${c} commits`}function tt({isGraphMode:t,onToggleMode:c,searchQuery:l,onSearchChange:r,onRefresh:p,onClose:h,isRefreshing:g,totalCommits:v,loadedCount:y,totalCount:L,hasMore:N}){let G=Je({matches:v,loaded:y,total:L,hasMore:N,isFiltering:l.trim().length>0});return e("div",{className:`flex flex-col gap-2 px-3 lg:px-5 py-3 border-b border-ink/10 bg-paper select-none
|
|
2
2
|
pl-[max(0.75rem,env(safe-area-inset-left,0px))] pr-[max(0.75rem,env(safe-area-inset-right,0px))]`,children:[e("div",{className:"flex items-center justify-between gap-2 lg:gap-4",children:[e("div",{className:"flex flex-col min-w-0",children:[e("div",{className:"flex items-center gap-2.5 min-w-0",children:[e("h2",{className:"text-base font-semibold text-ink tracking-tight",children:t?"Graph":"History"}),e("span",{className:"text-[11px] font-mono px-2 py-0.5 rounded-full bg-ink/5 text-ink/50 border border-ink/10 whitespace-nowrap",children:G})]}),e("p",{className:"text-xs text-ink/50 mt-0.5 hidden lg:block",children:"Browse recent commits and inspect changed files."})]}),e("div",{className:"flex items-center gap-1.5 lg:gap-2 flex-shrink-0",children:[e("div",{className:"flex items-center bg-ink/5 p-0.5 rounded-lg border border-ink/10 text-xs",children:[e("button",{type:"button",onClick:()=>c(!1),title:"History view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${!t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[e(In,{size:13}),e("span",{className:"hidden lg:inline",children:"History"})]}),e("button",{type:"button",onClick:()=>c(!0),title:"Graph view",className:`flex items-center gap-1.5 px-2.5 py-1 rounded-md font-medium transition-colors cursor-pointer ${t?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:[e(Tn,{size:13}),e("span",{className:"hidden lg:inline",children:"Graph"})]})]}),e("button",{type:"button",onClick:p,disabled:g,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-ink/15 hover:bg-ink/5 text-ink/70 hover:text-ink transition-colors cursor-pointer text-xs disabled:opacity-40",title:"Refresh commit history",children:[e(va,{size:13,className:g?"animate-spin text-ink":""}),e("span",{className:"hidden lg:inline",children:"refresh"})]}),e("button",{type:"button",onClick:h,className:"p-2 -mr-1 rounded-md hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors cursor-pointer",title:"Close modal",children:e(b,{size:16})})]})]}),e("div",{className:"relative mt-1",children:[e(F,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),e("input",{type:"text",value:l,onChange:(R)=>r(R.currentTarget.value),placeholder:"Filter commits by message, author, or hash...",className:"w-full bg-ink/[0.03] border border-ink/15 rounded-md pl-8 pr-3 py-1.5 text-xs text-ink placeholder-ink/40 focus:outline-none focus:border-ink/40 transition-colors font-mono"}),l&&e("button",{type:"button",onClick:()=>r(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-ink/40 hover:text-ink cursor-pointer",children:e(b,{size:12})})]})]})}var le=["#38bdf8","#f97316","#a855f7","#10b981","#ec4899","#eab308","#06b6d4","#6366f1"];function Ee(t,c){if(!t||!c)return!1;if(t===c)return!0;let l=Math.min(t.length,c.length);if(l>=4)return t.substring(0,l)===c.substring(0,l);return!1}function Re(t){let c=new Map,l=[];for(let r of t){if(typeof r.lane==="number"){c.set(r.hash,r.lane);continue}let p=l.findIndex((g)=>Ee(g,r.hash)||Ee(g,r.shortHash));if(p===-1)if(p=l.indexOf(null),p===-1)p=l.length,l.push(r.hash);else l[p]=r.hash;c.set(r.hash,p);let h=r.parents&&r.parents[0];if(h)l[p]=h;else l[p]=null;if(r.parents&&r.parents.length>1)for(let g=1;g<r.parents.length;g++){let v=r.parents[g];if(!l.some((L)=>Ee(L,v))){let L=l.indexOf(null);if(L===-1)l.push(v);else l[L]=v}}}return c}function nt(t,c,l,r){let p=[],h=new Map;t.forEach((g,v)=>{if(h.set(g.hash,v),g.shortHash)h.set(g.shortHash,v);if(g.hash.length>=7)h.set(g.hash.substring(0,7),v)});for(let g of t){let v=c.get(g.hash)??0,y=l[g.hash]??0,L=le[v%le.length];if(!g.parents||g.parents.length===0)continue;for(let N of g.parents){let G=h.get(N);if(typeof G!=="number"&&N.length>=7)G=h.get(N.substring(0,7));if(typeof G==="number"){let R=t[G],P=c.get(R.hash)??v,T=l[R.hash]??y+60;p.push({fromHash:g.hash,toHash:R.hash,fromLane:v,toLane:P,fromY:y,toY:T,color:le[v%le.length]})}else p.push({fromHash:g.hash,toHash:"tail-"+g.hash,fromLane:v,toLane:v,fromY:y,toY:Math.max(y+80,r),color:L})}}return p}function ot(t,c,l,r){if(Math.abs(t-l)<1)return`M ${t} ${c} L ${l} ${r}`;let p=r-c,h=c+p*0.45,g=r-p*0.45;return`M ${t} ${c} C ${t} ${h}, ${l} ${g}, ${l} ${r}`}function st({commits:t,nodePositions:c,selectedHash:l,hoveredHash:r,isGraphMode:p,laneWidth:h=18,paddingLeft:g=16,totalHeight:v}){let y=u(()=>{if(!p){let R=new Map;return t.forEach((P)=>R.set(P.hash,0)),R}return Re(t)},[t,p]),L=u(()=>{let R=0;return y.forEach((P)=>{if(P>R)R=P}),R},[y]),N=p?(L+1)*h+g*2:36,G=u(()=>{if(!p){let R=[];for(let P=0;P<t.length-1;P++){let T=c[t[P].hash]??P*60+20,k=c[t[P+1].hash]??(P+1)*60+20;R.push({fromHash:t[P].hash,toHash:t[P+1].hash,fromLane:0,toLane:0,fromY:T,toY:k,color:"var(--theme-ink)"})}return R}return nt(t,y,c,v)},[t,y,c,v,p]);return e("div",{className:"absolute top-0 left-0 pointer-events-none z-10",style:{width:N,height:v},children:e("svg",{className:"w-full h-full overflow-visible",style:{width:N,height:v},children:[e("defs",{children:e("filter",{id:"node-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",children:e("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodOpacity:"0.35"})})}),G.map((R)=>{let P=p?g+R.fromLane*h:16,T=p?g+R.toLane*h:16,k=p?R.color:"currentColor",x=p?0.95:0.25,w=ot(P,R.fromY,T,R.toY);return e("path",{d:w,fill:"none",stroke:k,strokeWidth:p?2.25:1.5,strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:x},`${R.fromHash}->${R.toHash}`)}),t.map((R)=>{let P=y.get(R.hash)??0,T=p?g+P*h:16,k=c[R.hash]??20,x=l===R.hash||l===R.shortHash,w=r===R.hash||r===R.shortHash,E=p?le[P%le.length]:"var(--theme-success)";return e("g",{"data-commit-node":R.hash,children:[(x||w)&&e("circle",{cx:T,cy:k,r:8,fill:E,fillOpacity:x?0.35:0.2,stroke:E,strokeWidth:1}),e("circle",{"data-commit-dot":"",cx:T,cy:k,r:p?4:4.5,fill:p?"var(--theme-paper)":E,stroke:E,strokeWidth:p?2.5:1.5,filter:"url(#node-glow)"}),p&&e("circle",{cx:T,cy:k,r:1.8,fill:E})]},`node-${R.hash}`)})]})})}function rt({commit:t,onAction:c}){return e("div",{className:"flex flex-wrap items-center gap-1.5 pt-1.5 pb-2",children:[e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("checkout",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"checkout"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("create_branch_here",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"create branch here"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("cherry_pick",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"cherry-pick"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("revert",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"revert"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("reset",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"reset..."}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("merge",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"merge into current"}),e("button",{type:"button",onClick:(l)=>{l.stopPropagation(),c("rebase",t)},className:"px-2.5 py-1 text-[11px] font-mono rounded border border-ink/20 hover:bg-ink/5 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40",children:"rebase onto this"})]})}var Ge=3;function Ft(t){let c=[];for(let l=0;l<t.length;l+=1){if(t[l].type!=="context"){c.push({row:t[l],index:l});continue}let r=l;while(r<t.length&&t[r].type==="context")r+=1;let p=r-l;if(p>Ge*2+1){for(let h=l;h<l+Ge;h+=1)c.push({row:t[h],index:h});c.push({row:{type:"elided",count:p-Ge*2},index:-1});for(let h=r-Ge;h<r;h+=1)c.push({row:t[h],index:h})}else for(let h=l;h<r;h+=1)c.push({row:t[h],index:h});l=r-1}return c}function lt({diffText:t,isLoading:c,filePath:l,fullContext:r=!1,onToggleContext:p}){let h=ro(),g=u(()=>{if(!t)return[];let N=[],G=1,R=1,P=t.split(/\r?\n/),k=P.some((x)=>x.startsWith("@@"))?P:[`@@ -0,0 +1,${P.length} @@`,...P.map((x)=>x.startsWith("+")||x.startsWith("-")?x:`+${x}`)];for(let x of k){if(x.startsWith("diff --git")||x.startsWith("index ")||x.startsWith("---")||x.startsWith("+++")||x.startsWith("new file mode")||x.startsWith("deleted file mode")||x.startsWith("similarity index")||x.startsWith("old mode")||x.startsWith("new mode")||x.startsWith("\\ No newline"))continue;if(x.startsWith("@@")){let w=x.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(w)G=parseInt(w[1],10),R=parseInt(w[2],10);N.push({type:"meta",text:x})}else if(x.startsWith("+"))N.push({type:"add",text:x.slice(1),newNum:R++});else if(x.startsWith("-"))N.push({type:"del",text:x.slice(1),oldNum:G++});else{let w=x.startsWith(" ")?x.slice(1):x;N.push({type:"context",text:w,oldNum:G++,newNum:R++})}}return N},[t]),v=pt(l),y=u(()=>{let N=Array(g.length).fill(""),G=-1,R=(P)=>{if(G<0)return;let T=Tu(g.slice(G,P).map((k)=>k.text).join(`
|
|
3
3
|
`),v);for(let k=G;k<P;k++)N[k]=T[k-G]??"";G=-1};return g.forEach((P,T)=>{if(P.type==="meta")R(T);else if(G<0)G=T}),R(g.length),N},[g,v,h]),L=u(()=>r?g.map((N,G)=>({row:N,index:G})):Ft(g),[g,r]);if(c)return e("div",{className:"my-2 p-4 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs flex items-center justify-center",children:"Loading commit diff..."});if(!t||g.length===0)return e("div",{className:"my-2 p-3 rounded bg-canvas border border-ink/10 text-ink/40 font-mono text-xs text-center",children:"No diff content available for this file."});return e("div",{className:"my-2 rounded border border-ink/15 bg-paper overflow-hidden text-[11px] font-mono leading-relaxed shadow-xs text-ink",children:[e("div",{className:"flex items-center justify-between px-3 py-1.5 bg-canvas border-b border-ink/10 text-ink/70 text-[10.5px]",children:[e("span",{className:"font-semibold text-meta",children:"Diff preview"}),e("button",{type:"button",onClick:p,disabled:!p,className:"hover:text-ink flex items-center gap-1 cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-default",title:r?"Show only the changed hunks":"Read the whole file around the change","aria-pressed":r,children:r?e(d,{children:[e(et,{size:12})," Collapse context"]}):e(d,{children:[e(B,{size:12})," Expand all context"]})})]}),e("div",{className:"overflow-x-auto max-h-72 select-text",children:e("div",{className:"w-max min-w-full divide-y divide-ink/[0.04]",children:L.map(({row:N,index:G},R)=>{if(N.type==="elided")return e("div",{className:"px-3 py-1 bg-canvas text-ink/40 text-[10px] text-center select-none",title:`${N.count} unchanged line(s) hidden`,children:["⋯ ",N.count," unchanged line",N.count===1?"":"s"," hidden ⋯"]},`elided-${R}`);let P=N,T=G;if(P.type==="meta")return e("div",{className:"flex items-center gap-2 px-3 py-1 bg-canvas border-y border-ink/10 text-meta text-[10px] font-semibold",children:[e("span",{children:"↕"}),e("span",{children:P.text})]},T);let k=P.type==="add",x=P.type==="del";return e("div",{className:`flex items-start font-mono ${k?"bg-success/10 hover:bg-success/15":x?"bg-error/10 hover:bg-error/15":"text-ink hover:bg-ink/[0.02]"}`,children:[e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${x?"bg-error/15 text-error font-semibold":k?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:P.oldNum??(k?"+":"")}),e("div",{className:`w-10 flex-shrink-0 text-right pr-2 py-0.5 select-none border-r border-ink/10 text-[10px] tabular-nums font-mono ${k?"bg-success/15 text-success font-semibold":x?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:P.newNum??(x?"-":"")}),e("div",{className:`w-4 flex-shrink-0 text-center py-0.5 select-none font-bold ${k?"text-success":x?"text-error":"opacity-0"}`,children:k?"+":x?"-":" "}),e("div",{className:"flex-1 py-0.5 pr-3 whitespace-pre text-ink",children:P.text?e("span",{className:"shiki",dangerouslySetInnerHTML:{__html:y[T]}}):" "})]},T)})})})]})}function ct({commit:t,isSelected:c,isGraphMode:l,onSelect:r,onAction:p,onToggleFile:h,isExpandedFile:g,isLoadingFile:v,isFullContextFile:y,onToggleContext:L,fileDiffs:N,headerRef:G}){let[R,P]=n(!1),[T,k]=n(!1),x=t.body?.trim()??"",w=x.length>0,E=(A)=>{A.stopPropagation(),navigator.clipboard.writeText(t.hash),P(!0),setTimeout(()=>P(!1),2000)},z=(A,H)=>{A.stopPropagation(),h(t.hash,H)};return e("div",{onClick:()=>{if(r(t),!w)return;let A=globalThis.getSelection?.();if(A&&!A.isCollapsed)return;k((H)=>!H)},"data-testid":"commit-row","data-commit-hash":t.hash,className:`border-b border-ink/5 transition-colors cursor-pointer ${c?"bg-ink/[0.03]":"hover:bg-ink/[0.015]"}`,children:e("div",{className:"py-2.5 pr-4 pl-1 flex flex-col",children:[e("div",{className:"flex flex-col gap-1",children:[t.refs&&t.refs.length>0&&e("div",{className:"flex flex-wrap items-center gap-1.5 pb-0.5",children:t.refs.map((A,H)=>{let O=A.includes("stash"),X=A.includes("HEAD")||A.includes("main")||A.includes("master");return e("span",{className:`px-2 py-0.5 rounded text-[10px] font-mono border ${O?"bg-warning/10 text-warning border-warning/25 font-semibold":X?"bg-ink/10 text-ink font-semibold border-ink/20":"bg-canvas text-meta border-ink/10 font-medium"}`,children:A},H)})}),e("div",{ref:G,className:"flex items-start gap-1.5",children:[e("span",{"data-commit-title":"",className:"text-[13px] font-semibold text-ink leading-snug break-words flex-1 min-w-0",children:t.message}),w&&e("span",{className:"text-ink/40 flex-shrink-0 mt-0.5","aria-hidden":"true",children:T?e(B,{size:13}):e(ie,{size:13})})]}),w&&T&&e("div",{className:"text-[12px] text-ink/70 leading-relaxed whitespace-pre-wrap break-words border-l-2 border-ink/15 pl-2.5 py-0.5 font-mono",children:x}),e("div",{className:"flex items-center gap-2 text-[11px] text-ink/50 font-mono flex-wrap",children:[e("span",{children:t.author}),e("span",{children:"•"}),e("span",{children:t.date}),e("span",{children:"•"}),e("button",{type:"button",onClick:E,title:"Copy commit hash",className:"inline-flex items-center gap-1 hover:text-ink transition-colors cursor-pointer text-ink/70",children:[e("span",{children:t.shortHash}),R?e(f,{size:11,className:"text-success"}):e(ae,{size:11})]})]})]}),(c||l)&&e("div",{className:"mt-2",children:e(rt,{commit:t,onAction:p})}),t.files&&t.files.length>0&&e("div",{className:"mt-2 flex flex-col gap-1",children:t.files.map((A,H)=>{let O=g(t.hash,A.file),X=`${t.hash}:${A.file}`,te=N[X]!==void 0?N[X]:A.diff,j=v(t.hash,A.file),K=A.status==="A"?"text-success font-bold":A.status==="D"?"text-error font-bold":A.status==="R"?"text-meta font-bold":"text-info font-bold";return e("div",{className:"flex flex-col",children:[e("div",{onClick:(W)=>z(W,A),className:"flex items-center gap-2 py-1 px-2 rounded hover:bg-ink/5 text-[11.5px] font-mono text-ink/80 transition-colors group cursor-pointer border border-transparent hover:border-ink/10",children:[e("span",{className:`w-3.5 text-center flex-shrink-0 text-[11px] ${K}`,children:A.status||"M"}),e("span",{className:"truncate flex-1 min-w-0 text-ink/90 group-hover:text-ink font-medium",children:A.file}),e("span",{className:"flex items-center gap-1 text-[10.5px] tabular-nums flex-shrink-0 font-medium",children:[e("span",{className:"text-success",children:["+",A.additions]}),e("span",{className:"text-ink/30",children:"/"}),e("span",{className:"text-error",children:["-",A.deletions]})]}),e("span",{className:"text-ink/40 group-hover:text-ink flex-shrink-0",children:O?e(B,{size:13}):e(ie,{size:13})})]}),O&&e("div",{className:"pl-4 pr-1",children:e(lt,{diffText:te,isLoading:j,filePath:A.file,fullContext:y(t.hash,A.file),onToggleContext:()=>L(t.hash,A)})})]},H)})})]})})}var xe=50;function Et(t){if(!Array.isArray(t))return[];let c=[];for(let l of t){if(!l||typeof l!=="object")continue;let r=l;if(typeof r.file!=="string"||!r.file)continue;c.push({file:r.file,status:typeof r.status==="string"?r.status:"M",additions:typeof r.additions==="number"&&Number.isFinite(r.additions)?r.additions:0,deletions:typeof r.deletions==="number"&&Number.isFinite(r.deletions)?r.deletions:0,diff:typeof r.diff==="string"?r.diff:void 0})}return c}function ze(t){if(!Array.isArray(t))return[];let c=[];for(let l of t){if(!l||typeof l!=="object")continue;let r=l,p=typeof r.hash==="string"&&r.hash?r.hash:"";if(!p)continue;c.push({hash:p,shortHash:typeof r.shortHash==="string"&&r.shortHash?r.shortHash:p.slice(0,8),author:typeof r.author==="string"?r.author:"Unknown",date:typeof r.date==="string"?r.date:typeof r.time==="string"?r.time:"",message:typeof r.message==="string"?r.message:"",body:typeof r.body==="string"?r.body:void 0,parents:Array.isArray(r.parents)?r.parents.filter((h)=>typeof h==="string"):[],refs:Array.isArray(r.refs)?r.refs.filter((h)=>typeof h==="string"):[],files:Et(r.files),lane:typeof r.lane==="number"?r.lane:void 0})}return c}function dt({output:t,isGraphMode:c,rootPath:l,activeRepo:r}){let[p,h]=n(!1),[g,v]=n(t?.hasMore??t?.data?.length===xe),[y,L]=n(t?.total),N=u(()=>ze(t?.data),[t?.data]),G=Array.isArray(t?.data)?t.data.length:0,[R,P]=n(N),[T,k]=n(G);i(()=>{if(P(N),k(G),v(t?.hasMore??G===xe),typeof t?.total==="number")L(t.total)},[N,G,t?.hasMore,t?.total]);let x=a(async()=>{if(p||!g)return;h(!0);try{let w=new FormData;if(w.set("actionType",c?"graph":"history"),w.set("limit",String(xe)),w.set("skip",String(T)),l)w.set("root",l);if(r)w.set("repo",r);let z=await(await fetch("/api/fs/git",{method:"POST",body:w})).json();if(z.success&&Array.isArray(z.data)){let I=ze(z.data),A=z.data.length;if(P((H)=>{let O=new Set(H.map((te)=>te.hash)),X=I.filter((te)=>!O.has(te.hash));return[...H,...X]}),k((H)=>H+A),v(Boolean(z.hasMore??A===xe)),typeof z.total==="number")L(z.total)}else v(!1)}catch(w){console.error("Failed to load more commits:",w)}finally{h(!1)}},[p,g,c,T,l,r]);return{commits:R,hasMore:g,totalCount:y,isLoadingMore:p,handleLoadMore:x}}function mt({onExecuteAction:t,rootPath:c,activeRepo:l}){let[r,p]=n({}),[h,g]=n(new Set),[v,y]=n(new Set),[L,N]=n(new Set),G=a(async(k,x,w)=>{let E=`${k}:${x.file}`;y((z)=>new Set(z).add(E));try{let z=new FormData;if(z.set("actionType","commit_diff"),z.set("hash",k),z.set("file",x.file),w)z.set("full","1");if(c)z.set("root",c);if(l&&l!==".")z.set("repo",l);let A=await(await fetch("/api/fs/git",{method:"POST",body:z})).json();if(A&&typeof A.diff==="string")p((H)=>({...H,[E]:A.diff}));else if(A&&A.error)p((H)=>({...H,[E]:`// Error: ${A.error}`}))}catch(z){console.error("Failed to load file diff:",z);let I=z instanceof Error?z.message:"Network error";p((A)=>({...A,[E]:`// Error loading diff: ${I}`}))}finally{y((z)=>{let I=new Set(z);return I.delete(E),I})}},[c,l]),R=a(async(k,x)=>{let w=`${k}:${x.file}`,E=!h.has(w);if(g((z)=>{let I=new Set(z);if(I.has(w))I.delete(w);else I.add(w);return I}),E&&r[w]===void 0&&!x.diff)await G(k,x,!1)},[h,r,G]),P=a(async(k,x)=>{let w=`${k}:${x.file}`,E=!L.has(w);N((z)=>{let I=new Set(z);if(I.has(w))I.delete(w);else I.add(w);return I}),await G(k,x,E)},[L,G]),T=a((k,x)=>{if(!t)return;if(k==="checkout")t("checkout",void 0,{branch:x.hash});else if(k==="create_branch_here"){let w=window.prompt(`Create new branch at commit ${x.shortHash}:`,`branch-${x.shortHash}`);if(w?.trim())t("create_branch_at",void 0,{branch:w.trim(),hash:x.hash})}else if(k==="cherry_pick"){if(window.confirm(`Cherry-pick commit ${x.shortHash} onto current branch?`))t("cherry_pick",void 0,{hash:x.hash})}else if(k==="revert"){if(window.confirm(`Revert commit ${x.shortHash}?`))t("revert_commit",void 0,{hash:x.hash})}else if(k==="reset"){let w=window.prompt(`Reset current branch to ${x.shortHash} (soft, mixed, hard):`,"soft");if(w&&["soft","mixed","hard"].includes(w.toLowerCase()))t("reset_commit",void 0,{hash:x.hash,mode:w.toLowerCase()})}else if(k==="merge"){if(window.confirm(`Merge commit ${x.shortHash} into current branch?`))t("merge_commit",void 0,{hash:x.hash})}else if(k==="rebase"){if(window.confirm(`Rebase current branch onto commit ${x.shortHash}?`))t("rebase_commit",void 0,{hash:x.hash})}},[t]);return{fileDiffs:r,expandedFiles:h,loadingFiles:v,fullContextFiles:L,handleToggleFile:R,handleToggleContext:P,handleCommitAction:T}}function He({output:t,onClose:c,onRefresh:l,onExecuteAction:r,rootPath:p,activeRepo:h}){if(!t)return null;let[g,v]=n(()=>({title:t.title,graph:t.title.toLowerCase().includes("graph")}));if(g.title!==t.title)v({title:t.title,graph:t.title.toLowerCase().includes("graph")});let y=g.graph,L=(U)=>v((_)=>({..._,graph:U})),[N,G]=n(""),[R,P]=n(""),[T,k]=n(!1),{commits:x,hasMore:w,totalCount:E,isLoadingMore:z,handleLoadMore:I}=dt({output:t,isGraphMode:y,rootPath:p,activeRepo:h}),{fileDiffs:A,expandedFiles:H,loadingFiles:O,fullContextFiles:X,handleToggleFile:te,handleToggleContext:j,handleCommitAction:K}=mt({onExecuteAction:r,rootPath:p,activeRepo:h});i(()=>{if(x.length>0&&!R)P(x[0].hash)},[x,R]);let W=u(()=>{if(!N.trim())return x;let U=N.toLowerCase().trim();return x.filter((_)=>_.message.toLowerCase().includes(U)||_.author.toLowerCase().includes(U)||_.shortHash.toLowerCase().includes(U)||_.hash.toLowerCase().includes(U)||_.refs?.some((ee)=>ee.toLowerCase().includes(U)))},[x,N]),ne=o(null),se=o(null),be=o(null),de=o({}),[pe,ve]=n({}),[Se,Pe]=n(800);i(()=>{let U=be.current;if(!U||!w||z||N.trim())return;let _=new IntersectionObserver((ee)=>{if(ee[0].isIntersecting)I()},{root:ne.current,threshold:0.1});return _.observe(U),()=>_.disconnect()},[w,z,N,I]);let re=a(()=>{if(!ne.current||!se.current)return;let U=ne.current.getBoundingClientRect(),_=ne.current.scrollTop,ee={};W.forEach((me,Le)=>{let ue=de.current[me.hash];if(ue){let oe=ue.getBoundingClientRect();ee[me.hash]=oe.top+oe.height/2-U.top+_}else ee[me.hash]=Le*60+20}),ve(ee);let Ce=se.current.offsetHeight;Pe(Math.max(Ce,ne.current.clientHeight,600))},[W]);V(()=>{re();let U=requestAnimationFrame(()=>{re()});return()=>cancelAnimationFrame(U)},[re,W,A,H,y,R]),i(()=>{let U=se.current;if(!U)return;let _=new ResizeObserver(()=>{re()});_.observe(U);for(let ee of Array.from(U.children))_.observe(ee);return()=>_.disconnect()},[re,W]);let Z=u(()=>Re(W),[W]),$e=u(()=>{let U=0;return Z.forEach((_)=>{if(_>U)U=_}),U},[Z]),ye=18,ke=16,Me=y?($e+1)*ye+ke*2:36;return e("div",{className:"fixed inset-0 z-50 modal-scrim backdrop-blur-xs flex items-center justify-center p-0 lg:p-5",onClick:c,role:"dialog","aria-modal":"true",children:e("div",{className:`glass-overlay bg-paper border-ink/20 shadow-2xl flex flex-col overflow-hidden
|
|
4
4
|
w-full h-full rounded-none border-0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d,u,le,e,IA,we,I,B,ie,vr,C,Fs,Fu,Lp,lg,Mp,Pp}from"./index-
|
|
1
|
+
import{d,u,le,e,IA,we,I,B,ie,vr,C,Fs,Fu,Lp,lg,Mp,Pp}from"./index-3wpsr2bc.js";function k({phase:t,index:o,collapsed:a,currentKey:i,onToggle:x}){let m=Mp(t),r=t.tasks.length>0&&m===t.tasks.length;return e("div",{className:"overflow-hidden rounded-lg border border-ink/10 bg-paper",children:[e("button",{type:"button",onClick:x,"aria-expanded":!a,className:"flex w-full items-center gap-1.5 border-b border-ink/8 bg-canvas/40 px-2.5 py-1.5 text-left hover:bg-ink/5",children:[a?e(ie,{size:12,className:"shrink-0 text-ink/40"}):e(B,{size:12,className:"shrink-0 text-ink/40"}),e("span",{className:`min-w-0 flex-1 truncate text-[10px] font-semibold uppercase tracking-wider ${r?"text-ink/35":"text-ink/60"}`,title:t.name,children:[o+1,". ",t.name]}),e("span",{className:"shrink-0 font-mono text-[10px] text-ink/40",children:[m,"/",t.tasks.length]})]}),!a&&e("div",{className:"divide-y divide-ink/[0.05] p-0.5",children:t.tasks.length===0?e("div",{className:"px-2.5 py-1.5 text-[11px] text-ink/40",children:"No tasks in this phase"}):t.tasks.map((l,f)=>e(Pp,{task:l,current:i===`${o}:${f}`},`${f}-${l.content}`))})]})}function j({className:t="",active:o=!0}){let[a]=le(),i=a.get("sessionId"),[x,m]=Fs("todo.collapsedPhases",{}),{data:r,isLoading:l,refreshing:f,stale:g,refresh:b}=we(i?IA(i):null,{enabled:o}),s=r?.snapshot??null,p=r?.progress??null,v=u(()=>{let n=lg(s?.phases??[]);return n?`${n.phase}:${n.task}`:null},[s]);if(!i)return e("div",{className:`flex h-full flex-col items-center justify-center bg-paper text-ink/40 ${t}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e("div",{className:`flex h-full w-full min-w-0 flex-col overflow-hidden bg-paper text-ink ${t}`,children:[e("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 border-b border-ink/10 px-3.5 py-2.5",children:[e("div",{className:"flex min-w-0 items-center gap-2",children:[e("h2",{className:"text-xs font-semibold uppercase tracking-wider text-ink",children:"Todos"}),s&&e("span",{className:"truncate font-mono text-[10.5px] text-ink/50",title:Fu(p),children:Fu(p)}),r?.isMock&&e("span",{className:"flex-shrink-0 rounded border border-ink/15 bg-ink/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-ink/60",children:"Mock"})]}),e("button",{type:"button",onClick:b,disabled:l,title:"Refresh todos","aria-label":"Refresh todos",className:"flex-shrink-0 rounded-md border border-ink/15 bg-paper p-1.5 text-ink/80 transition-colors hover:bg-ink/5 disabled:opacity-50",children:e(C,{size:12,className:l||f?"animate-spin text-ink":""})})]}),p&&p.total>0&&e("div",{className:"flex-shrink-0 border-b border-ink/10 px-3.5 py-2.5",children:e("div",{className:"h-1.5 overflow-hidden rounded-full bg-ink/8",children:e("div",{className:"h-full rounded-full bg-success transition-all duration-300",style:{width:`${Lp(p)}%`}})})}),e("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto scrollbar-overlay-container p-3.5",children:[g&&e("div",{className:"flex items-start gap-2 rounded-lg border border-ink/15 bg-ink/5 px-3 py-2 text-[11px] text-ink/60",children:[e(I,{size:13,className:"mt-[1px] shrink-0"}),e("span",{className:"min-w-0 break-words",children:"Reconnecting: this list may be out of date."})]}),!s?e("div",{className:"flex flex-col items-center justify-center gap-2 py-12 text-center text-ink/40",children:[e(vr,{size:20}),e("p",{className:"max-w-[240px] text-[11.5px] leading-relaxed",children:["No todo list in this session. The agent writes one with the ",e("span",{className:"font-mono",children:"todo"})," tool when a task is worth planning."]})]}):e(d,{children:[s.phases.map((n,c)=>e(k,{phase:n,index:c,collapsed:Boolean(x[String(c)]),currentKey:v,onToggle:()=>m((h)=>({...h,[String(c)]:!h[String(c)]}))},`${c}-${n.name}`)),e("p",{className:"pt-1 text-[10.5px] leading-relaxed text-ink/35",children:["Read from this session's transcript",s.updatedAt?` · updated ${N(s.updatedAt)}`:"",s.source==="custom"?" · edited by hand":"","."]})]})]})]})}function N(t){let o=new Date(t);if(Number.isNaN(o.getTime()))return t;return o.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}export{j as TodoPanel};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n,i,o,u,e,s,hr,br,za,mi,Ur,Fo,Lo,Ai,Hr}from"./index-st202rjv.js";var Ae={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},v=s(Ae);var xe={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},M=s(xe);var Le={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},I=s(Le);var Ee={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},D=s(Ee);var ze={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(ze);var Ze={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},T=s(Ze);var Oe={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Oe);var Ue={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},C=s(Ue);var K={class:{Icon:br,label:"Class"},interface:{Icon:Ai,label:"Interface"},type:{Icon:Hr,label:"Type"},enum:{Icon:Ur,label:"Enum"},function:{Icon:v,label:"Function"},method:{Icon:D,label:"Method"},constant:{Icon:za,label:"Constant"},variable:{Icon:C,label:"Variable"},struct:{Icon:I,label:"Struct"},trait:{Icon:Lo,label:"Trait"},impl:{Icon:M,label:"Impl"},module:{Icon:Fo,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:T,label:"Selector"},key:{Icon:mi,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:hr,label:"Macro"}};function Eu({kind:l,size:r=12}){let{Icon:a}=K[l];return e(a,{size:r,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function qi(l){return K[l].label}var ve={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(l,r){let a=ve[r],[d,t]=a.block??["",""],p=[],c="code",b="";for(let f of l){let m="";for(let k=0;k<f.length;k+=1){let h=f[k],_=f[k+1];if(c==="line"){m+=" ";continue}if(c==="block"){if(t&&h===t[0]&&f.startsWith(t,k)){c="code",m+=" ".repeat(t.length),k+=t.length-1;continue}m+=" ";continue}if(c==="quoted"||c==="template"||c==="triple"){if(h==="\\"){m+=" ",k+=1;continue}if(c==="triple"){if(h===b&&f.startsWith(b.repeat(3),k)){c="code",m+=" ",k+=2;continue}m+=" ";continue}if(m+=" ",h===b)c="code";continue}let g=a.line.find((Re)=>f.startsWith(Re,k));if(g){c="line",m+=" ".repeat(g.length),k+=g.length-1;continue}if(d&&f.startsWith(d,k)){c="block",m+=" ".repeat(d.length),k+=d.length-1;continue}if(a.triple&&h===(_??"")&&h===f[k+2]&&(h==="'"||h==='"')){c="triple",b=h,m+=" ",k+=2;continue}if(a.template&&h==="`"){c="template",b="`",m+=" ";continue}if(a.quotes?.includes(h)){c="quoted",b=h,m+=" ";continue}m+=h}if(c==="line"||c==="quoted")c="code";p.push(m)}return p}function z(l){let r=0;for(let a of l)if(a==="{")r+=1;else if(a==="}")r-=1;return r}var x=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],Me=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ie=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,De=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,L=[{kind:"method",re:Me},{kind:"method",re:Ie},{kind:"variable",re:De}];function P(l,r){let a=A(l,r.mask),d=[],t=0,p=[];for(let c=0;c<a.length;c+=1){let b=a[c].trim(),f=p.length>0&&t===p[p.length-1].depth?p[p.length-1]:null;if(b&&(t===0||f)){let m=a[c].length-a[c].trimStart().length,k=f&&r.members?Te(r.memberRules??[],b):null;if(k)d.push({name:k.name,kind:k.kind,line:c+1,column:m+k.column+1,depth:1});else{let h=f!==null&&$e.has(f.kind),_=Z(r.rules,b,h);if(_){if(d.push({name:_.name,kind:h&&_.kind==="function"?"method":_.kind,line:c+1,column:m+_.column+1,depth:f?1:0}),!h&&(r.scopes??[]).includes(_.kind))p.push({depth:t+1,kind:_.kind})}}}if(t+=z(a[c]),t<=0)t=0,p.length=0;else while(p.length>0&&t<p[p.length-1].depth)p.pop()}return d}var $e=new Set(["class","interface","struct","trait","impl","enum"]);function Z(l,r,a){for(let d of l){if(a&&Ne.has(d.kind))continue;let t=d.re.exec(r),p=t?.[1]?.trim();if(!t||!p)continue;return{name:p,kind:d.kind,column:t.indices?.[1]?.[0]??0}}return null}var Ne=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Te(l,r){for(let a of l){let d=a.re.exec(r),t=d?.[1]?.trim();if(!d||!t||qe.has(t))continue;return{name:t,kind:a.kind,column:d.indices?.[1]?.[0]??0}}return null}var qe=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function H(l,r){let a=A(l,r.mask),d=[],t=[];for(let p=0;p<a.length;p+=1){let c=a[p],b=c.trim();if(!b)continue;let f=c.length-c.trimStart().length;while(t.length>0&&f<=t[t.length-1])t.pop();let m=Z(r.rules,b,!1);if(!m)continue;if(t.length>1){t.push(f);continue}let k=t.length===1;d.push({name:m.name,kind:k&&m.kind==="function"?"method":m.kind,line:p+1,column:f+m.column+1,depth:k?1:0}),t.push(f)}return d}function B(l,r){let a=A(l,r.mask),d=[];for(let t=0;t<a.length;t+=1){let p=a[t],c=p.trim();if(!c)continue;let b=Z(r.rules,c,!1);if(!b)continue;let f=d[d.length-1];if(r.dedupe&&f&&f.name===b.name&&f.kind===b.kind)continue;d.push({name:b.name,kind:b.kind,line:t+1,column:p.length-p.trimStart().length+b.column+1,depth:0})}return d}function j(l){let r=[],a=null;for(let d=0;d<l.length;d+=1){let t=l[d],p=/^\s*(```+|~~~+)/.exec(t);if(p){if(a===null)a=p[1][0];else if(p[1][0]===a)a=null;continue}if(a!==null)continue;let c=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!c)continue;r.push({name:c[2],kind:"heading",line:d+1,column:c[1].length+2,depth:Math.min(c[1].length-1,2)})}return r}function F(l){let r=A(l,"raw"),a=[],d=0;for(let t=0;t<r.length;t+=1){let p=r[t].trim();if(d===1){let c=/^"([^"]+)"\s*:/.exec(p);if(c)a.push({name:c[1],kind:"key",line:t+1,column:r[t].length-r[t].trimStart().length+1,depth:0})}if(d+=z(r[t]),d<0)d=0}return a}var S=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],W=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],Y=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],X=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],G=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],J=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],Q=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],ee=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],te=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],ne=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],se=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],re=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],E=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ie=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],le=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],O=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],ce=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],de=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],ue=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],pe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],R=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],me=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],fe=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],ke=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],w=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var y={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:W},be={typescript:{...y,rules:x,memberRules:L,scopes:["class"]},tsx:{...y,rules:x,memberRules:L,scopes:["class"]},javascript:{...y,rules:x,memberRules:L,scopes:["class"]},jsx:{...y,rules:x,memberRules:L,scopes:["class"]},java:{...y,rules:S},c:{...y,rules:S},cpp:{...y,rules:S},csharp:{...y,rules:S},"objective-c":{...y,rules:S},kotlin:{...y,rules:S},swift:{...y,rules:S},scala:{...y,rules:S},dart:{...y,rules:S},groovy:{...y,rules:S},solidity:{...y,rules:fe},php:{mask:"c",nesting:"braces",rules:G,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:Y},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:ce},protobuf:{mask:"c",nesting:"braces",rules:O,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:O,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:X},lua:{mask:"lua",nesting:"flat",rules:J},elixir:{mask:"hash",nesting:"flat",rules:te},erlang:{mask:"percent",nesting:"flat",rules:ne},haskell:{mask:"hash",nesting:"flat",rules:se,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:re},julia:{mask:"hash",nesting:"flat",rules:oe},r:{mask:"hash",nesting:"flat",rules:ie},clojure:{mask:"lisp",nesting:"flat",rules:E},scheme:{mask:"lisp",nesting:"flat",rules:E},racket:{mask:"lisp",nesting:"flat",rules:E},perl:{mask:"hash",nesting:"flat",rules:me},powershell:{mask:"hash",nesting:"flat",rules:ke},bash:{mask:"hash",nesting:"flat",rules:ee},sql:{mask:"sql",nesting:"flat",rules:le},makefile:{mask:"hash",nesting:"flat",rules:de},dockerfile:{mask:"hash",nesting:"flat",rules:ue},nix:{mask:"hash",nesting:"flat",rules:pe},python:{mask:"python",nesting:"indent",rules:Q},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:w},xml:{mask:"raw",nesting:"flat",rules:w},svg:{mask:"raw",nesting:"flat",rules:w},vue:{mask:"raw",nesting:"flat",rules:w},svelte:{mask:"raw",nesting:"flat",rules:w},astro:{mask:"raw",nesting:"flat",rules:w},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(l,r){let a=be[r];if(!l||!a)return[];let d=l.split(`
|
|
1
|
+
import{n,i,o,u,e,s,hr,br,za,mi,Ur,Fo,Lo,Ai,Hr}from"./index-3wpsr2bc.js";var Ae={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},v=s(Ae);var xe={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},M=s(xe);var Le={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},I=s(Le);var Ee={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},D=s(Ee);var ze={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(ze);var Ze={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},T=s(Ze);var Oe={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Oe);var Ue={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},C=s(Ue);var K={class:{Icon:br,label:"Class"},interface:{Icon:Ai,label:"Interface"},type:{Icon:Hr,label:"Type"},enum:{Icon:Ur,label:"Enum"},function:{Icon:v,label:"Function"},method:{Icon:D,label:"Method"},constant:{Icon:za,label:"Constant"},variable:{Icon:C,label:"Variable"},struct:{Icon:I,label:"Struct"},trait:{Icon:Lo,label:"Trait"},impl:{Icon:M,label:"Impl"},module:{Icon:Fo,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:T,label:"Selector"},key:{Icon:mi,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:hr,label:"Macro"}};function Eu({kind:l,size:r=12}){let{Icon:a}=K[l];return e(a,{size:r,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function qi(l){return K[l].label}var ve={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(l,r){let a=ve[r],[d,t]=a.block??["",""],p=[],c="code",b="";for(let f of l){let m="";for(let k=0;k<f.length;k+=1){let h=f[k],_=f[k+1];if(c==="line"){m+=" ";continue}if(c==="block"){if(t&&h===t[0]&&f.startsWith(t,k)){c="code",m+=" ".repeat(t.length),k+=t.length-1;continue}m+=" ";continue}if(c==="quoted"||c==="template"||c==="triple"){if(h==="\\"){m+=" ",k+=1;continue}if(c==="triple"){if(h===b&&f.startsWith(b.repeat(3),k)){c="code",m+=" ",k+=2;continue}m+=" ";continue}if(m+=" ",h===b)c="code";continue}let g=a.line.find((Re)=>f.startsWith(Re,k));if(g){c="line",m+=" ".repeat(g.length),k+=g.length-1;continue}if(d&&f.startsWith(d,k)){c="block",m+=" ".repeat(d.length),k+=d.length-1;continue}if(a.triple&&h===(_??"")&&h===f[k+2]&&(h==="'"||h==='"')){c="triple",b=h,m+=" ",k+=2;continue}if(a.template&&h==="`"){c="template",b="`",m+=" ";continue}if(a.quotes?.includes(h)){c="quoted",b=h,m+=" ";continue}m+=h}if(c==="line"||c==="quoted")c="code";p.push(m)}return p}function z(l){let r=0;for(let a of l)if(a==="{")r+=1;else if(a==="}")r-=1;return r}var x=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],Me=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ie=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,De=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,L=[{kind:"method",re:Me},{kind:"method",re:Ie},{kind:"variable",re:De}];function P(l,r){let a=A(l,r.mask),d=[],t=0,p=[];for(let c=0;c<a.length;c+=1){let b=a[c].trim(),f=p.length>0&&t===p[p.length-1].depth?p[p.length-1]:null;if(b&&(t===0||f)){let m=a[c].length-a[c].trimStart().length,k=f&&r.members?Te(r.memberRules??[],b):null;if(k)d.push({name:k.name,kind:k.kind,line:c+1,column:m+k.column+1,depth:1});else{let h=f!==null&&$e.has(f.kind),_=Z(r.rules,b,h);if(_){if(d.push({name:_.name,kind:h&&_.kind==="function"?"method":_.kind,line:c+1,column:m+_.column+1,depth:f?1:0}),!h&&(r.scopes??[]).includes(_.kind))p.push({depth:t+1,kind:_.kind})}}}if(t+=z(a[c]),t<=0)t=0,p.length=0;else while(p.length>0&&t<p[p.length-1].depth)p.pop()}return d}var $e=new Set(["class","interface","struct","trait","impl","enum"]);function Z(l,r,a){for(let d of l){if(a&&Ne.has(d.kind))continue;let t=d.re.exec(r),p=t?.[1]?.trim();if(!t||!p)continue;return{name:p,kind:d.kind,column:t.indices?.[1]?.[0]??0}}return null}var Ne=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Te(l,r){for(let a of l){let d=a.re.exec(r),t=d?.[1]?.trim();if(!d||!t||qe.has(t))continue;return{name:t,kind:a.kind,column:d.indices?.[1]?.[0]??0}}return null}var qe=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function H(l,r){let a=A(l,r.mask),d=[],t=[];for(let p=0;p<a.length;p+=1){let c=a[p],b=c.trim();if(!b)continue;let f=c.length-c.trimStart().length;while(t.length>0&&f<=t[t.length-1])t.pop();let m=Z(r.rules,b,!1);if(!m)continue;if(t.length>1){t.push(f);continue}let k=t.length===1;d.push({name:m.name,kind:k&&m.kind==="function"?"method":m.kind,line:p+1,column:f+m.column+1,depth:k?1:0}),t.push(f)}return d}function B(l,r){let a=A(l,r.mask),d=[];for(let t=0;t<a.length;t+=1){let p=a[t],c=p.trim();if(!c)continue;let b=Z(r.rules,c,!1);if(!b)continue;let f=d[d.length-1];if(r.dedupe&&f&&f.name===b.name&&f.kind===b.kind)continue;d.push({name:b.name,kind:b.kind,line:t+1,column:p.length-p.trimStart().length+b.column+1,depth:0})}return d}function j(l){let r=[],a=null;for(let d=0;d<l.length;d+=1){let t=l[d],p=/^\s*(```+|~~~+)/.exec(t);if(p){if(a===null)a=p[1][0];else if(p[1][0]===a)a=null;continue}if(a!==null)continue;let c=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!c)continue;r.push({name:c[2],kind:"heading",line:d+1,column:c[1].length+2,depth:Math.min(c[1].length-1,2)})}return r}function F(l){let r=A(l,"raw"),a=[],d=0;for(let t=0;t<r.length;t+=1){let p=r[t].trim();if(d===1){let c=/^"([^"]+)"\s*:/.exec(p);if(c)a.push({name:c[1],kind:"key",line:t+1,column:r[t].length-r[t].trimStart().length+1,depth:0})}if(d+=z(r[t]),d<0)d=0}return a}var S=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],W=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],Y=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],X=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],G=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],J=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],Q=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],ee=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],te=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],ne=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],se=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],re=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],E=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ie=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],le=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],O=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],ce=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],de=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],ue=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],pe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],R=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],me=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],fe=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],ke=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],w=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var y={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:W},be={typescript:{...y,rules:x,memberRules:L,scopes:["class"]},tsx:{...y,rules:x,memberRules:L,scopes:["class"]},javascript:{...y,rules:x,memberRules:L,scopes:["class"]},jsx:{...y,rules:x,memberRules:L,scopes:["class"]},java:{...y,rules:S},c:{...y,rules:S},cpp:{...y,rules:S},csharp:{...y,rules:S},"objective-c":{...y,rules:S},kotlin:{...y,rules:S},swift:{...y,rules:S},scala:{...y,rules:S},dart:{...y,rules:S},groovy:{...y,rules:S},solidity:{...y,rules:fe},php:{mask:"c",nesting:"braces",rules:G,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:Y},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:ce},protobuf:{mask:"c",nesting:"braces",rules:O,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:O,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:R,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:X},lua:{mask:"lua",nesting:"flat",rules:J},elixir:{mask:"hash",nesting:"flat",rules:te},erlang:{mask:"percent",nesting:"flat",rules:ne},haskell:{mask:"hash",nesting:"flat",rules:se,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:re},julia:{mask:"hash",nesting:"flat",rules:oe},r:{mask:"hash",nesting:"flat",rules:ie},clojure:{mask:"lisp",nesting:"flat",rules:E},scheme:{mask:"lisp",nesting:"flat",rules:E},racket:{mask:"lisp",nesting:"flat",rules:E},perl:{mask:"hash",nesting:"flat",rules:me},powershell:{mask:"hash",nesting:"flat",rules:ke},bash:{mask:"hash",nesting:"flat",rules:ee},sql:{mask:"sql",nesting:"flat",rules:le},makefile:{mask:"hash",nesting:"flat",rules:de},dockerfile:{mask:"hash",nesting:"flat",rules:ue},nix:{mask:"hash",nesting:"flat",rules:pe},python:{mask:"python",nesting:"indent",rules:Q},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:w},xml:{mask:"raw",nesting:"flat",rules:w},svg:{mask:"raw",nesting:"flat",rules:w},vue:{mask:"raw",nesting:"flat",rules:w},svelte:{mask:"raw",nesting:"flat",rules:w},astro:{mask:"raw",nesting:"flat",rules:w},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(l,r){let a=be[r];if(!l||!a)return[];let d=l.split(`
|
|
2
2
|
`);if(a.nesting==="markdown")return j(d);if(a.nesting==="json")return F(d);if(a.nesting==="indent")return H(d,a);if(a.nesting==="flat")return B(d,a);return P(d,a)}function he(l,r){return U(l,r)}var Ce={idle:"No file open in the editor.",loading:"Reading the file…",error:"Could not read this file.","not-a-document":"This tab has no outline.",diff:"Diff tabs have no outline.",ready:"No symbols found."};function ye(l,r){return r??Ce[l]}var _e=8388608;function ge(l){let r=l.length;if(r<=500)return{rows:l,total:r,truncated:!1};return{rows:l.slice(0,500),total:r,truncated:!0}}function Bu(l){return`Showing the first ${500 .toLocaleString()} of ${l.toLocaleString()} symbols.`}function Se(l){if(l<=8388608)return null;return`This file is ${(l/1048576).toFixed(1)} MB — too large to outline.`}var Ke=300;function we(l){return l.length>_e}function Iu({content:l,language:r,state:a,note:d,path:t}){let[p,c]=n({content:l,language:r,path:t}),b=o(t);i(()=>{let h=t!==b.current;if(b.current=t,h||we(l)){c((g)=>g.content===l&&g.language===r?g:{content:l,language:r,path:t});return}let _=window.setTimeout(()=>{c((g)=>g.content===l&&g.language===r?g:{content:l,language:r,path:t})},Ke);return()=>window.clearTimeout(_)},[t,l,r]);let f=u(()=>{if(a!=="ready"||we(p.content))return[];return he(p.content,p.language)},[a,p]),m=u(()=>ge(f),[f]),k=a==="ready"?Se(l.length):null;return{symbols:m.rows,total:m.total,truncated:m.truncated,notice:k??ye(a,d)}}
|
|
3
3
|
export{Eu,qi,Bu,Iu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fa,Ql,Cs,gn,Nl,oi}from"./index-5y0bvq4q.js";function A(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function H(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Al(r){let t,e,n;if(r.length!==2)t=A,e=(a,m)=>A(r(a),m),n=(a,m)=>r(a)-m;else t=r===A||r===H?r:Pr,e=r,n=r;function i(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<0)o=c+1;else p=c}while(o<p)}return o}function u(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<=0)o=c+1;else p=c}while(o<p)}return o}function f(a,m,o=0,p=a.length){let c=i(a,m,o,p-1);return c>o&&n(a[c-1],m)>-n(a[c],m)?c-1:c}return{left:i,center:f,right:u}}function Pr(){return 0}function J(r){return r===null?NaN:+r}var xr=Al(A),{right:jr,left:Zr}=xr,Hr=Al(J).center,yr=jr;var Fr=Math.sqrt(50),zr=Math.sqrt(10),Dr=Math.sqrt(2);function I(r,t,e){let n=(t-r)/Math.max(0,e),i=Math.floor(Math.log10(n)),u=n/Math.pow(10,i),f=u>=Fr?10:u>=zr?5:u>=Dr?2:1,a,m,o;if(i<0){if(o=Math.pow(10,-i)/f,a=Math.round(r*o),m=Math.round(t*o),a/o<r)++a;if(m/o>t)--m;o=-o}else{if(o=Math.pow(10,i)*f,a=Math.round(r/o),m=Math.round(t/o),a*o<r)++a;if(m*o>t)--m}if(m<a&&0.5<=e&&e<2)return I(r,t,e*2);return[a,m,o]}function K(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];let n=t<r,[i,u,f]=n?I(t,r,e):I(r,t,e);if(!(u>=i))return[];let a=u-i+1,m=Array(a);if(n)if(f<0)for(let o=0;o<a;++o)m[o]=(u-o)/-f;else for(let o=0;o<a;++o)m[o]=(u-o)*f;else if(f<0)for(let o=0;o<a;++o)m[o]=(i+o)/-f;else for(let o=0;o<a;++o)m[o]=(i+o)*f;return m}function T(r,t,e){return t=+t,r=+r,e=+e,I(r,t,e)[2]}function du(r,t,e){t=+t,r=+r,e=+e;let n=t<r,i=n?T(t,r,e):T(r,t,e);return(n?-1:1)*(i<0?1/-i:i)}function Q(r,t){if(!t)t=[];var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(u){for(i=0;i<e;++i)n[i]=r[i]*(1-u)+t[i]*u;return n}}function Mr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function wr(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=Array(n),u=Array(e),f;for(f=0;f<n;++f)i[f]=b(r[f],t[f]);for(;f<e;++f)u[f]=t[f];return function(a){for(f=0;f<n;++f)u[f]=i[f](a);return u}}function W(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function _(r,t){var e={},n={},i;if(r===null||typeof r!=="object")r={};if(t===null||typeof t!=="object")t={};for(i in t)if(i in r)e[i]=b(r[i],t[i]);else n[i]=t[i];return function(u){for(i in e)n[i]=e[i](u);return n}}function b(r,t){var e=typeof t,n;return t==null||e==="boolean"?Ql(t):(e==="number"?gn:e==="string"?(n=Fa(t))?(t=n,Cs):Nl:t instanceof Fa?Cs:t instanceof Date?W:Mr(t)?Q:Array.isArray(t)?wr:typeof t.valueOf!=="function"&&typeof t.toString!=="function"||isNaN(t)?_:gn)(r,t)}function rr(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function tr(r){return Math.abs(r=Math.round(r))>=1000000000000000000000?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function S(r,t){if(!isFinite(r)||r===0)return null;var e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"),n=r.slice(0,e);return[n.length>1?n[0]+n.slice(2):n,+r.slice(e+1)]}function g(r){return r=S(Math.abs(r)),r?r[1]:NaN}function nr(r,t){return function(e,n){var i=e.length,u=[],f=0,a=r[0],m=0;while(i>0&&a>0){if(m+a+1>n)a=Math.max(1,n-m);if(u.push(e.substring(i-=a,i+a)),(m+=a+1)>n)break;a=r[f=(f+1)%r.length]}return u.reverse().join(t)}}function er(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var Er=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(r){if(!(t=Er.exec(r)))throw Error("invalid format: "+r);var t;return new C({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}w.prototype=C.prototype;function C(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}C.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ir(r){r:for(var t=r.length,e=1,n=-1,i;e<t;++e)switch(r[e]){case".":n=i=e;break;case"0":if(n===0)n=e;i=e;break;default:if(!+r[e])break r;if(n>0)n=0;break}return n>0?r.slice(0,n)+r.slice(i+1):r}var z;function or(r,t){var e=S(r,t);if(!e)return z=void 0,r.toPrecision(t);var n=e[0],i=e[1],u=i-(z=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=n.length;return u===f?n:u>f?n+Array(u-f+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+Array(1-u).join("0")+S(r,Math.max(0,t+u-1))[0]}function q(r,t){var e=S(r,t);if(!e)return r+"";var n=e[0],i=e[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}var fr={"%":(r,t)=>(r*100).toFixed(t),b:(r)=>Math.round(r).toString(2),c:(r)=>r+"",d:tr,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:(r)=>Math.round(r).toString(8),p:(r,t)=>q(r*100,t),r:q,s:or,X:(r)=>Math.round(r).toString(16).toUpperCase(),x:(r)=>Math.round(r).toString(16)};function V(r){return r}var Nr=Array.prototype.map,kr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ar(r){var t=r.grouping===void 0||r.thousands===void 0?V:nr(Nr.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",n=r.currency===void 0?"":r.currency[1]+"",i=r.decimal===void 0?".":r.decimal+"",u=r.numerals===void 0?V:er(Nr.call(r.numerals,String)),f=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",m=r.nan===void 0?"NaN":r.nan+"";function o(c,d){c=w(c);var M=c.fill,j=c.align,x=c.sign,F=c.symbol,D=c.zero,Y=c.width,Z=c.comma,N=c.precision,pr=c.trim,s=c.type;if(s==="n")Z=!0,s="g";else if(!fr[s])N===void 0&&(N=12),pr=!0,s="g";if(D||M==="0"&&j==="=")D=!0,M="0",j="=";var br=(d&&d.prefix!==void 0?d.prefix:"")+(F==="$"?e:F==="#"&&/[boxX]/.test(s)?"0"+s.toLowerCase():""),Sr=(F==="$"?n:/[%p]/.test(s)?f:"")+(d&&d.suffix!==void 0?d.suffix:""),sr=fr[s],vr=/[defgprs%]/.test(s);N=N===void 0?6:/[gprs]/.test(s)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function hr(l){var k=br,h=Sr,v,gr,E;if(s==="c")h=sr(l)+h,l="";else{l=+l;var L=l<0||1/l<0;if(l=isNaN(l)?m:sr(Math.abs(l),N),pr)l=ir(l);if(L&&+l===0&&x!=="+")L=!1;if(k=(L?x==="("?x:a:x==="-"||x==="("?"":x)+k,h=(s==="s"&&!isNaN(l)&&z!==void 0?kr[8+z/3]:"")+h+(L&&x==="("?")":""),vr){v=-1,gr=l.length;while(++v<gr)if(E=l.charCodeAt(v),48>E||E>57){h=(E===46?i+l.slice(v+1):l.slice(v))+h,l=l.slice(0,v);break}}}if(Z&&!D)l=t(l,1/0);var R=k.length+l.length+h.length,y=R<Y?Array(Y-R+1).join(M):"";if(Z&&D)l=t(y+l,y.length?Y-h.length:1/0),y="";switch(j){case"<":l=k+l+h+y;break;case"=":l=k+y+l+h;break;case"^":l=y.slice(0,R=y.length>>1)+k+l+h+y.slice(R);break;default:l=y+k+l+h;break}return u(l)}return hr.toString=function(){return c+""},hr}function p(c,d){var M=Math.max(-8,Math.min(8,Math.floor(g(d)/3)))*3,j=Math.pow(10,-M),x=o((c=w(c),c.type="f",c),{suffix:kr[8+M/3]});return function(F){return x(j*F)}}return{format:o,formatPrefix:p}}var B,Ya,G;ur({thousands:",",grouping:[3],currency:["$",""]});function ur(r){return B=ar(r),Ya=B.format,G=B.formatPrefix,B}function O(r){return Math.max(0,-g(Math.abs(r)))}function X(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(t)/3)))*3-g(Math.abs(r)))}function U(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,g(t)-g(r))+1}function mr(r){return function(){return r}}function cr(r){return+r}var Ar=[0,1];function P(r){return r}function lr(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:mr(isNaN(t)?NaN:0.5)}function Lr(r,t){var e;if(r>t)e=r,r=t,t=e;return function(n){return Math.max(r,Math.min(t,n))}}function Rr(r,t,e){var n=r[0],i=r[1],u=t[0],f=t[1];if(i<n)n=lr(i,n),u=e(f,u);else n=lr(n,i),u=e(u,f);return function(a){return u(n(a))}}function Ir(r,t,e){var n=Math.min(r.length,t.length)-1,i=Array(n),u=Array(n),f=-1;if(r[n]<r[0])r=r.slice().reverse(),t=t.slice().reverse();while(++f<n)i[f]=lr(r[f],r[f+1]),u[f]=e(t[f],t[f+1]);return function(a){var m=yr(r,a,1,n)-1;return u[m](i[m](a))}}function fd(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function Tr(){var r=Ar,t=Ar,e=b,n,i,u,f=P,a,m,o;function p(){var d=Math.min(r.length,t.length);if(f!==P)f=Lr(r[0],r[d-1]);return a=d>2?Ir:Rr,m=o=null,c}function c(d){return d==null||isNaN(d=+d)?u:(m||(m=a(r.map(n),t,e)))(n(f(d)))}return c.invert=function(d){return f(i((o||(o=a(t,r.map(n),gn)))(d)))},c.domain=function(d){return arguments.length?(r=Array.from(d,cr),p()):r.slice()},c.range=function(d){return arguments.length?(t=Array.from(d),p()):t.slice()},c.rangeRound=function(d){return t=Array.from(d),e=rr,p()},c.clamp=function(d){return arguments.length?(f=d?!0:P,p()):f!==P},c.interpolate=function(d){return arguments.length?(e=d,p()):e},c.unknown=function(d){return arguments.length?(u=d,c):u},function(d,M){return n=d,i=M,p()}}function pu(){return Tr()(P,P)}function dr(r,t,e,n){var i=du(r,t,e),u;switch(n=w(n==null?",f":n),n.type){case"s":{var f=Math.max(Math.abs(r),Math.abs(t));if(n.precision==null&&!isNaN(u=X(i,f)))n.precision=u;return G(n,f)}case"":case"e":case"g":case"p":case"r":{if(n.precision==null&&!isNaN(u=U(i,Math.max(Math.abs(r),Math.abs(t)))))n.precision=u-(n.type==="e");break}case"f":case"%":{if(n.precision==null&&!isNaN(u=O(i)))n.precision=u-(n.type==="%")*2;break}}return Ya(n)}function $r(r){var t=r.domain;return r.ticks=function(e){var n=t();return K(n[0],n[n.length-1],e==null?10:e)},r.tickFormat=function(e,n){var i=t();return dr(i[0],i[i.length-1],e==null?10:e,n)},r.nice=function(e){if(e==null)e=10;var n=t(),i=0,u=n.length-1,f=n[i],a=n[u],m,o,p=10;if(a<f)o=f,f=a,a=o,o=i,i=u,u=o;while(p-- >0){if(o=T(f,a,e),o===m)return n[i]=f,n[u]=a,t(n);else if(o>0)f=Math.floor(f/o)*o,a=Math.ceil(a/o)*o;else if(o<0)f=Math.ceil(f*o)/o,a=Math.floor(a*o)/o;else break;m=o}return r},r}function na(){var r=pu();return r.copy=function(){return fd(r,na())},oi.apply(r,arguments),$r(r)}
|
|
1
|
+
import{Fa,Ql,Cs,gn,Nl,oi}from"./index-zj45wj1x.js";function A(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function H(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Al(r){let t,e,n;if(r.length!==2)t=A,e=(a,m)=>A(r(a),m),n=(a,m)=>r(a)-m;else t=r===A||r===H?r:Pr,e=r,n=r;function i(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<0)o=c+1;else p=c}while(o<p)}return o}function u(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<=0)o=c+1;else p=c}while(o<p)}return o}function f(a,m,o=0,p=a.length){let c=i(a,m,o,p-1);return c>o&&n(a[c-1],m)>-n(a[c],m)?c-1:c}return{left:i,center:f,right:u}}function Pr(){return 0}function J(r){return r===null?NaN:+r}var xr=Al(A),{right:jr,left:Zr}=xr,Hr=Al(J).center,yr=jr;var Fr=Math.sqrt(50),zr=Math.sqrt(10),Dr=Math.sqrt(2);function I(r,t,e){let n=(t-r)/Math.max(0,e),i=Math.floor(Math.log10(n)),u=n/Math.pow(10,i),f=u>=Fr?10:u>=zr?5:u>=Dr?2:1,a,m,o;if(i<0){if(o=Math.pow(10,-i)/f,a=Math.round(r*o),m=Math.round(t*o),a/o<r)++a;if(m/o>t)--m;o=-o}else{if(o=Math.pow(10,i)*f,a=Math.round(r/o),m=Math.round(t/o),a*o<r)++a;if(m*o>t)--m}if(m<a&&0.5<=e&&e<2)return I(r,t,e*2);return[a,m,o]}function K(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];let n=t<r,[i,u,f]=n?I(t,r,e):I(r,t,e);if(!(u>=i))return[];let a=u-i+1,m=Array(a);if(n)if(f<0)for(let o=0;o<a;++o)m[o]=(u-o)/-f;else for(let o=0;o<a;++o)m[o]=(u-o)*f;else if(f<0)for(let o=0;o<a;++o)m[o]=(i+o)/-f;else for(let o=0;o<a;++o)m[o]=(i+o)*f;return m}function T(r,t,e){return t=+t,r=+r,e=+e,I(r,t,e)[2]}function du(r,t,e){t=+t,r=+r,e=+e;let n=t<r,i=n?T(t,r,e):T(r,t,e);return(n?-1:1)*(i<0?1/-i:i)}function Q(r,t){if(!t)t=[];var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(u){for(i=0;i<e;++i)n[i]=r[i]*(1-u)+t[i]*u;return n}}function Mr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function wr(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=Array(n),u=Array(e),f;for(f=0;f<n;++f)i[f]=b(r[f],t[f]);for(;f<e;++f)u[f]=t[f];return function(a){for(f=0;f<n;++f)u[f]=i[f](a);return u}}function W(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function _(r,t){var e={},n={},i;if(r===null||typeof r!=="object")r={};if(t===null||typeof t!=="object")t={};for(i in t)if(i in r)e[i]=b(r[i],t[i]);else n[i]=t[i];return function(u){for(i in e)n[i]=e[i](u);return n}}function b(r,t){var e=typeof t,n;return t==null||e==="boolean"?Ql(t):(e==="number"?gn:e==="string"?(n=Fa(t))?(t=n,Cs):Nl:t instanceof Fa?Cs:t instanceof Date?W:Mr(t)?Q:Array.isArray(t)?wr:typeof t.valueOf!=="function"&&typeof t.toString!=="function"||isNaN(t)?_:gn)(r,t)}function rr(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function tr(r){return Math.abs(r=Math.round(r))>=1000000000000000000000?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function S(r,t){if(!isFinite(r)||r===0)return null;var e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"),n=r.slice(0,e);return[n.length>1?n[0]+n.slice(2):n,+r.slice(e+1)]}function g(r){return r=S(Math.abs(r)),r?r[1]:NaN}function nr(r,t){return function(e,n){var i=e.length,u=[],f=0,a=r[0],m=0;while(i>0&&a>0){if(m+a+1>n)a=Math.max(1,n-m);if(u.push(e.substring(i-=a,i+a)),(m+=a+1)>n)break;a=r[f=(f+1)%r.length]}return u.reverse().join(t)}}function er(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var Er=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(r){if(!(t=Er.exec(r)))throw Error("invalid format: "+r);var t;return new C({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}w.prototype=C.prototype;function C(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}C.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ir(r){r:for(var t=r.length,e=1,n=-1,i;e<t;++e)switch(r[e]){case".":n=i=e;break;case"0":if(n===0)n=e;i=e;break;default:if(!+r[e])break r;if(n>0)n=0;break}return n>0?r.slice(0,n)+r.slice(i+1):r}var z;function or(r,t){var e=S(r,t);if(!e)return z=void 0,r.toPrecision(t);var n=e[0],i=e[1],u=i-(z=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=n.length;return u===f?n:u>f?n+Array(u-f+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+Array(1-u).join("0")+S(r,Math.max(0,t+u-1))[0]}function q(r,t){var e=S(r,t);if(!e)return r+"";var n=e[0],i=e[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}var fr={"%":(r,t)=>(r*100).toFixed(t),b:(r)=>Math.round(r).toString(2),c:(r)=>r+"",d:tr,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:(r)=>Math.round(r).toString(8),p:(r,t)=>q(r*100,t),r:q,s:or,X:(r)=>Math.round(r).toString(16).toUpperCase(),x:(r)=>Math.round(r).toString(16)};function V(r){return r}var Nr=Array.prototype.map,kr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ar(r){var t=r.grouping===void 0||r.thousands===void 0?V:nr(Nr.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",n=r.currency===void 0?"":r.currency[1]+"",i=r.decimal===void 0?".":r.decimal+"",u=r.numerals===void 0?V:er(Nr.call(r.numerals,String)),f=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",m=r.nan===void 0?"NaN":r.nan+"";function o(c,d){c=w(c);var M=c.fill,j=c.align,x=c.sign,F=c.symbol,D=c.zero,Y=c.width,Z=c.comma,N=c.precision,pr=c.trim,s=c.type;if(s==="n")Z=!0,s="g";else if(!fr[s])N===void 0&&(N=12),pr=!0,s="g";if(D||M==="0"&&j==="=")D=!0,M="0",j="=";var br=(d&&d.prefix!==void 0?d.prefix:"")+(F==="$"?e:F==="#"&&/[boxX]/.test(s)?"0"+s.toLowerCase():""),Sr=(F==="$"?n:/[%p]/.test(s)?f:"")+(d&&d.suffix!==void 0?d.suffix:""),sr=fr[s],vr=/[defgprs%]/.test(s);N=N===void 0?6:/[gprs]/.test(s)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function hr(l){var k=br,h=Sr,v,gr,E;if(s==="c")h=sr(l)+h,l="";else{l=+l;var L=l<0||1/l<0;if(l=isNaN(l)?m:sr(Math.abs(l),N),pr)l=ir(l);if(L&&+l===0&&x!=="+")L=!1;if(k=(L?x==="("?x:a:x==="-"||x==="("?"":x)+k,h=(s==="s"&&!isNaN(l)&&z!==void 0?kr[8+z/3]:"")+h+(L&&x==="("?")":""),vr){v=-1,gr=l.length;while(++v<gr)if(E=l.charCodeAt(v),48>E||E>57){h=(E===46?i+l.slice(v+1):l.slice(v))+h,l=l.slice(0,v);break}}}if(Z&&!D)l=t(l,1/0);var R=k.length+l.length+h.length,y=R<Y?Array(Y-R+1).join(M):"";if(Z&&D)l=t(y+l,y.length?Y-h.length:1/0),y="";switch(j){case"<":l=k+l+h+y;break;case"=":l=k+y+l+h;break;case"^":l=y.slice(0,R=y.length>>1)+k+l+h+y.slice(R);break;default:l=y+k+l+h;break}return u(l)}return hr.toString=function(){return c+""},hr}function p(c,d){var M=Math.max(-8,Math.min(8,Math.floor(g(d)/3)))*3,j=Math.pow(10,-M),x=o((c=w(c),c.type="f",c),{suffix:kr[8+M/3]});return function(F){return x(j*F)}}return{format:o,formatPrefix:p}}var B,Ya,G;ur({thousands:",",grouping:[3],currency:["$",""]});function ur(r){return B=ar(r),Ya=B.format,G=B.formatPrefix,B}function O(r){return Math.max(0,-g(Math.abs(r)))}function X(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(t)/3)))*3-g(Math.abs(r)))}function U(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,g(t)-g(r))+1}function mr(r){return function(){return r}}function cr(r){return+r}var Ar=[0,1];function P(r){return r}function lr(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:mr(isNaN(t)?NaN:0.5)}function Lr(r,t){var e;if(r>t)e=r,r=t,t=e;return function(n){return Math.max(r,Math.min(t,n))}}function Rr(r,t,e){var n=r[0],i=r[1],u=t[0],f=t[1];if(i<n)n=lr(i,n),u=e(f,u);else n=lr(n,i),u=e(u,f);return function(a){return u(n(a))}}function Ir(r,t,e){var n=Math.min(r.length,t.length)-1,i=Array(n),u=Array(n),f=-1;if(r[n]<r[0])r=r.slice().reverse(),t=t.slice().reverse();while(++f<n)i[f]=lr(r[f],r[f+1]),u[f]=e(t[f],t[f+1]);return function(a){var m=yr(r,a,1,n)-1;return u[m](i[m](a))}}function fd(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function Tr(){var r=Ar,t=Ar,e=b,n,i,u,f=P,a,m,o;function p(){var d=Math.min(r.length,t.length);if(f!==P)f=Lr(r[0],r[d-1]);return a=d>2?Ir:Rr,m=o=null,c}function c(d){return d==null||isNaN(d=+d)?u:(m||(m=a(r.map(n),t,e)))(n(f(d)))}return c.invert=function(d){return f(i((o||(o=a(t,r.map(n),gn)))(d)))},c.domain=function(d){return arguments.length?(r=Array.from(d,cr),p()):r.slice()},c.range=function(d){return arguments.length?(t=Array.from(d),p()):t.slice()},c.rangeRound=function(d){return t=Array.from(d),e=rr,p()},c.clamp=function(d){return arguments.length?(f=d?!0:P,p()):f!==P},c.interpolate=function(d){return arguments.length?(e=d,p()):e},c.unknown=function(d){return arguments.length?(u=d,c):u},function(d,M){return n=d,i=M,p()}}function pu(){return Tr()(P,P)}function dr(r,t,e,n){var i=du(r,t,e),u;switch(n=w(n==null?",f":n),n.type){case"s":{var f=Math.max(Math.abs(r),Math.abs(t));if(n.precision==null&&!isNaN(u=X(i,f)))n.precision=u;return G(n,f)}case"":case"e":case"g":case"p":case"r":{if(n.precision==null&&!isNaN(u=U(i,Math.max(Math.abs(r),Math.abs(t)))))n.precision=u-(n.type==="e");break}case"f":case"%":{if(n.precision==null&&!isNaN(u=O(i)))n.precision=u-(n.type==="%")*2;break}}return Ya(n)}function $r(r){var t=r.domain;return r.ticks=function(e){var n=t();return K(n[0],n[n.length-1],e==null?10:e)},r.tickFormat=function(e,n){var i=t();return dr(i[0],i[i.length-1],e==null?10:e,n)},r.nice=function(e){if(e==null)e=10;var n=t(),i=0,u=n.length-1,f=n[i],a=n[u],m,o,p=10;if(a<f)o=f,f=a,a=o,o=i,i=u,u=o;while(p-- >0){if(o=T(f,a,e),o===m)return n[i]=f,n[u]=a,t(n);else if(o>0)f=Math.floor(f/o)*o,a=Math.ceil(a/o)*o;else if(o<0)f=Math.ceil(f*o)/o,a=Math.floor(a*o)/o;else break;m=o}return r},r}function na(){var r=pu();return r.copy=function(){return fd(r,na())},oi.apply(r,arguments),$r(r)}
|
|
2
2
|
export{Al,du,Ya,fd,pu,na};
|