@openscout/scout 0.2.70 → 0.2.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +59 -3
  3. package/bin/openscout-runtime.mjs +23 -2
  4. package/bin/scout +34 -0
  5. package/bin/scout.mjs +195 -18
  6. package/bin/scoutd +0 -0
  7. package/dist/client/apple-touch-icon.png +0 -0
  8. package/dist/client/assets/RepoDiffViewer-D8gg36W3.js +56 -0
  9. package/dist/client/assets/{addon-fit-BNV7JPhj.js → addon-fit-D4KdY-pj.js} +1 -1
  10. package/dist/client/assets/{addon-webgl-B-_Y5L3F.js → addon-webgl-Bo_tmKBp.js} +1 -1
  11. package/dist/client/assets/arc.es-D0gujIKy.js +188 -0
  12. package/dist/client/assets/embed-entry-CUVNwyB_.js +1 -0
  13. package/dist/client/assets/index-CRkjiso5.js +257 -0
  14. package/dist/client/assets/index-D_RX2cRb.css +1 -0
  15. package/dist/client/assets/{xterm-Cx1oABPt.js → xterm-RfflDFod.js} +1 -1
  16. package/dist/client/favicon-16.png +0 -0
  17. package/dist/client/favicon-32.png +0 -0
  18. package/dist/client/favicon.ico +0 -0
  19. package/dist/client/favicon.svg +48 -0
  20. package/dist/client/index.html +42 -2
  21. package/dist/client/openscout-icon.png +0 -0
  22. package/dist/client/site.webmanifest +19 -0
  23. package/dist/client/web-app-icon-192.png +0 -0
  24. package/dist/client/web-app-icon-512.png +0 -0
  25. package/dist/drizzle/0000_curly_iron_monger.sql +592 -0
  26. package/dist/drizzle/0001_invocation-status-columns.sql +7 -0
  27. package/dist/drizzle/0002_invocation-flight-metadata.sql +21 -0
  28. package/dist/drizzle/README.md +81 -0
  29. package/dist/drizzle/meta/0000_snapshot.json +4575 -0
  30. package/dist/drizzle/meta/0001_snapshot.json +4624 -0
  31. package/dist/drizzle/meta/0002_snapshot.json +4631 -0
  32. package/dist/drizzle/meta/_journal.json +27 -0
  33. package/dist/main.mjs +77080 -60152
  34. package/dist/node/main.mjs +7607 -0
  35. package/dist/openscout-terminal-relay.mjs +3830 -152
  36. package/dist/{pair-supervisor.mjs → pairing-runtime-controller.mjs} +50837 -41212
  37. package/dist/runtime/base-daemon.mjs +2219 -488
  38. package/dist/runtime/broker-daemon.mjs +39082 -25118
  39. package/dist/runtime/broker-process-manager.mjs +2048 -392
  40. package/dist/runtime/mesh-discover.mjs +2012 -391
  41. package/dist/scout-control-plane-web.mjs +58128 -34736
  42. package/dist/scout-web-server.mjs +58128 -34736
  43. package/dist/statusline.mjs +287 -0
  44. package/package.json +8 -4
  45. package/dist/client/assets/index-BJri_z5a.css +0 -1
  46. package/dist/client/assets/index-Ccjo5BZz.js +0 -199
