termbeam 1.24.7 → 1.24.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/package.json +2 -2
- package/public/assets/{arc-CN_mAzCx.js → arc-lkBoPUiv.js} +1 -1
- package/public/assets/{architectureDiagram-3BPJPVTR-DG5MAGnf.js → architectureDiagram-3BPJPVTR-CW-9YJ0Z.js} +1 -1
- package/public/assets/{blockDiagram-GPEHLZMM-C-jOi0wQ.js → blockDiagram-GPEHLZMM-DxfdErp5.js} +1 -1
- package/public/assets/{c4Diagram-AAUBKEIU-Lf-jQplF.js → c4Diagram-AAUBKEIU-DTO8eUNN.js} +1 -1
- package/public/assets/channel-BTc6sQSs.js +1 -0
- package/public/assets/{chunk-2J33WTMH-C9JymBSL.js → chunk-2J33WTMH-yrwj8NK0.js} +1 -1
- package/public/assets/{chunk-4BX2VUAB-Csp2FrXm.js → chunk-4BX2VUAB-XBNsAODi.js} +1 -1
- package/public/assets/{chunk-55IACEB6-yz1xCvvM.js → chunk-55IACEB6-C2qvkskM.js} +1 -1
- package/public/assets/{chunk-727SXJPM-B3MVWfnV.js → chunk-727SXJPM-DIH8wusf.js} +1 -1
- package/public/assets/{chunk-AQP2D5EJ-B-TNnfnz.js → chunk-AQP2D5EJ-DA9dwqdX.js} +1 -1
- package/public/assets/{chunk-FMBD7UC4-Dtw2KMej.js → chunk-FMBD7UC4-DIyvzXgz.js} +1 -1
- package/public/assets/{chunk-ND2GUHAM-CHQn8fqy.js → chunk-ND2GUHAM-9rK8OTLs.js} +1 -1
- package/public/assets/{chunk-QZHKN3VN-DBFY1_WB.js → chunk-QZHKN3VN-Dtk7zuyF.js} +1 -1
- package/public/assets/classDiagram-4FO5ZUOK-GzwLVtQd.js +1 -0
- package/public/assets/classDiagram-v2-Q7XG4LA2-GzwLVtQd.js +1 -0
- package/public/assets/{cose-bilkent-S5V4N54A-CCEZDlDl.js → cose-bilkent-S5V4N54A-C8bjgUgd.js} +1 -1
- package/public/assets/{dagre-BM42HDAG-BRbrP_yo.js → dagre-BM42HDAG-BWEVHaKu.js} +1 -1
- package/public/assets/{diagram-2AECGRRQ-CbD1yOYx.js → diagram-2AECGRRQ-BaPB632f.js} +1 -1
- package/public/assets/{diagram-5GNKFQAL-BP3jOKKR.js → diagram-5GNKFQAL-D2Kfb40N.js} +1 -1
- package/public/assets/{diagram-KO2AKTUF-BSDZWca7.js → diagram-KO2AKTUF-Cw8gEA7U.js} +1 -1
- package/public/assets/{diagram-LMA3HP47-Cc6VwNQA.js → diagram-LMA3HP47-D6RBTehI.js} +1 -1
- package/public/assets/{diagram-OG6HWLK6-DKU0ICzr.js → diagram-OG6HWLK6-B9MCU1E9.js} +1 -1
- package/public/assets/{erDiagram-TEJ5UH35-BnoW0mTO.js → erDiagram-TEJ5UH35-DKtjOPVB.js} +1 -1
- package/public/assets/{flowDiagram-I6XJVG4X-deD4XLcv.js → flowDiagram-I6XJVG4X-DrIR5cLt.js} +1 -1
- package/public/assets/{ganttDiagram-6RSMTGT7-BgYvdjYD.js → ganttDiagram-6RSMTGT7-BDD_ev0k.js} +1 -1
- package/public/assets/{gitGraphDiagram-PVQCEYII-BtPMKzJD.js → gitGraphDiagram-PVQCEYII-BHHhCAFG.js} +1 -1
- package/public/assets/{index-DYmxHUor.js → index-BCMj8i62.js} +4 -4
- package/public/assets/{infoDiagram-5YYISTIA-BNFXZeHF.js → infoDiagram-5YYISTIA-D8uXjMCP.js} +1 -1
- package/public/assets/{ishikawaDiagram-YF4QCWOH-DuehQ5YB.js → ishikawaDiagram-YF4QCWOH-DNeoGEbk.js} +1 -1
- package/public/assets/{journeyDiagram-JHISSGLW-Blto5i-o.js → journeyDiagram-JHISSGLW-BIjb_Axs.js} +1 -1
- package/public/assets/{kanban-definition-UN3LZRKU-S2WBlPRG.js → kanban-definition-UN3LZRKU-D0t1sa_l.js} +1 -1
- package/public/assets/{linear-CMeCahwl.js → linear-DhqS9iJ2.js} +1 -1
- package/public/assets/{mindmap-definition-RKZ34NQL-GBziQpLb.js → mindmap-definition-RKZ34NQL-DvNxgS6S.js} +1 -1
- package/public/assets/{pieDiagram-4H26LBE5-Dlh-y7ih.js → pieDiagram-4H26LBE5-B5s38S3w.js} +1 -1
- package/public/assets/{quadrantDiagram-W4KKPZXB-tr5QhZAJ.js → quadrantDiagram-W4KKPZXB-DsnYiUNW.js} +1 -1
- package/public/assets/{requirementDiagram-4Y6WPE33-_qV3HlS7.js → requirementDiagram-4Y6WPE33-B9_7IN-C.js} +1 -1
- package/public/assets/{sankeyDiagram-5OEKKPKP-C7-d2ULi.js → sankeyDiagram-5OEKKPKP-BWNU5LMP.js} +1 -1
- package/public/assets/{sequenceDiagram-3UESZ5HK-CYGsjwvO.js → sequenceDiagram-3UESZ5HK-Dzr39nJO.js} +1 -1
- package/public/assets/{stateDiagram-AJRCARHV-D5wVSY__.js → stateDiagram-AJRCARHV-ChjfHPJA.js} +1 -1
- package/public/assets/stateDiagram-v2-BHNVJYJU-CYVpOWp1.js +1 -0
- package/public/assets/{timeline-definition-PNZ67QCA-B7tB0CoS.js → timeline-definition-PNZ67QCA-Czlpe0TZ.js} +1 -1
- package/public/assets/{vennDiagram-CIIHVFJN-CX_n409t.js → vennDiagram-CIIHVFJN-NnelkDOt.js} +1 -1
- package/public/assets/{wardley-L42UT6IY-eoSJq8mJ.js → wardley-L42UT6IY-BaD4ZZp6.js} +1 -1
- package/public/assets/{wardleyDiagram-YWT4CUSO-lQio0_RH.js → wardleyDiagram-YWT4CUSO-B3Y6MpHa.js} +1 -1
- package/public/assets/{xychartDiagram-2RQKCTM6-Bv9Hklj4.js → xychartDiagram-2RQKCTM6-B9kK3FNC.js} +1 -1
- package/public/index.html +3 -11
- package/public/manifest.webmanifest +1 -1
- package/public/sw.js +1 -1
- package/src/server/auth.js +2 -2
- package/src/server/index.js +1 -1
- package/public/assets/channel-BCPoRD6y.js +0 -1
- package/public/assets/classDiagram-4FO5ZUOK-Cu1smEpb.js +0 -1
- package/public/assets/classDiagram-v2-Q7XG4LA2-Cu1smEpb.js +0 -1
- package/public/assets/stateDiagram-v2-BHNVJYJU-DcLQpqf2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-BM42HDAG-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-BM42HDAG-BWEVHaKu.js","assets/graph-CAnANduQ.js","assets/layout-DGIYPm2g.js","assets/cose-bilkent-S5V4N54A-C8bjgUgd.js","assets/cytoscape.esm-BQaXIfA_.js","assets/c4Diagram-AAUBKEIU-DTO8eUNN.js","assets/chunk-ND2GUHAM-9rK8OTLs.js","assets/flowDiagram-I6XJVG4X-DrIR5cLt.js","assets/chunk-FMBD7UC4-DIyvzXgz.js","assets/chunk-55IACEB6-C2qvkskM.js","assets/chunk-2J33WTMH-yrwj8NK0.js","assets/channel-BTc6sQSs.js","assets/erDiagram-TEJ5UH35-DKtjOPVB.js","assets/gitGraphDiagram-PVQCEYII-BHHhCAFG.js","assets/chunk-4BX2VUAB-XBNsAODi.js","assets/chunk-QZHKN3VN-Dtk7zuyF.js","assets/wardley-L42UT6IY-BaD4ZZp6.js","assets/ganttDiagram-6RSMTGT7-BDD_ev0k.js","assets/linear-DhqS9iJ2.js","assets/init-Gi6I4Gst.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-5YYISTIA-D8uXjMCP.js","assets/pieDiagram-4H26LBE5-B5s38S3w.js","assets/arc-lkBoPUiv.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-W4KKPZXB-DsnYiUNW.js","assets/xychartDiagram-2RQKCTM6-B9kK3FNC.js","assets/requirementDiagram-4Y6WPE33-B9_7IN-C.js","assets/sequenceDiagram-3UESZ5HK-Dzr39nJO.js","assets/classDiagram-4FO5ZUOK-GzwLVtQd.js","assets/chunk-727SXJPM-DIH8wusf.js","assets/classDiagram-v2-Q7XG4LA2-GzwLVtQd.js","assets/stateDiagram-AJRCARHV-ChjfHPJA.js","assets/chunk-AQP2D5EJ-DA9dwqdX.js","assets/stateDiagram-v2-BHNVJYJU-CYVpOWp1.js","assets/journeyDiagram-JHISSGLW-BIjb_Axs.js","assets/timeline-definition-PNZ67QCA-Czlpe0TZ.js","assets/mindmap-definition-RKZ34NQL-DvNxgS6S.js","assets/kanban-definition-UN3LZRKU-D0t1sa_l.js","assets/sankeyDiagram-5OEKKPKP-BWNU5LMP.js","assets/diagram-LMA3HP47-D6RBTehI.js","assets/diagram-2AECGRRQ-BaPB632f.js","assets/blockDiagram-GPEHLZMM-DxfdErp5.js","assets/diagram-5GNKFQAL-D2Kfb40N.js","assets/architectureDiagram-3BPJPVTR-CW-9YJ0Z.js","assets/diagram-KO2AKTUF-Cw8gEA7U.js","assets/diagram-OG6HWLK6-B9MCU1E9.js","assets/wardleyDiagram-YWT4CUSO-B3Y6MpHa.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var o9=Object.defineProperty;var l9=(e,t,i)=>t in e?o9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var $i=(e,t,i)=>l9(e,typeof t!="symbol"?t+"":t,i);function c9(e,t){for(var i=0;i<t.length;i++){const r=t[i];if(typeof r!="string"&&!Array.isArray(r)){for(const n in r)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(r,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();const u9="modulepreload",h9=function(e){return"/"+e},qT={},ci=function(t,i,r){let n=Promise.resolve();if(i&&i.length>0){let l=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),c=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));n=l(i.map(u=>{if(u=h9(u),u in qT)return;qT[u]=!0;const f=u.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":u9,f||(g.as="script"),g.crossOrigin="",g.href=u,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((p,x)=>{g.addEventListener("load",p),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return n.then(l=>{for(const s of l||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};function jl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J2={exports:{}},Nh={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -119,7 +119,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
119
119
|
`))+1))}const l="#".repeat(n),s=i.enter("headingAtx"),c=i.enter("phrasing");o.move(l+" ");let u=i.containerPhrasing(e,{before:"# ",after:`
|
|
120
120
|
`,...o.current()});return/^[\t ]/.test(u)&&(u=Ud(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,i.options.closeAtx&&(u+=" "+l),c(),s(),u}bA.peek=oV;function bA(e){return e.value||""}function oV(){return"<"}yA.peek=lV;function yA(e,t,i,r){const n=zv(i),o=n==='"'?"Quote":"Apostrophe",l=i.enter("image");let s=i.enter("label");const c=i.createTracker(r);let u=c.move("![");return u+=c.move(i.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=i.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(i.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(s=i.enter("destinationRaw"),u+=c.move(i.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),s(),e.title&&(s=i.enter(`title${o}`),u+=c.move(" "+n),u+=c.move(i.safe(e.title,{before:u,after:n,...c.current()})),u+=c.move(n),s()),u+=c.move(")"),l(),u}function lV(){return"!"}vA.peek=cV;function vA(e,t,i,r){const n=e.referenceType,o=i.enter("imageReference");let l=i.enter("label");const s=i.createTracker(r);let c=s.move("![");const u=i.safe(e.alt,{before:c,after:"]",...s.current()});c+=s.move(u+"]["),l();const f=i.stack;i.stack=[],l=i.enter("reference");const d=i.safe(i.associationId(e),{before:c,after:"]",...s.current()});return l(),i.stack=f,o(),n==="full"||!u||u!==d?c+=s.move(d+"]"):n==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function cV(){return"!"}CA.peek=uV;function CA(e,t,i){let r=e.value||"",n="`",o=-1;for(;new RegExp("(^|[^`])"+n+"([^`]|$)").test(r);)n+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<i.unsafe.length;){const l=i.unsafe[o],s=i.compilePattern(l);let c;if(l.atBreak)for(;c=s.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return n+r+n}function uV(){return"`"}function xA(e,t){const i=Nv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}SA.peek=hV;function SA(e,t,i,r){const n=zv(i),o=n==='"'?"Quote":"Apostrophe",l=i.createTracker(r);let s,c;if(xA(e,i)){const f=i.stack;i.stack=[],s=i.enter("autolink");let d=l.move("<");return d+=l.move(i.containerPhrasing(e,{before:d,after:">",...l.current()})),d+=l.move(">"),s(),i.stack=f,d}s=i.enter("link"),c=i.enter("label");let u=l.move("[");return u+=l.move(i.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=i.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(i.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(c=i.enter("destinationRaw"),u+=l.move(i.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),c(),e.title&&(c=i.enter(`title${o}`),u+=l.move(" "+n),u+=l.move(i.safe(e.title,{before:u,after:n,...l.current()})),u+=l.move(n),c()),u+=l.move(")"),s(),u}function hV(e,t,i){return xA(e,i)?"<":"["}wA.peek=dV;function wA(e,t,i,r){const n=e.referenceType,o=i.enter("linkReference");let l=i.enter("label");const s=i.createTracker(r);let c=s.move("[");const u=i.containerPhrasing(e,{before:c,after:"]",...s.current()});c+=s.move(u+"]["),l();const f=i.stack;i.stack=[],l=i.enter("reference");const d=i.safe(i.associationId(e),{before:c,after:"]",...s.current()});return l(),i.stack=f,o(),n==="full"||!u||u!==d?c+=s.move(d+"]"):n==="shortcut"?c=c.slice(0,-1):c+=s.move("]"),c}function dV(){return"["}function Uv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fV(e){const t=Uv(e),i=e.options.bulletOther;if(!i)return t==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+i+"`) to be different");return i}function pV(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function TA(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function gV(e,t,i,r){const n=i.enter("list"),o=i.bulletCurrent;let l=e.ordered?pV(i):Uv(i);const s=e.ordered?l==="."?")":".":fV(i);let c=t&&i.bulletLastUsed?l===i.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(c=!0),TA(i)===l&&f){let d=-1;for(;++d<e.children.length;){const g=e.children[d];if(g&&g.type==="listItem"&&g.children&&g.children[0]&&g.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(l=s),i.bulletCurrent=l;const u=i.containerFlow(e,r);return i.bulletLastUsed=l,i.bulletCurrent=o,n(),u}function mV(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _V(e,t,i,r){const n=mV(i);let o=i.bulletCurrent||Uv(i);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(i.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(n==="tab"||n==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=i.createTracker(r);s.move(o+" ".repeat(l-o.length)),s.shift(l);const c=i.enter("listItem"),u=i.indentLines(i.containerFlow(e,s.current()),f);return c(),u;function f(d,g,p){return g?(p?"":" ".repeat(l))+d:(p?o:o+" ".repeat(l-o.length))+d}}function bV(e,t,i,r){const n=i.enter("paragraph"),o=i.enter("phrasing"),l=i.containerPhrasing(e,r);return o(),n(),l}const yV=_m(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vV(e,t,i,r){return(e.children.some(function(l){return yV(l)})?i.containerPhrasing:i.containerFlow).call(i,e,r)}function CV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}kA.peek=xV;function kA(e,t,i,r){const n=CV(i),o=i.enter("strong"),l=i.createTracker(r),s=l.move(n+n);let c=l.move(i.containerPhrasing(e,{after:n,before:s,...l.current()}));const u=c.charCodeAt(0),f=fg(r.before.charCodeAt(r.before.length-1),u,n);f.inside&&(c=Ud(u)+c.slice(1));const d=c.charCodeAt(c.length-1),g=fg(r.after.charCodeAt(0),d,n);g.inside&&(c=c.slice(0,-1)+Ud(d));const p=l.move(n+n);return o(),i.attentionEncodeSurroundingInfo={after:g.outside,before:f.outside},s+c+p}function xV(e,t,i){return i.options.strong||"*"}function SV(e,t,i,r){return i.safe(e.value,r)}function wV(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function TV(e,t,i){const r=(TA(i)+(i.options.ruleSpaces?" ":"")).repeat(wV(i));return i.options.ruleSpaces?r.slice(0,-1):r}const EA={blockquote:VG,break:fE,code:eV,definition:iV,emphasis:_A,hardBreak:fE,heading:aV,html:bA,image:yA,imageReference:vA,inlineCode:CA,link:SA,linkReference:wA,list:gV,listItem:_V,paragraph:bV,root:vV,strong:kA,text:SV,thematicBreak:TV};function kV(){return{enter:{table:EV,tableData:pE,tableHeader:pE,tableRow:LV},exit:{codeText:BV,table:AV,tableData:O_,tableHeader:O_,tableRow:O_}}}function EV(e){const t=e._align;this.enter({type:"table",align:t.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function AV(e){this.exit(e),this.data.inTable=void 0}function LV(e){this.enter({type:"tableRow",children:[]},e)}function O_(e){this.exit(e)}function pE(e){this.enter({type:"tableCell",children:[]},e)}function BV(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MV));const i=this.stack[this.stack.length-1];i.type,i.value=t,this.exit(e)}function MV(e,t){return t==="|"?t:e}function RV(e){const t=e||{},i=t.tableCellPadding,r=t.tablePipeAlign,n=t.stringLength,o=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
121
121
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:g,table:l,tableCell:c,tableRow:s}};function l(p,x,y,_){return u(f(p,y,_),p.align)}function s(p,x,y,_){const b=d(p,y,_),v=u([b]);return v.slice(0,v.indexOf(`
|
|
122
|
-
`))}function c(p,x,y,_){const b=y.enter("tableCell"),v=y.enter("phrasing"),C=y.containerPhrasing(p,{..._,before:o,after:o});return v(),b(),C}function u(p,x){return YG(p,{align:x,alignDelimiters:r,padding:i,stringLength:n})}function f(p,x,y){const _=p.children;let b=-1;const v=[],C=x.enter("table");for(;++b<_.length;)v[b]=d(_[b],x,y);return C(),v}function d(p,x,y){const _=p.children;let b=-1;const v=[],C=x.enter("tableRow");for(;++b<_.length;)v[b]=c(_[b],p,x,y);return C(),v}function g(p,x,y){let _=EA.inlineCode(p,x,y);return y.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function DV(){return{exit:{taskListCheckValueChecked:gE,taskListCheckValueUnchecked:gE,paragraph:OV}}}function NV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IV}}}function gE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function OV(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const r=i.children[0];if(r&&r.type==="text"){const n=t.children;let o=-1,l;for(;++o<n.length;){const s=n[o];if(s.type==="paragraph"){l=s;break}}l===i&&(r.value=r.value.slice(1),r.value.length===0?i.children.shift():i.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,i.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function IV(e,t,i,r){const n=e.children[0],o=typeof e.checked=="boolean"&&n&&n.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=i.createTracker(r);o&&s.move(l);let c=EA.listItem(e,t,i,{...r,...s.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(f){return f+l}}function FV(){return[gG(),IG(),$G(),kV(),DV()]}function PV(e){return{extensions:[mG(),FG(e),jG(),RV(e),NV()]}}const HV={tokenize:WV,partial:!0},AA={tokenize:YV,partial:!0},LA={tokenize:GV,partial:!0},BA={tokenize:VV,partial:!0},$V={tokenize:XV,partial:!0},MA={name:"wwwAutolink",tokenize:UV,previous:DA},RA={name:"protocolAutolink",tokenize:qV,previous:NA},Va={name:"emailAutolink",tokenize:zV,previous:OA},da={};function jV(){return{text:da}}let pl=48;for(;pl<123;)da[pl]=Va,pl++,pl===58?pl=65:pl===91&&(pl=97);da[43]=Va;da[45]=Va;da[46]=Va;da[95]=Va;da[72]=[Va,RA];da[104]=[Va,RA];da[87]=[Va,MA];da[119]=[Va,MA];function zV(e,t,i){const r=this;let n,o;return l;function l(d){return!ty(d)||!OA.call(r,r.previous)||qv(r.events)?i(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ty(d)?(e.consume(d),s):d===64?(e.consume(d),c):i(d)}function c(d){return d===46?e.check($V,f,u)(d):d===45||d===95||hn(d)?(o=!0,e.consume(d),c):f(d)}function u(d){return e.consume(d),n=!0,c}function f(d){return o&&n&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):i(d)}}function UV(e,t,i){const r=this;return n;function n(l){return l!==87&&l!==119||!DA.call(r,r.previous)||qv(r.events)?i(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(HV,e.attempt(AA,e.attempt(LA,o),i),i)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function qV(e,t,i){const r=this;let n="",o=!1;return l;function l(d){return(d===72||d===104)&&NA.call(r,r.previous)&&!qv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),e.consume(d),s):i(d)}function s(d){if(vn(d)&&n.length<5)return n+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const g=n.toLowerCase();if(g==="http"||g==="https")return e.consume(d),c}return i(d)}function c(d){return d===47?(e.consume(d),o?u:(o=!0,c)):i(d)}function u(d){return d===null||hg(d)||Yi(d)||Dl(d)||pm(d)?i(d):e.attempt(AA,e.attempt(LA,f),i)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function WV(e,t,i){let r=0;return n;function n(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),n):l===46&&r===3?(e.consume(l),o):i(l)}function o(l){return l===null?i(l):t(l)}}function YV(e,t,i){let r,n,o;return l;function l(u){return u===46||u===95?e.check(BA,c,s)(u):u===null||Yi(u)||Dl(u)||u!==45&&pm(u)?c(u):(o=!0,e.consume(u),l)}function s(u){return u===95?r=!0:(n=r,r=void 0),e.consume(u),l}function c(u){return n||r||!o?i(u):t(u)}}function GV(e,t){let i=0,r=0;return n;function n(l){return l===40?(i++,e.consume(l),n):l===41&&r<i?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(BA,t,o)(l):l===null||Yi(l)||Dl(l)?t(l):(e.consume(l),n)}function o(l){return l===41&&r++,e.consume(l),n}}function VV(e,t,i){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),n):s===60||s===null||Yi(s)||Dl(s)?t(s):i(s)}function n(s){return s===null||s===40||s===91||Yi(s)||Dl(s)?t(s):r(s)}function o(s){return vn(s)?l(s):i(s)}function l(s){return s===59?(e.consume(s),r):vn(s)?(e.consume(s),l):i(s)}}function XV(e,t,i){return r;function r(o){return e.consume(o),n}function n(o){return hn(o)?i(o):t(o)}}function DA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Yi(e)}function NA(e){return!vn(e)}function OA(e){return!(e===47||ty(e))}function ty(e){return e===43||e===45||e===46||e===95||hn(e)}function qv(e){let t=e.length,i=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){i=!0;break}if(r._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const KV={tokenize:nX,partial:!0};function QV(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tX,continuation:{tokenize:iX},exit:rX}},text:{91:{name:"gfmFootnoteCall",tokenize:eX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZV,resolveTo:JV}}}}function ZV(e,t,i){const r=this;let n=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;n--;){const c=r.events[n][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!l||!l._balanced)return i(c);const u=Hs(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?i(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function JV(e,t){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},n={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};n.end.column++,n.end.offset++,n.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},n.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[i+1],e[i+2],["enter",r,t],e[i+3],e[i+4],["enter",n,t],["exit",n,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(i,e.length-i+1,...s),e}function eX(e,t,i){const r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?i(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!l||d===null||d===91||Yi(d))return i(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return n.includes(Hs(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):i(d)}return Yi(d)||(l=!0),o++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function tX(e,t,i){const r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,s;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):i(x)}function f(x){if(l>999||x===93&&!s||x===null||x===91||Yi(x))return i(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=Hs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return Yi(x)||(s=!0),l++,e.consume(x),x===92?d:f}function d(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}function g(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),n.includes(o)||n.push(o),mi(e,p,"gfmFootnoteDefinitionWhitespace")):i(x)}function p(x){return t(x)}}function iX(e,t,i){return e.check(hf,t,e.attempt(KV,t,i))}function rX(e){e.exit("gfmFootnoteDefinition")}function nX(e,t,i){const r=this;return mi(e,n,"gfmFootnoteDefinitionIndent",5);function n(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):i(o)}}function sX(e){let i=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:n};return i==null&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function n(l,s){let c=-1;for(;++c<l.length;)if(l[c][0]==="enter"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._close){let u=c;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[c][1].end.offset-l[c][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[c][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[c][1].end)},d={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[c][1].start)},g=[["enter",f,s],["enter",l[u][1],s],["exit",l[u][1],s],["enter",d,s]],p=s.parser.constructs.insideSpan.null;p&&as(g,g.length,0,gm(p,l.slice(u+1,c),s)),as(g,g.length,0,[["exit",d,s],["enter",l[c][1],s],["exit",l[c][1],s],["exit",f,s]]),as(l,u-1,c-u+3,g),c=u+g.length-2;break}}for(c=-1;++c<l.length;)l[c][1].type==="strikethroughSequenceTemporary"&&(l[c][1].type="data");return l}function o(l,s,c){const u=this.previous,f=this.events;let d=0;return g;function g(x){return u===126&&f[f.length-1][1].type!=="characterEscape"?c(x):(l.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const y=bu(u);if(x===126)return d>1?c(x):(l.consume(x),d++,p);if(d<2&&!i)return c(x);const _=l.exit("strikethroughSequenceTemporary"),b=bu(x);return _._open=!b||b===2&&!!y,_._close=!y||y===2&&!!b,s(x)}}}class aX{constructor(){this.map=[]}add(t,i,r){oX(this,t,i,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let i=this.map.length;const r=[];for(;i>0;)i-=1,r.push(t.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),t.length=this.map[i][0];r.push(t.slice()),t.length=0;let n=r.pop();for(;n;){for(const o of n)t.push(o);n=r.pop()}this.map.length=0}}function oX(e,t,i,r){let n=0;if(!(i===0&&r.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=i,e.map[n][2].push(...r);return}n+=1}e.map.push([t,i,r])}}function lX(e,t){let i=!1;const r=[];for(;t<e.length;){const n=e[t];if(i){if(n[0]==="enter")n[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(i=!0);t+=1}return r}function cX(){return{flow:{null:{name:"table",tokenize:uX,resolveAll:hX}}}}function uX(e,t,i){const r=this;let n=0,o=0,l;return s;function s(D){let P=r.events.length-1;for(;P>-1;){const W=r.events[P][1].type;if(W==="lineEnding"||W==="linePrefix")P--;else break}const z=P>-1?r.events[P][1].type:null,U=z==="tableHead"||z==="tableRow"?T:c;return U===T&&r.parser.lazy[r.now().line]?i(D):U(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(l=!0,o+=1),f(D)}function f(D){return D===null?i(D):Dt(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),p):i(D):li(D)?mi(e,f,"whitespace")(D):(o+=1,l&&(l=!1,n+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),d(D)))}function d(D){return D===null||D===124||Yi(D)?(e.exit("data"),f(D)):(e.consume(D),D===92?g:d)}function g(D){return D===92||D===124?(e.consume(D),d):d(D)}function p(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?i(D):(e.enter("tableDelimiterRow"),l=!1,li(D)?mi(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):x(D))}function x(D){return D===45||D===58?_(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),y):E(D)}function y(D){return li(D)?mi(e,_,"whitespace")(D):_(D)}function _(D){return D===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(o+=1,b(D)):D===null||Dt(D)?k(D):E(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),v(D)):E(D)}function v(D){return D===45?(e.consume(D),v):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(D))}function C(D){return li(D)?mi(e,k,"whitespace")(D):k(D)}function k(D){return D===124?x(D):D===null||Dt(D)?!l||n!==o?E(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):E(D)}function E(D){return i(D)}function T(D){return e.enter("tableRow"),A(D)}function A(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),A):D===null||Dt(D)?(e.exit("tableRow"),t(D)):li(D)?mi(e,A,"whitespace")(D):(e.enter("data"),L(D))}function L(D){return D===null||D===124||Yi(D)?(e.exit("data"),A(D)):(e.consume(D),D===92?M:L)}function M(D){return D===92||D===124?(e.consume(D),L):L(D)}}function hX(e,t){let i=-1,r=!0,n=0,o=[0,0,0,0],l=[0,0,0,0],s=!1,c=0,u,f,d;const g=new aX;for(;++i<e.length;){const p=e[i],x=p[1];p[0]==="enter"?x.type==="tableHead"?(s=!1,c!==0&&(mE(g,t,c,u,f),f=void 0,c=0),u={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},g.add(i,0,[["enter",u,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],l=[0,i+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},g.add(i,0,[["enter",f,t]])),n=x.type==="tableDelimiterRow"?2:f?3:1):n&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],d=tp(g,t,o,n,void 0,d),o=[0,0,0,0]),l[2]=i)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],d=tp(g,t,o,n,void 0,d)),o=l,l=[o[1],i,0,0])):x.type==="tableHead"?(s=!0,c=i):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=i,o[1]!==0?(l[0]=l[1],d=tp(g,t,o,n,i,d)):l[1]!==0&&(d=tp(g,t,l,n,i,d)),n=0):n&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=i)}for(c!==0&&mE(g,t,c,u,f),g.consume(t.events),i=-1;++i<t.events.length;){const p=t.events[i];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=lX(t.events,i))}return e}function tp(e,t,i,r,n,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";i[0]!==0&&(o.end=Object.assign({},jc(t.events,i[0])),e.add(i[0],0,[["exit",o,t]]));const c=jc(t.events,i[1]);if(o={type:l,start:Object.assign({},c),end:Object.assign({},c)},e.add(i[1],0,[["enter",o,t]]),i[2]!==0){const u=jc(t.events,i[2]),f=jc(t.events,i[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(i[2],0,[["enter",d,t]]),r!==2){const g=t.events[i[2]],p=t.events[i[3]];if(g[1].end=Object.assign({},p[1].end),g[1].type="chunkText",g[1].contentType="text",i[3]>i[2]+1){const x=i[2]+1,y=i[3]-i[2]-1;e.add(x,y,[])}}e.add(i[3]+1,0,[["exit",d,t]])}return n!==void 0&&(o.end=Object.assign({},jc(t.events,n)),e.add(n,0,[["exit",o,t]]),o=void 0),o}function mE(e,t,i,r,n){const o=[],l=jc(t.events,i);n&&(n.end=Object.assign({},l),o.push(["exit",n,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(i+1,0,o)}function jc(e,t){const i=e[t],r=i[0]==="enter"?"start":"end";return i[1][r]}const dX={name:"tasklistCheck",tokenize:pX};function fX(){return{text:{91:dX}}}function pX(e,t,i){const r=this;return n;function n(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?i(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Yi(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):i(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):i(c)}function s(c){return Dt(c)?t(c):li(c)?e.check({tokenize:gX},t,i)(c):i(c)}}function gX(e,t,i){return mi(e,r,"whitespace");function r(n){return n===null?i(n):t(n)}}function mX(e){return q6([jV(),QV(),sX(e),cX(),fX()])}const _X={};function Cu(e){const t=this,i=e||_X,r=t.data(),n=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);n.push(mX(i)),o.push(FV()),l.push(PV(i))}const bX="_overlay_153fc_1",yX="_content_153fc_9",vX="_title_153fc_25",CX="_description_153fc_32",xX="_label_153fc_38",SX="_input_153fc_45",wX="_actions_153fc_73",TX="_cancelBtn_153fc_80",kX="_openBtn_153fc_95",EX="_close_153fc_116",sn={overlay:bX,content:yX,title:vX,description:CX,label:xX,input:SX,actions:wX,cancelBtn:TX,openBtn:kX,close:EX},AX="_changelogHeader_17ycj_1",LX="_changelog_17ycj_1",BX="_changelogPlaceholder_17ycj_56",MX="_wide_17ycj_63",$h={changelogHeader:AX,changelog:LX,changelogPlaceholder:BX,wide:MX};function _E({open:e,onClose:t,version:i}){const[r,n]=N.useState(""),[o,l]=N.useState(!1),[s,c]=N.useState(null),[u,f]=N.useState("idle"),d=N.useRef(!1);N.useEffect(()=>{e&&(d.current||(d.current=!0,f("loading"),oF().then(x=>{x?(c(x),f("loaded")):(f("error"),d.current=!1)})))},[e]);const g=N.useCallback(async()=>{l(!0),n("");try{const x=await Cv(!0);x?x.updateAvailable?n(`Update available: v${x.latest} (current: v${x.current})`):n(`You're up to date (v${x.current})`):n("Unable to check for updates")}catch{n("Unable to check for updates")}finally{l(!1)}},[]),p=N.useCallback(()=>{n(""),t()},[t]);return w.jsx(om,{open:e,onOpenChange:x=>!x&&p(),children:w.jsxs(lm,{children:[w.jsx(cm,{className:sn.overlay}),w.jsxs(um,{className:`${sn.content} ${$h.wide}`,children:[w.jsxs(hm,{className:sn.title,children:["TermBeam ",i?`v${i}`:""]}),w.jsx(A6,{className:sn.description,children:"Terminal in your browser, optimized for mobile."}),w.jsx("button",{className:sn.close,onClick:p,"aria-label":"Close",children:"✕"}),w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[w.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[w.jsx("a",{href:"https://github.com/dorlugasigal/TermBeam",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",fontSize:"0.9rem"},children:"GitHub"}),w.jsx("a",{href:"https://dorlugasigal.github.io/TermBeam/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",fontSize:"0.9rem"},children:"Docs"}),w.jsx("a",{href:"https://termbeam.pages.dev",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",fontSize:"0.9rem"},children:"Website"})]}),w.jsx("div",{className:sn.actions,style:{justifyContent:"flex-start"},children:w.jsx("button",{type:"button",className:sn.openBtn,onClick:g,disabled:o,style:{fontSize:"0.85rem"},children:o?"Checking…":"Check for updates"})}),r&&w.jsx("div",{style:{fontSize:"0.8rem",color:"var(--text-secondary)"},children:r}),w.jsx("div",{className:$h.changelogHeader,children:"What's new"}),u==="loading"&&w.jsx("div",{className:$h.changelogPlaceholder,children:"Loading release notes…"}),u==="error"&&w.jsxs("div",{className:$h.changelogPlaceholder,children:["Couldn't load release notes."," ",w.jsx("a",{href:"https://github.com/dorlugasigal/TermBeam/releases",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)"},children:"View on GitHub"})]}),u==="loaded"&&s&&w.jsx("div",{className:$h.changelog,children:w.jsx(vu,{remarkPlugins:[Cu],children:s})})]})]})]})})}const RX="_backdrop_wfjb2_1",DX="_backdropOpen_wfjb2_11",NX="_panel_wfjb2_16",OX="_panelOpen_wfjb2_31",IX="_header_wfjb2_35",FX="_title_wfjb2_44",PX="_closeBtn_wfjb2_50",HX="_body_wfjb2_65",$X="_section_wfjb2_71",jX="_sectionTitle_wfjb2_75",zX="_btn_wfjb2_84",UX="_themePickerRow_wfjb2_110",bs={backdrop:RX,backdropOpen:DX,panel:NX,panelOpen:OX,header:IX,title:FX,closeBtn:PX,body:HX,section:$X,sectionTitle:jX,btn:zX,themePickerRow:UX},qX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),w.jsx("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]}),WX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3"}),w.jsx("polyline",{points:"5 5 8 2 11 5"}),w.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"10"})]}),YX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3"}),w.jsx("polyline",{points:"5 11 8 14 11 11"}),w.jsx("line",{x1:"8",y1:"14",x2:"8",y2:"6"})]}),GX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),w.jsx("polyline",{points:"4 9 5.5 7 7 9"}),w.jsx("line",{x1:"9",y1:"9",x2:"9",y2:"7"}),w.jsx("polyline",{points:"9 7 10.5 8.5 12 7"})]}),VX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M11 2l3 3-8 8H3v-3z"}),w.jsx("line",{x1:"9",y1:"4",x2:"12",y2:"7"})]}),XX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"14"})]}),KX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"2",y1:"8",x2:"14",y2:"8"})]}),QX=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"})}),ZX=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),JX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"7",cy:"7",r:"4"}),w.jsx("line",{x1:"10",y1:"10",x2:"14",y2:"14"})]}),eK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 13L8 3l5 10"}),w.jsx("line",{x1:"5",y1:"9",x2:"11",y2:"9"}),w.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"1"}),w.jsx("line",{x1:"11",y1:"3",x2:"15",y2:"3"})]}),tK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 13L8 3l5 10"}),w.jsx("line",{x1:"5",y1:"9",x2:"11",y2:"9"}),w.jsx("line",{x1:"11",y1:"3",x2:"15",y2:"3"})]}),iK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),w.jsx("line",{x1:"5",y1:"13",x2:"11",y2:"13"}),w.jsx("line",{x1:"8",y1:"13",x2:"8",y2:"15"})]}),rK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M6.5 9.5a3 3 0 004 .5l2-2a3 3 0 00-4.24-4.24L7 5"}),w.jsx("path",{d:"M9.5 6.5a3 3 0 00-4-.5l-2 2a3 3 0 004.24 4.24L9 11"})]}),nK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("polyline",{points:"5 4 1 8 5 12"}),w.jsx("polyline",{points:"11 4 15 8 11 12"}),w.jsx("line",{x1:"9",y1:"2",x2:"7",y2:"14"})]}),sK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"4",cy:"4",r:"2"}),w.jsx("circle",{cx:"4",cy:"12",r:"2"}),w.jsx("circle",{cx:"12",cy:"8",r:"2"}),w.jsx("path",{d:"M4 6v4"}),w.jsx("path",{d:"M6 4.5c3 0 4 1.5 4 3.5"})]}),aK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 8a6 6 0 0110.47-4"}),w.jsx("polyline",{points:"12 1 13 4 10 5"}),w.jsx("path",{d:"M14 8a6 6 0 01-10.47 4"}),w.jsx("polyline",{points:"4 15 3 12 6 11"})]}),oK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 4h10"}),w.jsx("path",{d:"M5 4V3a1 1 0 011-1h4a1 1 0 011 1v1"}),w.jsx("path",{d:"M4 4l1 10a1 1 0 001 1h4a1 1 0 001-1l1-10"})]}),lK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"8",cy:"8",r:"6"}),w.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11"}),w.jsx("circle",{cx:"8",cy:"5",r:".5",fill:"currentColor"})]}),cK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("polyline",{points:"1 4 1 10 7 10"}),w.jsx("path",{d:"M3.51 11A6 6 0 0 0 14 8 6 6 0 0 0 3.51 5L1 10"})]}),uK=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"})}),hK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M11 2l3 3-7 7H4v-3l7-7z"}),w.jsx("path",{d:"M2 14l3-1"})]}),dK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"8",cy:"8",r:"2"}),w.jsx("path",{d:"M13 8a5 5 0 00-.1-1l1.4-1-1.5-2.6-1.7.5a5 5 0 00-1.7-1L9 1H7l-.4 1.8a5 5 0 00-1.7 1l-1.7-.5L1.7 6l1.4 1A5 5 0 003 8a5 5 0 00.1 1l-1.4 1 1.5 2.6 1.7-.5a5 5 0 001.7 1L7 15h2l.4-1.8a5 5 0 001.7-1l1.7.5L14.3 10l-1.4-1A5 5 0 0013 8z"})]});function I_(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{document.execCommand("copy"),Pt.success("URL copied to clipboard")}catch{Pt.error("Failed to copy URL")}document.body.removeChild(t)}function IA({inHub:e=!1}={}){const t=Je(T=>T.toolsPanelOpen),i=Je(T=>T.closeToolsPanel),[r,n]=N.useState(!1),[o,l]=N.useState(""),[s,c]=N.useState(t),[u,f]=N.useState(!1);N.useEffect(()=>{if(t)c(!0),requestAnimationFrame(()=>f(!0));else if(s){f(!1);const T=setTimeout(()=>c(!1),220);return()=>clearTimeout(T)}},[t,s]);const d=N.useCallback(()=>{i()},[i]),g=N.useCallback(T=>{T(),d()},[d]);if(!s)return w.jsx(_E,{open:r,onClose:()=>n(!1),version:o});const p=`${bs.panel} ${u?bs.panelOpen:""}`,x=()=>{const{activeId:T,sessions:A,updateSession:L}=ht.getState();if(!T)return;const M=A.get(T),D=prompt("Rename session:",(M==null?void 0:M.name)??"");!D||D===(M==null?void 0:M.name)||(K9(T,D).then(()=>{L(T,{name:D}),Pt.success("Session renamed")}).catch(()=>Pt.error("Failed to rename session")),d())},y=()=>{const{activeId:T,sessions:A,removeSession:L}=ht.getState();T&&confirm("Stop this session? The process will be killed.")&&(Pd(T).catch(()=>Pt.error("Failed to stop session")).finally(()=>{const M=A.get(T);M!=null&&M.companionTermId&&L(M.companionTermId),L(T)}),d())},_=()=>{xv().then(T=>{l(T),n(!0)}),d()},b=ht.getState().splitMode,k=[{id:"session",title:"SESSION",actions:[{id:"new-tab",label:"New tab",icon:qX,action:()=>g(()=>Je.getState().openNewSessionModal())},{id:"find",label:"Find in terminal",icon:JX,action:()=>g(()=>Je.getState().openSearchBar())},{id:"rename",label:"Rename session",icon:VX,action:x},{id:"split",label:b==="off"?"Split vertical":b==="vertical"?"Split horizontal":"Close split",icon:b==="off"?XX:b==="vertical"?KX:QX,action:()=>g(()=>ht.getState().toggleSplit())},{id:"stop",label:"Close session",icon:ZX,action:y}]},{id:"files",title:"FILES",actions:[{id:"browse",label:"Browse files",icon:uK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M,"files")})},{id:"upload",label:"Upload files",icon:WX,action:()=>g(()=>Je.getState().openUploadModal())},{id:"download",label:"Download file",icon:YX,action:()=>g(()=>Je.getState().openDownloadModal())},{id:"markdown",label:"View markdown",icon:GX,action:()=>g(()=>Je.getState().openMarkdownModal())}]},{id:"view",title:"VIEW",actions:[{id:"font-up",label:"Increase font size",icon:eK,action:()=>g(()=>{const{fontSize:T,setFontSize:A}=Je.getState();A(T+1)})},{id:"font-down",label:"Decrease font size",icon:tK,action:()=>g(()=>{const{fontSize:T,setFontSize:A}=Je.getState();A(T-1)})},{id:"preview",label:"Preview port",icon:iK,action:()=>g(()=>Je.getState().openPreviewModal())},{id:"view-code",label:"View code",icon:nK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M)})},{id:"git-changes",label:"Git changes",icon:sK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M,"changes")})}]},{id:"share",title:"SHARE",actions:[{id:"copy-link",label:"Copy link",icon:rK,action:()=>{const T=uF();if(navigator.clipboard&&typeof ClipboardItem<"u"){const A=T.then(L=>new Blob([L],{type:"text/plain"}));navigator.clipboard.write([new ClipboardItem({"text/plain":A})]).then(()=>Pt.success("Link copied!")).catch(()=>T.then(L=>I_(L)))}else T.then(A=>{var L;(L=navigator.clipboard)!=null&&L.writeText?navigator.clipboard.writeText(A).then(()=>Pt.success("Link copied!")).catch(()=>I_(A)):I_(A)});d()}}]},{id:"agents",title:"AGENTS",actions:[{id:"launch-agent",label:"Launch agent",icon:hK,action:()=>g(()=>Je.getState().openNewSessionModal("copilot"))},{id:"resume-agent",label:"Resume agent session",icon:cK,action:()=>g(()=>Je.getState().openResumeBrowser())}]},{id:"settings",title:"SETTINGS",actions:[{id:"settings",label:"Settings…",icon:dK,action:()=>g(()=>Je.getState().openSettingsPanel())}]},{id:"system",title:"SYSTEM",actions:[{id:"refresh",label:"Refresh",icon:aK,action:()=>g(()=>{"caches"in window&&caches.keys().then(T=>T.forEach(A=>caches.delete(A))),location.reload()})},{id:"clear",label:"Clear terminal",icon:oK,action:()=>g(()=>{var M;const{sessions:T,activeId:A}=ht.getState();if(!A)return;const L=T.get(A);(M=L==null?void 0:L.term)==null||M.clear()})},{id:"about",label:"About",icon:lK,action:_}]}],E=e?k.filter(T=>T.id!=="session"&&T.id!=="files").map(T=>T.id==="view"?{...T,actions:[]}:T.id==="system"?{...T,actions:T.actions.filter(A=>A.id!=="clear")}:T):k;return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${bs.backdrop} ${u?bs.backdropOpen:""}`,onClick:d}),w.jsxs("div",{className:p,"data-testid":"palette-panel","data-open":"true",children:[w.jsxs("div",{className:bs.header,children:[w.jsx("span",{className:bs.title,children:"Tools"}),w.jsx("button",{className:bs.closeBtn,onClick:d,children:"✕"})]}),w.jsx("div",{className:bs.body,children:E.map(T=>w.jsxs("div",{className:bs.section,children:[w.jsx("div",{className:bs.sectionTitle,children:T.title}),T.actions.map(A=>w.jsxs("button",{className:bs.btn,onClick:A.action,"data-testid":"palette-action",children:[A.icon,A.label]},A.id)),T.id==="view"&&w.jsx("div",{className:bs.themePickerRow,children:w.jsx(Tv,{onSelect:()=>d()})})]},T.id))})]}),w.jsx(_E,{open:r,onClose:()=>n(!1),version:o})]})}const fK="_banner_1u733_1",pK="_updating_1u733_14",gK="_error_1u733_19",mK="_success_1u733_23",_K="_text_1u733_27",bK="_actionBtn_1u733_32",yK="_spinner_1u733_51",vK="_dismiss_1u733_56",vr={banner:fK,updating:pK,error:gK,success:mK,text:_K,actionBtn:bK,spinner:yK,dismiss:vK},bE=()=>w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",width:"14",height:"14",style:{verticalAlign:"middle",marginRight:4},children:[w.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),w.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5"})]}),yE=()=>w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"14",height:"14",style:{verticalAlign:"middle",marginRight:4},children:w.jsx("polyline",{points:"3 8.5 6.5 12 13 4"})});function CK(){const[e,t]=N.useState({kind:"hidden"}),[i,r]=N.useState(!1),[n,o]=N.useState(!1),l=N.useRef(""),s=N.useRef(null),c=N.useRef(null),u=N.useRef(!1);N.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),N.useEffect(()=>{Cv(!0).then(g=>{if(g!=null&&g.updateAvailable){const p=g.command??"npm install -g termbeam@latest";l.current=p,t({kind:"available",current:g.current,latest:g.latest,canAutoUpdate:g.canAutoUpdate??!1,method:g.method??"npm",command:p})}})},[]),N.useEffect(()=>{function g(p){try{const x=JSON.parse(p.data);if(x.type!=="update-progress")return;const y=x;y.status==="installing"||y.status==="checking-permissions"||y.status==="verifying"?t({kind:"updating",phase:y.phase||"Updating..."}):y.status==="restarting"?t({kind:"restarting",toVersion:y.toVersion||"?",restartStrategy:y.restartStrategy||"exit"}):y.status==="complete"?t({kind:"success",toVersion:y.toVersion||"?"}):y.status==="failed"&&t({kind:"failed",error:y.error||"Unknown error",command:l.current})}catch{}}return window.addEventListener("termbeam:ws-message",g),()=>window.removeEventListener("termbeam:ws-message",g)},[]),N.useEffect(()=>{const g=e.kind==="updating"||e.kind==="restarting";return g&&!s.current?(e.kind==="restarting"&&(u.current=!1),s.current=setInterval(async()=>{const p=await cF();if(e.kind==="restarting"){if(!p){u.current=!0;return}if(u.current||p.status==="idle"){window.location.reload();return}}p&&(p.status==="complete"?t({kind:"success",toVersion:p.toVersion||"?"}):p.status==="failed"?t({kind:"failed",error:p.error||"Unknown error",command:l.current}):p.status==="restarting"?t({kind:"restarting",toVersion:p.toVersion||"?",restartStrategy:p.restartStrategy||"exit"}):(p.status==="installing"||p.status==="checking-permissions"||p.status==="verifying")&&t({kind:"updating",phase:p.phase||"Updating..."}))},2e3)):!g&&s.current&&(clearInterval(s.current),s.current=null),()=>{s.current&&(clearInterval(s.current),s.current=null)}},[e.kind]),N.useEffect(()=>{if(e.kind!=="success")return;const g=setTimeout(()=>r(!0),5e3);return()=>clearTimeout(g)},[e.kind]);const f=N.useCallback(async()=>{t({kind:"updating",phase:"Starting update..."});try{const g=await lF();g.error&&t({kind:"failed",error:g.error,command:g.command||l.current})}catch(g){t({kind:"failed",error:g instanceof Error?g.message:"Update request failed",command:l.current})}},[]),d=N.useCallback(async g=>{const p=()=>{o(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)};try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"){await navigator.clipboard.writeText(g),p();return}}catch{}try{const x=document.createElement("textarea");x.value=g,x.setAttribute("readonly",""),x.style.position="absolute",x.style.left="-9999px",document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x),p()}catch{}},[]);return e.kind==="hidden"||i?null:e.kind==="success"?w.jsx("div",{className:`${vr.banner} ${vr.success}`,"data-update-banner":!0,children:w.jsxs("span",{className:vr.text,children:["✓ Updated to v",e.toVersion]})}):e.kind==="restarting"?w.jsxs("div",{className:`${vr.banner} ${vr.updating}`,"data-update-banner":!0,children:[w.jsx("span",{className:vr.spinner,children:"⟳"}),w.jsx("span",{className:vr.text,children:e.restartStrategy==="pm2"?`Updated to v${e.toVersion}. Restarting...`:`Updated to v${e.toVersion}. Please restart TermBeam.`})]}):e.kind==="updating"?w.jsxs("div",{className:`${vr.banner} ${vr.updating}`,"data-update-banner":!0,children:[w.jsx("span",{className:vr.spinner,children:"⟳"}),w.jsx("span",{className:vr.text,children:e.phase})]}):e.kind==="failed"?w.jsxs("div",{className:`${vr.banner} ${vr.error}`,"data-update-banner":!0,children:[w.jsxs("span",{className:vr.text,children:["Update failed: ",e.error]}),e.command&&w.jsx("button",{className:vr.actionBtn,onClick:()=>d(e.command),title:"Copy manual update command",children:n?w.jsxs(w.Fragment,{children:[w.jsx(yE,{}),"Copied"]}):w.jsxs(w.Fragment,{children:[w.jsx(bE,{}),"Copy command"]})}),w.jsx("button",{className:vr.dismiss,onClick:()=>r(!0),"aria-label":"Dismiss",children:"✕"})]}):w.jsxs("div",{className:vr.banner,"data-update-banner":!0,children:[w.jsxs("span",{className:vr.text,children:["Update available: v",e.current," → v",e.latest]}),e.canAutoUpdate?w.jsx("button",{className:vr.actionBtn,onClick:f,children:"Update Now"}):w.jsx("button",{className:vr.actionBtn,onClick:()=>d(e.command),title:e.command,children:n?w.jsxs(w.Fragment,{children:[w.jsx(yE,{}),"Copied"]}):w.jsxs(w.Fragment,{children:[w.jsx(bE,{}),"Copy command"]})}),w.jsx("button",{className:vr.dismiss,onClick:()=>r(!0),"aria-label":"Dismiss update banner",children:"✕"})]})}const iy=zl(e=>({state:{kind:"hidden"},setState:t=>e({state:t})})),xK="_banner_eu3dd_1",SK="_warning_eu3dd_13",wK="_error_eu3dd_17",TK="_text_eu3dd_21",kK="_dismiss_eu3dd_26",ys={banner:xK,warning:SK,error:wK,text:TK,dismiss:kK};let vE=!1;function EK(){vE||(vE=!0,window.addEventListener("termbeam:ws-message",(e=>{let t;try{t=JSON.parse(typeof e.data=="string"?e.data:"")}catch{return}if(t.type!=="tunnel-status")return;const i=iy.getState();let r=null;switch(t.state){case"disconnected":r={kind:"disconnected",provider:t.provider};break;case"reconnecting":r={kind:"reconnecting"};break;case"connected":r={kind:"hidden"};break;case"failed":r={kind:"failed"};break}r&&i.setState(r)})))}function AK(){const e=iy(r=>r.state),t=iy(r=>r.setState);N.useEffect(()=>{EK()},[]);const i=()=>t({kind:"hidden"});return e.kind==="hidden"?null:e.kind==="disconnected"?w.jsxs("div",{className:`${ys.banner} ${ys.error}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:"⚠️ Tunnel disconnected — reconnecting automatically"}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):e.kind==="reconnecting"?w.jsxs("div",{className:`${ys.banner} ${ys.warning}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:"🔄 Tunnel reconnecting…"}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):e.kind==="failed"?w.jsxs("div",{className:`${ys.banner} ${ys.error}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:'❌ Tunnel failed — run "devtunnel user login" on the host'}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):null}function ff({size:e=16}){return w.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})})}const LK="_wrapper_c7307_1",BK="_deleteBackground_c7307_49",MK="_card_c7307_76",RK="_topRow_c7307_109",DK="_nameGroup_c7307_116",NK="_colorDot_c7307_123",OK="_name_c7307_116",IK="_pidBadge_c7307_139",FK="_detailsRow_c7307_201",PK="_detailItem_c7307_209",HK="_gitRow_c7307_221",$K="_gitBadge_c7307_228",jK="_statusClean_c7307_243",zK="_statusDirty_c7307_247",Cr={wrapper:LK,deleteBackground:BK,card:MK,topRow:RK,nameGroup:DK,colorDot:NK,name:OK,pidBadge:IK,detailsRow:FK,detailItem:PK,gitRow:HK,gitBadge:$K,statusClean:jK,statusDirty:zK},UK="_dissolving_180ww_15",Wv={dissolving:UK};function qK(e){if(!e)return"just now";const t=typeof e=="number"?e:new Date(e).getTime();if(isNaN(t))return"just now";const i=Date.now()-t;return i<1e4?"just now":i<6e4?`${Math.floor(i/1e3)}s ago`:i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:new Date(t).toLocaleDateString()}const CE=50,WK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),YK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("polyline",{points:"4 17 10 11 4 5"}),w.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),GK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("circle",{cx:"12",cy:"12",r:"10"}),w.jsx("polyline",{points:"12 6 12 12 16 14"})]}),VK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),w.jsx("circle",{cx:"18",cy:"6",r:"3"}),w.jsx("circle",{cx:"6",cy:"18",r:"3"}),w.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),XK=()=>w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("polyline",{points:"3 6 5 6 21 6"}),w.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),KK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),QK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"})});function ZK(e){if(!e)return null;const t=e.toLowerCase();return t.includes("github")?w.jsx(KK,{}):t.includes("gitlab")?w.jsx(QK,{}):null}const xE=()=>w.jsx(ff,{size:12});function JK({session:e,onSelect:t,onDelete:i,revealedId:r,onRevealChange:n,index:o=0,arriving:l=!1,dissolving:s=!1}){var L;const c=N.useRef(null),u=N.useRef(0),f=N.useRef(0),d=N.useRef(0),g=N.useRef(!1),p=r===e.id,x=N.useCallback(M=>{const D=c.current;D&&(D.style.transition="transform 0.25s ease",D.style.transform=`translateX(${M}px)`,d.current=M)},[]);N.useEffect(()=>{p||x(0)},[p,x]);const y=N.useCallback(M=>{const D=M.touches[0];if(!D)return;u.current=D.clientX,f.current=D.clientY,g.current=!1;const P=c.current;P&&(P.style.transition="none")},[]),_=N.useCallback(M=>{const D=M.touches[0];if(!D)return;const P=D.clientX-u.current,z=D.clientY-f.current;if(!g.current&&Math.abs(P)>5){if(Math.abs(z)>Math.abs(P))return;g.current=!0}if(!g.current)return;const U=c.current;if(!U)return;let Z=(p?-80:0)+P;Z=Math.max(Z,-80),Z=Math.min(Z,0),U.style.transform=`translateX(${Z}px)`},[p]),b=N.useCallback(M=>{if(!g.current)return;M.preventDefault();const D=M.changedTouches[0];if(!D)return;const P=D.clientX-u.current,U=(p?-80:0)+P;p?P>CE?(n(null),x(0)):x(-80):U<-CE?(n(e.id),x(-80)):x(0)},[p,e.id,n,x]),v=N.useCallback(M=>{M.stopPropagation(),i(e.id),n(null)},[e.id,i,n]),C=e.type==="copilot",k=e.shell.split("/").pop()??e.shell,E=C?"#a855f6":e.color??"var(--success)",T=e.git,A=((L=T==null?void 0:T.status)==null?void 0:L.clean)===!0;return w.jsxs("div",{className:`${Cr.wrapper} ${s?Wv.dissolving:""}`,style:{"--stagger-i":Math.min(o,8)},"data-session-id":e.id,"data-arriving":l||void 0,"aria-hidden":s||void 0,children:[w.jsxs("button",{className:Cr.deleteBackground,onClick:v,"aria-label":`Delete session ${e.name}`,type:"button",disabled:s,children:[w.jsx(XK,{}),"Delete"]}),w.jsxs("div",{ref:c,className:Cr.card,"data-testid":"session-card",onClick:()=>{s||t(e.id)},onTouchStart:y,onTouchMove:_,onTouchEnd:b,children:[w.jsxs("div",{className:Cr.topRow,children:[w.jsxs("div",{className:Cr.nameGroup,children:[C?w.jsx(xE,{}):w.jsx("span",{className:Cr.colorDot,style:{background:E}}),w.jsx("span",{className:Cr.name,"data-testid":"session-name",children:e.name})]}),C?w.jsx("span",{className:Cr.pidBadge,"data-testid":"session-type-badge",children:e.model??"Copilot"}):w.jsxs("span",{className:Cr.pidBadge,"data-testid":"session-pid",children:["PID ",e.pid]})]}),w.jsxs("div",{className:Cr.detailsRow,children:[w.jsxs("span",{className:Cr.detailItem,children:[w.jsx(WK,{})," ",e.cwd]}),C?w.jsxs("span",{className:Cr.detailItem,"data-testid":"session-shell",children:[w.jsx(xE,{})," Copilot"]}):w.jsxs("span",{className:Cr.detailItem,"data-testid":"session-shell",children:[w.jsx(YK,{})," ",k]}),w.jsxs("span",{className:Cr.detailItem,children:[w.jsx(GK,{})," ",qK(e.lastActivity)]})]}),T&&w.jsxs("div",{className:Cr.gitRow,children:[w.jsxs("span",{className:Cr.gitBadge,children:[w.jsx(VK,{})," ",T.branch]}),T.provider&&w.jsxs("span",{className:Cr.gitBadge,children:[ZK(T.provider)," ",T.provider]}),T.repoName&&w.jsx("span",{className:Cr.gitBadge,children:T.repoName}),T.status!=null&&w.jsx("span",{className:`${Cr.gitBadge} ${A?Cr.statusClean:Cr.statusDirty}`,children:A?"✓ clean":T.status.summary})]})]})]})}const F_=["#4a9eff","#4ade80","#fbbf24","#c084fc","#f87171","#22d3ee","#fb923c","#f472b6"],eQ="_badge_c2uf6_1",tQ="_dot_c2uf6_15",iQ="_sm_c2uf6_19",rQ="_md_c2uf6_34",jh={badge:eQ,dot:tQ,sm:iQ,md:rQ},nQ={copilot:w.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})}),claude:w.jsx("svg",{viewBox:"0 0 24 24",fill:"#D97757",children:w.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}),opencode:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[w.jsx("rect",{x:"2",y:"3",width:"20",height:"18",rx:"2",fill:"#1a1a2e"}),w.jsx("path",{d:"M7 9l3 3-3 3",stroke:"#c8ccd0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),w.jsx("line",{x1:"13",y1:"15",x2:"17",y2:"15",stroke:"#c8ccd0",strokeWidth:"2",strokeLinecap:"round"})]})},sQ={copilot:"#6cc644",claude:"#D97757",aider:"#4a9eff",codex:"#10a37f",opencode:"#1a1a2e"};function FA({agent:e,size:t="sm"}){const i=nQ[e];if(i)return w.jsx("span",{className:`${jh.badge} ${jh[t]}`,children:i});const r=sQ[e]||"var(--text-muted)";return w.jsx("span",{className:`${jh.badge} ${jh[t]}`,children:w.jsx("span",{className:jh.dot,style:{background:r}})})}const aQ="_overlay_1vya2_1",oQ="_content_1vya2_9",lQ="_title_1vya2_27",cQ="_form_1vya2_34",uQ="_field_1vya2_40",hQ="_label_1vya2_46",dQ="_input_1vya2_54",fQ="_select_1vya2_71 _input_1vya2_54",pQ="_dirRow_1vya2_81",gQ="_browseBtn_1vya2_90",mQ="_colorPicker_1vya2_109",_Q="_colorDot_1vya2_115",bQ="_colorDotActive_1vya2_130",yQ="_actions_1vya2_134",vQ="_cancelBtn_1vya2_141",CQ="_submitBtn_1vya2_159",xQ="_sessionTypeTabs_1vya2_183",SQ="_sessionTypeTab_1vya2_183",wQ="_sessionTypeTabActive_1vya2_214",TQ="_modelSelect_1vya2_223 _input_1vya2_54",kQ="_resumeLink_1vya2_244",EQ="_agentGrid_1vya2_269",AQ="_agentCard_1vya2_275",LQ="_agentIcon_1vya2_300",BQ="_agentName_1vya2_305",MQ="_agentVersion_1vya2_316",Zt={overlay:aQ,content:oQ,title:lQ,form:cQ,field:uQ,label:hQ,input:dQ,select:fQ,dirRow:pQ,browseBtn:gQ,colorPicker:mQ,colorDot:_Q,colorDotActive:bQ,actions:yQ,cancelBtn:vQ,submitBtn:CQ,sessionTypeTabs:xQ,sessionTypeTab:SQ,sessionTypeTabActive:wQ,modelSelect:TQ,resumeLink:kQ,agentGrid:EQ,agentCard:AQ,agentIcon:LQ,agentName:BQ,agentVersion:MQ},RQ=[{id:"claude-opus-4.6",label:"Claude Opus 4.6"},{id:"claude-opus-4.5",label:"Claude Opus 4.5"},{id:"claude-sonnet-4.6",label:"Claude Sonnet 4.6"},{id:"claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{id:"claude-sonnet-4",label:"Claude Sonnet 4"},{id:"claude-haiku-4.5",label:"Claude Haiku 4.5"},{id:"gpt-5.4",label:"GPT-5.4"},{id:"gpt-5.2",label:"GPT-5.2"},{id:"gpt-5.1",label:"GPT-5.1"},{id:"gpt-5.4-mini",label:"GPT-5.4 Mini"},{id:"gpt-5-mini",label:"GPT-5 Mini"},{id:"gpt-4.1",label:"GPT-4.1"}];function P_(e){const t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function DQ(e,t){if(!t.has(e))return e;let i=2;for(;t.has(`${e} (${i})`);)i++;return`${e} (${i})`}function PA({onCreated:e}){const{newSessionModalOpen:t,closeNewSessionModal:i,newSessionModalInitialMode:r}=Je(),n=Wi(H=>H.prefs.defaultFolder),o=Wi(H=>H.prefs.defaultInitialCommand),[l,s]=N.useState("terminal"),[c,u]=N.useState(""),[f,d]=N.useState(!1),[g,p]=N.useState(""),[x,y]=N.useState(!1),[_,b]=N.useState(!1),[v,C]=N.useState(""),[k,E]=N.useState([]),[T,A]=N.useState(""),[L,M]=N.useState(F_[0]),[D,P]=N.useState([]),[z,U]=N.useState("claude-opus-4.6"),W=N.useCallback((H,V)=>{if(f)return;const $=ht.getState().sessions,Y=new Set;for(const J of $.values())Y.add(J.name);const ee=P_(H);u(DQ(`${ee}${(V??l)==="copilot"?" · Copilot":""}`,Y))},[f,l]);N.useEffect(()=>{t&&(r&&s(r),Q9().catch(()=>({shells:[],defaultShell:"",cwd:""})).then(H=>{var ee;const V=H.shells;if(E(V),!v){const ne=V.find(J=>J.cmd===H.defaultShell)||V.find(J=>J.path===H.defaultShell);C((ne==null?void 0:ne.cmd)??((ee=V[0])==null?void 0:ee.cmd)??"")}const Y=Wi.getState().prefs.defaultFolder;if(Y){f||W(Y);return}H.cwd&&(p(ne=>ne||H.cwd),f||W(H.cwd))}),Z9().then(H=>P(H.agents||[])).catch(()=>P([])))},[t]);const Z=N.useRef(!1),j=N.useRef(!1);N.useEffect(()=>{t&&(n&&!Z.current&&!g&&(p(n),f||W(n)),o&&!j.current&&!T&&A(o))},[t,n,o]);function G(){s("terminal"),u(""),d(!1),C(""),p(""),A(""),M(F_[0]),b(!1),U("claude-sonnet-4"),Z.current=!1,j.current=!1}function X(H){s(H),!f&&g&&W(g,H)}async function F(){var H,V;y(!0);try{const $=ht.getState(),Y=$.activeId?$.sessions.get($.activeId):null,ee=(H=Y==null?void 0:Y.term)==null?void 0:H.cols,ne=(V=Y==null?void 0:Y.term)==null?void 0:V.rows,J=Wi.getState().prefs,K=(J.defaultInitialCommand||"").trim(),le=(J.defaultFolder||"").trim(),ie=T.trim()||K,he=g.trim()||le,pe=await Fd(l==="copilot"?{name:c.trim()||void 0,cwd:he||void 0,type:"copilot",model:z,...ee&&ne?{cols:ee,rows:ne}:{}}:{name:c.trim()||void 0,shell:v||void 0,cwd:he||void 0,color:L,initialCommand:ie||void 0,...ee&&ne?{cols:ee,rows:ne}:{}});ie&&ht.getState().setPendingInitialCommand(pe.id,ie),i(),G(),e(pe.id,l,pe.ptySessionId??null,l==="copilot"?z:void 0)}catch($){Pt.error($ instanceof Error?$.message:"Failed to create session")}finally{y(!1)}}async function O(H){var V,$,Y,ee;y(!0);try{const ne=ht.getState(),J=ne.activeId?ne.sessions.get(ne.activeId):null,K=(V=J==null?void 0:J.term)==null?void 0:V.cols,le=($=J==null?void 0:J.term)==null?void 0:$.rows,ie=await Fd({name:c.trim()||`${H.name}`,shell:v||void 0,cwd:g.trim()||void 0,color:L,initialCommand:(Y=H.args)!=null&&Y.length?`${H.cmd} ${H.args.join(" ")}`:H.cmd,...K&&le?{cols:K,rows:le}:{}}),he=(ee=H.args)!=null&&ee.length?`${H.cmd} ${H.args.join(" ")}`:H.cmd;ht.getState().setPendingInitialCommand(ie.id,he),i(),G(),e(ie.id,"terminal")}catch(ne){Pt.error(ne instanceof Error?ne.message:"Failed to launch agent")}finally{y(!1)}}return w.jsx(om,{open:t,onOpenChange:H=>{H||(i(),G())},children:w.jsxs(lm,{children:[w.jsx(cm,{className:Zt.overlay}),w.jsxs(um,{className:Zt.content,"data-testid":"new-session-modal",onOpenAutoFocus:H=>H.preventDefault(),children:[w.jsx(hm,{className:Zt.title,children:"New Session"}),_?w.jsx(kv,{currentDir:g||n||"/",onSelect:H=>{Z.current=!0,p(H),W(H),b(!1)},onCancel:()=>b(!1)}):w.jsxs("div",{className:Zt.form,children:[w.jsxs("div",{className:Zt.sessionTypeTabs,children:[w.jsx("button",{type:"button",className:`${Zt.sessionTypeTab} ${l==="terminal"?Zt.sessionTypeTabActive:""}`,onClick:()=>X("terminal"),children:">_ Terminal"}),w.jsxs("button",{type:"button",className:`${Zt.sessionTypeTab} ${l==="copilot"?Zt.sessionTypeTabActive:""}`,onClick:()=>X("copilot"),children:[w.jsx(ff,{size:14})," GitHub Copilot"]})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Working Directory"}),w.jsxs("div",{className:Zt.dirRow,children:[w.jsx("input",{className:Zt.input,type:"text",placeholder:n||"/",value:g,onChange:H=>{Z.current=!0,p(H.target.value)}}),w.jsx("button",{type:"button",className:Zt.browseBtn,onClick:()=>b(!0),children:"Browse"})]})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Name"}),w.jsx("input",{className:Zt.input,type:"text",placeholder:l==="copilot"?`${P_(g||"/")} · Copilot`:P_(g||"/"),value:c,onChange:H=>{u(H.target.value),d(!0)},"data-testid":"ns-name"})]}),l==="terminal"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Shell"}),w.jsx("select",{className:Zt.select,value:v,onChange:H=>C(H.target.value),"data-testid":"ns-shell",children:k.map(H=>w.jsxs("option",{value:H.cmd,children:[H.name," (",H.path,")"]},H.path))})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Initial command"}),w.jsx("input",{className:Zt.input,type:"text",placeholder:o||"e.g. npm run dev",value:T,onChange:H=>{j.current=!0,A(H.target.value)}})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Color"}),w.jsx("div",{className:Zt.colorPicker,children:F_.map(H=>w.jsx("button",{type:"button",className:`${Zt.colorDot} ${H===L?Zt.colorDotActive:""}`,style:{background:H},onClick:()=>M(H),"aria-label":`Color ${H}`},H))})]}),D.length>0&&w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"AI Agents"}),w.jsx("div",{className:Zt.agentGrid,children:D.map(H=>w.jsxs("button",{type:"button",className:Zt.agentCard,disabled:x,onClick:()=>O(H),children:[w.jsx("span",{className:Zt.agentIcon,children:w.jsx(FA,{agent:H.icon||H.id,size:"md"})}),w.jsx("span",{className:Zt.agentName,children:H.name}),H.version&&w.jsx("span",{className:Zt.agentVersion,children:H.version})]},H.id))})]})]}),l==="copilot"&&w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Model"}),w.jsx("select",{className:Zt.modelSelect,value:z,onChange:H=>U(H.target.value),"data-testid":"ns-model",children:RQ.map(H=>w.jsx("option",{value:H.id,children:H.label},H.id))})]}),w.jsx("button",{type:"button",className:Zt.resumeLink,onClick:()=>{i(),Je.getState().openResumeBrowser()},children:"Resume previous session →"}),w.jsxs("div",{className:Zt.actions,children:[w.jsx("button",{type:"button",className:Zt.cancelBtn,"data-testid":"ns-cancel",onClick:()=>{i(),G()},children:"Cancel"}),w.jsx("button",{type:"button",className:Zt.submitBtn,disabled:x,"data-testid":"ns-create",onClick:F,children:l==="copilot"?"Start Copilot Session":"Create"})]})]})]})]})})}const NQ="_page_s2fln_1",OQ="_header_s2fln_12",IQ="_backBtn_s2fln_21",FQ="_title_s2fln_36",PQ="_searchWrap_s2fln_43",HQ="_searchInput_s2fln_51",$Q="_clearBtn_s2fln_73",jQ="_tabs_s2fln_86",zQ="_tab_s2fln_86",UQ="_tabActive_s2fln_115",qQ="_list_s2fln_121",WQ="_emptyState_s2fln_133",YQ="_card_s2fln_143",GQ="_cardTop_s2fln_174",VQ="_cardIcon_s2fln_180",XQ="_cardSummary_s2fln_186",KQ="_cardMeta_s2fln_196",QQ="_metaItem_s2fln_205",ZQ="_spinner_s2fln_217",JQ="_timeFilters_s2fln_224",eZ="_timeChip_s2fln_233",tZ="_timeChipActive_s2fln_253",iZ="_folderFilter_s2fln_259",rZ="_folderSelect_s2fln_266",nZ="_resultCount_s2fln_288",sZ="_choiceOverlay_s2fln_316",aZ="_choiceDialog_s2fln_328",oZ="_choiceTitle_s2fln_338",lZ="_choiceDesc_s2fln_345",cZ="_choiceOptions_s2fln_354",uZ="_choiceBtn_s2fln_360",hZ="_choiceBtnIcon_s2fln_392",dZ="_choiceBtnLabel_s2fln_398",fZ="_choiceBtnHint_s2fln_403",pZ="_choiceSpinner_s2fln_409",$t={page:NQ,header:OQ,backBtn:IQ,title:FQ,searchWrap:PQ,searchInput:HQ,clearBtn:$Q,tabs:jQ,tab:zQ,tabActive:UQ,list:qQ,emptyState:WQ,card:YQ,cardTop:GQ,cardIcon:VQ,cardSummary:XQ,cardMeta:KQ,metaItem:QQ,spinner:ZQ,timeFilters:JQ,timeChip:eZ,timeChipActive:tZ,folderFilter:iZ,folderSelect:rZ,resultCount:nZ,choiceOverlay:sZ,choiceDialog:aZ,choiceTitle:oZ,choiceDesc:lZ,choiceOptions:cZ,choiceBtn:uZ,choiceBtnIcon:hZ,choiceBtnLabel:dZ,choiceBtnHint:fZ,choiceSpinner:pZ};function H_(e){const t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function gZ(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString()}function HA(){const{resumeBrowserOpen:e,closeResumeBrowser:t}=Je(),[i,r]=N.useState([]),[n,o]=N.useState(!0),[l,s]=N.useState(""),[c,u]=N.useState("all"),[f,d]=N.useState("all"),[g,p]=N.useState("all"),[x,y]=N.useState(null),[_,b]=N.useState(null),v=N.useRef(void 0),C=N.useRef(null),k=N.useRef(0),E=N.useCallback(async j=>{const G=++k.current;o(!0);try{const{sessions:X}=await J9(100,j||void 0);G===k.current&&r(X)}catch{G===k.current&&r([])}finally{G===k.current&&o(!1)}},[]);N.useEffect(()=>(e?(E(),setTimeout(()=>{var j;return(j=C.current)==null?void 0:j.focus()},300)):(s(""),u("all"),d("all"),p("all")),()=>{v.current&&clearTimeout(v.current)}),[e,E]);function T(j){s(j),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>E(j),300)}const A=N.useMemo(()=>{const j=new Set;return i.forEach(G=>{G.cwd&&j.add(G.cwd)}),[...j].sort()},[i]),L=N.useMemo(()=>{let j=c==="all"?i:i.filter(G=>G.agent===c);if(g!=="all"&&(j=j.filter(G=>G.cwd===g)),f!=="all"){const G=Date.now(),X={today:1440*60*1e3,week:10080*60*1e3,month:720*60*60*1e3},F=G-X[f];j=j.filter(O=>new Date(O.updatedAt).getTime()>F)}return j},[i,c,g,f]);function M(j){const G=ht.getState(),X=new Set([...G.sessions.values()].map(O=>O.name));let F=H_(j.cwd||"/");if(X.has(F)){let O=2;for(;X.has(`${F} (${O})`);)O++;F=`${F} (${O})`}return F}function D(j){j.agent==="copilot"?b({session:j,name:M(j)}):P(j,M(j))}async function P(j,G){var X,F;y(`${j.agent}-${j.id}`),b(null);try{const O=ht.getState(),H=O.activeId?O.sessions.get(O.activeId):null,V=(X=H==null?void 0:H.term)==null?void 0:X.cols,$=(F=H==null?void 0:H.term)==null?void 0:F.rows,{command:Y}=await eF(j.agent,j.id),ee=await Fd({name:G,cwd:j.cwd||void 0,initialCommand:Y,color:"#c084fc",...V&&$?{cols:V,rows:$}:{}});t(),window.history.pushState(null,"",`/terminal?id=${ee.id}`),window.dispatchEvent(new PopStateEvent("popstate"))}catch(O){Pt.error(O instanceof Error?O.message:"Failed to resume session")}finally{y(null)}}async function z(j,G){y(`${j.agent}-${j.id}`),b(null);try{const X=await tF(j.id,{name:G,cwd:j.cwd||void 0}),F=ht.getState();X.ptySessionId&&!F.sessions.has(X.ptySessionId)&&F.addSession({id:X.ptySessionId,name:`${G} Terminal`,type:"terminal",hidden:!0,shell:"",pid:0,cwd:j.cwd||"",color:"#6ec1e4",createdAt:new Date().toISOString(),lastActivity:Date.now(),term:null,fitAddon:null,searchAddon:null,ws:null,send:null,connected:!1,exited:!1,scrollback:"",hasUnread:!1}),F.sessions.has(X.id)||F.addSession({id:X.id,name:G,type:"copilot",shell:"",pid:0,cwd:j.cwd||"",color:"#a855f6",createdAt:new Date().toISOString(),lastActivity:Date.now(),companionTermId:X.ptySessionId??void 0,term:null,fitAddon:null,searchAddon:null,ws:null,send:null,connected:!0,exited:!1,scrollback:"",hasUnread:!1}),F.setActiveId(X.id),t(),window.history.pushState(null,"",`/terminal?session=${X.id}`),window.dispatchEvent(new PopStateEvent("popstate"))}catch(X){Pt.error(X instanceof Error?X.message:"Failed to resume session")}finally{y(null)}}if(N.useEffect(()=>{if(!e)return;const j=G=>{G.key==="Escape"&&(_?b(null):t())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[e,t,_]),!e)return null;const U=i.filter(j=>j.agent==="copilot").length,W=i.filter(j=>j.agent==="claude").length,Z=i.filter(j=>j.agent==="opencode").length;return w.jsxs("div",{className:$t.page,children:[w.jsxs("div",{className:$t.header,children:[w.jsx("button",{className:$t.backBtn,onClick:t,"aria-label":"Go back",type:"button",children:"←"}),w.jsx("h1",{className:$t.title,children:"Resume Session"})]}),w.jsxs("div",{className:$t.searchWrap,children:[w.jsx("input",{ref:C,className:$t.searchInput,type:"text",placeholder:"Search sessions...",value:l,onChange:j=>T(j.target.value)}),l&&w.jsx("button",{className:$t.clearBtn,"aria-label":"Clear search",onClick:()=>{s(""),E()},children:"✕"})]}),w.jsxs("div",{className:$t.tabs,children:[w.jsxs("button",{className:`${$t.tab} ${c==="all"?$t.tabActive:""}`,onClick:()=>u("all"),children:["All (",i.length,")"]}),U>0&&w.jsxs("button",{className:`${$t.tab} ${c==="copilot"?$t.tabActive:""}`,onClick:()=>u("copilot"),children:["Copilot (",U,")"]}),W>0&&w.jsxs("button",{className:`${$t.tab} ${c==="claude"?$t.tabActive:""}`,onClick:()=>u("claude"),children:["Claude (",W,")"]}),Z>0&&w.jsxs("button",{className:`${$t.tab} ${c==="opencode"?$t.tabActive:""}`,onClick:()=>u("opencode"),children:["OpenCode (",Z,")"]})]}),w.jsx("div",{className:$t.timeFilters,children:["all","today","week","month"].map(j=>w.jsx("button",{className:`${$t.timeChip} ${f===j?$t.timeChipActive:""}`,onClick:()=>d(j),children:j==="all"?"All time":j==="today"?"Today":j==="week"?"This week":"This month"},j))}),A.length>1&&w.jsx("div",{className:$t.folderFilter,children:w.jsxs("select",{className:$t.folderSelect,value:g,onChange:j=>p(j.target.value),children:[w.jsx("option",{value:"all",children:"All projects"}),A.map(j=>w.jsx("option",{value:j,children:H_(j)},j))]})}),w.jsxs("div",{className:$t.resultCount,children:[L.length," session",L.length!==1?"s":""]}),w.jsx("div",{className:$t.list,children:n?w.jsx("div",{className:$t.emptyState,children:"Loading sessions…"}):L.length===0?w.jsx("div",{className:$t.emptyState,children:l?`No sessions matching "${l}"`:"No past agent sessions found"}):L.map(j=>w.jsxs("button",{className:$t.card,disabled:x!==null,onClick:()=>D(j),children:[w.jsxs("div",{className:$t.cardTop,children:[w.jsx("span",{className:$t.cardIcon,children:w.jsx(FA,{agent:j.agentIcon})}),w.jsx("span",{className:$t.cardSummary,children:j.summary||"Untitled session"}),x===`${j.agent}-${j.id}`&&w.jsx("span",{className:$t.spinner,children:"⟳"})]}),w.jsxs("div",{className:$t.cardMeta,children:[j.cwd&&w.jsx("span",{className:$t.metaItem,children:H_(j.cwd)}),j.branch&&w.jsx("span",{className:$t.metaItem,children:j.branch}),w.jsx("span",{className:$t.metaItem,children:gZ(j.updatedAt)}),j.turnCount>0&&w.jsxs("span",{className:$t.metaItem,children:[j.turnCount," turns"]})]})]},`${j.agent}-${j.id}`))}),_&&w.jsx("div",{className:$t.choiceOverlay,onClick:()=>b(null),children:w.jsxs("div",{className:$t.choiceDialog,onClick:j=>j.stopPropagation(),children:[w.jsx("h2",{className:$t.choiceTitle,children:"Resume Copilot Session"}),w.jsx("p",{className:$t.choiceDesc,children:_.session.summary||"Untitled session"}),w.jsxs("div",{className:$t.choiceOptions,children:[w.jsxs("button",{className:$t.choiceBtn,disabled:x!==null,onClick:()=>P(_.session,_.name),children:[w.jsx("span",{className:$t.choiceBtnIcon,children:w.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",children:w.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V2.75a.25.25 0 0 0-.25-.25ZM7.25 8a.749.749 0 0 1-.22.53l-2.25 2.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L5.44 8 3.72 6.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.25 2.25c.141.14.22.331.22.53Zm1.5 1.5h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5Z"})})}),w.jsx("span",{className:$t.choiceBtnLabel,children:"Terminal"}),w.jsx("span",{className:$t.choiceBtnHint,children:"Pure CLI experience"})]}),w.jsxs("button",{className:$t.choiceBtn,disabled:x!==null,onClick:()=>z(_.session,_.name),children:[w.jsx("span",{className:$t.choiceBtnIcon,children:w.jsx(ff,{size:18})}),w.jsx("span",{className:$t.choiceBtnLabel,children:"Agent UI"}),w.jsx("span",{className:$t.choiceBtnHint,children:"Copilot SDK interface"})]})]}),x&&w.jsx("div",{className:$t.choiceSpinner,children:"⟳ Resuming…"})]})})]})}const mZ="_backdrop_269p1_1",_Z="_modal_269p1_13",bZ="_header_269p1_27",yZ="_titleBlock_269p1_36",vZ="_title_269p1_36",CZ="_subtitle_269p1_51",xZ="_closeBtn_269p1_56",SZ="_body_269p1_76",wZ="_empty_269p1_84",TZ="_emptyIcon_269p1_93",kZ="_emptyTitle_269p1_101",EZ="_emptyHint_269p1_108",AZ="_list_269p1_118",LZ="_workspaceItem_269p1_127",BZ="_workspaceHeader_269p1_141",MZ="_workspaceTitleRow_269p1_155",RZ="_workspaceName_269p1_162",DZ="_defaultBadge_269p1_169",NZ="_workspaceMetaRow_269p1_181",OZ="_metaPill_269p1_188",IZ="_metaPillAgent_269p1_189",FZ="_metaPillCmd_269p1_190",PZ="_chevron_269p1_212",HZ="_colorStrip_269p1_221",$Z="_colorStripSegment_269p1_230",jZ="_workspaceBody_269p1_238",zZ="_sessionList_269p1_247",UZ="_sessionItem_269p1_256",qZ="_sessionColorBar_269p1_270",WZ="_sessionMain_269p1_276",YZ="_sessionTopRow_269p1_285",GZ="_sessionName_269p1_292",VZ="_kindBadge_269p1_303",XZ="_kindBadgeTerminal_269p1_313",KZ="_kindBadgeAgent_269p1_318",QZ="_sessionPath_269p1_323",ZZ="_pathIcon_269p1_332",JZ="_pathDir_269p1_338",eJ="_pathFull_269p1_343",tJ="_sessionCmdRow_269p1_352",iJ="_cmdLabel_269p1_364",rJ="_cmdText_269p1_372",nJ="_sessionMeta_269p1_385",sJ="_metaItem_269p1_393",aJ="_metaKey_269p1_401",oJ="_launchBtn_269p1_421",lJ="_launchCount_269p1_452",cJ="_spinner_269p1_465",Ft={backdrop:mZ,modal:_Z,header:bZ,titleBlock:yZ,title:vZ,subtitle:CZ,closeBtn:xZ,body:SZ,empty:wZ,emptyIcon:TZ,emptyTitle:kZ,emptyHint:EZ,list:AZ,workspaceItem:LZ,workspaceHeader:BZ,workspaceTitleRow:MZ,workspaceName:RZ,defaultBadge:DZ,workspaceMetaRow:NZ,metaPill:OZ,metaPillAgent:IZ,metaPillCmd:FZ,chevron:PZ,colorStrip:HZ,colorStripSegment:$Z,workspaceBody:jZ,sessionList:zZ,sessionItem:UZ,sessionColorBar:qZ,sessionMain:WZ,sessionTopRow:YZ,sessionName:GZ,kindBadge:VZ,kindBadgeTerminal:XZ,kindBadgeAgent:KZ,sessionPath:QZ,pathIcon:ZZ,pathDir:JZ,pathFull:eJ,sessionCmdRow:tJ,cmdLabel:iJ,cmdText:rJ,sessionMeta:nJ,metaItem:sJ,metaKey:aJ,launchBtn:oJ,launchCount:lJ,spinner:cJ};function SE(e){if(!e)return"";const t=e.replace(/\/+$/,"").match(/[^/\\]+$/);return t?t[0]:e}function uJ(e,t=36){if(e.length<=t)return e;const i=e.slice(0,14),r=e.slice(-(t-16));return`${i}…${r}`}function hJ({open:e,onClose:t,onLaunched:i}){const r=Wi(f=>f.prefs),[n,o]=N.useState(null),[l,s]=N.useState(null),c=N.useMemo(()=>{var d,g;const f=r.workspaces??[];return f.length>0?f:(g=(d=r.startupWorkspace)==null?void 0:d.sessions)!=null&&g.length?[{id:"__legacy__",name:"Default startup",sessions:r.startupWorkspace.sessions}]:[]},[r]);if(N.useEffect(()=>{c.length===1&&c[0]&&s(c[0].id)},[c]),N.useEffect(()=>{if(!e)return;const f=d=>{d.key==="Escape"&&t()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,t]),!e)return null;const u=async f=>{if(f.sessions.length===0){Pt.info("This workspace is empty");return}o(f.id);let d,g,p=0;try{for(const y of f.sessions){const _=(y.initialCommand??"").trim(),b={name:y.name,cwd:y.cwd||void 0,color:y.color||void 0,initialCommand:_||void 0,type:y.kind==="agent"?"agent":"terminal"};let v;try{v=await Fd({...b,shell:y.shell||void 0})}catch(C){const k=C instanceof Error?C.message:"";if(k.toLowerCase().includes("shell"))try{v=await Fd(b)}catch(E){Pt.error(`Failed to launch "${y.name}": ${E instanceof Error?E.message:"unknown error"}`);continue}else{Pt.error(`Failed to launch "${y.name}": ${k||"unknown error"}`);continue}}d||(d=v.id),_&&(ht.getState().setPendingInitialCommand(v.id,_),g||(g=v.id),p+=1)}const x=p>0?` · ${p} initial command${p===1?"":"s"} running`:"";Pt.success(`Launched ${f.sessions.length} session${f.sessions.length===1?"":"s"}${x}`),i(g??d),t()}finally{o(null)}};return w.jsx("div",{className:Ft.backdrop,onClick:t,role:"dialog","aria-modal":"true",children:w.jsxs("div",{className:Ft.modal,onClick:f=>f.stopPropagation(),children:[w.jsxs("div",{className:Ft.header,children:[w.jsxs("div",{className:Ft.titleBlock,children:[w.jsx("span",{className:Ft.title,children:"Open Workspace"}),c.length>0&&w.jsxs("span",{className:Ft.subtitle,children:[c.length," saved workspace",c.length===1?"":"s"]})]}),w.jsx("button",{className:Ft.closeBtn,onClick:t,"aria-label":"Close",children:"✕"})]}),w.jsx("div",{className:Ft.body,children:c.length===0?w.jsxs("div",{className:Ft.empty,children:[w.jsx("div",{className:Ft.emptyIcon,"aria-hidden":"true",children:"⊞"}),w.jsx("p",{className:Ft.emptyTitle,children:"No workspaces yet"}),w.jsxs("p",{className:Ft.emptyHint,children:["Open ",w.jsx("strong",{children:"Settings → Workspaces"})," after spinning up the sessions you want grouped, then click ",w.jsx("em",{children:"Save current as new workspace"}),"."]})]}):w.jsx("ul",{className:Ft.list,children:c.map(f=>{const d=l===f.id,g=f.sessions.filter(x=>(x.initialCommand??"").trim()).length,p=f.sessions.filter(x=>x.kind==="agent").length;return w.jsxs("li",{className:Ft.workspaceItem,children:[w.jsxs("button",{type:"button",className:Ft.workspaceHeader,onClick:()=>s(d?null:f.id),"aria-expanded":d,children:[w.jsxs("div",{className:Ft.workspaceTitleRow,children:[w.jsx("span",{className:Ft.workspaceName,children:f.name}),f.default&&w.jsx("span",{className:Ft.defaultBadge,children:"auto-start"})]}),w.jsxs("div",{className:Ft.workspaceMetaRow,children:[w.jsxs("span",{className:Ft.metaPill,children:[f.sessions.length," session",f.sessions.length===1?"":"s"]}),p>0&&w.jsxs("span",{className:Ft.metaPillAgent,children:[p," agent",p===1?"":"s"]}),g>0&&w.jsxs("span",{className:Ft.metaPillCmd,children:[g," command",g===1?"":"s"]}),w.jsx("span",{className:Ft.chevron,"aria-hidden":"true",children:d?"▾":"▸"})]}),w.jsx(dJ,{sessions:f.sessions})]}),d&&w.jsxs("div",{className:Ft.workspaceBody,children:[w.jsx("ul",{className:Ft.sessionList,children:f.sessions.map(x=>w.jsx(fJ,{session:x},x.id))}),w.jsx("button",{className:Ft.launchBtn,onClick:()=>u(f),disabled:n!==null||f.sessions.length===0,children:n===f.id?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:Ft.spinner,"aria-hidden":"true"}),"Launching…"]}):w.jsxs(w.Fragment,{children:["Launch"," ",f.sessions.length>1&&w.jsx("span",{className:Ft.launchCount,children:f.sessions.length})]})})]})]},f.id)})})})]})})}function dJ({sessions:e}){return e.length===0?null:w.jsx("div",{className:Ft.colorStrip,"aria-hidden":"true",children:e.slice(0,12).map((t,i)=>w.jsx("span",{className:Ft.colorStripSegment,style:{background:t.color||"var(--accent)"}},t.id+i))})}function fJ({session:e}){const t=uJ(e.cwd||"~"),i=SE(e.cwd||"");return w.jsxs("li",{className:Ft.sessionItem,children:[w.jsx("span",{className:Ft.sessionColorBar,style:{background:e.color||"var(--accent)"},"aria-hidden":"true"}),w.jsxs("div",{className:Ft.sessionMain,children:[w.jsxs("div",{className:Ft.sessionTopRow,children:[w.jsx("span",{className:Ft.sessionName,children:e.name}),w.jsx("span",{className:`${Ft.kindBadge} ${e.kind==="agent"?Ft.kindBadgeAgent:Ft.kindBadgeTerminal}`,children:e.kind==="agent"?"Agent":"Terminal"})]}),w.jsxs("div",{className:Ft.sessionPath,title:e.cwd||"~",children:[w.jsx("span",{className:Ft.pathIcon,"aria-hidden":"true",children:"⌘"}),w.jsx("span",{className:Ft.pathDir,children:i||"~"}),w.jsx("span",{className:Ft.pathFull,children:t})]}),e.initialCommand&&w.jsxs("div",{className:Ft.sessionCmdRow,title:e.initialCommand,children:[w.jsx("span",{className:Ft.cmdLabel,children:"$"}),w.jsx("code",{className:Ft.cmdText,children:e.initialCommand})]}),(e.shell||e.kind==="agent"&&e.agentId)&&w.jsxs("div",{className:Ft.sessionMeta,children:[e.shell&&w.jsxs("span",{className:Ft.metaItem,children:[w.jsx("span",{className:Ft.metaKey,children:"shell"}),w.jsx("code",{children:SE(e.shell)})]}),e.kind==="agent"&&e.agentId&&w.jsxs("span",{className:Ft.metaItem,children:[w.jsx("span",{className:Ft.metaKey,children:"agent"}),w.jsx("code",{children:e.agentId})]})]})]})]})}const ry={text:"",repo:null,branch:null,shell:null,hasAgent:!1};function ny(e){return e.shell?(e.shell.split(/[\\/]/).pop()??e.shell).replace(/\.exe$/i,""):""}function $A(e){return e.type==="copilot"||e.type==="agent"}function pJ(e,t){var r,n,o,l;if(t.hasAgent&&!$A(e)||t.repo&&((r=e.git)==null?void 0:r.repoName)!==t.repo||t.branch&&((n=e.git)==null?void 0:n.branch)!==t.branch||t.shell&&ny(e)!==t.shell)return!1;const i=t.text.trim().toLowerCase();return!(i&&![e.name,e.cwd,ny(e),((o=e.git)==null?void 0:o.branch)??"",((l=e.git)==null?void 0:l.repoName)??""].join(" ").toLowerCase().includes(i))}function gJ(e,t){return pg(t)?e:e.filter(i=>pJ(i,t))}function pg(e){return!e.text.trim()&&!e.repo&&!e.branch&&!e.shell&&!e.hasAgent}function mJ(e){var o,l;const t=new Set,i=new Set,r=new Set;let n=!1;for(const s of e){(o=s.git)!=null&&o.repoName&&t.add(s.git.repoName),(l=s.git)!=null&&l.branch&&i.add(s.git.branch);const c=ny(s);c&&r.add(c),$A(s)&&(n=!0)}return{repos:[...t].sort(),branches:[...i].sort(),shells:[...r].sort(),hasAnyAgent:n}}const _J="_bar_r5zbt_1",bJ="_searchRow_r5zbt_10",yJ="_searchInput_r5zbt_16",vJ="_clearBtn_r5zbt_32",CJ="_chips_r5zbt_43",xJ="_chip_r5zbt_43",SJ="_chipActive_r5zbt_64",wJ="_chipGroup_r5zbt_69",TJ="_chipMenu_r5zbt_73",kJ="_chipMenuItem_r5zbt_88",EJ="_chipMenuItemActive_r5zbt_106",Nn={bar:_J,searchRow:bJ,searchInput:yJ,clearBtn:vJ,chips:CJ,chip:xJ,chipActive:SJ,chipGroup:wJ,chipMenu:TJ,chipMenuItem:kJ,chipMenuItemActive:EJ};function AJ({filter:e,facets:t,onChange:i}){const[r,n]=N.useState(null),o=N.useRef(null);N.useEffect(()=>{if(!r)return;const c=u=>{var f;(f=o.current)!=null&&f.contains(u.target)||n(null)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[r]);const l=c=>i({...e,...c}),s=(c,u,f,d)=>{if(f.length===0&&!d)return null;const g=d??u,p=!!d,x=r===c;return w.jsxs("div",{className:Nn.chipGroup,ref:x?o:void 0,children:[w.jsxs("button",{type:"button",className:`${Nn.chip} ${p?Nn.chipActive:""}`,onClick:()=>n(y=>y===c?null:c),"aria-haspopup":"menu","aria-expanded":x,children:[p?"✓ ":"",g,p?"":" ▾"]}),x&&w.jsxs("div",{className:Nn.chipMenu,role:"menu",children:[d&&w.jsxs("button",{type:"button",className:Nn.chipMenuItem,onClick:()=>{l({[c]:null}),n(null)},role:"menuitem",children:["Clear ",u]}),f.map(y=>w.jsx("button",{type:"button",className:`${Nn.chipMenuItem} ${d===y?Nn.chipMenuItemActive:""}`,onClick:()=>{l({[c]:y}),n(null)},role:"menuitem",children:y},y))]})]},c)};return w.jsxs("div",{className:Nn.bar,"data-testid":"sessions-filter-bar",children:[w.jsxs("div",{className:Nn.searchRow,children:[w.jsx("input",{className:Nn.searchInput,placeholder:"Search name, path, branch…",value:e.text,onChange:c=>l({text:c.target.value}),"aria-label":"Search sessions",type:"search",autoComplete:"off",spellCheck:!1,"data-testid":"sessions-search"}),!pg(e)&&w.jsx("button",{type:"button",className:Nn.clearBtn,onClick:()=>i({text:"",repo:null,branch:null,shell:null,hasAgent:!1}),"aria-label":"Clear all filters",children:"Clear"})]}),w.jsxs("div",{className:Nn.chips,children:[t.hasAnyAgent&&w.jsxs("button",{type:"button",className:`${Nn.chip} ${e.hasAgent?Nn.chipActive:""}`,onClick:()=>l({hasAgent:!e.hasAgent}),"aria-pressed":e.hasAgent,children:[e.hasAgent?"✓ ":"","Has agent"]}),s("repo","Repo",t.repos,e.repo),s("branch","Branch",t.branches,e.branch),s("shell","Shell",t.shells,e.shell)]})]})}const qd=[{icon:"⌨️",title:"TouchBar is your secret weapon",body:"Esc, Tab, Ctrl, arrows — all live one tap away on the bar above the on-screen keyboard"},{icon:"🎤",title:"Talk to your terminal",body:"Drop a Mic key into the TouchBar to dictate commands hands-free"},{icon:"🤏",title:"Pinch to resize",body:"Two-finger pinch on the terminal scales the font — and we remember the size next time"},{icon:"↕️",title:"Stack more keys",body:"Tap the TouchBar handle to expand and reveal up to 3 rows for vim, tmux, or your own combos"},{icon:"⚙️",title:"Customize every key",body:"Tap ▦ → Settings → Touch Bar → Customize to set exactly what each key types"},{icon:"🔗",title:"Beam this terminal anywhere",body:"Tap the share button to copy a URL — open it on any device with the password and you are in"},{icon:"📱",title:"Add to Home Screen",body:"Install TermBeam as a PWA from your browser for full-screen, app-like access"},{icon:"🗂️",title:"Save a workspace",body:"Group your favorite sessions in Settings → Workspaces → Save current as new workspace, then re-launch with one tap"},{icon:"↺",title:"Pick up where you left off",body:"Resume Agent opens your latest Copilot, Claude, or OpenCode conversation in a fresh terminal with the full history"},{icon:"⏯",title:"Hold an arrow to repeat",body:"Long-press the arrow keys on the TouchBar for fast cursor movement, just like a real keyboard"},{icon:"🛰️",title:"Cellular access on the go",body:"An optional dev tunnel lets you reach this terminal from your phone over LTE — no VPN, no LAN, no fuss"},{icon:"🎨",title:"Theme to match your vibe",body:"Tap the palette icon in the header to switch themes — your choice syncs across every device"},{icon:"👈",title:"Swipe a session to delete",body:"Swipe a session card left to reveal its delete button — swipe right to snap it back"},{icon:"🔍",title:"Filter the noise",body:"When you have a few sessions running, the filter bar lets you narrow by repo, branch, or shell"},{icon:"📁",title:"Pin a default folder",body:"Set a default folder in Settings so every new session starts where you actually work"},{icon:"✨",title:"Auto-run on launch",body:"Set a default initial command in Settings to fire vim, tmux, or your agent the moment a session boots"},{icon:"🔔",title:"Get pinged when output goes quiet",body:"Enable Notifications in Settings — TermBeam beeps on bell signals or after a busy command goes silent"},{icon:"📳",title:"Feel every keypress",body:"Haptics on iOS-style devices add a subtle buzz to TouchBar taps — toggle in Settings → Notifications & Feedback"},{icon:"🧭",title:"Jump between sessions",body:"Tap ☰ to slide open the side panel and hop between every running session without leaving the terminal"},{icon:"📋",title:"Copy & paste, no jailbreak",body:"Long-press in the terminal to select text, then use the Copy and Paste keys on the TouchBar"},{icon:"🔄",title:"Always on the latest",body:"A banner appears at the top whenever a new TermBeam version ships — tap to grab the update"},{icon:"📡",title:"Reconnects on its own",body:"Lose signal in the elevator? TermBeam auto-reattaches when your phone is back online, scrollback intact"},{icon:"🪄",title:"Multiple shells, one tap",body:"Open ▦ → New tab and pick zsh, bash, pwsh — TermBeam auto-detects every shell installed on your machine"},{icon:"📑",title:"Watch the agent edit your code",body:"When Claude or Copilot edits a file through a tool call, the change renders as a diff right inside the chat"},{icon:"🔭",title:"Find in terminal",body:"Open ▦ → Find in terminal to search scrollback — regex is one tap away when you need it"},{icon:"🪟",title:"Split the screen",body:"Open ▦ → Split vertical or Split horizontal to put two terminals side by side — tests in one, edits in the other"},{icon:"🏷️",title:"Name your sessions",body:'Rename a session from the Tools panel so the side panel reads "api" or "logs" instead of a hash'},{icon:"📤",title:"Push files from your phone",body:"Open ▦ → Upload files to drop photos, configs, or anything else straight into your working directory"},{icon:"📥",title:"Pull files back",body:"Use ▦ → Download file to grab a build artifact, log, or screenshot off the server in one tap"},{icon:"📖",title:"Read READMEs in style",body:"Open ▦ → View markdown to render any .md file from your repo with proper headings and code blocks"},{icon:"🌐",title:"Preview a local port on your phone",body:"Tap ▦ → Preview port to expose a dev server (3000, 5173, …) through the tunnel so you can hit it from anywhere"},{icon:"🪵",title:"See the diff before you commit",body:"Open ▦ → Git changes for a quick look at staged and unstaged hunks without leaving the terminal"},{icon:"🗒️",title:"Sessions live in tabs",body:"Tap ▦ → New tab to spin up another session — switch between every running session from the tab bar at the top"},{icon:"🧹",title:"Clean slate, no typing",body:"Hit ▦ → Clear terminal to wipe both the viewport and scrollback — quicker than reaching for the on-screen keyboard"},{icon:"🧯",title:"Filter folders as you type",body:"In the folder picker, start typing any path fragment — the list narrows live so you never scroll a deep tree"},{icon:"📎",title:"Paste many lines, no surprises",body:"Multi-line pastes use bracketed-paste markers so the shell treats them as one chunk — no stray commands sneak through"},{icon:"🔐",title:"One password, many devices",body:"Use the same TermBeam URL and password to attach from your laptop, tablet, and phone at once — every view stays in sync"},{icon:"👀",title:"Watch a teammate live",body:"Multiple browsers attached to the same session see the same output frame-by-frame — great for pair debugging"},{icon:"🖋️",title:"Tweak the font, not the world",body:"Use ▦ → Increase/Decrease font size for finer control than pinch — perfect for reading code on a small screen"},{icon:"ℹ️",title:"Wondering what version you are on?",body:"Tap ▦ → About to see the running version, links to docs and source, and a one-tap update check"}];function LJ(e=Math.random()){return Math.floor(e*qd.length)%qd.length}function BJ(e){const t=qd.length,i=(e%t+t)%t;return qd[i]}const MJ="_page_lcfvw_1",RJ="_header_lcfvw_11",DJ="_brand_lcfvw_25",NJ="_title_lcfvw_32",OJ="_version_lcfvw_47",IJ="_headerActions_lcfvw_56",FJ="_headerBtn_lcfvw_63",PJ="_content_lcfvw_89",HJ="_sessionsList_lcfvw_94",$J="_emptyState_lcfvw_113",jJ="_emptyIcon_lcfvw_124",zJ="_emptyText_lcfvw_129",UJ="_emptyHint_lcfvw_133",qJ="_emptyHintButton_lcfvw_138",WJ="_tipCard_lcfvw_158",YJ="_tipBadge_lcfvw_180",GJ="_tipIcon_lcfvw_195",VJ="_tipBody_lcfvw_202",XJ="_tipTitle_lcfvw_210",KJ="_tipText_lcfvw_216",QJ="_tipNav_lcfvw_223",ZJ="_tipNavBtn_lcfvw_234",JJ="_tipCounter_lcfvw_267",eee="_hubFooter_lcfvw_276",tee="_newSessionBtn_lcfvw_289",iee="_resumeBtn_lcfvw_314",ree="_workspaceBtn_lcfvw_338",Ei={page:MJ,header:RJ,brand:DJ,title:NJ,version:OJ,headerActions:IJ,headerBtn:FJ,content:PJ,sessionsList:HJ,emptyState:$J,emptyIcon:jJ,emptyText:zJ,emptyHint:UJ,emptyHintButton:qJ,tipCard:WJ,tipBadge:YJ,tipIcon:GJ,tipBody:VJ,tipTitle:XJ,tipText:KJ,tipNav:QJ,tipNavBtn:ZJ,tipCounter:JJ,hubFooter:eee,newSessionBtn:tee,resumeBtn:iee,workspaceBtn:ree},nee=3e3,sy="termbeam-hub-filter",wE=40;function see(){try{const e=sessionStorage.getItem(sy);if(!e)return ry;const t=JSON.parse(e);return{text:typeof t.text=="string"?t.text:"",repo:typeof t.repo=="string"?t.repo:null,branch:typeof t.branch=="string"?t.branch:null,shell:typeof t.shell=="string"?t.shell:null,hasAgent:!!t.hasAgent}}catch{return ry}}const aee=()=>w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]});function oee(){const[e,t]=N.useState([]),[i,r]=N.useState(!0),[n,o]=N.useState(!1),[l,s]=N.useState(""),[c,u]=N.useState(null),[f,d]=N.useState(()=>see()),[g,p]=N.useState(!1),x=N.useRef(null),y=N.useRef(!0),{openNewSessionModal:_,openResumeBrowser:b,themePickerOpen:v,closeThemePicker:C,toggleToolsPanel:k,customKeysModalOpen:E,closeCustomKeysModal:T}=Je(),A=ht(V=>V.dissolvingIds),L=Sv(),M=N.useCallback(async()=>{try{const $=(await _d()).filter(Y=>!Y.hidden);t(Y=>{const ee=new Set($.map(J=>J.id)),ne=Y.filter(J=>ht.getState().dissolvingIds.has(J.id)&&!ee.has(J.id));return[...$,...ne]})}catch{}finally{r(!1)}},[]);N.useEffect(()=>{M();const V=setInterval(M,nee);return()=>clearInterval(V)},[M]),N.useEffect(()=>{if(y.current&&!i){o(!0);const V=setTimeout(()=>o(!1),2200);return y.current=i,()=>clearTimeout(V)}y.current=i},[i]),N.useEffect(()=>{xv().then(V=>{V&&s(V)})},[]),N.useEffect(()=>{try{pg(f)?sessionStorage.removeItem(sy):sessionStorage.setItem(sy,JSON.stringify(f))}catch{}},[f]);const D=N.useMemo(()=>mJ(e),[e]),P=N.useMemo(()=>gJ(e,f),[e,f]),z=!pg(f),[U,W]=N.useState(()=>LJ()),Z=BJ(U),j=qd.length,G=N.useCallback(()=>W(V=>V-1),[]),X=N.useCallback(()=>W(V=>V+1),[]),F=N.useRef(null);function O(V){window.history.pushState(null,"",`/terminal?session=${V}`),window.dispatchEvent(new PopStateEvent("popstate"))}async function H(V){var ee;const $=e.find(ne=>ne.id===V),Y=(ee=x.current)==null?void 0:ee.querySelector(`[data-session-id="${V}"]`);try{await L(V,{element:Y??null,color:($==null?void 0:$.color)??"#6ec1e4",apiDelete:()=>Pd(V),finalize:()=>{const ne=ht.getState(),J=ne.sessions.get(V);J!=null&&J.companionTermId&&ne.removeSession(J.companionTermId),ne.removeSession(V),t(K=>K.filter(le=>le.id!==V))}}),Pt.success(`Session "${($==null?void 0:$.name)??V}" deleted`)}catch(ne){Pt.error(ne instanceof Error?ne.message:"Failed to delete session")}}return N.useEffect(()=>{const V=$=>{if(($.ctrlKey||$.metaKey)&&$.key==="k"){const Y=$.target;if((Y==null?void 0:Y.tagName)==="INPUT"||(Y==null?void 0:Y.tagName)==="TEXTAREA"||(Y==null?void 0:Y.isContentEditable))return;$.preventDefault(),k()}};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[k]),w.jsxs("div",{className:Ei.page,children:[w.jsx(CK,{}),w.jsx(AK,{}),w.jsxs("header",{className:Ei.header,children:[w.jsx("div",{className:Ei.brand,children:w.jsxs("h1",{className:Ei.title,children:[w.jsx(lg,{size:"sm",animated:!1}),l?w.jsxs("span",{className:Ei.version,"data-testid":"hub-version",children:["v",l]}):null]})}),w.jsx("div",{className:Ei.headerActions,children:w.jsx("button",{className:Ei.headerBtn,onClick:k,"aria-label":"Tools",title:"Tools (Ctrl+K)","data-testid":"palette-trigger",children:w.jsx(aee,{})})})]}),w.jsx(Tv,{open:v,onClose:C,hideTrigger:!0}),w.jsx(IA,{inHub:!0}),w.jsx(G4,{inHub:!0}),w.jsx(K4,{open:E,onClose:T}),w.jsx("main",{className:Ei.content,"aria-busy":i||void 0,children:i?null:e.length===0?w.jsxs("div",{className:Ei.emptyState,"data-testid":"empty-state",children:[w.jsx(lg,{size:"md"}),w.jsx("span",{className:Ei.emptyText,children:"No active sessions"}),w.jsx("span",{className:Ei.emptyHint,children:'Tap "+ New Session" to create a new terminal session'}),w.jsxs("div",{className:Ei.tipCard,"data-testid":"hub-tip",role:"region","aria-label":"Tip carousel","aria-live":"polite",onTouchStart:V=>{var $;F.current=(($=V.touches[0])==null?void 0:$.clientX)??null},onTouchEnd:V=>{var ee;const $=F.current;if(F.current=null,$==null)return;const Y=(((ee=V.changedTouches[0])==null?void 0:ee.clientX)??$)-$;Y<=-wE?X():Y>=wE&&G()},children:[w.jsx("span",{className:Ei.tipBadge,children:"Tip"}),w.jsx("span",{className:Ei.tipIcon,"aria-hidden":"true",children:Z.icon}),w.jsxs("div",{className:Ei.tipBody,children:[w.jsx("strong",{className:Ei.tipTitle,children:Z.title}),w.jsx("span",{className:Ei.tipText,children:Z.body})]}),w.jsxs("div",{className:Ei.tipNav,"data-testid":"hub-tip-nav",children:[w.jsx("button",{type:"button",className:Ei.tipNavBtn,onClick:G,"aria-label":"Previous tip","data-testid":"hub-tip-prev",children:w.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("polyline",{points:"15 18 9 12 15 6"})})}),w.jsxs("span",{className:Ei.tipCounter,"aria-label":`Tip ${(U%j+j)%j+1} of ${j}`,"data-testid":"hub-tip-counter",children:[(U%j+j)%j+1,w.jsxs("span",{"aria-hidden":"true",children:[" / ",j]})]}),w.jsx("button",{type:"button",className:Ei.tipNavBtn,onClick:X,"aria-label":"Next tip","data-testid":"hub-tip-next",children:w.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("polyline",{points:"9 18 15 12 9 6"})})})]})]})]}):w.jsxs(w.Fragment,{children:[w.jsx(AJ,{filter:f,facets:D,onChange:d}),P.length===0?w.jsxs("div",{className:Ei.emptyState,"data-testid":"empty-filtered",children:[w.jsx("span",{className:Ei.emptyIcon,children:"🔍"}),w.jsx("span",{className:Ei.emptyText,children:"No sessions match your filters"}),w.jsx("button",{type:"button",className:`${Ei.emptyHint} ${Ei.emptyHintButton}`,onClick:()=>d(ry),children:"Clear filters"})]}):w.jsx("div",{ref:x,className:Ei.sessionsList,"data-testid":"sessions-list","data-filter-active":z||void 0,"data-arriving":n||void 0,children:P.map((V,$)=>w.jsx(JK,{session:V,onSelect:O,onDelete:H,revealedId:c,onRevealChange:u,index:$,arriving:n,dissolving:A.has(V.id)},V.id))})]})}),w.jsxs("div",{className:Ei.hubFooter,children:[w.jsx("button",{className:Ei.newSessionBtn,onClick:()=>_(),"aria-label":"New session","data-testid":"hub-new-session-btn",children:"+ New Session"}),w.jsx("button",{className:Ei.resumeBtn,onClick:b,"aria-label":"Resume agent",children:"↺ Resume Agent"}),w.jsx("button",{className:Ei.workspaceBtn,onClick:()=>p(!0),"aria-label":"Open workspace","data-testid":"hub-open-workspace-btn",children:"Open Workspace"})]}),w.jsx(PA,{onCreated:O}),w.jsx(HA,{}),w.jsx(hJ,{open:g,onClose:()=>p(!1),onLaunched:V=>{V&&O(V)}})]})}function lee(){const e=N.useRef(null);N.useEffect(()=>{if(!("wakeLock"in navigator))return;async function t(){try{e.current=await navigator.wakeLock.request("screen")}catch{}}function i(){document.visibilityState==="visible"&&t()}return t(),document.addEventListener("visibilitychange",i),()=>{var r;document.removeEventListener("visibilitychange",i),(r=e.current)==null||r.release().catch(()=>{}),e.current=null}},[])}const TE=50;function vm(){var r;const[e,t]=N.useState({keyboardOpen:!1,keyboardHeight:0}),i=N.useRef(((r=window.visualViewport)==null?void 0:r.height)??window.innerHeight);return N.useEffect(()=>{const n=window.visualViewport;if(!n)return;i.current=n.height;let o=n.width,l=!1,s;function c(){l=!0,t({keyboardOpen:!1,keyboardHeight:0}),clearTimeout(s),s=setTimeout(()=>{i.current=n.height,o=n.width,l=!1;const g=i.current-n.height,p=g>TE;t({keyboardOpen:p,keyboardHeight:p?g:0})},500)}function u(){if(n.width!==o){c();return}if(l)return;const g=n.height,p=i.current-g,x=p>TE;t({keyboardOpen:x,keyboardHeight:x?p:0})}function f(){c()}n.addEventListener("resize",u);const d=screen.orientation;return d&&d.addEventListener("change",f),window.addEventListener("orientationchange",f),()=>{clearTimeout(s),n.removeEventListener("resize",u),d&&d.removeEventListener("change",f),window.removeEventListener("orientationchange",f)}},[]),e}var $_={exports:{}},kE;function cee(){return kE||(kE=1,(function(e,t){(function(i,r){e.exports=r()})(globalThis,(()=>(()=>{var i={4567:function(l,s,c){var u=this&&this.__decorate||function(v,C,k,E){var T,A=arguments.length,L=A<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,C,k,E);else for(var M=v.length-1;M>=0;M--)(T=v[M])&&(L=(A<3?T(L):A>3?T(C,k,L):T(C,k))||L);return A>3&&L&&Object.defineProperty(C,k,L),L},f=this&&this.__param||function(v,C){return function(k,E){C(k,E,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const d=c(9042),g=c(9924),p=c(844),x=c(4725),y=c(2585),_=c(3656);let b=s.AccessibilityManager=class extends p.Disposable{constructor(v,C,k,E){super(),this._terminal=v,this._coreBrowserService=k,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
122
|
+
`))}function c(p,x,y,_){const b=y.enter("tableCell"),v=y.enter("phrasing"),C=y.containerPhrasing(p,{..._,before:o,after:o});return v(),b(),C}function u(p,x){return YG(p,{align:x,alignDelimiters:r,padding:i,stringLength:n})}function f(p,x,y){const _=p.children;let b=-1;const v=[],C=x.enter("table");for(;++b<_.length;)v[b]=d(_[b],x,y);return C(),v}function d(p,x,y){const _=p.children;let b=-1;const v=[],C=x.enter("tableRow");for(;++b<_.length;)v[b]=c(_[b],p,x,y);return C(),v}function g(p,x,y){let _=EA.inlineCode(p,x,y);return y.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function DV(){return{exit:{taskListCheckValueChecked:gE,taskListCheckValueUnchecked:gE,paragraph:OV}}}function NV(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IV}}}function gE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function OV(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const r=i.children[0];if(r&&r.type==="text"){const n=t.children;let o=-1,l;for(;++o<n.length;){const s=n[o];if(s.type==="paragraph"){l=s;break}}l===i&&(r.value=r.value.slice(1),r.value.length===0?i.children.shift():i.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,i.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function IV(e,t,i,r){const n=e.children[0],o=typeof e.checked=="boolean"&&n&&n.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=i.createTracker(r);o&&s.move(l);let c=EA.listItem(e,t,i,{...r,...s.current()});return o&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(f){return f+l}}function FV(){return[gG(),IG(),$G(),kV(),DV()]}function PV(e){return{extensions:[mG(),FG(e),jG(),RV(e),NV()]}}const HV={tokenize:WV,partial:!0},AA={tokenize:YV,partial:!0},LA={tokenize:GV,partial:!0},BA={tokenize:VV,partial:!0},$V={tokenize:XV,partial:!0},MA={name:"wwwAutolink",tokenize:UV,previous:DA},RA={name:"protocolAutolink",tokenize:qV,previous:NA},Va={name:"emailAutolink",tokenize:zV,previous:OA},da={};function jV(){return{text:da}}let pl=48;for(;pl<123;)da[pl]=Va,pl++,pl===58?pl=65:pl===91&&(pl=97);da[43]=Va;da[45]=Va;da[46]=Va;da[95]=Va;da[72]=[Va,RA];da[104]=[Va,RA];da[87]=[Va,MA];da[119]=[Va,MA];function zV(e,t,i){const r=this;let n,o;return l;function l(d){return!ty(d)||!OA.call(r,r.previous)||qv(r.events)?i(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(d))}function s(d){return ty(d)?(e.consume(d),s):d===64?(e.consume(d),c):i(d)}function c(d){return d===46?e.check($V,f,u)(d):d===45||d===95||hn(d)?(o=!0,e.consume(d),c):f(d)}function u(d){return e.consume(d),n=!0,c}function f(d){return o&&n&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):i(d)}}function UV(e,t,i){const r=this;return n;function n(l){return l!==87&&l!==119||!DA.call(r,r.previous)||qv(r.events)?i(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(HV,e.attempt(AA,e.attempt(LA,o),i),i)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function qV(e,t,i){const r=this;let n="",o=!1;return l;function l(d){return(d===72||d===104)&&NA.call(r,r.previous)&&!qv(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),n+=String.fromCodePoint(d),e.consume(d),s):i(d)}function s(d){if(vn(d)&&n.length<5)return n+=String.fromCodePoint(d),e.consume(d),s;if(d===58){const g=n.toLowerCase();if(g==="http"||g==="https")return e.consume(d),c}return i(d)}function c(d){return d===47?(e.consume(d),o?u:(o=!0,c)):i(d)}function u(d){return d===null||hg(d)||Yi(d)||Dl(d)||pm(d)?i(d):e.attempt(AA,e.attempt(LA,f),i)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function WV(e,t,i){let r=0;return n;function n(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),n):l===46&&r===3?(e.consume(l),o):i(l)}function o(l){return l===null?i(l):t(l)}}function YV(e,t,i){let r,n,o;return l;function l(u){return u===46||u===95?e.check(BA,c,s)(u):u===null||Yi(u)||Dl(u)||u!==45&&pm(u)?c(u):(o=!0,e.consume(u),l)}function s(u){return u===95?r=!0:(n=r,r=void 0),e.consume(u),l}function c(u){return n||r||!o?i(u):t(u)}}function GV(e,t){let i=0,r=0;return n;function n(l){return l===40?(i++,e.consume(l),n):l===41&&r<i?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(BA,t,o)(l):l===null||Yi(l)||Dl(l)?t(l):(e.consume(l),n)}function o(l){return l===41&&r++,e.consume(l),n}}function VV(e,t,i){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),n):s===60||s===null||Yi(s)||Dl(s)?t(s):i(s)}function n(s){return s===null||s===40||s===91||Yi(s)||Dl(s)?t(s):r(s)}function o(s){return vn(s)?l(s):i(s)}function l(s){return s===59?(e.consume(s),r):vn(s)?(e.consume(s),l):i(s)}}function XV(e,t,i){return r;function r(o){return e.consume(o),n}function n(o){return hn(o)?i(o):t(o)}}function DA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Yi(e)}function NA(e){return!vn(e)}function OA(e){return!(e===47||ty(e))}function ty(e){return e===43||e===45||e===46||e===95||hn(e)}function qv(e){let t=e.length,i=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){i=!0;break}if(r._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const KV={tokenize:nX,partial:!0};function QV(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tX,continuation:{tokenize:iX},exit:rX}},text:{91:{name:"gfmFootnoteCall",tokenize:eX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ZV,resolveTo:JV}}}}function ZV(e,t,i){const r=this;let n=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;n--;){const c=r.events[n][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return s;function s(c){if(!l||!l._balanced)return i(c);const u=Hs(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?i(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function JV(e,t){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},n={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};n.end.column++,n.end.offset++,n.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},n.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[i+1],e[i+2],["enter",r,t],e[i+3],e[i+4],["enter",n,t],["exit",n,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(i,e.length-i+1,...s),e}function eX(e,t,i){const r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return s;function s(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?i(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(o>999||d===93&&!l||d===null||d===91||Yi(d))return i(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteCallString");return n.includes(Hs(r.sliceSerialize(g)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):i(d)}return Yi(d)||(l=!0),o++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),o++,u):u(d)}}function tX(e,t,i){const r=this,n=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,s;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):i(x)}function f(x){if(l>999||x===93&&!s||x===null||x===91||Yi(x))return i(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return o=Hs(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),g}return Yi(x)||(s=!0),l++,e.consume(x),x===92?d:f}function d(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}function g(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),n.includes(o)||n.push(o),mi(e,p,"gfmFootnoteDefinitionWhitespace")):i(x)}function p(x){return t(x)}}function iX(e,t,i){return e.check(hf,t,e.attempt(KV,t,i))}function rX(e){e.exit("gfmFootnoteDefinition")}function nX(e,t,i){const r=this;return mi(e,n,"gfmFootnoteDefinitionIndent",5);function n(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):i(o)}}function sX(e){let i=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:n};return i==null&&(i=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function n(l,s){let c=-1;for(;++c<l.length;)if(l[c][0]==="enter"&&l[c][1].type==="strikethroughSequenceTemporary"&&l[c][1]._close){let u=c;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[c][1].end.offset-l[c][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[c][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[c][1].end)},d={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[c][1].start)},g=[["enter",f,s],["enter",l[u][1],s],["exit",l[u][1],s],["enter",d,s]],p=s.parser.constructs.insideSpan.null;p&&as(g,g.length,0,gm(p,l.slice(u+1,c),s)),as(g,g.length,0,[["exit",d,s],["enter",l[c][1],s],["exit",l[c][1],s],["exit",f,s]]),as(l,u-1,c-u+3,g),c=u+g.length-2;break}}for(c=-1;++c<l.length;)l[c][1].type==="strikethroughSequenceTemporary"&&(l[c][1].type="data");return l}function o(l,s,c){const u=this.previous,f=this.events;let d=0;return g;function g(x){return u===126&&f[f.length-1][1].type!=="characterEscape"?c(x):(l.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const y=bu(u);if(x===126)return d>1?c(x):(l.consume(x),d++,p);if(d<2&&!i)return c(x);const _=l.exit("strikethroughSequenceTemporary"),b=bu(x);return _._open=!b||b===2&&!!y,_._close=!y||y===2&&!!b,s(x)}}}class aX{constructor(){this.map=[]}add(t,i,r){oX(this,t,i,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let i=this.map.length;const r=[];for(;i>0;)i-=1,r.push(t.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),t.length=this.map[i][0];r.push(t.slice()),t.length=0;let n=r.pop();for(;n;){for(const o of n)t.push(o);n=r.pop()}this.map.length=0}}function oX(e,t,i,r){let n=0;if(!(i===0&&r.length===0)){for(;n<e.map.length;){if(e.map[n][0]===t){e.map[n][1]+=i,e.map[n][2].push(...r);return}n+=1}e.map.push([t,i,r])}}function lX(e,t){let i=!1;const r=[];for(;t<e.length;){const n=e[t];if(i){if(n[0]==="enter")n[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(n[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(n[1].type==="tableDelimiterRow")break}else n[0]==="enter"&&n[1].type==="tableDelimiterRow"&&(i=!0);t+=1}return r}function cX(){return{flow:{null:{name:"table",tokenize:uX,resolveAll:hX}}}}function uX(e,t,i){const r=this;let n=0,o=0,l;return s;function s(D){let P=r.events.length-1;for(;P>-1;){const W=r.events[P][1].type;if(W==="lineEnding"||W==="linePrefix")P--;else break}const z=P>-1?r.events[P][1].type:null,U=z==="tableHead"||z==="tableRow"?T:c;return U===T&&r.parser.lazy[r.now().line]?i(D):U(D)}function c(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(l=!0,o+=1),f(D)}function f(D){return D===null?i(D):Dt(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),p):i(D):li(D)?mi(e,f,"whitespace")(D):(o+=1,l&&(l=!1,n+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),d(D)))}function d(D){return D===null||D===124||Yi(D)?(e.exit("data"),f(D)):(e.consume(D),D===92?g:d)}function g(D){return D===92||D===124?(e.consume(D),d):d(D)}function p(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?i(D):(e.enter("tableDelimiterRow"),l=!1,li(D)?mi(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):x(D))}function x(D){return D===45||D===58?_(D):D===124?(l=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),y):E(D)}function y(D){return li(D)?mi(e,_,"whitespace")(D):_(D)}function _(D){return D===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),b):D===45?(o+=1,b(D)):D===null||Dt(D)?k(D):E(D)}function b(D){return D===45?(e.enter("tableDelimiterFiller"),v(D)):E(D)}function v(D){return D===45?(e.consume(D),v):D===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(D))}function C(D){return li(D)?mi(e,k,"whitespace")(D):k(D)}function k(D){return D===124?x(D):D===null||Dt(D)?!l||n!==o?E(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):E(D)}function E(D){return i(D)}function T(D){return e.enter("tableRow"),A(D)}function A(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),A):D===null||Dt(D)?(e.exit("tableRow"),t(D)):li(D)?mi(e,A,"whitespace")(D):(e.enter("data"),L(D))}function L(D){return D===null||D===124||Yi(D)?(e.exit("data"),A(D)):(e.consume(D),D===92?M:L)}function M(D){return D===92||D===124?(e.consume(D),L):L(D)}}function hX(e,t){let i=-1,r=!0,n=0,o=[0,0,0,0],l=[0,0,0,0],s=!1,c=0,u,f,d;const g=new aX;for(;++i<e.length;){const p=e[i],x=p[1];p[0]==="enter"?x.type==="tableHead"?(s=!1,c!==0&&(mE(g,t,c,u,f),f=void 0,c=0),u={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},g.add(i,0,[["enter",u,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],l=[0,i+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},g.add(i,0,[["enter",f,t]])),n=x.type==="tableDelimiterRow"?2:f?3:1):n&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],d=tp(g,t,o,n,void 0,d),o=[0,0,0,0]),l[2]=i)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],d=tp(g,t,o,n,void 0,d)),o=l,l=[o[1],i,0,0])):x.type==="tableHead"?(s=!0,c=i):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=i,o[1]!==0?(l[0]=l[1],d=tp(g,t,o,n,i,d)):l[1]!==0&&(d=tp(g,t,l,n,i,d)),n=0):n&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=i)}for(c!==0&&mE(g,t,c,u,f),g.consume(t.events),i=-1;++i<t.events.length;){const p=t.events[i];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=lX(t.events,i))}return e}function tp(e,t,i,r,n,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";i[0]!==0&&(o.end=Object.assign({},jc(t.events,i[0])),e.add(i[0],0,[["exit",o,t]]));const c=jc(t.events,i[1]);if(o={type:l,start:Object.assign({},c),end:Object.assign({},c)},e.add(i[1],0,[["enter",o,t]]),i[2]!==0){const u=jc(t.events,i[2]),f=jc(t.events,i[3]),d={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(i[2],0,[["enter",d,t]]),r!==2){const g=t.events[i[2]],p=t.events[i[3]];if(g[1].end=Object.assign({},p[1].end),g[1].type="chunkText",g[1].contentType="text",i[3]>i[2]+1){const x=i[2]+1,y=i[3]-i[2]-1;e.add(x,y,[])}}e.add(i[3]+1,0,[["exit",d,t]])}return n!==void 0&&(o.end=Object.assign({},jc(t.events,n)),e.add(n,0,[["exit",o,t]]),o=void 0),o}function mE(e,t,i,r,n){const o=[],l=jc(t.events,i);n&&(n.end=Object.assign({},l),o.push(["exit",n,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(i+1,0,o)}function jc(e,t){const i=e[t],r=i[0]==="enter"?"start":"end";return i[1][r]}const dX={name:"tasklistCheck",tokenize:pX};function fX(){return{text:{91:dX}}}function pX(e,t,i){const r=this;return n;function n(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?i(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),o)}function o(c){return Yi(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):i(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):i(c)}function s(c){return Dt(c)?t(c):li(c)?e.check({tokenize:gX},t,i)(c):i(c)}}function gX(e,t,i){return mi(e,r,"whitespace");function r(n){return n===null?i(n):t(n)}}function mX(e){return q6([jV(),QV(),sX(e),cX(),fX()])}const _X={};function Cu(e){const t=this,i=e||_X,r=t.data(),n=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);n.push(mX(i)),o.push(FV()),l.push(PV(i))}const bX="_overlay_153fc_1",yX="_content_153fc_9",vX="_title_153fc_25",CX="_description_153fc_32",xX="_label_153fc_38",SX="_input_153fc_45",wX="_actions_153fc_73",TX="_cancelBtn_153fc_80",kX="_openBtn_153fc_95",EX="_close_153fc_116",sn={overlay:bX,content:yX,title:vX,description:CX,label:xX,input:SX,actions:wX,cancelBtn:TX,openBtn:kX,close:EX},AX="_changelogHeader_17ycj_1",LX="_changelog_17ycj_1",BX="_changelogPlaceholder_17ycj_56",MX="_wide_17ycj_63",$h={changelogHeader:AX,changelog:LX,changelogPlaceholder:BX,wide:MX};function _E({open:e,onClose:t,version:i}){const[r,n]=N.useState(""),[o,l]=N.useState(!1),[s,c]=N.useState(null),[u,f]=N.useState("idle"),d=N.useRef(!1);N.useEffect(()=>{e&&(d.current||(d.current=!0,f("loading"),oF().then(x=>{x?(c(x),f("loaded")):(f("error"),d.current=!1)})))},[e]);const g=N.useCallback(async()=>{l(!0),n("");try{const x=await Cv(!0);x?x.updateAvailable?n(`Update available: v${x.latest} (current: v${x.current})`):n(`You're up to date (v${x.current})`):n("Unable to check for updates")}catch{n("Unable to check for updates")}finally{l(!1)}},[]),p=N.useCallback(()=>{n(""),t()},[t]);return w.jsx(om,{open:e,onOpenChange:x=>!x&&p(),children:w.jsxs(lm,{children:[w.jsx(cm,{className:sn.overlay}),w.jsxs(um,{className:`${sn.content} ${$h.wide}`,children:[w.jsxs(hm,{className:sn.title,children:["TermBeam ",i?`v${i}`:""]}),w.jsx(A6,{className:sn.description,children:"Terminal in your browser, optimized for mobile."}),w.jsx("button",{className:sn.close,onClick:p,"aria-label":"Close",children:"✕"}),w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[w.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[w.jsx("a",{href:"https://github.com/dorlugasigal/TermBeam",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",fontSize:"0.9rem"},children:"GitHub"}),w.jsx("a",{href:"https://dorlugasigal.github.io/TermBeam/",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)",fontSize:"0.9rem"},children:"Docs"})]}),w.jsx("div",{className:sn.actions,style:{justifyContent:"flex-start"},children:w.jsx("button",{type:"button",className:sn.openBtn,onClick:g,disabled:o,style:{fontSize:"0.85rem"},children:o?"Checking…":"Check for updates"})}),r&&w.jsx("div",{style:{fontSize:"0.8rem",color:"var(--text-secondary)"},children:r}),w.jsx("div",{className:$h.changelogHeader,children:"What's new"}),u==="loading"&&w.jsx("div",{className:$h.changelogPlaceholder,children:"Loading release notes…"}),u==="error"&&w.jsxs("div",{className:$h.changelogPlaceholder,children:["Couldn't load release notes."," ",w.jsx("a",{href:"https://github.com/dorlugasigal/TermBeam/releases",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent)"},children:"View on GitHub"})]}),u==="loaded"&&s&&w.jsx("div",{className:$h.changelog,children:w.jsx(vu,{remarkPlugins:[Cu],children:s})})]})]})]})})}const RX="_backdrop_wfjb2_1",DX="_backdropOpen_wfjb2_11",NX="_panel_wfjb2_16",OX="_panelOpen_wfjb2_31",IX="_header_wfjb2_35",FX="_title_wfjb2_44",PX="_closeBtn_wfjb2_50",HX="_body_wfjb2_65",$X="_section_wfjb2_71",jX="_sectionTitle_wfjb2_75",zX="_btn_wfjb2_84",UX="_themePickerRow_wfjb2_110",bs={backdrop:RX,backdropOpen:DX,panel:NX,panelOpen:OX,header:IX,title:FX,closeBtn:PX,body:HX,section:$X,sectionTitle:jX,btn:zX,themePickerRow:UX},qX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),w.jsx("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]}),WX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3"}),w.jsx("polyline",{points:"5 5 8 2 11 5"}),w.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"10"})]}),YX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3"}),w.jsx("polyline",{points:"5 11 8 14 11 11"}),w.jsx("line",{x1:"8",y1:"14",x2:"8",y2:"6"})]}),GX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),w.jsx("polyline",{points:"4 9 5.5 7 7 9"}),w.jsx("line",{x1:"9",y1:"9",x2:"9",y2:"7"}),w.jsx("polyline",{points:"9 7 10.5 8.5 12 7"})]}),VX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M11 2l3 3-8 8H3v-3z"}),w.jsx("line",{x1:"9",y1:"4",x2:"12",y2:"7"})]}),XX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"14"})]}),KX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),w.jsx("line",{x1:"2",y1:"8",x2:"14",y2:"8"})]}),QX=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"})}),ZX=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})}),JX=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"7",cy:"7",r:"4"}),w.jsx("line",{x1:"10",y1:"10",x2:"14",y2:"14"})]}),eK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 13L8 3l5 10"}),w.jsx("line",{x1:"5",y1:"9",x2:"11",y2:"9"}),w.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"1"}),w.jsx("line",{x1:"11",y1:"3",x2:"15",y2:"3"})]}),tK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 13L8 3l5 10"}),w.jsx("line",{x1:"5",y1:"9",x2:"11",y2:"9"}),w.jsx("line",{x1:"11",y1:"3",x2:"15",y2:"3"})]}),iK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),w.jsx("line",{x1:"5",y1:"13",x2:"11",y2:"13"}),w.jsx("line",{x1:"8",y1:"13",x2:"8",y2:"15"})]}),rK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M6.5 9.5a3 3 0 004 .5l2-2a3 3 0 00-4.24-4.24L7 5"}),w.jsx("path",{d:"M9.5 6.5a3 3 0 00-4-.5l-2 2a3 3 0 004.24 4.24L9 11"})]}),nK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("polyline",{points:"5 4 1 8 5 12"}),w.jsx("polyline",{points:"11 4 15 8 11 12"}),w.jsx("line",{x1:"9",y1:"2",x2:"7",y2:"14"})]}),sK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"4",cy:"4",r:"2"}),w.jsx("circle",{cx:"4",cy:"12",r:"2"}),w.jsx("circle",{cx:"12",cy:"8",r:"2"}),w.jsx("path",{d:"M4 6v4"}),w.jsx("path",{d:"M6 4.5c3 0 4 1.5 4 3.5"})]}),aK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M2 8a6 6 0 0110.47-4"}),w.jsx("polyline",{points:"12 1 13 4 10 5"}),w.jsx("path",{d:"M14 8a6 6 0 01-10.47 4"}),w.jsx("polyline",{points:"4 15 3 12 6 11"})]}),oK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 4h10"}),w.jsx("path",{d:"M5 4V3a1 1 0 011-1h4a1 1 0 011 1v1"}),w.jsx("path",{d:"M4 4l1 10a1 1 0 001 1h4a1 1 0 001-1l1-10"})]}),lK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"8",cy:"8",r:"6"}),w.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11"}),w.jsx("circle",{cx:"8",cy:"5",r:".5",fill:"currentColor"})]}),cK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("polyline",{points:"1 4 1 10 7 10"}),w.jsx("path",{d:"M3.51 11A6 6 0 0 0 14 8 6 6 0 0 0 3.51 5L1 10"})]}),uK=w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.5 1.5H13a1 1 0 011 1v6a1 1 0 01-1 1H3a1 1 0 01-1-1V4z"})}),hK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M11 2l3 3-7 7H4v-3l7-7z"}),w.jsx("path",{d:"M2 14l3-1"})]}),dK=w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("circle",{cx:"8",cy:"8",r:"2"}),w.jsx("path",{d:"M13 8a5 5 0 00-.1-1l1.4-1-1.5-2.6-1.7.5a5 5 0 00-1.7-1L9 1H7l-.4 1.8a5 5 0 00-1.7 1l-1.7-.5L1.7 6l1.4 1A5 5 0 003 8a5 5 0 00.1 1l-1.4 1 1.5 2.6 1.7-.5a5 5 0 001.7 1L7 15h2l.4-1.8a5 5 0 001.7-1l1.7.5L14.3 10l-1.4-1A5 5 0 0013 8z"})]});function I_(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();try{document.execCommand("copy"),Pt.success("URL copied to clipboard")}catch{Pt.error("Failed to copy URL")}document.body.removeChild(t)}function IA({inHub:e=!1}={}){const t=Je(T=>T.toolsPanelOpen),i=Je(T=>T.closeToolsPanel),[r,n]=N.useState(!1),[o,l]=N.useState(""),[s,c]=N.useState(t),[u,f]=N.useState(!1);N.useEffect(()=>{if(t)c(!0),requestAnimationFrame(()=>f(!0));else if(s){f(!1);const T=setTimeout(()=>c(!1),220);return()=>clearTimeout(T)}},[t,s]);const d=N.useCallback(()=>{i()},[i]),g=N.useCallback(T=>{T(),d()},[d]);if(!s)return w.jsx(_E,{open:r,onClose:()=>n(!1),version:o});const p=`${bs.panel} ${u?bs.panelOpen:""}`,x=()=>{const{activeId:T,sessions:A,updateSession:L}=ht.getState();if(!T)return;const M=A.get(T),D=prompt("Rename session:",(M==null?void 0:M.name)??"");!D||D===(M==null?void 0:M.name)||(K9(T,D).then(()=>{L(T,{name:D}),Pt.success("Session renamed")}).catch(()=>Pt.error("Failed to rename session")),d())},y=()=>{const{activeId:T,sessions:A,removeSession:L}=ht.getState();T&&confirm("Stop this session? The process will be killed.")&&(Pd(T).catch(()=>Pt.error("Failed to stop session")).finally(()=>{const M=A.get(T);M!=null&&M.companionTermId&&L(M.companionTermId),L(T)}),d())},_=()=>{xv().then(T=>{l(T),n(!0)}),d()},b=ht.getState().splitMode,k=[{id:"session",title:"SESSION",actions:[{id:"new-tab",label:"New tab",icon:qX,action:()=>g(()=>Je.getState().openNewSessionModal())},{id:"find",label:"Find in terminal",icon:JX,action:()=>g(()=>Je.getState().openSearchBar())},{id:"rename",label:"Rename session",icon:VX,action:x},{id:"split",label:b==="off"?"Split vertical":b==="vertical"?"Split horizontal":"Close split",icon:b==="off"?XX:b==="vertical"?KX:QX,action:()=>g(()=>ht.getState().toggleSplit())},{id:"stop",label:"Close session",icon:ZX,action:y}]},{id:"files",title:"FILES",actions:[{id:"browse",label:"Browse files",icon:uK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M,"files")})},{id:"upload",label:"Upload files",icon:WX,action:()=>g(()=>Je.getState().openUploadModal())},{id:"download",label:"Download file",icon:YX,action:()=>g(()=>Je.getState().openDownloadModal())},{id:"markdown",label:"View markdown",icon:GX,action:()=>g(()=>Je.getState().openMarkdownModal())}]},{id:"view",title:"VIEW",actions:[{id:"font-up",label:"Increase font size",icon:eK,action:()=>g(()=>{const{fontSize:T,setFontSize:A}=Je.getState();A(T+1)})},{id:"font-down",label:"Decrease font size",icon:tK,action:()=>g(()=>{const{fontSize:T,setFontSize:A}=Je.getState();A(T-1)})},{id:"preview",label:"Preview port",icon:iK,action:()=>g(()=>Je.getState().openPreviewModal())},{id:"view-code",label:"View code",icon:nK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M)})},{id:"git-changes",label:"Git changes",icon:sK,action:()=>g(()=>{const{activeId:T,sessions:A}=ht.getState();if(!T)return;const L=A.get(T),M=(L==null?void 0:L.type)==="copilot"?L.companionTermId??T:T;Je.getState().openCodeViewer(M,"changes")})}]},{id:"share",title:"SHARE",actions:[{id:"copy-link",label:"Copy link",icon:rK,action:()=>{const T=uF();if(navigator.clipboard&&typeof ClipboardItem<"u"){const A=T.then(L=>new Blob([L],{type:"text/plain"}));navigator.clipboard.write([new ClipboardItem({"text/plain":A})]).then(()=>Pt.success("Link copied!")).catch(()=>T.then(L=>I_(L)))}else T.then(A=>{var L;(L=navigator.clipboard)!=null&&L.writeText?navigator.clipboard.writeText(A).then(()=>Pt.success("Link copied!")).catch(()=>I_(A)):I_(A)});d()}}]},{id:"agents",title:"AGENTS",actions:[{id:"launch-agent",label:"Launch agent",icon:hK,action:()=>g(()=>Je.getState().openNewSessionModal("copilot"))},{id:"resume-agent",label:"Resume agent session",icon:cK,action:()=>g(()=>Je.getState().openResumeBrowser())}]},{id:"settings",title:"SETTINGS",actions:[{id:"settings",label:"Settings…",icon:dK,action:()=>g(()=>Je.getState().openSettingsPanel())}]},{id:"system",title:"SYSTEM",actions:[{id:"refresh",label:"Refresh",icon:aK,action:()=>g(()=>{"caches"in window&&caches.keys().then(T=>T.forEach(A=>caches.delete(A))),location.reload()})},{id:"clear",label:"Clear terminal",icon:oK,action:()=>g(()=>{var M;const{sessions:T,activeId:A}=ht.getState();if(!A)return;const L=T.get(A);(M=L==null?void 0:L.term)==null||M.clear()})},{id:"about",label:"About",icon:lK,action:_}]}],E=e?k.filter(T=>T.id!=="session"&&T.id!=="files").map(T=>T.id==="view"?{...T,actions:[]}:T.id==="system"?{...T,actions:T.actions.filter(A=>A.id!=="clear")}:T):k;return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:`${bs.backdrop} ${u?bs.backdropOpen:""}`,onClick:d}),w.jsxs("div",{className:p,"data-testid":"palette-panel","data-open":"true",children:[w.jsxs("div",{className:bs.header,children:[w.jsx("span",{className:bs.title,children:"Tools"}),w.jsx("button",{className:bs.closeBtn,onClick:d,children:"✕"})]}),w.jsx("div",{className:bs.body,children:E.map(T=>w.jsxs("div",{className:bs.section,children:[w.jsx("div",{className:bs.sectionTitle,children:T.title}),T.actions.map(A=>w.jsxs("button",{className:bs.btn,onClick:A.action,"data-testid":"palette-action",children:[A.icon,A.label]},A.id)),T.id==="view"&&w.jsx("div",{className:bs.themePickerRow,children:w.jsx(Tv,{onSelect:()=>d()})})]},T.id))})]}),w.jsx(_E,{open:r,onClose:()=>n(!1),version:o})]})}const fK="_banner_1u733_1",pK="_updating_1u733_14",gK="_error_1u733_19",mK="_success_1u733_23",_K="_text_1u733_27",bK="_actionBtn_1u733_32",yK="_spinner_1u733_51",vK="_dismiss_1u733_56",vr={banner:fK,updating:pK,error:gK,success:mK,text:_K,actionBtn:bK,spinner:yK,dismiss:vK},bE=()=>w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",width:"14",height:"14",style:{verticalAlign:"middle",marginRight:4},children:[w.jsx("rect",{x:"5",y:"5",width:"9",height:"9",rx:"1.5"}),w.jsx("path",{d:"M11 5V3.5A1.5 1.5 0 009.5 2h-6A1.5 1.5 0 002 3.5v6A1.5 1.5 0 003.5 11H5"})]}),yE=()=>w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"14",height:"14",style:{verticalAlign:"middle",marginRight:4},children:w.jsx("polyline",{points:"3 8.5 6.5 12 13 4"})});function CK(){const[e,t]=N.useState({kind:"hidden"}),[i,r]=N.useState(!1),[n,o]=N.useState(!1),l=N.useRef(""),s=N.useRef(null),c=N.useRef(null),u=N.useRef(!1);N.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),N.useEffect(()=>{Cv(!0).then(g=>{if(g!=null&&g.updateAvailable){const p=g.command??"npm install -g termbeam@latest";l.current=p,t({kind:"available",current:g.current,latest:g.latest,canAutoUpdate:g.canAutoUpdate??!1,method:g.method??"npm",command:p})}})},[]),N.useEffect(()=>{function g(p){try{const x=JSON.parse(p.data);if(x.type!=="update-progress")return;const y=x;y.status==="installing"||y.status==="checking-permissions"||y.status==="verifying"?t({kind:"updating",phase:y.phase||"Updating..."}):y.status==="restarting"?t({kind:"restarting",toVersion:y.toVersion||"?",restartStrategy:y.restartStrategy||"exit"}):y.status==="complete"?t({kind:"success",toVersion:y.toVersion||"?"}):y.status==="failed"&&t({kind:"failed",error:y.error||"Unknown error",command:l.current})}catch{}}return window.addEventListener("termbeam:ws-message",g),()=>window.removeEventListener("termbeam:ws-message",g)},[]),N.useEffect(()=>{const g=e.kind==="updating"||e.kind==="restarting";return g&&!s.current?(e.kind==="restarting"&&(u.current=!1),s.current=setInterval(async()=>{const p=await cF();if(e.kind==="restarting"){if(!p){u.current=!0;return}if(u.current||p.status==="idle"){window.location.reload();return}}p&&(p.status==="complete"?t({kind:"success",toVersion:p.toVersion||"?"}):p.status==="failed"?t({kind:"failed",error:p.error||"Unknown error",command:l.current}):p.status==="restarting"?t({kind:"restarting",toVersion:p.toVersion||"?",restartStrategy:p.restartStrategy||"exit"}):(p.status==="installing"||p.status==="checking-permissions"||p.status==="verifying")&&t({kind:"updating",phase:p.phase||"Updating..."}))},2e3)):!g&&s.current&&(clearInterval(s.current),s.current=null),()=>{s.current&&(clearInterval(s.current),s.current=null)}},[e.kind]),N.useEffect(()=>{if(e.kind!=="success")return;const g=setTimeout(()=>r(!0),5e3);return()=>clearTimeout(g)},[e.kind]);const f=N.useCallback(async()=>{t({kind:"updating",phase:"Starting update..."});try{const g=await lF();g.error&&t({kind:"failed",error:g.error,command:g.command||l.current})}catch(g){t({kind:"failed",error:g instanceof Error?g.message:"Update request failed",command:l.current})}},[]),d=N.useCallback(async g=>{const p=()=>{o(!0),c.current&&clearTimeout(c.current),c.current=setTimeout(()=>o(!1),2e3)};try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function"){await navigator.clipboard.writeText(g),p();return}}catch{}try{const x=document.createElement("textarea");x.value=g,x.setAttribute("readonly",""),x.style.position="absolute",x.style.left="-9999px",document.body.appendChild(x),x.select(),document.execCommand("copy"),document.body.removeChild(x),p()}catch{}},[]);return e.kind==="hidden"||i?null:e.kind==="success"?w.jsx("div",{className:`${vr.banner} ${vr.success}`,"data-update-banner":!0,children:w.jsxs("span",{className:vr.text,children:["✓ Updated to v",e.toVersion]})}):e.kind==="restarting"?w.jsxs("div",{className:`${vr.banner} ${vr.updating}`,"data-update-banner":!0,children:[w.jsx("span",{className:vr.spinner,children:"⟳"}),w.jsx("span",{className:vr.text,children:e.restartStrategy==="pm2"?`Updated to v${e.toVersion}. Restarting...`:`Updated to v${e.toVersion}. Please restart TermBeam.`})]}):e.kind==="updating"?w.jsxs("div",{className:`${vr.banner} ${vr.updating}`,"data-update-banner":!0,children:[w.jsx("span",{className:vr.spinner,children:"⟳"}),w.jsx("span",{className:vr.text,children:e.phase})]}):e.kind==="failed"?w.jsxs("div",{className:`${vr.banner} ${vr.error}`,"data-update-banner":!0,children:[w.jsxs("span",{className:vr.text,children:["Update failed: ",e.error]}),e.command&&w.jsx("button",{className:vr.actionBtn,onClick:()=>d(e.command),title:"Copy manual update command",children:n?w.jsxs(w.Fragment,{children:[w.jsx(yE,{}),"Copied"]}):w.jsxs(w.Fragment,{children:[w.jsx(bE,{}),"Copy command"]})}),w.jsx("button",{className:vr.dismiss,onClick:()=>r(!0),"aria-label":"Dismiss",children:"✕"})]}):w.jsxs("div",{className:vr.banner,"data-update-banner":!0,children:[w.jsxs("span",{className:vr.text,children:["Update available: v",e.current," → v",e.latest]}),e.canAutoUpdate?w.jsx("button",{className:vr.actionBtn,onClick:f,children:"Update Now"}):w.jsx("button",{className:vr.actionBtn,onClick:()=>d(e.command),title:e.command,children:n?w.jsxs(w.Fragment,{children:[w.jsx(yE,{}),"Copied"]}):w.jsxs(w.Fragment,{children:[w.jsx(bE,{}),"Copy command"]})}),w.jsx("button",{className:vr.dismiss,onClick:()=>r(!0),"aria-label":"Dismiss update banner",children:"✕"})]})}const iy=zl(e=>({state:{kind:"hidden"},setState:t=>e({state:t})})),xK="_banner_eu3dd_1",SK="_warning_eu3dd_13",wK="_error_eu3dd_17",TK="_text_eu3dd_21",kK="_dismiss_eu3dd_26",ys={banner:xK,warning:SK,error:wK,text:TK,dismiss:kK};let vE=!1;function EK(){vE||(vE=!0,window.addEventListener("termbeam:ws-message",(e=>{let t;try{t=JSON.parse(typeof e.data=="string"?e.data:"")}catch{return}if(t.type!=="tunnel-status")return;const i=iy.getState();let r=null;switch(t.state){case"disconnected":r={kind:"disconnected",provider:t.provider};break;case"reconnecting":r={kind:"reconnecting"};break;case"connected":r={kind:"hidden"};break;case"failed":r={kind:"failed"};break}r&&i.setState(r)})))}function AK(){const e=iy(r=>r.state),t=iy(r=>r.setState);N.useEffect(()=>{EK()},[]);const i=()=>t({kind:"hidden"});return e.kind==="hidden"?null:e.kind==="disconnected"?w.jsxs("div",{className:`${ys.banner} ${ys.error}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:"⚠️ Tunnel disconnected — reconnecting automatically"}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):e.kind==="reconnecting"?w.jsxs("div",{className:`${ys.banner} ${ys.warning}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:"🔄 Tunnel reconnecting…"}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):e.kind==="failed"?w.jsxs("div",{className:`${ys.banner} ${ys.error}`,"data-testid":"tunnel-banner",children:[w.jsx("span",{className:ys.text,children:'❌ Tunnel failed — run "devtunnel user login" on the host'}),w.jsx("button",{className:ys.dismiss,onClick:i,"aria-label":"Dismiss",children:"✕"})]}):null}function ff({size:e=16}){return w.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})})}const LK="_wrapper_c7307_1",BK="_deleteBackground_c7307_49",MK="_card_c7307_76",RK="_topRow_c7307_109",DK="_nameGroup_c7307_116",NK="_colorDot_c7307_123",OK="_name_c7307_116",IK="_pidBadge_c7307_139",FK="_detailsRow_c7307_201",PK="_detailItem_c7307_209",HK="_gitRow_c7307_221",$K="_gitBadge_c7307_228",jK="_statusClean_c7307_243",zK="_statusDirty_c7307_247",Cr={wrapper:LK,deleteBackground:BK,card:MK,topRow:RK,nameGroup:DK,colorDot:NK,name:OK,pidBadge:IK,detailsRow:FK,detailItem:PK,gitRow:HK,gitBadge:$K,statusClean:jK,statusDirty:zK},UK="_dissolving_180ww_15",Wv={dissolving:UK};function qK(e){if(!e)return"just now";const t=typeof e=="number"?e:new Date(e).getTime();if(isNaN(t))return"just now";const i=Date.now()-t;return i<1e4?"just now":i<6e4?`${Math.floor(i/1e3)}s ago`:i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:new Date(t).toLocaleDateString()}const CE=50,WK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:w.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),YK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("polyline",{points:"4 17 10 11 4 5"}),w.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),GK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("circle",{cx:"12",cy:"12",r:"10"}),w.jsx("polyline",{points:"12 6 12 12 16 14"})]}),VK=()=>w.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),w.jsx("circle",{cx:"18",cy:"6",r:"3"}),w.jsx("circle",{cx:"6",cy:"18",r:"3"}),w.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),XK=()=>w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[w.jsx("polyline",{points:"3 6 5 6 21 6"}),w.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]}),KK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),QK=()=>w.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"})});function ZK(e){if(!e)return null;const t=e.toLowerCase();return t.includes("github")?w.jsx(KK,{}):t.includes("gitlab")?w.jsx(QK,{}):null}const xE=()=>w.jsx(ff,{size:12});function JK({session:e,onSelect:t,onDelete:i,revealedId:r,onRevealChange:n,index:o=0,arriving:l=!1,dissolving:s=!1}){var L;const c=N.useRef(null),u=N.useRef(0),f=N.useRef(0),d=N.useRef(0),g=N.useRef(!1),p=r===e.id,x=N.useCallback(M=>{const D=c.current;D&&(D.style.transition="transform 0.25s ease",D.style.transform=`translateX(${M}px)`,d.current=M)},[]);N.useEffect(()=>{p||x(0)},[p,x]);const y=N.useCallback(M=>{const D=M.touches[0];if(!D)return;u.current=D.clientX,f.current=D.clientY,g.current=!1;const P=c.current;P&&(P.style.transition="none")},[]),_=N.useCallback(M=>{const D=M.touches[0];if(!D)return;const P=D.clientX-u.current,z=D.clientY-f.current;if(!g.current&&Math.abs(P)>5){if(Math.abs(z)>Math.abs(P))return;g.current=!0}if(!g.current)return;const U=c.current;if(!U)return;let Z=(p?-80:0)+P;Z=Math.max(Z,-80),Z=Math.min(Z,0),U.style.transform=`translateX(${Z}px)`},[p]),b=N.useCallback(M=>{if(!g.current)return;M.preventDefault();const D=M.changedTouches[0];if(!D)return;const P=D.clientX-u.current,U=(p?-80:0)+P;p?P>CE?(n(null),x(0)):x(-80):U<-CE?(n(e.id),x(-80)):x(0)},[p,e.id,n,x]),v=N.useCallback(M=>{M.stopPropagation(),i(e.id),n(null)},[e.id,i,n]),C=e.type==="copilot",k=e.shell.split("/").pop()??e.shell,E=C?"#a855f6":e.color??"var(--success)",T=e.git,A=((L=T==null?void 0:T.status)==null?void 0:L.clean)===!0;return w.jsxs("div",{className:`${Cr.wrapper} ${s?Wv.dissolving:""}`,style:{"--stagger-i":Math.min(o,8)},"data-session-id":e.id,"data-arriving":l||void 0,"aria-hidden":s||void 0,children:[w.jsxs("button",{className:Cr.deleteBackground,onClick:v,"aria-label":`Delete session ${e.name}`,type:"button",disabled:s,children:[w.jsx(XK,{}),"Delete"]}),w.jsxs("div",{ref:c,className:Cr.card,"data-testid":"session-card",onClick:()=>{s||t(e.id)},onTouchStart:y,onTouchMove:_,onTouchEnd:b,children:[w.jsxs("div",{className:Cr.topRow,children:[w.jsxs("div",{className:Cr.nameGroup,children:[C?w.jsx(xE,{}):w.jsx("span",{className:Cr.colorDot,style:{background:E}}),w.jsx("span",{className:Cr.name,"data-testid":"session-name",children:e.name})]}),C?w.jsx("span",{className:Cr.pidBadge,"data-testid":"session-type-badge",children:e.model??"Copilot"}):w.jsxs("span",{className:Cr.pidBadge,"data-testid":"session-pid",children:["PID ",e.pid]})]}),w.jsxs("div",{className:Cr.detailsRow,children:[w.jsxs("span",{className:Cr.detailItem,children:[w.jsx(WK,{})," ",e.cwd]}),C?w.jsxs("span",{className:Cr.detailItem,"data-testid":"session-shell",children:[w.jsx(xE,{})," Copilot"]}):w.jsxs("span",{className:Cr.detailItem,"data-testid":"session-shell",children:[w.jsx(YK,{})," ",k]}),w.jsxs("span",{className:Cr.detailItem,children:[w.jsx(GK,{})," ",qK(e.lastActivity)]})]}),T&&w.jsxs("div",{className:Cr.gitRow,children:[w.jsxs("span",{className:Cr.gitBadge,children:[w.jsx(VK,{})," ",T.branch]}),T.provider&&w.jsxs("span",{className:Cr.gitBadge,children:[ZK(T.provider)," ",T.provider]}),T.repoName&&w.jsx("span",{className:Cr.gitBadge,children:T.repoName}),T.status!=null&&w.jsx("span",{className:`${Cr.gitBadge} ${A?Cr.statusClean:Cr.statusDirty}`,children:A?"✓ clean":T.status.summary})]})]})]})}const F_=["#4a9eff","#4ade80","#fbbf24","#c084fc","#f87171","#22d3ee","#fb923c","#f472b6"],eQ="_badge_c2uf6_1",tQ="_dot_c2uf6_15",iQ="_sm_c2uf6_19",rQ="_md_c2uf6_34",jh={badge:eQ,dot:tQ,sm:iQ,md:rQ},nQ={copilot:w.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:w.jsx("path",{d:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"})}),claude:w.jsx("svg",{viewBox:"0 0 24 24",fill:"#D97757",children:w.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}),opencode:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",children:[w.jsx("rect",{x:"2",y:"3",width:"20",height:"18",rx:"2",fill:"#1a1a2e"}),w.jsx("path",{d:"M7 9l3 3-3 3",stroke:"#c8ccd0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),w.jsx("line",{x1:"13",y1:"15",x2:"17",y2:"15",stroke:"#c8ccd0",strokeWidth:"2",strokeLinecap:"round"})]})},sQ={copilot:"#6cc644",claude:"#D97757",aider:"#4a9eff",codex:"#10a37f",opencode:"#1a1a2e"};function FA({agent:e,size:t="sm"}){const i=nQ[e];if(i)return w.jsx("span",{className:`${jh.badge} ${jh[t]}`,children:i});const r=sQ[e]||"var(--text-muted)";return w.jsx("span",{className:`${jh.badge} ${jh[t]}`,children:w.jsx("span",{className:jh.dot,style:{background:r}})})}const aQ="_overlay_1vya2_1",oQ="_content_1vya2_9",lQ="_title_1vya2_27",cQ="_form_1vya2_34",uQ="_field_1vya2_40",hQ="_label_1vya2_46",dQ="_input_1vya2_54",fQ="_select_1vya2_71 _input_1vya2_54",pQ="_dirRow_1vya2_81",gQ="_browseBtn_1vya2_90",mQ="_colorPicker_1vya2_109",_Q="_colorDot_1vya2_115",bQ="_colorDotActive_1vya2_130",yQ="_actions_1vya2_134",vQ="_cancelBtn_1vya2_141",CQ="_submitBtn_1vya2_159",xQ="_sessionTypeTabs_1vya2_183",SQ="_sessionTypeTab_1vya2_183",wQ="_sessionTypeTabActive_1vya2_214",TQ="_modelSelect_1vya2_223 _input_1vya2_54",kQ="_resumeLink_1vya2_244",EQ="_agentGrid_1vya2_269",AQ="_agentCard_1vya2_275",LQ="_agentIcon_1vya2_300",BQ="_agentName_1vya2_305",MQ="_agentVersion_1vya2_316",Zt={overlay:aQ,content:oQ,title:lQ,form:cQ,field:uQ,label:hQ,input:dQ,select:fQ,dirRow:pQ,browseBtn:gQ,colorPicker:mQ,colorDot:_Q,colorDotActive:bQ,actions:yQ,cancelBtn:vQ,submitBtn:CQ,sessionTypeTabs:xQ,sessionTypeTab:SQ,sessionTypeTabActive:wQ,modelSelect:TQ,resumeLink:kQ,agentGrid:EQ,agentCard:AQ,agentIcon:LQ,agentName:BQ,agentVersion:MQ},RQ=[{id:"claude-opus-4.6",label:"Claude Opus 4.6"},{id:"claude-opus-4.5",label:"Claude Opus 4.5"},{id:"claude-sonnet-4.6",label:"Claude Sonnet 4.6"},{id:"claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{id:"claude-sonnet-4",label:"Claude Sonnet 4"},{id:"claude-haiku-4.5",label:"Claude Haiku 4.5"},{id:"gpt-5.4",label:"GPT-5.4"},{id:"gpt-5.2",label:"GPT-5.2"},{id:"gpt-5.1",label:"GPT-5.1"},{id:"gpt-5.4-mini",label:"GPT-5.4 Mini"},{id:"gpt-5-mini",label:"GPT-5 Mini"},{id:"gpt-4.1",label:"GPT-4.1"}];function P_(e){const t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function DQ(e,t){if(!t.has(e))return e;let i=2;for(;t.has(`${e} (${i})`);)i++;return`${e} (${i})`}function PA({onCreated:e}){const{newSessionModalOpen:t,closeNewSessionModal:i,newSessionModalInitialMode:r}=Je(),n=Wi(H=>H.prefs.defaultFolder),o=Wi(H=>H.prefs.defaultInitialCommand),[l,s]=N.useState("terminal"),[c,u]=N.useState(""),[f,d]=N.useState(!1),[g,p]=N.useState(""),[x,y]=N.useState(!1),[_,b]=N.useState(!1),[v,C]=N.useState(""),[k,E]=N.useState([]),[T,A]=N.useState(""),[L,M]=N.useState(F_[0]),[D,P]=N.useState([]),[z,U]=N.useState("claude-opus-4.6"),W=N.useCallback((H,V)=>{if(f)return;const $=ht.getState().sessions,Y=new Set;for(const J of $.values())Y.add(J.name);const ee=P_(H);u(DQ(`${ee}${(V??l)==="copilot"?" · Copilot":""}`,Y))},[f,l]);N.useEffect(()=>{t&&(r&&s(r),Q9().catch(()=>({shells:[],defaultShell:"",cwd:""})).then(H=>{var ee;const V=H.shells;if(E(V),!v){const ne=V.find(J=>J.cmd===H.defaultShell)||V.find(J=>J.path===H.defaultShell);C((ne==null?void 0:ne.cmd)??((ee=V[0])==null?void 0:ee.cmd)??"")}const Y=Wi.getState().prefs.defaultFolder;if(Y){f||W(Y);return}H.cwd&&(p(ne=>ne||H.cwd),f||W(H.cwd))}),Z9().then(H=>P(H.agents||[])).catch(()=>P([])))},[t]);const Z=N.useRef(!1),j=N.useRef(!1);N.useEffect(()=>{t&&(n&&!Z.current&&!g&&(p(n),f||W(n)),o&&!j.current&&!T&&A(o))},[t,n,o]);function G(){s("terminal"),u(""),d(!1),C(""),p(""),A(""),M(F_[0]),b(!1),U("claude-sonnet-4"),Z.current=!1,j.current=!1}function X(H){s(H),!f&&g&&W(g,H)}async function F(){var H,V;y(!0);try{const $=ht.getState(),Y=$.activeId?$.sessions.get($.activeId):null,ee=(H=Y==null?void 0:Y.term)==null?void 0:H.cols,ne=(V=Y==null?void 0:Y.term)==null?void 0:V.rows,J=Wi.getState().prefs,K=(J.defaultInitialCommand||"").trim(),le=(J.defaultFolder||"").trim(),ie=T.trim()||K,he=g.trim()||le,pe=await Fd(l==="copilot"?{name:c.trim()||void 0,cwd:he||void 0,type:"copilot",model:z,...ee&&ne?{cols:ee,rows:ne}:{}}:{name:c.trim()||void 0,shell:v||void 0,cwd:he||void 0,color:L,initialCommand:ie||void 0,...ee&&ne?{cols:ee,rows:ne}:{}});ie&&ht.getState().setPendingInitialCommand(pe.id,ie),i(),G(),e(pe.id,l,pe.ptySessionId??null,l==="copilot"?z:void 0)}catch($){Pt.error($ instanceof Error?$.message:"Failed to create session")}finally{y(!1)}}async function O(H){var V,$,Y,ee;y(!0);try{const ne=ht.getState(),J=ne.activeId?ne.sessions.get(ne.activeId):null,K=(V=J==null?void 0:J.term)==null?void 0:V.cols,le=($=J==null?void 0:J.term)==null?void 0:$.rows,ie=await Fd({name:c.trim()||`${H.name}`,shell:v||void 0,cwd:g.trim()||void 0,color:L,initialCommand:(Y=H.args)!=null&&Y.length?`${H.cmd} ${H.args.join(" ")}`:H.cmd,...K&&le?{cols:K,rows:le}:{}}),he=(ee=H.args)!=null&&ee.length?`${H.cmd} ${H.args.join(" ")}`:H.cmd;ht.getState().setPendingInitialCommand(ie.id,he),i(),G(),e(ie.id,"terminal")}catch(ne){Pt.error(ne instanceof Error?ne.message:"Failed to launch agent")}finally{y(!1)}}return w.jsx(om,{open:t,onOpenChange:H=>{H||(i(),G())},children:w.jsxs(lm,{children:[w.jsx(cm,{className:Zt.overlay}),w.jsxs(um,{className:Zt.content,"data-testid":"new-session-modal",onOpenAutoFocus:H=>H.preventDefault(),children:[w.jsx(hm,{className:Zt.title,children:"New Session"}),_?w.jsx(kv,{currentDir:g||n||"/",onSelect:H=>{Z.current=!0,p(H),W(H),b(!1)},onCancel:()=>b(!1)}):w.jsxs("div",{className:Zt.form,children:[w.jsxs("div",{className:Zt.sessionTypeTabs,children:[w.jsx("button",{type:"button",className:`${Zt.sessionTypeTab} ${l==="terminal"?Zt.sessionTypeTabActive:""}`,onClick:()=>X("terminal"),children:">_ Terminal"}),w.jsxs("button",{type:"button",className:`${Zt.sessionTypeTab} ${l==="copilot"?Zt.sessionTypeTabActive:""}`,onClick:()=>X("copilot"),children:[w.jsx(ff,{size:14})," GitHub Copilot"]})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Working Directory"}),w.jsxs("div",{className:Zt.dirRow,children:[w.jsx("input",{className:Zt.input,type:"text",placeholder:n||"/",value:g,onChange:H=>{Z.current=!0,p(H.target.value)}}),w.jsx("button",{type:"button",className:Zt.browseBtn,onClick:()=>b(!0),children:"Browse"})]})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Name"}),w.jsx("input",{className:Zt.input,type:"text",placeholder:l==="copilot"?`${P_(g||"/")} · Copilot`:P_(g||"/"),value:c,onChange:H=>{u(H.target.value),d(!0)},"data-testid":"ns-name"})]}),l==="terminal"&&w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Shell"}),w.jsx("select",{className:Zt.select,value:v,onChange:H=>C(H.target.value),"data-testid":"ns-shell",children:k.map(H=>w.jsxs("option",{value:H.cmd,children:[H.name," (",H.path,")"]},H.path))})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Initial command"}),w.jsx("input",{className:Zt.input,type:"text",placeholder:o||"e.g. npm run dev",value:T,onChange:H=>{j.current=!0,A(H.target.value)}})]}),w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Color"}),w.jsx("div",{className:Zt.colorPicker,children:F_.map(H=>w.jsx("button",{type:"button",className:`${Zt.colorDot} ${H===L?Zt.colorDotActive:""}`,style:{background:H},onClick:()=>M(H),"aria-label":`Color ${H}`},H))})]}),D.length>0&&w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"AI Agents"}),w.jsx("div",{className:Zt.agentGrid,children:D.map(H=>w.jsxs("button",{type:"button",className:Zt.agentCard,disabled:x,onClick:()=>O(H),children:[w.jsx("span",{className:Zt.agentIcon,children:w.jsx(FA,{agent:H.icon||H.id,size:"md"})}),w.jsx("span",{className:Zt.agentName,children:H.name}),H.version&&w.jsx("span",{className:Zt.agentVersion,children:H.version})]},H.id))})]})]}),l==="copilot"&&w.jsxs("div",{className:Zt.field,children:[w.jsx("label",{className:Zt.label,children:"Model"}),w.jsx("select",{className:Zt.modelSelect,value:z,onChange:H=>U(H.target.value),"data-testid":"ns-model",children:RQ.map(H=>w.jsx("option",{value:H.id,children:H.label},H.id))})]}),w.jsx("button",{type:"button",className:Zt.resumeLink,onClick:()=>{i(),Je.getState().openResumeBrowser()},children:"Resume previous session →"}),w.jsxs("div",{className:Zt.actions,children:[w.jsx("button",{type:"button",className:Zt.cancelBtn,"data-testid":"ns-cancel",onClick:()=>{i(),G()},children:"Cancel"}),w.jsx("button",{type:"button",className:Zt.submitBtn,disabled:x,"data-testid":"ns-create",onClick:F,children:l==="copilot"?"Start Copilot Session":"Create"})]})]})]})]})})}const NQ="_page_s2fln_1",OQ="_header_s2fln_12",IQ="_backBtn_s2fln_21",FQ="_title_s2fln_36",PQ="_searchWrap_s2fln_43",HQ="_searchInput_s2fln_51",$Q="_clearBtn_s2fln_73",jQ="_tabs_s2fln_86",zQ="_tab_s2fln_86",UQ="_tabActive_s2fln_115",qQ="_list_s2fln_121",WQ="_emptyState_s2fln_133",YQ="_card_s2fln_143",GQ="_cardTop_s2fln_174",VQ="_cardIcon_s2fln_180",XQ="_cardSummary_s2fln_186",KQ="_cardMeta_s2fln_196",QQ="_metaItem_s2fln_205",ZQ="_spinner_s2fln_217",JQ="_timeFilters_s2fln_224",eZ="_timeChip_s2fln_233",tZ="_timeChipActive_s2fln_253",iZ="_folderFilter_s2fln_259",rZ="_folderSelect_s2fln_266",nZ="_resultCount_s2fln_288",sZ="_choiceOverlay_s2fln_316",aZ="_choiceDialog_s2fln_328",oZ="_choiceTitle_s2fln_338",lZ="_choiceDesc_s2fln_345",cZ="_choiceOptions_s2fln_354",uZ="_choiceBtn_s2fln_360",hZ="_choiceBtnIcon_s2fln_392",dZ="_choiceBtnLabel_s2fln_398",fZ="_choiceBtnHint_s2fln_403",pZ="_choiceSpinner_s2fln_409",$t={page:NQ,header:OQ,backBtn:IQ,title:FQ,searchWrap:PQ,searchInput:HQ,clearBtn:$Q,tabs:jQ,tab:zQ,tabActive:UQ,list:qQ,emptyState:WQ,card:YQ,cardTop:GQ,cardIcon:VQ,cardSummary:XQ,cardMeta:KQ,metaItem:QQ,spinner:ZQ,timeFilters:JQ,timeChip:eZ,timeChipActive:tZ,folderFilter:iZ,folderSelect:rZ,resultCount:nZ,choiceOverlay:sZ,choiceDialog:aZ,choiceTitle:oZ,choiceDesc:lZ,choiceOptions:cZ,choiceBtn:uZ,choiceBtnIcon:hZ,choiceBtnLabel:dZ,choiceBtnHint:fZ,choiceSpinner:pZ};function H_(e){const t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function gZ(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:t<6048e5?`${Math.floor(t/864e5)}d ago`:new Date(e).toLocaleDateString()}function HA(){const{resumeBrowserOpen:e,closeResumeBrowser:t}=Je(),[i,r]=N.useState([]),[n,o]=N.useState(!0),[l,s]=N.useState(""),[c,u]=N.useState("all"),[f,d]=N.useState("all"),[g,p]=N.useState("all"),[x,y]=N.useState(null),[_,b]=N.useState(null),v=N.useRef(void 0),C=N.useRef(null),k=N.useRef(0),E=N.useCallback(async j=>{const G=++k.current;o(!0);try{const{sessions:X}=await J9(100,j||void 0);G===k.current&&r(X)}catch{G===k.current&&r([])}finally{G===k.current&&o(!1)}},[]);N.useEffect(()=>(e?(E(),setTimeout(()=>{var j;return(j=C.current)==null?void 0:j.focus()},300)):(s(""),u("all"),d("all"),p("all")),()=>{v.current&&clearTimeout(v.current)}),[e,E]);function T(j){s(j),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>E(j),300)}const A=N.useMemo(()=>{const j=new Set;return i.forEach(G=>{G.cwd&&j.add(G.cwd)}),[...j].sort()},[i]),L=N.useMemo(()=>{let j=c==="all"?i:i.filter(G=>G.agent===c);if(g!=="all"&&(j=j.filter(G=>G.cwd===g)),f!=="all"){const G=Date.now(),X={today:1440*60*1e3,week:10080*60*1e3,month:720*60*60*1e3},F=G-X[f];j=j.filter(O=>new Date(O.updatedAt).getTime()>F)}return j},[i,c,g,f]);function M(j){const G=ht.getState(),X=new Set([...G.sessions.values()].map(O=>O.name));let F=H_(j.cwd||"/");if(X.has(F)){let O=2;for(;X.has(`${F} (${O})`);)O++;F=`${F} (${O})`}return F}function D(j){j.agent==="copilot"?b({session:j,name:M(j)}):P(j,M(j))}async function P(j,G){var X,F;y(`${j.agent}-${j.id}`),b(null);try{const O=ht.getState(),H=O.activeId?O.sessions.get(O.activeId):null,V=(X=H==null?void 0:H.term)==null?void 0:X.cols,$=(F=H==null?void 0:H.term)==null?void 0:F.rows,{command:Y}=await eF(j.agent,j.id),ee=await Fd({name:G,cwd:j.cwd||void 0,initialCommand:Y,color:"#c084fc",...V&&$?{cols:V,rows:$}:{}});t(),window.history.pushState(null,"",`/terminal?id=${ee.id}`),window.dispatchEvent(new PopStateEvent("popstate"))}catch(O){Pt.error(O instanceof Error?O.message:"Failed to resume session")}finally{y(null)}}async function z(j,G){y(`${j.agent}-${j.id}`),b(null);try{const X=await tF(j.id,{name:G,cwd:j.cwd||void 0}),F=ht.getState();X.ptySessionId&&!F.sessions.has(X.ptySessionId)&&F.addSession({id:X.ptySessionId,name:`${G} Terminal`,type:"terminal",hidden:!0,shell:"",pid:0,cwd:j.cwd||"",color:"#6ec1e4",createdAt:new Date().toISOString(),lastActivity:Date.now(),term:null,fitAddon:null,searchAddon:null,ws:null,send:null,connected:!1,exited:!1,scrollback:"",hasUnread:!1}),F.sessions.has(X.id)||F.addSession({id:X.id,name:G,type:"copilot",shell:"",pid:0,cwd:j.cwd||"",color:"#a855f6",createdAt:new Date().toISOString(),lastActivity:Date.now(),companionTermId:X.ptySessionId??void 0,term:null,fitAddon:null,searchAddon:null,ws:null,send:null,connected:!0,exited:!1,scrollback:"",hasUnread:!1}),F.setActiveId(X.id),t(),window.history.pushState(null,"",`/terminal?session=${X.id}`),window.dispatchEvent(new PopStateEvent("popstate"))}catch(X){Pt.error(X instanceof Error?X.message:"Failed to resume session")}finally{y(null)}}if(N.useEffect(()=>{if(!e)return;const j=G=>{G.key==="Escape"&&(_?b(null):t())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[e,t,_]),!e)return null;const U=i.filter(j=>j.agent==="copilot").length,W=i.filter(j=>j.agent==="claude").length,Z=i.filter(j=>j.agent==="opencode").length;return w.jsxs("div",{className:$t.page,children:[w.jsxs("div",{className:$t.header,children:[w.jsx("button",{className:$t.backBtn,onClick:t,"aria-label":"Go back",type:"button",children:"←"}),w.jsx("h1",{className:$t.title,children:"Resume Session"})]}),w.jsxs("div",{className:$t.searchWrap,children:[w.jsx("input",{ref:C,className:$t.searchInput,type:"text",placeholder:"Search sessions...",value:l,onChange:j=>T(j.target.value)}),l&&w.jsx("button",{className:$t.clearBtn,"aria-label":"Clear search",onClick:()=>{s(""),E()},children:"✕"})]}),w.jsxs("div",{className:$t.tabs,children:[w.jsxs("button",{className:`${$t.tab} ${c==="all"?$t.tabActive:""}`,onClick:()=>u("all"),children:["All (",i.length,")"]}),U>0&&w.jsxs("button",{className:`${$t.tab} ${c==="copilot"?$t.tabActive:""}`,onClick:()=>u("copilot"),children:["Copilot (",U,")"]}),W>0&&w.jsxs("button",{className:`${$t.tab} ${c==="claude"?$t.tabActive:""}`,onClick:()=>u("claude"),children:["Claude (",W,")"]}),Z>0&&w.jsxs("button",{className:`${$t.tab} ${c==="opencode"?$t.tabActive:""}`,onClick:()=>u("opencode"),children:["OpenCode (",Z,")"]})]}),w.jsx("div",{className:$t.timeFilters,children:["all","today","week","month"].map(j=>w.jsx("button",{className:`${$t.timeChip} ${f===j?$t.timeChipActive:""}`,onClick:()=>d(j),children:j==="all"?"All time":j==="today"?"Today":j==="week"?"This week":"This month"},j))}),A.length>1&&w.jsx("div",{className:$t.folderFilter,children:w.jsxs("select",{className:$t.folderSelect,value:g,onChange:j=>p(j.target.value),children:[w.jsx("option",{value:"all",children:"All projects"}),A.map(j=>w.jsx("option",{value:j,children:H_(j)},j))]})}),w.jsxs("div",{className:$t.resultCount,children:[L.length," session",L.length!==1?"s":""]}),w.jsx("div",{className:$t.list,children:n?w.jsx("div",{className:$t.emptyState,children:"Loading sessions…"}):L.length===0?w.jsx("div",{className:$t.emptyState,children:l?`No sessions matching "${l}"`:"No past agent sessions found"}):L.map(j=>w.jsxs("button",{className:$t.card,disabled:x!==null,onClick:()=>D(j),children:[w.jsxs("div",{className:$t.cardTop,children:[w.jsx("span",{className:$t.cardIcon,children:w.jsx(FA,{agent:j.agentIcon})}),w.jsx("span",{className:$t.cardSummary,children:j.summary||"Untitled session"}),x===`${j.agent}-${j.id}`&&w.jsx("span",{className:$t.spinner,children:"⟳"})]}),w.jsxs("div",{className:$t.cardMeta,children:[j.cwd&&w.jsx("span",{className:$t.metaItem,children:H_(j.cwd)}),j.branch&&w.jsx("span",{className:$t.metaItem,children:j.branch}),w.jsx("span",{className:$t.metaItem,children:gZ(j.updatedAt)}),j.turnCount>0&&w.jsxs("span",{className:$t.metaItem,children:[j.turnCount," turns"]})]})]},`${j.agent}-${j.id}`))}),_&&w.jsx("div",{className:$t.choiceOverlay,onClick:()=>b(null),children:w.jsxs("div",{className:$t.choiceDialog,onClick:j=>j.stopPropagation(),children:[w.jsx("h2",{className:$t.choiceTitle,children:"Resume Copilot Session"}),w.jsx("p",{className:$t.choiceDesc,children:_.session.summary||"Untitled session"}),w.jsxs("div",{className:$t.choiceOptions,children:[w.jsxs("button",{className:$t.choiceBtn,disabled:x!==null,onClick:()=>P(_.session,_.name),children:[w.jsx("span",{className:$t.choiceBtnIcon,children:w.jsx("svg",{width:"18",height:"18",viewBox:"0 0 16 16",fill:"currentColor",children:w.jsx("path",{d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V2.75a.25.25 0 0 0-.25-.25ZM7.25 8a.749.749 0 0 1-.22.53l-2.25 2.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L5.44 8 3.72 6.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.25 2.25c.141.14.22.331.22.53Zm1.5 1.5h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5Z"})})}),w.jsx("span",{className:$t.choiceBtnLabel,children:"Terminal"}),w.jsx("span",{className:$t.choiceBtnHint,children:"Pure CLI experience"})]}),w.jsxs("button",{className:$t.choiceBtn,disabled:x!==null,onClick:()=>z(_.session,_.name),children:[w.jsx("span",{className:$t.choiceBtnIcon,children:w.jsx(ff,{size:18})}),w.jsx("span",{className:$t.choiceBtnLabel,children:"Agent UI"}),w.jsx("span",{className:$t.choiceBtnHint,children:"Copilot SDK interface"})]})]}),x&&w.jsx("div",{className:$t.choiceSpinner,children:"⟳ Resuming…"})]})})]})}const mZ="_backdrop_269p1_1",_Z="_modal_269p1_13",bZ="_header_269p1_27",yZ="_titleBlock_269p1_36",vZ="_title_269p1_36",CZ="_subtitle_269p1_51",xZ="_closeBtn_269p1_56",SZ="_body_269p1_76",wZ="_empty_269p1_84",TZ="_emptyIcon_269p1_93",kZ="_emptyTitle_269p1_101",EZ="_emptyHint_269p1_108",AZ="_list_269p1_118",LZ="_workspaceItem_269p1_127",BZ="_workspaceHeader_269p1_141",MZ="_workspaceTitleRow_269p1_155",RZ="_workspaceName_269p1_162",DZ="_defaultBadge_269p1_169",NZ="_workspaceMetaRow_269p1_181",OZ="_metaPill_269p1_188",IZ="_metaPillAgent_269p1_189",FZ="_metaPillCmd_269p1_190",PZ="_chevron_269p1_212",HZ="_colorStrip_269p1_221",$Z="_colorStripSegment_269p1_230",jZ="_workspaceBody_269p1_238",zZ="_sessionList_269p1_247",UZ="_sessionItem_269p1_256",qZ="_sessionColorBar_269p1_270",WZ="_sessionMain_269p1_276",YZ="_sessionTopRow_269p1_285",GZ="_sessionName_269p1_292",VZ="_kindBadge_269p1_303",XZ="_kindBadgeTerminal_269p1_313",KZ="_kindBadgeAgent_269p1_318",QZ="_sessionPath_269p1_323",ZZ="_pathIcon_269p1_332",JZ="_pathDir_269p1_338",eJ="_pathFull_269p1_343",tJ="_sessionCmdRow_269p1_352",iJ="_cmdLabel_269p1_364",rJ="_cmdText_269p1_372",nJ="_sessionMeta_269p1_385",sJ="_metaItem_269p1_393",aJ="_metaKey_269p1_401",oJ="_launchBtn_269p1_421",lJ="_launchCount_269p1_452",cJ="_spinner_269p1_465",Ft={backdrop:mZ,modal:_Z,header:bZ,titleBlock:yZ,title:vZ,subtitle:CZ,closeBtn:xZ,body:SZ,empty:wZ,emptyIcon:TZ,emptyTitle:kZ,emptyHint:EZ,list:AZ,workspaceItem:LZ,workspaceHeader:BZ,workspaceTitleRow:MZ,workspaceName:RZ,defaultBadge:DZ,workspaceMetaRow:NZ,metaPill:OZ,metaPillAgent:IZ,metaPillCmd:FZ,chevron:PZ,colorStrip:HZ,colorStripSegment:$Z,workspaceBody:jZ,sessionList:zZ,sessionItem:UZ,sessionColorBar:qZ,sessionMain:WZ,sessionTopRow:YZ,sessionName:GZ,kindBadge:VZ,kindBadgeTerminal:XZ,kindBadgeAgent:KZ,sessionPath:QZ,pathIcon:ZZ,pathDir:JZ,pathFull:eJ,sessionCmdRow:tJ,cmdLabel:iJ,cmdText:rJ,sessionMeta:nJ,metaItem:sJ,metaKey:aJ,launchBtn:oJ,launchCount:lJ,spinner:cJ};function SE(e){if(!e)return"";const t=e.replace(/\/+$/,"").match(/[^/\\]+$/);return t?t[0]:e}function uJ(e,t=36){if(e.length<=t)return e;const i=e.slice(0,14),r=e.slice(-(t-16));return`${i}…${r}`}function hJ({open:e,onClose:t,onLaunched:i}){const r=Wi(f=>f.prefs),[n,o]=N.useState(null),[l,s]=N.useState(null),c=N.useMemo(()=>{var d,g;const f=r.workspaces??[];return f.length>0?f:(g=(d=r.startupWorkspace)==null?void 0:d.sessions)!=null&&g.length?[{id:"__legacy__",name:"Default startup",sessions:r.startupWorkspace.sessions}]:[]},[r]);if(N.useEffect(()=>{c.length===1&&c[0]&&s(c[0].id)},[c]),N.useEffect(()=>{if(!e)return;const f=d=>{d.key==="Escape"&&t()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,t]),!e)return null;const u=async f=>{if(f.sessions.length===0){Pt.info("This workspace is empty");return}o(f.id);let d,g,p=0;try{for(const y of f.sessions){const _=(y.initialCommand??"").trim(),b={name:y.name,cwd:y.cwd||void 0,color:y.color||void 0,initialCommand:_||void 0,type:y.kind==="agent"?"agent":"terminal"};let v;try{v=await Fd({...b,shell:y.shell||void 0})}catch(C){const k=C instanceof Error?C.message:"";if(k.toLowerCase().includes("shell"))try{v=await Fd(b)}catch(E){Pt.error(`Failed to launch "${y.name}": ${E instanceof Error?E.message:"unknown error"}`);continue}else{Pt.error(`Failed to launch "${y.name}": ${k||"unknown error"}`);continue}}d||(d=v.id),_&&(ht.getState().setPendingInitialCommand(v.id,_),g||(g=v.id),p+=1)}const x=p>0?` · ${p} initial command${p===1?"":"s"} running`:"";Pt.success(`Launched ${f.sessions.length} session${f.sessions.length===1?"":"s"}${x}`),i(g??d),t()}finally{o(null)}};return w.jsx("div",{className:Ft.backdrop,onClick:t,role:"dialog","aria-modal":"true",children:w.jsxs("div",{className:Ft.modal,onClick:f=>f.stopPropagation(),children:[w.jsxs("div",{className:Ft.header,children:[w.jsxs("div",{className:Ft.titleBlock,children:[w.jsx("span",{className:Ft.title,children:"Open Workspace"}),c.length>0&&w.jsxs("span",{className:Ft.subtitle,children:[c.length," saved workspace",c.length===1?"":"s"]})]}),w.jsx("button",{className:Ft.closeBtn,onClick:t,"aria-label":"Close",children:"✕"})]}),w.jsx("div",{className:Ft.body,children:c.length===0?w.jsxs("div",{className:Ft.empty,children:[w.jsx("div",{className:Ft.emptyIcon,"aria-hidden":"true",children:"⊞"}),w.jsx("p",{className:Ft.emptyTitle,children:"No workspaces yet"}),w.jsxs("p",{className:Ft.emptyHint,children:["Open ",w.jsx("strong",{children:"Settings → Workspaces"})," after spinning up the sessions you want grouped, then click ",w.jsx("em",{children:"Save current as new workspace"}),"."]})]}):w.jsx("ul",{className:Ft.list,children:c.map(f=>{const d=l===f.id,g=f.sessions.filter(x=>(x.initialCommand??"").trim()).length,p=f.sessions.filter(x=>x.kind==="agent").length;return w.jsxs("li",{className:Ft.workspaceItem,children:[w.jsxs("button",{type:"button",className:Ft.workspaceHeader,onClick:()=>s(d?null:f.id),"aria-expanded":d,children:[w.jsxs("div",{className:Ft.workspaceTitleRow,children:[w.jsx("span",{className:Ft.workspaceName,children:f.name}),f.default&&w.jsx("span",{className:Ft.defaultBadge,children:"auto-start"})]}),w.jsxs("div",{className:Ft.workspaceMetaRow,children:[w.jsxs("span",{className:Ft.metaPill,children:[f.sessions.length," session",f.sessions.length===1?"":"s"]}),p>0&&w.jsxs("span",{className:Ft.metaPillAgent,children:[p," agent",p===1?"":"s"]}),g>0&&w.jsxs("span",{className:Ft.metaPillCmd,children:[g," command",g===1?"":"s"]}),w.jsx("span",{className:Ft.chevron,"aria-hidden":"true",children:d?"▾":"▸"})]}),w.jsx(dJ,{sessions:f.sessions})]}),d&&w.jsxs("div",{className:Ft.workspaceBody,children:[w.jsx("ul",{className:Ft.sessionList,children:f.sessions.map(x=>w.jsx(fJ,{session:x},x.id))}),w.jsx("button",{className:Ft.launchBtn,onClick:()=>u(f),disabled:n!==null||f.sessions.length===0,children:n===f.id?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:Ft.spinner,"aria-hidden":"true"}),"Launching…"]}):w.jsxs(w.Fragment,{children:["Launch"," ",f.sessions.length>1&&w.jsx("span",{className:Ft.launchCount,children:f.sessions.length})]})})]})]},f.id)})})})]})})}function dJ({sessions:e}){return e.length===0?null:w.jsx("div",{className:Ft.colorStrip,"aria-hidden":"true",children:e.slice(0,12).map((t,i)=>w.jsx("span",{className:Ft.colorStripSegment,style:{background:t.color||"var(--accent)"}},t.id+i))})}function fJ({session:e}){const t=uJ(e.cwd||"~"),i=SE(e.cwd||"");return w.jsxs("li",{className:Ft.sessionItem,children:[w.jsx("span",{className:Ft.sessionColorBar,style:{background:e.color||"var(--accent)"},"aria-hidden":"true"}),w.jsxs("div",{className:Ft.sessionMain,children:[w.jsxs("div",{className:Ft.sessionTopRow,children:[w.jsx("span",{className:Ft.sessionName,children:e.name}),w.jsx("span",{className:`${Ft.kindBadge} ${e.kind==="agent"?Ft.kindBadgeAgent:Ft.kindBadgeTerminal}`,children:e.kind==="agent"?"Agent":"Terminal"})]}),w.jsxs("div",{className:Ft.sessionPath,title:e.cwd||"~",children:[w.jsx("span",{className:Ft.pathIcon,"aria-hidden":"true",children:"⌘"}),w.jsx("span",{className:Ft.pathDir,children:i||"~"}),w.jsx("span",{className:Ft.pathFull,children:t})]}),e.initialCommand&&w.jsxs("div",{className:Ft.sessionCmdRow,title:e.initialCommand,children:[w.jsx("span",{className:Ft.cmdLabel,children:"$"}),w.jsx("code",{className:Ft.cmdText,children:e.initialCommand})]}),(e.shell||e.kind==="agent"&&e.agentId)&&w.jsxs("div",{className:Ft.sessionMeta,children:[e.shell&&w.jsxs("span",{className:Ft.metaItem,children:[w.jsx("span",{className:Ft.metaKey,children:"shell"}),w.jsx("code",{children:SE(e.shell)})]}),e.kind==="agent"&&e.agentId&&w.jsxs("span",{className:Ft.metaItem,children:[w.jsx("span",{className:Ft.metaKey,children:"agent"}),w.jsx("code",{children:e.agentId})]})]})]})]})}const ry={text:"",repo:null,branch:null,shell:null,hasAgent:!1};function ny(e){return e.shell?(e.shell.split(/[\\/]/).pop()??e.shell).replace(/\.exe$/i,""):""}function $A(e){return e.type==="copilot"||e.type==="agent"}function pJ(e,t){var r,n,o,l;if(t.hasAgent&&!$A(e)||t.repo&&((r=e.git)==null?void 0:r.repoName)!==t.repo||t.branch&&((n=e.git)==null?void 0:n.branch)!==t.branch||t.shell&&ny(e)!==t.shell)return!1;const i=t.text.trim().toLowerCase();return!(i&&![e.name,e.cwd,ny(e),((o=e.git)==null?void 0:o.branch)??"",((l=e.git)==null?void 0:l.repoName)??""].join(" ").toLowerCase().includes(i))}function gJ(e,t){return pg(t)?e:e.filter(i=>pJ(i,t))}function pg(e){return!e.text.trim()&&!e.repo&&!e.branch&&!e.shell&&!e.hasAgent}function mJ(e){var o,l;const t=new Set,i=new Set,r=new Set;let n=!1;for(const s of e){(o=s.git)!=null&&o.repoName&&t.add(s.git.repoName),(l=s.git)!=null&&l.branch&&i.add(s.git.branch);const c=ny(s);c&&r.add(c),$A(s)&&(n=!0)}return{repos:[...t].sort(),branches:[...i].sort(),shells:[...r].sort(),hasAnyAgent:n}}const _J="_bar_r5zbt_1",bJ="_searchRow_r5zbt_10",yJ="_searchInput_r5zbt_16",vJ="_clearBtn_r5zbt_32",CJ="_chips_r5zbt_43",xJ="_chip_r5zbt_43",SJ="_chipActive_r5zbt_64",wJ="_chipGroup_r5zbt_69",TJ="_chipMenu_r5zbt_73",kJ="_chipMenuItem_r5zbt_88",EJ="_chipMenuItemActive_r5zbt_106",Nn={bar:_J,searchRow:bJ,searchInput:yJ,clearBtn:vJ,chips:CJ,chip:xJ,chipActive:SJ,chipGroup:wJ,chipMenu:TJ,chipMenuItem:kJ,chipMenuItemActive:EJ};function AJ({filter:e,facets:t,onChange:i}){const[r,n]=N.useState(null),o=N.useRef(null);N.useEffect(()=>{if(!r)return;const c=u=>{var f;(f=o.current)!=null&&f.contains(u.target)||n(null)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[r]);const l=c=>i({...e,...c}),s=(c,u,f,d)=>{if(f.length===0&&!d)return null;const g=d??u,p=!!d,x=r===c;return w.jsxs("div",{className:Nn.chipGroup,ref:x?o:void 0,children:[w.jsxs("button",{type:"button",className:`${Nn.chip} ${p?Nn.chipActive:""}`,onClick:()=>n(y=>y===c?null:c),"aria-haspopup":"menu","aria-expanded":x,children:[p?"✓ ":"",g,p?"":" ▾"]}),x&&w.jsxs("div",{className:Nn.chipMenu,role:"menu",children:[d&&w.jsxs("button",{type:"button",className:Nn.chipMenuItem,onClick:()=>{l({[c]:null}),n(null)},role:"menuitem",children:["Clear ",u]}),f.map(y=>w.jsx("button",{type:"button",className:`${Nn.chipMenuItem} ${d===y?Nn.chipMenuItemActive:""}`,onClick:()=>{l({[c]:y}),n(null)},role:"menuitem",children:y},y))]})]},c)};return w.jsxs("div",{className:Nn.bar,"data-testid":"sessions-filter-bar",children:[w.jsxs("div",{className:Nn.searchRow,children:[w.jsx("input",{className:Nn.searchInput,placeholder:"Search name, path, branch…",value:e.text,onChange:c=>l({text:c.target.value}),"aria-label":"Search sessions",type:"search",autoComplete:"off",spellCheck:!1,"data-testid":"sessions-search"}),!pg(e)&&w.jsx("button",{type:"button",className:Nn.clearBtn,onClick:()=>i({text:"",repo:null,branch:null,shell:null,hasAgent:!1}),"aria-label":"Clear all filters",children:"Clear"})]}),w.jsxs("div",{className:Nn.chips,children:[t.hasAnyAgent&&w.jsxs("button",{type:"button",className:`${Nn.chip} ${e.hasAgent?Nn.chipActive:""}`,onClick:()=>l({hasAgent:!e.hasAgent}),"aria-pressed":e.hasAgent,children:[e.hasAgent?"✓ ":"","Has agent"]}),s("repo","Repo",t.repos,e.repo),s("branch","Branch",t.branches,e.branch),s("shell","Shell",t.shells,e.shell)]})]})}const qd=[{icon:"⌨️",title:"TouchBar is your secret weapon",body:"Esc, Tab, Ctrl, arrows — all live one tap away on the bar above the on-screen keyboard"},{icon:"🎤",title:"Talk to your terminal",body:"Drop a Mic key into the TouchBar to dictate commands hands-free"},{icon:"🤏",title:"Pinch to resize",body:"Two-finger pinch on the terminal scales the font — and we remember the size next time"},{icon:"↕️",title:"Stack more keys",body:"Tap the TouchBar handle to expand and reveal up to 3 rows for vim, tmux, or your own combos"},{icon:"⚙️",title:"Customize every key",body:"Tap ▦ → Settings → Touch Bar → Customize to set exactly what each key types"},{icon:"🔗",title:"Beam this terminal anywhere",body:"Tap the share button to copy a URL — open it on any device with the password and you are in"},{icon:"📱",title:"Add to Home Screen",body:"Install TermBeam as a PWA from your browser for full-screen, app-like access"},{icon:"🗂️",title:"Save a workspace",body:"Group your favorite sessions in Settings → Workspaces → Save current as new workspace, then re-launch with one tap"},{icon:"↺",title:"Pick up where you left off",body:"Resume Agent opens your latest Copilot, Claude, or OpenCode conversation in a fresh terminal with the full history"},{icon:"⏯",title:"Hold an arrow to repeat",body:"Long-press the arrow keys on the TouchBar for fast cursor movement, just like a real keyboard"},{icon:"🛰️",title:"Cellular access on the go",body:"An optional dev tunnel lets you reach this terminal from your phone over LTE — no VPN, no LAN, no fuss"},{icon:"🎨",title:"Theme to match your vibe",body:"Tap the palette icon in the header to switch themes — your choice syncs across every device"},{icon:"👈",title:"Swipe a session to delete",body:"Swipe a session card left to reveal its delete button — swipe right to snap it back"},{icon:"🔍",title:"Filter the noise",body:"When you have a few sessions running, the filter bar lets you narrow by repo, branch, or shell"},{icon:"📁",title:"Pin a default folder",body:"Set a default folder in Settings so every new session starts where you actually work"},{icon:"✨",title:"Auto-run on launch",body:"Set a default initial command in Settings to fire vim, tmux, or your agent the moment a session boots"},{icon:"🔔",title:"Get pinged when output goes quiet",body:"Enable Notifications in Settings — TermBeam beeps on bell signals or after a busy command goes silent"},{icon:"📳",title:"Feel every keypress",body:"Haptics on iOS-style devices add a subtle buzz to TouchBar taps — toggle in Settings → Notifications & Feedback"},{icon:"🧭",title:"Jump between sessions",body:"Tap ☰ to slide open the side panel and hop between every running session without leaving the terminal"},{icon:"📋",title:"Copy & paste, no jailbreak",body:"Long-press in the terminal to select text, then use the Copy and Paste keys on the TouchBar"},{icon:"🔄",title:"Always on the latest",body:"A banner appears at the top whenever a new TermBeam version ships — tap to grab the update"},{icon:"📡",title:"Reconnects on its own",body:"Lose signal in the elevator? TermBeam auto-reattaches when your phone is back online, scrollback intact"},{icon:"🪄",title:"Multiple shells, one tap",body:"Open ▦ → New tab and pick zsh, bash, pwsh — TermBeam auto-detects every shell installed on your machine"},{icon:"📑",title:"Watch the agent edit your code",body:"When Claude or Copilot edits a file through a tool call, the change renders as a diff right inside the chat"},{icon:"🔭",title:"Find in terminal",body:"Open ▦ → Find in terminal to search scrollback — regex is one tap away when you need it"},{icon:"🪟",title:"Split the screen",body:"Open ▦ → Split vertical or Split horizontal to put two terminals side by side — tests in one, edits in the other"},{icon:"🏷️",title:"Name your sessions",body:'Rename a session from the Tools panel so the side panel reads "api" or "logs" instead of a hash'},{icon:"📤",title:"Push files from your phone",body:"Open ▦ → Upload files to drop photos, configs, or anything else straight into your working directory"},{icon:"📥",title:"Pull files back",body:"Use ▦ → Download file to grab a build artifact, log, or screenshot off the server in one tap"},{icon:"📖",title:"Read READMEs in style",body:"Open ▦ → View markdown to render any .md file from your repo with proper headings and code blocks"},{icon:"🌐",title:"Preview a local port on your phone",body:"Tap ▦ → Preview port to expose a dev server (3000, 5173, …) through the tunnel so you can hit it from anywhere"},{icon:"🪵",title:"See the diff before you commit",body:"Open ▦ → Git changes for a quick look at staged and unstaged hunks without leaving the terminal"},{icon:"🗒️",title:"Sessions live in tabs",body:"Tap ▦ → New tab to spin up another session — switch between every running session from the tab bar at the top"},{icon:"🧹",title:"Clean slate, no typing",body:"Hit ▦ → Clear terminal to wipe both the viewport and scrollback — quicker than reaching for the on-screen keyboard"},{icon:"🧯",title:"Filter folders as you type",body:"In the folder picker, start typing any path fragment — the list narrows live so you never scroll a deep tree"},{icon:"📎",title:"Paste many lines, no surprises",body:"Multi-line pastes use bracketed-paste markers so the shell treats them as one chunk — no stray commands sneak through"},{icon:"🔐",title:"One password, many devices",body:"Use the same TermBeam URL and password to attach from your laptop, tablet, and phone at once — every view stays in sync"},{icon:"👀",title:"Watch a teammate live",body:"Multiple browsers attached to the same session see the same output frame-by-frame — great for pair debugging"},{icon:"🖋️",title:"Tweak the font, not the world",body:"Use ▦ → Increase/Decrease font size for finer control than pinch — perfect for reading code on a small screen"},{icon:"ℹ️",title:"Wondering what version you are on?",body:"Tap ▦ → About to see the running version, links to docs and source, and a one-tap update check"}];function LJ(e=Math.random()){return Math.floor(e*qd.length)%qd.length}function BJ(e){const t=qd.length,i=(e%t+t)%t;return qd[i]}const MJ="_page_lcfvw_1",RJ="_header_lcfvw_11",DJ="_brand_lcfvw_25",NJ="_title_lcfvw_32",OJ="_version_lcfvw_47",IJ="_headerActions_lcfvw_56",FJ="_headerBtn_lcfvw_63",PJ="_content_lcfvw_89",HJ="_sessionsList_lcfvw_94",$J="_emptyState_lcfvw_113",jJ="_emptyIcon_lcfvw_124",zJ="_emptyText_lcfvw_129",UJ="_emptyHint_lcfvw_133",qJ="_emptyHintButton_lcfvw_138",WJ="_tipCard_lcfvw_158",YJ="_tipBadge_lcfvw_180",GJ="_tipIcon_lcfvw_195",VJ="_tipBody_lcfvw_202",XJ="_tipTitle_lcfvw_210",KJ="_tipText_lcfvw_216",QJ="_tipNav_lcfvw_223",ZJ="_tipNavBtn_lcfvw_234",JJ="_tipCounter_lcfvw_267",eee="_hubFooter_lcfvw_276",tee="_newSessionBtn_lcfvw_289",iee="_resumeBtn_lcfvw_314",ree="_workspaceBtn_lcfvw_338",Ei={page:MJ,header:RJ,brand:DJ,title:NJ,version:OJ,headerActions:IJ,headerBtn:FJ,content:PJ,sessionsList:HJ,emptyState:$J,emptyIcon:jJ,emptyText:zJ,emptyHint:UJ,emptyHintButton:qJ,tipCard:WJ,tipBadge:YJ,tipIcon:GJ,tipBody:VJ,tipTitle:XJ,tipText:KJ,tipNav:QJ,tipNavBtn:ZJ,tipCounter:JJ,hubFooter:eee,newSessionBtn:tee,resumeBtn:iee,workspaceBtn:ree},nee=3e3,sy="termbeam-hub-filter",wE=40;function see(){try{const e=sessionStorage.getItem(sy);if(!e)return ry;const t=JSON.parse(e);return{text:typeof t.text=="string"?t.text:"",repo:typeof t.repo=="string"?t.repo:null,branch:typeof t.branch=="string"?t.branch:null,shell:typeof t.shell=="string"?t.shell:null,hasAgent:!!t.hasAgent}}catch{return ry}}const aee=()=>w.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]});function oee(){const[e,t]=N.useState([]),[i,r]=N.useState(!0),[n,o]=N.useState(!1),[l,s]=N.useState(""),[c,u]=N.useState(null),[f,d]=N.useState(()=>see()),[g,p]=N.useState(!1),x=N.useRef(null),y=N.useRef(!0),{openNewSessionModal:_,openResumeBrowser:b,themePickerOpen:v,closeThemePicker:C,toggleToolsPanel:k,customKeysModalOpen:E,closeCustomKeysModal:T}=Je(),A=ht(V=>V.dissolvingIds),L=Sv(),M=N.useCallback(async()=>{try{const $=(await _d()).filter(Y=>!Y.hidden);t(Y=>{const ee=new Set($.map(J=>J.id)),ne=Y.filter(J=>ht.getState().dissolvingIds.has(J.id)&&!ee.has(J.id));return[...$,...ne]})}catch{}finally{r(!1)}},[]);N.useEffect(()=>{M();const V=setInterval(M,nee);return()=>clearInterval(V)},[M]),N.useEffect(()=>{if(y.current&&!i){o(!0);const V=setTimeout(()=>o(!1),2200);return y.current=i,()=>clearTimeout(V)}y.current=i},[i]),N.useEffect(()=>{xv().then(V=>{V&&s(V)})},[]),N.useEffect(()=>{try{pg(f)?sessionStorage.removeItem(sy):sessionStorage.setItem(sy,JSON.stringify(f))}catch{}},[f]);const D=N.useMemo(()=>mJ(e),[e]),P=N.useMemo(()=>gJ(e,f),[e,f]),z=!pg(f),[U,W]=N.useState(()=>LJ()),Z=BJ(U),j=qd.length,G=N.useCallback(()=>W(V=>V-1),[]),X=N.useCallback(()=>W(V=>V+1),[]),F=N.useRef(null);function O(V){window.history.pushState(null,"",`/terminal?session=${V}`),window.dispatchEvent(new PopStateEvent("popstate"))}async function H(V){var ee;const $=e.find(ne=>ne.id===V),Y=(ee=x.current)==null?void 0:ee.querySelector(`[data-session-id="${V}"]`);try{await L(V,{element:Y??null,color:($==null?void 0:$.color)??"#6ec1e4",apiDelete:()=>Pd(V),finalize:()=>{const ne=ht.getState(),J=ne.sessions.get(V);J!=null&&J.companionTermId&&ne.removeSession(J.companionTermId),ne.removeSession(V),t(K=>K.filter(le=>le.id!==V))}}),Pt.success(`Session "${($==null?void 0:$.name)??V}" deleted`)}catch(ne){Pt.error(ne instanceof Error?ne.message:"Failed to delete session")}}return N.useEffect(()=>{const V=$=>{if(($.ctrlKey||$.metaKey)&&$.key==="k"){const Y=$.target;if((Y==null?void 0:Y.tagName)==="INPUT"||(Y==null?void 0:Y.tagName)==="TEXTAREA"||(Y==null?void 0:Y.isContentEditable))return;$.preventDefault(),k()}};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[k]),w.jsxs("div",{className:Ei.page,children:[w.jsx(CK,{}),w.jsx(AK,{}),w.jsxs("header",{className:Ei.header,children:[w.jsx("div",{className:Ei.brand,children:w.jsxs("h1",{className:Ei.title,children:[w.jsx(lg,{size:"sm",animated:!1}),l?w.jsxs("span",{className:Ei.version,"data-testid":"hub-version",children:["v",l]}):null]})}),w.jsx("div",{className:Ei.headerActions,children:w.jsx("button",{className:Ei.headerBtn,onClick:k,"aria-label":"Tools",title:"Tools (Ctrl+K)","data-testid":"palette-trigger",children:w.jsx(aee,{})})})]}),w.jsx(Tv,{open:v,onClose:C,hideTrigger:!0}),w.jsx(IA,{inHub:!0}),w.jsx(G4,{inHub:!0}),w.jsx(K4,{open:E,onClose:T}),w.jsx("main",{className:Ei.content,"aria-busy":i||void 0,children:i?null:e.length===0?w.jsxs("div",{className:Ei.emptyState,"data-testid":"empty-state",children:[w.jsx(lg,{size:"md"}),w.jsx("span",{className:Ei.emptyText,children:"No active sessions"}),w.jsx("span",{className:Ei.emptyHint,children:'Tap "+ New Session" to create a new terminal session'}),w.jsxs("div",{className:Ei.tipCard,"data-testid":"hub-tip",role:"region","aria-label":"Tip carousel","aria-live":"polite",onTouchStart:V=>{var $;F.current=(($=V.touches[0])==null?void 0:$.clientX)??null},onTouchEnd:V=>{var ee;const $=F.current;if(F.current=null,$==null)return;const Y=(((ee=V.changedTouches[0])==null?void 0:ee.clientX)??$)-$;Y<=-wE?X():Y>=wE&&G()},children:[w.jsx("span",{className:Ei.tipBadge,children:"Tip"}),w.jsx("span",{className:Ei.tipIcon,"aria-hidden":"true",children:Z.icon}),w.jsxs("div",{className:Ei.tipBody,children:[w.jsx("strong",{className:Ei.tipTitle,children:Z.title}),w.jsx("span",{className:Ei.tipText,children:Z.body})]}),w.jsxs("div",{className:Ei.tipNav,"data-testid":"hub-tip-nav",children:[w.jsx("button",{type:"button",className:Ei.tipNavBtn,onClick:G,"aria-label":"Previous tip","data-testid":"hub-tip-prev",children:w.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("polyline",{points:"15 18 9 12 15 6"})})}),w.jsxs("span",{className:Ei.tipCounter,"aria-label":`Tip ${(U%j+j)%j+1} of ${j}`,"data-testid":"hub-tip-counter",children:[(U%j+j)%j+1,w.jsxs("span",{"aria-hidden":"true",children:[" / ",j]})]}),w.jsx("button",{type:"button",className:Ei.tipNavBtn,onClick:X,"aria-label":"Next tip","data-testid":"hub-tip-next",children:w.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:w.jsx("polyline",{points:"9 18 15 12 9 6"})})})]})]})]}):w.jsxs(w.Fragment,{children:[w.jsx(AJ,{filter:f,facets:D,onChange:d}),P.length===0?w.jsxs("div",{className:Ei.emptyState,"data-testid":"empty-filtered",children:[w.jsx("span",{className:Ei.emptyIcon,children:"🔍"}),w.jsx("span",{className:Ei.emptyText,children:"No sessions match your filters"}),w.jsx("button",{type:"button",className:`${Ei.emptyHint} ${Ei.emptyHintButton}`,onClick:()=>d(ry),children:"Clear filters"})]}):w.jsx("div",{ref:x,className:Ei.sessionsList,"data-testid":"sessions-list","data-filter-active":z||void 0,"data-arriving":n||void 0,children:P.map((V,$)=>w.jsx(JK,{session:V,onSelect:O,onDelete:H,revealedId:c,onRevealChange:u,index:$,arriving:n,dissolving:A.has(V.id)},V.id))})]})}),w.jsxs("div",{className:Ei.hubFooter,children:[w.jsx("button",{className:Ei.newSessionBtn,onClick:()=>_(),"aria-label":"New session","data-testid":"hub-new-session-btn",children:"+ New Session"}),w.jsx("button",{className:Ei.resumeBtn,onClick:b,"aria-label":"Resume agent",children:"↺ Resume Agent"}),w.jsx("button",{className:Ei.workspaceBtn,onClick:()=>p(!0),"aria-label":"Open workspace","data-testid":"hub-open-workspace-btn",children:"Open Workspace"})]}),w.jsx(PA,{onCreated:O}),w.jsx(HA,{}),w.jsx(hJ,{open:g,onClose:()=>p(!1),onLaunched:V=>{V&&O(V)}})]})}function lee(){const e=N.useRef(null);N.useEffect(()=>{if(!("wakeLock"in navigator))return;async function t(){try{e.current=await navigator.wakeLock.request("screen")}catch{}}function i(){document.visibilityState==="visible"&&t()}return t(),document.addEventListener("visibilitychange",i),()=>{var r;document.removeEventListener("visibilitychange",i),(r=e.current)==null||r.release().catch(()=>{}),e.current=null}},[])}const TE=50;function vm(){var r;const[e,t]=N.useState({keyboardOpen:!1,keyboardHeight:0}),i=N.useRef(((r=window.visualViewport)==null?void 0:r.height)??window.innerHeight);return N.useEffect(()=>{const n=window.visualViewport;if(!n)return;i.current=n.height;let o=n.width,l=!1,s;function c(){l=!0,t({keyboardOpen:!1,keyboardHeight:0}),clearTimeout(s),s=setTimeout(()=>{i.current=n.height,o=n.width,l=!1;const g=i.current-n.height,p=g>TE;t({keyboardOpen:p,keyboardHeight:p?g:0})},500)}function u(){if(n.width!==o){c();return}if(l)return;const g=n.height,p=i.current-g,x=p>TE;t({keyboardOpen:x,keyboardHeight:x?p:0})}function f(){c()}n.addEventListener("resize",u);const d=screen.orientation;return d&&d.addEventListener("change",f),window.addEventListener("orientationchange",f),()=>{clearTimeout(s),n.removeEventListener("resize",u),d&&d.removeEventListener("change",f),window.removeEventListener("orientationchange",f)}},[]),e}var $_={exports:{}},kE;function cee(){return kE||(kE=1,(function(e,t){(function(i,r){e.exports=r()})(globalThis,(()=>(()=>{var i={4567:function(l,s,c){var u=this&&this.__decorate||function(v,C,k,E){var T,A=arguments.length,L=A<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,k):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,C,k,E);else for(var M=v.length-1;M>=0;M--)(T=v[M])&&(L=(A<3?T(L):A>3?T(C,k,L):T(C,k))||L);return A>3&&L&&Object.defineProperty(C,k,L),L},f=this&&this.__param||function(v,C){return function(k,E){C(k,E,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const d=c(9042),g=c(9924),p=c(844),x=c(4725),y=c(2585),_=c(3656);let b=s.AccessibilityManager=class extends p.Disposable{constructor(v,C,k,E){super(),this._terminal=v,this._coreBrowserService=k,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let T=0;T<this._terminal.rows;T++)this._rowElements[T]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[T]);if(this._topBoundaryFocusListener=T=>this._handleBoundaryFocus(T,0),this._bottomBoundaryFocusListener=T=>this._handleBoundaryFocus(T,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new g.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((T=>this._handleResize(T.rows)))),this.register(this._terminal.onRender((T=>this._refreshRows(T.start,T.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((T=>this._handleChar(T)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
123
123
|
`)))),this.register(this._terminal.onA11yTab((T=>this._handleTab(T)))),this.register(this._terminal.onKey((T=>this._handleKey(T.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let C=0;C<v;C++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
|
|
124
124
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,C){this._liveRegionDebouncer.refresh(v,C,this._terminal.rows)}_renderRows(v,C){const k=this._terminal.buffer,E=k.lines.length.toString();for(let T=v;T<=C;T++){const A=k.lines.get(k.ydisp+T),L=[],M=(A==null?void 0:A.translateToString(!0,void 0,void 0,L))||"",D=(k.ydisp+T+1).toString(),P=this._rowElements[T];P&&(M.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=M,this._rowColumns.set(P,L)),P.setAttribute("aria-posinset",D),P.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,C){const k=v.target,E=this._rowElements[C===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(C===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==E)return;let T,A;if(C===0?(T=k,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(T=this._rowElements.shift(),A=k,this._rowContainer.removeChild(T)),T.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),C===0){const L=this._createAccessibilityTreeNode();this._rowElements.unshift(L),this._rowContainer.insertAdjacentElement("afterbegin",L)}else{const L=this._createAccessibilityTreeNode();this._rowElements.push(L),this._rowContainer.appendChild(L)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(C===0?-1:1),this._rowElements[C===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let C={node:v.anchorNode,offset:v.anchorOffset},k={node:v.focusNode,offset:v.focusOffset};if((C.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||C.node===k.node&&C.offset>k.offset)&&([C,k]=[k,C]),C.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(C={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(C.node))return;const E=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:E,offset:((M=E.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(k.node))return;const T=({node:D,offset:P})=>{const z=D instanceof Text?D.parentNode:D;let U=parseInt(z==null?void 0:z.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(z);if(!W)return console.warn("columns is null. Race condition?"),null;let Z=P<W.length?W[P]:W.slice(-1)[0]+1;return Z>=this._terminal.cols&&(++U,Z=0),{row:U,column:Z}},A=T(C),L=T(k);if(A&&L){if(A.row>L.row||A.row===L.row&&A.column>=L.column)throw new Error("invalid range");this._terminal.select(A.column,A.row,(L.row-A.row)*this._terminal.cols-A.column+L.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let C=this._rowContainer.children.length;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=b=u([f(1,y.IInstantiationService),f(2,x.ICoreBrowserService),f(3,x.IRenderService)],b)},3614:(l,s)=>{function c(g){return g.replace(/\r?\n/g,"\r")}function u(g,p){return p?"\x1B[200~"+g+"\x1B[201~":g}function f(g,p,x,y){g=u(g=c(g),x.decPrivateModes.bracketedPasteMode&&y.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(g,!0),p.value=""}function d(g,p,x){const y=x.getBoundingClientRect(),_=g.clientX-y.left-10,b=g.clientY-y.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${_}px`,p.style.top=`${b}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=c,s.bracketTextForPaste=u,s.copyHandler=function(g,p){g.clipboardData&&g.clipboardData.setData("text/plain",p.selectionText),g.preventDefault()},s.handlePasteEvent=function(g,p,x,y){g.stopPropagation(),g.clipboardData&&f(g.clipboardData.getData("text/plain"),p,x,y)},s.paste=f,s.moveTextAreaUnderMouseCursor=d,s.rightClickHandler=function(g,p,x,y,_){d(g,p,x),_&&y.rightClickSelect(g),p.value=y.selectionText,p.select()}},7239:(l,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const u=c(1505);s.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(f,d,g){this._css.set(f,d,g)}getCss(f,d){return this._css.get(f,d)}setColor(f,d,g){this._color.set(f,d,g)}getColor(f,d){return this._color.get(f,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,u,f,d){c.addEventListener(u,f,d);let g=!1;return{dispose:()=>{g||(g=!0,c.removeEventListener(u,f,d))}}}},3551:function(l,s,c){var u=this&&this.__decorate||function(b,v,C,k){var E,T=arguments.length,A=T<3?v:k===null?k=Object.getOwnPropertyDescriptor(v,C):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,v,C,k);else for(var L=b.length-1;L>=0;L--)(E=b[L])&&(A=(T<3?E(A):T>3?E(v,C,A):E(v,C))||A);return T>3&&A&&Object.defineProperty(v,C,A),A},f=this&&this.__param||function(b,v){return function(C,k){v(C,k,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const d=c(3656),g=c(8460),p=c(844),x=c(2585),y=c(4725);let _=s.Linkifier=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(b,v,C,k,E){super(),this._element=b,this._mouseService=v,this._renderService=C,this._bufferService=k,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)((()=>{var T;this._lastMouseEvent=void 0,(T=this._activeProviderReplies)==null||T.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const C=b.composedPath();for(let k=0;k<C.length;k++){const E=C[k];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,v){var k,E;this._activeProviderReplies&&v||((k=this._activeProviderReplies)==null||k.forEach((T=>{T==null||T.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let C=!1;for(const[T,A]of this._linkProviderService.linkProviders.entries())v?(E=this._activeProviderReplies)!=null&&E.get(T)&&(C=this._checkLinkProviderResult(T,b,C)):A.provideLinks(b.y,(L=>{var D,P;if(this._isMouseOut)return;const M=L==null?void 0:L.map((z=>({link:z})));(D=this._activeProviderReplies)==null||D.set(T,M),C=this._checkLinkProviderResult(T,b,C),((P=this._activeProviderReplies)==null?void 0:P.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,v){const C=new Set;for(let k=0;k<v.size;k++){const E=v.get(k);if(E)for(let T=0;T<E.length;T++){const A=E[T],L=A.link.range.start.y<b?0:A.link.range.start.x,M=A.link.range.end.y>b?this._bufferService.cols:A.link.range.end.x;for(let D=L;D<=M;D++){if(C.has(D)){E.splice(T--,1);break}C.add(D)}}}}_checkLinkProviderResult(b,v,C){var T;if(!this._activeProviderReplies)return C;const k=this._activeProviderReplies.get(b);let E=!1;for(let A=0;A<b;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(E=!0);if(!E&&k){const A=k.find((L=>this._linkAtPosition(L.link,v)));A&&(C=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!C)for(let A=0;A<this._activeProviderReplies.size;A++){const L=(T=this._activeProviderReplies.get(A))==null?void 0:T.find((M=>this._linkAtPosition(M.link,v)));if(L){C=!0,this._handleNewLink(L);break}}return C}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,v){this._currentLink&&this._lastMouseEvent&&(!b||!v||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(b.link,v)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var C,k;return(k=(C=this._currentLink)==null?void 0:C.state)==null?void 0:k.decorations.pointerCursor},set:C=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==C&&(this._currentLink.state.decorations.pointerCursor=C,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",C))}},underline:{get:()=>{var C,k;return(k=(C=this._currentLink)==null?void 0:C.state)==null?void 0:k.decorations.underline},set:C=>{var k,E,T;(k=this._currentLink)!=null&&k.state&&((T=(E=this._currentLink)==null?void 0:E.state)==null?void 0:T.decorations.underline)!==C&&(this._currentLink.state.decorations.underline=C,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,C))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((C=>{if(!this._currentLink)return;const k=C.start===0?0:C.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+C.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(k,E),this._lastMouseEvent)){const T=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);T&&this._askForLink(T,!1)}}))))}_linkHover(b,v,C){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(C,v.text)}_fireUnderlineEvent(b,v){const C=b.range,k=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(C.start.x-1,C.start.y-k-1,C.end.x,C.end.y-k-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,v,C){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(C,v.text)}_linkAtPosition(b,v){const C=b.range.start.y*this._bufferService.cols+b.range.start.x,k=b.range.end.y*this._bufferService.cols+b.range.end.x,E=v.y*this._bufferService.cols+v.x;return C<=E&&E<=k}_positionFromMouseEvent(b,v,C){const k=C.getCoords(b,v,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,v,C,k,E){return{x1:b,y1:v,x2:C,y2:k,cols:this._bufferService.cols,fg:E}}};s.Linkifier=_=u([f(1,y.IMouseService),f(2,y.IRenderService),f(3,x.IBufferService),f(4,y.ILinkProviderService)],_)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,c){var u=this&&this.__decorate||function(y,_,b,v){var C,k=arguments.length,E=k<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(y,_,b,v);else for(var T=y.length-1;T>=0;T--)(C=y[T])&&(E=(k<3?C(E):k>3?C(_,b,E):C(_,b))||E);return k>3&&E&&Object.defineProperty(_,b,E),E},f=this&&this.__param||function(y,_){return function(b,v){_(b,v,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const d=c(511),g=c(2585);let p=s.OscLinkProvider=class{constructor(y,_,b){this._bufferService=y,this._optionsService=_,this._oscLinkService=b}provideLinks(y,_){var M;const b=this._bufferService.buffer.lines.get(y-1);if(!b)return void _(void 0);const v=[],C=this._optionsService.rawOptions.linkHandler,k=new d.CellData,E=b.getTrimmedLength();let T=-1,A=-1,L=!1;for(let D=0;D<E;D++)if(A!==-1||b.hasContent(D)){if(b.loadCell(D,k),k.hasExtendedAttrs()&&k.extended.urlId){if(A===-1){A=D,T=k.extended.urlId;continue}L=k.extended.urlId!==T}else A!==-1&&(L=!0);if(L||A!==-1&&D===E-1){const P=(M=this._oscLinkService.getLinkData(T))==null?void 0:M.uri;if(P){const z={start:{x:A+1,y},end:{x:D+(L||D!==E-1?0:1),y}};let U=!1;if(!(C!=null&&C.allowNonHttpProtocols))try{const W=new URL(P);["http:","https:"].includes(W.protocol)||(U=!0)}catch{U=!0}U||v.push({text:P,range:z,activate:(W,Z)=>C?C.activate(W,Z,z):x(0,Z),hover:(W,Z)=>{var j;return(j=C==null?void 0:C.hover)==null?void 0:j.call(C,W,Z,z)},leave:(W,Z)=>{var j;return(j=C==null?void 0:C.leave)==null?void 0:j.call(C,W,Z,z)}})}L=!1,k.hasExtendedAttrs()&&k.extended.urlId?(A=D,T=k.extended.urlId):(A=-1,T=-1)}}_(v)}};function x(y,_){if(confirm(`Do you want to navigate to ${_}?
|
|
125
125
|
|
|
@@ -440,8 +440,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error
|
|
|
440
440
|
L0,20`)},"requirement_arrow"),F2e=q((e,t,i)=>{const r=cr(),{themeVariables:n}=r,{strokeWidth:o}=n;e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
441
441
|
L20,10
|
|
442
442
|
M20,10
|
|
443
|
-
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),P2e=q((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H2e=q((e,t,i)=>{const r=cr(),{themeVariables:n}=r,{strokeWidth:o}=n,l=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");l.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),l.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),l.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),l.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),$2e={extension:b2e,composition:y2e,aggregation:v2e,dependency:C2e,lollipop:x2e,point:S2e,circle:w2e,cross:T2e,barb:k2e,barbNeo:E2e,only_one:A2e,zero_or_one:L2e,one_or_more:B2e,zero_or_more:M2e,only_one_neo:R2e,zero_or_one_neo:D2e,one_or_more_neo:N2e,zero_or_more_neo:O2e,requirement_arrow:I2e,requirement_contains:P2e,requirement_arrow_neo:F2e,requirement_contains_neo:H2e},j2e=_2e,z2e={common:xf,getConfig:cr,insertCluster:H1e,insertEdge:m2e,insertEdgeLabel:u2e,insertMarkers:j2e,insertNode:UN,interpolateToCurve:HC,labelHelper:Ht,log:Pe,positionEdgeLabel:h2e},af={},GN=q(e=>{for(const t of e)af[t.name]=t},"registerLayoutLoaders"),U2e=q(()=>{GN([{name:"dagre",loader:q(async()=>await ci(()=>import("./dagre-BM42HDAG-BRbrP_yo.js"),__vite__mapDeps([0,1,2])),"loader")},{name:"cose-bilkent",loader:q(async()=>await ci(()=>import("./cose-bilkent-S5V4N54A-CCEZDlDl.js"),__vite__mapDeps([3,4])),"loader")}])},"registerDefaultLayoutLoaders");U2e();var vEe=q(async(e,t)=>{if(!(e.layoutAlgorithm in af))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const f of e.nodes){const d=f.domId||f.id;f.domId=`${e.diagramId}-${d}`}const i=af[e.layoutAlgorithm],r=await i.loader(),{theme:n,themeVariables:o}=e.config,{useGradient:l,gradientStart:s,gradientStop:c}=o,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),l){const f=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");f.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),f.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return r.render(e,t,z2e,{algorithm:i.algorithm})},"render"),CEe=q((e="",{fallback:t="dagre"}={})=>{if(e in af)return e;if(t in af)return Pe.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),ax="comm",VN="rule",XN="decl",q2e="@media",W2e="@import",Y2e="@supports",G2e="@namespace",uv="@keyframes",KN="@layer",V2e="@scope",QN=Math.abs,ox=String.fromCharCode;function ZN(e){return e.trim()}function rg(e,t,i){return e.replace(t,i)}function X2e(e,t,i){return e.indexOf(t,i)}function ru(e,t){return e.charCodeAt(t)|0}function Lu(e,t,i){return e.slice(t,i)}function na(e){return e.length}function JN(e){return e.length}function Sp(e,t){return t.push(e),e}var Vm=1,Bu=1,eO=0,Es=0,Nr=0,zu="";function lx(e,t,i,r,n,o,l,s){return{value:e,root:t,parent:i,type:r,props:n,children:o,line:Vm,column:Bu,length:l,return:"",siblings:s}}function K2e(){return Nr}function Q2e(){return Nr=Es>0?ru(zu,--Es):0,Bu--,Nr===10&&(Bu=1,Vm--),Nr}function js(){return Nr=Es<eO?ru(zu,Es++):0,Bu++,Nr===10&&(Bu=1,Vm++),Nr}function Io(){return ru(zu,Es)}function ng(){return Es}function Xm(e,t){return Lu(zu,e,t)}function of(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Z2e(e){return Vm=Bu=1,eO=na(zu=e),Es=0,[]}function J2e(e){return zu="",e}function Tb(e){return ZN(Xm(Es-1,hv(e===91?e+2:e===40?e+1:e)))}function e_e(e){for(;(Nr=Io())&&Nr<33;)js();return of(e)>2||of(Nr)>3?"":" "}function t_e(e,t){for(;--t&&js()&&!(Nr<48||Nr>102||Nr>57&&Nr<65||Nr>70&&Nr<97););return Xm(e,ng()+(t<6&&Io()==32&&js()==32))}function hv(e){for(;js();)switch(Nr){case e:return Es;case 34:case 39:e!==34&&e!==39&&hv(Nr);break;case 40:e===41&&hv(e);break;case 92:js();break}return Es}function i_e(e,t){for(;js()&&e+Nr!==57;)if(e+Nr===84&&Io()===47)break;return"/*"+Xm(t,Es-1)+"*"+ox(e===47?e:js())}function r_e(e){for(;!of(Io());)js();return Xm(e,Es)}function n_e(e){return J2e(sg("",null,null,null,[""],e=Z2e(e),0,[0],e))}function sg(e,t,i,r,n,o,l,s,c){for(var u=0,f=0,d=l,g=0,p=0,x=0,y=1,_=1,b=1,v=0,C="",k=n,E=o,T=r,A=C;_;)switch(x=v,v=js()){case 40:if(x!=108&&ru(A,d-1)==58){X2e(A+=rg(Tb(v),"&","&\f"),"&\f",QN(u?s[u-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:A+=Tb(v);break;case 9:case 10:case 13:case 32:A+=e_e(x);break;case 92:A+=t_e(ng()-1,7);continue;case 47:switch(Io()){case 42:case 47:Sp(s_e(i_e(js(),ng()),t,i,c),c),(of(x||1)==5||of(Io()||1)==5)&&na(A)&&Lu(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*y:s[u++]=na(A)*b;case 125*y:case 59:case 0:switch(v){case 0:case 125:_=0;case 59+f:b==-1&&(A=rg(A,/\f/g,"")),p>0&&(na(A)-d||y===0&&x===47)&&Sp(p>32?V5(A+";",r,i,d-1,c):V5(rg(A," ","")+";",r,i,d-2,c),c);break;case 59:A+=";";default:if(Sp(T=G5(A,t,i,u,f,n,s,C,k=[],E=[],d,o),o),v===123)if(f===0)sg(A,t,T,T,k,o,d,s,E);else{switch(g){case 99:if(ru(A,3)===110)break;case 108:if(ru(A,2)===97)break;default:f=0;case 100:case 109:case 115:}f?sg(e,T,T,r&&Sp(G5(e,T,T,0,0,n,s,C,n,k=[],d,E),E),n,E,d,s,r?k:E):sg(A,T,T,T,[""],E,0,s,E)}}u=f=p=0,y=b=1,C=A="",d=l;break;case 58:d=1+na(A),p=x;default:if(y<1){if(v==123)--y;else if(v==125&&y++==0&&Q2e()==125)continue}switch(A+=ox(v),v*y){case 38:b=f>0?1:(A+="\f",-1);break;case 44:s[u++]=(na(A)-1)*b,b=1;break;case 64:Io()===45&&(A+=Tb(js())),g=Io(),f=d=na(C=A+=r_e(ng())),v++;break;case 45:x===45&&na(A)==2&&(y=0)}}return o}function G5(e,t,i,r,n,o,l,s,c,u,f,d){for(var g=n-1,p=n===0?o:[""],x=JN(p),y=0,_=0,b=0;y<r;++y)for(var v=0,C=Lu(e,g+1,g=QN(_=l[y])),k=e;v<x;++v)(k=ZN(_>0?p[v]+" "+C:rg(C,/&\f/g,p[v])))&&(c[b++]=k);return lx(e,t,i,n===0?VN:s,c,u,f,d)}function s_e(e,t,i,r){return lx(e,t,i,ax,ox(K2e()),Lu(e,2,-2),0,r)}function V5(e,t,i,r,n){return lx(e,t,i,XN,Lu(e,0,r),Lu(e,r+1,-1),r,n)}function dv(e,t){for(var i="",r=0;r<e.length;r++)i+=t(e[r],r,e,t)||"";return i}function a_e(e,t,i,r){switch(e.type){case KN:if(e.children.length)break;case W2e:case G2e:case XN:return e.return=e.return||e.value;case ax:return"";case uv:return e.return=e.value+"{"+dv(e.children,r)+"}";case VN:if(!na(e.value=e.props.join(",")))return""}return na(i=dv(e.children,r))?e.return=e.value+"{"+i+"}":""}function o_e(e){var t=JN(e);return function(i,r,n,o){for(var l="",s=0;s<t;s++)l+=e[s](i,r,n,o)||"";return l}}var tO="c4",l_e=q(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),c_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./c4Diagram-AAUBKEIU-Lf-jQplF.js");return{diagram:t}},__vite__mapDeps([5,6]));return{id:tO,diagram:e}},"loader"),u_e={id:tO,detector:l_e,loader:c_e},h_e=u_e,iO="flowchart",d_e=q((e,t)=>{var i,r;return((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),f_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-deD4XLcv.js");return{diagram:t}},__vite__mapDeps([7,8,6,9,10,11]));return{id:iO,diagram:e}},"loader"),p_e={id:iO,detector:d_e,loader:f_e},g_e=p_e,rO="flowchart-v2",m_e=q((e,t)=>{var i,r,n;return((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),__e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-deD4XLcv.js");return{diagram:t}},__vite__mapDeps([7,8,6,9,10,11]));return{id:rO,diagram:e}},"loader"),b_e={id:rO,detector:m_e,loader:__e},y_e=b_e,nO="er",v_e=q(e=>/^\s*erDiagram/.test(e),"detector"),C_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./erDiagram-TEJ5UH35-BnoW0mTO.js");return{diagram:t}},__vite__mapDeps([12,9,10,11]));return{id:nO,diagram:e}},"loader"),x_e={id:nO,detector:v_e,loader:C_e},S_e=x_e,sO="gitGraph",w_e=q(e=>/^\s*gitGraph/.test(e),"detector"),T_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./gitGraphDiagram-PVQCEYII-BtPMKzJD.js");return{diagram:t}},__vite__mapDeps([13,14,15,16]));return{id:sO,diagram:e}},"loader"),k_e={id:sO,detector:w_e,loader:T_e},E_e=k_e,aO="gantt",A_e=q(e=>/^\s*gantt/.test(e),"detector"),L_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./ganttDiagram-6RSMTGT7-BgYvdjYD.js");return{diagram:t}},__vite__mapDeps([17,18,19,20]));return{id:aO,diagram:e}},"loader"),B_e={id:aO,detector:A_e,loader:L_e},M_e=B_e,oO="info",R_e=q(e=>/^\s*info/.test(e),"detector"),D_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./infoDiagram-5YYISTIA-BNFXZeHF.js");return{diagram:t}},__vite__mapDeps([21,16]));return{id:oO,diagram:e}},"loader"),N_e={id:oO,detector:R_e,loader:D_e},lO="pie",O_e=q(e=>/^\s*pie/.test(e),"detector"),I_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./pieDiagram-4H26LBE5-Dlh-y7ih.js");return{diagram:t}},__vite__mapDeps([22,14,16,23,24,19]));return{id:lO,diagram:e}},"loader"),F_e={id:lO,detector:O_e,loader:I_e},cO="quadrantChart",P_e=q(e=>/^\s*quadrantChart/.test(e),"detector"),H_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./quadrantDiagram-W4KKPZXB-tr5QhZAJ.js");return{diagram:t}},__vite__mapDeps([25,18,19,20]));return{id:cO,diagram:e}},"loader"),$_e={id:cO,detector:P_e,loader:H_e},j_e=$_e,uO="xychart",z_e=q(e=>/^\s*xychart(-beta)?/.test(e),"detector"),U_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./xychartDiagram-2RQKCTM6-Bv9Hklj4.js");return{diagram:t}},__vite__mapDeps([26,19,24,18,20]));return{id:uO,diagram:e}},"loader"),q_e={id:uO,detector:z_e,loader:U_e},W_e=q_e,hO="requirement",Y_e=q(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),G_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./requirementDiagram-4Y6WPE33-_qV3HlS7.js");return{diagram:t}},__vite__mapDeps([27,9,10]));return{id:hO,diagram:e}},"loader"),V_e={id:hO,detector:Y_e,loader:G_e},X_e=V_e,dO="sequence",K_e=q(e=>/^\s*sequenceDiagram/.test(e),"detector"),Q_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./sequenceDiagram-3UESZ5HK-CYGsjwvO.js");return{diagram:t}},__vite__mapDeps([28,6,15]));return{id:dO,diagram:e}},"loader"),Z_e={id:dO,detector:K_e,loader:Q_e},J_e=Z_e,fO="class",ebe=q((e,t)=>{var i;return((i=t==null?void 0:t.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),tbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./classDiagram-4FO5ZUOK-Cu1smEpb.js");return{diagram:t}},__vite__mapDeps([29,30,8,6,9,10]));return{id:fO,diagram:e}},"loader"),ibe={id:fO,detector:ebe,loader:tbe},rbe=ibe,pO="classDiagram",nbe=q((e,t)=>{var i;return/^\s*classDiagram/.test(e)&&((i=t==null?void 0:t.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),sbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./classDiagram-v2-Q7XG4LA2-Cu1smEpb.js");return{diagram:t}},__vite__mapDeps([31,30,8,6,9,10]));return{id:pO,diagram:e}},"loader"),abe={id:pO,detector:nbe,loader:sbe},obe=abe,gO="state",lbe=q((e,t)=>{var i;return((i=t==null?void 0:t.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),cbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./stateDiagram-AJRCARHV-D5wVSY__.js");return{diagram:t}},__vite__mapDeps([32,33,9,10,1,2]));return{id:gO,diagram:e}},"loader"),ube={id:gO,detector:lbe,loader:cbe},hbe=ube,mO="stateDiagram",dbe=q((e,t)=>{var i;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((i=t==null?void 0:t.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),fbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./stateDiagram-v2-BHNVJYJU-DcLQpqf2.js");return{diagram:t}},__vite__mapDeps([34,33,9,10]));return{id:mO,diagram:e}},"loader"),pbe={id:mO,detector:dbe,loader:fbe},gbe=pbe,_O="journey",mbe=q(e=>/^\s*journey/.test(e),"detector"),_be=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./journeyDiagram-JHISSGLW-Blto5i-o.js");return{diagram:t}},__vite__mapDeps([35,8,6,23]));return{id:_O,diagram:e}},"loader"),bbe={id:_O,detector:mbe,loader:_be},ybe=bbe,vbe=q((e,t,i)=>{Pe.debug(`rendering svg for syntax error
|
|
444
|
-
`);const r=ipe(t),n=r.append("g");r.attr("viewBox","0 0 2412 512"),GB(r,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),bO={draw:vbe},Cbe=bO,xbe={db:{},renderer:bO,parser:{parse:q(()=>{},"parse")}},Sbe=xbe,yO="flowchart-elk",wbe=q((e,t={})=>{var i;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Tbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-
|
|
443
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),P2e=q((e,t,i)=>{const r=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");r.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),r.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),r.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H2e=q((e,t,i)=>{const r=cr(),{themeVariables:n}=r,{strokeWidth:o}=n,l=e.append("defs").append("marker").attr("id",i+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");l.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),l.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),l.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),l.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),$2e={extension:b2e,composition:y2e,aggregation:v2e,dependency:C2e,lollipop:x2e,point:S2e,circle:w2e,cross:T2e,barb:k2e,barbNeo:E2e,only_one:A2e,zero_or_one:L2e,one_or_more:B2e,zero_or_more:M2e,only_one_neo:R2e,zero_or_one_neo:D2e,one_or_more_neo:N2e,zero_or_more_neo:O2e,requirement_arrow:I2e,requirement_contains:P2e,requirement_arrow_neo:F2e,requirement_contains_neo:H2e},j2e=_2e,z2e={common:xf,getConfig:cr,insertCluster:H1e,insertEdge:m2e,insertEdgeLabel:u2e,insertMarkers:j2e,insertNode:UN,interpolateToCurve:HC,labelHelper:Ht,log:Pe,positionEdgeLabel:h2e},af={},GN=q(e=>{for(const t of e)af[t.name]=t},"registerLayoutLoaders"),U2e=q(()=>{GN([{name:"dagre",loader:q(async()=>await ci(()=>import("./dagre-BM42HDAG-BWEVHaKu.js"),__vite__mapDeps([0,1,2])),"loader")},{name:"cose-bilkent",loader:q(async()=>await ci(()=>import("./cose-bilkent-S5V4N54A-C8bjgUgd.js"),__vite__mapDeps([3,4])),"loader")}])},"registerDefaultLayoutLoaders");U2e();var vEe=q(async(e,t)=>{if(!(e.layoutAlgorithm in af))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const f of e.nodes){const d=f.domId||f.id;f.domId=`${e.diagramId}-${d}`}const i=af[e.layoutAlgorithm],r=await i.loader(),{theme:n,themeVariables:o}=e.config,{useGradient:l,gradientStart:s,gradientStop:c}=o,u=t.attr("id");if(t.append("defs").append("filter").attr("id",`${u}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${u}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${n!=null&&n.includes("dark")?"#FFFFFF":"#000000"}`),l){const f=t.append("linearGradient").attr("id",t.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");f.append("svg:stop").attr("offset","0%").attr("stop-color",s).attr("stop-opacity",1),f.append("svg:stop").attr("offset","100%").attr("stop-color",c).attr("stop-opacity",1)}return r.render(e,t,z2e,{algorithm:i.algorithm})},"render"),CEe=q((e="",{fallback:t="dagre"}={})=>{if(e in af)return e;if(t in af)return Pe.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),ax="comm",VN="rule",XN="decl",q2e="@media",W2e="@import",Y2e="@supports",G2e="@namespace",uv="@keyframes",KN="@layer",V2e="@scope",QN=Math.abs,ox=String.fromCharCode;function ZN(e){return e.trim()}function rg(e,t,i){return e.replace(t,i)}function X2e(e,t,i){return e.indexOf(t,i)}function ru(e,t){return e.charCodeAt(t)|0}function Lu(e,t,i){return e.slice(t,i)}function na(e){return e.length}function JN(e){return e.length}function Sp(e,t){return t.push(e),e}var Vm=1,Bu=1,eO=0,Es=0,Nr=0,zu="";function lx(e,t,i,r,n,o,l,s){return{value:e,root:t,parent:i,type:r,props:n,children:o,line:Vm,column:Bu,length:l,return:"",siblings:s}}function K2e(){return Nr}function Q2e(){return Nr=Es>0?ru(zu,--Es):0,Bu--,Nr===10&&(Bu=1,Vm--),Nr}function js(){return Nr=Es<eO?ru(zu,Es++):0,Bu++,Nr===10&&(Bu=1,Vm++),Nr}function Io(){return ru(zu,Es)}function ng(){return Es}function Xm(e,t){return Lu(zu,e,t)}function of(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Z2e(e){return Vm=Bu=1,eO=na(zu=e),Es=0,[]}function J2e(e){return zu="",e}function Tb(e){return ZN(Xm(Es-1,hv(e===91?e+2:e===40?e+1:e)))}function e_e(e){for(;(Nr=Io())&&Nr<33;)js();return of(e)>2||of(Nr)>3?"":" "}function t_e(e,t){for(;--t&&js()&&!(Nr<48||Nr>102||Nr>57&&Nr<65||Nr>70&&Nr<97););return Xm(e,ng()+(t<6&&Io()==32&&js()==32))}function hv(e){for(;js();)switch(Nr){case e:return Es;case 34:case 39:e!==34&&e!==39&&hv(Nr);break;case 40:e===41&&hv(e);break;case 92:js();break}return Es}function i_e(e,t){for(;js()&&e+Nr!==57;)if(e+Nr===84&&Io()===47)break;return"/*"+Xm(t,Es-1)+"*"+ox(e===47?e:js())}function r_e(e){for(;!of(Io());)js();return Xm(e,Es)}function n_e(e){return J2e(sg("",null,null,null,[""],e=Z2e(e),0,[0],e))}function sg(e,t,i,r,n,o,l,s,c){for(var u=0,f=0,d=l,g=0,p=0,x=0,y=1,_=1,b=1,v=0,C="",k=n,E=o,T=r,A=C;_;)switch(x=v,v=js()){case 40:if(x!=108&&ru(A,d-1)==58){X2e(A+=rg(Tb(v),"&","&\f"),"&\f",QN(u?s[u-1]:0))!=-1&&(b=-1);break}case 34:case 39:case 91:A+=Tb(v);break;case 9:case 10:case 13:case 32:A+=e_e(x);break;case 92:A+=t_e(ng()-1,7);continue;case 47:switch(Io()){case 42:case 47:Sp(s_e(i_e(js(),ng()),t,i,c),c),(of(x||1)==5||of(Io()||1)==5)&&na(A)&&Lu(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*y:s[u++]=na(A)*b;case 125*y:case 59:case 0:switch(v){case 0:case 125:_=0;case 59+f:b==-1&&(A=rg(A,/\f/g,"")),p>0&&(na(A)-d||y===0&&x===47)&&Sp(p>32?V5(A+";",r,i,d-1,c):V5(rg(A," ","")+";",r,i,d-2,c),c);break;case 59:A+=";";default:if(Sp(T=G5(A,t,i,u,f,n,s,C,k=[],E=[],d,o),o),v===123)if(f===0)sg(A,t,T,T,k,o,d,s,E);else{switch(g){case 99:if(ru(A,3)===110)break;case 108:if(ru(A,2)===97)break;default:f=0;case 100:case 109:case 115:}f?sg(e,T,T,r&&Sp(G5(e,T,T,0,0,n,s,C,n,k=[],d,E),E),n,E,d,s,r?k:E):sg(A,T,T,T,[""],E,0,s,E)}}u=f=p=0,y=b=1,C=A="",d=l;break;case 58:d=1+na(A),p=x;default:if(y<1){if(v==123)--y;else if(v==125&&y++==0&&Q2e()==125)continue}switch(A+=ox(v),v*y){case 38:b=f>0?1:(A+="\f",-1);break;case 44:s[u++]=(na(A)-1)*b,b=1;break;case 64:Io()===45&&(A+=Tb(js())),g=Io(),f=d=na(C=A+=r_e(ng())),v++;break;case 45:x===45&&na(A)==2&&(y=0)}}return o}function G5(e,t,i,r,n,o,l,s,c,u,f,d){for(var g=n-1,p=n===0?o:[""],x=JN(p),y=0,_=0,b=0;y<r;++y)for(var v=0,C=Lu(e,g+1,g=QN(_=l[y])),k=e;v<x;++v)(k=ZN(_>0?p[v]+" "+C:rg(C,/&\f/g,p[v])))&&(c[b++]=k);return lx(e,t,i,n===0?VN:s,c,u,f,d)}function s_e(e,t,i,r){return lx(e,t,i,ax,ox(K2e()),Lu(e,2,-2),0,r)}function V5(e,t,i,r,n){return lx(e,t,i,XN,Lu(e,0,r),Lu(e,r+1,-1),r,n)}function dv(e,t){for(var i="",r=0;r<e.length;r++)i+=t(e[r],r,e,t)||"";return i}function a_e(e,t,i,r){switch(e.type){case KN:if(e.children.length)break;case W2e:case G2e:case XN:return e.return=e.return||e.value;case ax:return"";case uv:return e.return=e.value+"{"+dv(e.children,r)+"}";case VN:if(!na(e.value=e.props.join(",")))return""}return na(i=dv(e.children,r))?e.return=e.value+"{"+i+"}":""}function o_e(e){var t=JN(e);return function(i,r,n,o){for(var l="",s=0;s<t;s++)l+=e[s](i,r,n,o)||"";return l}}var tO="c4",l_e=q(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),c_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./c4Diagram-AAUBKEIU-DTO8eUNN.js");return{diagram:t}},__vite__mapDeps([5,6]));return{id:tO,diagram:e}},"loader"),u_e={id:tO,detector:l_e,loader:c_e},h_e=u_e,iO="flowchart",d_e=q((e,t)=>{var i,r;return((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),f_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-DrIR5cLt.js");return{diagram:t}},__vite__mapDeps([7,8,6,9,10,11]));return{id:iO,diagram:e}},"loader"),p_e={id:iO,detector:d_e,loader:f_e},g_e=p_e,rO="flowchart-v2",m_e=q((e,t)=>{var i,r,n;return((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((r=t==null?void 0:t.flowchart)==null?void 0:r.defaultRenderer)==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&((n=t==null?void 0:t.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),__e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-DrIR5cLt.js");return{diagram:t}},__vite__mapDeps([7,8,6,9,10,11]));return{id:rO,diagram:e}},"loader"),b_e={id:rO,detector:m_e,loader:__e},y_e=b_e,nO="er",v_e=q(e=>/^\s*erDiagram/.test(e),"detector"),C_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./erDiagram-TEJ5UH35-DKtjOPVB.js");return{diagram:t}},__vite__mapDeps([12,9,10,11]));return{id:nO,diagram:e}},"loader"),x_e={id:nO,detector:v_e,loader:C_e},S_e=x_e,sO="gitGraph",w_e=q(e=>/^\s*gitGraph/.test(e),"detector"),T_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./gitGraphDiagram-PVQCEYII-BHHhCAFG.js");return{diagram:t}},__vite__mapDeps([13,14,15,16]));return{id:sO,diagram:e}},"loader"),k_e={id:sO,detector:w_e,loader:T_e},E_e=k_e,aO="gantt",A_e=q(e=>/^\s*gantt/.test(e),"detector"),L_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./ganttDiagram-6RSMTGT7-BDD_ev0k.js");return{diagram:t}},__vite__mapDeps([17,18,19,20]));return{id:aO,diagram:e}},"loader"),B_e={id:aO,detector:A_e,loader:L_e},M_e=B_e,oO="info",R_e=q(e=>/^\s*info/.test(e),"detector"),D_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./infoDiagram-5YYISTIA-D8uXjMCP.js");return{diagram:t}},__vite__mapDeps([21,16]));return{id:oO,diagram:e}},"loader"),N_e={id:oO,detector:R_e,loader:D_e},lO="pie",O_e=q(e=>/^\s*pie/.test(e),"detector"),I_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./pieDiagram-4H26LBE5-B5s38S3w.js");return{diagram:t}},__vite__mapDeps([22,14,16,23,24,19]));return{id:lO,diagram:e}},"loader"),F_e={id:lO,detector:O_e,loader:I_e},cO="quadrantChart",P_e=q(e=>/^\s*quadrantChart/.test(e),"detector"),H_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./quadrantDiagram-W4KKPZXB-DsnYiUNW.js");return{diagram:t}},__vite__mapDeps([25,18,19,20]));return{id:cO,diagram:e}},"loader"),$_e={id:cO,detector:P_e,loader:H_e},j_e=$_e,uO="xychart",z_e=q(e=>/^\s*xychart(-beta)?/.test(e),"detector"),U_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./xychartDiagram-2RQKCTM6-B9kK3FNC.js");return{diagram:t}},__vite__mapDeps([26,19,24,18,20]));return{id:uO,diagram:e}},"loader"),q_e={id:uO,detector:z_e,loader:U_e},W_e=q_e,hO="requirement",Y_e=q(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),G_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./requirementDiagram-4Y6WPE33-B9_7IN-C.js");return{diagram:t}},__vite__mapDeps([27,9,10]));return{id:hO,diagram:e}},"loader"),V_e={id:hO,detector:Y_e,loader:G_e},X_e=V_e,dO="sequence",K_e=q(e=>/^\s*sequenceDiagram/.test(e),"detector"),Q_e=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./sequenceDiagram-3UESZ5HK-Dzr39nJO.js");return{diagram:t}},__vite__mapDeps([28,6,15]));return{id:dO,diagram:e}},"loader"),Z_e={id:dO,detector:K_e,loader:Q_e},J_e=Z_e,fO="class",ebe=q((e,t)=>{var i;return((i=t==null?void 0:t.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),tbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./classDiagram-4FO5ZUOK-GzwLVtQd.js");return{diagram:t}},__vite__mapDeps([29,30,8,6,9,10]));return{id:fO,diagram:e}},"loader"),ibe={id:fO,detector:ebe,loader:tbe},rbe=ibe,pO="classDiagram",nbe=q((e,t)=>{var i;return/^\s*classDiagram/.test(e)&&((i=t==null?void 0:t.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),sbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./classDiagram-v2-Q7XG4LA2-GzwLVtQd.js");return{diagram:t}},__vite__mapDeps([31,30,8,6,9,10]));return{id:pO,diagram:e}},"loader"),abe={id:pO,detector:nbe,loader:sbe},obe=abe,gO="state",lbe=q((e,t)=>{var i;return((i=t==null?void 0:t.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),cbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./stateDiagram-AJRCARHV-ChjfHPJA.js");return{diagram:t}},__vite__mapDeps([32,33,9,10,1,2]));return{id:gO,diagram:e}},"loader"),ube={id:gO,detector:lbe,loader:cbe},hbe=ube,mO="stateDiagram",dbe=q((e,t)=>{var i;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((i=t==null?void 0:t.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),fbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./stateDiagram-v2-BHNVJYJU-CYVpOWp1.js");return{diagram:t}},__vite__mapDeps([34,33,9,10]));return{id:mO,diagram:e}},"loader"),pbe={id:mO,detector:dbe,loader:fbe},gbe=pbe,_O="journey",mbe=q(e=>/^\s*journey/.test(e),"detector"),_be=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./journeyDiagram-JHISSGLW-BIjb_Axs.js");return{diagram:t}},__vite__mapDeps([35,8,6,23]));return{id:_O,diagram:e}},"loader"),bbe={id:_O,detector:mbe,loader:_be},ybe=bbe,vbe=q((e,t,i)=>{Pe.debug(`rendering svg for syntax error
|
|
444
|
+
`);const r=ipe(t),n=r.append("g");r.attr("viewBox","0 0 2412 512"),GB(r,100,512,!0),n.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),n.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),n.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),n.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),n.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),n.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),n.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),n.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),bO={draw:vbe},Cbe=bO,xbe={db:{},renderer:bO,parser:{parse:q(()=>{},"parse")}},Sbe=xbe,yO="flowchart-elk",wbe=q((e,t={})=>{var i;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((i=t==null?void 0:t.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(t.layout="elk",!0):!1},"detector"),Tbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./flowDiagram-I6XJVG4X-DrIR5cLt.js");return{diagram:t}},__vite__mapDeps([7,8,6,9,10,11]));return{id:yO,diagram:e}},"loader"),kbe={id:yO,detector:wbe,loader:Tbe},Ebe=kbe,vO="timeline",Abe=q(e=>/^\s*timeline/.test(e),"detector"),Lbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./timeline-definition-PNZ67QCA-Czlpe0TZ.js");return{diagram:t}},__vite__mapDeps([36,23]));return{id:vO,diagram:e}},"loader"),Bbe={id:vO,detector:Abe,loader:Lbe},Mbe=Bbe,CO="mindmap",Rbe=q(e=>/^\s*mindmap/.test(e),"detector"),Dbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./mindmap-definition-RKZ34NQL-DvNxgS6S.js");return{diagram:t}},__vite__mapDeps([37,9,10]));return{id:CO,diagram:e}},"loader"),Nbe={id:CO,detector:Rbe,loader:Dbe},Obe=Nbe,xO="kanban",Ibe=q(e=>/^\s*kanban/.test(e),"detector"),Fbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./kanban-definition-UN3LZRKU-D0t1sa_l.js");return{diagram:t}},__vite__mapDeps([38,8]));return{id:xO,diagram:e}},"loader"),Pbe={id:xO,detector:Ibe,loader:Fbe},Hbe=Pbe,SO="sankey",$be=q(e=>/^\s*sankey(-beta)?/.test(e),"detector"),jbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./sankeyDiagram-5OEKKPKP-BWNU5LMP.js");return{diagram:t}},__vite__mapDeps([39,24,19]));return{id:SO,diagram:e}},"loader"),zbe={id:SO,detector:$be,loader:jbe},Ube=zbe,wO="packet",qbe=q(e=>/^\s*packet(-beta)?/.test(e),"detector"),Wbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./diagram-LMA3HP47-D6RBTehI.js");return{diagram:t}},__vite__mapDeps([40,14,16]));return{id:wO,diagram:e}},"loader"),Ybe={id:wO,detector:qbe,loader:Wbe},TO="radar",Gbe=q(e=>/^\s*radar-beta/.test(e),"detector"),Vbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./diagram-2AECGRRQ-BaPB632f.js");return{diagram:t}},__vite__mapDeps([41,14,16]));return{id:TO,diagram:e}},"loader"),Xbe={id:TO,detector:Gbe,loader:Vbe},kO="block",Kbe=q(e=>/^\s*block(-beta)?/.test(e),"detector"),Qbe=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./blockDiagram-GPEHLZMM-DxfdErp5.js");return{diagram:t}},__vite__mapDeps([42,8,1,11]));return{id:kO,diagram:e}},"loader"),Zbe={id:kO,detector:Kbe,loader:Qbe},Jbe=Zbe,EO="treeView",eye=q(e=>/^\s*treeView-beta/.test(e),"detector"),tye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./diagram-5GNKFQAL-D2Kfb40N.js");return{diagram:t}},__vite__mapDeps([43,14,15,16]));return{id:EO,diagram:e}},"loader"),iye={id:EO,detector:eye,loader:tye},rye=iye,AO="architecture",nye=q(e=>/^\s*architecture/.test(e),"detector"),sye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./architectureDiagram-3BPJPVTR-CW-9YJ0Z.js");return{diagram:t}},__vite__mapDeps([44,14,16,4]));return{id:AO,diagram:e}},"loader"),aye={id:AO,detector:nye,loader:sye},oye=aye,LO="eventmodeling",lye=q(e=>/^\s*eventmodeling/.test(e),"detector"),cye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./diagram-KO2AKTUF-Cw8gEA7U.js");return{diagram:t}},__vite__mapDeps([45,14,16]));return{id:LO,diagram:e}},"loader"),uye={id:LO,detector:lye,loader:cye},hye=uye,BO="ishikawa",dye=q(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),fye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./ishikawaDiagram-YF4QCWOH-DNeoGEbk.js");return{diagram:t}},[]);return{id:BO,diagram:e}},"loader"),pye={id:BO,detector:dye,loader:fye},MO="venn",gye=q(e=>/^\s*venn-beta/.test(e),"detector"),mye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./vennDiagram-CIIHVFJN-NnelkDOt.js");return{diagram:t}},[]);return{id:MO,diagram:e}},"loader"),_ye={id:MO,detector:gye,loader:mye},bye=_ye,RO="treemap",yye=q(e=>/^\s*treemap/.test(e),"detector"),vye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./diagram-OG6HWLK6-B9MCU1E9.js");return{diagram:t}},__vite__mapDeps([46,10,14,16,20,24,19]));return{id:RO,diagram:e}},"loader"),Cye={id:RO,detector:yye,loader:vye},DO="wardley-beta",xye=q(e=>/^\s*wardley-beta/i.test(e),"detector"),Sye=q(async()=>{const{diagram:e}=await ci(async()=>{const{diagram:t}=await import("./wardleyDiagram-YWT4CUSO-B3Y6MpHa.js");return{diagram:t}},__vite__mapDeps([47,14,16]));return{id:DO,diagram:e}},"loader"),wye={id:DO,detector:xye,loader:Sye},Tye=wye,X5=!1,Km=q(()=>{X5||(X5=!0,Ag("error",Sbe,e=>e.toLowerCase().trim()==="error"),Ag("---",{db:{clear:q(()=>{},"clear")},styles:{},renderer:{draw:q(()=>{},"draw")},parser:{parse:q(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:q(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),by(Ebe,Obe,oye),by(h_e,Hbe,obe,rbe,S_e,M_e,N_e,F_e,X_e,J_e,y_e,g_e,Mbe,E_e,gbe,hbe,ybe,j_e,Ube,Ybe,W_e,Jbe,hye,rye,Xbe,pye,Cye,bye,Tye))},"addDiagrams"),kye=q(async()=>{Pe.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Nl).map(async([i,{detector:r,loader:n}])=>{if(n)try{Sy(i)}catch{try{const{diagram:o,id:l}=await n();Ag(l,o,r)}catch(o){throw Pe.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete Nl[i],o}}}))).filter(i=>i.status==="rejected");if(t.length>0){Pe.error(`Failed to load ${t.length} external diagrams`);for(const i of t)Pe.error(i);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),Eye="graphics-document document";function NO(e,t){e.attr("role",Eye),t!==""&&e.attr("aria-roledescription",t)}q(NO,"setA11yDiagramInfo");function OO(e,t,i,r){if(e.insert!==void 0){if(i){const n=`chart-desc-${r}`;e.attr("aria-describedby",n),e.insert("desc",":first-child").attr("id",n).text(i)}if(t){const n=`chart-title-${r}`;e.attr("aria-labelledby",n),e.insert("title",":first-child").attr("id",n).text(t)}}}q(OO,"addSVGa11yTitleDescription");var Ml,fv=(Ml=class{constructor(t,i,r,n,o){this.type=t,this.text=i,this.db=r,this.parser=n,this.renderer=o}static async fromText(t,i={}){var u,f;const r=cr(),n=cC(t,r);t=sme(t)+`
|
|
445
445
|
`;try{Sy(n)}catch{const d=xue(n);if(!d)throw new RB(`Diagram ${n} not found.`);const{id:g,diagram:p}=await d();Ag(g,p)}const{db:o,parser:l,renderer:s,init:c}=Sy(n);return l.parser&&(l.parser.yy=o),(u=o.clear)==null||u.call(o),c==null||c(r),i.title&&((f=o.setDiagramTitle)==null||f.call(o,i.title)),await l.parse(t),new Ml(n,t,o,l,s)}async render(t,i){await this.renderer.draw(this.text,t,i,this)}getParser(){return this.parser}getType(){return this.type}},q(Ml,"Diagram"),Ml),K5=[],Aye=q(()=>{K5.forEach(e=>{e()}),K5=[]},"attachFunctions"),Lye=q(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function IO(e){const t=e.match(MB);if(!t)return{text:e,metadata:{}};let i=cge(t[1],{schema:lge})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const r={};return i.displayMode&&(r.displayMode=i.displayMode.toString()),i.title&&(r.title=i.title.toString()),i.config&&(r.config=i.config),{text:e.slice(t[0].length),metadata:r}}q(IO,"extractFrontMatter");var Bye=q(e=>e.replace(/\r\n?/g,`
|
|
446
446
|
`).replace(/<(\w+)([^>]*)>/g,(t,i,r)=>"<"+i+r.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Mye=q(e=>{const{text:t,metadata:i}=IO(e),{displayMode:r,title:n,config:o={}}=i;return r&&(o.gantt||(o.gantt={}),o.gantt.displayMode=r),{title:n,config:o,text:t}},"processFrontmatter"),Rye=q(e=>{const t=Ps.detectInit(e)??{},i=Ps.detectDirective(e,"wrap");return Array.isArray(i)?t.wrap=i.some(({type:r})=>r==="wrap"):(i==null?void 0:i.type)==="wrap"&&(t.wrap=!0),{text:Yge(e),directive:t}},"processDirectives");function cx(e){const t=Bye(e),i=Mye(t),r=Rye(i.text),n=qC(i.config,r.directive);return e=Lye(r.text),{code:e,title:i.title,config:n}}q(cx,"preprocessDiagram");function FO(e){const t=new TextEncoder().encode(e),i=Array.from(t,r=>String.fromCodePoint(r)).join("");return btoa(i)}q(FO,"toBase64");var Dye=5e4,Nye="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Oye="sandbox",Iye="loose",Fye="http://www.w3.org/2000/svg",Pye="http://www.w3.org/1999/xlink",Hye="http://www.w3.org/1999/xhtml",$ye="100%",jye="100%",zye="border:0;margin:0;",Uye="margin:0",qye="allow-top-navigation-by-user-activation allow-popups",Wye='The "iframe" tag is not supported by your browser.',Yye=["foreignobject"],Gye=["dominant-baseline"];function ux(e){const t=cx(e);return kg(),Xue(t.config??{}),t}q(ux,"processAndSetConfigs");async function PO(e,t){Km();try{const{code:i,config:r}=ux(e);return{diagramType:(await $O(i)).type,config:r}}catch(i){if(t!=null&&t.suppressErrors)return!1;throw i}}q(PO,"parse");var Q5=q((e,t,i=[])=>{const r=FB(`{ ${i.join(" !important; ")} !important; }`);return`.${e} ${t} ${r}`},"cssImportantStyles"),Vye=q((e,t=new Map)=>{const i=new CSSStyleSheet;if(e.fontFamily!==void 0&&i.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,i.cssRules.length),e.altFontFamily!==void 0&&i.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,i.cssRules.length),t instanceof Map){const s=wn(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(c=>{h5(c.styles)||s.forEach(u=>{i.insertRule(Q5(c.id,u,c.styles),i.cssRules.length)}),h5(c.textStyles)||i.insertRule(Q5(c.id,"tspan",((c==null?void 0:c.textStyles)||[]).map(u=>u.replace("color","fill"))),i.cssRules.length)})}let r="";if(e.themeCSS!==void 0)if(typeof i.replaceSync=="function"){const n=new CSSStyleSheet;n.replaceSync(e.themeCSS),r=xy(n)+`
|
|
447
447
|
`}else r+=`${e.themeCSS}
|