filecat 1.0.26 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -43,7 +43,7 @@ url: http://116.198.245.137:5569/
43
43
  5. [excalidraw](https://github.com/excalidraw/excalidraw)绘图编辑器,这是一个很好用白板工具。
44
44
  5. 切换根目录,在设置中添加多个文件夹路径后,可以在右上角选择切换根目录,只对一个session生效。
45
45
  6. 终端,默认是bash, windwos下是 powershell。
46
- 7. 超大文本日志查看器,对任意文本右键使用作为日志类型查看,点击窗口后可以使用上下键来快速滚动翻页。
46
+ 7. 超大文本日志查看器,对任意大小的文本右键使用作为日志类型查看,点击窗口后可以使用上下键来快速滚动翻页,还可以实时输出内容。
47
47
  - ssh代理,ftp代理: 可以管理多个linux服务器,作用和winscp类似,让终端和文件管理更方便。
48
48
  - 网站,是网址收藏夹,可用于保存服务器上其它的网站
49
49
  - ddns
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 181.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[181],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:c().getModeForPath(null!==(r=t.name)&&void 0!==r?r:"").mode,wrap:!1,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,highlightActiveLine:!1,fontSize:14},t.options));return n.container.addEventListener("wheel",(function(t){t.preventDefault()})),n.focus(),n.on("change",(function(e){t.on_change&&t.on_change()})),e.current=n,u.xK.set_editor_temp(n),function(){u.xK.set_editor_temp(null),n.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},7181:(t,e,r)=>{r.r(e),r.d(e,{default:()=>v});var n=r(6540),o=r(5997),i=r(7952),a=r(7444),c=r(6417),u=r(8247),l=r(4091);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",d="completed",g={};function b(){}function w(){}function E(){}var j={};l(j,a,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(T([])));O&&O!==r&&n.call(O,a)&&(j=O);var _=E.prototype=b.prototype=Object.create(j);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=y;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?d:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(S.prototype),l(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(){var t=p((0,a.L4)(c.A.editorSetting),2),e=t[0],r=t[1],f=p((0,n.useState)(!1),2),y=f[0],v=f[1];function m(){return d.apply(this,arguments)}function d(){var t;return t=s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.save||!y){t.next=5;break}return t.next=3,e.save(u.xK.get_deitor_value());case 3:u.xK.set_value_temp(""),v(!1);case 5:case"end":return t.stop()}}),t)})),d=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))},d.apply(this,arguments)}var g=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),e.save&&y&&m())};(0,n.useEffect)((function(){return function(){v(!1)}}),[e]),(0,n.useEffect)((function(){return document.addEventListener("keydown",g),function(){document.removeEventListener("keydown",g)}}),[y,e]);var b=n.createElement("div",{id:"editor-container"},n.createElement(i.A,{ignore_tags:!0,left_children:[n.createElement(o.rA,{key:1,title:"取消",icon:"close",onClick:function(){u.xK.set_value_temp(""),r({open:!1,model:"",fileName:"",save:null})}}),n.createElement("title",{key:2},e.fileName)]},e.menu_list&&e.menu_list,y&&n.createElement(o.rA,{title:"保存",icon:"save",onClick:m})),n.createElement(l.A,{name:e.fileName,on_change:function(){y||v(!0)}}));return e.open&&b}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[181],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(766),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:c().getModeForPath(null!==(r=t.name)&&void 0!==r?r:"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14},t.options));return n.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}),n.container.addEventListener("wheel",(function(t){t.preventDefault()})),n.focus(),n.on("change",(function(e){t.on_change&&t.on_change()})),e.current=n,u.xK.set_editor_temp(n),function(){u.xK.set_editor_temp(null),n.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}r(47),i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},7181:(t,e,r)=>{r.r(e),r.d(e,{default:()=>v});var n=r(6540),o=r(5997),i=r(7952),a=r(7444),c=r(6417),u=r(8247),l=r(4091);function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:P(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",m="executing",d="completed",g={};function b(){}function w(){}function E(){}var O={};l(O,a,(function(){return this}));var j=Object.getPrototypeOf,x=j&&j(j(T([])));x&&x!==r&&n.call(x,a)&&(O=x);var _=E.prototype=b.prototype=Object.create(O);function L(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=y;return function(i,a){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?d:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=E,o(_,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=l(E,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(S.prototype),l(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function h(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(){var t=p((0,a.L4)(c.A.editorSetting),2),e=t[0],r=t[1],f=p((0,n.useState)(!1),2),y=f[0],v=f[1];function m(){return d.apply(this,arguments)}function d(){var t;return t=s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.save||!y){t.next=5;break}return t.next=3,e.save(u.xK.get_deitor_value());case 3:u.xK.set_value_temp(""),v(!1);case 5:case"end":return t.stop()}}),t)})),d=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){h(i,n,o,a,c,"next",t)}function c(t){h(i,n,o,a,c,"throw",t)}a(void 0)}))},d.apply(this,arguments)}var g=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),e.save&&y&&m())};(0,n.useEffect)((function(){return function(){v(!1)}}),[e]),(0,n.useEffect)((function(){return document.addEventListener("keydown",g),function(){document.removeEventListener("keydown",g)}}),[y,e]);var b=n.createElement("div",{id:"editor-container"},n.createElement(i.A,{ignore_tags:!0,left_children:[n.createElement(o.rA,{key:1,title:"取消",icon:"close",onClick:function(){u.xK.set_value_temp(""),r({open:!1,model:"",fileName:"",save:null})}}),n.createElement("title",{key:2},e.fileName)]},e.menu_list&&e.menu_list,y&&n.createElement(o.rA,{title:"保存",icon:"save",onClick:m})),n.createElement(l.A,{name:e.fileName,on_change:function(){y||v(!0)}}));return e.open&&b}}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 502.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[502],{2502:(t,e,r)=>{r.r(e),r.d(e,{default:()=>j});var n=r(6540),o=r(4238),i=r(4944),a=r(7444),c=r(6417),u=r(7952),l=r(5997),s=r(7022),f=r(4289),h=r(2042),p=r(3033),v=r(2389),y=r(4694);function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(){m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:T(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",v="executing",y="completed",g={};function b(){}function w(){}function x(){}var _={};l(_,a,(function(){return this}));var E=Object.getPrototypeOf,k=E&&E(E(C([])));k&&k!==r&&n.call(k,a)&&(_=k);var L=x.prototype=b.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==d(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=h;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:w,configurable:!0}),w.displayName=l(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,c,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(L),l(L,u,"Generator"),l(L,a,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function b(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){b(i,n,o,a,c,"next",t)}function c(t){b(i,n,o,a,c,"throw",t)}a(void 0)}))}}function x(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var k,L=300,S=0,A=!1,T=[];function j(t){var e=x((0,a.L4)(c.A.log_viewer),2),r=e[0],d=e[1],b=(0,n.useRef)(null),_=x((0,n.useState)(0),2),E=_[0],j=_[1],O=x((0,n.useState)(0),2),I=O[0],N=O[1],C=(0,v.Bd)().t,G=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0,i=b.current.scrollTop===b.current.scrollHeight,a=document.createElement("div");return a.textContent=t,a.style.whiteSpace="break-word",a.style.overflowWrap="break-word",a.setAttribute("position","".concat(e)),a.setAttribute("start_position","".concat(r)),n?(b.current.insertBefore(a,o),T.unshift(a)):(b.current.appendChild(a),T.push(a)),i&&(b.current.scrollTop=b.current.scrollHeight),a},P=function(t){var e=(0,y.I)(T,(function(e){return e===t}));e&&b.current.removeChild(e)},z=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t){var o=Array.isArray(t)?t:t.split("\n");if(n){for(var i,a=0;a<o.length;a++)i=G(o[a],e[a],r[a],!0,0===a?b.current.firstChild:i);if(T.length>L)for(var c=T.length-1;c>=L;c--)P(T[c])}else{for(var u=0;u<o.length;u++)G(o[u],e[u],r[u]);if(T.length>L)for(var l=0;l<T.length-L;l++)P(T[l])}}},F=function(){var t=w(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return k.context="",t.next=3,i.ws.sendData(o.HK.log_viewer,k);case 3:(e=t.sent)&&(r=e.context,k=r,z(r.context_list,r.context_position_list,r.context_start_position_list,k.back),k.back&&T.length>0?k.context_list.length>T.length?j(Math.floor(100*parseInt(T[k.context_list.length-T.length].getAttribute("position"))/k.max_size)):j(Math.floor(100*parseInt(T[T.length-k.context_list.length].getAttribute("position"))/k.max_size)):j(Math.floor(100*(null!==(n=k.context_position_list[k.context_position_list.length-1])&&void 0!==n?n:0)/k.max_size)));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),H=function(){var t=w(m().mark((function t(){var e,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){var t=w(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=b.current)){t.next=36;break}if(!(S<e.scrollTop&&T.length>0&&e.scrollTop+e.clientHeight+500>=e.scrollHeight)){t.next=19;break}if(!((r=parseInt(T[T.length-1].getAttribute("position")))>=k.max_size)){t.next=8;break}return A||(A=!0,(0,h.N9)("到达底部")),S=e.scrollTop,t.abrupt("return");case 8:return k.line=20,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!1,k.position=r,t.next=17,F();case 17:t.next=34;break;case 19:if(!(S>e.scrollTop&&T.length>0&&e.scrollTop-300<=0)){t.next=34;break}if(!((n=parseInt(T[0].getAttribute("start_position")))<=0)){t.next=25;break}return A||(A=!0,(0,h.N9)("到达顶部")),S=e.scrollTop,t.abrupt("return");case 25:return k.line=10,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!0,k.position=n,t.next=34,F();case 34:S=e.scrollTop,A=!1;case 36:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),b.current.addEventListener("scroll",e),n=function(t){var e=b.current;e&&(t.preventDefault(),t.deltaY>0?e.scrollTop+=20:e.scrollTop-=20)},b.current.addEventListener("wheel",n,{passive:!1}),N(0),S=0,T=[],(k=new s.d2).line=L,k.path="".concat((0,f.GG)("file",location.pathname)).concat(r.fileName),k.token=localStorage.getItem("token"),t.next=13,F();case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),M=function(){b.current&&b.current.remove(),T=[]};if((0,n.useEffect)((function(){r.show?H():M()}),[r]),(0,n.useEffect)((function(){return function(){M()}}),[]),r.show){var Y=function(){var t=w(m().mark((function t(){var e,r,n,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k.line=L,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],e=0,t.prev=6,!((e=parseInt(I))>100)){t.next=10;break}throw"超过最大范围";case 10:r=g(T);try{for(r.s();!(n=r.n()).done;)o=n.value,b.current.removeChild(o)}catch(t){r.e(t)}finally{r.f()}T=[],t.next=19;break;case 15:return t.prev=15,t.t0=t.catch(6),(0,h.N9)(t.t0),t.abrupt("return");case 19:return k.back=100===e,k.position=Math.floor(k.max_size*(e/100)),t.next=23,F();case 23:case"end":return t.stop()}}),t,null,[[6,15]])})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",{id:"editor-container"},n.createElement(u.A,{ignore_tags:!0,left_children:[n.createElement(l.rA,{key:1,title:"取消",icon:"close",onClick:function(){d({show:!1})}})]},"加载进度",E,n.createElement(p.$Z,{max_width:"10rem",placeholder:C("跳转进度"),icon:"percent",value:I,handleInputChange:function(t){N(t)}}),n.createElement(l.rA,{icon:"play_arrow",title:C("跳转进度"),onClick:Y})),n.createElement("div",{style:{height:"100%"}},n.createElement("div",{ref:b,style:{overflowY:"auto",height:"100%"}})))}}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[502],{2502:(t,e,r)=>{r.r(e),r.d(e,{default:()=>O});var n=r(6540),o=r(4238),i=r(4944),a=r(7444),c=r(6417),u=r(7952),l=r(5997),s=r(7022),f=r(4289),h=r(2042),p=r(3033),v=r(2389),y=r(4694);function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=b(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(){m=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof x?e:x,a=Object.create(i.prototype),c=new C(n||[]);return o(a,"_invoke",{value:T(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",v="executing",y="completed",g={};function x(){}function w(){}function _(){}var b={};l(b,a,(function(){return this}));var k=Object.getPrototypeOf,E=k&&k(k(N([])));E&&E!==r&&n.call(E,a)&&(b=E);var L=_.prototype=x.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==d(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function T(e,r,n){var o=h;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=_,o(L,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:w,configurable:!0}),w.displayName=l(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,l(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(A.prototype),l(A.prototype,c,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(L),l(L,u,"Generator"),l(L,a,(function(){return this})),l(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function x(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){x(i,n,o,a,c,"next",t)}function c(t){x(i,n,o,a,c,"throw",t)}a(void 0)}))}}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||b(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){if(t){if("string"==typeof t)return k(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var E,L=300,S=!1,A=0,T=!0,j=[];function O(t){var e=_((0,a.L4)(c.A.log_viewer),2),r=e[0],d=e[1],x=(0,n.useRef)(null),b=_((0,n.useState)(0),2),k=b[0],O=b[1],I=_((0,n.useState)(100),2),C=I[0],N=I[1],G=_((0,n.useState)(!1),2),z=G[0],H=G[1],P=(0,v.Bd)().t,M=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0,i=document.createElement("div");return i.textContent=t,i.style.whiteSpace="pre-wrap",i.style.overflowWrap="break-word",i.setAttribute("position","".concat(e)),i.setAttribute("start_position","".concat(r)),n?(x.current.insertBefore(i,o),j.unshift(i)):(x.current.appendChild(i),j.push(i)),i},F=function(t){var e=(0,y.I)(j,(function(e){return e===t}));e&&x.current.removeChild(e)},Y=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t){var o=Array.isArray(t)?t:t.split("\n");if(n){for(var i,a=0;a<o.length;a++)i=M(o[a],e[a],r[a],!0,0===a?x.current.firstChild:i);if(j.length>L)for(var c=j.length-1;c>=L;)F(j[j.length-1]),c--}else{for(var u=0;u<o.length;u++)M(o[u],e[u],r[u]);if(j.length>L)for(var l=j.length-L;l>0;)F(j[0]),l--}}},D=function(){var t=w(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return E.context="",t.next=3,i.ws.sendData(o.HK.log_viewer,E);case 3:(e=t.sent)&&(r=e.context,E=r,Y(r.context_list,r.context_position_list,r.context_start_position_list,E.back),E.context_list.length>0&&(E.back&&j.length>0?(E.context_list.length>j.length?O(Math.floor(100*parseInt(j[E.context_list.length-j.length].getAttribute("position"))/E.max_size)):O(Math.floor(100*parseInt(j[j.length-E.context_list.length].getAttribute("position"))/E.max_size)),T=!1):O(Math.floor(100*(null!==(n=E.context_position_list[E.context_position_list.length-1])&&void 0!==n?n:0)/E.max_size))),x.current.clientHeight===x.current.scrollHeight&&K(E.max_size));case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),K=function(t){S||(S=!0,O(100),i.ws.addMsg(o.HK.log_viewer_watch,(function(t){var e=t.context;e&&(E=e,Y(e.context_list,e.context_position_list,e.context_start_position_list,!1),x.current.scrollTop=x.current.scrollHeight)})),E.context="",E.context_list=[],E.context_position_list=[],E.context_start_position_list=[],E.position=t,i.ws.sendData(o.HK.log_viewer_watch,E),H(!0))},B=function(){var t=w(m().mark((function t(){var e,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){var t=w(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=x.current)){t.next=38;break}if(A>e.scrollTop&&S&&(S=!1,i.ws.unConnect(),H(!1)),!S){t.next=6;break}return A=e.scrollTop,t.abrupt("return");case 6:if(!(A<e.scrollTop&&j.length>0&&e.scrollTop+e.clientHeight+500>=e.scrollHeight)){t.next=22;break}if(!((r=parseInt(j[j.length-1].getAttribute("position")))>=E.max_size)){t.next=11;break}return K(r),t.abrupt("return");case 11:return E.line=20,E.context="",E.context_list=[],E.context_position_list=[],E.context_start_position_list=[],E.back=!1,E.position=r,t.next=20,D();case 20:t.next=37;break;case 22:if(!(A>e.scrollTop&&j.length>0&&e.scrollTop-300<=0)){t.next=37;break}if(!((n=parseInt(j[0].getAttribute("start_position")))<=0)){t.next=28;break}return T||(T=!0,(0,h.N9)("到达顶部")),A=e.scrollTop,t.abrupt("return");case 28:return E.line=10,E.context="",E.context_list=[],E.context_position_list=[],E.context_start_position_list=[],E.back=!0,E.position=n,t.next=37,D();case 37:A=e.scrollTop;case 38:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),x.current.addEventListener("scroll",e),n=function(t){var e=x.current;e&&(t.preventDefault(),t.deltaY>0?e.scrollTop+=20:e.scrollTop-=20)},x.current.addEventListener("wheel",n,{passive:!1}),H(!1),S=!1,A=0,j=[],(E=new s.d2).line=L,E.path="".concat((0,f.GG)("file",location.pathname)).concat(r.fileName),E.token=localStorage.getItem("token"),t.next=14,D();case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),$=function(){var t=w(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return x.current&&x.current.remove(),t.next=3,i.ws.unConnect();case 3:j=[];case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();if((0,n.useEffect)((function(){r.show?B():$()}),[r]),(0,n.useEffect)((function(){return function(){$()}}),[]),r.show){var R=function(){var t=w(m().mark((function t(){var e,r,n,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(E.line=L,E.context="",E.context_list=[],E.context_position_list=[],E.context_start_position_list=[],e=0,t.prev=6,!((e=parseInt(C))>100||e<0)){t.next=11;break}throw(0,h.zN)("范围在0-100"),"超过最大范围";case 11:r=g(j);try{for(r.s();!(n=r.n()).done;)o=n.value,x.current.removeChild(o)}catch(t){r.e(t)}finally{r.f()}j=[],t.next=20;break;case 16:return t.prev=16,t.t0=t.catch(6),(0,h.N9)(t.t0),t.abrupt("return");case 20:return E.back=e>=100,E.position=Math.floor(E.max_size*(e/100)),t.next=24,D();case 24:case"end":return t.stop()}}),t,null,[[6,16]])})));return function(){return t.apply(this,arguments)}}(),U=function(){var t=w(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!S){t.next=2;break}return t.abrupt("return");case 2:E.line=L,E.context="",E.context_list=[],E.context_position_list=[],E.context_start_position_list=[],e=g(j);try{for(e.s();!(r=e.n()).done;)n=r.value,x.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return j=[],E.back=!0,E.position=E.max_size,t.next=14,D();case 14:x.current.scrollTop=x.current.scrollHeight,K(E.max_size);case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",{id:"editor-container"},n.createElement(u.A,{ignore_tags:!0,left_children:[n.createElement(l.rA,{key:1,title:"取消",icon:"close",onClick:function(){d({show:!1})}}),n.createElement("title",{key:2},r.fileName,n.createElement("span",null,"加载完成"))]},z&&n.createElement("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"}},"正在实时监听 "),n.createElement("span",null,"当前加载进度",k),n.createElement(p.$Z,{max_width:"10rem",placeholder:P("跳转进度"),icon:"percent",value:C,handleInputChange:function(t){N(t)}}),n.createElement(l.rA,{icon:"play_arrow",title:P("跳转进度"),onClick:R}),n.createElement(l.rA,{icon:"text_rotate_vertical",title:P("滑动到文件最底部,实时输出"),onClick:U})),n.createElement("div",{style:{height:"100%"}},n.createElement("div",{ref:x,style:{overflowY:"auto",height:"100%"}})))}}}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 674.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[674],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:c().getModeForPath(null!==(r=t.name)&&void 0!==r?r:"").mode,wrap:!1,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,highlightActiveLine:!1,fontSize:14},t.options));return n.container.addEventListener("wheel",(function(t){t.preventDefault()})),n.focus(),n.on("change",(function(e){t.on_change&&t.on_change()})),e.current=n,u.xK.set_editor_temp(n),function(){u.xK.set_editor_temp(null),n.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},2674:(t,e,r)=>{r.r(e),r.d(e,{default:()=>C});var n=r(6540),o=r(6417),i=r(7444),a=r(5997),c=r(7952),u=r(7022);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function x(){}var E={};f(E,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(F([])));k&&k!==r&&n.call(k,a)&&(E=k);var L=x.prototype=w.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(l(e)+" is not iterable")}return b.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(j.prototype),f(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(L),f(L,u,"Generator"),f(L,a,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,c,"next",t)}function c(t){f(i,n,o,a,c,"throw",t)}a(void 0)}))}}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t){var e=p((0,n.useState)(!1),2),r=e[0],o=e[1],i=p((0,n.useState)([]),2),a=i[0],c=i[1],l=function(t){c(t)},f=function(){var e=h(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("folder"!==t.type){e.next=7;break}if(r||!t.click||a){e.next=4;break}return e.next=4,t.click(t,l,t.pre_path);case 4:o(!r),e.next=10;break;case 7:if(!t.click){e.next=10;break}return e.next=10,t.click(t,l,t.pre_path);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=h(s().mark((function e(){var r,n=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],"folder"!==t.type||r){e.next=6;break}return e.next=4,t.click(t,l,t.pre_path);case 4:e.next=7;break;case 6:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,n.useEffect)((function(){c(t.children)}),[t.children]),n.createElement("div",{className:"studio-item"},n.createElement("div",{onClick:f,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===u.Iw.folder,y)},className:"studio-item-title"},n.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":r?"arrow_drop_down":"arrow_right"),n.createElement("i",{className:"material-icons","file-type":t.type},"folder"===t.type?"folder":"text_snippet"),n.createElement("span",{className:"studio-item-name"},t.name)),r&&a&&n.createElement("div",{style:{marginLeft:20}},a.map((function(e,r){return n.createElement(n.Fragment,{key:r},n.createElement(d,{type:e.type,click:t.click,name:e.name,key:r,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:y}))}))))}function v(t){return n.createElement("div",null,t.list.map((function(e,r){return n.createElement(d,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),key:r,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click})})))}var m=r(9653),g=r(4289),w=r(3459),b=r(8247),x=r(1499),E=r(2042),_=r(2543),k=r.n(_),L=r(4251),S=r(5421),j=r(2389),O=r(4091);function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function N(){N=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(F([])));E&&E!==r&&n.call(E,a)&&(b=E);var _=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==P(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(P(e)+" is not iterable")}return g.prototype=w,o(_,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function A(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function G(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){A(i,n,o,a,c,"next",t)}function c(t){A(i,n,o,a,c,"throw",t)}a(void 0)}))}}function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t){var e=F((0,i.L4)(o.A.studio),2),r=e[0],l=e[1],s=F((0,n.useState)([]),2),f=s[0],h=s[1],p=F((0,n.useState)(""),2),y=p[0],d=p[1],_=F((0,n.useState)(""),2),P=(_[0],_[1]),A=F((0,n.useState)(!1),2),T=(A[0],A[1],F((0,n.useState)("text"),2)),C=(T[0],T[1]),M=F((0,n.useState)({path:"",name:""}),2),I=M[0],D=M[1],K=F((0,n.useState)(""),2),Y=K[0],$=K[1],R=F((0,i.L4)(o.A.confirm),2),U=(R[0],R[1]),z=F((0,n.useState)(!1),2),B=z[0],W=z[1],X=F((0,i.L4)(o.A.fileShellShow),2),V=X[0],q=X[1],H=F((0,i.L4)(o.A.file_shell_hidden),2),J=H[0],Q=H[1],Z=(0,n.useRef)(null),tt=(0,n.useRef)(null),et=F((0,n.useState)(!1),2),rt=et[0],nt=et[1],ot=F((0,n.useState)(16),2),it=ot[0],at=ot[1],ct=F((0,i.L4)(o.A.showPrompt),2),ut=(ct[0],ct[1]),lt=(0,j.Bd)().t,st=F((0,n.useState)(void 0),2),ft=st[0],ht=st[1],pt=function(){var t=G(N().mark((function t(){var e,n;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,g.GG)("file",r.folder_path),d(e),t.next=4,m.$M.post("studio/get/item",{path:e});case 4:(n=t.sent).code===w.m.Sucess&&h(n.data.list);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){P(""),D({}),W(!1),r.folder_path&&pt()}),[r]);var yt=function(){var t=G(N().mark((function t(e,r){var n,o,i;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!==(n=(0,x.kr)(e))&&void 0!==n?n:"text",C(o),t.next=4,m.$M.get("".concat(r));case 4:if((i=t.sent).code!==w.m.File_Max){t.next=8;break}return(0,E.zN)("超过20MB"),t.abrupt("return");case 8:P(i.data),b.xK.set_value_temp(i.data),D({path:r,name:e}),$(r);case 12:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),dt=function(){var t=G(N().mark((function t(e,r,n){var o;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("folder"!==e.type){t.next=7;break}return t.next=3,m.$M.post("studio/get/item",{path:"".concat(n)});case 3:(o=t.sent).code===w.m.Sucess&&r(o.data.list),t.next=12;break;case 7:if(!B){t.next=10;break}return U({open:!0,handle:function(){yt(e.name,n),U({open:!1,handle:null}),W(!1)},title:"确定不保存就切换吗?"}),t.abrupt("return");case 10:return t.next=12,yt(e.name,n);case 12:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function vt(){return mt.apply(this,arguments)}function mt(){return(mt=G(N().mark((function t(){var e;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(B){t.next=2;break}return t.abrupt("return");case 2:return e={context:ft.getValue()},t.next=5,m.$M.post("save/".concat(Y),e);case 5:0===t.sent.code&&W(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),B&&vt())};(0,n.useEffect)((function(){return document.addEventListener("keydown",gt),function(){document.removeEventListener("keydown",gt)}}),[B]);var wt=(0,n.useCallback)(k().throttle((function(t){var e=parseFloat(getComputedStyle(tt.current).fontSize),r=window.innerWidth/e-4,n=t.clientX/e,o=2.25+Z.current.offsetWidth/e;n<=r&&n>=o&&at(parseFloat(n.toFixed(2)))}),32),[]),bt=function(){nt(!1),tt.current.removeEventListener("pointermove",wt)};if(r.folder_path){var xt=[{r:lt("创建文件"),v:"创建文件"},{r:lt("创建目录"),v:"创建目录"},{r:lt("重命名"),v:"重命名"},{r:lt("删除"),v:"删除"}],Et=[{r:lt("重命名"),v:"重命名"},{r:lt("删除"),v:"删除"}],_t=function(t,e,r,n,o){t.preventDefault();var i=new L.i;i.path=r,i.filename=e,i.x=t.clientX,i.y=t.clientY,i.items=n?xt:Et,o===pt&&(i.items=i.items.slice(0,2)),i.type=n?u.Iw.studio_folder:u.Iw.studio_file;var a=function(t){o(t)};i.textClick=function(t){switch(t){case"创建文件":ut({show:!0,type:S.PromptEnum.FileNew,overlay:!0,data:{dir:r,call:a}});break;case"创建目录":ut({show:!0,type:S.PromptEnum.DirNew,overlay:!0,data:{dir:r,call:a}});break;case"删除":if(B&&(I.path===r||I.path.includes(r))){ut({show:!0,type:S.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:function(){a(n),W(!1),D({}),P(""),b.xK.set_value_temp("")}}});break}ut({show:!0,type:S.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:n?function(){a(!0)}:a}});break;case"重命名":ut({show:!0,type:S.PromptEnum.FileRename,overlay:!0,data:{path:r,dir:(0,g.Yp)(r),call:function(){a(!0)},filename:e}})}},ut({show:!0,type:S.PromptEnum.FileMenu,overlay:!1,data:i})};return n.createElement("div",{className:"studio"},n.createElement(c.A,{ignore_tags:!0,left_children:[n.createElement(a.rA,{key:1,title:"取消",icon:"close",onClick:function(){l({}),q({show:!1,path:""}),Q(void 0)}}),n.createElement("title",{key:2},I.name)]},n.createElement(a.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===J?V.show?q({show:!1,path:""}):(q({show:!0,path:(0,g.GG)("file",r.folder_path)}),Q(!1)):Q(!J)}}),B&&n.createElement(a.rA,{title:"保存",icon:"save",onClick:vt})),n.createElement("div",{className:"studio-body",ref:tt},n.createElement("div",{className:"studio-nav",style:{width:"".concat(it-1,"em")},onContextMenu:function(t){_t(t,I.name,(0,g.GG)("file",r.folder_path),!0,pt)}},n.createElement(v,{pre_path:y,list:f,click:dt,handleContextMenu:_t,fatherNowToggleExpansion:pt})),n.createElement("div",{className:"studio__divider",ref:Z,onPointerDown:function(){nt(!0),tt.current.addEventListener("pointermove",wt)},onPointerUp:bt}),rt&&n.createElement("div",{className:"shell__overlay",onPointerUp:bt}),n.createElement("div",{className:"studio-editor",key:I.path},I.name&&n.createElement(O.A,{name:I.name,on_change:function(){B||W(!0)},init:function(t){return ht(t)}}))))}}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[674],{4091:(t,e,r)=>{r.d(e,{A:()=>h});var n=r(6540),o=r(952),i=r.n(o),a=(r(2327),r(1766),r(4854),r(8),r(846),r(975),r(4286),r(766),r(1234),r(4522)),c=r.n(a),u=r(8247);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t,e,r){return(e=function(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t){var e=(0,n.useRef)(null);return(0,n.useEffect)((function(){var r,n=i().edit(e.current,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({value:u.xK.get_value_temp(),showPrintMargin:!1,theme:"ace/theme/cloud9_day",mode:c().getModeForPath(null!==(r=t.name)&&void 0!==r?r:"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14},t.options));return n.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}),n.container.addEventListener("wheel",(function(t){t.preventDefault()})),n.focus(),n.on("change",(function(e){t.on_change&&t.on_change()})),e.current=n,u.xK.set_editor_temp(n),function(){u.xK.set_editor_temp(null),n.destroy()}}),[]),n.createElement("div",{ref:e,style:{height:"100%",width:"100%"}})}r(47),i().config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("modePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("themePath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/")),i().config.set("workerPath","https://cdn.jsdelivr.net/npm/ace-builds@".concat(o.version,"/src-min-noconflict/"))},2674:(t,e,r)=>{r.r(e),r.d(e,{default:()=>C});var n=r(6540),o=r(6417),i=r(7444),a=r(5997),c=r(7952),u=r(7022);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:j(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",d="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function x(){}var E={};f(E,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(F([])));k&&k!==r&&n.call(k,a)&&(E=k);var L=x.prototype=w.prototype=Object.create(E);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=p(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function j(e,r,n){var o=y;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(l(e)+" is not iterable")}return b.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(O.prototype),f(O.prototype,c,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(L),f(L,u,"Generator"),f(L,a,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function f(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function h(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){f(i,n,o,a,c,"next",t)}function c(t){f(i,n,o,a,c,"throw",t)}a(void 0)}))}}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function d(t){var e=p((0,n.useState)(!1),2),r=e[0],o=e[1],i=p((0,n.useState)([]),2),a=i[0],c=i[1],l=function(t){c(t)},f=function(){var e=h(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("folder"!==t.type){e.next=7;break}if(r||!t.click||a){e.next=4;break}return e.next=4,t.click(t,l,t.pre_path);case 4:o(!r),e.next=10;break;case 7:if(!t.click){e.next=10;break}return e.next=10,t.click(t,l,t.pre_path);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=h(s().mark((function e(){var r,n=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.length>0&&void 0!==n[0]&&n[0],"folder"!==t.type||r){e.next=6;break}return e.next=4,t.click(t,l,t.pre_path);case 4:e.next=7;break;case 6:t.fatherNowToggleExpansion&&t.fatherNowToggleExpansion();case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,n.useEffect)((function(){c(t.children)}),[t.children]),n.createElement("div",{className:"studio-item"},n.createElement("div",{onClick:f,onContextMenu:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),t.handleContextMenu&&t.handleContextMenu(e,t.name,t.pre_path,t.type===u.Iw.folder,y)},className:"studio-item-title"},n.createElement("i",{className:"material-icons studio-item-title-tag"},"file"==t.type?"":r?"arrow_drop_down":"arrow_right"),n.createElement("i",{className:"material-icons","file-type":t.type},"folder"===t.type?"folder":"text_snippet"),n.createElement("span",{className:"studio-item-name"},t.name)),r&&a&&n.createElement("div",{style:{marginLeft:20}},a.map((function(e,r){return n.createElement(n.Fragment,{key:r},n.createElement(d,{type:e.type,click:t.click,name:e.name,key:r,children:e.children,pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:y}))}))))}function v(t){return n.createElement("div",null,t.list.map((function(e,r){return n.createElement(d,{pre_path:"".concat(t.pre_path).concat(e.name).concat(e.type===u.Iw.folder?"/":""),key:r,name:e.name,type:e.type,handleContextMenu:t.handleContextMenu,fatherNowToggleExpansion:t.fatherNowToggleExpansion,children:e.children,click:t.click})})))}var m=r(9653),g=r(4289),w=r(3459),b=r(8247),x=r(1499),E=r(2042),_=r(2543),k=r.n(_),L=r(4251),S=r(5421),O=r(2389),j=r(4091);function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function N(){N=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new G(n||[]);return o(a,"_invoke",{value:S(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function w(){}var b={};l(b,a,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(F([])));E&&E!==r&&n.call(E,a)&&(b=E);var _=w.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==P(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function S(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=O(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function O(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function F(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(P(e)+" is not iterable")}return g.prototype=w,o(_,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,u,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},k(L.prototype),l(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(_),l(_,u,"Generator"),l(_,a,(function(){return this})),l(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=F,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:F(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function A(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function G(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){A(i,n,o,a,c,"next",t)}function c(t){A(i,n,o,a,c,"throw",t)}a(void 0)}))}}function F(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C(t){var e=F((0,i.L4)(o.A.studio),2),r=e[0],l=e[1],s=F((0,n.useState)([]),2),f=s[0],h=s[1],p=F((0,n.useState)(""),2),y=p[0],d=p[1],_=F((0,n.useState)(""),2),P=(_[0],_[1]),A=F((0,n.useState)(!1),2),T=(A[0],A[1],F((0,n.useState)("text"),2)),C=(T[0],T[1]),M=F((0,n.useState)({path:"",name:""}),2),I=M[0],D=M[1],K=F((0,n.useState)(""),2),Y=K[0],$=K[1],R=F((0,i.L4)(o.A.confirm),2),U=(R[0],R[1]),z=F((0,n.useState)(!1),2),B=z[0],W=z[1],X=F((0,i.L4)(o.A.fileShellShow),2),V=X[0],q=X[1],H=F((0,i.L4)(o.A.file_shell_hidden),2),J=H[0],Q=H[1],Z=(0,n.useRef)(null),tt=(0,n.useRef)(null),et=F((0,n.useState)(!1),2),rt=et[0],nt=et[1],ot=F((0,n.useState)(16),2),it=ot[0],at=ot[1],ct=F((0,i.L4)(o.A.showPrompt),2),ut=(ct[0],ct[1]),lt=(0,O.Bd)().t,st=F((0,n.useState)(void 0),2),ft=st[0],ht=st[1],pt=function(){var t=G(N().mark((function t(){var e,n;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0,g.GG)("file",r.folder_path),d(e),t.next=4,m.$M.post("studio/get/item",{path:e});case 4:(n=t.sent).code===w.m.Sucess&&h(n.data.list);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();(0,n.useEffect)((function(){P(""),D({}),W(!1),r.folder_path&&pt()}),[r]);var yt=function(){var t=G(N().mark((function t(e,r){var n,o,i;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=null!==(n=(0,x.kr)(e))&&void 0!==n?n:"text",C(o),t.next=4,m.$M.get("".concat(r));case 4:if((i=t.sent).code!==w.m.File_Max){t.next=8;break}return(0,E.zN)("超过20MB"),t.abrupt("return");case 8:P(i.data),b.xK.set_value_temp(i.data),D({path:r,name:e}),$(r);case 12:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),dt=function(){var t=G(N().mark((function t(e,r,n){var o;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("folder"!==e.type){t.next=7;break}return t.next=3,m.$M.post("studio/get/item",{path:"".concat(n)});case 3:(o=t.sent).code===w.m.Sucess&&r(o.data.list),t.next=12;break;case 7:if(!B){t.next=10;break}return U({open:!0,handle:function(){yt(e.name,n),U({open:!1,handle:null}),W(!1)},title:"确定不保存就切换吗?"}),t.abrupt("return");case 10:return t.next=12,yt(e.name,n);case 12:case"end":return t.stop()}}),t)})));return function(e,r,n){return t.apply(this,arguments)}}();function vt(){return mt.apply(this,arguments)}function mt(){return(mt=G(N().mark((function t(){var e;return N().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(B){t.next=2;break}return t.abrupt("return");case 2:return e={context:ft.getValue()},t.next=5,m.$M.post("save/".concat(Y),e);case 5:0===t.sent.code&&W(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var gt=function(t){t.ctrlKey&&"s"===t.key&&(t.preventDefault(),B&&vt())};(0,n.useEffect)((function(){return document.addEventListener("keydown",gt),function(){document.removeEventListener("keydown",gt)}}),[B]);var wt=(0,n.useCallback)(k().throttle((function(t){var e=parseFloat(getComputedStyle(tt.current).fontSize),r=window.innerWidth/e-4,n=t.clientX/e,o=2.25+Z.current.offsetWidth/e;n<=r&&n>=o&&at(parseFloat(n.toFixed(2)))}),32),[]),bt=function(){nt(!1),tt.current.removeEventListener("pointermove",wt)};if(r.folder_path){var xt=[{r:lt("创建文件"),v:"创建文件"},{r:lt("创建目录"),v:"创建目录"},{r:lt("重命名"),v:"重命名"},{r:lt("删除"),v:"删除"}],Et=[{r:lt("重命名"),v:"重命名"},{r:lt("删除"),v:"删除"}],_t=function(t,e,r,n,o){t.preventDefault();var i=new L.i;i.path=r,i.filename=e,i.x=t.clientX,i.y=t.clientY,i.items=n?xt:Et,o===pt&&(i.items=i.items.slice(0,2)),i.type=n?u.Iw.studio_folder:u.Iw.studio_file;var a=function(t){o(t)};i.textClick=function(t){switch(t){case"创建文件":ut({show:!0,type:S.PromptEnum.FileNew,overlay:!0,data:{dir:r,call:a}});break;case"创建目录":ut({show:!0,type:S.PromptEnum.DirNew,overlay:!0,data:{dir:r,call:a}});break;case"删除":if(B&&(I.path===r||I.path.includes(r))){ut({show:!0,type:S.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:function(){a(n),W(!1),D({}),P(""),b.xK.set_value_temp("")}}});break}ut({show:!0,type:S.PromptEnum.FilesDelete,overlay:!0,data:{path:r,call:n?function(){a(!0)}:a}});break;case"重命名":ut({show:!0,type:S.PromptEnum.FileRename,overlay:!0,data:{path:r,dir:(0,g.Yp)(r),call:function(){a(!0)},filename:e}})}},ut({show:!0,type:S.PromptEnum.FileMenu,overlay:!1,data:i})};return n.createElement("div",{className:"studio"},n.createElement(c.A,{ignore_tags:!0,left_children:[n.createElement(a.rA,{key:1,title:"取消",icon:"close",onClick:function(){l({}),q({show:!1,path:""}),Q(void 0)}}),n.createElement("title",{key:2},I.name)]},n.createElement(a.rA,{icon:"terminal",title:"shell",onClick:function(){void 0===J?V.show?q({show:!1,path:""}):(q({show:!0,path:(0,g.GG)("file",r.folder_path)}),Q(!1)):Q(!J)}}),B&&n.createElement(a.rA,{title:"保存",icon:"save",onClick:vt})),n.createElement("div",{className:"studio-body",ref:tt},n.createElement("div",{className:"studio-nav",style:{width:"".concat(it-1,"em")},onContextMenu:function(t){_t(t,I.name,(0,g.GG)("file",r.folder_path),!0,pt)}},n.createElement(v,{pre_path:y,list:f,click:dt,handleContextMenu:_t,fatherNowToggleExpansion:pt})),n.createElement("div",{className:"studio__divider",ref:Z,onPointerDown:function(){nt(!0),tt.current.addEventListener("pointermove",wt)},onPointerUp:bt}),rt&&n.createElement("div",{className:"shell__overlay",onPointerUp:bt}),n.createElement("div",{className:"studio-editor",key:I.path},I.name&&n.createElement(j.A,{name:I.name,on_change:function(){B||W(!0)},init:function(t){return ht(t)}}))))}}}}]);