@@ -0,0 +1,56 @@
1
+ import{e as ue,r as o,j as n,C as fe,f as he,L as me,S as pe,g as xe,X as ge,M as be,h as je,i as V,P as ye,k as te,l as q,m as ne,n as re,p as we}from"./index-CRkjiso5.js";const ke=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],ve=ue("file-code-corner",ke),Ne=["branch","unstaged","staged"],se={unstaged:"Unstaged",staged:"Staged",branch:"Branch"},$e={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C",typechange:"T",conflict:"!",unknown:"?"};function W(e){return e.newPath??e.oldPath??"(unknown)"}function ie(e){const t=e.split("/"),r=t[t.length-1]||e,s=t.slice(0,-1).join("/");return{name:r,dir:s}}function K(e,t){return`${e.oldPath??""}→${e.newPath??""}#${t}`}function Ce(e){return e.files.reduce((t,r)=>({add:t.add+(r.additions??0),del:t.del+(r.deletions??0)}),{add:0,del:0})}function G(e,t,r=null){return{fetchedAt:e.fetchedAt,cacheHit:!0,refreshing:t,refreshError:r}}function Se(e,t){return{fetchedAt:e.fetchedAt,cacheHit:e.cacheHit,refreshing:t,refreshError:null}}function Pe({snapshot:e,selectedFile:t,targets:r,targetId:s,onTargetId:i,draft:c,onDraft:u,contextItems:l,onRemoveContextItem:d,pending:a,status:f,error:b,textareaRef:k,onSubmit:v}){const[m,N]=o.useState(!1),j=o.useRef(null),w=r.find(x=>x.id===s)??null,h=w?.label??"Scout",y=r[0]?.id??null,P=t?W(t):null,I=(c.trim().length>0||l.length>0)&&!a,D=o.useMemo(()=>[...r.map(x=>({id:x.id,label:x.label,suffix:x.id===y?"best context":null})),{id:"scout",label:"Scout",suffix:null}],[y,r]);return o.useEffect(()=>{if(!m)return;const x=$=>{const g=j.current;g&&$.target instanceof Node&&g.contains($.target)||N(!1)};return document.addEventListener("pointerdown",x),()=>document.removeEventListener("pointerdown",x)},[m]),n.jsxs("div",{className:"rd-comment",children:[l.length>0?n.jsx("div",{className:"rd-comment-context","aria-label":"Included diff context",children:l.map(x=>n.jsx(Le,{item:x,disabled:a,onRemove:d},x.id))}):null,n.jsxs("div",{className:"rd-comment-main",children:[n.jsxs("div",{className:"rd-target-picker",ref:j,children:[n.jsxs("button",{type:"button",className:"rd-target-button",onClick:()=>N(x=>!x),onKeyDown:x=>{x.stopPropagation(),x.key==="Escape"&&N(!1)},disabled:a,"aria-label":"Diff comment target","aria-haspopup":"listbox","aria-expanded":m,title:"Diff comment target",children:[n.jsx("span",{children:h}),n.jsx(fe,{size:13,strokeWidth:2,"aria-hidden":!0})]}),m?n.jsx("div",{className:"rd-target-menu",role:"listbox","aria-label":"Diff comment target",children:D.map(x=>{const $=x.id===(w?.id??"scout");return n.jsxs("button",{type:"button",className:"rd-target-option",role:"option","aria-selected":$,onClick:()=>{i(x.id),N(!1)},children:[n.jsx("span",{className:"rd-target-option-label",children:x.label}),x.suffix?n.jsx("span",{className:"rd-target-option-suffix",children:x.suffix}):null,n.jsx("span",{className:"rd-target-option-check","aria-hidden":!0,children:$?n.jsx(he,{size:12,strokeWidth:2.2}):null})]},x.id)})}):null]}),n.jsx("textarea",{ref:k,value:c,onChange:x=>u(x.currentTarget.value),onKeyDown:x=>{x.stopPropagation(),(x.metaKey||x.ctrlKey)&&x.key==="Enter"&&(x.preventDefault(),v())},rows:1,disabled:a,placeholder:l.length>0?`Steer ${h} with included context`:"Leave a note on this diff…","aria-label":"Diff comment"}),n.jsxs("button",{type:"button",className:"rd-comment-send",disabled:!I,onClick:v,title:"Send diff comment","aria-label":"Send diff comment",children:[a?n.jsx(me,{size:13,className:"rd-comment-spin","aria-hidden":!0}):n.jsx(pe,{size:13,"aria-hidden":!0}),n.jsx("span",{children:a?"Sending":"Send"})]})]}),n.jsx("div",{className:"rd-comment-meta",children:b?n.jsx("span",{className:"err",children:b}):f?n.jsx("span",{className:"ok",children:f}):n.jsxs("span",{children:[e.scope?.kind==="session"?"Session diff":"Worktree diff",P?` · ${P}`:""]})})]})}function Le({item:e,disabled:t,onRemove:r}){const s=e.kind==="file"?ve:xe;return n.jsxs("div",{className:`rd-context-item ${e.kind}`,children:[n.jsxs("div",{className:"rd-context-head",children:[n.jsx("span",{className:"rd-context-icon","aria-hidden":!0,children:n.jsx(s,{size:12,strokeWidth:2})}),n.jsx("span",{className:"rd-context-label",title:e.label,children:e.label}),n.jsx("span",{className:"rd-context-detail",children:e.detail}),n.jsx("button",{type:"button",className:"rd-context-remove",onClick:()=>r(e.id),disabled:t,title:"Remove included context","aria-label":"Remove included context",children:n.jsx(ge,{size:11,strokeWidth:2.2,"aria-hidden":!0})})]}),e.preview?n.jsx("pre",{className:"rd-context-preview",children:e.preview}):null]})}function Re({heading:e,worktreePath:t,snapshot:r,freshness:s,activeLayer:i,onLayer:c,layout:u,onLayout:l,refreshing:d,onRefresh:a,onFocusComment:f,onClose:b,onOpenAsPage:k}){const{dir:v}=ie(t);return n.jsxs("div",{className:"rd-header",children:[n.jsxs("div",{className:"rd-header-id",children:[n.jsxs("div",{className:"rd-header-title",children:[n.jsx("span",{className:"rd-header-name",title:t,children:e}),r.scope?n.jsx(Ee,{snapshot:r}):null,v?n.jsx("span",{className:"rd-header-dir",children:v}):null]}),n.jsx("div",{className:"rd-header-sub",children:n.jsx(Fe,{layers:r.layers,activeLayer:i,onLayer:c})}),n.jsx(De,{freshness:s,generatedAt:r.generatedAt})]}),n.jsxs("div",{className:"rd-header-actions",children:[n.jsx("button",{type:"button",className:"rd-close","aria-label":"Comment on diff",title:"Comment on diff",onClick:f,children:n.jsx(be,{size:14,strokeWidth:2,"aria-hidden":!0})}),n.jsxs("div",{className:"rd-segmented",role:"group","aria-label":"Diff layout",children:[n.jsx("button",{type:"button",className:u==="unified"?"on":"","aria-pressed":u==="unified",onClick:()=>l("unified"),children:"Unified"}),n.jsx("button",{type:"button",className:u==="split"?"on":"","aria-pressed":u==="split",onClick:()=>l("split"),children:"Split"})]}),n.jsx("button",{type:"button",className:`rd-close${d?" spinning":""}`,"aria-label":"Refresh diff",title:"Fetch fresh diff",onClick:a,disabled:d,children:n.jsx(je,{size:14,strokeWidth:2,"aria-hidden":!0})}),k?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Open diff as page",title:"Open as full page",onClick:k,children:"↗"}):null,b?n.jsx("button",{type:"button",className:"rd-close","aria-label":"Close",onClick:b,children:"✕"}):null]})]})}function Ie({snapshot:e}){const t=[];e.coverage.truncatedLayers>0&&t.push({level:"warning",text:`${e.coverage.truncatedLayers} layer${e.coverage.truncatedLayers===1?"":"s"} truncated — the native diff hit a size budget; some files or hunks are omitted.`}),e.coverage.scanBudgetReached&&t.push({level:"warning",text:"Scan budget reached — this diff is partial."});for(const r of e.diagnostics)t.push({level:r.level,text:r.path?`${r.message} (${r.path})`:r.message});return t.length===0?null:n.jsx(n.Fragment,{children:t.map((r,s)=>n.jsxs("div",{className:`rd-banner ${r.level}`,children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:r.text})]},s))})}function Ee({snapshot:e}){const t=e.scope;if(!t)return null;const r=t.kind==="session"?`Session · ${t.filteredPaths.length} files`:t.filteredPaths.length>0?`Filtered · ${t.filteredPaths.length} files`:"Worktree",s=t.kind==="session"?`${t.label}: path-filtered diff from ${t.changedFiles} changed / ${t.touchedFiles} touched session files`:t.label;return n.jsx("span",{className:`rd-scope-pill ${t.kind}`,title:s,children:r})}function De({freshness:e,generatedAt:t}){const r=e?.fetchedAt??t,s=Math.max(0,Date.now()-r),i=e?.cacheHit?`Prefetched ${V(s)}`:`Updated ${V(s)}`;return n.jsxs("div",{className:"rd-freshness",title:new Date(r).toLocaleString(),children:[n.jsx("span",{children:i}),e?.refreshing?n.jsx("span",{children:"Refreshing…"}):null,e?.refreshError?n.jsx("span",{children:"Refresh failed"}):null]})}function Fe({layers:e,activeLayer:t,onLayer:r}){return n.jsx("div",{className:"rd-layers",role:"tablist","aria-label":"Diff layers",children:e.map(s=>{const i=Ce(s);return n.jsxs("button",{type:"button",role:"tab","aria-selected":s.kind===t,className:"rd-layer-tab"+(s.kind===t?" on":""),onClick:()=>r(s.kind),title:s.shortstat??void 0,children:[n.jsx("span",{children:se[s.kind]??s.kind}),n.jsx("span",{className:"rd-layer-stat",children:s.files.length===0?"clean":n.jsxs(n.Fragment,{children:[s.files.length,"f"," ",n.jsxs("span",{style:{color:"var(--rd-add)"},children:["+",i.add]})," ",n.jsxs("span",{style:{color:"var(--rd-del)"},children:["−",i.del]}),s.truncated?" ⚠":""]})})]},s.kind)})})}function H({className:e,children:t}){return n.jsx("div",{className:e?`rd-viewer ${e}`:"rd-viewer","data-scout-theme":!0,children:t})}function M({children:e}){return n.jsx("div",{className:"rd-center",children:n.jsx("div",{className:"rd-center-card",children:e})})}function X(e){const t=e.trim();return!t||t==="/dev/null"?null:t.startsWith("a/")||t.startsWith("b/")?t.slice(2):t}function Me(e,t){return[t.newPath,t.oldPath].filter(s=>!!s).includes(e)}function Te(e,t){if(!e?.rawPatch)return[];const r=[];let s=null,i=null,c=null,u=null;for(const l of e.rawPatch.split(`
2
+ `)){if(l.startsWith("diff --git ")){s=null,i=null,c=null,u=null;continue}if(l.startsWith("--- ")){s=X(l.slice(4));continue}if(l.startsWith("+++ ")){i=X(l.slice(4));continue}const d=/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/.exec(l);if(d){c=Number(d[1]),u=Number(d[2]);continue}if(c==null||u==null)continue;const a=i??s;a&&(t&&!Me(a,t)||(l.startsWith("+")?(r.push({layer:e.kind,filePath:a,side:"add",oldLine:null,newLine:u,text:l.slice(1)}),u+=1):l.startsWith("-")?(r.push({layer:e.kind,filePath:a,side:"del",oldLine:c,newLine:null,text:l.slice(1)}),c+=1):l.startsWith(" ")&&(r.push({layer:e.kind,filePath:a,side:"context",oldLine:c,newLine:u,text:l.slice(1)}),c+=1,u+=1)))}return r}function Ae(e){return e.newLine!=null?`L${e.newLine}`:e.oldLine!=null?`old L${e.oldLine}`:"line"}function We(e,t=160){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-1)}…`:r}function _e(e){const{line:t}=e,r=t.side==="add"?"+":t.side==="del"?"-":" ";return`[Diff line: ${t.layer} · ${t.filePath}:${Ae(t)} · ${r} ${We(t.text)}]`}function He(e){const{selection:t}=e;return[`[Diff selection: ${[t.layer??"diff",t.filePath].filter(Boolean).join(" · ")||"diff"}]`,t.text.trim(),"[/Diff selection]"].join(`
3
+ `)}function Y(e){const t=window.getSelection(),r=t?.toString().trim()??"";if(!t||!r||!e.root)return null;const s=t.anchorNode,i=t.focusNode;return s&&!e.root.contains(s)||i&&!e.root.contains(i)?null:{layer:e.activeLayer,filePath:e.selectedFile?W(e.selectedFile):null,text:r}}const Be="1.2.7",B=`https://esm.sh/@pierre/diffs@${Be}`,U={base:`${B}?external=react,react-dom`,react:`${B}/react?external=react,react-dom`,worker:`${B}/worker/worker.js`},ae=["typescript","tsx","javascript","jsx","json","markdown","rust","swift","shellscript","yaml","css","html"];function Ke(){return import(U.react)}function ze(){return import(U.base)}let A=null;function J(){return A||(A=(async()=>{const e="react",t="react-dom/client",[r,s,i,c]=await Promise.all([Ke(),ze(),import(e),import(t)]),u=d=>typeof d=="function"||typeof d=="object"&&d!==null;if(!u(r?.CodeView)||!u(r?.WorkerPoolContextProvider)||typeof s?.parsePatchFiles!="function"||typeof i?.createElement!="function"||typeof c?.createRoot!="function")throw new Error(`Pierre loaded from ${B} but the expected exports are missing.`);const l=()=>{const d=`import ${JSON.stringify(U.worker)};`,a=URL.createObjectURL(new Blob([d],{type:"text/javascript"})),f=new Worker(a,{type:"module"});return URL.revokeObjectURL(a),f};return{CodeView:r.CodeView,PatchDiff:r.PatchDiff,WorkerPoolContextProvider:r.WorkerPoolContextProvider,parsePatchFiles:s.parsePatchFiles,preloadHighlighter:s.preloadHighlighter,workerFactory:l,createElement:i.createElement,createRoot:c.createRoot}})(),A.catch(()=>{A=null}),A)}let _=null;function Oe(e,t){return _||(_=e.preloadHighlighter({themes:[t],langs:[...ae]}).catch(()=>{_=null}),_)}function Ue(e,t,r){return e.parsePatchFiles(t,r,!0)}const Ve=`
4
+ [data-line-type="change-addition"]:is(
5
+ :where([data-background]) [data-line],
6
+ :where([data-background]) [data-no-newline]
7
+ ),
8
+ [data-line-type="change-deletion"]:is(
9
+ :where([data-background]) [data-line],
10
+ :where([data-background]) [data-no-newline]
11
+ ) {
12
+ --mix-light: var(--rd-diff-line-mix-light, 94%);
13
+ --mix-dark: var(--rd-diff-line-mix-dark, 92%);
14
+ }
15
+
16
+ [data-line-type="change-addition"]:is(
17
+ :where([data-background]) [data-gutter-buffer],
18
+ :where([data-background]) [data-column-number]
19
+ ) {
20
+ --mix-light: var(--rd-diff-gutter-mix-light, 76%);
21
+ --mix-dark: var(--rd-diff-gutter-mix-dark, 72%);
22
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
23
+ }
24
+
25
+ [data-line-type="change-deletion"]:is(
26
+ :where([data-background]) [data-gutter-buffer],
27
+ :where([data-background]) [data-column-number]
28
+ ) {
29
+ --mix-light: var(--rd-diff-gutter-mix-light, 76%);
30
+ --mix-dark: var(--rd-diff-gutter-mix-dark, 72%);
31
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
32
+ }
33
+
34
+ [data-column-number]:is(
35
+ [data-indicators="bars"] [data-line-type="change-addition"],
36
+ [data-indicators="bars"] [data-line-type="change-deletion"]
37
+ )::before {
38
+ width: var(--rd-diff-spine-width, 6px);
39
+ }
40
+
41
+ [data-column-number]:is([data-indicators="bars"] [data-line-type="change-addition"])::before {
42
+ background-color: var(--diffs-addition-base);
43
+ }
44
+
45
+ [data-column-number]:is([data-indicators="bars"] [data-line-type="change-deletion"])::before {
46
+ background-color: var(--diffs-deletion-base);
47
+ background-image: none;
48
+ }
49
+ `;function Q(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function qe(e){const t=e,r=t?.type==="diff"?t.fileDiff:null;return[r?.name,r?.prevName].filter(s=>typeof s=="string"&&s.length>0)}function le(e,t,r){return r==="additions"?e.newLine===t:r==="deletions"?e.oldLine===t:e.newLine===t||e.oldLine===t}function Ge(e,t,r){return e.findIndex(s=>le(s,t,r))}function Xe(e,t,r){for(let s=e.length-1;s>=0;s-=1)if(le(e[s],t,r))return s;return-1}function Ye(e){return e.map(t=>{const r=t.side==="add"?"+":t.side==="del"?"-":" ",s=t.newLine??t.oldLine,i=s!=null?`${s}: `:"";return`${r} ${i}${t.text}`}).join(`
50
+ `)}function Je({range:e,item:t,lineContexts:r}){if(!e)return null;const s=Q(e.start),i=Q(e.end);if(s==null||i==null)return null;const c=qe(t),u=r.filter(k=>c.length===0||c.includes(k.filePath)),l=Ge(u,s,e.side),d=Xe(u,i,e.endSide??e.side);if(l<0||d<0)return null;const a=Math.min(l,d),f=Math.max(l,d),b=u.slice(a,f+1);return b.length>0?b:null}function Qe(e){return{layer:e[0]?.layer??null,filePath:e[0]?.filePath??null,text:Ye(e)}}function Ze(e,t){const r=e.createRoot(t);let s=null;const i=c=>{s=c};return{render({items:c,theme:u,layout:l,lineContexts:d=[],onIncludeLineContext:a,onIncludeSelectionContext:f}){r.render(e.createElement(e.WorkerPoolContextProvider,{poolOptions:{workerFactory:e.workerFactory},highlighterOptions:{theme:u,langs:[...ae]}},e.createElement(e.CodeView,{className:"rd-codeview",items:c,options:{theme:u,diffStyle:l,diffIndicators:"bars",stickyHeaders:!0,unsafeCSS:Ve,enableGutterUtility:!!a,enableLineSelection:!!f,lineHoverHighlight:"number",onGutterUtilityClick:(b,k)=>{const v=Je({range:b,item:k,lineContexts:d});if(v){if(v.length===1&&a){a(v[0]);return}f&&f(Qe(v))}}},ref:i})))},scrollToItem(c,u="smooth"){s?.scrollTo({type:"item",id:c,align:"start",behavior:u})},unmount(){r.unmount()}}}function et({layer:e,patchLayer:t,patchPhase:r,patchError:s,selectedFileKey:i,renderKey:c,theme:u,layout:l,pierre:d,pierrePhase:a,pierreError:f,onRetryPierre:b,onIncludeLineContext:k,onIncludeSelectionContext:v}){const m=o.useRef(null),[N,j]=o.useState(null),w=o.useMemo(()=>e?e.files.find((g,L)=>K(g,L)===i)??null:null,[e,i]),h=t??e,y=o.useMemo(()=>{if(!d||!h||!h.rawPatch)return null;try{const g=`${c}:${h.kind}:${h.patchOid}`,L=Ue(d,h.rawPatch,g),C=[];return L.forEach((E,R)=>{E.files.forEach((p,S)=>{C.push({id:`${g}:${R}:${S}:${p.name}`,type:"diff",fileDiff:p})})}),{ok:!0,items:C,patches:L}}catch(g){return{ok:!1,error:g instanceof Error?g.message:String(g)}}},[d,h,c]),P=o.useMemo(()=>{if(!y||!y.ok||!w)return null;const g=[w.newPath,w.oldPath].filter(L=>!!L);for(const L of y.items){const C=L.fileDiff?.name;if(C&&g.includes(C))return L.id}return null},[y,w]),I=o.useMemo(()=>Te(h,w),[h,w]),D=o.useCallback(()=>{const g=Y({activeLayer:e?.kind??null,selectedFile:w,root:m.current});g&&(v(g),window.getSelection()?.removeAllRanges(),j(null))},[e?.kind,v,w]),x=o.useCallback(()=>{const g=m.current,L=Y({activeLayer:e?.kind??null,selectedFile:w,root:g});if(!g||!L){j(null);return}const C=window.getSelection(),R=(C?.rangeCount?C.getRangeAt(0):null)?.getBoundingClientRect();if(!R||R.width===0&&R.height===0){j(null);return}const p=g.getBoundingClientRect(),S=Math.max(8,g.clientWidth-132),F=Math.max(8,g.clientHeight-36);j({left:Math.min(Math.max(R.right-p.left+8,8),S),top:Math.min(Math.max(R.top-p.top-2,8),F)})},[e?.kind,w]);if(o.useEffect(()=>{const g=()=>{requestAnimationFrame(x)};return document.addEventListener("selectionchange",g),()=>{document.removeEventListener("selectionchange",g)}},[x]),!e)return n.jsx("div",{className:"rd-surface",children:n.jsx(M,{children:n.jsx("div",{className:"rd-center-title",children:"No layer selected"})})});if(e.files.length===0)return n.jsx("div",{className:"rd-surface",children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-center-title",children:"Nothing to diff"}),n.jsxs("div",{className:"rd-center-body",children:["The ",se[e.kind]??e.kind.toLowerCase()," layer is clean."]})]})});if(r==="loading"||r==="idle"&&w)return n.jsx("div",{className:"rd-surface",children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-spinner","aria-hidden":!0}),n.jsx("div",{className:"rd-center-title",children:"Loading selected file…"}),n.jsx("div",{className:"rd-center-body",children:"Fetching a path-filtered patch chunk for this file."})]})});if(r==="error"&&!t)return n.jsx("div",{className:"rd-surface",children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-center-title",children:"Couldn’t load this file"}),n.jsx("div",{className:"rd-center-body",children:s??"The path-filtered patch request failed."})]})});if(a==="loading")return n.jsx("div",{className:"rd-surface",children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-spinner","aria-hidden":!0}),n.jsx("div",{className:"rd-center-title",children:"Loading the diff renderer…"}),n.jsx("div",{className:"rd-center-body",children:"Fetching Pierre Diffs + Shiki (first open only)."})]})});if(a==="error"||!d)return n.jsxs("div",{className:"rd-surface",children:[n.jsxs("div",{className:"rd-banner warning",children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsxs("span",{children:["The diff renderer failed to load",f?`: ${f}`:"."," Showing raw patch text."]})]}),n.jsx("div",{className:"rd-surface-scroll",children:n.jsx(Z,{layer:h??e,onRetry:b})})]});if(!h?.rawPatch||!y)return n.jsx("div",{className:"rd-surface",children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-center-title",children:"No patch text available"}),n.jsx("div",{className:"rd-center-body",children:e.truncated?"This layer was truncated by the native diff budget; file summaries are shown in the rail.":"The summary is loaded. Select a file to fetch its patch text."})]})});if(!y.ok)return n.jsxs("div",{className:"rd-surface",children:[n.jsxs("div",{className:"rd-banner warning",children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsxs("span",{children:["Couldn’t parse the patch (",y.error,"). Showing raw text."]})]}),n.jsx("div",{className:"rd-surface-scroll",children:n.jsx(Z,{layer:h})})]});const $=h.files.filter(g=>g.truncated).length;return n.jsxs("div",{className:"rd-surface",ref:m,children:[r==="error"&&t?n.jsxs("div",{className:"rd-banner warning",children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:s??"Couldn’t refresh this file; showing the cached chunk."})]}):null,h.truncated||$>0?n.jsxs("div",{className:"rd-banner warning",children:[n.jsx("span",{className:"rd-banner-dot","aria-hidden":!0}),n.jsx("span",{children:h.truncated?"This layer was truncated; some files or hunks are omitted.":`${$} file${$===1?"":"s"} truncated.`})]}):null,N?n.jsx("button",{type:"button",className:"rd-selection-context-chip",style:{left:N.left,top:N.top},onMouseDown:g=>g.preventDefault(),onClick:D,children:"+ selection"}):null,n.jsx("div",{className:"rd-surface-scroll",onMouseUp:x,onKeyUp:x,children:n.jsx(tt,{pierre:d,items:y.items,theme:u,layout:l,scrollToItemId:P,lineContexts:I,onIncludeLineContext:k,onIncludeSelectionContext:v})})]})}function tt({pierre:e,items:t,theme:r,layout:s,scrollToItemId:i,lineContexts:c,onIncludeLineContext:u,onIncludeSelectionContext:l}){const d=o.useRef(null),a=o.useRef(null);return o.useEffect(()=>{if(!d.current)return;const f=Ze(e,d.current);return a.current=f,()=>{a.current=null,setTimeout(()=>f.unmount(),0)}},[e]),o.useEffect(()=>{a.current?.render({items:t,theme:r,layout:s,lineContexts:c,onIncludeLineContext:u,onIncludeSelectionContext:l})},[t,r,s,c,u,l]),o.useEffect(()=>{if(!i)return;const f=requestAnimationFrame(()=>{a.current?.scrollToItem(i)});return()=>cancelAnimationFrame(f)},[i]),n.jsx("div",{ref:d,className:"rd-codeview-host"})}function Z({layer:e,onRetry:t}){return n.jsxs("div",{style:{padding:"var(--space-lg)"},children:[t?n.jsx("div",{className:"rd-center-action",style:{marginTop:0,marginBottom:"var(--space-md)"},children:n.jsx("button",{type:"button",className:"rd-btn",onClick:t,children:"Retry renderer"})}):null,n.jsx("pre",{style:{margin:0,whiteSpace:"pre",fontFamily:"var(--rd-mono)",fontSize:"var(--text-xs)",lineHeight:1.5,color:"var(--ink)"},children:e.rawPatch??"(no patch text)"})]})}const oe="openscout.repo-diff.files-rail-width",ee=268,nt=196,rt=520;function st(e,t){if(e.length<=t)return e;const r=e.lastIndexOf(".");if(r<=0){const d=Math.max(1,Math.floor((t-1)/2)),a=t-d-1;return e.slice(0,d)+"…"+e.slice(-Math.max(1,a))}const s=e.slice(0,r),i=e.slice(r),c=t-i.length-1;if(c<2){const d=Math.max(1,t-i.length-1);return s.slice(0,d)+"…"+i}const u=Math.max(1,Math.floor(c/2)),l=Math.max(1,c-u);return s.slice(0,u)+"…"+s.slice(-l)+i}function it(e,t){return Math.max(8,Math.floor((e-178-t*14)/6.7))}function z(e){return Math.max(nt,Math.min(rt,Math.round(e)))}function at(){if(typeof window>"u")return ee;const e=Number(window.localStorage.getItem(oe));return Number.isFinite(e)?z(e):ee}function lt(e){const t={name:"",path:"",firstIndex:Number.MAX_SAFE_INTEGER,children:new Map,files:[]};for(const r of e){t.firstIndex=Math.min(t.firstIndex,r.index);const s=r.dir?r.dir.split("/").filter(Boolean):[];let i=t;for(const c of s){const u=i.path?`${i.path}/${c}`:c;let l=i.children.get(c);l||(l={name:c,path:u,firstIndex:r.index,children:new Map,files:[]},i.children.set(c,l)),l.firstIndex=Math.min(l.firstIndex,r.index),i=l}i.files.push(r)}return t}function ce(e){let t=e.files.length;for(const r of e.children.values())t+=ce(r);return t}function ot({layer:e,selectedFileKey:t,onSelect:r,onIncludeFile:s}){const[i,c]=o.useState(at),[u,l]=o.useState(()=>new Set),d=o.useMemo(()=>(e?.files??[]).map((m,N)=>{const j=K(m,N),w=W(m),{name:h,dir:y}=ie(w),P=(m.status==="renamed"||m.status==="copied")&&m.oldPath&&m.newPath&&m.oldPath!==m.newPath;return{file:m,index:N,key:j,display:w,name:h,dir:y,renamed:!!P}}),[e]),a=o.useMemo(()=>lt(d),[d]),f=o.useCallback(m=>{l(N=>{const j=new Set(N);return j.has(m)?j.delete(m):j.add(m),j})},[]),b=o.useCallback(m=>{m.preventDefault();const N=m.clientX,j=i,w=y=>{c(z(j+y.clientX-N))},h=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",h),c(y=>{const P=z(y);return window.localStorage.setItem(oe,String(P)),P})};window.addEventListener("pointermove",w),window.addEventListener("pointerup",h,{once:!0})},[i]),k=(m,N)=>n.jsx(ct,{entry:m,depth:N,railWidth:i,selected:m.key===t,onSelect:r,onIncludeFile:s},m.key),v=(m,N)=>{const j=[],w=[...m.children.values()].sort((h,y)=>h.firstIndex!==y.firstIndex?h.firstIndex-y.firstIndex:h.name.localeCompare(y.name));for(const h of w){const y=u.has(h.path);j.push(n.jsxs("button",{type:"button",className:"rd-dir-row",style:{paddingLeft:12+N*14},onClick:()=>f(h.path),title:h.path,children:[n.jsx("span",{className:"rd-dir-caret",children:y?"›":"⌄"}),n.jsx("span",{className:"rd-dir-name",children:h.name}),n.jsx("span",{className:"rd-dir-count",children:ce(h)})]},`dir:${h.path}`)),y||j.push(...v(h,N+1))}for(const h of m.files)j.push(k(h,N));return j};return n.jsxs("div",{className:"rd-rail",style:{width:i},children:[n.jsx("div",{className:"rd-rail-head",children:e?`Changed files · ${e.files.length}`:"Changed files"}),n.jsx("div",{className:"rd-rail-list",children:v(a,0)}),n.jsx("div",{className:"rd-rail-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file navigation",onPointerDown:b})]})}function ct({entry:e,depth:t,railWidth:r,selected:s,onSelect:i,onIncludeFile:c}){const{file:u,key:l,display:d,name:a,dir:f,renamed:b}=e,k=it(r,t),v=st(a,k);return n.jsxs("div",{className:"rd-file-row"+(s?" on":""),title:b?`${u.oldPath} → ${u.newPath}`:d,children:[n.jsxs("button",{type:"button",className:"rd-file-pick",style:{paddingLeft:18+t*14},onClick:()=>i(l),children:[n.jsx("span",{className:`rd-file-glyph ${u.status}`,children:$e[u.status]}),n.jsxs("span",{className:"rd-file-id",children:[n.jsx("span",{className:"rd-file-name",children:v}),n.jsx("span",{className:"rd-file-dir",children:b?`${u.oldPath} → ${f||a}`:f}),n.jsx(dt,{file:u})]})]}),n.jsx("span",{className:"rd-file-churn",children:u.binary?n.jsx("span",{className:"add",style:{color:"var(--muted)"},children:"bin"}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"add",children:["+",u.additions??0]}),n.jsxs("span",{className:"del",children:["−",u.deletions??0]})]})}),n.jsx("button",{type:"button",className:"rd-file-include",onClick:m=>{m.stopPropagation(),c(u,l)},"aria-label":`Include ${d} in comment`,title:"Include in comment",children:n.jsx(ye,{size:12,strokeWidth:2,"aria-hidden":!0})})]})}function dt({file:e}){const t=[];return e.binary&&t.push("BINARY"),e.truncated&&t.push("TRUNCATED"),e.status==="conflict"&&t.push("CONFLICT"),t.length===0?null:n.jsx("span",{className:"rd-file-tags",children:t.map(r=>n.jsx("span",{className:"rd-file-tag",children:r},r))})}function ut(e){switch(e?.trim().toLowerCase()){case"active":case"working":case"running":case"in_turn":return 80;case"queued":case"waiting":case"waking":case"in_flight":return 50;case"idle":case"available":return 25;case"offline":case"retired":case"stale":return-40;default:return 0}}function ft(e){return e.newPath??e.oldPath??"(unknown)"}function de(e){const t=e.scope?.kind==="session"?e.scope.agentId:null,r=new Map;for(const s of e.scout.hints)s.agentId&&r.set(s.agentId,(r.get(s.agentId)??0)+1);return e.scout.agents.map(s=>({id:s.id,label:te(s),score:ut(s.state)+(s.id===t?1e3:0)+(r.get(s.id)??0)*10})).sort((s,i)=>{const c=i.score-s.score;return c!==0?c:s.label.localeCompare(i.label)})}function ht(e){return de(e)[0]??null}function mt(e){const t=e.files.reduce((r,s)=>({add:r.add+(s.additions??0),del:r.del+(s.deletions??0)}),{add:0,del:0});return`${e.kind}: ${e.files.length} file${e.files.length===1?"":"s"}, +${t.add} -${t.del}${e.truncated?", truncated":""}`}function O(e){const t=e.binary?"binary":`+${e.additions??0} -${e.deletions??0}`;return`${e.status}: ${ft(e)} (${t}${e.truncated?", truncated":""})`}function pt(e){const t=e.scope;return t?t.kind==="session"?`session ${t.sessionId??t.refId??"(unknown)"} (${t.changedFiles} changed / ${t.touchedFiles} touched files, ${t.include})`:t.filteredPaths.length>0?`filtered worktree (${t.filteredPaths.length} paths)`:"worktree":"worktree"}function xt(e){const{comment:t,includedContext:r=[],snapshot:s,activeLayer:i,selectedFile:c}=e,l=((i?s.layers.find(f=>f.kind===i)??null:null)?.files??s.layers.flatMap(f=>f.files)).slice(0,12).map(O),d=s.scout.agents.map(f=>te(f)).slice(0,8),a=["Operator comment on repo diff:",t,"","Repo Diff context:",`- Worktree: ${s.worktreePath}`,`- Scope: ${pt(s)}`,`- Active layer: ${i??"none"}`];return r.length>0&&a.splice(3,0,"Included diff context:",...r.map(f=>f.trim()).filter(Boolean),""),c&&a.push(`- Selected file: ${O(c)}`),a.push(`- Layers: ${s.layers.map(mt).join("; ")}`),d.length>0&&a.push(`- Attached agents: ${d.join(", ")}`),s.scout.sessions.length>0&&a.push(`- Sessions: ${s.scout.sessions.map(f=>f.id).slice(0,8).join(", ")}`),l.length>0&&a.push(`- Changed files: ${l.join(", ")}`),s.diagnostics.length>0&&a.push(`- Diagnostics: ${s.diagnostics.map(f=>f.message).join("; ")}`),a.join(`
51
+ `)}function gt(e){const{snapshot:t,activeLayer:r,file:s}=e,i=[r??"diff",O(s)];return t.scope?.kind==="session"&&i.push(`session ${t.scope.sessionId??t.scope.refId??"scope"}`),`[Diff context: ${i.join(" · ")}]`}function bt(e,t,r){return!e||!t?null:e.files.find((s,i)=>r(s,i)===t)??null}function jt(e,t=120){const r=e.replace(/\s+/g," ").trim();return r.length>t?`${r.slice(0,t-3)}...`:r}function yt(e,t=7){const r=e.trimEnd().split(`
52
+ `),s=r.slice(0,t),i=r.length-s.length;return i>0?`${s.join(`
53
+ `)}
54
+ ... ${i} more line${i===1?"":"s"}`:s.join(`
55
+ `)}function wt(e){return e.newLine!=null?`L${e.newLine}`:e.oldLine!=null?`old L${e.oldLine}`:"line"}function kt(e){return e.side==="add"?"+":e.side==="del"?"-":" "}function vt(e){const{snapshot:t,activeLayer:r,file:s}=e,i=W(s),c=s.binary?"binary":`+${s.additions??0} -${s.deletions??0}`;return{id:`file:${r??"diff"}:${i}`,kind:"file",label:i,detail:`${r??"diff"} · ${s.status} · ${c}`,preview:null,snippet:gt({snapshot:t,activeLayer:r,file:s})}}function Nt(e){const{line:t}=e,r=kt(t);return{id:`line:${t.layer}:${t.filePath}:${t.side}:${t.oldLine??""}:${t.newLine??""}`,kind:"line",label:`${t.filePath}:${wt(t)}`,detail:`${t.layer} · ${r}`,preview:`${r} ${jt(t.text,180)}`,snippet:_e({line:t})}}function $t(e){const{selection:t}=e,r=t.filePath??"diff selection",s=t.text.trim().split(`
56
+ `).filter(Boolean).length;return{id:`selection:${t.layer??"diff"}:${r}:${t.text}`,kind:"selection",label:r,detail:`${t.layer??"diff"} · ${s} line${s===1?"":"s"}`,preview:yt(t.text),snippet:He({selection:t})}}function Ct({snapshot:e,activeLayer:t,selectedFile:r,setSelectedFileKey:s,resetKey:i}){const[c,u]=o.useState(""),[l,d]=o.useState([]),[a,f]=o.useState("scout"),[b,k]=o.useState(!1),[v,m]=o.useState(!1),[N,j]=o.useState(null),[w,h]=o.useState(null),y=o.useRef(null),P=o.useMemo(()=>e?de(e):[],[e]),I=o.useMemo(()=>e?ht(e):null,[e]);o.useEffect(()=>{u(""),d([]),k(!1),j(null),h(null)},[i]),o.useEffect(()=>{f(p=>b&&p==="scout"||P.some(S=>S.id===p)?p:I?.id??"scout")},[b,P,I?.id]);const D=o.useCallback(p=>{u(p),j(null),h(null)},[]),x=o.useCallback(p=>{k(!0),f(p)},[]),$=o.useCallback(p=>{d(S=>S.some(F=>F.id===p.id)?S:[...S,p]),j(null),h(null),queueMicrotask(()=>y.current?.focus())},[]),g=o.useCallback(p=>{d(S=>S.filter(F=>F.id!==p)),j(null),h(null)},[]),L=o.useCallback(async()=>{const p=c.trim();if(!p&&l.length===0||v||!e)return;const S=P.find(T=>T.id===a)??null,F=xt({comment:p||"Please review the included diff context.",includedContext:l.map(T=>T.snippet),snapshot:e,activeLayer:t,selectedFile:r});m(!0),j(null),h(null);try{S?(await q("/api/ask",{method:"POST",body:JSON.stringify({body:F,targetAgentId:S.id,targetLabel:S.label,metadata:{source:"repo-diff",originSurface:"repo-diff",handoffKind:"repo-diff-comment",targetAgentId:S.id,worktreePath:e.worktreePath,activeLayer:t,selectedFile:r?W(r):null,scopeKind:e.scope?.kind??"worktree"}})}),j(`Sent to ${S.label}`)):(await q("/api/send",{method:"POST",body:JSON.stringify({body:F})}),j("Sent to Scout")),u(""),d([])}catch(T){h(T instanceof Error?T.message:String(T))}finally{m(!1)}},[t,l,c,v,a,P,r,e]),C=o.useCallback((p,S)=>{e&&(s(S),$(vt({snapshot:e,activeLayer:t,file:p})))},[t,$,s,e]),E=o.useCallback(p=>{e&&$(Nt({line:p}))},[$,e]),R=o.useCallback(p=>{e&&$($t({selection:p}))},[$,e]);return{targets:P,targetId:a,setTargetId:x,draft:c,setDraft:D,contextItems:l,removeContextItem:g,pending:v,status:N,error:w,textareaRef:y,submit:L,includeFileInComment:C,includeLineInComment:E,includeSelectionInComment:R}}function St(e){const[t,r]=o.useState(null),[s,i]=o.useState("loading"),[c,u]=o.useState(null),l=o.useCallback(()=>{i("loading"),u(null),J().then(d=>{r(d),i("ready")},d=>{u(d instanceof Error?d.message:String(d)),i("error")})},[]);return o.useEffect(()=>{let d=!0;return J().then(a=>{d&&(r(a),i("ready"))},a=>{d&&(u(a instanceof Error?a.message:String(a)),i("error"))}),()=>{d=!1}},[]),o.useEffect(()=>{t&&e&&Oe(t,e.render.preferredTheme)},[t,e]),{pierre:t,pierrePhase:s,pierreError:c,retryPierre:l}}function Pt({path:e,activeLayer:t,selectedFile:r,snapshotKey:s}){const i=r?W(r):null,c=`${e}\0${t??""}\0${i??""}\0${s}`,[u,l]=o.useState({layer:null,phase:"idle",error:null}),d=o.useRef(c),a=o.useMemo(()=>!t||!i?null:ne(e,[t],{files:[i],tier:"patch",cacheScope:s}),[t,i,e,s]);return o.useEffect(()=>{if(d.current=c,!t||!i){l({layer:null,phase:"idle",error:null});return}if(a?.fresh){l({layer:a.snapshot.layers[0]??null,phase:"ready",error:null});return}l({layer:null,phase:"loading",error:null}),re(e,[t],{files:[i],tier:"patch",cacheScope:s}).then(f=>{d.current===c&&l({layer:f.snapshot.layers[0]??null,phase:"ready",error:null})},f=>{d.current===c&&l(b=>({layer:b.layer,phase:"error",error:f instanceof Error?f.message:String(f)}))})},[t,a,i,e,c]),u}function Lt(e){const[t,r]=o.useState(null),[s,i]=o.useState(null),[c,u]=o.useState("split");o.useEffect(()=>{e&&u(e.render.preferredLayout==="stacked"?"unified":"split")},[e]),o.useEffect(()=>{if(!e)return;const f=e.layers.filter(b=>b.files.length>0)[0]??e.layers[0]??null;r(b=>b&&e.layers.some(k=>k.kind===b)?b:f?f.kind:null)},[e]);const l=o.useMemo(()=>!e||!t?null:e.layers.find(a=>a.kind===t)??null,[e,t]),d=o.useMemo(()=>bt(l,s,K),[l,s]);return o.useEffect(()=>{if(!l){i(null);return}i(a=>{const f=l.files.map((b,k)=>K(b,k));return a&&f.includes(a)?a:f[0]??null})},[l]),{activeLayer:t,setActiveLayer:r,layer:l,selectedFileKey:s,setSelectedFileKey:i,selectedFile:d,layout:c,setLayout:u}}function Rt({path:e,layers:t,files:r,session:s,tier:i="summary",forceInitialLoad:c}){const u=t.join(","),l=o.useMemo(()=>u.split(","),[u]),d=(r??[]).join("\0"),a=s?`${s.sessionId??""}\0${s.agentId??""}\0${s.include??"changed"}`:"",f=o.useMemo(()=>({files:d?d.split("\0").filter(Boolean):void 0,tier:i,session:a?{sessionId:s?.sessionId??null,agentId:s?.agentId??null,include:s?.include??"changed"}:null}),[d,s?.agentId,s?.include,s?.sessionId,a,i]),[b,k]=o.useState(null),[v,m]=o.useState("loading"),[N,j]=o.useState(null),[w,h]=o.useState(null),y=o.useRef(null),P=o.useRef(!1);o.useEffect(()=>{y.current=b},[b]);const I=o.useCallback(async(x={})=>{const $=ne(e,l,f),g=x.force===!0||c&&!P.current,L=x.preserveCurrent===!0&&y.current!=null;j(null),$&&!g?(k($.snapshot),h(G($,!0)),m("ready")):L?(h(C=>({fetchedAt:C?.fetchedAt??Date.now(),cacheHit:C?.cacheHit??!1,refreshing:!0,refreshError:null})),m("ready")):(m("loading"),h(null));try{const C=await re(e,l,{force:g||$!=null,...f});g&&(P.current=!0),k(C.snapshot),h(Se(C,!1)),m("ready")}catch(C){const E=C instanceof Error?C.message:String(C);$?(h(G($,!1,E)),m("ready")):L?(h(R=>R&&{...R,refreshing:!1,refreshError:E}),m("ready")):(j(E),m("error"))}},[c,e,l,f]);o.useEffect(()=>{I()},[I]);const D=o.useCallback(()=>{I({force:!0,preserveCurrent:!0})},[I]);return{snapshot:b,fetchPhase:v,fetchError:N,freshness:w,filesKey:d,sessionKey:a,requestedLayers:l,loadSnapshot:I,refreshSnapshot:D}}function Et({path:e,layers:t=Ne,files:r,session:s,forceInitialLoad:i=!1,onClose:c,onOpenAsPage:u,className:l,title:d}){const{snapshot:a,fetchPhase:f,fetchError:b,freshness:k,filesKey:v,sessionKey:m,loadSnapshot:N,refreshSnapshot:j}=Rt({path:e,layers:t,files:r,session:s,tier:"summary",forceInitialLoad:i}),{pierre:w,pierrePhase:h,pierreError:y,retryPierre:P}=St(a),{activeLayer:I,setActiveLayer:D,layer:x,selectedFileKey:$,setSelectedFileKey:g,selectedFile:L,layout:C,setLayout:E}=Lt(a),R=Pt({path:e,activeLayer:I,selectedFile:L,snapshotKey:a?.render.renderKey??""}),p=Ct({snapshot:a,activeLayer:I,selectedFile:L,setSelectedFileKey:g,resetKey:`${e}\0${v}\0${m}`});if(f==="loading"&&!a)return n.jsx(H,{className:l,children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-spinner","aria-hidden":!0}),n.jsxs("div",{className:"rd-center-title",children:["Reading ",s?"session":"worktree"," diff…"]}),n.jsx("div",{className:"rd-center-body",children:e})]})});if(f==="error"&&!a)return n.jsx(H,{className:l,children:n.jsxs(M,{children:[n.jsx("div",{className:"rd-center-title",children:"Couldn’t load the diff"}),n.jsx("div",{className:"rd-center-body",children:b??"The broker did not return a diff snapshot."}),n.jsx("div",{className:"rd-center-action",children:n.jsx("button",{type:"button",className:"rd-btn",onClick:()=>{N()},children:"Retry"})})]})});if(!a)return n.jsx(H,{className:l});const S=d??we(a.worktreePath);return n.jsxs(H,{className:l,children:[n.jsx(Re,{heading:S,worktreePath:a.worktreePath,snapshot:a,freshness:k,activeLayer:I,onLayer:D,layout:C,onLayout:E,refreshing:k?.refreshing===!0,onRefresh:j,onFocusComment:()=>{p.textareaRef.current?.scrollIntoView({block:"nearest"}),p.textareaRef.current?.focus()},onClose:c,onOpenAsPage:u}),n.jsx(Ie,{snapshot:a}),n.jsxs("div",{className:"rd-body",children:[n.jsx(ot,{layer:x,selectedFileKey:$,onSelect:g,onIncludeFile:p.includeFileInComment}),n.jsx(Pe,{snapshot:a,selectedFile:L,targets:p.targets,targetId:p.targetId,onTargetId:p.setTargetId,draft:p.draft,onDraft:p.setDraft,contextItems:p.contextItems,onRemoveContextItem:p.removeContextItem,pending:p.pending,status:p.status,error:p.error,textareaRef:p.textareaRef,onSubmit:p.submit}),n.jsx(et,{layer:x,patchLayer:R.layer,patchPhase:R.phase,patchError:R.error,selectedFileKey:$,renderKey:a.render.renderKey,theme:a.render.preferredTheme,layout:C,pierre:w,pierrePhase:h,pierreError:y,onRetryPierre:P,onIncludeLineContext:p.includeLineInComment,onIncludeSelectionContext:p.includeSelectionInComment})]})]})}export{Et as RepoDiffViewer,Et as default};
@@ -1 +1 @@
1
- import{g as f}from"./index-Ccjo5BZz.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};
1
+ import{o as f}from"./index-CRkjiso5.js";function g(o,s){for(var r=0;r<s.length;r++){const t=s[r];if(typeof t!="string"&&!Array.isArray(t)){for(const e in t)if(e!=="default"&&!(e in o)){const i=Object.getOwnPropertyDescriptor(t,e);i&&Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}var a={exports:{}},d;function _(){return d||(d=1,(function(o,s){(function(r,t){o.exports=t()})(globalThis,(()=>(()=>{var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const i=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(i._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),m=Math.max(0,parseInt(l.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),u=c-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=m-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-i;return{cols:Math.max(2,Math.floor(h/e.css.cell.width)),rows:Math.max(1,Math.floor(u/e.css.cell.height))}}}})(),r})()))})(a)),a.exports}var p=_();const y=f(p),v=g({__proto__:null,default:y},[p]);export{v as a};
@@ -1,4 +1,4 @@
1
- import{g as We}from"./index-Ccjo5BZz.js";function Ke(Ie,ke){for(var Se=0;Se<ke.length;Se++){const Ee=ke[Se];if(typeof Ee!="string"&&!Array.isArray(Ee)){for(const ge in Ee)if(ge!=="default"&&!(ge in Ie)){const De=Object.getOwnPropertyDescriptor(Ee,ge);De&&Object.defineProperty(Ie,ge,De.get?De:{enumerable:!0,get:()=>Ee[ge]})}}}return Object.freeze(Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"}))}var Ne={exports:{}},Fe;function He(){return Fe||(Fe=1,(function(Ie,ke){(function(Se,Ee){Ie.exports=Ee()})(globalThis,(()=>(()=>{var Se={6864:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellColorResolver=void 0;const i=v(1564),f=v(7993),h=v(4959);let C,b=0,_=0,o=!1,r=!1,p=!1,E=0;e.CellColorResolver=class{constructor(t,R,u,n,s,a){this._terminal=t,this._optionService=R,this._selectionRenderModel=u,this._decorationService=n,this._coreBrowserService=s,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(t,R,u,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=268435456&t.bg?t.extended.ext:0,_=0,b=0,r=!1,o=!1,p=!1,C=this._themeService.colors,E=0,t.getCode()!==i.NULL_CELL_CODE&&t.extended.underlineStyle===4){const s=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));E=R*n%(2*Math.round(s))}if(this._decorationService.forEachDecorationAtCell(R,u,"bottom",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),p=this._selectionRenderModel.isCellSelected(this._terminal,R,u),p){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}_=f.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else _=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,C.selectionForeground&&(b=C.selectionForeground.rgba>>8&16777215,o=!0),(0,h.treatGlyphAsBackgroundColor)(t.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))b=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=f.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(R,u,"top",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(_=p?-16777216&t.bg&-134217729|_|50331648:-16777216&t.bg|_|50331648),o&&(b=-16777216&t.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!o&&(b=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&C.background.rgba>>8|50331648,o=!0),!r&&o&&(_=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&C.foreground.rgba>>8|50331648,r=!0)),C=void 0,this.result.bg=r?_:this.result.bg,this.result.fg=o?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=E<<29&3758096384}}},5670:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.acquireTextureAtlas=function(C,b,_,o,r,p,E,t,R){const u=(0,f.generateConfig)(o,r,p,E,b,_,t,R);for(let a=0;a<h.length;a++){const c=h[a],l=c.ownedBy.indexOf(C);if(l>=0){if((0,f.configEquals)(c.config,u))return c.atlas;c.ownedBy.length===1?(c.atlas.dispose(),h.splice(a,1)):c.ownedBy.splice(l,1);break}}for(let a=0;a<h.length;a++){const c=h[a];if((0,f.configEquals)(c.config,u))return c.ownedBy.push(C),c.atlas}const n=C._core,s={atlas:new i.TextureAtlas(document,u,n.unicodeService),config:u,ownedBy:[C]};return h.push(s),s.atlas},e.removeTerminalFromCache=function(C){for(let b=0;b<h.length;b++){const _=h[b].ownedBy.indexOf(C);if(_!==-1){h[b].ownedBy.length===1?(h[b].atlas.dispose(),h.splice(b,1)):h[b].ownedBy.splice(_,1);break}}};const i=v(2115),f=v(3657),h=[]},3657:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.generateConfig=function(f,h,C,b,_,o,r,p){const E={foreground:o.foreground,background:o.background,cursor:i.NULL_COLOR,cursorAccent:i.NULL_COLOR,selectionForeground:i.NULL_COLOR,selectionBackgroundTransparent:i.NULL_COLOR,selectionBackgroundOpaque:i.NULL_COLOR,selectionInactiveBackgroundTransparent:i.NULL_COLOR,selectionInactiveBackgroundOpaque:i.NULL_COLOR,overviewRulerBorder:i.NULL_COLOR,scrollbarSliderBackground:i.NULL_COLOR,scrollbarSliderHoverBackground:i.NULL_COLOR,scrollbarSliderActiveBackground:i.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:_.customGlyphs,devicePixelRatio:r,deviceMaxTextureSize:p,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:f,deviceCellHeight:h,deviceCharWidth:C,deviceCharHeight:b,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:E}},e.configEquals=function(f,h){for(let C=0;C<f.colors.ansi.length;C++)if(f.colors.ansi[C].rgba!==h.colors.ansi[C].rgba)return!1;return f.devicePixelRatio===h.devicePixelRatio&&f.customGlyphs===h.customGlyphs&&f.lineHeight===h.lineHeight&&f.letterSpacing===h.letterSpacing&&f.fontFamily===h.fontFamily&&f.fontSize===h.fontSize&&f.fontWeight===h.fontWeight&&f.fontWeightBold===h.fontWeightBold&&f.allowTransparency===h.allowTransparency&&f.deviceCharWidth===h.deviceCharWidth&&f.deviceCharHeight===h.deviceCharHeight&&f.drawBoldTextInBrightColors===h.drawBoldTextInBrightColors&&f.minimumContrastRatio===h.minimumContrastRatio&&f.colors.foreground.rgba===h.colors.foreground.rgba&&f.colors.background.rgba===h.colors.background.rgba},e.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432};const i=v(7993)},2e3:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=void 0;const i=v(7095);e.DIM_OPACITY=.5,e.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},3773:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorBlinkStateManager=void 0,e.CursorBlinkStateManager=class{constructor(v,i){this._renderCallback=v,this._coreBrowserService=i,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(v=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const i=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0)return void this._restartInterval(i)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const i=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(i)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),v)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},9705:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0,e.tryDrawCustomChar=function(o,r,p,E,t,R,u,n){const s=e.blockElementDefinitions[r];if(s)return(function(L,w,S,g,A,U){for(let D=0;D<w.length;D++){const P=w[D],B=A/8,M=U/8;L.fillRect(S+P.x*B,g+P.y*M,P.w*B,P.h*M)}})(o,s,p,E,t,R),!0;const a=f[r];if(a)return(function(L,w,S,g,A,U){let D=h.get(w);D||(D=new Map,h.set(w,D));const P=L.fillStyle;if(typeof P!="string")throw new Error(`Unexpected fillStyle type "${P}"`);let B=D.get(P);if(!B){const M=w[0].length,y=w.length,x=L.canvas.ownerDocument.createElement("canvas");x.width=M,x.height=y;const I=(0,i.throwIfFalsy)(x.getContext("2d")),O=new ImageData(M,y);let N,W,K,$;if(P.startsWith("#"))N=parseInt(P.slice(1,3),16),W=parseInt(P.slice(3,5),16),K=parseInt(P.slice(5,7),16),$=P.length>7&&parseInt(P.slice(7,9),16)||1;else{if(!P.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${P}" when drawing pattern glyph`);[N,W,K,$]=P.substring(5,P.length-1).split(",").map((X=>parseFloat(X)))}for(let X=0;X<y;X++)for(let Z=0;Z<M;Z++)O.data[4*(X*M+Z)]=N,O.data[4*(X*M+Z)+1]=W,O.data[4*(X*M+Z)+2]=K,O.data[4*(X*M+Z)+3]=w[X][Z]*(255*$);I.putImageData(O,0,0),B=(0,i.throwIfFalsy)(L.createPattern(x,null)),D.set(P,B)}L.fillStyle=B,L.fillRect(S,g,A,U)})(o,a,p,E,t,R),!0;const c=e.boxDrawingDefinitions[r];if(c)return(function(L,w,S,g,A,U,D){L.strokeStyle=L.fillStyle;for(const[P,B]of Object.entries(w)){let M;L.beginPath(),L.lineWidth=D*Number.parseInt(P),M=typeof B=="function"?B(.15,.15/U*A):B;for(const y of M.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!0,D))}L.stroke(),L.closePath()}})(o,c,p,E,t,R,n),!0;const l=e.powerlineDefinitions[r];return!!l&&((function(L,w,S,g,A,U,D,P){const B=new Path2D;B.rect(S,g,A,U),L.clip(B),L.beginPath();const M=D/12;L.lineWidth=P*M;for(const y of w.d.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!1,P,(w.leftPadding??0)*(M/2),(w.rightPadding??0)*(M/2)))}w.type===1?(L.strokeStyle=L.fillStyle,L.stroke()):L.fill(),L.closePath()})(o,l,p,E,t,R,u,n),!0)};const i=v(4959);e.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};e.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},e.powerlineDefinitions={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},e.powerlineDefinitions[""]=e.powerlineDefinitions[""],e.powerlineDefinitions[""]=e.powerlineDefinitions[""];const h=new Map;function C(o,r,p=0){return Math.max(Math.min(o,r),p)}const b={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function _(o,r,p,E,t,R,u,n=0,s=0){const a=o.map((c=>parseFloat(c)||parseInt(c)));if(a.length<2)throw new Error("Too few arguments for instruction");for(let c=0;c<a.length;c+=2)a[c]*=r-n*u-s*u,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,r,0)),a[c]+=E+n*u;for(let c=1;c<a.length;c+=2)a[c]*=p,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,p,0)),a[c]+=t;return a}},697:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=function(f,h,C){let b=new h.ResizeObserver((_=>{const o=_.find((E=>E.target===f));if(!o)return;if(!("devicePixelContentBoxSize"in o))return b?.disconnect(),void(b=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,p=o.devicePixelContentBoxSize[0].blockSize;r>0&&p>0&&C(r,p)}));try{b.observe(f,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,i.toDisposable)((()=>b?.disconnect()))};const i=v(2540)},3028:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphRenderer=void 0;const i=v(2115),f=v(1564),h=v(2540),C=v(5719),b=v(4959),_=11,o=_*Float32Array.BYTES_PER_ELEMENT;let r,p=0,E=0,t=0;class R extends h.Disposable{constructor(n,s,a,c){super(),this._terminal=n,this._gl=s,this._dimensions=a,this._optionsService=c,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const l=this._gl;i.TextureAtlas.maxAtlasPages===void 0&&(i.TextureAtlas.maxAtlasPages=Math.min(32,(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),i.TextureAtlas.maxTextureSize=(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=(0,b.throwIfFalsy)((0,C.createProgram)(l,`#version 300 es
1
+ import{o as We}from"./index-CRkjiso5.js";function Ke(Ie,ke){for(var Se=0;Se<ke.length;Se++){const Ee=ke[Se];if(typeof Ee!="string"&&!Array.isArray(Ee)){for(const ge in Ee)if(ge!=="default"&&!(ge in Ie)){const De=Object.getOwnPropertyDescriptor(Ee,ge);De&&Object.defineProperty(Ie,ge,De.get?De:{enumerable:!0,get:()=>Ee[ge]})}}}return Object.freeze(Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"}))}var Ne={exports:{}},Fe;function He(){return Fe||(Fe=1,(function(Ie,ke){(function(Se,Ee){Ie.exports=Ee()})(globalThis,(()=>(()=>{var Se={6864:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CellColorResolver=void 0;const i=v(1564),f=v(7993),h=v(4959);let C,b=0,_=0,o=!1,r=!1,p=!1,E=0;e.CellColorResolver=class{constructor(t,R,u,n,s,a){this._terminal=t,this._optionService=R,this._selectionRenderModel=u,this._decorationService=n,this._coreBrowserService=s,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(t,R,u,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=268435456&t.bg?t.extended.ext:0,_=0,b=0,r=!1,o=!1,p=!1,C=this._themeService.colors,E=0,t.getCode()!==i.NULL_CELL_CODE&&t.extended.underlineStyle===4){const s=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));E=R*n%(2*Math.round(s))}if(this._decorationService.forEachDecorationAtCell(R,u,"bottom",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),p=this._selectionRenderModel.isCellSelected(this._terminal,R,u),p){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}_=f.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else _=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,C.selectionForeground&&(b=C.selectionForeground.rgba>>8&16777215,o=!0),(0,h.treatGlyphAsBackgroundColor)(t.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))b=(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=f.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?C.selectionBackgroundOpaque:C.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}o=!0}}this._decorationService.forEachDecorationAtCell(R,u,"top",(s=>{s.backgroundColorRGB&&(_=s.backgroundColorRGB.rgba>>8&16777215,r=!0),s.foregroundColorRGB&&(b=s.foregroundColorRGB.rgba>>8&16777215,o=!0)})),r&&(_=p?-16777216&t.bg&-134217729|_|50331648:-16777216&t.bg|_|50331648),o&&(b=-16777216&t.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!o&&(b=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&C.background.rgba>>8|50331648,o=!0),!r&&o&&(_=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&C.foreground.rgba>>8|50331648,r=!0)),C=void 0,this.result.bg=r?_:this.result.bg,this.result.fg=o?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=E<<29&3758096384}}},5670:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.acquireTextureAtlas=function(C,b,_,o,r,p,E,t,R){const u=(0,f.generateConfig)(o,r,p,E,b,_,t,R);for(let a=0;a<h.length;a++){const c=h[a],l=c.ownedBy.indexOf(C);if(l>=0){if((0,f.configEquals)(c.config,u))return c.atlas;c.ownedBy.length===1?(c.atlas.dispose(),h.splice(a,1)):c.ownedBy.splice(l,1);break}}for(let a=0;a<h.length;a++){const c=h[a];if((0,f.configEquals)(c.config,u))return c.ownedBy.push(C),c.atlas}const n=C._core,s={atlas:new i.TextureAtlas(document,u,n.unicodeService),config:u,ownedBy:[C]};return h.push(s),s.atlas},e.removeTerminalFromCache=function(C){for(let b=0;b<h.length;b++){const _=h[b].ownedBy.indexOf(C);if(_!==-1){h[b].ownedBy.length===1?(h[b].atlas.dispose(),h.splice(b,1)):h[b].ownedBy.splice(_,1);break}}};const i=v(2115),f=v(3657),h=[]},3657:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.generateConfig=function(f,h,C,b,_,o,r,p){const E={foreground:o.foreground,background:o.background,cursor:i.NULL_COLOR,cursorAccent:i.NULL_COLOR,selectionForeground:i.NULL_COLOR,selectionBackgroundTransparent:i.NULL_COLOR,selectionBackgroundOpaque:i.NULL_COLOR,selectionInactiveBackgroundTransparent:i.NULL_COLOR,selectionInactiveBackgroundOpaque:i.NULL_COLOR,overviewRulerBorder:i.NULL_COLOR,scrollbarSliderBackground:i.NULL_COLOR,scrollbarSliderHoverBackground:i.NULL_COLOR,scrollbarSliderActiveBackground:i.NULL_COLOR,ansi:o.ansi.slice(),contrastCache:o.contrastCache,halfContrastCache:o.halfContrastCache};return{customGlyphs:_.customGlyphs,devicePixelRatio:r,deviceMaxTextureSize:p,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:f,deviceCellHeight:h,deviceCharWidth:C,deviceCharHeight:b,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:E}},e.configEquals=function(f,h){for(let C=0;C<f.colors.ansi.length;C++)if(f.colors.ansi[C].rgba!==h.colors.ansi[C].rgba)return!1;return f.devicePixelRatio===h.devicePixelRatio&&f.customGlyphs===h.customGlyphs&&f.lineHeight===h.lineHeight&&f.letterSpacing===h.letterSpacing&&f.fontFamily===h.fontFamily&&f.fontSize===h.fontSize&&f.fontWeight===h.fontWeight&&f.fontWeightBold===h.fontWeightBold&&f.allowTransparency===h.allowTransparency&&f.deviceCharWidth===h.deviceCharWidth&&f.deviceCharHeight===h.deviceCharHeight&&f.drawBoldTextInBrightColors===h.drawBoldTextInBrightColors&&f.minimumContrastRatio===h.minimumContrastRatio&&f.colors.foreground.rgba===h.colors.foreground.rgba&&f.colors.background.rgba===h.colors.background.rgba},e.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432};const i=v(7993)},2e3:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TEXT_BASELINE=e.DIM_OPACITY=void 0;const i=v(7095);e.DIM_OPACITY=.5,e.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},3773:(j,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CursorBlinkStateManager=void 0,e.CursorBlinkStateManager=class{constructor(v,i){this._renderCallback=v,this._coreBrowserService=i,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(v=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const i=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0)return void this._restartInterval(i)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const i=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(i)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),v)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},9705:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.powerlineDefinitions=e.boxDrawingDefinitions=e.blockElementDefinitions=void 0,e.tryDrawCustomChar=function(o,r,p,E,t,R,u,n){const s=e.blockElementDefinitions[r];if(s)return(function(L,w,S,g,A,U){for(let D=0;D<w.length;D++){const P=w[D],B=A/8,M=U/8;L.fillRect(S+P.x*B,g+P.y*M,P.w*B,P.h*M)}})(o,s,p,E,t,R),!0;const a=f[r];if(a)return(function(L,w,S,g,A,U){let D=h.get(w);D||(D=new Map,h.set(w,D));const P=L.fillStyle;if(typeof P!="string")throw new Error(`Unexpected fillStyle type "${P}"`);let B=D.get(P);if(!B){const M=w[0].length,y=w.length,x=L.canvas.ownerDocument.createElement("canvas");x.width=M,x.height=y;const I=(0,i.throwIfFalsy)(x.getContext("2d")),O=new ImageData(M,y);let N,W,K,$;if(P.startsWith("#"))N=parseInt(P.slice(1,3),16),W=parseInt(P.slice(3,5),16),K=parseInt(P.slice(5,7),16),$=P.length>7&&parseInt(P.slice(7,9),16)||1;else{if(!P.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${P}" when drawing pattern glyph`);[N,W,K,$]=P.substring(5,P.length-1).split(",").map((X=>parseFloat(X)))}for(let X=0;X<y;X++)for(let Z=0;Z<M;Z++)O.data[4*(X*M+Z)]=N,O.data[4*(X*M+Z)+1]=W,O.data[4*(X*M+Z)+2]=K,O.data[4*(X*M+Z)+3]=w[X][Z]*(255*$);I.putImageData(O,0,0),B=(0,i.throwIfFalsy)(L.createPattern(x,null)),D.set(P,B)}L.fillStyle=B,L.fillRect(S,g,A,U)})(o,a,p,E,t,R),!0;const c=e.boxDrawingDefinitions[r];if(c)return(function(L,w,S,g,A,U,D){L.strokeStyle=L.fillStyle;for(const[P,B]of Object.entries(w)){let M;L.beginPath(),L.lineWidth=D*Number.parseInt(P),M=typeof B=="function"?B(.15,.15/U*A):B;for(const y of M.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!0,D))}L.stroke(),L.closePath()}})(o,c,p,E,t,R,n),!0;const l=e.powerlineDefinitions[r];return!!l&&((function(L,w,S,g,A,U,D,P){const B=new Path2D;B.rect(S,g,A,U),L.clip(B),L.beginPath();const M=D/12;L.lineWidth=P*M;for(const y of w.d.split(" ")){const x=y[0],I=b[x];if(!I){console.error(`Could not find drawing instructions for "${x}"`);continue}const O=y.substring(1).split(",");O[0]&&O[1]&&I(L,_(O,A,U,S,g,!1,P,(w.leftPadding??0)*(M/2),(w.rightPadding??0)*(M/2)))}w.type===1?(L.strokeStyle=L.fillStyle,L.stroke()):L.fill(),L.closePath()})(o,l,p,E,t,R,u,n),!0)};const i=v(4959);e.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};e.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╒":{1:(o,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(o,r)=>`M${.5-o},1 L${.5-o},.5 L1,.5 M${.5+o},.5 L${.5+o},1`},"╔":{1:(o,r)=>`M1,${.5-r} L${.5-o},${.5-r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╕":{1:(o,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(o,r)=>`M${.5+o},1 L${.5+o},.5 L0,.5 M${.5-o},.5 L${.5-o},1`},"╗":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5+o},${.5-r} L${.5+o},1`},"╘":{1:(o,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(o,r)=>`M1,.5 L${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╚":{1:(o,r)=>`M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0 M1,${.5+r} L${.5-o},${.5+r} L${.5-o},0`},"╛":{1:(o,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(o,r)=>`M0,.5 L${.5+o},.5 L${.5+o},0 M${.5-o},.5 L${.5-o},0`},"╝":{1:(o,r)=>`M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M0,${.5+r} L${.5+o},${.5+r} L${.5+o},0`},"╞":{1:(o,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1 M${.5+o},.5 L1,.5`},"╠":{1:(o,r)=>`M${.5-o},0 L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╡":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(o,r)=>`M0,.5 L${.5-o},.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╣":{1:(o,r)=>`M${.5+o},0 L${.5+o},1 M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0`},"╤":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},1 M${.5+o},.5 L${.5+o},1`},"╦":{1:(o,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1`},"╧":{1:(o,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},.5 L${.5-o},0 M${.5+o},.5 L${.5+o},0`},"╩":{1:(o,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╪":{1:(o,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(o,r)=>`M0,.5 L1,.5 M${.5-o},0 L${.5-o},1 M${.5+o},0 L${.5+o},1`},"╬":{1:(o,r)=>`M0,${.5+r} L${.5-o},${.5+r} L${.5-o},1 M1,${.5+r} L${.5+o},${.5+r} L${.5+o},1 M0,${.5-r} L${.5-o},${.5-r} L${.5-o},0 M1,${.5-r} L${.5+o},${.5-r} L${.5+o},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(o,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(o,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},e.powerlineDefinitions={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},e.powerlineDefinitions[""]=e.powerlineDefinitions[""],e.powerlineDefinitions[""]=e.powerlineDefinitions[""];const h=new Map;function C(o,r,p=0){return Math.max(Math.min(o,r),p)}const b={C:(o,r)=>o.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(o,r)=>o.lineTo(r[0],r[1]),M:(o,r)=>o.moveTo(r[0],r[1])};function _(o,r,p,E,t,R,u,n=0,s=0){const a=o.map((c=>parseFloat(c)||parseInt(c)));if(a.length<2)throw new Error("Too few arguments for instruction");for(let c=0;c<a.length;c+=2)a[c]*=r-n*u-s*u,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,r,0)),a[c]+=E+n*u;for(let c=1;c<a.length;c+=2)a[c]*=p,R&&a[c]!==0&&(a[c]=C(Math.round(a[c]+.5)-.5,p,0)),a[c]+=t;return a}},697:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.observeDevicePixelDimensions=function(f,h,C){let b=new h.ResizeObserver((_=>{const o=_.find((E=>E.target===f));if(!o)return;if(!("devicePixelContentBoxSize"in o))return b?.disconnect(),void(b=void 0);const r=o.devicePixelContentBoxSize[0].inlineSize,p=o.devicePixelContentBoxSize[0].blockSize;r>0&&p>0&&C(r,p)}));try{b.observe(f,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,i.toDisposable)((()=>b?.disconnect()))};const i=v(2540)},3028:(j,e,v)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlyphRenderer=void 0;const i=v(2115),f=v(1564),h=v(2540),C=v(5719),b=v(4959),_=11,o=_*Float32Array.BYTES_PER_ELEMENT;let r,p=0,E=0,t=0;class R extends h.Disposable{constructor(n,s,a,c){super(),this._terminal=n,this._gl=s,this._dimensions=a,this._optionsService=c,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const l=this._gl;i.TextureAtlas.maxAtlasPages===void 0&&(i.TextureAtlas.maxAtlasPages=Math.min(32,(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),i.TextureAtlas.maxTextureSize=(0,b.throwIfFalsy)(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=(0,b.throwIfFalsy)((0,C.createProgram)(l,`#version 300 es
2
2
  layout (location = 0) in vec2 a_unitquad;
3
3
  layout (location = 1) in vec2 a_cellpos;
4
4
  layout (location = 2) in vec2 a_offset;