toolroll 0.9.129 → 0.9.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/agent-fence.js +0 -2
  3. package/dist/agent-state.js +1 -1
  4. package/dist/agents-board.js +0 -3
  5. package/dist/assignment.js +4 -3
  6. package/dist/backup-ui.js +6 -3
  7. package/dist/bounded-spawn.js +0 -1
  8. package/dist/browser/manifest.json +57 -0
  9. package/dist/browser/terminal.4d1cf20c32ad7c2099df657358d540d5fd92bb55195a88121e74b28467238b42.css.br +0 -0
  10. package/dist/browser/terminal.4d1cf20c32ad7c2099df657358d540d5fd92bb55195a88121e74b28467238b42.css.gz +0 -0
  11. package/dist/browser/{terminal.js → terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js} +1 -1
  12. package/dist/browser/terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js.br +0 -0
  13. package/dist/browser/terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js.gz +0 -0
  14. package/dist/browser/{workspace.js → workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js} +25 -25
  15. package/dist/browser/workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js.br +0 -0
  16. package/dist/browser/workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js.gz +0 -0
  17. package/dist/browser/{workspace.css → workspace.a0752f935cfeaf16758d1085fe8f3e1719a7cd525b91a9c9943c789d65879a54.css} +1 -1
  18. package/dist/browser/workspace.a0752f935cfeaf16758d1085fe8f3e1719a7cd525b91a9c9943c789d65879a54.css.br +0 -0
  19. package/dist/browser/workspace.a0752f935cfeaf16758d1085fe8f3e1719a7cd525b91a9c9943c789d65879a54.css.gz +0 -0
  20. package/dist/browser-shell.js +271 -25
  21. package/dist/builder-restart.js +13 -4
  22. package/dist/builder.js +4 -1
  23. package/dist/canvas-freshness.js +122 -0
  24. package/dist/canvas-fs.js +273 -0
  25. package/dist/canvas-reads.js +747 -0
  26. package/dist/canvas-state-key.js +45 -0
  27. package/dist/canvas-state-worker.js +12 -0
  28. package/dist/central-recovery-stage.js +3 -3
  29. package/dist/chat-actions.js +26 -0
  30. package/dist/chat-channel.js +4 -3
  31. package/dist/chat-follow.js +4 -0
  32. package/dist/chat-task-actions.js +1 -1
  33. package/dist/chat-warmth.js +0 -1
  34. package/dist/check-report.js +0 -6
  35. package/dist/commit-extract.js +79 -40
  36. package/dist/companion/access.js +1 -0
  37. package/dist/companion/actions.js +79 -16
  38. package/dist/companion/canvas.js +141 -0
  39. package/dist/companion/chat-origin.js +92 -0
  40. package/dist/companion/chat.js +571 -0
  41. package/dist/companion/daemon.js +46 -5
  42. package/dist/companion/finish.js +51 -0
  43. package/dist/companion/reads.js +5 -1
  44. package/dist/companion/schema.js +64 -0
  45. package/dist/companion/service.js +1 -0
  46. package/dist/companion/store.js +1 -0
  47. package/dist/companion/webauthn.js +11 -2
  48. package/dist/console-instance.js +0 -4
  49. package/dist/contracts/console-api.js +1 -1
  50. package/dist/converse.js +0 -1
  51. package/dist/coordinator.js +1 -1
  52. package/dist/db-tuning.js +16 -0
  53. package/dist/desktop-config.js +156 -0
  54. package/dist/desktop-host.js +6 -152
  55. package/dist/desktop-update.js +1 -1
  56. package/dist/discord.js +9 -3
  57. package/dist/dispatch.js +32 -4
  58. package/dist/doctor.js +30 -0
  59. package/dist/evidence.js +49 -3
  60. package/dist/exec.js +3 -0
  61. package/dist/finished-task-sql.js +14 -0
  62. package/dist/flexible-answers.js +0 -1
  63. package/dist/git-views.js +7 -1
  64. package/dist/github-read.js +41 -0
  65. package/dist/guides.js +4 -3
  66. package/dist/invoke.js +12 -2
  67. package/dist/lead-doors.js +50 -3
  68. package/dist/lead-queue-runtime.js +18 -6
  69. package/dist/lead-queue.js +25 -0
  70. package/dist/lead-status.js +3 -3
  71. package/dist/live-backup-change.js +93 -0
  72. package/dist/live-backup.js +75 -31
  73. package/dist/live-bus.js +3 -2
  74. package/dist/live-records.js +0 -1
  75. package/dist/local-owner.js +0 -1
  76. package/dist/loop-recovery.js +40 -0
  77. package/dist/maintenance.js +29 -1
  78. package/dist/model-choices.js +0 -11
  79. package/dist/needs-you.js +2 -0
  80. package/dist/nightly-check.js +0 -3
  81. package/dist/nightly-github.js +1 -2
  82. package/dist/notification-retention.js +119 -0
  83. package/dist/observations.js +0 -1
  84. package/dist/operate.js +393 -56
  85. package/dist/planner.js +4 -1
  86. package/dist/pull-request-flow.js +56 -15
  87. package/dist/qr.js +0 -25
  88. package/dist/query-index-schema.js +10 -0
  89. package/dist/read-executor-worker.js +9 -7
  90. package/dist/read-executor.js +18 -1
  91. package/dist/read-worker-connection.js +7 -0
  92. package/dist/release-adapters.js +63 -48
  93. package/dist/release-auto.js +17 -13
  94. package/dist/release-card.js +0 -4
  95. package/dist/release-cli.js +58 -10
  96. package/dist/release-next.js +1 -1
  97. package/dist/release-stops.js +71 -0
  98. package/dist/release-supersede.js +125 -0
  99. package/dist/release-supervise.js +90 -0
  100. package/dist/release.js +265 -42
  101. package/dist/restore-retirement.js +4 -1
  102. package/dist/result-review.js +0 -3
  103. package/dist/retention-ui.js +1 -1
  104. package/dist/retention.js +14 -21
  105. package/dist/review-context.js +0 -5
  106. package/dist/route-rules.js +1 -5
  107. package/dist/runner.js +36 -1
  108. package/dist/sandbox-runtime.js +0 -1
  109. package/dist/scope.js +1 -13
  110. package/dist/scout.js +4 -7
  111. package/dist/serve.js +122 -12
  112. package/dist/server/kit.js +1 -0
  113. package/dist/server/live.js +9 -2
  114. package/dist/server/pages.js +3 -2
  115. package/dist/server/phone-engine-api.js +22 -2
  116. package/dist/server/render-pages.js +1 -11
  117. package/dist/server/render-results.js +0 -1
  118. package/dist/server/render-tasks.js +0 -68
  119. package/dist/server/route-table.js +1 -1
  120. package/dist/server/settings-phone.js +32 -9
  121. package/dist/server/settings-scripts.js +1 -1
  122. package/dist/server/settings-section-table.js +0 -3
  123. package/dist/server/settings-sections.js +4 -2
  124. package/dist/server/settings.js +20 -5
  125. package/dist/server/terminals.js +2 -1
  126. package/dist/shutdown-proof.js +29 -0
  127. package/dist/slack.js +9 -3
  128. package/dist/sqlite-telemetry.js +26 -14
  129. package/dist/statement-cache.js +137 -0
  130. package/dist/store.js +86 -14
  131. package/dist/structured-output.js +0 -1
  132. package/dist/style-asset.js +20 -7
  133. package/dist/tailnet.js +0 -3
  134. package/dist/task-control.js +5 -0
  135. package/dist/task-sizing.js +0 -1
  136. package/dist/task-status.js +1 -1
  137. package/dist/teams.js +9 -3
  138. package/dist/teardown-git.js +10 -1
  139. package/dist/telegram.js +4 -1
  140. package/dist/toolroll-update-cli.js +19 -3
  141. package/dist/toolroll-update-ui.js +2 -2
  142. package/dist/toolroll-update.js +95 -15
  143. package/dist/up-processes.js +16 -1
  144. package/dist/up-role-child.js +2 -0
  145. package/dist/wake-hub.js +15 -6
  146. package/dist/work-index.js +101 -44
  147. package/dist/work-reads.js +53 -9
  148. package/dist/work-snapshots.js +185 -0
  149. package/dist/worker-statement-cache.js +83 -0
  150. package/dist/workspace-revision.js +145 -21
  151. package/package.json +1 -1
  152. package/dist/companion/webauthn-test-support.js +0 -44
  153. package/dist/contracts/contract-test.js +0 -55
  154. package/dist/unfenced-test-support.js +0 -6
  155. /package/dist/browser/{terminal.css → terminal.4d1cf20c32ad7c2099df657358d540d5fd92bb55195a88121e74b28467238b42.css} +0 -0
@@ -151,7 +151,7 @@ out vec4 outColor;
151
151
 
