import {c as ce,C as Ce,E as Ee,D}from'./chunk-C1cNl4jV.js';import {O as Oe,b as bt}from'./chunk-De4L3Lrd.js';import {J,c as tS,a5 as fh,c3 as He,L as w,c4 as Pt,aq as Sr,a9 as zt,c5 as bD,bW as JT,bu as dy}from'./main-WUGO6e7n.js';var F,C=J(()=>{tS();fh();He();Oe();ce();tS();F=(()=>{class r extends bt{constructor(){super(...arguments),this.showScriptListTreeSelector=!1,this.scriptListDialogTitle="lblExecuteScript",this.scriptListDataTree=[],this.showRunScriptParametersDialog=!1,this.runScriptParametersData=null,this.runScriptText="",this.runScriptTreeNodeConnectionManager=w(Pt);}handleNonRunnableEntry(t){}runInjectedScript(t){this.runResolvedScript(t);}isReadyForInjection(){return !!this.remoteTerminal}onRunScriptPress(){this.scriptListDataTree=[],this.runScriptTreeNodeConnectionManager.getLastRepositoryTreeNodeConnections().pipe(Sr(t=>!!t),zt(1)).subscribe(t=>{this.scriptListDataTree=Ce(this.runScriptTreeNodeConnectionManager.getTreeNodeByConnectionType(this.scriptListConnections,t.length>0?t[0]:null)),this.showScriptListTreeSelector=!0;});}onScriptEntrySelected(t){let n=t?.data?.connection;if(!n?.permissions?.canExecute)return;this.showScriptListTreeSelector=!1;let i=n.id;i&&this.connectionService.getWebTerminalSessionTool(i,this.webClientSessionConfig?.connectionId).pipe(zt(1)).subscribe(e=>{let s=this.getRunnableScript(e);if(e?.canRunInWebTerminal!==!1&&s){if(Ee(e)){this.runScriptParametersData=e,this.runScriptText=s,this.showRunScriptParametersDialog=!0;return}this.runResolvedScript(this.applyRunScriptParameters(s,D(e)));return}this.handleNonRunnableEntry(e);});}onRunScriptParametersResult(t){this.runResolvedScript(this.applyRunScriptParameters(this.runScriptText,t));}onRunScriptParametersVisibilityChange(t){this.showRunScriptParametersDialog=t,t||(this.runScriptParametersData=null,this.runScriptText="");}onScriptListCancel(){this.showScriptListTreeSelector=!1;}static{this.\u0275fac=(()=>{let t;return function(i){return (t||(t=bD(r)))(i||r)}})();}static{this.\u0275dir=JT({type:r,features:[dy]});}}return r})();});export{C,F};