"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[3105],{3105:(t,e,n)=>{n.r(e),n.d(e,{Actions:()=>u,TerminalActions:()=>u});var r,o=n(21716),c=n(55696),i=n(40713),a=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.doctype="none",e}return a(e,t),e.prototype._init2=function(){},e.prototype._raw_default_frame_tree=function(){return{type:"terminal"}},e.prototype.get_terminal=function(t){return this.terminals.get(t)},e.prototype.run_command=function(t,e){var n=e.run,r=void 0===n||n,o=e.cleanup,c=void 0===o||o,i=e.userarg,a=void 0!==i&&i,u=e.special,l=this._get_most_recent_active_frame_id_of_type("terminal");if(null!=l){this.unset_frame_full(),this.focus(l),this.set_active_id(l);var s=this.terminals.get(l);if(null==s)return;switch(u){case"up":s.conn_write("[A");break;case"down":s.conn_write("[B");break;case"tab":s.conn_write("\t");break;case"ctrl-c":s.conn_write("");break;default:var f=r&&!a?"\n":a?"":" ",p=c?"":"",_=a?" ''[D":"";s.conn_write("".concat(p).concat(t).concat(_).concat(f))}}},e.prototype.help=function(){(0,i.open_new_tab)("https://doc.cocalc.com/terminal.html")},e.prototype.guide=function(){return t=this,e=void 0,r=function(){var t;return function(t,e){var n,r,o,c,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return c={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function a(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}(this,(function(e){switch(e.label){case 0:return t=this.show_focused_frame_of_type("commands_guide","col",!1,3/4),[4,(0,o.delay)(0)];case 1:return e.sent(),"closed"===this._state||this.set_active_id(t,!0),[2]}}))},new((n=Promise)||(n=Promise))((function(o,c){function i(t){try{u(r.next(t))}catch(t){c(t)}}function a(t){try{u(r.throw(t))}catch(t){c(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,a)}u((r=r.apply(t,e||[])).next())}));var t,e,n,r},e}(c.e)}}]);