152
152
  void main() {
153
153
  outColor = v_color;
154
- }`,Gs=8,vm=Gs*Float32Array.BYTES_PER_ELEMENT,GM=20*Gs,Sk=class{constructor(){this.attributes=new Float32Array(GM),this.count=0}},js=0,kk=0,xk=0,Ck=0,Ek=0,Tk=0,Ak=0,YM=class extends wi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new Sk,this._verticesCursor=new Sk;let r=this._gl;this._program=Je(fx(r,jM,VM)),this._register(Rt(()=>r.deleteProgram(this._program))),this._projectionLocation=Je(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Rt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Rt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Je(r.createBuffer()),this._register(Rt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,vm,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,vm,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,vm,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(c=>{this._updateCachedColors(c),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,dx),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,l,c,h,u,d,f,p;for(r=0;r<t.rows;r++){for(o=-1,a=0,l=0,c=!1,n=0;n<t.cols;n++)h=(r*t.cols+n)*bu,u=e.cells[h+pu],d=e.cells[h+gu],f=!!(d&67108864),(u!==a||d!==l&&(c||f))&&((a!==0||c&&l!==0)&&(p=s++*Gs,this._updateRectangle(i,p,l,a,o,n,r)),o=n,a=u,l=d,c=f);(a!==0||c&&l!==0)&&(p=s++*Gs,this._updateRectangle(i,p,l,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){t.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*Gs,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:js=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:js=(i&16777215)<<8;break;default:js=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:js=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:js=(s&16777215)<<8;break;default:js=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=zM(e.attributes,this._terminal.rows*this._terminal.cols*Gs)),kk=r*this._dimensions.device.cell.width,xk=o*this._dimensions.device.cell.height,Ck=(js>>24&255)/255,Ek=(js>>16&255)/255,Tk=(js>>8&255)/255,Ak=1,this._addRectangle(e.attributes,t,kk,xk,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Ck,Ek,Tk,Ak)}_addRectangle(e,t,i,s,r,n,o,a,l,c){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=l,e[t+7]=c}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},XM=class extends wi{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(l=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(Rt(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Je(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=hx(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Qk,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},ZM=class extends XM{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(s.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&NM(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ji=typeof window=="object"?window:globalThis,Bm=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ce,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ce,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Bm.INSTANCE=new Bm;var px=Bm;function QM(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var GD=px.INSTANCE.onDidChangeZoomLevel,YD=px.INSTANCE.onDidChangeFullscreen,Vo=typeof navigator=="object"?navigator.userAgent:"",XD=Vo.indexOf("Firefox")>=0,ym=Vo.indexOf("AppleWebKit")>=0,JM=Vo.indexOf("Chrome")>=0,eR=!JM&&Vo.indexOf("Safari")>=0,ZD=Vo.indexOf("Electron/")>=0,QD=Vo.indexOf("Android")>=0,mu=!1;if(typeof ji.matchMedia=="function"){let e=ji.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ji.matchMedia("(display-mode: fullscreen)");mu=e.matches,QM(ji,e,({matches:i})=>{mu&&t.matches||(mu=i)})}function tR(){return mu}var Ko="en",Om=!1,zm=!1,_u=!1,iR=!1,gx=!1,mx=!1,sR=!1,rR=!1,nR=!1,oR=!1,hu,vu=Ko,Mk=Ko,aR,Vs,Zs=globalThis,bi;typeof Zs.vscode<"u"&&typeof Zs.vscode.process<"u"?bi=Zs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(bi=process);var _x=typeof bi?.versions?.electron=="string",lR=_x&&bi?.type==="renderer";if(typeof bi=="object"){Om=bi.platform==="win32",zm=bi.platform==="darwin",_u=bi.platform==="linux",iR=_u&&!!bi.env.SNAP&&!!bi.env.SNAP_REVISION,sR=_x,nR=!!bi.env.CI||!!bi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,hu=Ko,vu=Ko;let e=bi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);hu=t.userLocale,Mk=t.osLocale,vu=t.resolvedLanguage||Ko,aR=t.languagePack?.translationsConfigFile}catch{}gx=!0}else typeof navigator=="object"&&!lR?(Vs=navigator.userAgent,Om=Vs.indexOf("Windows")>=0,zm=Vs.indexOf("Macintosh")>=0,rR=(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_u=Vs.indexOf("Linux")>=0,oR=Vs?.indexOf("Mobi")>=0,mx=!0,vu=globalThis._VSCODE_NLS_LANGUAGE||Ko,hu=navigator.language.toLowerCase(),Mk=hu):console.error("Unable to resolve platform.");var bm=0;zm?bm=1:Om?bm=3:_u&&(bm=2);var wm=gx,cR=mx&&typeof Zs.importScripts=="function",JD=cR?Zs.origin:void 0,_s=Vs,Ir=vu,hR;(e=>{function t(){return Ir}e.value=t;function i(){return Ir.length===2?Ir==="en":Ir.length>=3?Ir[0]==="e"&&Ir[1]==="n"&&Ir[2]==="-":!1}e.isDefaultVariant=i;function s(){return Ir==="en"}e.isDefault=s})(hR||={});var uR=typeof Zs.postMessage=="function"&&!Zs.importScripts,dR=(()=>{if(uR){let e=[];Zs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Zs.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),fR=!!(_s&&_s.indexOf("Chrome")>=0),eN=!!(_s&&_s.indexOf("Firefox")>=0),tN=!!(!fR&&_s&&_s.indexOf("Safari")>=0),iN=!!(_s&&_s.indexOf("Edg/")>=0),sN=!!(_s&&_s.indexOf("Android")>=0),Fr=typeof navigator=="object"?navigator:{},rN={clipboard:{writeText:wm||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Fr&&Fr.clipboard&&Fr.clipboard.writeText),readText:wm||!!(Fr&&Fr.clipboard&&Fr.clipboard.readText)},keyboard:wm||tR()?0:Fr.keyboard||eR?1:2,touch:"ontouchstart"in ji||Fr.maxTouchPoints>0,pointerEvents:ji.PointerEvent&&("ontouchstart"in ji||navigator.maxTouchPoints>0)},Im=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Sm=new Im,Rk=new Im,Lk=new Im,nN=new Array(230),pR;(e=>{function t(a){return Sm.keyCodeToStr(a)}e.toString=t;function i(a){return Sm.strToKeyCode(a)}e.fromString=i;function s(a){return Rk.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Lk.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return Rk.strToKeyCode(a)||Lk.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Sm.keyCodeToStr(a)}e.toElectronAccelerator=o})(pR||={});var vx=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),gR;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof mR?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ys.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vx})})(gR||={});var mR=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?vx:(this._emitter||(this._emitter=new Ce),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var _R,km;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?km=(e,t)=>{dR(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:km=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},_R=e=>km(globalThis,e)})();var vR;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(vR||={});var Dk=class Hi{static fromArray(t){return new Hi(i=>{i.emitMany(t)})}static fromPromise(t){return new Hi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Hi(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Hi(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Ce,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ys.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Hi(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Hi.map(this,t)}static filter(t,i){return new Hi(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Hi.filter(this,t)}static coalesce(t){return Hi.filter(t,i=>!!i)}coalesce(){return Hi.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Hi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Dk.EMPTY=Dk.fromArray([]);function yR(e){return 55296<=e&&e<=56319}function Nk(e){return 56320<=e&&e<=57343}function bR(e,t){return(e-55296<<10)+(t-56320)+65536}function wR(e){return Fm(e,0)}function Fm(e,t){switch(typeof e){case"object":return e===null?Xs(349,t):Array.isArray(e)?kR(e,t):xR(e,t);case"string":return yx(e,t);case"boolean":return SR(e,t);case"number":return Xs(e,t);case"undefined":return Xs(937,t);default:return Xs(617,t)}}function Xs(e,t){return(t<<5)-t+e|0}function SR(e,t){return Xs(e?433:863,t)}function yx(e,t){t=Xs(149417,t);for(let i=0,s=e.length;i<s;i++)t=Xs(e.charCodeAt(i),t);return t}function kR(e,t){return t=Xs(104579,t),e.reduce((i,s)=>Fm(s,i),t)}function xR(e,t){return t=Xs(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=yx(s,i),Fm(e[s],i)),t)}function xm(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function Bk(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function CR(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Tl(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):CR((e>>>0).toString(16),t/4)}var ER=class bx{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(yR(o))if(a+1<i){let c=t.charCodeAt(a+1);Nk(c)?(a++,l=bR(o,c)):l=65533}else{n=o;break}else Nk(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Tl(this._h0)+Tl(this._h1)+Tl(this._h2)+Tl(this._h3)+Tl(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Bk(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Bk(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=bx._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,xm(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=xm(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=xm(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};ER._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:oN,getWindow:TR,getDocument:aN,getWindows:lN,getWindowsCount:cN,getWindowId:Ok,getWindowById:hN,hasWindow:uN,onDidRegisterWindow:dN,onWillUnregisterWindow:fN,onDidUnregisterWindow:pN}=(function(){let e=new Map,t={window:ji,disposables:new Wo};e.set(ji.vscodeWindowId,t);let i=new Ce,s=new Ce,r=new Ce;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return wi.None;let a=new Wo,l={window:o,disposables:a.add(new Wo)};return e.set(o.vscodeWindowId,l),a.add(Rt(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(Hm(o,RR.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:ji},getDocument(o){return TR(o).document}}})(),AR=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Hm(e,t,i,s){return new AR(e,t,i,s)}var MR,zk,Cm=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){uu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(Cm.sort),o.shift().execute();s.set(n,!1)};zk=(n,o,a=0)=>{let l=Ok(n),c=new Cm(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},MR=(n,o,a)=>{let l=Ok(n);if(s.get(l)){let c=new Cm(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return zk(n,o,a)}})();var Hk=class yu{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new yu(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof yu?t:new yu(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};Hk.None=new Hk(0,0);var gN=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=wR(i),n=s.get(r);if(n)n.users+=1;else{let o=new Ce,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(Rt(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},RR={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ym?"webkitAnimationStart":"animationstart",ANIMATION_END:ym?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ym?"webkitAnimationIteration":"animationiteration"},LR=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function wx(e,t,i,...s){let r=LR.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function DR(e,t,...i){return wx("http://www.w3.org/1999/xhtml",e,t,...i)}DR.SVG=function(e,t,...i){return wx("http://www.w3.org/2000/svg",e,t,...i)};var NR=class extends wi{constructor(e,t,i,s,r,n,o,a,l){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new kl,this._charAtlasDisposable=this._register(new kl),this._observerDisposable=this._register(new kl),this._model=new WM,this._workCell=new bk,this._workCell2=new bk,this._rectangleRenderer=this._register(new kl),this._glyphRenderer=this._register(new kl),this._onChangeTextureAtlas=this._register(new Ce),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ce),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ce),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Ce),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Ce),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let c={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",c),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new oM(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new ZM(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=rM(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Hm(this._canvas,"webglcontextlost",h=>{console.log("webglcontextlost event received"),h.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(h)},3e3)})),this._register(Hm(this._canvas,"webglcontextrestored",h=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,vk(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=yk(this._canvas,this._coreBrowserService.window,(h,u)=>this._setCanvasDevicePixelDimensions(h,u)),this._register(this._coreBrowserService.onWindowChange(h=>{this._observerDisposable.value=yk(this._canvas,h,(u,d)=>this._setCanvasDevicePixelDimensions(u,d))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Rt(()=>{for(let h of this._renderLayers)h.dispose();this._canvas.parentElement?.removeChild(this._canvas),vk(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new YM(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new IM(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=hx(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=Vk(Ys.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Ys.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new BM(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,l,c,h=0,u=!0,d,f,p,b,T,v,m,y,g;e=Uk(e,i.rows-1,0),t=Uk(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",A=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,D=A-i.buffer.ydisp,O=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),j=-1,$=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,p=A===o,h=0,l=this._characterJoinerService.getJoinedCharacters(o),y=0;y<i.cols;y++){if(r=this._cellColorResolver.result.bg,a.loadCell(y,s),y===0&&(r=this._cellColorResolver.result.bg),c=!1,u=y>=h,d=y,l.length>0&&y===l[0][0]&&u){f=l.shift();let W=this._model.selection.isCellSelected(this._terminal,f[0],o);for(m=f[0]+1;m<f[1];m++)u&&=W===this._model.selection.isCellSelected(this._terminal,m,o);u&&=!p||O<f[0]||O>=f[1],u?(c=!0,s=new BR(s,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),d=f[1]-1):h=f[1]}if(b=s.getChars(),T=s.getCode(),m=(n*i.cols+y)*bu,this._cellColorResolver.resolve(s,y,o,this.dimensions.device.cell.width),$&&o===A&&(y===O&&(this._model.cursor={x:O,y:D,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},j=O+s.getWidth()-1),y>=O&&y<=j&&(this._coreBrowserService.isFocused&&C==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),T!==0&&(this._model.lineLengths[n]=y+1),!(this._model.cells[m]===T&&this._model.cells[m+pu]===this._cellColorResolver.result.bg&&this._model.cells[m+gu]===this._cellColorResolver.result.fg&&this._model.cells[m+_m]===this._cellColorResolver.result.ext)&&(P=!0,b.length>1&&(T|=KM),this._model.cells[m]=T,this._model.cells[m+pu]=this._cellColorResolver.result.bg,this._model.cells[m+gu]=this._cellColorResolver.result.fg,this._model.cells[m+_m]=this._cellColorResolver.result.ext,v=s.getWidth(),this._glyphRenderer.value.updateCell(y,n,T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,v,r),c)){for(s=this._workCell,y++;y<=d;y++)g=(n*i.cols+y)*bu,this._glyphRenderer.value.updateCell(y,n,0,0,0,0,ZA,0,0),this._model.cells[g]=0,this._model.cells[g+pu]=this._cellColorResolver.result.bg,this._model.cells[g+gu]=this._cellColorResolver.result.fg,this._model.cells[g+_m]=this._cellColorResolver.result.ext;y--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},BR=class extends $o{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Uk(e,t,i=0){return Math.max(Math.min(e,t),i)}var Pk="di$target",qk="di$dependencies",Em=new Map;function vs(e){if(Em.has(e))return Em.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");OR(t,i,r)};return t._id=e,Em.set(e,t),t}function OR(e,t,i){t[Pk]===t?t[qk].push({id:e,index:i}):(t[qk]=[{id:e,index:i}],t[Pk]=t)}var mN=vs("BufferService"),_N=vs("CoreMouseService"),vN=vs("CoreService"),yN=vs("CharsetService"),bN=vs("InstantiationService"),wN=vs("LogService"),zR=vs("OptionsService"),SN=vs("OscLinkService"),kN=vs("UnicodeService"),xN=vs("DecorationService"),HR={trace:0,debug:1,info:2,warn:3,error:4,off:5},UR="xterm.js: ",Ik=class extends wi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),Sx=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=HR[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":UR)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Ik=LA([DA(0,zR)],Ik);var Sx;function PR(e){Sx=e}var kx=class extends wi{constructor(e){if(Xk&&XA()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Ce),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ce),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ce),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Ce),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=t.coreService,s=t.optionsService,r=t,n=r._renderService,o=r._characterJoinerService,a=r._charSizeService,l=r._coreBrowserService,c=r._decorationService,h=r._logService,u=r._themeService;PR(h),this._renderer=this._register(new NR(e,o,a,l,i,c,s,u,this._preserveDrawingBuffer)),this._register(Ys.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Ys.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Ys.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Ys.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(Rt(()=>{if(this._terminal._core._store._isDisposed)return;let d=this._terminal._core._renderService;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};var Ex=Symbol("html"),Dl=class{#e;constructor(t,i){if(t!==Ex)throw new TypeError("Html is made by html`…`");this.#e=i}static markupOf(t){return t.#e}toString(){if(xx)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(xx)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},xx=typeof process<"u"&&process.env.VITEST!==void 0,qR=e=>new Dl(Ex,e);var IR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FR=e=>e.replace(/[&<>"']/g,t=>IR[t]);function Tx(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Dl)return Dl.markupOf(e);if(Array.isArray(e))return e.map(Tx).join("");if(typeof e=="string")return FR(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var Cx=new WeakSet,$R=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,KR=/\bname\s*=\s*["']?csrf\b/i;function WR(e){if(Cx.has(e))return;let t=e.join("\0");if($R.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(KR.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");Cx.add(e)}function Go(e,...t){WR(e);let i=e[0];for(let s=0;s<t.length;s++)i+=Tx(t[s])+e[s+1];return qR(i)}var K=(e,t,i)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:i}),Ax=[K("scope","scopes?|scoped","plan"),K("contract","contracts?","plan"),K("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),K("sealed","seal|seals|sealed|sealing","approved"),K("binds","binds?","approved"),K("digest","digests?","(the plan version, in Details)"),K("worker","workers?","builder"),K("runner","runners?","builder"),K("daemon","daemons?","builder"),K("background service","background service","builder"),K("operator","operators?|instance operator","approver, or owner"),K("coordinator","coordinators?","your lead"),K("mate","mate","your lead"),K("scout","scouts?|scouting|scouted","research"),K("criterion","criterion|criteria","requirement"),K("evidence","evidence","requirement, or the saved files"),K("proof","proofs?","requirement"),K("verdict","verdicts?","requirement"),K("caveat","caveats?","requirement"),K("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),K("Accept and finish","accept\\s+and\\s+finish","Accept"),K("Revise","revise","Send back, or Request changes"),K("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),K("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),K("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),K("tidy","tidy|tidied|tidying","Archive"),K("run #N","(?:run|result)\\s+#?\\d+|attempt\\s+#?\\d+(?!\\s+\\(build\\s+#\\d+\\))","build #N, or attempt N (build #M)"),K("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),K("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),K("claim","claim|claimed","Waiting: Toolroll is …"),K("lease","leases?|leased","Waiting: Toolroll is …"),K("custody","custody","Waiting: Toolroll is …"),K("incident","incidents?","Waiting: Toolroll is …"),K("plane","plane","Toolroll"),K("fence","fences?|fenced","Waiting: Toolroll is …"),K("attested","attest|attested|attestation","Waiting: Toolroll is …"),K("receipt","receipts?","Waiting: Toolroll is …"),K("regate","regate[ds]?","Run checks"),K("carried","carried|carry|carries","Waiting: Toolroll is …"),K("incarnation","incarnations?","Waiting: Toolroll is …"),K("admission","admission","Waiting: Toolroll is …"),K("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),K("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),K("unproven","unproven","Waiting: Toolroll is …"),K("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],jR=Ax.map(e=>e.never);var bB=[K("lead","lead","Toolroll, or Chat"),K("crew","crew","Toolroll"),K("scope","scopes?|scoped","plan"),K("mode","modes?","(Settings)"),K("flow","flows?","(Settings)"),K("fleet","fleet","(Settings)"),K("fallback","fallbacks?","(Settings)"),K("routing","routing|routed","(Settings)"),K("spend","spend|spends|spending|spent","cost"),K("MCP","mcp","(Settings)"),K("password","passwords?|passwordless","(only where one is asked for)"),K("token","tokens?","(Settings)"),K("builder","builders?","taking work")];var Mx={queued:{stage:"queued"},ready:{stage:"queued"},"provider-quota":{stage:"queued"},running:{stage:"building"},reviewing:{stage:"reviewing"},"review-pending":{stage:"building"},"checks-running":{stage:"checking"},"ready-to-check":{stage:"finished",act:"open-result"},"ready-to-review":{stage:"finished"},"report-ready":{stage:"finished"},"no-change":{stage:"finished"},"pr-opened":{stage:"finished"},"merge-observed":{stage:"finished"},"pr-closed":{stage:"finished"},"agent-attested":{stage:"finished"},"accepted-exception":{stage:"finished"},complete:{stage:"complete",act:"open-result"},cancelled:{stage:"stopped",act:"inspect-task"},paused:{stage:"stopped"},stopped:{stage:"stopped",act:"resume-run"},failed:{stage:"failed",act:"retry-task"},"checks-failed":{stage:"failed"},"waiting-incident":{stage:"failed",act:"retry-task"},"plan-stopped":{stage:"needs-you",need:"plan-again",act:"inspect-task"},"planning-stopped":{stage:"needs-you",need:"planning-stopped",act:"inspect-task"},stopping:{stage:"waiting",wait:"build-stopping"},"build-stopping":{stage:"waiting",wait:"build-stopping"},"other-computer":{stage:"waiting",wait:"other-computer"},"planning-ready":{stage:"waiting",wait:"plan-next"},"scouting-ready":{stage:"waiting",wait:"research-next"},"worker-at-capacity":{stage:"waiting",wait:"builders-busy"},"retry-scheduled":{stage:"waiting",wait:"retry-later"},"plan-retry":{stage:"waiting",wait:"plan-retry-later"},updating:{stage:"waiting",wait:"app-update"},"waiting-dependency":{stage:"waiting",wait:"other-task"},"history-problem":{stage:"needs-you",need:"history",act:"inspect-task"},"earlier-active":{stage:"needs-you",need:"earlier-version",act:"inspect-task"},"waiting-decision":{stage:"needs-you",need:"answer",act:"answer-decision"},"finding-held":{stage:"needs-you",need:"finding",act:"inspect-findings"},"decision-queue":{stage:"needs-you",need:"questions",act:"inspect-decisions"},"result-needs-attention":{stage:"needs-you",need:"other",act:"inspect-run"},"process-needs-attention":{stage:"needs-you",need:"stop-unproven",act:"inspect-run"},"vanished-run":{stage:"needs-you",need:"vanished",act:"reconcile-run"},held:{stage:"needs-you",need:"hold",act:"inspect-hold"},"storage-blocked":{stage:"needs-you",need:"storage",act:"unhold"},"terminal-dependency":{stage:"needs-you",need:"fix-dependency",act:"repair-dependency"},"needs-project":{stage:"needs-you",need:"choose-project",act:"place-task"},"needs-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"invalid-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"planner-source":{stage:"needs-you",need:"fix-request",act:"write-scope"},"needs-agent-profile":{stage:"needs-you",need:"choose-agent",act:"select-agent"},"needs-approval":{stage:"needs-you",need:"approval",act:"approve-scope"},"missing-requirement":{stage:"needs-you",need:"add-requirement",act:"repair-capability"},"no-worker-registered":{stage:"needs-you",need:"connect-builder",act:"start-worker"},"no-worker-online":{stage:"needs-you",need:"start-builder",act:"start-worker"},"signed-out":{stage:"needs-you",need:"sign-in",act:"sign-in"},"needs-verification":{stage:"needs-you",need:"review-result"},"proof-refuted":{stage:"needs-you",need:"review-result"},"no-build-record":{stage:"needs-you",need:"review-result"},"verification-needed":{stage:"needs-you",need:"review-result"},"evidence-mismatch":{stage:"needs-you",need:"review-result"},"record-incomplete":{stage:"needs-you",need:"review-result"},"evidence-damaged":{stage:"needs-you",need:"review-result"}};var xB=Object.fromEntries(Object.entries(Mx).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var GR="The check result couldn't be read.",zB=`${GR} Run checks on it, or open the result to see why.`;var HB={ok:Go`<path d="M20 6 9 17l-5-5"/>`,running:Go`<circle cx="12" cy="12" r="4"/>`,none:Go`<circle cx="12" cy="12" r="3"/>`,note:Go`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Go`<path d="M18 6 6 18M6 6l12 12"/>`};function $m(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function Rx(e,t){let i=$m(e,t);return i==="password"?"password":i==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function Nl(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}var z=e=>["path",{d:e}],Wr=(e,t,i)=>["circle",{cx:e,cy:t,r:i}],ku={home:[z("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),z("M9 22V12h6v10")],tasks:[z("m3 17 2 2 4-4"),z("m3 7 2 2 4-4"),z("M13 6h8"),z("M13 12h8"),z("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],z("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[z("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],z("M2 14h2"),z("M20 14h2"),z("M15 13v2"),z("M9 13v2")],projects:[z("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[z("M21 4h-7"),z("M10 4H3"),z("M21 12h-9"),z("M8 12H3"),z("M21 20h-5"),z("M12 20H3"),z("M14 2v4"),z("M8 10v4"),z("M16 18v4")],pen:[z("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[z("M5 12h14"),z("m12 5 7 7-7 7")],plus:[z("M12 5v14"),z("M5 12h14")],send:[z("M12 19V5"),z("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[z("M18 6 6 18"),z("m6 6 12 12")],back:[z("m15 18-6-6 6-6")],menu:[z("M4 6h16"),z("M4 12h16"),z("M4 18h16")],search:[Wr(11,11,7),z("m20 20-3.5-3.5")],chevron:[z("m6 9 6 6 6-6")],check:[z("M20 6 9 17l-5-5")],alert:[Wr(12,12,9),z("M12 8v4"),z("M12 16h.01")],more:[Wr(5,12,1),Wr(12,12,1),Wr(19,12,1)],file:[z("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),z("M14 3v5h5")],minus:[z("M5 12h14")],fit:[z("M15 3h6v6"),z("M9 21H3v-6"),z("M21 3l-7 7"),z("M3 21l7-7")],bolt:[z("M13 2 4 14h7l-1 8 9-12h-7z")],code:[z("m16 18 6-6-6-6"),z("m8 6-6 6 6 6")],sun:[Wr(12,12,4),z("M12 2v2"),z("M12 20v2"),z("m4.93 4.93 1.41 1.41"),z("m17.66 17.66 1.41 1.41"),z("M2 12h2"),z("M20 12h2"),z("m6.34 17.66-1.41 1.41"),z("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],z("M15 2v2"),z("M15 20v2"),z("M2 15h2"),z("M2 9h2"),z("M20 15h2"),z("M20 9h2"),z("M9 2v2"),z("M9 20v2")],bell:[z("M10.27 21a2 2 0 0 0 3.46 0"),z("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[z("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[z("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[z("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Wr(9,7,4),z("M22 21v-2a4 4 0 0 0-3-3.87"),z("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Wr(12,12,10),z("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),z("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],z("M8 21h8"),z("M12 17v4")],list:[z("M8 6h13"),z("M8 12h13"),z("M8 18h13"),z("M3 6h.01"),z("M3 12h.01"),z("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],z("M9 3v18"),z("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],z("M15 3v18")],server:[["rect",{x:2,y:2,width:20,height:8,rx:2}],["rect",{x:2,y:14,width:20,height:8,rx:2}],z("M6 6h.01"),z("M6 18h.01")]};var Bx=U(ri(),1);var Me=(...e)=>e.filter(Boolean).join(" ");var Ox=U(F(),1);function Ot({name:e,small:t=!1}){return(0,Ox.jsx)("svg",{className:Me("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ku[e].map((i,s)=>(0,Bx.createElement)(i[0],{key:s,...i[1]}))})}var Vt=U(F(),1);function ze({variant:e="outline",sm:t,iconOnly:i,lead:s,label:r,docked:n,busy:o,className:a,type:l="button",...c}){return(0,Vt.jsx)("button",{type:l,className:Me("k-btn",`k-btn-${e}`,t&&"k-btn-sm",i&&"k-btn-icon",n&&"k-docked",o&&"busy",a),"aria-label":i?r:void 0,title:i?r:void 0,"aria-busy":o?!0:void 0,...c,children:i?(0,Vt.jsx)(Ot,{name:i}):(0,Vt.jsx)("span",{className:"k-face",children:o?(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("span",{className:"k-spin","aria-hidden":"true"}),o]}):(0,Vt.jsxs)(Vt.Fragment,{children:[s&&(0,Vt.jsx)(Ot,{name:s,small:!0}),r]})})})}function Km({variant:e="outline",sm:t,label:i,lead:s,className:r,...n}){return(0,Vt.jsx)("a",{className:Me("k-btn",`k-btn-${e}`,t&&"k-btn-sm",r),...n,children:(0,Vt.jsxs)("span",{className:"k-face",children:[s&&(0,Vt.jsx)(Ot,{name:s,small:!0}),i]})})}var zx=U(F(),1);function Cu({word:e,tone:t="",dot:i=!0}){return(0,zx.jsx)("span",{className:Me("k-chip",t,!i&&"nodot"),children:e})}var ZR=U(F(),1);var Hx=U(F(),1);var Ux=U(F(),1);var Px=U(ri(),1);var Dn=U(F(),1);function qx({label:e,hint:t,error:i,children:s}){let r=(0,Px.useId)(),n=Me(t&&`${r}-hint`,`${r}-err`);return(0,Dn.jsxs)("div",{className:"k-field",children:[(0,Dn.jsx)("label",{className:"k-label",htmlFor:r,children:e}),s({id:r,describedBy:n,invalid:!!i}),t&&(0,Dn.jsx)("p",{className:"k-hint",id:`${r}-hint`,children:t}),(0,Dn.jsx)("span",{className:"k-err",id:`${r}-err`,role:"alert",children:i??""})]})}var Ix=({className:e,...t})=>(0,Dn.jsx)("input",{className:Me("k-input",e),...t});var Eu=U(F(),1);function Fx({items:e,sm:t,wide:i,className:s,...r}){return(0,Eu.jsx)("span",{className:Me("k-selw",t&&"sm",i&&"wide",s),children:(0,Eu.jsx)("select",{className:"k-sel",...r,children:e.map(n=>{let[o,a]=typeof n=="string"?[n,n]:n;return(0,Eu.jsx)("option",{value:o,children:a},o)})})})}var $x=U(F(),1);var Kx=U(F(),1);var Qs=U(F(),1);function Wx({name:e,legend:t,current:i,items:s,onChange:r}){return(0,Qs.jsxs)("fieldset",{className:"k-radios",children:[(0,Qs.jsx)("legend",{className:"k-sr",children:t}),s.map(n=>(0,Qs.jsxs)("label",{className:"k-opt",children:[(0,Qs.jsx)("input",{type:"radio",name:e,value:n.value,checked:n.value===i,onChange:()=>r(n.value)}),(0,Qs.jsxs)("span",{children:[(0,Qs.jsx)("b",{children:n.label}),n.text&&(0,Qs.jsx)("span",{children:n.text})]}),n.tag]},n.value))]})}var jx=U(F(),1),Yo=({children:e})=>(0,jx.jsx)("div",{className:"k-acts",children:e});var QR=U(ri(),1),Vx=U(F(),1);var Xo=U(F(),1),Wm=({children:e})=>(0,Xo.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,Xo.jsx)(Ot,{name:"alert",small:!0}),(0,Xo.jsx)("span",{children:e})]});var Bl=({children:e})=>(0,Xo.jsx)("p",{className:"k-note",children:e});var Ol=U(F(),1);function Tu({title:e,text:t,action:i}){return(0,Ol.jsxs)("div",{className:"k-empty",children:[(0,Ol.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,Ol.jsx)("p",{className:"k-empty-x",children:t}),i]})}var Gx=U(F(),1);var jm=U(F(),1);var Vm=U(F(),1);var Gm=U(F(),1);var Vr=U(ri(),1),_2=U(Qu(),1);var JR="toolroll.key",e8="x-toolroll-key",t8=/^[0-9a-f]{64}$/;function Yx(){try{let e=globalThis.localStorage?.getItem(JR)??null;if(e===null)return null;let t=JSON.parse(e),i=typeof t=="object"&&t!==null?t.key:null;return typeof i=="string"&&t8.test(i)?i:null}catch{return null}}function Au(e){let t=Yx();return t===null?e:{...e,[e8]:t}}function Xx(){let e=Yx();return e===null?["toolroll"]:["toolroll",`toolroll.key.${e}`]}var ys="form.k-sform",Hl=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",i8=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),Zx="http://www.w3.org/2000/svg",Js=e=>e.querySelector("[data-k-proof]"),bs=e=>e.querySelector("[data-k-save]"),i2=e=>new Set(Array.from(Js(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function Ru(e,t=null){let i=i2(e),s;try{s=t?new FormData(e,t):new FormData(e)}catch{s=new FormData(e)}let r=[];return s.forEach((n,o)=>{!i.has(o)&&typeof n=="string"&&r.push([o,n])}),r}function e_(e){let t=new Map;for(let[i,s]of e)t.set(i,[...t.get(i)??[],s]);return t}function s2(e){let t=i2(e),i=[];for(let s of Array.from(i8(e)))!s.name||s.type==="hidden"||s.type==="submit"||s.type==="button"||t.has(s.name)||i.includes(s.name)||i.push(s.name);return i}var Vi=e=>(e??"").replace(/\s+/g," ").trim();function r2(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function s8(e,t){let i=r2(e,t);if(i===null)return t;let s=i.getAttribute("aria-label");if(s)return Vi(s);if(i.type==="radio"||i.type==="checkbox"&&i.getAttribute("role")!=="switch"){let o=i.closest("fieldset")?.querySelector("legend");if(o)return Vi(o.textContent)}let r=i.closest(".k-frow")?.querySelector(".k-frow-t");if(r)return Vi(r.textContent);let n=i.labels?.[0];return n?Vi(n.querySelector(".k-sl-t, b")?.textContent??n.textContent):t}function r8(e,t,i){let s=r2(e,t);if(s instanceof HTMLSelectElement)return Vi(Array.from(s.options).find(o=>o.value===i[0])?.textContent??i[0]);if(s?.type==="radio"||s?.type==="checkbox"){let o=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(s.type==="checkbox"&&s.getAttribute("role")==="switch")return i.length>0?"On":"Off";let a=o.filter(l=>i.includes(l.value)).map(l=>Vi(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return a.length===0?"none":a.join(", ")}let r=i[0]??"";if(s?.type==="password")return r===""?"unchanged":"a new value";let n=r.split(`
154
+ }`,Gs=8,vm=Gs*Float32Array.BYTES_PER_ELEMENT,GM=20*Gs,Sk=class{constructor(){this.attributes=new Float32Array(GM),this.count=0}},js=0,kk=0,xk=0,Ck=0,Ek=0,Tk=0,Ak=0,YM=class extends wi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new Sk,this._verticesCursor=new Sk;let r=this._gl;this._program=Je(fx(r,jM,VM)),this._register(Rt(()=>r.deleteProgram(this._program))),this._projectionLocation=Je(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Rt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Rt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Je(r.createBuffer()),this._register(Rt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,vm,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,vm,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,vm,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(c=>{this._updateCachedColors(c),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,dx),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,l,c,h,u,d,f,p;for(r=0;r<t.rows;r++){for(o=-1,a=0,l=0,c=!1,n=0;n<t.cols;n++)h=(r*t.cols+n)*bu,u=e.cells[h+pu],d=e.cells[h+gu],f=!!(d&67108864),(u!==a||d!==l&&(c||f))&&((a!==0||c&&l!==0)&&(p=s++*Gs,this._updateRectangle(i,p,l,a,o,n,r)),o=n,a=u,l=d,c=f);(a!==0||c&&l!==0)&&(p=s++*Gs,this._updateRectangle(i,p,l,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){t.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*Gs,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:js=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:js=(i&16777215)<<8;break;default:js=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:js=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:js=(s&16777215)<<8;break;default:js=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=zM(e.attributes,this._terminal.rows*this._terminal.cols*Gs)),kk=r*this._dimensions.device.cell.width,xk=o*this._dimensions.device.cell.height,Ck=(js>>24&255)/255,Ek=(js>>16&255)/255,Tk=(js>>8&255)/255,Ak=1,this._addRectangle(e.attributes,t,kk,xk,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Ck,Ek,Tk,Ak)}_addRectangle(e,t,i,s,r,n,o,a,l,c){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=l,e[t+7]=c}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},XM=class extends wi{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(l=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(Rt(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Je(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=hx(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Qk,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},ZM=class extends XM{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(s.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&NM(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ji=typeof window=="object"?window:globalThis,Bm=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Ce,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Ce,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Bm.INSTANCE=new Bm;var px=Bm;function QM(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var GD=px.INSTANCE.onDidChangeZoomLevel,YD=px.INSTANCE.onDidChangeFullscreen,Vo=typeof navigator=="object"?navigator.userAgent:"",XD=Vo.indexOf("Firefox")>=0,ym=Vo.indexOf("AppleWebKit")>=0,JM=Vo.indexOf("Chrome")>=0,eR=!JM&&Vo.indexOf("Safari")>=0,ZD=Vo.indexOf("Electron/")>=0,QD=Vo.indexOf("Android")>=0,mu=!1;if(typeof ji.matchMedia=="function"){let e=ji.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ji.matchMedia("(display-mode: fullscreen)");mu=e.matches,QM(ji,e,({matches:i})=>{mu&&t.matches||(mu=i)})}function tR(){return mu}var Ko="en",Om=!1,zm=!1,_u=!1,iR=!1,gx=!1,mx=!1,sR=!1,rR=!1,nR=!1,oR=!1,hu,vu=Ko,Mk=Ko,aR,Vs,Zs=globalThis,bi;typeof Zs.vscode<"u"&&typeof Zs.vscode.process<"u"?bi=Zs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(bi=process);var _x=typeof bi?.versions?.electron=="string",lR=_x&&bi?.type==="renderer";if(typeof bi=="object"){Om=bi.platform==="win32",zm=bi.platform==="darwin",_u=bi.platform==="linux",iR=_u&&!!bi.env.SNAP&&!!bi.env.SNAP_REVISION,sR=_x,nR=!!bi.env.CI||!!bi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,hu=Ko,vu=Ko;let e=bi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);hu=t.userLocale,Mk=t.osLocale,vu=t.resolvedLanguage||Ko,aR=t.languagePack?.translationsConfigFile}catch{}gx=!0}else typeof navigator=="object"&&!lR?(Vs=navigator.userAgent,Om=Vs.indexOf("Windows")>=0,zm=Vs.indexOf("Macintosh")>=0,rR=(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_u=Vs.indexOf("Linux")>=0,oR=Vs?.indexOf("Mobi")>=0,mx=!0,vu=globalThis._VSCODE_NLS_LANGUAGE||Ko,hu=navigator.language.toLowerCase(),Mk=hu):console.error("Unable to resolve platform.");var bm=0;zm?bm=1:Om?bm=3:_u&&(bm=2);var wm=gx,cR=mx&&typeof Zs.importScripts=="function",JD=cR?Zs.origin:void 0,_s=Vs,Ir=vu,hR;(e=>{function t(){return Ir}e.value=t;function i(){return Ir.length===2?Ir==="en":Ir.length>=3?Ir[0]==="e"&&Ir[1]==="n"&&Ir[2]==="-":!1}e.isDefaultVariant=i;function s(){return Ir==="en"}e.isDefault=s})(hR||={});var uR=typeof Zs.postMessage=="function"&&!Zs.importScripts,dR=(()=>{if(uR){let e=[];Zs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Zs.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),fR=!!(_s&&_s.indexOf("Chrome")>=0),eN=!!(_s&&_s.indexOf("Firefox")>=0),tN=!!(!fR&&_s&&_s.indexOf("Safari")>=0),iN=!!(_s&&_s.indexOf("Edg/")>=0),sN=!!(_s&&_s.indexOf("Android")>=0),Fr=typeof navigator=="object"?navigator:{},rN={clipboard:{writeText:wm||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Fr&&Fr.clipboard&&Fr.clipboard.writeText),readText:wm||!!(Fr&&Fr.clipboard&&Fr.clipboard.readText)},keyboard:wm||tR()?0:Fr.keyboard||eR?1:2,touch:"ontouchstart"in ji||Fr.maxTouchPoints>0,pointerEvents:ji.PointerEvent&&("ontouchstart"in ji||navigator.maxTouchPoints>0)},Im=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Sm=new Im,Rk=new Im,Lk=new Im,nN=new Array(230),pR;(e=>{function t(a){return Sm.keyCodeToStr(a)}e.toString=t;function i(a){return Sm.strToKeyCode(a)}e.fromString=i;function s(a){return Rk.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Lk.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return Rk.strToKeyCode(a)||Lk.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Sm.keyCodeToStr(a)}e.toElectronAccelerator=o})(pR||={});var vx=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),gR;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof mR?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ys.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:vx})})(gR||={});var mR=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?vx:(this._emitter||(this._emitter=new Ce),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var _R,km;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?km=(e,t)=>{dR(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:km=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},_R=e=>km(globalThis,e)})();var vR;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(vR||={});var Dk=class Hi{static fromArray(t){return new Hi(i=>{i.emitMany(t)})}static fromPromise(t){return new Hi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Hi(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Hi(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Ce,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ys.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Hi(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Hi.map(this,t)}static filter(t,i){return new Hi(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Hi.filter(this,t)}static coalesce(t){return Hi.filter(t,i=>!!i)}coalesce(){return Hi.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Hi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Dk.EMPTY=Dk.fromArray([]);function yR(e){return 55296<=e&&e<=56319}function Nk(e){return 56320<=e&&e<=57343}function bR(e,t){return(e-55296<<10)+(t-56320)+65536}function wR(e){return Fm(e,0)}function Fm(e,t){switch(typeof e){case"object":return e===null?Xs(349,t):Array.isArray(e)?kR(e,t):xR(e,t);case"string":return yx(e,t);case"boolean":return SR(e,t);case"number":return Xs(e,t);case"undefined":return Xs(937,t);default:return Xs(617,t)}}function Xs(e,t){return(t<<5)-t+e|0}function SR(e,t){return Xs(e?433:863,t)}function yx(e,t){t=Xs(149417,t);for(let i=0,s=e.length;i<s;i++)t=Xs(e.charCodeAt(i),t);return t}function kR(e,t){return t=Xs(104579,t),e.reduce((i,s)=>Fm(s,i),t)}function xR(e,t){return t=Xs(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=yx(s,i),Fm(e[s],i)),t)}function xm(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function Bk(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function CR(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Tl(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):CR((e>>>0).toString(16),t/4)}var ER=class bx{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(yR(o))if(a+1<i){let c=t.charCodeAt(a+1);Nk(c)?(a++,l=bR(o,c)):l=65533}else{n=o;break}else Nk(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Tl(this._h0)+Tl(this._h1)+Tl(this._h2)+Tl(this._h3)+Tl(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Bk(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Bk(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=bx._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,xm(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=xm(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=xm(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};ER._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:oN,getWindow:TR,getDocument:aN,getWindows:lN,getWindowsCount:cN,getWindowId:Ok,getWindowById:hN,hasWindow:uN,onDidRegisterWindow:dN,onWillUnregisterWindow:fN,onDidUnregisterWindow:pN}=(function(){let e=new Map,t={window:ji,disposables:new Wo};e.set(ji.vscodeWindowId,t);let i=new Ce,s=new Ce,r=new Ce;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return wi.None;let a=new Wo,l={window:o,disposables:a.add(new Wo)};return e.set(o.vscodeWindowId,l),a.add(Rt(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(Hm(o,RR.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:ji},getDocument(o){return TR(o).document}}})(),AR=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Hm(e,t,i,s){return new AR(e,t,i,s)}var MR,zk,Cm=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){uu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(Cm.sort),o.shift().execute();s.set(n,!1)};zk=(n,o,a=0)=>{let l=Ok(n),c=new Cm(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},MR=(n,o,a)=>{let l=Ok(n);if(s.get(l)){let c=new Cm(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return zk(n,o,a)}})();var Hk=class yu{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new yu(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof yu?t:new yu(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};Hk.None=new Hk(0,0);var gN=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=wR(i),n=s.get(r);if(n)n.users+=1;else{let o=new Ce,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(Rt(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},RR={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:ym?"webkitAnimationStart":"animationstart",ANIMATION_END:ym?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:ym?"webkitAnimationIteration":"animationiteration"},LR=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function wx(e,t,i,...s){let r=LR.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function DR(e,t,...i){return wx("http://www.w3.org/1999/xhtml",e,t,...i)}DR.SVG=function(e,t,...i){return wx("http://www.w3.org/2000/svg",e,t,...i)};var NR=class extends wi{constructor(e,t,i,s,r,n,o,a,l){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new kl,this._charAtlasDisposable=this._register(new kl),this._observerDisposable=this._register(new kl),this._model=new WM,this._workCell=new bk,this._workCell2=new bk,this._rectangleRenderer=this._register(new kl),this._glyphRenderer=this._register(new kl),this._onChangeTextureAtlas=this._register(new Ce),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ce),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ce),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Ce),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Ce),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let c={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",c),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new oM(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new ZM(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=rM(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Hm(this._canvas,"webglcontextlost",h=>{console.log("webglcontextlost event received"),h.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(h)},3e3)})),this._register(Hm(this._canvas,"webglcontextrestored",h=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,vk(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=yk(this._canvas,this._coreBrowserService.window,(h,u)=>this._setCanvasDevicePixelDimensions(h,u)),this._register(this._coreBrowserService.onWindowChange(h=>{this._observerDisposable.value=yk(this._canvas,h,(u,d)=>this._setCanvasDevicePixelDimensions(u,d))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Rt(()=>{for(let h of this._renderLayers)h.dispose();this._canvas.parentElement?.removeChild(this._canvas),vk(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new YM(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new IM(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=hx(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=Vk(Ys.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Ys.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new BM(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,l,c,h=0,u=!0,d,f,p,b,T,v,m,y,g;e=Uk(e,i.rows-1,0),t=Uk(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",A=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,D=A-i.buffer.ydisp,O=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),j=-1,$=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,p=A===o,h=0,l=this._characterJoinerService.getJoinedCharacters(o),y=0;y<i.cols;y++){if(r=this._cellColorResolver.result.bg,a.loadCell(y,s),y===0&&(r=this._cellColorResolver.result.bg),c=!1,u=y>=h,d=y,l.length>0&&y===l[0][0]&&u){f=l.shift();let W=this._model.selection.isCellSelected(this._terminal,f[0],o);for(m=f[0]+1;m<f[1];m++)u&&=W===this._model.selection.isCellSelected(this._terminal,m,o);u&&=!p||O<f[0]||O>=f[1],u?(c=!0,s=new BR(s,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),d=f[1]-1):h=f[1]}if(b=s.getChars(),T=s.getCode(),m=(n*i.cols+y)*bu,this._cellColorResolver.resolve(s,y,o,this.dimensions.device.cell.width),$&&o===A&&(y===O&&(this._model.cursor={x:O,y:D,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},j=O+s.getWidth()-1),y>=O&&y<=j&&(this._coreBrowserService.isFocused&&C==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),T!==0&&(this._model.lineLengths[n]=y+1),!(this._model.cells[m]===T&&this._model.cells[m+pu]===this._cellColorResolver.result.bg&&this._model.cells[m+gu]===this._cellColorResolver.result.fg&&this._model.cells[m+_m]===this._cellColorResolver.result.ext)&&(P=!0,b.length>1&&(T|=KM),this._model.cells[m]=T,this._model.cells[m+pu]=this._cellColorResolver.result.bg,this._model.cells[m+gu]=this._cellColorResolver.result.fg,this._model.cells[m+_m]=this._cellColorResolver.result.ext,v=s.getWidth(),this._glyphRenderer.value.updateCell(y,n,T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,v,r),c)){for(s=this._workCell,y++;y<=d;y++)g=(n*i.cols+y)*bu,this._glyphRenderer.value.updateCell(y,n,0,0,0,0,ZA,0,0),this._model.cells[g]=0,this._model.cells[g+pu]=this._cellColorResolver.result.bg,this._model.cells[g+gu]=this._cellColorResolver.result.fg,this._model.cells[g+_m]=this._cellColorResolver.result.ext;y--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},BR=class extends $o{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Uk(e,t,i=0){return Math.max(Math.min(e,t),i)}var Pk="di$target",qk="di$dependencies",Em=new Map;function vs(e){if(Em.has(e))return Em.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");OR(t,i,r)};return t._id=e,Em.set(e,t),t}function OR(e,t,i){t[Pk]===t?t[qk].push({id:e,index:i}):(t[qk]=[{id:e,index:i}],t[Pk]=t)}var mN=vs("BufferService"),_N=vs("CoreMouseService"),vN=vs("CoreService"),yN=vs("CharsetService"),bN=vs("InstantiationService"),wN=vs("LogService"),zR=vs("OptionsService"),SN=vs("OscLinkService"),kN=vs("UnicodeService"),xN=vs("DecorationService"),HR={trace:0,debug:1,info:2,warn:3,error:4,off:5},UR="xterm.js: ",Ik=class extends wi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),Sx=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=HR[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":UR)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Ik=LA([DA(0,zR)],Ik);var Sx;function PR(e){Sx=e}var kx=class extends wi{constructor(e){if(Xk&&XA()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Ce),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Ce),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Ce),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Ce),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=t.coreService,s=t.optionsService,r=t,n=r._renderService,o=r._characterJoinerService,a=r._charSizeService,l=r._coreBrowserService,c=r._decorationService,h=r._logService,u=r._themeService;PR(h),this._renderer=this._register(new NR(e,o,a,l,i,c,s,u,this._preserveDrawingBuffer)),this._register(Ys.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Ys.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Ys.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Ys.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(Rt(()=>{if(this._terminal._core._store._isDisposed)return;let d=this._terminal._core._renderService;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};var Ex=Symbol("html"),Dl=class{#e;constructor(t,i){if(t!==Ex)throw new TypeError("Html is made by html`…`");this.#e=i}static markupOf(t){return t.#e}toString(){if(xx)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(xx)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},xx=typeof process<"u"&&process.env.VITEST!==void 0,qR=e=>new Dl(Ex,e);var IR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FR=e=>e.replace(/[&<>"']/g,t=>IR[t]);function Tx(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Dl)return Dl.markupOf(e);if(Array.isArray(e))return e.map(Tx).join("");if(typeof e=="string")return FR(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var Cx=new WeakSet,$R=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,KR=/\bname\s*=\s*["']?csrf\b/i;function WR(e){if(Cx.has(e))return;let t=e.join("\0");if($R.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(KR.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");Cx.add(e)}function Go(e,...t){WR(e);let i=e[0];for(let s=0;s<t.length;s++)i+=Tx(t[s])+e[s+1];return qR(i)}var K=(e,t,i)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:i}),Ax=[K("scope","scopes?|scoped","plan"),K("contract","contracts?","plan"),K("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),K("sealed","seal|seals|sealed|sealing","approved"),K("binds","binds?","approved"),K("digest","digests?","(the plan version, in Details)"),K("worker","workers?","builder"),K("runner","runners?","builder"),K("daemon","daemons?","builder"),K("background service","background service","builder"),K("operator","operators?|instance operator","approver, or owner"),K("coordinator","coordinators?","your lead"),K("mate","mate","your lead"),K("scout","scouts?|scouting|scouted","research"),K("criterion","criterion|criteria","requirement"),K("evidence","evidence","requirement, or the saved files"),K("proof","proofs?","requirement"),K("verdict","verdicts?","requirement"),K("caveat","caveats?","requirement"),K("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),K("Accept and finish","accept\\s+and\\s+finish","Accept"),K("Revise","revise","Send back, or Request changes"),K("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),K("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),K("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),K("tidy","tidy|tidied|tidying","Archive"),K("run #N","(?:run|result)\\s+#?\\d+|attempt\\s+#?\\d+(?!\\s+\\(build\\s+#\\d+\\))","build #N, or attempt N (build #M)"),K("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),K("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),K("claim","claim|claimed","Waiting: Toolroll is …"),K("lease","leases?|leased","Waiting: Toolroll is …"),K("custody","custody","Waiting: Toolroll is …"),K("incident","incidents?","Waiting: Toolroll is …"),K("plane","plane","Toolroll"),K("fence","fences?|fenced","Waiting: Toolroll is …"),K("attested","attest|attested|attestation","Waiting: Toolroll is …"),K("receipt","receipts?","Waiting: Toolroll is …"),K("regate","regate[ds]?","Run checks"),K("carried","carried|carry|carries","Waiting: Toolroll is …"),K("incarnation","incarnations?","Waiting: Toolroll is …"),K("admission","admission","Waiting: Toolroll is …"),K("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),K("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),K("unproven","unproven","Waiting: Toolroll is …"),K("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],jR=Ax.map(e=>e.never);var bB=[K("lead","lead","Toolroll, or Chat"),K("crew","crew","Toolroll"),K("scope","scopes?|scoped","plan"),K("mode","modes?","(Settings)"),K("flow","flows?","(Settings)"),K("fleet","fleet","(Settings)"),K("fallback","fallbacks?","(Settings)"),K("routing","routing|routed","(Settings)"),K("spend","spend|spends|spending|spent","cost"),K("MCP","mcp","(Settings)"),K("password","passwords?|passwordless","(only where one is asked for)"),K("token","tokens?","(Settings)"),K("builder","builders?","taking work")];var Mx={queued:{stage:"queued"},ready:{stage:"queued"},"provider-quota":{stage:"queued"},running:{stage:"building"},reviewing:{stage:"reviewing"},"review-pending":{stage:"building"},"checks-running":{stage:"checking"},"ready-to-check":{stage:"finished",act:"open-result"},"ready-to-review":{stage:"finished"},"report-ready":{stage:"finished"},"no-change":{stage:"finished"},"pr-opened":{stage:"finished"},"merge-observed":{stage:"finished"},"pr-closed":{stage:"finished"},"agent-attested":{stage:"finished"},"accepted-exception":{stage:"finished"},complete:{stage:"complete",act:"open-result"},cancelled:{stage:"stopped",act:"inspect-task"},paused:{stage:"stopped"},stopped:{stage:"stopped",act:"resume-run"},failed:{stage:"failed",act:"retry-task"},"checks-failed":{stage:"failed"},"waiting-incident":{stage:"failed",act:"retry-task"},"plan-stopped":{stage:"needs-you",need:"plan-again",act:"inspect-task"},"planning-stopped":{stage:"needs-you",need:"planning-stopped",act:"inspect-task"},stopping:{stage:"waiting",wait:"build-stopping"},"build-stopping":{stage:"waiting",wait:"build-stopping"},"other-computer":{stage:"waiting",wait:"other-computer"},"planning-ready":{stage:"waiting",wait:"plan-next"},"scouting-ready":{stage:"waiting",wait:"research-next"},"worker-at-capacity":{stage:"waiting",wait:"builders-busy"},"retry-scheduled":{stage:"waiting",wait:"retry-later"},"plan-retry":{stage:"waiting",wait:"plan-retry-later"},updating:{stage:"waiting",wait:"app-update"},"waiting-dependency":{stage:"waiting",wait:"other-task"},"watch-stalled":{stage:"waiting",wait:"builder-restarting"},"history-problem":{stage:"needs-you",need:"history",act:"inspect-task"},"earlier-active":{stage:"needs-you",need:"earlier-version",act:"inspect-task"},"waiting-decision":{stage:"needs-you",need:"answer",act:"answer-decision"},"finding-held":{stage:"needs-you",need:"finding",act:"inspect-findings"},"decision-queue":{stage:"needs-you",need:"questions",act:"inspect-decisions"},"result-needs-attention":{stage:"needs-you",need:"other",act:"inspect-run"},"process-needs-attention":{stage:"needs-you",need:"stop-unproven",act:"inspect-run"},"vanished-run":{stage:"needs-you",need:"vanished",act:"reconcile-run"},held:{stage:"needs-you",need:"hold",act:"inspect-hold"},"storage-blocked":{stage:"needs-you",need:"storage",act:"unhold"},"terminal-dependency":{stage:"needs-you",need:"fix-dependency",act:"repair-dependency"},"needs-project":{stage:"needs-you",need:"choose-project",act:"place-task"},"needs-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"invalid-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"planner-source":{stage:"needs-you",need:"fix-request",act:"write-scope"},"needs-agent-profile":{stage:"needs-you",need:"choose-agent",act:"select-agent"},"needs-approval":{stage:"needs-you",need:"approval",act:"approve-scope"},"missing-requirement":{stage:"needs-you",need:"add-requirement",act:"repair-capability"},"no-worker-registered":{stage:"needs-you",need:"connect-builder",act:"start-worker"},"no-worker-online":{stage:"needs-you",need:"start-builder",act:"start-worker"},"signed-out":{stage:"needs-you",need:"sign-in",act:"sign-in"},"needs-verification":{stage:"needs-you",need:"review-result"},"proof-refuted":{stage:"needs-you",need:"review-result"},"no-build-record":{stage:"needs-you",need:"review-result"},"verification-needed":{stage:"needs-you",need:"review-result"},"evidence-mismatch":{stage:"needs-you",need:"review-result"},"record-incomplete":{stage:"needs-you",need:"review-result"},"evidence-damaged":{stage:"needs-you",need:"review-result"}};var xB=Object.fromEntries(Object.entries(Mx).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var GR="The check result couldn't be read.",zB=`${GR} Run checks on it, or open the result to see why.`;var HB={ok:Go`<path d="M20 6 9 17l-5-5"/>`,running:Go`<circle cx="12" cy="12" r="4"/>`,none:Go`<circle cx="12" cy="12" r="3"/>`,note:Go`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Go`<path d="M18 6 6 18M6 6l12 12"/>`};function $m(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function Rx(e,t){let i=$m(e,t);return i==="password"?"password":i==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function Nl(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}var z=e=>["path",{d:e}],Wr=(e,t,i)=>["circle",{cx:e,cy:t,r:i}],ku={home:[z("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),z("M9 22V12h6v10")],tasks:[z("m3 17 2 2 4-4"),z("m3 7 2 2 4-4"),z("M13 6h8"),z("M13 12h8"),z("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],z("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[z("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],z("M2 14h2"),z("M20 14h2"),z("M15 13v2"),z("M9 13v2")],projects:[z("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[z("M21 4h-7"),z("M10 4H3"),z("M21 12h-9"),z("M8 12H3"),z("M21 20h-5"),z("M12 20H3"),z("M14 2v4"),z("M8 10v4"),z("M16 18v4")],pen:[z("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[z("M5 12h14"),z("m12 5 7 7-7 7")],plus:[z("M12 5v14"),z("M5 12h14")],send:[z("M12 19V5"),z("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[z("M18 6 6 18"),z("m6 6 12 12")],back:[z("m15 18-6-6 6-6")],menu:[z("M4 6h16"),z("M4 12h16"),z("M4 18h16")],search:[Wr(11,11,7),z("m20 20-3.5-3.5")],chevron:[z("m6 9 6 6 6-6")],check:[z("M20 6 9 17l-5-5")],alert:[Wr(12,12,9),z("M12 8v4"),z("M12 16h.01")],more:[Wr(5,12,1),Wr(12,12,1),Wr(19,12,1)],file:[z("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),z("M14 3v5h5")],minus:[z("M5 12h14")],fit:[z("M15 3h6v6"),z("M9 21H3v-6"),z("M21 3l-7 7"),z("M3 21l7-7")],bolt:[z("M13 2 4 14h7l-1 8 9-12h-7z")],code:[z("m16 18 6-6-6-6"),z("m8 6-6 6 6 6")],sun:[Wr(12,12,4),z("M12 2v2"),z("M12 20v2"),z("m4.93 4.93 1.41 1.41"),z("m17.66 17.66 1.41 1.41"),z("M2 12h2"),z("M20 12h2"),z("m6.34 17.66-1.41 1.41"),z("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],z("M15 2v2"),z("M15 20v2"),z("M2 15h2"),z("M2 9h2"),z("M20 15h2"),z("M20 9h2"),z("M9 2v2"),z("M9 20v2")],bell:[z("M10.27 21a2 2 0 0 0 3.46 0"),z("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[z("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[z("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[z("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Wr(9,7,4),z("M22 21v-2a4 4 0 0 0-3-3.87"),z("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Wr(12,12,10),z("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),z("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],z("M8 21h8"),z("M12 17v4")],list:[z("M8 6h13"),z("M8 12h13"),z("M8 18h13"),z("M3 6h.01"),z("M3 12h.01"),z("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],z("M9 3v18"),z("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],z("M15 3v18")],server:[["rect",{x:2,y:2,width:20,height:8,rx:2}],["rect",{x:2,y:14,width:20,height:8,rx:2}],z("M6 6h.01"),z("M6 18h.01")]};var Bx=U(ri(),1);var Me=(...e)=>e.filter(Boolean).join(" ");var Ox=U(F(),1);function Ot({name:e,small:t=!1}){return(0,Ox.jsx)("svg",{className:Me("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ku[e].map((i,s)=>(0,Bx.createElement)(i[0],{key:s,...i[1]}))})}var Vt=U(F(),1);function ze({variant:e="outline",sm:t,iconOnly:i,lead:s,label:r,docked:n,busy:o,className:a,type:l="button",...c}){return(0,Vt.jsx)("button",{type:l,className:Me("k-btn",`k-btn-${e}`,t&&"k-btn-sm",i&&"k-btn-icon",n&&"k-docked",o&&"busy",a),"aria-label":i?r:void 0,title:i?r:void 0,"aria-busy":o?!0:void 0,...c,children:i?(0,Vt.jsx)(Ot,{name:i}):(0,Vt.jsx)("span",{className:"k-face",children:o?(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("span",{className:"k-spin","aria-hidden":"true"}),o]}):(0,Vt.jsxs)(Vt.Fragment,{children:[s&&(0,Vt.jsx)(Ot,{name:s,small:!0}),r]})})})}function Km({variant:e="outline",sm:t,label:i,lead:s,className:r,...n}){return(0,Vt.jsx)("a",{className:Me("k-btn",`k-btn-${e}`,t&&"k-btn-sm",r),...n,children:(0,Vt.jsxs)("span",{className:"k-face",children:[s&&(0,Vt.jsx)(Ot,{name:s,small:!0}),i]})})}var zx=U(F(),1);function Cu({word:e,tone:t="",dot:i=!0}){return(0,zx.jsx)("span",{className:Me("k-chip",t,!i&&"nodot"),children:e})}var ZR=U(F(),1);var Hx=U(F(),1);var Ux=U(F(),1);var Px=U(ri(),1);var Dn=U(F(),1);function qx({label:e,hint:t,error:i,children:s}){let r=(0,Px.useId)(),n=Me(t&&`${r}-hint`,`${r}-err`);return(0,Dn.jsxs)("div",{className:"k-field",children:[(0,Dn.jsx)("label",{className:"k-label",htmlFor:r,children:e}),s({id:r,describedBy:n,invalid:!!i}),t&&(0,Dn.jsx)("p",{className:"k-hint",id:`${r}-hint`,children:t}),(0,Dn.jsx)("span",{className:"k-err",id:`${r}-err`,role:"alert",children:i??""})]})}var Ix=({className:e,...t})=>(0,Dn.jsx)("input",{className:Me("k-input",e),...t});var Eu=U(F(),1);function Fx({items:e,sm:t,wide:i,className:s,...r}){return(0,Eu.jsx)("span",{className:Me("k-selw",t&&"sm",i&&"wide",s),children:(0,Eu.jsx)("select",{className:"k-sel",...r,children:e.map(n=>{let[o,a]=typeof n=="string"?[n,n]:n;return(0,Eu.jsx)("option",{value:o,children:a},o)})})})}var $x=U(F(),1);var Kx=U(F(),1);var Qs=U(F(),1);function Wx({name:e,legend:t,current:i,items:s,onChange:r}){return(0,Qs.jsxs)("fieldset",{className:"k-radios",children:[(0,Qs.jsx)("legend",{className:"k-sr",children:t}),s.map(n=>(0,Qs.jsxs)("label",{className:"k-opt",children:[(0,Qs.jsx)("input",{type:"radio",name:e,value:n.value,checked:n.value===i,onChange:()=>r(n.value)}),(0,Qs.jsxs)("span",{children:[(0,Qs.jsx)("b",{children:n.label}),n.text&&(0,Qs.jsx)("span",{children:n.text})]}),n.tag]},n.value))]})}var jx=U(F(),1),Yo=({children:e})=>(0,jx.jsx)("div",{className:"k-acts",children:e});var QR=U(ri(),1),Vx=U(F(),1);var Xo=U(F(),1),Wm=({children:e})=>(0,Xo.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,Xo.jsx)(Ot,{name:"alert",small:!0}),(0,Xo.jsx)("span",{children:e})]});var Bl=({children:e})=>(0,Xo.jsx)("p",{className:"k-note",children:e});var Ol=U(F(),1);function Tu({title:e,text:t,action:i}){return(0,Ol.jsxs)("div",{className:"k-empty",children:[(0,Ol.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,Ol.jsx)("p",{className:"k-empty-x",children:t}),i]})}var Gx=U(F(),1);var jm=U(F(),1);var Vm=U(F(),1);var Gm=U(F(),1);var Vr=U(ri(),1),_2=U(Qu(),1);var JR="toolroll.key",e8="x-toolroll-key",t8=/^[0-9a-f]{64}$/;function Yx(){try{let e=globalThis.localStorage?.getItem(JR)??null;if(e===null)return null;let t=JSON.parse(e),i=typeof t=="object"&&t!==null?t.key:null;return typeof i=="string"&&t8.test(i)?i:null}catch{return null}}function Au(e){let t=Yx();return t===null?e:{...e,[e8]:t}}function Xx(){let e=Yx();return e===null?["toolroll"]:["toolroll",`toolroll.key.${e}`]}var ys="form.k-sform",Hl=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",i8=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),Zx="http://www.w3.org/2000/svg",Js=e=>e.querySelector("[data-k-proof]"),bs=e=>e.querySelector("[data-k-save]"),i2=e=>new Set(Array.from(Js(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function Ru(e,t=null){let i=i2(e),s;try{s=t?new FormData(e,t):new FormData(e)}catch{s=new FormData(e)}let r=[];return s.forEach((n,o)=>{!i.has(o)&&typeof n=="string"&&r.push([o,n])}),r}function e_(e){let t=new Map;for(let[i,s]of e)t.set(i,[...t.get(i)??[],s]);return t}function s2(e){let t=i2(e),i=[];for(let s of Array.from(i8(e)))!s.name||s.type==="hidden"||s.type==="submit"||s.type==="button"||t.has(s.name)||i.includes(s.name)||i.push(s.name);return i}var Vi=e=>(e??"").replace(/\s+/g," ").trim();function r2(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function s8(e,t){let i=r2(e,t);if(i===null)return t;let s=i.getAttribute("aria-label");if(s)return Vi(s);if(i.type==="radio"||i.type==="checkbox"&&i.getAttribute("role")!=="switch"){let o=i.closest("fieldset")?.querySelector("legend");if(o)return Vi(o.textContent)}let r=i.closest(".k-frow")?.querySelector(".k-frow-t");if(r)return Vi(r.textContent);let n=i.labels?.[0];return n?Vi(n.querySelector(".k-sl-t, b")?.textContent??n.textContent):t}function r8(e,t,i){let s=r2(e,t);if(s instanceof HTMLSelectElement)return Vi(Array.from(s.options).find(o=>o.value===i[0])?.textContent??i[0]);if(s?.type==="radio"||s?.type==="checkbox"){let o=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(s.type==="checkbox"&&s.getAttribute("role")==="switch")return i.length>0?"On":"Off";let a=o.filter(l=>i.includes(l.value)).map(l=>Vi(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return a.length===0?"none":a.join(", ")}let r=i[0]??"";if(s?.type==="password")return r===""?"unchanged":"a new value";let n=r.split(`
155
155
  `)[0].trim();return n===""?"empty":n.length>40?`${n.slice(0,39)}…`:`${n}${r.includes(`
156
156
  `)?"…":""}`}var n8=(e,t)=>JSON.stringify(e??[])===JSON.stringify(t??[]);function t_(e){let t=e_(Ru(e));return s2(e).filter(i=>!n8(e.kInit?.get(i),t.get(i)))}function n2(e,t){let i=e_(t),s=e.hasAttribute("data-k-gate")?t_(e):s2(e);return s.length>3?`${s.length} changes`:s.map(r=>`${s8(e,r)}: ${r8(e,r,i.get(r)??[])}`).join(" · ")}function o2(e,t){let i=e.dataset.kProofIf;if(!i)return!0;let s=i.indexOf("=");return t.some(([r,n])=>r===i.slice(0,s)&&n===i.slice(s+1))}var Xm=e=>e!==null&&e.querySelector('input[type="password"], a.sso-step-up')!==null;function Mu(e){if(e.kPrepped)return;e.kPrepped=!0,e.kInit=e_(Ru(e));for(let i of Array.from(Js(e)?.querySelectorAll("input[required]")??[]))i.removeAttribute("required"),i.dataset.kRequired="";let t=bs(e);t&&(t.dataset.kVariant=t.classList.contains("k-btn-danger")?"danger":t.classList.contains("k-btn-outline")?"outline":"primary")}function Qx(){for(let e of Array.from(document.querySelectorAll(ys)))Mu(e)}function o8(e,t){e.classList.remove("k-btn-primary","k-btn-outline","k-btn-danger"),e.classList.add(`k-btn-${t}`)}function a8(e){for(let t of Array.from(document.querySelectorAll(`${ys}[data-k-gate]`))){let i=bs(t);!i||i.dataset.kVariant!=="primary"||o8(i,t===e||e===null?"primary":"outline")}}function l8(e,t){if(!e.hasAttribute("data-k-gate"))return;let i=t_(e),s=e.querySelector(".k-ssave-said");if(e.toggleAttribute("data-dirty",i.length>0),s)if(s.dataset.kIdle===void 0&&(s.dataset.kIdle=s.textContent??""),i.length===0)s.textContent=s.dataset.kIdle??"";else{let r=Ru(e),n=Js(e)!==null&&Xm(Js(e))&&o2(e,r)?" · Asks for your password.":"";s.textContent=`${n2(e,r)}${n}`}t&&a8(i.length>0?e:document.querySelector(`${ys}[data-k-gate][data-dirty]`))}function a2(e){let t=document.createElementNS(Zx,"svg");t.setAttribute("class","k-i"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true");for(let i of ku[e]){let s=document.createElementNS(Zx,i[0]);for(let[r,n]of Object.entries(i[1]))s.setAttribute(r,String(n));t.append(s)}return t}function zl(e,t,i){let s=document.createElement("button");s.type="button",s.className=`k-btn k-btn-${t}`;for(let[n,o]of Object.entries(i))s.setAttribute(n,o);let r=document.createElement("span");return r.className="k-face",r.textContent=e,s.append(r),s}function Ul(e,t){let i=bs(e);if(!i)return;let s=i.querySelector(".k-face");if(s&&i.dataset.kLabel===void 0&&(i.dataset.kLabel=s.textContent??""),i.classList.toggle("busy",t),i.toggleAttribute("aria-busy",t),s)if(s.replaceChildren(),t){let r=document.createElement("span");r.className="k-spin",r.setAttribute("aria-hidden","true"),s.append(r,i.dataset.kBusy??"Saving…")}else s.textContent=i.dataset.kLabel??"Save"}function l2(e){let t=e.querySelector(".k-ssave-err");t&&t.childElementCount>0&&t.replaceChildren(),bs(e)?.removeAttribute("aria-describedby")}function Zm(e,t){e.kPending=!1,e.kSent=!1,Ul(e,!1);for(let s of Array.from(Js(e)?.querySelectorAll('input[type="password"]')??[]))s.value="";let i=e.querySelector(".k-ssave-err");if(i){let s=document.createElement("p");s.className="k-notice",s.setAttribute("role","alert"),s.append(a2("alert"));let r=document.createElement("span");r.textContent=t,s.append(r),i.replaceChildren(s),i.id||(i.id=`${Hl(e)||"k-sform"}-err`),bs(e)?.setAttribute("aria-describedby",i.id),(e.querySelector(".k-ssave")??i).scrollIntoView({block:"center",behavior:"instant"})}bs(e)?.focus({preventScroll:!0})}var c2=e=>{let t=Vi(e);return t===""?t:`${t.charAt(0).toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?"":"."}`},Qm=e=>`${c2(e)} Your edits are still here.`;function c8(e){try{let i=new DOMParser().parseFromString(e,"text/html").querySelector(".k-notice[role=alert] span, .problem, .k-notice[role=alert], [role=alert]"),s=Vi(i?.textContent);return s===""?null:s.slice(0,400)}catch{return null}}var Zo=!1,h8=e=>Vi(e.closest("section")?.querySelector("h3")?.childNodes[0]?.textContent??e.closest("section")?.querySelector("h3")?.textContent)||"a section",u8=e=>Array.from(document.querySelectorAll(`${ys}[data-k-gate][data-dirty]`)).filter(t=>t!==e);function d8(e){let t=new URL(window.location.href);for(let s of["said","problem","unconfirmed"])t.searchParams.delete(s);t.searchParams.set("unconfirmed",Hl(e));let i=e.closest("section[id]")?.id;return`${t.pathname}${t.search}${i?`#${i}`:""}`}var f8=(e,t)=>t instanceof HTMLButtonElement&&t.form===e&&t.hasAttribute("formaction")?t.formAction:new URL(HTMLFormElement.prototype.getAttribute.call(e,"action")??"",window.location.href).href;function Ym(e){Zo=!0,window.location.assign(Hl(e)?d8(e):window.location.href)}async function p8(e,t,i,s){Ul(e,!0);let r=new URLSearchParams;for(let[d,f]of[...t,...i])r.append(d,f);let n=f8(e,s),o;try{o=await fetch(n,{method:"POST",body:r,credentials:"same-origin",redirect:"follow",headers:Au({accept:"text/html"})})}catch{Ym(e);return}let a=new URL(o.url||n,window.location.href);if(a.origin!==window.location.origin||a.pathname==="/login"){Ym(e);return}let l=a.searchParams.get("problem");if(l){Zm(e,Qm(l));return}if(!o.redirected&&o.status>=400&&o.status<500){let d=c8(await o.text().catch(()=>""));Zm(e,Qm(d??`Toolroll refused this (${o.status}). Nothing changed`));return}if(!o.ok){Ym(e);return}let c=a.pathname===window.location.pathname,h=e.closest("section[id]")?.id;Zo=!0;let u=`${a.pathname}${a.search}${c&&h?`#${h}`:""}`;o.redirected&&`${a.pathname}${a.search}`!=`${window.location.pathname}${window.location.search}`?window.location.assign(u):(o.redirected&&window.history.replaceState(window.history.state,"",u),window.location.reload())}function Jx(e,t){let i=e.hasAttribute("data-k-download");i||(Zo=!0),e.kGo=!0;try{t instanceof HTMLButtonElement&&t.form===e?e.requestSubmit(t):e.requestSubmit()}finally{e.kGo=!1}if(i){Zo=!1,e.kPending=!1,e.kSent=!1,Ul(e,!1);for(let s of Array.from(Js(e)?.querySelectorAll('input[type="password"]')??[]))s.value=""}}function Jm(e,t,i,s){if(e.kPending=!0,e.hasAttribute("data-k-native")){if(e.hasAttribute("data-k-download")||Ul(e,!0),e.hasAttribute("data-k-prepare")){let r=!1,n=o=>{r||(r=!0,o===null?Jx(e,s):Zm(e,Qm(o)))};e.dispatchEvent(new CustomEvent("k-prepare",{detail:{done:n}}));return}Jx(e,s);return}p8(e,t,i,s)}var h2=e=>Array.from(e?.querySelectorAll("input[name]")??[]).map(t=>[t.name,t.value]);function g8(e,t,i){let s=Js(e),r=s.nextElementSibling,n=`${Hl(e)||"k-sform"}-pop`,o=document.createElement("div");o.className="k-pop",o.id=n,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby",`${n}-h`),o.tabIndex=-1;let a=document.createElement("div");a.className="k-pop-h";let l=document.createElement("h3");l.id=`${n}-h`,l.textContent="Confirm with your password";let c=zl("","ghost",{"data-k-close":"","aria-label":"Close",title:"Close"});c.classList.add("k-btn-sm","k-btn-icon"),c.replaceChildren(a2("x")),a.append(l,c);let h=document.createElement("p");h.className="k-pop-terms",h.textContent=n2(e,t)||Vi(e.dataset.kConfirm);let u=document.createElement("p");u.textContent=[e.dataset.kConfirm,e.dataset.kNote].filter(Boolean).map(p=>c2(p)).join(" ");let d=document.createElement("div");d.className="k-acts";let f=Vi(bs(e)?.dataset.kLabel??bs(e)?.textContent)||"Save";d.append(zl(f,"primary",{"data-k-sconfirm":""}),zl("Cancel","ghost",{"data-k-close":""})),o.append(a,h,u,s,d),e.append(o),e.kSnapshot=t,e.kSubmitter=i,e.kPending=!0,e.kSent=!1,e.kClose=jr(o,i??bs(e),{onClose:()=>{if(r&&r.parentElement===e?r.before(s):e.insertBefore(s,e.querySelector(".k-ssave")),o.remove(),e.kClose=null,!e.kSent){e.kPending=!1;for(let p of Array.from(s.querySelectorAll('input[type="password"]')))p.value="",p.setCustomValidity("")}}})}function e2(e){let t=Js(e),i=Array.from(t?.querySelectorAll('input[type="password"]')??[]).find(r=>r.value==="");if(i){i.setCustomValidity("Enter your password."),i.reportValidity(),i.focus();return}let s=h2(t);e.kSent=!0,e.kClose?.(),Jm(e,e.kSnapshot??[],s,e.kSubmitter??null)}function m8(e,t){if(e.kPending||(Mu(e),e.hasAttribute("data-k-gate")&&t_(e).length===0&&!(t instanceof HTMLButtonElement&&t.hasAttribute("formaction"))))return;let i=e.hasAttribute("data-k-download")?[]:u8(e);if(i.length>0){_8(e,i,t);return}u2(e,t)}function _8(e,t,i){let s=[...new Set(t.map(h8))],r=`${Hl(e)||"k-sform"}-discard`,n=document.createElement("div");n.className="k-pop",n.id=r,n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby",`${r}-h`),n.tabIndex=-1;let o=document.createElement("div");o.className="k-pop-h";let a=document.createElement("h3");a.id=`${r}-h`,a.textContent="Unsaved changes",o.append(a);let l=document.createElement("p");l.textContent=`You have unsaved changes in ${s.length>1?`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`:s[0]}. Saving this will discard them.`;let c=document.createElement("div");c.className="k-acts";let h=zl("Save this anyway","primary",{"data-k-discard":""});c.append(h,zl("Cancel","ghost",{"data-k-close":""})),n.append(o,l,c),e.append(n),e.kPending=!0;let u=!1,d=jr(n,i??bs(e),{onClose:()=>{n.remove(),e.kPending=!1,u&&u2(e,i)}});h.addEventListener("click",f=>{f.preventDefault(),u=!0,d()}),h.focus()}function u2(e,t){l2(e);let i=Ru(e,t);if(t instanceof HTMLButtonElement&&t.hasAttribute("formaction")){Jm(e,i,[],t);return}let s=Js(e);if(s!==null&&o2(e,i)&&Xm(s)){g8(e,i,t);return}Jm(e,i,s!==null&&!Xm(s)?h2(s):[],t)}var t2=!1;function d2(){if(t2||typeof document>"u")return;t2=!0,document.documentElement.classList.add("k-js");let e=i=>{let s=i.target?.closest?.(ys);s&&Mu(s)};document.addEventListener("focusin",e,!0),document.addEventListener("pointerdown",e,!0);let t=i=>{let s=i.target,r=s?.form;if(!r||!r.matches(ys)||s.closest("[data-k-proof], .k-pop")){s?.type==="password"&&s.setCustomValidity("");return}Mu(r),l2(r),l8(r,!0)};document.addEventListener("input",t),document.addEventListener("change",t),document.addEventListener("submit",i=>{let s=i.target;if(!(s instanceof HTMLFormElement)||!s.matches(ys))return;let r=s;if(!r.kGo){if(i.preventDefault(),i.stopImmediatePropagation(),r.kClose){e2(r);return}m8(r,i.submitter??null)}},!0),document.addEventListener("click",i=>{let s=i.target?.closest?.("[data-k-sconfirm]");if(!s)return;let r=s.closest(ys);r&&(i.preventDefault(),e2(r))}),window.addEventListener("pageshow",()=>{Zo=!1;for(let i of Array.from(document.querySelectorAll(ys)))i.kPending=!1,i.kSent=!1,Ul(i,!1)}),window.addEventListener("standing-orders:workspace-rendered",Qx),window.addEventListener("beforeunload",i=>{Zo||document.querySelector(`${ys}[data-k-gate][data-dirty]`)===null||i.preventDefault()}),Qx()}var v8="(max-width: 760px)",y8='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',i_=()=>typeof window<"u"&&window.matchMedia(v8).matches,b8=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Pl(e){let t=e.closest(".k-composer");if(t===null)return;let i=getComputedStyle(e),s=parseFloat(i.lineHeight)||21,r=(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0),n=s*(Number(e.dataset.max)||8)+r,o=s*(Number(e.dataset.min)||1)+r;e.style.height="auto",e.style.height=`${Math.max(o,Math.min(e.scrollHeight,n))}px`,e.style.overflowY=e.scrollHeight>n+1?"auto":"hidden";let a=e.value.trim()!=="";t.classList.toggle("has-text",a);for(let l of t.querySelectorAll(".k-send[data-gate]:not(:disabled)"))l.setAttribute("aria-disabled",String(!a))}function f2(){let e=window.visualViewport;if(!e)return;let t=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));document.documentElement.style.setProperty("--kb",`${t}px`),document.documentElement.classList.toggle("kb-open",t>80)}var zt=[];function w8(e,t){if(t===null||!t.isConnected)return;let i=t.getBoundingClientRect(),s=e.offsetWidth||336,r=e.offsetHeight||200,n=Math.min(Math.max(8,i.right-s),window.innerWidth-s-8),o=i.bottom+6,a=o+r>window.innerHeight-8?Math.max(8,i.top-r-6):o;e.style.left=`${Math.round(n)}px`,e.style.top=`${Math.round(a)}px`,e.style.setProperty("--origin",`${i.right-n}px ${a>=o?0:r}px`)}function jr(e,t,i={}){zt.length>0&&!e.classList.contains("k-pop")&&m2("close");let r=e.classList.contains("k-pop"),n=i_();e.isConnected||document.body.append(e);let o=document.createElement("div");o.className=`k-scrim${i.dim??(!r||n)?" dim":""}${zt.length>0?" stacked":""}`,e.before(o),e.hidden=!1,e.setAttribute("role",e.getAttribute("role")??"dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.classList.toggle("stacked",zt.length>0),e.classList.toggle("as-sheet",r&&n),r&&!n&&w8(e,t),b8()||(e.classList.remove("k-grow-in"),e.offsetWidth,e.classList.add("k-grow-in"));let a=[];for(let h=e;h&&h!==document.body;h=h.parentElement)h.inert&&(h.inert=!1,a.push(h));let l=[];for(let h=e;h!==document.body&&h.parentElement;h=h.parentElement)for(let u of Array.from(h.parentElement.children))u===h||u===o||u.inert||(u.inert=!0,l.push(u));let c={panel:e,scrim:o,trigger:t,inerted:l,released:a,onClose:i.onClose};return S8(),zt.push(c),o.addEventListener("click",()=>Bn(c,"scrim")),(e.querySelector("[autofocus]")??e.querySelector('input:not([type="hidden"]), textarea, select')??e).focus(),()=>Bn(c,"close")}function Bn(e,t){let i=zt.indexOf(e);if(!(i<0)){for(let s of zt.slice(i+1).reverse())Bn(s,"removed");zt.splice(i,1),zt.length===0&&(Nn?.disconnect(),Nn=null);for(let s of e.inerted)s.inert=!1;for(let s of e.released)s.isConnected&&(s.inert=!0);e.scrim.remove(),e.panel.hidden=!0,e.panel.classList.remove("k-grow-in","as-sheet","stacked"),k8(e.trigger),e.onClose?.(t)}}function s_(){for(let e of zt.slice().reverse())e.panel.isConnected||Bn(e,"removed");zt.length===0&&(Nn?.disconnect(),Nn=null)}var Nn=null;function S8(){Nn!==null||typeof MutationObserver>"u"||(Nn=new MutationObserver(()=>{zt.some(e=>!e.panel.isConnected)&&s_()}),Nn.observe(document.body,{childList:!0,subtree:!0}))}function m2(e="removed"){for(let t of zt.slice().reverse())Bn(t,e)}function Lu(e){return e!=null&&e.isConnected&&e.getClientRects().length>0}function k8(e){let t=e?.getAttribute("data-k-open");if(Lu(e)){e.focus();return}((t?Array.from(document.querySelectorAll(`[data-k-open="${CSS.escape(t)}"]`)).find(Lu):void 0)??Array.from(document.querySelectorAll(".k-dock .k-btn")).find(Lu))?.focus()}function x8(e){let t=zt[zt.length-1];if(!t)return;if(e.key==="Escape"){e.preventDefault(),Bn(t,"escape");return}if(e.key!=="Tab")return;let i=Array.from(t.panel.querySelectorAll(y8)).filter(Lu);if(i.length===0){e.preventDefault(),t.panel.focus();return}let s=i[0],r=i[i.length-1];e.shiftKey&&(document.activeElement===s||document.activeElement===t.panel)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus())}function ql(e,t,i){let s=i_(),r=document.createElement("div"),n=`k-menu-${Math.random().toString(36).slice(2,8)}`;r.className=s?"k-sheet":"k-pop k-pop-menu",r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",n);let o=document.createElement("div");o.className=s?"k-sheet-h":"k-pop-h";let a=document.createElement(s?"h2":"h3");a.id=n,a.textContent=t;let l=document.createElement("button");l.type="button",l.className="k-btn k-btn-ghost k-btn-sm k-btn-icon",l.setAttribute("aria-label","Close"),l.setAttribute("data-k-close",""),l.textContent="×",o.append(a,l);let c=document.createElement("div");c.className="k-menu";let h=()=>{};for(let u of i){let d=document.createElement("button");d.type="button",d.textContent=u.current?`${u.label} · current`:u.label,u.current&&d.setAttribute("aria-current","true"),d.addEventListener("click",()=>{h(),u.act()}),c.append(d)}return r.append(o,c),h=jr(r,e,{onClose:()=>r.remove()}),h}function C8(e){let t=e.target,i=t?.closest("[data-k-composer-project]"),s=t?.closest("[data-k-composer-plus]"),r=i?.dataset.kComposerProject??s?.dataset.kComposerPlus;if(r===void 0)return!1;e.preventDefault();let n=document.getElementById(`${r}-project`),o=c=>{if(!n)return;let h=[];try{let u=JSON.parse(n.dataset.items??"[]");Array.isArray(u)&&(h=u.filter(d=>typeof d=="string"))}catch{h=[]}ql(c,"Project",h.map(u=>({label:u,current:u===n.value,act:()=>{n.value=u;let d=document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"] [data-k-project-name]`);d&&(d.textContent=u),document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)?.setAttribute("aria-label",`Project: ${u}. Change`),n.dispatchEvent(new Event("change",{bubbles:!0}))}})))};if(i)return o(i),!0;let a=document.querySelector(`input[type="file"][data-k-attach="${CSS.escape(r)}"]`),l=[];return a&&l.push({label:"Attach a file",act:()=>a.click()}),n&&l.push({label:"Choose project",act:()=>o(document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)??s)}),l.length>0&&ql(s,"Add to your message",l),!0}function E8(e,t){let i=e.closest("[data-k-draft]");if(i===null)return!1;let s=document.getElementById(`${i.dataset.kInto??""}-text`);if(!(s instanceof HTMLTextAreaElement)||s.disabled)return!0;t.preventDefault();let r=i.dataset.kDraft??"",n=s.value;return s.value=n.trim()===""?r:n.includes(r)?n:`${n.trimEnd()}
157
157
  ${r}`,Pl(s),s.focus(),!0}var p2=!1,g2=new WeakMap;function T8(){let e=document.documentElement;e.classList.add("k-js"),document.addEventListener("keydown",t=>{(t.key==="Tab"||t.key==="F6")&&e.classList.add("k-kbd")},!0),document.addEventListener("pointerdown",()=>{e.classList.remove("k-kbd")},!0)}function Du(){if(p2||typeof document>"u")return;p2=!0,document.addEventListener("input",t=>{let i=t.target;i instanceof HTMLTextAreaElement&&i.classList.contains("k-composer-ta")&&Pl(i)}),document.addEventListener("click",t=>{let i=t.target;if(i===null)return;if(i.closest('.k-send[data-gate][aria-disabled="true"]')){t.preventDefault();return}if(E8(i,t)||C8(t))return;let r=i.closest("[data-k-open]");if(r){let o=document.getElementById(r.dataset.kOpen??"");o&&(t.preventDefault(),jr(o,r));return}if(i.closest("[data-k-close]")){let o=zt[zt.length-1];o&&o.panel.contains(i)&&(t.preventDefault(),Bn(o,"close"));return}let n=i.closest("button.k-switch[role=switch][data-k-switch]");if(n){let o=n.getAttribute("aria-checked")!=="true";n.setAttribute("aria-checked",String(o));let[a,l]=(n.dataset.kSwitch||"On|Off").split("|"),c=n.querySelector("[data-k-words]");c&&(c.textContent=(o?a:l)??""),n.dispatchEvent(new CustomEvent("k-switch",{bubbles:!0,detail:{on:o}}));return}i.closest("[data-k-print]")&&(t.preventDefault(),window.print())}),document.addEventListener("submit",t=>{let i=t.target;if(!(i instanceof HTMLFormElement)||t.defaultPrevented)return;let s=(t.submitter instanceof HTMLButtonElement?t.submitter:null)??i.querySelector("button[type=submit][data-k-busy]"),r=s?.dataset.kBusy;if(s==null||r===void 0)return;if(i.getAttribute("aria-busy")==="true"){t.preventDefault();return}i.setAttribute("aria-busy","true");let n=s.querySelector(".k-face");n!==null&&(g2.set(s,Array.from(n.childNodes)),n.replaceChildren(Object.assign(document.createElement("span"),{className:"k-spin"}),document.createTextNode(r)),n.firstElementChild?.setAttribute("aria-hidden","true")),s.classList.add("busy")}),window.addEventListener("pageshow",()=>{for(let t of document.querySelectorAll("form[aria-busy=true]")){t.removeAttribute("aria-busy");for(let i of Array.from(Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(t))){if(!(i instanceof HTMLButtonElement)||!i.classList.contains("busy")||i.dataset.kBusy===void 0)continue;i.classList.remove("busy");let s=i.querySelector(".k-face"),r=g2.get(i);s!==null&&r!==void 0&&s.replaceChildren(...r)}}}),document.addEventListener("keydown",x8,!0),T8();let e=()=>{s_();for(let t of document.querySelectorAll(".k-composer-ta"))Pl(t)};window.addEventListener("standing-orders:workspace-rendered",e),window.visualViewport?.addEventListener("resize",f2),window.visualViewport?.addEventListener("scroll",f2),d2(),e()}var Ke=U(F(),1);function Nu({kind:e,title:t,sub:i,trigger:s,onClose:r,children:n}){let o=(0,Vr.useRef)(null),a=(0,Vr.useRef)(r);a.current=r;let l=(0,Vr.useId)();(0,Vr.useLayoutEffect)(()=>{let f=o.current;if(!f)return;let p=!1,b=jr(f,s,{onClose:T=>{p=!0,a.current(T)}});return()=>{p||b()}},[s]);let c=(0,Ke.jsx)(ze,{variant:"ghost",iconOnly:"x",label:"Close",sm:e==="popover"||e==="menu","data-k-close":""}),h=e==="menu"?(0,Ke.jsx)("div",{className:"k-menu",children:n}):n,u=e==="drawer"?(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsxs)("header",{className:"k-drawer-h",children:[(0,Ke.jsx)("h2",{id:l,children:t}),c]}),(0,Ke.jsx)("div",{className:"k-drawer-b",children:h})]}):e==="sheet"?(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsxs)("div",{className:"k-sheet-h",children:[(0,Ke.jsxs)("div",{className:"k-sheet-ht",children:[(0,Ke.jsx)("h2",{id:l,children:t}),i&&(0,Ke.jsx)(Bl,{children:i})]}),c]}),(0,Ke.jsx)("div",{className:"k-sheet-b",children:h})]}):(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsxs)("div",{className:"k-pop-h",children:[(0,Ke.jsx)("h3",{id:l,children:t}),c]}),h]}),d=e==="drawer"?"k-drawer":e==="sheet"?"k-sheet":Me("k-pop",e==="menu"&&"k-pop-menu");return(0,_2.createPortal)((0,Ke.jsx)("div",{ref:o,className:d,role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,children:u}),document.body)}var v2=U(F(),1);var Gr=U(ri(),1);var bt=U(F(),1);function y2({kind:e,facts:t,label:i,terms:s,text:r,primary:n=!0,docked:o,busy:a="Starting…",onApprove:l,check:c}){let h=$m(e,t),[u,d]=(0,Gr.useState)(null),[f,p]=(0,Gr.useState)(!1),[b,T]=(0,Gr.useState)(null),v=(0,Gr.useRef)(!1),m=(0,Gr.useId)(),y=async C=>{if(!v.current){v.current=!0,p(!0),T(null);try{let A=await l(C,Rx(e,t));T(A),A===null&&d(null)}finally{v.current=!1,p(!1)}}};if(h==="automatic")return null;let g=C=>{C.preventDefault();let A=new FormData(C.currentTarget).get("token");y(typeof A=="string"?A:"")};return(0,bt.jsxs)(bt.Fragment,{children:[(0,bt.jsx)(ze,{variant:n?"primary":"outline",label:i,docked:o===!0,busy:f&&u===null?a:!1,"aria-haspopup":h==="password"?"dialog":void 0,...n?{"data-ink-approve":""}:{},onClick:C=>{!A8(C)||v.current||c!==void 0&&!c()||(h==="password"?d(C.currentTarget):y(null))}}),h==="click"&&b&&(0,bt.jsx)(Wm,{children:b}),u&&(0,bt.jsxs)(Nu,{kind:"popover",title:"Confirm with your password",trigger:u,onClose:()=>{d(null),T(null)},children:[r&&(0,bt.jsx)("p",{children:r}),(0,bt.jsx)("p",{className:"k-pop-terms",children:s}),(0,bt.jsxs)("form",{className:"k-field",onSubmit:g,children:[(0,bt.jsx)("label",{className:"k-label",htmlFor:m,children:"Your password"}),(0,bt.jsx)(Ix,{id:m,type:"password",name:"token",autoComplete:"current-password",required:!0,autoFocus:!0,"aria-describedby":`${m}-err`,"aria-invalid":b?!0:void 0}),(0,bt.jsx)("span",{className:"k-err",id:`${m}-err`,role:"alert",children:b??""}),(0,bt.jsxs)(Yo,{children:[(0,bt.jsx)(ze,{type:"submit",variant:"primary",label:i,busy:f?a:!1}),(0,bt.jsx)(ze,{variant:"ghost",label:"Cancel","data-k-close":""})]})]}),(0,bt.jsx)("p",{className:"k-pop-foot k-note",children:Nl(e,{...t,remembered:!1,passwordless:!1})==="Asks for your password."&&e==="standard"?"After this, standard approvals on this computer need no password for 15 minutes.":Nl(e,t)})]})]})}function A8(e){return e.nativeEvent.isTrusted!==!1}var b2=U(F(),1);var R8=U(ri(),1);var w2=U(F(),1);var S2=U(F(),1);var r_=U(F(),1);var L8=U(ri(),1);var k2=U(F(),1);var x2=U(F(),1);var n_=U(F(),1);var o_=U(F(),1);var C2=U(F(),1);var a_=U(ri(),1);var E2=U(F(),1);var Bu=U(ri(),1);var l_=U(F(),1);var B=U(F(),1),c_=(()=>{let e=new URLSearchParams(location.search),t=e.get("task")?.trim()??"",i=e.get("run")?.trim()??"";if(t===""||t.length>200||!/^[1-9][0-9]{0,14}$/.test(i))return null;let s=e.get("program")?.trim()??"",r=s==="claude"||s==="codex"||s==="antigravity"||s==="shell"?s:"claude";return{task:t,run:Number(i),program:r}})(),Yr={claude:"Claude Code",codex:"Codex",antigravity:"Antigravity",shell:"Shell"},N8={claude:"An agent you drive by hand",codex:"An agent you drive by hand",antigravity:"Gemini models via Antigravity",shell:"A plain terminal"},B8={connecting:"Connecting…",live:"Live",ended:"Ended",behind:"Catching up…","signed-out":"Signed out. Sign in again to keep typing",gone:"This terminal is gone",offline:"Reconnecting…",busy:"Not reading input. What you type waits"},h_=document.getElementById("so-term-boot"),O8=h_?.dataset.csrf??"",Ou=h_?.dataset.session||null,z8=h_?.dataset.passwordless==="1",T2={passwordless:z8,remembered:!1},H8=()=>window.matchMedia("(max-width: 760px)").matches;async function U8(){let e=await fetch("/term/state",{headers:{accept:"application/json"},credentials:"same-origin"});return e.status===401?(location.href=`/login?next=${encodeURIComponent(location.pathname)}`,null):e.ok?await e.json():null}async function R2(e,t){try{return await(await fetch(e,{method:"POST",headers:Au({accept:"application/json"}),credentials:"same-origin",body:new URLSearchParams({csrf:O8,...t})})).json()}catch{return{ok:!1,error:"The console didn't answer. Nothing changed; try again."}}}function A2(){let e=r=>getComputedStyle(document.documentElement).getPropertyValue(r).trim(),t=e("--so-ink"),i=e("--so-code-bg")||e("--so-paper"),s=e("--so-muted");return{background:i,foreground:t,cursor:t,cursorAccent:i,selectionBackground:e("--so-selection")||e("--so-soft"),black:t,brightBlack:s,white:s,brightWhite:t,blue:e("--so-info"),brightBlue:e("--so-info"),green:e("--so-success"),brightGreen:e("--so-success"),red:e("--so-danger"),brightRed:e("--so-danger"),yellow:e("--so-warning"),brightYellow:e("--so-warning"),cyan:e("--so-info"),brightCyan:e("--so-info"),magenta:e("--so-accent-text"),brightMagenta:e("--so-accent-text")}}function P8({session:e,onLink:t,onControl:i,keys:s,controls:r}){let n=(0,me.useRef)(null);return(0,me.useEffect)(()=>{let o=new zS({fontFamily:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:H8()?12:13,cursorBlink:!0,allowProposedApi:!0,scrollback:5e3,macOptionIsMeta:!0,theme:A2()}),a=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{o.options.theme=A2()};a.addEventListener("change",l);let c=new HS;o.loadAddon(c);let h=new rk;o.loadAddon(h),o.unicode.activeVersion="11",o.open(n.current);let u=null;try{u=new kx,u.onContextLoss(()=>{u?.dispose(),u=null}),o.loadAddon(u)}catch{u=null}let d=null,f=!1,p=!1,b=!0,T=0,v,m,y=$=>{d?.readyState===WebSocket.OPEN&&d.send(JSON.stringify($))},g=$=>{b&&y({t:"in",d:$})};s(g);let C=()=>{try{c.fit()}catch{return}b&&y({t:"resize",cols:o.cols,rows:o.rows})};r({take:()=>{y({t:"take-control"}),o.focus()},release:()=>{y({t:"release-control"})}});let A=()=>{t(T===0?"connecting":"offline"),i(null);let $=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/term/${e.id}/socket`,P=new WebSocket($,Xx());d=P,P.binaryType="arraybuffer";let W=!0;P.onmessage=w=>{if(W&&(o.reset(),W=!1),typeof w.data!="string"){o.write(new Uint8Array(w.data));return}let _;try{_=JSON.parse(w.data)}catch{return}if(_.t==="hello")T=0,p=_.ended===!0,t(p?"ended":"live"),p||C();else if(_.t==="control"&&(_.role==="controller"||_.role==="observer")){let k={role:_.role,controller:_.controller??null,viewers:Array.isArray(_.viewers)?_.viewers:[],epoch:_.epoch??0},S=!b&&k.role==="controller";b=k.role==="controller",i(k),S&&!p&&C()}else _.t==="exit"?(p=!0,t("ended")):_.t==="input-full"&&(t("busy"),window.clearTimeout(m),m=window.setTimeout(()=>{p||t("live")},2500))},P.onclose=w=>{if(d===P&&(d=null),!f){if(w.code===4401)return t("signed-out");if(w.code===4404)return t("gone");if(p)return t("ended");t(w.code===4008?"behind":"offline"),T+=1,v=window.setTimeout(A,Math.min(8e3,250*2**Math.min(T,5)))}}},D=o.onData(g),O=new ResizeObserver(()=>C());O.observe(n.current);let j=window.visualViewport;return j?.addEventListener("resize",C),A(),o.focus(),()=>{f=!0,window.clearTimeout(v),window.clearTimeout(m),a.removeEventListener("change",l),O.disconnect(),j?.removeEventListener("resize",C),D.dispose(),d?.close(1e3),o.dispose()}},[e.id]),(0,B.jsx)("div",{className:"term-screen",ref:n})}function q8({sendRef:e}){let[t,i]=(0,me.useState)(!1),s=(n,o)=>(0,B.jsx)(ze,{sm:!0,className:"term-key",label:n,onPointerDown:a=>{a.preventDefault(),e.current?.(o)}},n),r=n=>{e.current?.(String.fromCharCode(n.toUpperCase().charCodeAt(0)-64)),i(!1)};return(0,B.jsxs)("div",{className:"term-keys",role:"toolbar","aria-label":"Terminal keys",children:[s("Esc","\x1B"),s("Tab"," "),(0,B.jsx)(ze,{sm:!0,className:"term-key",label:"Ctrl","aria-pressed":t,onPointerDown:n=>{n.preventDefault(),i(o=>!o)}}),t?(0,B.jsx)(B.Fragment,{children:["c","d","r","l","z"].map(n=>(0,B.jsx)(ze,{sm:!0,className:"term-key",label:`^${n.toUpperCase()}`,onPointerDown:o=>{o.preventDefault(),r(n)}},n))}):(0,B.jsxs)(B.Fragment,{children:[s("↑","\x1B[A"),s("↓","\x1B[B"),s("←","\x1B[D"),s("→","\x1B[C"),s("/","/"),s("⏎","\r")]})]})}function I8({state:e,target:t,onClearTarget:i,onStarted:s,onCancel:r}){let[n,o]=(0,me.useState)(e.projects[0]?.path??""),[a,l]=(0,me.useState)(t?.program??e.programs[0]??"claude");if(t===null&&e.projects.length===0)return(0,B.jsx)("div",{className:"term-form",children:(0,B.jsx)(Tu,{title:"No projects yet.",text:"Add a project in the console first, then start a terminal in it.",action:(0,B.jsx)(Km,{sm:!0,href:"/projects",label:"Open Projects"})})});let c=e.projects.find(f=>f.path===n)?.name??"",h=async f=>{let p=t!==null?{task:t.task,run:String(t.run),program:a,password:f??""}:{repo:n,program:a,password:f??""},b=await R2("/term/start",p);return b.ok&&b.id!==void 0?(s(b.id),null):b.error??"The terminal didn't start. Nothing changed."},u=t!==null?`${Yr[a]} · task ${t.task} (build #${t.run}) · separate copy${a==="shell"?"":" with task context"}`:`${Yr[a]} · ${c} · a fresh worktree on its own branch`,d=t!==null?`${Yr[a]} on a separate copy of task ${t.task} (build #${t.run}).`:`${Yr[a]} in ${c}, a fresh worktree on its own branch.`;return(0,B.jsxs)("section",{className:"term-form","aria-labelledby":"term-new-title","data-term-new":!0,children:[(0,B.jsx)("h2",{id:"term-new-title",className:"k-sr",children:"New terminal"}),t!==null?(0,B.jsxs)("div",{className:"k-field",children:[(0,B.jsx)("span",{className:"k-label",children:"Task build"}),(0,B.jsxs)("p",{className:"term-terms",children:[(0,B.jsx)("a",{className:"k-link",href:`/t/${encodeURIComponent(t.task)}`,children:t.task})," · build #",t.run," · ",(0,B.jsx)(ze,{variant:"ghost",sm:!0,label:"Use a project instead",onClick:i})]})]}):(0,B.jsx)(qx,{label:"Project",children:f=>(0,B.jsx)(Fx,{id:f.id,wide:!0,value:n,onChange:p=>o(p.target.value),items:e.projects.map(p=>[p.path,p.name])})}),(0,B.jsxs)("div",{className:"k-field term-radios",children:[(0,B.jsx)("span",{className:"k-label",children:"Program"}),(0,B.jsx)(Wx,{name:"program",legend:"Program",current:a,onChange:f=>l(f),items:e.programs.map(f=>({value:f,label:Yr[f],text:N8[f]}))})]}),(0,B.jsx)("p",{className:"term-terms",children:u}),(0,B.jsxs)(Yo,{children:[(0,B.jsx)(y2,{kind:"step-up",facts:T2,label:"Start terminal",terms:d,onApprove:h}),r!==null&&(0,B.jsx)(ze,{variant:"ghost",label:"Cancel",onClick:r})]}),(0,B.jsx)(Bl,{children:`${Nl("step-up",T2)} A terminal can do anything you can on this computer. Your default branch is never touched.`})]})}function F8({session:e,onDone:t}){let[i,s]=(0,me.useState)(null),[r,n]=(0,me.useState)(!1),[o,a]=(0,me.useState)(null),l=e.endedAt===null,c=l?"close":"remove",h=async()=>{n(!0),a(null);let u=await R2(`/term/${e.id}/${c}`,{});if(n(!1),!u.ok){a(u.error??"That didn't work. Nothing changed.");return}s(null),await t()};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ze,{variant:"ghost",sm:!0,label:l?"Close":"Remove","aria-haspopup":"dialog",onClick:u=>s(u.currentTarget),"data-term-end":c}),i!==null&&(0,B.jsxs)(Nu,{kind:"popover",title:l?"Close this terminal?":"Remove this terminal?",trigger:i,onClose:()=>{s(null),a(null)},children:[(0,B.jsx)("p",{className:"k-pop-terms",children:l?"Everything running in it stops. Its branch stays.":"Its worktree is removed. Its branch stays."}),o!==null&&(0,B.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,B.jsx)(Ot,{name:"alert",small:!0}),(0,B.jsx)("span",{children:o})]}),(0,B.jsxs)(Yo,{children:[(0,B.jsx)(ze,{variant:"danger",label:l?"Close terminal":"Remove terminal",busy:r?l?"Closing…":"Removing…":!1,onClick:()=>{h()}}),(0,B.jsx)(ze,{variant:"ghost",label:"Cancel","data-k-close":""})]})]})]})}function $8(){let[e,t]=(0,me.useState)(null),[i,s]=(0,me.useState)(Ou),[r,n]=(0,me.useState)(Ou===null?c_:null),[o,a]=(0,me.useState)(Ou===null&&c_!==null),[l,c]=(0,me.useState)(Ou===null&&c_===null),[h,u]=(0,me.useState)("connecting"),[d,f]=(0,me.useState)(null),[p,b]=(0,me.useState)(!1),T=(0,me.useRef)(!1),v=(0,me.useRef)(null),m=(0,me.useRef)(null),y=(0,me.useCallback)(async()=>{let W=await U8();W!==null&&t(W)},[]);if((0,me.useEffect)(()=>{y();let W=window.setInterval(()=>{y()},5e3);return()=>window.clearInterval(W)},[y]),(0,me.useEffect)(()=>{if(e!==null){if(r!==null&&!T.current){T.current=!0;let W=e.sessions.find(w=>w.endedAt===null&&w.task===r.task&&w.run===r.run&&w.program===r.program)??e.sessions.find(w=>w.endedAt===null&&w.task===r.task&&w.run===r.run);if(W!==void 0){s(W.id),a(!1),c(!1),n(null);return}a(!0),c(!1);return}i!==null&&!e.sessions.some(W=>W.id===i)&&s(e.sessions[0]?.id??null),i===null&&e.sessions.length>0&&!o&&s(e.sessions[0].id)}},[e,i,o,r]),(0,me.useEffect)(()=>{if(r!==null&&i===null)return;let W=i===null?"/term":`/term/${i}`;(location.pathname!==W||location.search!=="")&&history.replaceState(null,"",W)},[i,r]),(0,me.useEffect)(()=>{h==="ended"&&y()},[h,y]),(0,me.useEffect)(()=>{b(!1)},[i,d?.controller,d?.role]),e===null)return(0,B.jsx)("div",{className:"term-app term-app--loading",children:(0,B.jsx)("p",{className:"k-note",children:"Loading…"})});let g=e.sessions.find(W=>W.id===i)??null,C=e.sessions.filter(W=>W.endedAt===null).length,A=W=>{s(W),a(!1),c(!1),n(null)},D=()=>{n(null),a(!0),c(!1)},O=o||!l&&g!==null,j=(0,B.jsxs)("nav",{className:"term-list","aria-label":"Terminals",children:[e.sessions.length===0?(0,B.jsx)("p",{className:"term-none",children:"No terminals yet."}):null,e.sessions.map(W=>(0,B.jsxs)("a",{href:`/term/${W.id}`,className:"term-item","aria-current":W.id===i&&!o?"true":void 0,onClick:w=>{w.preventDefault(),A(W.id)},children:[(0,B.jsxs)("span",{className:"term-item-t",children:[Yr[W.program]," · ",W.project]}),(0,B.jsxs)("span",{className:"term-item-m",children:[W.endedAt===null?(0,B.jsx)(Cu,{word:"Live",tone:"live"}):(0,B.jsx)(Cu,{word:"Ended"}),(0,B.jsx)("span",{className:"k-mono",children:W.branch})]})]},W.id))]}),$=(0,B.jsxs)("header",{className:"term-tb",children:[O?(0,B.jsx)(ze,{className:"k-phone-only",variant:"ghost",iconOnly:"back",label:"All terminals",onClick:()=>{a(!1),c(!0)}}):(0,B.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon k-phone-only",href:"/agents","aria-label":"Agents",title:"Agents",children:(0,B.jsx)(Ot,{name:"back"})}),(0,B.jsxs)("a",{className:"term-back k-desk-only",href:"/agents",children:[(0,B.jsx)(Ot,{name:"back",small:!0}),"Agents"]}),(0,B.jsx)("h1",{children:"Terminals"}),(0,B.jsxs)("span",{className:"term-ctx",children:[C," running · up to 8"]}),(0,B.jsx)("span",{className:"k-grow"}),e.available&&!o&&(0,B.jsx)(ze,{variant:"primary",sm:!0,lead:"plus",label:"New terminal",onClick:D})]}),P;return e.available?o||g===null?P=(0,B.jsx)(I8,{state:e,target:r,onClearTarget:()=>n(null),onCancel:g===null&&e.sessions.length===0?null:()=>{a(!1),n(null)},onStarted:W=>{a(!1),n(null),s(W),c(!1),y()}}):P=(0,B.jsxs)("section",{className:"term-pane","aria-label":`${Yr[g.program]} terminal`,children:[(0,B.jsxs)("header",{className:"term-ph",children:[(0,B.jsxs)("div",{children:[(0,B.jsxs)("b",{children:[Yr[g.program]," · ",g.project]}),(0,B.jsxs)("span",{className:"term-ph-m",children:[g.task!==null&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)("a",{className:"k-link",href:`/t/${encodeURIComponent(g.task)}`,children:g.task})," · "]}),(0,B.jsx)("span",{className:"k-mono",children:g.branch})," · started ",new Date(g.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),g.endedAt===null&&d!==null&&(d.role==="observer"?(0,B.jsxs)("span",{className:"term-link",role:"status",children:[d.controller?`Observing · ${d.controller} controlling`:"Observing · Idle"," ",p&&d.controller!==null?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ze,{sm:!0,variant:"primary",label:`Confirm takeover from ${d.controller}`,onClick:()=>{b(!1),m.current?.take()}})," ",(0,B.jsx)(ze,{sm:!0,variant:"ghost",label:"Cancel",onClick:()=>b(!1)})]}):(0,B.jsx)(ze,{sm:!0,variant:"primary",label:"Take control",onClick:()=>{d.controller!==null?b(!0):m.current?.take()}})]}):d.viewers.length>1?(0,B.jsxs)("span",{className:"term-link term-link--live",role:"status",children:["Controlling · ",d.viewers.length-1," observing"," ",(0,B.jsx)(ze,{sm:!0,variant:"ghost",label:"Release",onClick:()=>m.current?.release()})]}):null),(0,B.jsx)("span",{className:`term-link term-link--${h}`,role:"status",children:B8[h]}),(0,B.jsx)(F8,{session:g,onDone:y},g.id)]}),(0,B.jsx)(P8,{session:g,onLink:u,onControl:f,keys:W=>{v.current=W},controls:W=>{m.current=W}},g.id),g.endedAt===null?(0,B.jsx)(q8,{sendRef:v}):(0,B.jsx)(Bl,{children:"Ended. Its branch stays; Remove takes it off this list."})]}):P=(0,B.jsx)("div",{className:"term-form",children:(0,B.jsx)(Tu,{title:"Terminals aren't available.",text:e.problem??"This install can't run terminals."})}),(0,B.jsxs)("div",{className:`term-app${O?" term-app--pane":""}`,"data-kit-page":!0,children:[$,(0,B.jsxs)("div",{className:"term-grid",children:[(0,B.jsx)("aside",{className:"term-side",children:j}),(0,B.jsx)("main",{className:"term-main",children:P})]})]})}Du();(0,M2.createRoot)(document.getElementById("so-term")).render((0,B.jsx)($8,{}));