"use strict";(self.webpackChunkdvls=self.webpackChunkdvls||[]).push([[3669],{3669:(y,l,a)=>{a.r(l),a.d(l,{a:()=>m});var t,s,c={exports:{}};self,c.exports=(t=s={},Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();e&&this._terminal&&!isNaN(e.cols)&&!isNaN(e.rows)&&(this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(this._terminal._core._renderService.clear(),this._terminal.resize(e.cols,e.rows)))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(0===r.css.cell.width||0===r.css.cell.height)return;const u=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,p=window.getComputedStyle(this._terminal.element.parentElement),g=parseInt(p.getPropertyValue("height")),f=Math.max(0,parseInt(p.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),_=g-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),w=f-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(w/r.css.cell.width)),rows:Math.max(1,Math.floor(_/r.css.cell.height))}}},s);const m=function d(i,o){for(var s=0;s<o.length;s++){const t=o[s];if("string"!=typeof t&&!Array.isArray(t))for(const e in t)if("default"!==e&&!(e in i)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(i,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}({__proto__:null},[c.exports])}}]);