filecat 1.0.23 → 1.0.25
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/build/dist/34.bundle.js +1 -1
- package/build/dist/421.bundle.js +1 -1
- package/build/dist/502.bundle.js +1 -1
- package/build/dist/623.bundle.js +1 -1
- package/build/dist/665.bundle.js +1 -1
- package/build/dist/734.bundle.js +1 -1
- package/build/dist/826.bundle.js +1 -0
- package/build/dist/943.bundle.js +1 -1
- package/build/dist/977.bundle.js +1 -1
- package/build/dist/bundle.js +1 -1
- package/build/main.js +1 -1
- package/package.json +3 -4
- package/build/dist/854.bundle.js +0 -2
- package/build/dist/854.bundle.js.LICENSE.txt +0 -12
package/build/dist/502.bundle.js
CHANGED
|
@@ -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 w?e:w,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 w(){}function b(){}function x(){}var _={};l(_,a,(function(){return this}));var E=Object.getPrototypeOf,k=E&&E(E(N([])));k&&k!==r&&n.call(k,a)&&(_=k);var L=x.prototype=w.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 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 b.prototype=x,o(L,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=l(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,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 w(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){w(i,n,o,a,c,"next",t)}function c(t){w(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],w=(0,n.useRef)(null),_=x((0,n.useState)(0),2),E=_[0],j=_[1],O=x((0,n.useState)(0),2),I=O[0],C=O[1],N=(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=w.current.scrollTop===w.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?(w.current.insertBefore(a,o),T.unshift(a)):(w.current.appendChild(a),T.push(a)),i&&(w.current.scrollTop=w.current.scrollHeight),a},P=function(t){var e=(0,y.I)(T,(function(e){return e===t}));e&&w.current.removeChild(e)},F=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?w.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])}}},H=function(){var t=b(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,F(r.context_list,r.context_position_list,r.context_start_position_list,k.back),k.back?j(Math.floor(100*parseInt(w.current.children[w.current.children.length-k.context_list.length-1].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)}}(),z=function(){var t=b(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=b(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e=w.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,H();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,H();case 34:S=e.scrollTop,A=!1;case 36:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),w.current.addEventListener("scroll",e),n=function(t){var e=w.current;e&&(t.preventDefault(),t.deltaY>0?e.scrollTop+=20:e.scrollTop-=20)},w.current.addEventListener("wheel",n,{passive:!1}),C(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,H();case 13:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),M=function(){w.current&&w.current.remove(),T=[]};if((0,n.useEffect)((function(){r.show?z():M()}),[r]),(0,n.useEffect)((function(){return function(){M()}}),[]),r.show){var Y=function(){var t=b(m().mark((function t(){var e,r,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=g(T);try{for(e.s();!(r=e.n()).done;)n=r.value,w.current.removeChild(n)}catch(t){e.e(t)}finally{e.f()}return T=[],k.line=L,k.context="",k.context_list=[],k.context_position_list=[],k.context_start_position_list=[],k.back=!1,k.position=Math.floor(k.max_size*(parseInt(I)/100)),t.next=12,H();case 12: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})}})]},"加载进度",E,n.createElement(p.$Z,{max_width:"10rem",placeholder:N("跳转进度"),icon:"percent",value:I,handleInputChange:function(t){C(t)}}),n.createElement(l.rA,{icon:"play_arrow",title:N("跳转进度"),onClick:Y})),n.createElement("div",{style:{height:"100%"}},n.createElement("div",{ref:w,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:()=>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%"}})))}}}}]);
|