"use strict";(self.webpackChunk_cocalc_static=self.webpackChunk_cocalc_static||[]).push([[9282],{12430:(t,e,r)=>{r.d(e,{l:()=>c,v:()=>a});var n=r(24620),i=r(56393),o=r(41780);function c(t){var e=(0,n.path_split)(t),r=(0,n.separate_file_extension)(e.tail);return{directory:e.head,base:r.name,filename:e.tail}}function a(t,e){var r=(0,n.encode_path)(e);return(0,i.join)(o.appBasePath,t,"raw",r)}},29282:(t,e,r)=>{r.r(e),r.d(e,{Actions:()=>_});var n=r(23040),i=r.n(n),o=r(5010),c=r(78193),a=r(12430);function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e,r){return s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}},s(t,e,r||t)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function l(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t,e){return p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},p(t,e)}var h=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};var _=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e)}(o,t);var e,r,n=(e=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=u(e);if(r){var i=u(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return l(this,t)});function o(){return f(this,o),n.apply(this,arguments)}var h=o.prototype;return h._init2=function(){this.is_public||(this._init_syncstring_value(),this._init_spellcheck(),this._init_iframe_reload())},h._init_iframe_reload=function(){var t=this;this._syncstring.on("save-to-disk",(function(){t.set_reload("iframe")}))},h._raw_default_frame_tree=function(){return this.is_public?{type:"html"}:{direction:"col",type:"node",first:{type:"cm"},second:{type:"iframe"}}},h.reload=function(t){var e=this._get_frame_node(t);e&&("iframe"===e.get("type")?this.set_reload("iframe",(new Date).getTime()):s(u(o.prototype),"reload",this).call(this,t))},h.print=function(t){var e=this._get_frame_node(t);if(e)if("cm"!==e.get("type"))try{switch(e.get("type")){case"iframe":(0,c.kX)({src:(0,a.v)(this.project_id,this.path)});break;case"preview":(0,c.kX)({html:i()("#frame-".concat(t)).html(),project_id:this.project_id,path:this.path});break;default:throw Error("Printing not implemented")}}catch(t){this.set_error(t)}else s(u(o.prototype),"print",this).call(this,t)},o}(o.e)}}]);