filecat 1.0.32 → 1.1.0

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.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 467.bundle.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[467],{8694:(t,e,r)=>{function n(t){return n="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},n(t)}function o(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{$K:()=>s,eq:()=>f,qB:()=>l,vo:()=>h});var l=a((function t(){u(this,t)})),f=function(t){return t[t.tcp=0]="tcp",t[t.udp=1]="udp",t}({}),s=a((function t(){u(this,t),o(this,"open",!1),o(this,"model",f.udp),o(this,"key","")})),h=a((function t(){u(this,t),o(this,"open",!1),o(this,"key","")}))},7481:(t,e,r)=>{r.d(e,{S:()=>a,X:()=>i});var n=r(6540);function o(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 i(t){var e,r,i,a=(r=n.useState([]),i=2,function(t){if(Array.isArray(t))return t}(r)||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}}(r,i)||function(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}(r,i)||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.")}()),c=a[0],u=a[1];return(0,n.useEffect)((function(){t.children?u(Array.isArray(t.children)?t.children:[t.children]):u(t.rows)}),[t.rows,t.children]),n.createElement("table",null,n.createElement("thead",null,n.createElement("tr",null,null===(e=t.headers)||void 0===e?void 0:e.map((function(t,e){return n.createElement("th",{key:e},t)})))),n.createElement("tbody",null,c.map((function(e,r){return n.createElement("tr",{key:r},e.map((function(e,r){var o;return n.createElement("td",{style:{width:null!==(o=t.width)&&void 0!==o?o:"auto"},key:r,className:r===c.length-1?"small":""},e)})))}))))}function a(t){return n.createElement("div",{style:{display:t.isFlex?"flex":"block"}},t.columns.map((function(t,e){return n.createElement("div",{key:e},t)})))}},8467:(t,e,r)=>{r.r(e),r.d(e,{default:()=>P});var n=r(6540),o=r(5725),i=r(9653),a=r(2042),c=r(3459),u=r(447),l=r(3033),f=r(5997),s=r(7481),h=r(8694),p=r(4944),y=r(4238),v=r(2389);function m(t){return m="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},m(t)}function d(){d=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 f(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,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var x={};l(x,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(C([])));L&&L!==r&&n.call(L,a)&&(x=L);var k=E.prototype=b.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==m(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){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 _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){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=I(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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(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=s(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 P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(m(e)+" is not iterable")}return w.prototype=E,o(k,"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(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(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(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"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(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:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function g(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 b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))}}function w(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 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}}(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 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}function x(t){var e=(0,v.Bd)().t,r=w((0,n.useState)(void 0),2),m=r[0],g=r[1],E=w((0,n.useState)(!1),2),x=E[0],S=E[1],L=w((0,n.useState)(!1),2),k=L[0],j=L[1],O=w((0,n.useState)(""),2),_=O[0],I=O[1],P=w((0,n.useState)([e("".concat(e("虚拟"),"ip")),"".concat(e("物理"),"ip"),e("在线状态")]),2),A=P[0],N=(P[1],w((0,n.useState)([]),2)),C=(N[0],N[1]);(0,n.useEffect)((function(){var t=function(){var t=b(d().mark((function t(){var e,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new y.hf(y.HK.vir_net_serverIno_get),t.next=3,p.ws.send(e);case 3:r=t.sent,C(r);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t();var e=function(){var e=b(d().mark((function e(){var r,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i._U.get("vir/server/get");case 2:if((r=e.sent).code===c.m.Sucess){e.next=5;break}return e.abrupt("return");case 5:n=r.data,g(n.port),I(n.key),j(n.model===h.eq.udp),S(n.open),setInterval(t,3e4);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var T=function(){var t=b(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.$K).open=x,e.model=k?h.eq.udp:h.eq.tcp,e.key=_,e.port=parseInt(m),t.next=7,i._U.post("vir/server/save",e);case 7:if(t.sent.code===c.m.Sucess){t.next=11;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 11:(0,a.LW)("保存成功");case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"port",value:m,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:_,handleInputChange:function(t){I(t)}}),n.createElement("form",null,e("状态"),":",n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:x,onchange:function(){S(!x)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!x,onchange:function(){S(!x)}})]})),n.createElement("form",null,e("模式"),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:"tcp".concat(e("流量转发")),selected:!k,onchange:function(){j(!k)}}),n.createElement(l.U6,{value:1,context:"udp".concat(e("点对点")),selected:k,onchange:function(){j(!k)}})]}))),n.createElement(u.Zp,{title:""},n.createElement(s.X,{headers:A,rows:[],width:"10rem"})))))}function S(t){return S="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},S(t)}function L(){L=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 f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",m={};function d(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(C([])));x&&x!==r&&n.call(x,a)&&(w=x);var k=b.prototype=d.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==S(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){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 _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){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=I(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;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,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(S(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,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,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(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(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"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(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,m):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),m},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),m}},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:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function k(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 j(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){k(i,n,o,a,c,"next",t)}function c(t){k(i,n,o,a,c,"throw",t)}a(void 0)}))}}function O(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,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,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,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 I(t){var e=(0,v.Bd)().t,r=O((0,n.useState)(""),2),p=r[0],y=r[1],m=O((0,n.useState)(void 0),2),d=m[0],g=m[1],b=O((0,n.useState)(""),2),w=b[0],E=b[1],x=O((0,n.useState)(void 0),2),S=x[0],k=x[1],_=O((0,n.useState)(!1),2),I=_[0],P=_[1],A=O((0,n.useState)(""),2),N=A[0],C=A[1];(0,n.useEffect)((function(){var t=function(){var t=j(L().mark((function t(){var e,r;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i._U.get("vir/client/get");case 2:if((e=t.sent).code===c.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:r=e.data,k(r.serverPort),E(r.serverIp),y(r.ip),g(r.mask),C(r.key),P(r.open);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()}),[]);var T=function(){var t=j(L().mark((function t(){var e;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.vo).ip=p,e.mask=parseInt(d),e.key=N,e.serverIp=w,e.serverPort=parseInt(S),e.open=I,t.next=9,i._U.post("vir/client/save",e);case 9:if(t.sent.code===c.m.Sucess){t.next=13;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 13:(0,a.LW)("保存成功");case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"ip ",value:p,handleInputChange:function(t){y(t)}}),n.createElement(l.Sm,{placeholder:"mask",value:d,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"ip"),value:w,handleInputChange:function(t){E(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"part"),value:S,handleInputChange:function(t){k(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:N,handleInputChange:function(t){C(t)}}),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:I,onchange:function(){P(!I)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!I,onchange:function(){P(!I)}})]})),n.createElement(u.Zp,{title:""},n.createElement("div",null,"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"),n.createElement("div",null,"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"),n.createElement("div",null,"key:用于验证身份信息并加密的和服务器设置的一样")))))}function P(){var t=(0,v.Bd)().t,e=[{index:2,name:t("服务端"),rto:"server/"},{index:1,name:t("客户端"),rto:"client/"}];return n.createElement(o.W1,{optionList:e},n.createElement(I,null),n.createElement(x,null))}}}]);
2
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[467],{8694:(t,e,r)=>{function n(t){return n="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},n(t)}function o(t,e,r){return(e=c(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function a(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{$K:()=>s,RB:()=>p,eq:()=>f,qB:()=>l,vo:()=>h,vr:()=>y});var l=a((function t(){u(this,t)})),f=function(t){return t[t.tcp=0]="tcp",t[t.udp=1]="udp",t}({}),s=a((function t(){u(this,t),o(this,"open",!1),o(this,"model",f.udp),o(this,"key","")})),h=a((function t(){u(this,t),o(this,"open",!1),o(this,"key","")})),p=function(t){return t[t.row=1]="row",t[t.json=2]="json",t[t.form=3]="form",t}({}),y=a((function t(){u(this,t)}))},7481:(t,e,r)=>{r.d(e,{S:()=>a,X:()=>i});var n=r(6540);function o(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 i(t){var e,r,i,a=(r=n.useState([]),i=2,function(t){if(Array.isArray(t))return t}(r)||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}}(r,i)||function(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}(r,i)||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.")}()),c=a[0],u=a[1];return(0,n.useEffect)((function(){t.children?u(Array.isArray(t.children)?t.children:[t.children]):u(t.rows)}),[t.rows,t.children]),n.createElement("table",null,n.createElement("thead",null,n.createElement("tr",null,null===(e=t.headers)||void 0===e?void 0:e.map((function(t,e){return n.createElement("th",{key:e},t)})))),n.createElement("tbody",null,c.map((function(e,r){return n.createElement("tr",{key:r},e.map((function(e,r){var o;return n.createElement("td",{style:{width:null!==(o=t.width)&&void 0!==o?o:"auto"},key:r,className:r===c.length-1?"small":""},e)})))}))))}function a(t){return n.createElement("div",{style:{display:t.isFlex?"flex":"block"}},t.columns.map((function(t,e){return n.createElement("div",{key:e},t)})))}},8467:(t,e,r)=>{r.r(e),r.d(e,{default:()=>P});var n=r(6540),o=r(5725),i=r(6007),a=r(2042),c=r(3459),u=r(447),l=r(3033),f=r(5997),s=r(7481),h=r(8694),p=r(4944),y=r(4238),v=r(2389);function m(t){return m="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},m(t)}function d(){d=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 f(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,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",g={};function b(){}function w(){}function E(){}var x={};l(x,a,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(C([])));L&&L!==r&&n.call(L,a)&&(x=L);var k=E.prototype=b.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==m(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){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 _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){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=I(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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(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=s(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 P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(m(e)+" is not iterable")}return w.prototype=E,o(k,"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(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(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(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"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(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:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function g(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 b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){g(i,n,o,a,c,"next",t)}function c(t){g(i,n,o,a,c,"throw",t)}a(void 0)}))}}function w(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 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}}(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 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}function x(t){var e=(0,v.Bd)().t,r=w((0,n.useState)(void 0),2),m=r[0],g=r[1],E=w((0,n.useState)(!1),2),x=E[0],S=E[1],L=w((0,n.useState)(!1),2),k=L[0],j=L[1],O=w((0,n.useState)(""),2),_=O[0],I=O[1],P=w((0,n.useState)([e("".concat(e("虚拟"),"ip")),"".concat(e("物理"),"ip"),e("在线状态")]),2),A=P[0],N=(P[1],w((0,n.useState)([]),2)),C=(N[0],N[1]);(0,n.useEffect)((function(){var t=function(){var t=b(d().mark((function t(){var e,r;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new y.hf(y.HK.vir_net_serverIno_get),t.next=3,p.ws.send(e);case 3:r=t.sent,C(r);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t();var e=function(){var e=b(d().mark((function e(){var r,n;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i._U.get("vir/server/get");case 2:if((r=e.sent).code===c.m.Sucess){e.next=5;break}return e.abrupt("return");case 5:n=r.data,g(n.port),I(n.key),j(n.model===h.eq.udp),S(n.open),setInterval(t,3e4);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var T=function(){var t=b(d().mark((function t(){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.$K).open=x,e.model=k?h.eq.udp:h.eq.tcp,e.key=_,e.port=parseInt(m),t.next=7,i._U.post("vir/server/save",e);case 7:if(t.sent.code===c.m.Sucess){t.next=11;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 11:(0,a.LW)("保存成功");case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"port",value:m,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:_,handleInputChange:function(t){I(t)}}),n.createElement("form",null,e("状态"),":",n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:x,onchange:function(){S(!x)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!x,onchange:function(){S(!x)}})]})),n.createElement("form",null,e("模式"),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:"tcp".concat(e("流量转发")),selected:!k,onchange:function(){j(!k)}}),n.createElement(l.U6,{value:1,context:"udp".concat(e("点对点")),selected:k,onchange:function(){j(!k)}})]}))),n.createElement(u.Zp,{title:""},n.createElement(s.X,{headers:A,rows:[],width:"10rem"})))))}function S(t){return S="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},S(t)}function L(){L=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 f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:_(t,r,c)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var h="suspendedStart",p="suspendedYield",y="executing",v="completed",m={};function d(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(C([])));x&&x!==r&&n.call(x,a)&&(w=x);var k=b.prototype=d.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==S(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){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 _(e,r,n){var o=h;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){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=I(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=s(e,r,n);if("normal"===l.type){if(o=n.done?v:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function I(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,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=s(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;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,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,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(S(e)+" is not iterable")}return g.prototype=b,o(k,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,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,b):(t.__proto__=b,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},j(O.prototype),l(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(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"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(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,m):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),m},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),m}},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:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function k(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 j(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){k(i,n,o,a,c,"next",t)}function c(t){k(i,n,o,a,c,"throw",t)}a(void 0)}))}}function O(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,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,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,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 I(t){var e=(0,v.Bd)().t,r=O((0,n.useState)(""),2),p=r[0],y=r[1],m=O((0,n.useState)(void 0),2),d=m[0],g=m[1],b=O((0,n.useState)(""),2),w=b[0],E=b[1],x=O((0,n.useState)(void 0),2),S=x[0],k=x[1],_=O((0,n.useState)(!1),2),I=_[0],P=_[1],A=O((0,n.useState)(""),2),N=A[0],C=A[1];(0,n.useEffect)((function(){var t=function(){var t=j(L().mark((function t(){var e,r;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i._U.get("vir/client/get");case 2:if((e=t.sent).code===c.m.Sucess){t.next=5;break}return t.abrupt("return");case 5:r=e.data,k(r.serverPort),E(r.serverIp),y(r.ip),g(r.mask),C(r.key),P(r.open);case 12:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();t()}),[]);var T=function(){var t=j(L().mark((function t(){var e;return L().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new h.vo).ip=p,e.mask=parseInt(d),e.key=N,e.serverIp=w,e.serverPort=parseInt(S),e.open=I,t.next=9,i._U.post("vir/client/save",e);case 9:if(t.sent.code===c.m.Sucess){t.next=13;break}return(0,a.zN)("网络错误"),t.abrupt("return");case 13:(0,a.LW)("保存成功");case 14:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",null,n.createElement(o.fI,null,n.createElement(o.VP,null,n.createElement(u.Zp,{title:"",rightBottomCom:n.createElement(f.C3,{text:e("保存"),clickFun:T})},n.createElement(l.Sm,{placeholder:"ip ",value:p,handleInputChange:function(t){y(t)}}),n.createElement(l.Sm,{placeholder:"mask",value:d,handleInputChange:function(t){g(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"ip"),value:w,handleInputChange:function(t){E(t)}}),n.createElement(l.Sm,{placeholder:"".concat(e("服务器"),"part"),value:S,handleInputChange:function(t){k(t)}}),n.createElement(l.Sm,{placeholder:"key ",value:N,handleInputChange:function(t){C(t)}}),n.createElement(s.S,{isFlex:!0,columns:[n.createElement(l.U6,{value:1,context:e("开启"),selected:I,onchange:function(){P(!I)}}),n.createElement(l.U6,{value:1,context:e("关闭"),selected:!I,onchange:function(){P(!I)}})]})),n.createElement(u.Zp,{title:""},n.createElement("div",null,"ip: 虚拟ip, “10.0.0.0 - 10.255.255.255”和“172.16.0.0 - 172.31.255.255”和“192.168.0.0 - 192.168.255.255”这三个网段属于内网ip"),n.createElement("div",null,"mask: 一些常见的子网掩码网段/8:255.0.0.0;/16:255.255.0.0 ;/24:255.255.255.0"),n.createElement("div",null,"key:用于验证身份信息并加密的和服务器设置的一样")))))}function P(){var t=(0,v.Bd)().t,e=[{index:2,name:t("服务端"),rto:"server/"},{index:1,name:t("客户端"),rto:"client/"}];return n.createElement(o.W1,{optionList:e},n.createElement(I,null),n.createElement(x,null))}}}]);
@@ -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:()=>N});var n=r(6540),o=r(4238),i=r(4944),a=r(7444),c=r(6417),l=r(7952),u=r(5997),s=r(7022),f=r(4289),h=r(2042),p=r(3033),v=r(2389),y=r(4694),d=r(447);function m(t){return m="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},m(t)}function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=k(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 x(){x=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",l=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new O(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",d={};function g(){}function _(){}function w(){}var b={};u(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=w.prototype=g.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var l=f(t[o],t,i);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==m(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){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(l.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 l=C(c,n);if(l){if(l===d)continue;return l}}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 u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function C(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,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;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,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function I(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 j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,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(m(e)+" is not iterable")}return _.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:_,configurable:!0}),_.displayName=u(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(A.prototype),u(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),u(L,l,"Generator"),u(L,a,(function(){return this})),u(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,O.prototype={constructor:O,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(j),!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 l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)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,d):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),d},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),j(r),d}},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;j(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),d}},e}function _(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).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){_(i,n,o,a,c,"next",t)}function c(t){_(i,n,o,a,c,"throw",t)}a(void 0)}))}}function b(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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||k(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 k(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 L,S=300,A=!1,T=0,C=!0,I=[],j=-1,O=[];function N(t){var e=b((0,a.L4)(c.A.log_viewer),2),r=e[0],m=e[1],_=(0,n.useRef)(null),N=b((0,n.useState)(0),2),H=N[0],z=N[1],G=b((0,n.useState)(100),2),P=G[0],M=G[1],K=b((0,n.useState)(!1),2),F=K[0],D=K[1],Y=b((0,n.useState)(""),2),$=Y[0],q=Y[1],B=b((0,n.useState)(0),2),R=B[0],W=B[1],Z=b((0,n.useState)(0),2),U=Z[0],J=Z[1],Q=b((0,n.useState)(0),2),V=(Q[0],Q[1]),X=(0,v.Bd)().t,tt=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-1===j?i.textContent=t:i.innerHTML=t,i.style.whiteSpace="pre-wrap",i.style.overflowWrap="break-word",i.setAttribute("position","".concat(e)),i.setAttribute("start_position","".concat(r)),n?(_.current.insertBefore(i,o),I.unshift(i)):(_.current.appendChild(i),I.push(i)),i},et=function(t){var e=(0,y.I)(I,(function(e){return e===t}));e&&_.current.removeChild(e)},rt=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=tt(o[a],e[a],r[a],!0,0===a?_.current.firstChild:i);if(I.length>S)for(var c=I.length-1;c>=S;)et(I[I.length-1]),c--}else{for(var l=0;l<o.length;l++)tt(o[l],e[l],r[l]);if(I.length>S)for(var u=I.length-S;u>0;)et(I[0]),u--}}},nt=function(){var t=w(x().mark((function t(){var e,r,n,a,c;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L.context="",t.next=3,i.ws.sendData(o.HK.log_viewer,L);case 3:if(e=t.sent){if(r=e.context,L=r,r.find_back_enter_index&&r.context_list.length>0)for(n=0;n<r.context_list.length;n++)a=new RegExp(r.query_text,"g"),r.context_list[n]=r.context_list[n].replace(a,'<span style="color: blue;">'.concat(r.query_text,"</span>"));L.find_back_enter_index=!1,rt(r.context_list,r.context_position_list,r.context_start_position_list,L.back),L.context_list.length>0&&(L.back&&I.length>0?(L.context_list.length>I.length?z(Math.floor(100*parseInt(I[L.context_list.length-I.length].getAttribute("position"))/L.max_size)):z(Math.floor(100*parseInt(I[I.length-L.context_list.length].getAttribute("position"))/L.max_size)),C=!1):z(Math.floor(100*(null!==(c=L.context_position_list[L.context_position_list.length-1])&&void 0!==c?c:0)/L.max_size))),_.current.clientHeight===_.current.scrollHeight&&ot(L.max_size)}case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ot=function(t){A||(A=!0,z(100),i.ws.addMsg(o.HK.log_viewer_watch,(function(t){var e=t.context;e&&(L=e,rt(e.context_list,e.context_position_list,e.context_start_position_list,!1),_.current.scrollTop=_.current.scrollHeight)})),L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.position=t,i.ws.sendData(o.HK.log_viewer_watch,L),D(!0))},it=function(){var t=w(x().mark((function t(){var e,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){var t=w(x().mark((function t(){var e,r,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=_.current)){t.next=38;break}if(T>e.scrollTop&&A&&(A=!1,i.ws.unConnect(),D(!1)),!A){t.next=6;break}return T=e.scrollTop,t.abrupt("return");case 6:if(!(T<e.scrollTop&&I.length>0&&e.scrollTop+e.clientHeight+500>=e.scrollHeight)){t.next=22;break}if(!((r=parseInt(I[I.length-1].getAttribute("position")))>=L.max_size)){t.next=11;break}return ot(r),t.abrupt("return");case 11:return L.line=20,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.back=!1,L.position=r,t.next=20,nt();case 20:t.next=37;break;case 22:if(!(T>e.scrollTop&&I.length>0&&e.scrollTop-300<=0)){t.next=37;break}if(!((n=parseInt(I[0].getAttribute("start_position")))<=0)){t.next=28;break}return C||(C=!0,(0,h.N9)("到达顶部")),T=e.scrollTop,t.abrupt("return");case 28:return L.line=10,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.back=!0,L.position=n,t.next=37,nt();case 37:T=e.scrollTop;case 38:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_.current.addEventListener("scroll",e),n=function(t){var e=_.current;e&&(t.preventDefault(),t.deltaY>0?e.scrollTop+=20:e.scrollTop-=20)},_.current.addEventListener("wheel",n,{passive:!1}),D(!1),W(0),J(0),q(""),A=!1,V(0),T=0,O=[],j=-1,I=[],(L=new s.d2).line=S,L.path="".concat((0,f.GG)("file",location.pathname)).concat(r.fileName),L.token=localStorage.getItem("token"),t.next=20,nt();case 20:i.ws.addMsg(o.HK.search_file_progress,(function(t){try{W(parseInt(t.context))}catch(t){(0,h.zN)(t.message)}})),i.ws.addMsg(o.HK.search_file_index,(function(t){try{var e;(e=O).push.apply(e,function(t){if(Array.isArray(t))return E(t)}(r=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),V(t.context.length)}catch(t){(0,h.zN)(t.message)}var r}));case 22:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),at=function(){var t=w(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _.current&&_.current.remove(),t.next=3,i.ws.unConnect();case 3:I=[];case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();if((0,n.useEffect)((function(){r.show?it():at()}),[r]),(0,n.useEffect)((function(){return function(){at()}}),[]),r.show){var ct=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=0,t.prev=6,!((e=parseInt(P))>100||e<0)){t.next=11;break}throw(0,h.zN)("范围在0-100"),"超过最大范围";case 11:r=g(I);try{for(r.s();!(n=r.n()).done;)o=n.value,_.current.removeChild(o)}catch(t){r.e(t)}finally{r.f()}I=[],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 L.back=e>=100,L.position=Math.floor(L.max_size*(e/100)),t.next=24,nt();case 24:case"end":return t.stop()}}),t,null,[[6,16]])})));return function(){return t.apply(this,arguments)}}(),lt=function(){var t=w(x().mark((function t(){var e,r,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!A){t.next=2;break}return t.abrupt("return");case 2:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],L.back=!0,L.position=L.max_size,t.next=14,nt();case 14:_.current.scrollTop=_.current.scrollHeight,ot(L.max_size);case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ut=function(){var t=w(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if($){t.next=2;break}return t.abrupt("return");case 2:W(.1),J(0),V(0),j=-1,O=[],L.query_text=$,i.ws.sendData(o.HK.search_file,L);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),st=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],o=j+1>=O.length?0:j+1,J(o+1),j=o,L.find_back_enter_index=!0,L.back=!1,L.position=O[j],t.next=16,nt();case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ft=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],o=j-1<0?O.length-1:j-1,J(o+1),j=o,L.back=!1,L.find_back_enter_index=!0,L.position=O[j],t.next=16,nt();case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",{id:"editor-container"},n.createElement(l.A,{ignore_tags:!0,left_children:[n.createElement(u.rA,{key:1,title:"取消",icon:"close",onClick:function(){m({show:!1})}}),n.createElement("div",{key:2,style:{width:"4rem"}},n.createElement(d.WA,{context:r.fileName})),n.createElement(n.Fragment,{key:3}," ",n.createElement(p.$Z,{handleEnterPress:ut,placeholder:X("回车搜索整个文件"),icon:"search",value:$,handleInputChange:function(t){q(t)},max_width:"25em"})),$&&n.createElement("div",{key:5,style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:st},"↓"),$&&n.createElement("div",{key:6,style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:ft},"↑"),$&&n.createElement("div",{key:7,style:{paddingLeft:"1.5rem"}},U,"/",O.length),$&&n.createElement("div",{key:8,style:{paddingLeft:"1.5rem"}},"搜索进度$",R,"%"),0!==R&&100!==R&&n.createElement(u.rA,{key:4,title:"取消",icon:"cancel",onClick:function(){i.ws.sendData(o.HK.search_file_cancel,{}),q(""),W(0)}})]},F&&n.createElement("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"}},"正在实时监听 "),n.createElement("span",null,"当前加载进度",H),n.createElement(p.$Z,{max_width:"10rem",placeholder:X("跳转进度"),icon:"percent",value:P,handleInputChange:function(t){M(t)}}),n.createElement(u.rA,{icon:"play_arrow",title:X("跳转进度"),onClick:ct}),n.createElement(u.rA,{icon:"text_rotate_vertical",title:X("滑动到文件最底部,实时输出"),onClick:lt})),n.createElement("div",{style:{height:"100%"}},n.createElement("div",{ref:_,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:()=>N});var n=r(6540),o=r(4238),i=r(4944),a=r(7444),c=r(6417),l=r(7952),u=r(5997),s=r(7022),f=r(4289),h=r(2042),p=r(3033),v=r(2389),y=r(4694),d=r(447);function m(t){return m="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},m(t)}function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=k(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 x(){x=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",l=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),c=new O(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",d={};function g(){}function _(){}function w(){}var b={};u(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=w.prototype=g.prototype=Object.create(b);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(o,i,a,c){var l=f(t[o],t,i);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==m(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){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(l.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 l=C(c,n);if(l){if(l===d)continue;return l}}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 u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function C(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,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;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,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function I(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 j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,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(m(e)+" is not iterable")}return _.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:_,configurable:!0}),_.displayName=u(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,l,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},S(A.prototype),u(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),u(L,l,"Generator"),u(L,a,(function(){return this})),u(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,O.prototype={constructor:O,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(j),!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 l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)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,d):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),d},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),j(r),d}},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;j(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),d}},e}function _(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).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){_(i,n,o,a,c,"next",t)}function c(t){_(i,n,o,a,c,"throw",t)}a(void 0)}))}}function b(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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||k(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 k(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 L,S=300,A=!1,T=0,C=!0,I=[],j=-1,O=[];function N(t){var e=b((0,a.L4)(c.A.log_viewer),2),r=e[0],m=e[1],_=(0,n.useRef)(null),N=b((0,n.useState)(0),2),H=N[0],z=N[1],G=b((0,n.useState)(100),2),P=G[0],M=G[1],K=b((0,n.useState)(!1),2),F=K[0],D=K[1],Y=b((0,n.useState)(""),2),$=Y[0],q=Y[1],B=b((0,n.useState)(0),2),R=B[0],W=B[1],Z=b((0,n.useState)(0),2),U=Z[0],X=Z[1],J=b((0,n.useState)(0),2),Q=(J[0],J[1]),V=(0,v.Bd)().t,tt=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-1===j?i.textContent=t:i.innerHTML=t,i.style.whiteSpace="pre-wrap",i.style.overflowWrap="break-word",i.setAttribute("position","".concat(e)),i.setAttribute("start_position","".concat(r)),n?(_.current.insertBefore(i,o),I.unshift(i)):(_.current.appendChild(i),I.push(i)),i},et=function(t){var e=(0,y.I)(I,(function(e){return e===t}));e&&_.current.removeChild(e)},rt=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=tt(o[a],e[a],r[a],!0,0===a?_.current.firstChild:i);if(I.length>S)for(var c=I.length-1;c>=S;)et(I[I.length-1]),c--}else{for(var l=0;l<o.length;l++)tt(o[l],e[l],r[l]);if(I.length>S)for(var u=I.length-S;u>0;)et(I[0]),u--}}},nt=function(){var t=w(x().mark((function t(){var e,r,n,a,c;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L.context="",t.next=3,i.ws.sendData(o.HK.log_viewer,L);case 3:if(e=t.sent){if(r=e.context,L=r,r.find_back_enter_index&&r.context_list.length>0)for(n=0;n<r.context_list.length;n++)a=new RegExp(r.query_text,"g"),r.context_list[n]=r.context_list[n].replace(a,'<span style="color: blue;">'.concat(r.query_text,"</span>"));L.find_back_enter_index=!1,rt(r.context_list,r.context_position_list,r.context_start_position_list,L.back),L.context_list.length>0&&(L.back&&I.length>0?(L.context_list.length>I.length?z(Math.floor(100*parseInt(I[L.context_list.length-I.length].getAttribute("position"))/L.max_size)):z(Math.floor(100*parseInt(I[I.length-L.context_list.length].getAttribute("position"))/L.max_size)),C=!1):z(Math.floor(100*(null!==(c=L.context_position_list[L.context_position_list.length-1])&&void 0!==c?c:0)/L.max_size))),_.current.clientHeight===_.current.scrollHeight&&ot(L.max_size)}case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ot=function(t){A||(A=!0,z(100),i.ws.addMsg(o.HK.log_viewer_watch,(function(t){var e=t.context;e&&(L=e,rt(e.context_list,e.context_position_list,e.context_start_position_list,!1),_.current.scrollTop=_.current.scrollHeight)})),L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.position=t,i.ws.sendData(o.HK.log_viewer_watch,L),D(!0))},it=function(){var t=w(x().mark((function t(){var e,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=function(){var t=w(x().mark((function t(){var e,r,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=_.current)){t.next=38;break}if(T>e.scrollTop&&A&&(A=!1,i.ws.unConnect(),D(!1)),!A){t.next=6;break}return T=e.scrollTop,t.abrupt("return");case 6:if(!(T<e.scrollTop&&I.length>0&&e.scrollTop+e.clientHeight+500>=e.scrollHeight)){t.next=22;break}if(!((r=parseInt(I[I.length-1].getAttribute("position")))>=L.max_size)){t.next=11;break}return ot(r),t.abrupt("return");case 11:return L.line=20,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.back=!1,L.position=r,t.next=20,nt();case 20:t.next=37;break;case 22:if(!(T>e.scrollTop&&I.length>0&&e.scrollTop-300<=0)){t.next=37;break}if(!((n=parseInt(I[0].getAttribute("start_position")))<=0)){t.next=28;break}return C||(C=!0,(0,h.N9)("到达顶部")),T=e.scrollTop,t.abrupt("return");case 28:return L.line=10,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],L.back=!0,L.position=n,t.next=37,nt();case 37:T=e.scrollTop;case 38:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_.current.addEventListener("scroll",e),n=function(t){var e=_.current;e&&(t.preventDefault(),t.deltaY>0?e.scrollTop+=20:e.scrollTop-=20)},_.current.addEventListener("wheel",n,{passive:!1}),D(!1),W(0),X(0),q(""),A=!1,Q(0),T=0,O=[],j=-1,I=[],(L=new s.d2).line=S,L.path="".concat((0,f.GG)("file",(0,f.vX)())).concat(r.fileName),L.token=localStorage.getItem("token"),t.next=20,nt();case 20:i.ws.addMsg(o.HK.search_file_progress,(function(t){try{W(parseInt(t.context))}catch(t){(0,h.zN)(t.message)}})),i.ws.addMsg(o.HK.search_file_index,(function(t){try{var e;(e=O).push.apply(e,function(t){if(Array.isArray(t))return E(t)}(r=t.context)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),Q(t.context.length)}catch(t){(0,h.zN)(t.message)}var r}));case 22:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),at=function(){var t=w(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _.current&&_.current.remove(),t.next=3,i.ws.unConnect();case 3:I=[];case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();if((0,n.useEffect)((function(){r.show?it():at()}),[r]),(0,n.useEffect)((function(){return function(){at()}}),[]),r.show){var ct=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=0,t.prev=6,!((e=parseInt(P))>100||e<0)){t.next=11;break}throw(0,h.zN)("范围在0-100"),"超过最大范围";case 11:r=g(I);try{for(r.s();!(n=r.n()).done;)o=n.value,_.current.removeChild(o)}catch(t){r.e(t)}finally{r.f()}I=[],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 L.back=e>=100,L.position=Math.floor(L.max_size*(e/100)),t.next=24,nt();case 24:case"end":return t.stop()}}),t,null,[[6,16]])})));return function(){return t.apply(this,arguments)}}(),lt=function(){var t=w(x().mark((function t(){var e,r,n;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!A){t.next=2;break}return t.abrupt("return");case 2:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],L.back=!0,L.position=L.max_size,t.next=14,nt();case 14:_.current.scrollTop=_.current.scrollHeight,ot(L.max_size);case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ut=function(){var t=w(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if($){t.next=2;break}return t.abrupt("return");case 2:W(.1),X(0),Q(0),j=-1,O=[],L.query_text=$,i.ws.sendData(o.HK.search_file,L);case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),st=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],o=j+1>=O.length?0:j+1,X(o+1),j=o,L.find_back_enter_index=!0,L.back=!1,L.position=O[j],t.next=16,nt();case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ft=function(){var t=w(x().mark((function t(){var e,r,n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:L.line=S,L.context="",L.context_list=[],L.context_position_list=[],L.context_start_position_list=[],e=g(I);try{for(e.s();!(r=e.n()).done;)n=r.value,_.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return I=[],o=j-1<0?O.length-1:j-1,X(o+1),j=o,L.back=!1,L.find_back_enter_index=!0,L.position=O[j],t.next=16,nt();case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return n.createElement("div",{id:"editor-container"},n.createElement(l.A,{ignore_tags:!0,left_children:[n.createElement(u.rA,{key:1,title:"取消",icon:"close",onClick:function(){m({show:!1})}}),n.createElement("div",{key:2,style:{width:"4rem"}},n.createElement(d.WA,{context:r.fileName})),n.createElement(n.Fragment,{key:3}," ",n.createElement(p.$Z,{handleEnterPress:ut,placeholder:V("回车搜索整个文件"),icon:"search",value:$,handleInputChange:function(t){q(t)},max_width:"25em"})),$&&n.createElement("div",{key:5,style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:st},"↓"),$&&n.createElement("div",{key:6,style:{paddingLeft:"1.5rem",cursor:"pointer"},onClick:ft},"↑"),$&&n.createElement("div",{key:7,style:{paddingLeft:"1.5rem"}},U,"/",O.length),$&&n.createElement("div",{key:8,style:{paddingLeft:"1.5rem"}},"搜索进度$",R,"%"),0!==R&&100!==R&&n.createElement(u.rA,{key:4,title:"取消",icon:"cancel",onClick:function(){i.ws.sendData(o.HK.search_file_cancel,{}),q(""),W(0)}})]},F&&n.createElement("span",{style:{color:"var(--icon-green)",whiteSpace:"pre"}},"正在实时监听 "),n.createElement("span",null,"当前加载进度",H),n.createElement(p.$Z,{max_width:"10rem",placeholder:V("跳转进度"),icon:"percent",value:P,handleInputChange:function(t){M(t)}}),n.createElement(u.rA,{icon:"play_arrow",title:V("跳转进度"),onClick:ct}),n.createElement(u.rA,{icon:"text_rotate_vertical",title:V("滑动到文件最底部,实时输出"),onClick:lt})),n.createElement("div",{style:{height:"100%"}},n.createElement("div",{ref:_,style:{overflowY:"auto",height:"100%"}})))}}}}]);