"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[503],{503:(t,e,r)=>{function i(t){return(t?.ownerDocument?.defaultView?t.ownerDocument.defaultView:window).getComputedStyle(t,null)}r.r(e),r.d(e,{FitAddon:()=>s});var s=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows)||this._terminal.resize(t.cols,t.rows)}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal.dimensions;if(!t||0===t.css.cell.width||0===t.css.cell.height)return;let e=this._terminal.options.scrollbar?.showScrollbar??!0,r=0!==this._terminal.options.scrollback&&e?this._terminal.options.scrollbar?.width??14:0,s=i(this._terminal.element.parentElement),l=parseInt(s.getPropertyValue("height")),n=Math.max(0,parseInt(s.getPropertyValue("width"))),a=i(this._terminal.element),o={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},h=o.top+o.bottom;return{cols:Math.max(2,Math.floor((n-(o.right+o.left)-r)/t.css.cell.width)),rows:Math.max(1,Math.floor((l-h)/t.css.cell.height))}}}}}]);