diff --git a/logs/update.log b/logs/update.log index c6ba64a2..cb4894d9 100644 --- a/logs/update.log +++ b/logs/update.log @@ -1,5 +1,8 @@ elecV2P 重要更新日志: (最新版本 v3.8.1) +v3.8.2 2024-12-14 + • Docker基础node版本固定到22.12.0 + v3.8.1 2024-11-10 • 前端打包配置文件修复 • 增加脚本运行环境的兼容性 diff --git a/package.json b/package.json index be1f6bf2..10776979 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "elecV2P", - "version": "3.8.1", + "version": "3.8.2", "description": "customize personal network", "main": "index.js", "author": "https://github.com/elecV2", diff --git a/utils/eproxy.js b/utils/eproxy.js index 22f8d24b..2efe55b8 100644 --- a/utils/eproxy.js +++ b/utils/eproxy.js @@ -14,7 +14,7 @@ class eproxy { }, // throttle: 1000, // 限速: k/s forceProxyHttps: false, - wsIntercept: false, + wsIntercept: true, silent: false } diff --git a/web/dist/efss/index.d55513c7ed071bdb7183.js b/web/dist/efss/index.6770dbcb1ce2d68e302b.js similarity index 99% rename from web/dist/efss/index.d55513c7ed071bdb7183.js rename to web/dist/efss/index.6770dbcb1ce2d68e302b.js index 54cad430..f05ead26 100644 --- a/web/dist/efss/index.d55513c7ed071bdb7183.js +++ b/web/dist/efss/index.6770dbcb1ce2d68e302b.js @@ -4,4 +4,4 @@ * (c) 2014-2023 Evan You * Released under the MIT License. */ -var s=Object.freeze({}),i=Array.isArray;function o(e){return null==e}function a(e){return null!=e}function c(e){return!0===e}function l(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return"function"==typeof e}function f(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function h(e){return"[object RegExp]"===d.call(e)}function m(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,y,2):String(e)}function y(e,t){return t&&t.__v_isRef?t.value:t}function b(e){var t=parseFloat(e);return isNaN(t)?e:t}function _(e,t){for(var n=Object.create(null),r=e.split(","),s=0;s-1)return e.splice(r,1)}}var C=Object.prototype.hasOwnProperty;function x(e,t){return C.call(e,t)}function $(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var S=/-(\w)/g,E=$((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),O=$((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,A=$((function(e){return e.replace(T,"-$1").toLowerCase()}));var R=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function N(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function P(e,t){for(var n in t)e[n]=t[n];return e}function D(e){for(var t={},n=0;n0,te=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var ne=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var re,se=Y&&Y.match(/firefox\/(\d+)/),ie={}.watch,oe=!1;if(Z)try{var ae={};Object.defineProperty(ae,"passive",{get:function(){oe=!0}}),window.addEventListener("test-passive",null,ae)}catch(e){}var ce=function(){return void 0===re&&(re=!Z&&void 0!==n.g&&(n.g.process&&"server"===n.g.process.env.VUE_ENV)),re},le=Z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ue(e){return"function"==typeof e&&/native code/.test(e.toString())}var fe,de="undefined"!=typeof Symbol&&ue(Symbol)&&"undefined"!=typeof Reflect&&ue(Reflect.ownKeys);fe="undefined"!=typeof Set&&ue(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var pe=null;function he(e){void 0===e&&(e=null),e||pe&&pe._scope.off(),pe=e,e&&e._scope.on()}var me=function(){function e(e,t,n,r,s,i,o,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=s,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new me;return t.text=e,t.isComment=!0,t};function ge(e){return new me(void 0,void 0,void 0,String(e))}function ye(e){var t=new me(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var be=0,_e=[],we=function(){function e(){this._pending=!1,this.id=be++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,_e.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,r=t.length;n0&&(Qe((r=et(r,"".concat(t||"","_").concat(n)))[0])&&Qe(u)&&(f[s]=ge(u.text+r[0].text),r.shift()),f.push.apply(f,r)):l(r)?Qe(u)?f[s]=ge(u.text+r):""!==r&&f.push(ge(r)):Qe(r)&&Qe(u)?f[s]=ge(u.text+r.text):(c(e._isVList)&&a(r.tag)&&o(r.key)&&a(t)&&(r.key="__vlist".concat(t,"_").concat(n,"__")),f.push(r)));return f}function tt(e,t){var n,r,s,o,c=null;if(i(e)||"string"==typeof e)for(c=new Array(e.length),n=0,r=e.length;n0,a=t?!!t.$stable:!o,c=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==s&&c===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=_t(e,n,l,t[l]))}else i={};for(var u in n)u in i||(i[u]=wt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),G(i,"$stable",a),G(i,"$key",c),G(i,"$hasNormal",o),i}function _t(e,t,n,r){var s=function(){var t=pe;he(e);var n=arguments.length?r.apply(null,arguments):r({}),s=(n=n&&"object"==typeof n&&!i(n)?[n]:Ye(n))&&n[0];return he(t),n&&(!s||1===n.length&&s.isComment&&!yt(s))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:s,enumerable:!0,configurable:!0}),s}function wt(e,t){return function(){return e[t]}}function kt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};G(t,"_v_attr_proxy",!0),Ct(t,e.$attrs,s,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||Ct(e._listenersProxy={},e.$listeners,s,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||$t(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:R(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Ue(e,t,n)}))}}}function Ct(e,t,n,r,s){var i=!1;for(var o in t)o in e?t[o]!==n[o]&&(i=!0):(i=!0,xt(e,o,r,s));for(var o in e)o in t||(i=!0,delete e[o]);return i}function xt(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function $t(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var St=null;function Et(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),f(e)?t.extend(e):e}function Ot(e){if(i(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(yn=function(){return bn.now()})}var _n=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function wn(){var e,t;for(gn=yn(),mn=!0,fn.sort(_n),vn=0;vnvn&&fn[n].id>e.id;)n--;fn.splice(n+1,0,e)}else fn.push(e);hn||(hn=!0,qt(wn))}}function Cn(e,t){if(e){for(var n=Object.create(null),r=de?Reflect.ownKeys(e):Object.keys(e),s=0;s-1)if(i&&!x(s,"default"))o=!1;else if(""===o||o===A(e)){var c=Kn(String,s.type);(c<0||a-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!h(e)&&e.test(t)}function or(e,t){var n=e.cache,r=e.keys,s=e._vnode,i=e.$vnode;for(var o in n){var a=n[o];if(a){var c=a.name;c&&!t(c)&&ar(n,o,r,s)}}i.componentOptions.children=void 0}function ar(e,t,n,r){var s=e[t];!s||r&&s.tag===r.tag||s.componentInstance.$destroy(),e[t]=null,k(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=er++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ke(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var s=r.componentOptions;n.propsData=s.propsData,n._parentListeners=s.listeners,n._renderChildren=s.children,n._componentTag=s.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=zn(tr(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&rn(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=vt(t._renderChildren,r),e.$scopedSlots=n?bt(e.$parent,n.data.scopedSlots,e.$slots):s,e._c=function(t,n,r,s){return Rt(e,t,n,r,s,!1)},e.$createElement=function(t,n,r,s){return Rt(e,t,n,r,s,!0)};var i=n&&n.data;De(e,"$attrs",i&&i.attrs||s,null,!0),De(e,"$listeners",t._parentListeners||s,null,!0)}(t),un(t,"beforeCreate",void 0,!1),function(e){var t=Cn(e.$options.inject,e);t&&(Ae(!1),Object.keys(t).forEach((function(n){De(e,n,t[n])})),Ae(!0))}(t),Gn(t),function(e){var t=e.$options.provide;if(t){var n=u(t)?t.call(e):t;if(!f(n))return;for(var r=qe(e),s=de?Reflect.ownKeys(n):Object.keys(n),i=0;i1?N(n):n;for(var r=N(arguments,1),s='event handler for "'.concat(e,'"'),i=0,o=n.length;iparseInt(this.max)&&ar(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ar(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){or(e,(function(e){return ir(t,e)}))})),this.$watch("exclude",(function(t){or(e,(function(e){return!ir(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ot(e),n=t&&t.componentOptions;if(n){var r=sr(n),s=this.include,i=this.exclude;if(s&&(!r||!ir(s,r))||i&&r&&ir(i,r))return t;var o=this.cache,a=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;o[c]?(t.componentInstance=o[c].componentInstance,k(a,c),a.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}},ur={KeepAlive:lr};!function(e){var t={get:function(){return K}};Object.defineProperty(e,"config",t),e.util={warn:Nn,extend:P,mergeOptions:zn,defineReactive:De},e.set=je,e.delete=Me,e.nextTick=qt,e.observable=function(e){return Pe(e),e},e.options=Object.create(null),H.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,P(e.options.components,ur),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=N(arguments,1);return n.unshift(this),u(e.install)?e.install.apply(e,n):u(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=zn(this.options,e),this}}(e),rr(e),function(e){H.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&u(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(nr),Object.defineProperty(nr.prototype,"$isServer",{get:ce}),Object.defineProperty(nr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(nr,"FunctionalRenderContext",{value:xn}),nr.version="2.7.16";var fr=_("style,class"),dr=_("input,textarea,option,select,progress"),pr=_("contenteditable,draggable,spellcheck"),hr=_("events,caret,typing,plaintext-only"),mr=_("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),vr="http://www.w3.org/1999/xlink",gr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},yr=function(e){return gr(e)?e.slice(6,e.length):""},br=function(e){return null==e||!1===e};function _r(e){for(var t=e.data,n=e,r=e;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=wr(r.data,t));for(;a(n=n.parent);)n&&n.data&&(t=wr(t,n.data));return function(e,t){if(a(e)||a(t))return kr(e,Cr(t));return""}(t.staticClass,t.class)}function wr(e,t){return{staticClass:kr(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function kr(e,t){return e?t?e+" "+t:e:t||""}function Cr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,s=e.length;r-1?Wr(e,t,n):mr(t)?br(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):pr(t)?e.setAttribute(t,function(e,t){return br(t)||"false"===t?"false":"contenteditable"===e&&hr(t)?t:"true"}(t,n)):gr(t)?br(n)?e.removeAttributeNS(vr,yr(t)):e.setAttributeNS(vr,t,n):Wr(e,t,n)}function Wr(e,t,n){if(br(n))e.removeAttribute(t);else{if(Q&&!ee&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Gr={create:Kr,update:Kr};function Jr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var i=_r(t),c=n._transitionClasses;a(c)&&(i=kr(i,Cr(c))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var Xr,Zr={create:Jr,update:Jr},Yr="__r",Qr="__c";function es(e,t,n){var r=Xr;return function s(){null!==t.apply(null,arguments)&&rs(e,s,n,r)}}var ts=It&&!(se&&Number(se[1])<=53);function ns(e,t,n,r){if(ts){var s=gn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=s||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Xr.addEventListener(e,t,oe?{capture:n,passive:r}:n)}function rs(e,t,n,r){(r||Xr).removeEventListener(e,t._wrapper||t,n)}function ss(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Xr=t.elm||e.elm,function(e){if(a(e[Yr])){var t=Q?"change":"input";e[t]=[].concat(e[Yr],e[t]||[]),delete e[Yr]}a(e[Qr])&&(e.change=[].concat(e[Qr],e.change||[]),delete e[Qr])}(n),Je(n,r,ns,rs,es,t.context),Xr=void 0}}var is,os={create:ss,update:ss,destroy:function(e){return ss(e,Dr)}};function as(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,s=t.elm,i=e.data.domProps||{},l=t.data.domProps||{};for(n in(a(l.__ob__)||c(l._v_attr_proxy))&&(l=t.data.domProps=P({},l)),i)n in l||(s[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===i[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=r;var u=o(r)?"":String(r);cs(s,u)&&(s.value=u)}else if("innerHTML"===n&&Sr(s.tagName)&&o(s.innerHTML)){(is=is||document.createElement("div")).innerHTML="".concat(r,"");for(var f=is.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;f.firstChild;)s.appendChild(f.firstChild)}else if(r!==i[n])try{s[n]=r}catch(e){}}}}function cs(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return b(n)!==b(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var ls={create:as,update:as},us=$((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function fs(e){var t=ds(e.style);return e.staticStyle?P(e.staticStyle,t):t}function ds(e){return Array.isArray(e)?D(e):"string"==typeof e?us(e):e}var ps,hs=/^--/,ms=/\s*!important$/,vs=function(e,t,n){if(hs.test(t))e.style.setProperty(t,n);else if(ms.test(n))e.style.setProperty(A(t),n.replace(ms,""),"important");else{var r=ys(t);if(Array.isArray(n))for(var s=0,i=n.length;s-1?t.split(ws).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Cs(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ws).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function xs(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&P(t,$s(e.name||"v")),P(t,e),t}return"string"==typeof e?$s(e):void 0}}var $s=$((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Ss=Z&&!ee,Es="transition",Os="animation",Ts="transition",As="transitionend",Rs="animation",Ns="animationend";Ss&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ts="WebkitTransition",As="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Rs="WebkitAnimation",Ns="webkitAnimationEnd"));var Ps=Z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ds(e){Ps((function(){Ps(e)}))}function js(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ks(e,t))}function Ms(e,t){e._transitionClasses&&k(e._transitionClasses,t),Cs(e,t)}function Ls(e,t,n){var r=zs(e,t),s=r.type,i=r.timeout,o=r.propCount;if(!s)return n();var a=s===Es?As:Ns,c=0,l=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++c>=o&&l()};setTimeout((function(){c0&&(n=Es,u=o,f=i.length):t===Os?l>0&&(n=Os,u=l,f=c.length):f=(n=(u=Math.max(o,l))>0?o>l?Es:Os:null)?n===Es?i.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:n===Es&&Is.test(r[Ts+"Property"])}}function Fs(e,t){for(;e.length1}function qs(e,t){!0!==t.data.show&&Us(t)}var Ws=function(e){var t,n,r={},s=e.modules,u=e.nodeOps;for(t=0;th?b(e,o(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&k(t,f,h)}(f,m,g,n,l):a(g)?(a(e.text)&&u.setTextContent(f,""),b(f,null,g,0,g.length-1,n)):a(m)?k(m,0,m.length-1):a(e.text)&&u.setTextContent(f,""):e.text!==t.text&&u.setTextContent(f,t.text),a(h)&&a(p=h.hook)&&a(p=p.postpatch)&&p(e,t)}}}function S(e,t,n){if(c(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,o.selected!==i&&(o.selected=i);else if(I(Ys(o),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));s||(e.selectedIndex=-1)}}function Zs(e,t){return t.every((function(t){return!I(t,e)}))}function Ys(e){return"_value"in e?e._value:e.value}function Qs(e){e.target.composing=!0}function ei(e){e.target.composing&&(e.target.composing=!1,ti(e.target,"input"))}function ti(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ni(e){return!e.componentInstance||e.data&&e.data.transition?e:ni(e.componentInstance._vnode)}var ri={bind:function(e,t,n){var r=t.value,s=(n=ni(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&s?(n.data.show=!0,Us(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=ni(n)).data&&n.data.transition?(n.data.show=!0,r?Us(n,(function(){e.style.display=e.__vOriginalDisplay})):Hs(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,s){s||(e.style.display=e.__vOriginalDisplay)}},si={model:Gs,show:ri},ii={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function oi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?oi(Ot(t.children)):e}function ai(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var s=n._parentListeners;for(var r in s)t[E(r)]=s[r];return t}function ci(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var li=function(e){return e.tag||yt(e)},ui=function(e){return"show"===e.name},fi={name:"transition",props:ii,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(li)).length){0;var r=this.mode;0;var s=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return s;var i=oi(s);if(!i)return s;if(this._leaving)return ci(e,s);var o="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?o+"comment":o+i.tag:l(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var a=(i.data||(i.data={})).transition=ai(this),c=this._vnode,u=oi(c);if(i.data.directives&&i.data.directives.some(ui)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!yt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=P({},a);if("out-in"===r)return this._leaving=!0,Xe(f,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ci(e,s);if("in-out"===r){if(yt(i))return c;var d,p=function(){d()};Xe(a,"afterEnter",p),Xe(a,"enterCancelled",p),Xe(f,"delayLeave",(function(e){d=e}))}}return s}}},di=P({tag:String,moveClass:String},ii);delete di.mode;var pi={props:di,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var s=on(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,s(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,s=this.$slots.default||[],i=this.children=[],o=ai(this),a=0;a-1?Or[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Or[e]=/HTMLUnknownElement/.test(t.toString())},P(nr.options.directives,si),P(nr.options.components,gi),nr.prototype.__patch__=Z?Ws:j,nr.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=ve),un(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Qt(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&un(e,"beforeUpdate")}},!0),n=!1;var s=e._preWatchers;if(s)for(var i=0;i1,expression:"filecheck.length>1"}],staticClass:"elecBtn elecBtn--file elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.zipFiles()}}},[e._v("ZIP打包")]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.fileop.name,expression:"fileop.name"}],staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.operateFiles()}}},[e._v("粘贴")]),e._v(" "),t("button",{staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.copyFiles()}}},[e._v("复制")]),e._v(" "),t("button",{staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.moveFiles()}}},[e._v("剪切")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.deltFiles()}}},[e._v("删除")])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.collapse.titlearrow,expression:"collapse.titlearrow"}],staticClass:"efssupload"},[t("div",{staticClass:"eflex w100 eflex--between",attrs:{title:"远程文件链接 -rename=文件名"}},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.filedownloadurl,expression:"filedownloadurl",modifiers:{trim:!0}}],staticClass:"elecTable_input wp80",attrs:{type:"text",placeholder:"远程文件链接 -rename=xxx.xx"},domProps:{value:e.filedownloadurl},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.fileDownload()},input:function(t){t.target.composing||(e.filedownloadurl=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn wp19",attrs:{title:"远程文件下载到服务器"},on:{click:function(t){return e.fileDownload()}}},[e._v("开始下载")])]),e._v(" "),t("div",{staticClass:"eflex w100 eflex--between emargin--top"},[t("div",{staticClass:"eupload w80"},[t("input",{ref:"efssfiles",staticClass:"eupload_file",attrs:{type:"file",name:"efss",multiple:""},on:{change:e.nUpload}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.upflists.length,expression:"upflists.length"}],staticClass:"eupload_span"},[e._v(e._s(e.efssfilesname))])]),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:e.eUpload}},[e._v("开始上传")])])]),e._v(" "),t("ul",{staticClass:"efsslist_content",on:{contextmenu:function(t){return t.preventDefault(),e.eMenu(t)},click:function(t){return e.fileOpdelegate(t)},keydown:function(t){return(t.type.indexOf("key")||65===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.fileMCheck("all")):null},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.fileMCheck("none"))}}},e._l(e.showlist,(function(n,r){return t("li",{key:n.name,staticClass:"efssa",class:{"efssa--directory":"directory"===n.type}},["file"===n.type?t("div",{staticClass:"efssa_check"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.filecheck,expression:"filecheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:n.name,checked:Array.isArray(e.filecheck)?e._i(e.filecheck,n.name)>-1:e.filecheck},on:{change:function(t){var r=e.filecheck,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=n.name,a=e._i(r,o);s.checked?a<0&&(e.filecheck=r.concat([o])):a>-1&&(e.filecheck=r.slice(0,a).concat(r.slice(a+1)))}else e.filecheck=i}}})]):e._e(),e._v(" "),t("span",{staticClass:"efssa_name",attrs:{"data-op":"open","data-type":n.type,"data-index":n.index,"data-name":n.name,"data-size":n.size}},[e._v(e._s(n.name))]),e._v(" "),t("span",{staticClass:"efssa_mtime",attrs:{"data-op":"mkdir"}},[e._v(e._s(e.$sTime(n.mtime)))]),e._v(" "),t("div",{staticClass:"efssa_last"},[t("span",{staticClass:"efssa_delete",attrs:{"data-op":"del","data-type":n.type,"data-index":n.index,"data-name":n.name}},[e._v("❌")]),e._v(" "),t("span",{staticClass:"efssa_span"},[e._v(e._s(n.size||(n.list?n.list.length:"")))])])])})),0)])],1)};yi._withStripped=!0;var bi=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.bShow,expression:"bShow"}],staticClass:"codeditor",class:{"codeditor--collapsed":e.collapse,"codeditor--full":e.fullscreen},style:"transform: translate("+e.tranposi[0]+"px, "+e.tranposi[1]+"px);",attrs:{draggable:e.collapse},on:{keydown:function(t){return t.type.indexOf("key")||122===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.fullscreen=!e.fullscreen)):null},dragstart:function(t){return e.dragStart(t)},dragend:function(t){return e.dragEnd(t)}}},[t("h3",{staticClass:"title title--editview"},[t("span",{staticClass:"title_close",attrs:{title:"alt+w"},on:{click:function(t){t.preventDefault(),e.bShow=!1}}},[e._v("X")]),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"按 F2 或双击可修改文件名(原文件将保留)"},on:{dblclick:function(t){return t.preventDefault(),e.nameChange()}}},[e._v(e._s(e.curtfile.path)+"/"+e._s(e.curtfile.name))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){t.preventDefault(),e.tranposi=[0,0],e.collapse=!e.collapse}}})]),e._v(" "),t("div",{staticClass:"codeditor_toolbar"},[t("ul",{staticClass:"codeditor_menu eflex"},[t("li",{staticClass:"toolbar_item"},[t("label",[e._v("自动换行")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"autoWrap"},on:{change:function(t){return e.autoWrap(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("行线显示")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"offUnder"},on:{change:function(t){return e.offUnder(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_separate"}),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("显示不可见字符")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"showInvi"},on:{change:function(t){return e.showInvi(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("Tab 宽度")]),e._v(" "),t("select",{staticClass:"elecTable_select toolbar_select",on:{change:function(t){return e.tabResize(t)}}},[t("option",{attrs:{value:"4"}},[e._v("4 个空格")]),e._v(" "),t("option",{attrs:{value:"2"}},[e._v("2 个空格")])])]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("使用空格代替 Tab")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"softTabs"},on:{change:function(t){return e.softTabs(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_separate"}),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("只读模式")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{type:"checkbox",name:"readOnly"},on:{change:function(t){return e.readOnly(t)}}})]),e._v(" "),"hex"===e.curtfile.mode?t("li",{attrs:{title:"尝试将当前内容转化为文本"}},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.hexstrToggle()}}},[e._v("文本模式")])]):e._e(),e._v(" "),t("li",{staticClass:"toolbar_item",attrs:{title:"在新标签页中查看该文件"}},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.fileView()}}},[e._v("查看源文件")])]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.moreSet()}}},[e._v("更多设置")])]),e._v(" "),t("li",{staticClass:"toolbar_item toolbar_item--mergebtn",attrs:{title:"仅在 https 环境下有效"}},[t("span",{staticClass:"toolbar_mergebtn",on:{click:function(t){return e.editor.selectAll()}}},[e._v("全选")]),e._v(" "),t("span",{staticClass:"toolbar_copy",on:{click:function(t){return e.copySelection()}}},[e._v("复制")]),e._v(" "),t("span",{staticClass:"toolbar_mergebtn",on:{click:function(t){return e.pasteSelection()}}},[e._v("粘贴")])])])]),e._v(" "),t("div",{attrs:{id:"aceditor"},on:{keydown:[function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.save()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.fileView()):null},function(t){return(t.type.indexOf("key")||87===t.keyCode)&&t.altKey?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.metaKey?null:void(e.bShow=!1)):null}],keyup:function(t){return t.type.indexOf("key")||113===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.nameChange()):null}}},[e._v("elecV2P editor")]),e._v(" "),t("div",{staticClass:"codeditor_button center"},[t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),e.save()}}},[e._v("保存(Ctrl+S)")]),e._v(" "),t("ul",{directives:[{name:"show",rawName:"v-show",value:e.tipshow,expression:"tipshow"}],staticClass:"codeditor_tip",on:{click:function(t){t.preventDefault(),e.tipshow=!e.tipshow}}},[t("li",[e._v("f2: 重命名文件 f11: 全屏")]),e._v(" "),t("li",[e._v("alt+enter: 新标签页中查看该文件")])])])])};bi._withStripped=!0;const _i={name:"editor",props:["file"],data:()=>({curtfile:{burl:"",name:"",path:"",mode:"string"},bShow:!1,editor:null,modelist:null,collapse:!1,tipshow:!0,fullscreen:!1,tranposi:[0,0],dragposi:[0,0]}),mounted(){window.onload=()=>{ace?(this.editor=ace.edit("aceditor",{wrap:!0,fontSize:20,showInvisibles:!0,indentedSoftWrap:!1}),this.modelist=ace.require("ace/ext/modelist"),document.querySelector(".codeditor").addEventListener("transitionend",(()=>{this.editor.resize()}))):this.$message.error("ace editor not ready yet")}},watch:{"file.start":function(e){e&&(this.fileOpen().catch((e=>{this.$message.error("编辑文件",this.file.name,`失败 ${e.message}\n文件已在新标签页打开`),this.$uApi.open(this.file.burl+this.file.name),console.error("编辑文件",this.file.name,"失败",e)})),this.file.start=!1)}},methods:{nameChange(){let e=prompt("新的文件名(不包含路径)",this.curtfile.name);if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void this.$message.error("文件名中保存特殊字符,请修改后重试");this.curtfile.name=e,this.$message.success("文件名修改成功"),this.editor.focus()}},async fileOpen(){if(!this.editor)return void this.$message.error("编辑器暂时不可用,请稍等...,或尝试刷新页面");if(!this.file.name||!this.file.path)return void this.$message.error("没有获取到可编辑的文件信息");let e=this.file.name,t=this.file.burl,n="",r=this.modelist.getModeForPath(e),s=r.name,i=r.mode,o="text"===s&&!/\.txt$/.test(e);if(!o||confirm(e+" 可能并不是文本文件\n点击确定-使用文本编辑器打开\n点击取消-在新标签页面中打开")){if("url"===this.file.start){if(!/^https?:\/\/\S{4}/.test(t))return void this.$message.error("远程链接错误,无法获取文件内容",t+e);let r=this.$message.loading("正在加载",e,"文件内容...",0);try{n=await this.$axios.get(t+e,{responseType:"arraybuffer"}).then((e=>o?(this.curtfile.mode="hex",this.$uStr.bufferToHex(e.data)):(this.curtfile.mode="string",(new TextDecoder).decode(e.data)))),r(),this.curtfile.burl=t,this.$message.success(e,"文件内容加载成功")}catch(t){return r(),this.$message.error("无法加载",e,"文件内容",t.message),void console.error("无法加载",e,"文件内容",t)}}else{if("new"!==this.file.start)return void this.$message.error("未知指令",this.file.start,"无法打开文本编辑器");this.$message.success("新建文件",e),this.curtfile.burl=this.file.burl,n=this.file.content||"欢迎使用 elecV2P 文本文件编辑器\n\nctrl+a 全选\nctrl+s保存"}this.editor.session.setMode(i),console.debug("elecV2P editor current mode",s),"string"!==this.$sType(n)&&(this.$message.error("获取文件内容并非文本格式,已强制进行转换"),n=this.$sString(n)),this.bShow=!0,this.tranposi=[0,0],this.collapse=!1,this.curtfile.path=this.file.path,this.curtfile.name=e,this.editor.session.setValue(n),this.editor.focus()}else this.$uApi.open(this.file.burl+this.file.name)},fileView(){/^https?:\/\/\S{4}/.test(this.curtfile.burl)?this.$uApi.open(this.curtfile.burl+this.curtfile.name):this.$message.error("暂时无法获取该文件的远程查看链接")},autoWrap(e){this.editor.session.setUseWrapMode(e.target.checked),this.editor.focus()},offUnder(e){e.target.checked?document.querySelector(".ace_content").classList.remove("underoff"):document.querySelector(".ace_content").classList.add("underoff"),this.editor.focus()},readOnly(e){this.editor.setReadOnly(e.target.checked),this.editor.focus()},tabResize(e){this.editor.session.setTabSize(Number(e.target.value)),this.editor.focus()},softTabs(e){this.editor.session.setUseSoftTabs(e.target.checked),this.editor.focus()},showInvi(e){this.editor.setShowInvisibles(e.target.checked),this.editor.focus()},hexstrToggle(){if("hex"===this.curtfile.mode){const e=this.$message.loading("正在尝试将当前内容转化为文本");let t=this.editor.getValue();t=(new TextDecoder).decode(this.$uStr.hexToBuffer(t)),this.editor.session.setValue(t),e(),this.$message.success("转化完成"),this.curtfile.mode="string"}else console.log("当前编辑器内容已经是文本格式")},moreSet(){this.editor.execCommand("showSettingsMenu"),this.tipshow=!this.tipshow},dragStart(e){e.dataTransfer.effectAllowed="move",this.dragposi=[e.clientX,e.clientY]},dragEnd(e){e.preventDefault(),this.tranposi=[this.tranposi[0]+e.clientX-this.dragposi[0],this.tranposi[1]+e.clientY-this.dragposi[1]]},copySelection(){if(!navigator.clipboard)return void this.$message.error("粘贴板仅在 https 页面中可访问");let e=this.editor.getCopyText();""!==e?navigator.clipboard.writeText(e).then((()=>{this.$message.success("复制成功")})).catch((e=>{this.$message.error("复制失败",e.message),console.error("复制选择文字失败",e)})):this.$message.error("请先选择文字")},pasteSelection(){navigator.clipboard?navigator.clipboard.readText().then((e=>{e?(this.editor.insert(""),this.editor.session.insert(this.editor.getCursorPosition(),e),this.$message.success("粘贴成功")):(this.$message.error("没有检测到文字内容"),console.log("没有检测到文字内容"))})).catch((e=>{this.$message.error("粘贴失败",e.message),console.error("粘贴失败",e)})):this.$message.error("粘贴板仅在 https 页面中可访问")},save(){const e=this.$message.loading(this.curtfile.name,"上传保存中...",0);let t=this.editor.getValue();"hex"===this.curtfile.mode&&(t=Array.from(this.$uStr.hexToBuffer(t))),this.$axios.post("/rpc",{v:103,method:"save",params:[this.curtfile.path+"/"+this.curtfile.name,t,this.curtfile.mode]}).then((e=>{0===e.data.rescode?this.$message.success(this.curtfile.name,"保存成功"):(this.$message.error(this.curtfile.name,"保存失败",e.data.message),console.error(this.curtfile.name,"保存失败",e.data.message))})).catch((e=>{this.$message.error(this.curtfile.name,"保存失败",e.message),console.error(this.curtfile.name,"保存失败",e)})).finally(e)}}};function wi(e,t,n,r,s,i,o,a){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=c):s&&(c=a?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}const ki=wi(_i,bi,[],!1,null,"6f9c736c",null).exports;var Ci=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message"},e._l(e.msgs,(function(n,r){return t("div",{key:r,staticClass:"message_item",style:{textAlign:n.align}},[t("span",{staticClass:"message_type icon",domProps:{innerHTML:e._s(e.icon[n.type])}}),e._v(" "),t("span",{staticClass:"message_text",class:{cursor:n.url},attrs:{title:n.url},on:{click:function(t){return e.$uApi.open(n.url)}}},[e._v(e._s(n.text))]),e._v(" "),t("span",{staticClass:"message_remove",on:{click:function(t){return e.msgRemove(r)}}},[e._v("X")])])})),0)};Ci._withStripped=!0;const xi={home:'',pause:'',sync:'',delete:'',play:'',plays:'',downcircle:'',upcircle:'',stop:'',clear:'',success:'',error:'',loading:'',overview:'',rules:'',rewrite:'',jsmanage:'',task:'',mitm:'',cfilter:'',setting:'',about:'',donation:''};var $i=n(724);const Si={base_url:location.origin,glogslicebegin:0,version:"3.8.1"};function Ei(e){return"object"!=typeof e?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()||"object"}function Oi(e,t=!1){if(!e)return!!t&&Object.create(null);switch(Ei(e)){case"array":case"object":return e;case"set":return Array.from(e);case"map":return Array.from(e).reduce(((e,[t,n])=>(e[t]=n,e)),{})}try{let t=JSON.parse(e);if("object"==typeof t)return t}catch(t){try{let t=new Function("return "+e)();if(/^(object|array)$/.test(Ei(t)))return t}catch(e){}}return!!t&&{0:e}}function Ti(e){if(null==e)return"";let t=Ei(e);switch(t){case"string":return e.trim();case"map":case"set":return JSON.stringify({dataType:t,value:Array.from(e)});case"array":case"object":try{return e[Symbol.toPrimitive]?String(e[Symbol.toPrimitive]()):JSON.stringify(e)}catch(e){return e.message}default:return String(e).trim()}}function Ai(e){if(!e)return!1;if("boolean"==typeof e)return e;if("string"!=typeof e)return!0;switch(e=e.trim()){case"":case"0":case"false":case"null":case"undefined":case"NaN":return!1;default:return!0}}function Ri(e){return!!(""===Ti(e).trim()||/^(object|array)$/.test(Ei(e))&&0===Object.keys(e).length)}function Ni(e){try{return new URL(e)}catch(e){return!1}}function Pi(e=8){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t[Math.floor(52*Math.random())];for(e--;e--;)n+=t[Math.floor(62*Math.random())];return n}function Di(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}function ji(e,t){return void 0===t&&(t=e,e=0),Math.floor(Math.random()*(t-e+1))+e}Si.vernum=Number(Si.version.replace(/\D/g,""));const Mi=6e4*(new Date).getTimezoneOffset();function Li(e=null,t=0,n=Si.glogslicebegin){return e=e?Number(e)||Date.parse(e):Date.now(),new Date(e-Mi).toISOString().slice(n,t?-1:-5).replace("T"," ")}function Ii(e=Date.now()){let t=(Date.now()-e)/1e3/60/60;return t>100?(t/24).toFixed(2)+" days":t.toFixed(2)+" hours"}const zi=new Map;function Fi(e,t=16){const n=e+t;if(zi.has(n))return zi.get(n);const r=function(e,t=16){if(e.length===t)return e;if(e.lengtht){const n=e.split(/\/|\\/);n.length>1&&(e=n[0].slice(0,1)+"/"+n.pop());const r=e.split(" ").pop();return e.slice(0,t-6-r.length)+"..."+e.slice(-r.length-3)}}(e,t);return zi.set(n,r),r}function Bi(e=""){if(/[&<>"']/.test(e)){const t={'"':""","'":"'","&":"&","<":"<",">":">"};return e.replace(/[&<>"']/g,(e=>t[e]||e))}return e}function Ui(e){return(0,$i.ansiHtml)(Bi(e))}function Hi(e){if(!e)return"";let t="",n=e.split(/\/|\\|\?|#/);for(;""===t&&n.length;)t=n.pop();return t}const Vi=[];for(let e=0;e<=255;++e){const t=e.toString(16).padStart(2,"0");Vi.push(t)}function Ki(e,t=" ",n=2e4){const r=new Uint8Array(e),s=new Array(r.length);r.length>n?console.debug("arrayBuffer length",r.length,"is too big to tranfer, slice to",n):n=r.length;for(let e=0;eVi.indexOf(e))))}function Wi(e="",t=0){if(!e){if(t<1)return"";e="0"}let n=Ki((new TextEncoder).encode(e),"");return 0===t||n.length===t?n:(n.length{const t=r[s++];return s>=r.length&&(i+=1,s=0),e+t*i+r.length})),"")}function Xi(e,t="elecV2"){const n=qi(e,null),r=(new TextEncoder).encode(t);let s=0,i=1;return(new TextDecoder).decode(n.map((e=>{const t=r[s++];return s>=r.length&&(i+=1,s=0),e-t*i-r.length})))}function Zi(e=0,t=1024){return edocument.body.clientWidth&&(r-=t),e.pageY+n>document.body.clientHeight&&(s-=n),[r,s]}const eo=new Map,to=new Map;to.set("082bc4ee40bfef100f79579dc780dff7",{name:"elecV2",homepage:"https://github.com/elecV2"}),to.set("cd2458b5e43827ee9a2009b56f29ffd5",{name:"Public test",homepage:"https://t.me/elecV2"}),to.set("b9b2e3354b6520261c1b5c375dc2bf74",{name:"Oreomeow",homepage:"https://github.com/Oreomeow"});let no=localStorage.getItem("sponsors");if(no)try{JSON.parse(Xi(no,"elecV2P_sponsors")).forEach((e=>{to.set(e,Object.create(null))}))}catch(e){console.debug("parse localStorage sponsors",e)}eo.set("sponsors",to),eo.set("bChecked",localStorage.getItem("bcheck")===(new Date).getDate().toString()),to.has(localStorage.getItem("userid"))&&eo.set("bSponsor",!0);const ro={get:e=>localStorage.getItem(e),set:(e,t)=>localStorage.setItem(e,t),hasCache:e=>eo.has(e),getCache:e=>eo.get(e),setCache:(e,t)=>eo.set(e,t),deleteCache:e=>eo.delete(e)};function so(e){let t=document.querySelector(e);t&&(t.scrollTop=t.scrollHeight)}function io(e){let t=document.querySelector(e);t&&t.scrollIntoView()}function oo(e){let t=document.querySelector(e);t&&t.focus()}function ao(e,t="elecV2P.json",n="application/json"){e=/json/.test(n)?JSON.stringify(e,null,2):String(e);const r=new Blob([e],{type:n});let s=(window.URL||window.webkitURL).createObjectURL(r),i=document.createElement("a");i.download=t,i.href=s,i.click()}function co(e,t=""){fetch(e).then((n=>{if(!t)try{const e=n.headers.get("Content-Disposition").split(";");t=e[1].split("=")[1]}catch(e){console.error("fail to get filename",e)}return n.blob().then((n=>{let r=document.createElement("a");r.href=URL.createObjectURL(n),r.download=t||e.split("/").pop(),r.click()}))}))}function lo(e="",t=".evscript"){if(!e)return void console.log("some code are expect");document.querySelector(t)&&document.querySelector(t).remove();let n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("defer","defer"),n.className="evscript",n.innerHTML=e,document.head.appendChild(n)}function uo(e="",t=".evtheme"){if(!e)return void console.log("some style contexts are expect");document.querySelector(t)&&document.querySelector(t).remove();let n=document.createElement("style");n.className="evtheme",n.innerHTML=e,document.head.appendChild(n)}function fo(e="",t=""){if(!e)return void console.log("a meta name is expect");let n=document.querySelector(`meta[name=${e}]`),r=null;n?r=n:(r=document.createElement("meta"),r.name=e),r.content=t,!n&&document.head.appendChild(r)}function po(e="standalone"){return matchMedia(`(display-mode: ${e})`).matches||navigator.standalone||document.referrer.includes("android-app://")}function ho(e){document.querySelector(e)&&document.querySelector(e).remove()}function mo(e=""){let t=document.querySelector(".copyinput");t&&"INPUT"===t.nodeName||(t=document.createElement("input"),t.className="copyinput",t.style.position="fixed",t.style.top="-6px",t.style.height="0",t.style.border="none",document.body.appendChild(t)),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.blur()}function vo(e){return navigator.clipboard.writeText(e)}function go({accept:e="*",type:t="text",multiple:n=!1}={}){let r=document.createElement("input");return r.type="file",r.accept=e,n&&(r.multiple=!0),new Promise(((e,n)=>{r.onchange=r=>{let s=r.target.files[0];if(s)if(console.debug("get file",s.name,s.type,s.size),"file"===t)e(s);else{let t=new FileReader;t.readAsText(s,"UTF-8"),t.onload=t=>{e({name:s.name,type:s.type,size:s.size,content:t.target.result})}}else n("请先选择文件")},r.click()}))}function yo(){return navigator.userAgent||"Mozilla/5.0 (Linux; U; elecV2P; x64) ePhone Super Max Plus++"}function bo(e=""){return getComputedStyle(document.querySelector("#app")).getPropertyValue(e).trim()}function _o(e=""){document.execCommand("insertText",!1,e)}const wo=new Map;function ko(e="",t="",n=3){if(!e||!t)return void wo.clear();32!==e.length&&(e=Wi(t,32));const r=e+t+n;if(wo.has(r))return wo.get(r);let s="";switch(n){case 4:s=function(e=""){const t=document.createElement("canvas");t.width=180,t.height=180;const n=t.getContext("2d"),r=e.match(/\w{2}/g).map((e=>parseInt(e,16)));n.fillStyle=`rgba(${r[0]}, ${r[4]}, ${r[8]}, ${r[12]/380+.3})`,n.fillRect(0,0,t.width,t.height),n.lineCap="round",n.lineJoin="round";const s=r[0]%4,i=r[1]%10+10;switch(n.beginPath(),n.lineWidth=r[2]%15+5,n.strokeStyle=`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]/380+.3})`,n.fillStyle=`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]/380+.3})`,s){case 0:n.strokeRect(50-i,60-i,2*i,2*i);break;case 1:n.fillRect(50-i,60-i,2*i,2*i);break;case 2:n.arc(50,60,i,0,2*Math.PI),n.stroke();break;default:n.arc(50,60,i,0,2*Math.PI),n.fill()}const o=r[4]%4,a=r[5]%10+10;switch(n.beginPath(),n.lineWidth=r[6]%15+5,n.strokeStyle=`rgba(${r[4]}, ${r[5]}, ${r[6]}, ${r[7]/380+.3})`,n.fillStyle=`rgba(${r[4]}, ${r[5]}, ${r[6]}, ${r[7]/380+.3})`,o){case 0:n.strokeRect(130-a,60-a,2*a,2*a);break;case 1:n.fillRect(130-a,60-a,2*a,2*a);break;case 2:n.arc(130,60,a,0,2*Math.PI),n.stroke();break;default:n.arc(130,60,a,0,2*Math.PI),n.fill()}return n.beginPath(),n.moveTo(90,(i+a)/2+60),n.quadraticCurveTo(r[8],r[9],90,r[10]%15+105),n.lineWidth=r[11]%15+5,n.strokeStyle=`rgba(${r[8]}, ${r[9]}, ${r[10]}, ${r[11]/380+.3})`,n.stroke(),n.beginPath(),n.moveTo(50,130),n.quadraticCurveTo(r[12],r[13]%50+130,130,130),n.lineWidth=r[14]%15+5,n.strokeStyle=`rgba(${r[12]}, ${r[13]}, ${r[14]}, ${r[15]/380+.3})`,n.stroke(),t.toDataURL()}(e);break;case 3:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d"),s=e.match(/\w{2}/g).map((e=>parseInt(e,16))),i=r.createRadialGradient(90,90,0,90,90,128);i.addColorStop(0,`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/380+.3})`),i.addColorStop(.25,`rgba(${s[4]}, ${s[5]}, ${s[6]}, ${s[7]/380+.3})`),i.addColorStop(.5,`rgba(${s[8]}, ${s[9]}, ${s[10]}, ${s[11]/380+.3})`),i.addColorStop(.75,`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`),i.addColorStop(1,`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`),r.beginPath(),r.fillStyle=i,r.arc(90,90,128,0,2*Math.PI),r.fill(),t&&Co(t,r);return n.toDataURL()}(e,t);break;case 2:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d");e+=e;let s=0;for(let t=0;t<18;t++){for(let n=0;n<18;n++)r.beginPath(),r.fillStyle="#"+e.slice(s+n,s+n+8),r.arc(10*n+5,10*t+5,5,0,2*Math.PI),r.fill();s++}t&&Co(t,r);return n.toDataURL()}(e,t);break;default:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d"),s=e.match(/\w{2}/g).map((e=>parseInt(e,16))),i=[s[0]%120,s[1]%120],o=[s[2]%(180-i[0])+i[0],s[3]%(180-i[1])+i[1]];r.fillStyle=`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/380+.3})`,r.fillRect(0,0,o[0],i[1]-2),r.fillStyle=`rgba(${s[4]}, ${s[5]}, ${s[6]}, ${s[7]/380+.3})`,r.fillRect(o[0]+2,0,180-o[0]-2,o[1]),r.fillStyle=`rgba(${s[8]}, ${s[9]}, ${s[10]}, ${s[11]/380+.3})`,r.fillRect(i[0],o[1]+2,180-i[0],180-o[1]-2),r.fillStyle=`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`,r.fillRect(0,i[1],i[0]-2,180-i[1]),r.fillStyle=bo("--main-bk")||`rgba(${s[1]}, ${s[5]}, ${s[9]}, ${s[13]/380+.3})`,r.fillRect(i[0],i[1],o[0]-i[0],o[1]-i[1]),r.fillStyle="#000",r.fillRect(o[0],0,2,o[1]),r.fillRect(i[0],o[1],180-i[0],2),r.fillRect(i[0]-2,i[1],2,180-i[1]),r.fillRect(0,i[1]-2,o[0],2),t&&Co(t,r);return n.toDataURL()}(e,t)}return wo.set(r,s),s}function Co(e="",t){e&&(e.length>1&&(e=e.slice(0,1)),e=e.toUpperCase(),t.beginPath(),t.lineWidth=6,t.textAlign="center",t.textBaseline="middle",t.font="bold 140px "+(bo("--font-fm")||"system-ui,sans-serif"),t.strokeStyle=bo("--main-fc")||"#FFFFFF",t.strokeText(e,90,98))}function xo(e=""){if("function"!=typeof eval){const e="eval 函数在当前环境下不可用";return console.error(e),e}try{return(0,eval)(e)}catch(e){return console.error("evalRun fail",e),e.message}}function $o(){return document.title}function So(e="elecV2P"){document.title=e}function Eo({ele:e=document.querySelector(".logo_a"),off:t=!0}={}){return t?e.classList.add("logo_a--offline"):e.classList.remove("logo_a--offline")}function Oo(e,t=""){return t?document.querySelectorAll(e):document.querySelector(e)}const To={message:Object.create(null),evui:()=>{}};const Ao=wi({name:"message",data:()=>({msgs:{},icon:xi}),computed:{},created(){Object.assign(To.message,{success:(...e)=>this.msgShow("success",this.formMsg(e)),error:(...e)=>this.msgShow("error",this.formMsg(e)),loading:(...e)=>this.msgShow("loading",this.formMsg(e)),close:e=>{e?this.msgRemove(e):this.msgs={}}}),this.$wsrecv&&this.$wsrecv.add("message",(e=>{if("object"===Ei(e))switch(e.type){case"success":case"error":case"loading":const t=this.formMsg(e.data);this.msgShow(e.type,t),this.msgNotify(t.msg,{secd:t.secd,url:t.url,tag:t.mid});break;case"close":e.data?this.msgRemove(e.data):this.msgs={};break;default:this.msgShow("error",{msg:"暂不支持的通知类型: "+e.type,secd:10})}else this.msgShow("success",this.formMsg(e))}))},methods:{formMsg(e){if(0===e.length)return{msg:""};if("array"!==Ei(e))return{msg:Ti(e)};if(1===e.length)return{msg:Ti(e[0])};let t,n,r,s,i=e.pop();return Number.isFinite(i)?t=i:"object"===Ei(i)&&(i.secd||i.url||i.mid||i.align)?(t=i.secd,n=i.url,r=i.mid,s=i.align):e.push(i),{msg:e.map((e=>Ti(e))).join(" "),secd:t,url:n,mid:r,align:s}},msgShow(e,{msg:t,secd:n,url:r,mid:s=Pi(),align:i}){return void 0!==t&&""!==t||(t="a empty message",s="empty"),Number.isFinite(n)||(n=(t.match(/\W/g)||t).length/5+(3*Object.keys(this.msgs).length||5)),this.$set(this.msgs,s,{text:t,type:e,secd:n,url:r,align:i}),0!==n&&(this.msgs[s].sTout=setTimeout(this.msgRemove,1e3*n,s)),()=>{this.msgRemove(s)}},msgRemove(e){this.msgs[e]&&(clearTimeout(this.msgs[e].sTout),this.$delete(this.msgs,e))},async getNotifyPerm(){if("undefined"==typeof Notification)return"";let e=Notification.permission;return"granted"===e||"denied"===e?e:(e=await Notification.requestPermission(),void 0===e?new Promise((e=>Notification.requestPermission((t=>e(t))))):e)},async msgNotify(e="",t={}){if("granted"===await this.getNotifyPerm()){t.icon||(t.icon="efss/logo/elecV2P.png");const n=new Notification(t.title||"",{body:e,icon:t.icon,tag:t.tag});t.secd>0&&setTimeout((()=>n.close()),1e3*t.secd),t.url&&(n.onclick=e=>{e.preventDefault(),this.$uApi.open(t.url),n.close()})}}}},Ci,[],!1,null,"40ac18ce",null).exports;var Ro=function(){var e=this,t=e._self._c;return t("div",{staticClass:"checkbox",class:{"checkbox--checked":e.bChecked},on:{click:function(t){e.bChecked=!e.bChecked}}},[t("span",{staticClass:"checkbox_status"})])};Ro._withStripped=!0;const No=wi({name:"checkbox",props:["oCheck","oKey","oInit"],computed:{bKey(){return this.oKey||"enable"},bChecked:{get(){return void 0===this.oCheck[this.bKey]?"false"!==this.oInit:!!this.oCheck[this.bKey]},set(e){this.$set(this.oCheck,this.bKey,e)}}}},Ro,[],!1,null,"40a3a37e",null).exports;var Po=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"menu",style:{left:(e.pos?e.pos[0]:0)+"px",top:(e.pos?e.pos[1]:0)+"px"}},e._l(e.menus,(function(n,r){return t("li",{staticClass:"menu_item",style:{color:n.color,backgroundColor:n.bkcolor,fontSize:n.fontsize,height:n.height},attrs:{"data-method":n.method,"data-param":n.param},on:{click:function(t){return t.preventDefault(),e.click(r)},contextmenu:function(t){return t.preventDefault(),e.rclick(r)},dblclick:function(t){return t.preventDefault(),e.dclick(r)}}},[e._v(e._s(n.label))])})),0)};Po._withStripped=!0;const Do=wi({name:"contextmenu",props:["menus","pos"],methods:{click(e){this.menus.length&&this.menus[e].click?this.menus[e].click():console.debug("点击暂无对应处理函数"),this.menus.splice(0)},rclick(e){this.menus.length&&this.menus[e].rclick?this.menus[e].rclick():console.debug("右键暂无对应处理函数"),this.menus.splice(0)},dclick(e){this.menus.length&&this.menus[e].dclick?this.menus[e].dclick():console.debug("双击暂无对应处理函数"),this.menus.splice(0)}}},Po,[],!1,null,"10ef9a33",null).exports;var jo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"favend",class:{"favend--collapsed":e.collapse}},[t("table",{staticClass:"elecTable",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.favendSave()):null}}},[t("caption",{staticClass:"elecTable_caption"},[t("div",{staticClass:"title padding0"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"刷新 EFSS 相关设置"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.$emit("init","config")}}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"EFSS favorite&backend"}},[e._v("favend 相关设置 - "+e._s(e.favend_total))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})])]),e._v(" "),t("thead",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}]},[t("tr",{attrs:{title:"在输入框内使用 alt + enter 打开 favend 页面"}},[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:"全选/全不选"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.favendCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v("名称")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--input"},[e._v("关键字")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--input"},[e._v("类型")]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v("目标")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v("启用")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_cell100"},[e._v("操作")])])]),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.favendOpenDelegate(t)):null}}},e._l(e.showlist,(function(n,r){return t("tr",{key:"key"+r,class:{"elecTable_tr--disabled":!n.enable,"elecTable_tr--selected":e.favendChecked[n.key]}},[t("td",{staticClass:"elecTable_td",class:{folderbk:n.collapse}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.favendCheck,expression:"favendCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:n.key,checked:Array.isArray(e.favendCheck)?e._i(e.favendCheck,n.key)>-1:e.favendCheck},on:{change:function(t){var r=e.favendCheck,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=n.key,a=e._i(r,o);s.checked?a<0&&(e.favendCheck=r.concat([o])):a>-1&&(e.favendCheck=r.slice(0,a).concat(r.slice(a+1)))}else e.favendCheck=i}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.name,expression:"favend.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text","data-key":n.key},domProps:{value:n.name},on:{input:function(t){t.target.composing||e.$set(n,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.key,expression:"favend.key",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text","data-key":n.key},domProps:{value:n.key},on:{input:function(t){t.target.composing||e.$set(n,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:n.type,expression:"favend.type"}],staticClass:"elecTable_select",on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(n,"type",t.target.multiple?r:r[0])}}},[t("option",{attrs:{value:"favorite"}},[e._v("收藏目录")]),e._v(" "),t("option",{attrs:{value:"runjs"}},[e._v("运行脚本")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.target,expression:"favend.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"目录地址 或 脚本名称 比如: logs 或 favend.js","data-key":n.key},domProps:{value:n.target},on:{input:function(t){t.target.composing||e.$set(n,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:n}})],1),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100"},[t("span",{staticClass:"icon--op",attrs:{title:"打开查看"},domProps:{innerHTML:e._s(e.icon.play)},on:{click:function(t){return e.favendOpen(n.key)}}}),e._v(" "),t("span",{staticClass:"icon--op",attrs:{title:"删除此项"},domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.favendDel(n.key)}}})])])})),0),e._v(" "),t("tfoot",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}]},[t("tr",[t("td",{staticClass:"center cursor border_top1 border_right1 favend_collanum",class:{"favend_collanum--show":e.coll_show},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.coll_show=!e.coll_show}}},[e._v(e._s(e.coll_keys.length))]),e._v(" "),t("td",{staticClass:"center border_top1",attrs:{colspan:"6"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasChecks,expression:"hasChecks"}],staticClass:"elecTable_addbtn elecBtn--file",on:{click:function(t){return e.favendCol(!0)}}},[e._v("隐藏选择规则")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasCheckCols,expression:"hasCheckCols"}],staticClass:"elecTable_addbtn elecTable_addbtn--stop",on:{click:function(t){return e.favendCol(!1)}}},[e._v("规则隐藏取消")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasChecks,expression:"hasChecks"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.favendDelCks()}}},[e._v("删除选择规则")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.favendNew()}}},[e._v("添加新的规则")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{title:"(CTRL+S)保存后正式生效"},on:{click:function(t){return e.favendSave()}}},[e._v("保存当前列表")])])])])])])};jo._withStripped=!0;const Mo={name:"efss",props:["favendlist","efssdir"],data:()=>({icon:xi,collapse:!0,orglist:[],coll_show:!1,favendCheck:[]}),components:{checkbox:No},computed:{favend_total(){return this.orglist.length},showlist(){return this.coll_show?this.orglist:this.orglist.filter((e=>!e.collapse))},coll_keys(){return this.orglist.filter((e=>e.collapse)).map((e=>e.key))},favendChecked:{get(){let e={};return this.favendCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.favendCheck=this.showlist.map((e=>e.key)):"none"===e&&(this.favendCheck=[])}},hasChecks(){return 0!==this.favendCheck.length},hasCheckCols(){return this.favendCheck.some((e=>this.coll_keys.includes(e)))}},watch:{favendlist(e){let t=[];for(let n in e)t.push(e[n]);this.orglist=t}},methods:{favendOpen(e){this.$uApi.open("/efss/"+e)},favendOpenDelegate(e){e.target.dataset.key&&this.$uApi.open("/efss/"+e.target.dataset.key)},favendDel(e){this.orglist=this.orglist.filter((t=>t.key!==e))},favendDelCks(){this.orglist=this.orglist.filter((e=>!this.favendChecked[e.key])),this.$message.success(`成功删除 ${this.favendCheck.length} 条规则,保存后正式生效`),this.favendCheck=[]},favendNew(e=this.$uStr.euid()){let t=Math.random()<.5?"runjs":"favorite";this.orglist.push({key:e,name:"favend "+(Object.keys(this.orglist).length+1),type:t,target:"favorite"===t?this.efssdir:"test.js",enable:!0})},favendSave(){let e=Object.create(null);for(let t of this.orglist){if(!(t.key&&t.name&&t.target))return void this.$message.error(t.name,t.key,"部分项参数为空,请修改后再进行保存");if(e[t.key])return void this.$message.error("设置了重复关键字:",t.key,"请修改后再进行保存\n重复项:",t.name,"和",e[t.key].name);e[t.key]=t}const t=this.$message.loading("favend 列表更新中...",0);this.$axios.put("/config",{type:"efss",data:{favend:e}}).then((t=>{if(0===t.data.rescode){this.$message.success("favend 设置保存成功");for(let t in this.favendlist)e[t]||delete this.favendlist[t];for(let t in e)this.favendlist[t]=e[t]}else this.$message.error("favend 设置保存失败",t.data.message||"未知错误"),console.error(t.data)})).catch((e=>{this.$message.error("favend 设置失败",e.message),console.error(e)})).finally(t)},favendCkall(e){this.favendChecked=e.target.checked?"all":"none"},favendCol(e=!0){if(!this.hasChecks)return void this.$message.error("请先选择规则");const t=this.$message.loading("隐藏列表更新中...",0);this.$axios.put("/config",{type:"favend",prop:"collapse",keys:this.favendCheck,value:e}).then((t=>{0===t.data.rescode?(this.$message.success("隐藏列表更新成功"),t.data.resdata&&this.$message.error("其中",t.data.resdata.join(", "),"对应规则尚未上传保存"),this.orglist=this.orglist.map((t=>this.favendCheck.includes(t.key)?{...t,collapse:e}:{...t})),this.favendCheck=[]):(this.$message.error("隐藏列表更新失败",t.data.message||t.data||"未知错误"),console.error("隐藏列表更新失败",t.data))})).catch((e=>{this.$message.error("隐藏列表更新失败失败",e.message),console.error("隐藏列表更新失败",e)})).finally(t)}}};const Lo=wi(Mo,jo,[],!1,null,"51f47af4",null).exports;var Io=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.preview.enable,expression:"preview.enable"}],staticClass:"preview",class:{"preview--collapsed":e.collapse},style:"transform: translate("+e.tranposi[0]+"px, "+e.tranposi[1]+"px);",attrs:{draggable:e.collapse},on:{dragstart:function(t){return e.dragStart(t)},dragend:function(t){return e.dragEnd(t)}}},[t("div",{staticClass:"title title--editview"},[t("span",{staticClass:"title_close",on:{click:function(t){return t.preventDefault(),e.previewClose()}}},[e._v("X")]),e._v(" "),t("span",{staticClass:"title_main"},[e._v(e._s(e.preview.name))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){return t.preventDefault(),e.previewCollapse()}}})]),e._v(" "),t("div",{staticClass:"preview_toolbar"},[t("ul",{staticClass:"preview_menu eflex eflex--wrap"},[t("li",{attrs:{title:"保存该文件到本地磁盘上"}},[t("button",{staticClass:"elecBtn elecBtn--h32 folderbk",on:{click:function(t){return e.fileSave()}}},[e._v("下载该文件")])]),e._v(" "),t("li",[t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32",on:{click:function(t){return e.fileDelete()}}},[e._v("删除该文件")])]),e._v(" "),t("li",{attrs:{title:"在新标签页中查看该文件"}},[t("button",{staticClass:"elecBtn elecBtn--check elecBtn--h32",on:{click:function(t){return e.fileOpen()}}},[e._v("新页面打开")])])])]),e._v(" "),t("div",{staticClass:"preview_content"},["image"===e.preview.type?t("img",{staticClass:"preview_image",attrs:{src:e.previewurl,alt:e.preview.name,draggable:"false"}}):"media"===e.preview.type?t("div",{staticClass:"premedia"},[t("video",{staticClass:"preview_media",attrs:{src:e.previewurl,controls:"",autoplay:"true"},on:{play:function(t){return e.playStart()},ended:function(t){return e.playNext()},loadedmetadata:function(t){return e.volumeSet(t)}}},[t("p",[e._v("\n Your browser doesn't support HTML media. Here is a\n "),t("a",{attrs:{href:e.previewurl,target:"_blank"}},[e._v("link to the media")]),e._v(" instead.\n ")])])]):e.preview.type?t("div",[t("p",[e._v("暂时无法预览文件类型 "+e._s(e.preview.type)+"。文件地址:"),t("a",{attrs:{href:e.previewurl,target:"_blank"}},[e._v(e._s(e.previewurl))])])]):e._e(),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.listshow,expression:"listshow"}],staticClass:"preview_list"},[t("ul",{staticClass:"preview_listul"},e._l(e.preview.list,(function(n){return t("li",{key:n,staticClass:"preview_listli",class:{greenbk:n===e.preview.name},on:{click:function(t){e.preview.name=n}}},[e._v(e._s(n))])})),0)]),e._v(" "),t("div",{staticClass:"precontrol"},[t("div",{staticClass:"precontrol_menu"},[t("span",{staticClass:"precontrol_item",attrs:{title:"查看同类型文件列表"},on:{click:function(t){e.listshow=!e.listshow}}},[e._v("☰")]),e._v(" "),t("span",{staticClass:"precontrol_item",attrs:{title:"上一项"},on:{click:function(t){return e.playNext(-1)}}},[e._v("⏮")]),e._v(" "),t("span",{staticClass:"precontrol_item",class:{"precontrol_item--active":e.autonext},attrs:{title:"连续播放"},on:{click:function(t){return e.playMode(1)}}},[e._v("🔁")]),e._v(" "),t("span",{staticClass:"precontrol_item",class:{"precontrol_item--active":e.randnext},attrs:{title:"随机播放"},on:{click:function(t){return e.playMode(2)}}},[e._v("🔀")]),e._v(" "),t("span",{staticClass:"precontrol_item",attrs:{title:"下一项"},on:{click:function(t){return e.playNext(1)}}},[e._v("⏭")])])])])])};Io._withStripped=!0;const zo={name:"preview",props:["preview"],data(){return{collapse:!1,position:[0,0],tranposi:[0,0],listshow:!1,autonext:!1,randnext:!1,b_volume:!0,orgtitle:this.$uApi.getTitle(),autoInter:null,mediaend:!0}},watch:{preview:function(e){e.enable&&(this.collapse=!1,this.listshow=!1,this.tranposi=[0,0])}},computed:{previewurl(){return"/efss"+this.preview.base+"/"+this.preview.name},curtidx(){return this.preview.list.indexOf(this.preview.name)}},methods:{previewClose(){this.preview.enable=!1,this.preview.type="",this.preview.base="",this.preview.name="",this.preview.list=[],this.$uApi.setTitle(this.orgtitle),this.interClear(),this.autonext=!1,this.randnext=!1},previewCollapse(){this.tranposi=[0,0],this.collapse=!this.collapse,this.interClear()},fileOpen(){this.$uApi.open(this.previewurl)},fileSave(){this.$uApi.downloadFile(this.previewurl,this.preview.name)},fileDelete(){const e=this.preview.name;if(!confirm(`确定删除文件 ${e}?(不可恢复)`))return;const t=this.$message.loading("正在删除文件",e,"...",0);this.$axios.delete("/sefss",{data:{path:this.preview.base,files:[e]}}).then((t=>{if(0===t.data.rescode){this.$emit("eRemove",e);const n=this.preview.list.indexOf(e);this.preview.list.splice(n,1),this.preview.list.length&&(this.preview.name=this.preview.list[n]||this.preview.list[0]),this.$message.success("操作完成",t.data.message)}else this.$message.error(e,"删除失败:",t.data.message)})).catch((t=>{this.$message.error(e,"删除失败",t.message),console.error(e,"删除失败",t)})).finally(t)},dragStart(e){e.dataTransfer.effectAllowed="move",this.position=[e.clientX,e.clientY]},dragEnd(e){e.preventDefault(),this.tranposi=[this.tranposi[0]+e.clientX-this.position[0],this.tranposi[1]+e.clientY-this.position[1]]},playStart(){this.$uApi.setTitle(this.preview.name+" - elecV2P Player"),this.mediaend=!1},playNext(e=0){if("media"===this.preview.type&&(this.$uApi.setTitle(this.orgtitle),0===e&&(this.mediaend=!0)),!e&&!this.autonext&&!this.randnext)return;const t=this.preview.list.length;if(t<=1)return;const n=this.randnext?this.$uStr.iRandom(0,t):this.curtidx+(e||1);this.preview.name=this.preview.list[n]||this.preview.list[0]},playMode(e=1){switch(e){case 1:this.autonext=!this.autonext,this.$message.success(this.autonext?"开启连续播放模式":"退出连续播放模式"),this.autonext&&(this.randnext=!1);break;case 2:this.randnext=!this.randnext,this.$message.success(this.randnext?"开启随机播放模式":"退出随机播放模式"),this.randnext&&(this.autonext=!1);break;default:this.message.error("未知操作")}"image"===this.preview.type?this.autoInter||!this.autonext&&!this.randnext?!this.autoInter||this.autonext||this.randnext||this.interClear():this.autoInter=setInterval(this.playNext,5e3,1):this.mediaend&&this.playNext(1)},interClear(){this.autoInter&&(clearInterval(this.autoInter),this.autoInter=null,this.autonext=!1,this.randnext=!1)},volumeSet(e){this.b_volume&&(e.target.volume=.3,this.b_volume=!1)}}};const Fo=wi(zo,Io,[],!1,null,"759ce28a",null).exports,Bo={clients:new Map,connections:new Set,Recv(e,t){let n=this.clients.get(e);if(n?n.add(t):(n=new Set([t]),this.clients.set(e,n)),this.connections.has(e))console.debug("server-sent events:",e,"connected");else{const t=new EventSource("/sse/elecV2P/"+e);t.onmessage=t=>{let n=Oi(t.data),r=this.clients.get(e);r?r.forEach((e=>e(n))):console.debug("no sse method for:",e,t.data)},t.onerror=n=>{t.close(),this.connections.delete(e),console.error("sse close",n)},this.connections.add(e)}}},Uo={name:"efss",data(){return{icon:xi,filelist:{},subpath:[],curtdir:"",upflists:[],esconfig:{enable:!0,directory:"./efss",dotshow:{enable:!1},max:600,skip:{folder:[],file:[]},favend:{}},menu:{pos:[0,0],list:[]},fileop:{name:"",folder:"",operate:""},fileedit:{burl:"",name:"",path:"",start:!1},filecheck:[],collapse:{titlearrow:this.$uStr.iRandom(0,10)>5,efssset:this.$uStr.iRandom(0,10)>7},filedownloadurl:"",preview:{enable:!1,type:"",base:"",name:"",list:[]},imageext:["png","jpg","ico","svg","bmp","gif","jpeg","webp","jfif"],mediaext:["mp4","m4v","m4s","ogm","ogg","ogv","webm","mp3","wav","aac"],uopenext:["exe","dll","msi","zip","gz","rar","7z","iso","img","avi","mov","rmvb","flv","download","bin","wasm","psd","pdf","cbz","epub","mobi","doc","docx","xls","xlsx","ppt","pptx","apk","ipa","ttf","woff","dat"],filesearch:"",locsubpath:this.$sJson(localStorage.getItem("subpath"))}},computed:{efssfilesname(){let e=[];for(let t=0;t0!==n&&t?e+"/"+t[1]:e),"")},fullpath(){return this.curtdir.replace(/\/$/,"")+this.postpath},curtshow(){return this.subpath.reduce(((e,t,n)=>0!==n&&t&&e.list&&e.list[t[0]]?e.list[t[0]]:e),this.filelist)},showlist(){if(this.curtshow&&this.curtshow.list){let e=[],t=[];return this.curtshow.list.forEach(((n,r)=>{this.filesearch&&!n.name.includes(this.filesearch)||("directory"===n.type?e.push({...n,index:r}):t.push({...n,index:r}))})),[...e,...t]}return[]},isSingleCheck(){return 1===this.filecheck.length},isZipCheck(){return this.filecheck[0]&&/\.zip$/.test(this.filecheck[0])},skipfolder:{get(){return this.esconfig.skip.folder.join(", ")},set(e){this.esconfig.skip.folder=e.split(/ ?, ?|,| /)}},skipfile:{get(){return this.esconfig.skip.file.join(", ")},set(e){this.esconfig.skip.file=e.split(/ ?, ?|,| /)}}},mounted(){this.eInit(),window.onbeforeunload=()=>localStorage.setItem("subpath",JSON.stringify(this.subpath))},components:{editor:ki,message:Ao,checkbox:No,favend:Lo,contextmenu:Do,preview:Fo},methods:{eInit(e){const t=this.$message.loading("获取 EFSS 相关数据中...",0);this.$axios.get("/sefss"+(e?"?type="+e:"")).then((e=>{let t="";e.data.config&&(Object.assign(this.esconfig,e.data.config),t+="成功获取 EFSS 相关设置"),e.data.list&&(this.filelist=e.data.list,t+="\n成功获取 EFSS 文件列表"),this.esconfig.enable?(0===this.subpath.length&&(this.locsubpath&&this.locsubpath[0]&&this.locsubpath[0][1]===this.filelist.name?this.subpath=this.locsubpath:this.subpath.push([0,this.filelist.name])),this.curtdir=this.esconfig.directory,this.$message.success(t)):this.$message.success("EFSS 目前处于关闭状态");let n=e.data.userid;if(n&&this.$uApi.store.getCache("sponsors").has(n)){let e=this.$sJson(this.$uApi.store.get("theme"));e&&this.theme(e)}this.fileMCheck("none")})).catch((e=>{this.$message.error("获取失败",e.message),console.error("获取失败",e)})).finally(t)},theme(e=null){if(e)if(e.simple&&(e=e.simple),e.enable){let t="";e.mainbk&&(t=`--main-bk: ${e.mainbk};`,e.mainbk.startsWith("#")&&(t+=`--secd-fc: ${e.mainbk.padEnd(7,8).slice(0,7)}b8;`)),e.maincl&&(t+=`--main-cl: ${e.maincl};`,e.maincl.startsWith("#")&&(t+=`--secd-bk: ${e.maincl.padEnd(7,8).slice(0,7)}b8;`)),e.appbk&&(/^http/.test(e.appbk)&&(e.appbk=`url(${e.appbk})`),t+=`background: ${e.appbk};`),t&&(t=`#app{${t}}`),e.style&&(t+=e.style),this.$uApi.injectCss(t),this.$uApi.injectMeta("theme-color",e.mainbk)}else this.$uApi.removeItem(".evtheme"),this.$uApi.injectMeta("theme-color","#003153")},nUpload(){this.upflists=this.$refs.efssfiles.files},size:e=>e>1048576?(e/1048576).toFixed(2)+" M":e>1024?(e/1024).toFixed(2)+" K":e+" B",eUpload(){let e=new FormData,t=[];if(0===this.upflists.length)return void this.$message.error("请先选择要上传的文件");for(let n of this.upflists)e.append(n.name,n),t.push([n.name,this.size(n.size)]);const n=this.$message.loading("文件上传中...",0);this.$axios.post("/sefss?subpath="+encodeURI(this.postpath),e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{if(0===e.data.rescode){let n=this.curtshow.list.map((e=>e.name)),r=t.map((e=>{let t=n.indexOf(e[0]);return this.$set(this.curtshow.list,-1===t?this.curtshow.list.length:t,{type:"file",name:e[0],size:e[1],mtime:this.$sTime()}),e[0]}));this.$message.success(r.join(","),"上传成功"),this.$refs.efssfiles.value="",console.debug(e.data,r.join(","),"上传成功")}else this.$message.error("上传失败",e.data.message||e.data),console.error("上传失败",e.data)})).catch((e=>{this.$message.error("上传失败",e.message),console.error(e)})).finally(n)},fileOpdelegate(e){switch(e.target.dataset.op){case"open":this.eOpen({type:e.target.dataset.type,name:e.target.dataset.name,size:e.target.dataset.size,index:Number(e.target.dataset.index)});break;case"del":this.eDel([e.target.dataset.name])}},getPreviewList(e="image"){return this.showlist.filter((t=>{if("directory"===t.type)return!1;const n=t.name.match(/.+\.(\w+)/);if(!n)return!1;const r=n[1].toLowerCase();return"image"===e&&this.imageext.includes(r)||"media"===e&&this.mediaext.includes(r)})).map((e=>e.name))},eOpen(e){if("directory"===e.type)this.subpath.push([e.index,e.name]),this.fileMCheck("none");else{const t=/\./.test(e.name)?e.name.split(".").pop().toLowerCase():"";if(!t||-1!==this.uopenext.indexOf(t))return void this.$uApi.open("/efss"+this.postpath+"/"+e.name);-1!==this.imageext.indexOf(t)?this.preview={enable:!0,type:"image",name:e.name,base:this.postpath,list:this.getPreviewList("image")}:-1!==this.mediaext.indexOf(t)?this.preview={enable:!0,type:"media",name:e.name,base:this.postpath,list:this.getPreviewList("media")}:/(M|G)$/.test(e.size)?this.$uApi.open("/efss"+this.postpath+"/"+e.name):(this.fileedit.burl=location.origin+"/efss"+this.postpath+"/",this.fileedit.name=e.name,this.fileedit.path=this.fullpath,this.fileedit.start="url")}},eZip(e,t,n){let r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 已存在,是否继续?(将会覆盖原文件"))return;const s=this.$message.loading(n,"压缩文件生成中...",0);this.$axios.post("/rpc",{method:"zip",params:[e,t+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success("成功生成压缩文件",n,e.data.message),-1!==r?this.curtshow.list[r].mtime=this.$sTime():this.curtshow.list.push({type:"file",name:n,mtime:this.$sTime()}),console.debug(e.data)):(this.$message.error(n,"打包失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{this.$message.error(n,"打包失败",e.message),console.error(e)})).finally(s)},eUnZip(e,t){let n=this.$uStr.surlName(t).replace(/\.zip$/i,""),r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 文件夹已存在,是否继续?(将会覆盖原文件"))return;const s=this.$message.loading(t,"解压中...",0);this.$axios.post("/rpc",{method:"unzip",params:[e+"/"+t,e+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success("成功解压文件",t),-1!==r?this.curtshow.list[r]=e.data.reslist:this.curtshow.list.push(e.data.reslist),console.debug(e.data)):(this.$message.error(t,"解压失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{this.$message.error(t,"解压失败",e.message),console.error(e)})).finally(s)},eMenu(e){let t={};if(!e.target.dataset.type||!e.target.dataset.name)return"mkdir"===e.target.dataset.op?this.eMenuMkdir(e):void 0;t.type=e.target.dataset.type,t.size=e.target.dataset.size,t.name=e.target.dataset.name,t.index=Number(e.target.dataset.index);let n=this.fullpath,r=location.origin+"/efss"+this.postpath+"/",s=this.eOpen,i=this.eDel,o=this.eZip,a=this.eUnZip,c=this.$message,l=this.$axios,u=this.$uApi.copy,f=this.$uApi.open,d=this.fileop,p=this.fileedit,h=this.renameFile,m=[];if("directory"===t.type)m.push({label:"重命名",click(){h(t.name,t.index)}},{label:"zip 压缩打包",click(){o([n+"/"+t.name],n,t.name+".zip")}},{label:"打开该文件夹",click(){s(t)}},{label:"删除该文件夹",bkcolor:"var(--note-bk)",click(){i([t.name])}});else{if(d.name&&d.folder&&d.operate){let e=this.operateFiles;m.push({label:"粘贴",click(){e()}})}m.push({label:"复制",click(){d.name=t.name,d.folder=n,d.operate="copy",u(n+"/"+t.name),c.success(t.name,"文件地址已复制\n请选择目标文件夹后进行粘贴")}},{label:"剪切",click(){d.name=t.name,d.folder=n,d.operate="move",u(n+"/"+t.name),c.success(t.name,"文件地址已获取\n请选择目标文件夹后进行粘贴")}},{label:"编辑",click(){/(M|G)$/.test(t.size)?c.error("当前文件过大,暂时无法处理"):(p.burl=r,p.name=t.name,p.path=n,p.start="url")}},{label:"重命名",click(){h(t.name,t.index)}}),/\.zip$/.test(t.name)?m.push({label:"解压此文件",click(){a(n,t.name)}}):(-1===t.name.indexOf(".")||/\.(js|json|py|sh)$/.test(t.name))&&m.push({label:"使用 PM2 运行",click(){const e=c.loading("命令执行中...",0);l.post("/rpc",{method:"pm2run",params:[t.name,{cwd:n}]}).then((e=>{0===e.data.rescode?(c.success(t.name,"已运行",e.data.message,{align:"left"}),console.debug(e.data)):(c.error(t.name,"运行失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{c.error(t.name,"运行失败",e.message),console.error(e)})).finally(e)}}),m.push({label:"获取文件链接",click(){c.success(r+t.name),u(r+t.name)}},{label:"新标签页打开",bkcolor:"var(--icon-bk)",click(){f(r+t.name)}},{label:"删除该文件",bkcolor:"var(--note-bk)",click(){i([t.name])}})}this.menu={pos:this.$uApi.getCursorPos(e,160,32*m.length),list:m}},eMenuMkdir(e){let t=this.$axios,n=this.$message,r=this.fileedit,s=this.fullpath,i=this.curtshow.list,o=this.$sTime(),a=location.origin+"/efss"+this.postpath+"/",c=[];if(this.fileop.name&&this.fileop.folder&&this.fileop.operate){let e=this.operateFiles;c.push({label:"粘贴到此文件夹",fontsize:"17px",click(){e()}})}c.push({label:"新建文本文件",height:"38px",fontsize:"20px",click(){let e=prompt("新建文本文件名:","新建文本文件.txt");if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void n.error(e,"包含特殊字符,请修改后重试");if(-1!==i.findIndex((t=>t.name===e)))return void n.error(e,"已存在,请使用其他文件名");r.name=e,r.path=s,r.burl=a,r.start="new",i.push({type:"file",size:"0 B",name:e,mtime:o})}}},{label:"新建文件夹",height:"38px",fontsize:"20px",color:"var(--main-bk)",bkcolor:"var(--folder-bk)",click(){let e=prompt("文件夹名称","我的文件夹");if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void n.error(e,"包含特殊字符,请修改后重试");if(-1!==i.findIndex((t=>t.name===e)))return void n.error(e,"已存在,请使用其他文件名");const r=n.loading("准备新建文件夹...",0);t.post("/rpc",{method:"mkdir",params:[s+"/"+e]}).then((t=>{0===t.data.rescode?(n.success("成功创建文件夹",e,t.data.message),i.push({type:"directory",name:e,list:[],mtime:o}),console.debug(t.data)):(n.error(t.data.message||t.data),console.error(t.data))})).catch((t=>{n.error(e,"文件夹新建失败",t.message),console.error(t)})).finally(r)}}}),this.menu={pos:this.$uApi.getCursorPos(e,160,32*c.length),list:c}},eDel(e){if("string"===this.$sType(e)&&(e=[e]),confirm(`确定删除 ${e.join(", ")}?(不可恢复)`)){const t=this.$message.loading("正在删除",e.join(", "),"...",0);this.$axios.delete("/sefss",{data:{path:this.postpath,files:e}}).then((t=>{t.data&&0===t.data.rescode?(this.$message.success("操作完成",t.data.message),e.forEach((e=>this.eRemove(e))),this.fileMCheck("none")):this.$message.error(e,"删除失败:",t.data.message)})).catch((t=>{this.$message.error(e,"删除失败",t.message),console.error(t)})).finally(t)}},eRemove(e=""){this.curtshow.list.splice(this.curtshow.list.findIndex((t=>t.name===e)),1)},subGo(e){e.target.dataset.index&&(this.subpath.splice(Number(e.target.dataset.index)+1),this.fileMCheck("none"))},efssSave(){if(this.esconfig.enable){if(""===this.esconfig.directory)return void this.$message.error("请填写目录地址")}else if(!confirm("确定关闭 EFSS?"))return;const e=this.$message.loading("EFSS 目录更新中...",0);this.$axios.put("/config",{type:"efss",data:this.esconfig}).then((e=>{console.debug(e.data),0===e.data.rescode?(this.subpath.splice(0),this.$message.success(e.data.message),this.eInit()):404===e.data.rescode?this.$message.error("目录:",this.esconfig.directory,"并不存在,请设置其他目录"):this.$message.error("EFSS 设置失败,未知错误")})).catch((e=>{this.$message.error("EFSS 设置失败",e.message),console.error(e)})).finally(e)},editFile(){this.fileedit.name=this.filecheck[0],this.fileedit.burl=location.origin+"/efss"+this.postpath+"/",this.fileedit.path=this.fullpath,this.fileedit.start="url"},renameFile(e="",t=-1){e||(e=this.filecheck[0]);let n=prompt("请输入新的文件名",e);for(;n&&/\\|\/|\?|\||<|>|:|\*/.test(n);)n=prompt("文件名中保存特殊字符,请重新输入",n);if(!n)return;let r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 已存在,是否继续?(将会覆盖原文件"))return;-1===t&&(t=this.curtshow.list.findIndex((t=>t.name===e)));const s=this.$message.loading(e,"重命名中...",0);this.$axios.post("/rpc",{method:"rename",params:[this.fullpath+"/"+e,this.fullpath+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success(`成功重命名为 ${n} ${e.data.message}`),this.curtshow.list[t].name=n,-1!==r&&this.curtshow.list.splice(r,1),this.fileMCheck("none"),console.debug(e.data)):(this.$message.error(`重命名失败 ${e.data.message}`),console.error(e.data))})).catch((e=>{this.$message.error(`重命名失败 ${e.message}`),console.error(e)})).finally(s)},operateFiles(){if(!(this.fileop.name&&this.fileop.folder&&this.fileop.operate))return void this.$message.error("无法对空对象进行操作");if(this.fileop.folder===this.fullpath)return void this.$message.error("无法在和复制/剪切相同的目录下进行粘贴操作");"string"===this.$sType(this.fileop.name)&&(this.fileop.name=[this.fileop.name]);let e=this.fileop.operate;const t=this.$message.loading(this.fileop.name.join(", "),e,"中...",0);this.$axios.post("/rpc",{method:this.fileop.operate,params:[this.fileop.name,this.fileop.folder,this.fullpath]}).then((t=>{if(0===t.data.rescode){this.$message.success(`${this.fileop.name.join(", ")} ${e}成功\n${t.data.message}`);let n=this.$sTime();this.curtshow.list.push(...this.fileop.name.map((e=>({type:"file",name:e,mtime:n})))),console.debug(t.data),this.fileop.name="",this.fileop.folder="",this.fileop.operate=""}else this.$message.error(`${this.fileop.name.join(", ")} ${e} 失败\n${t.data.message||t.data}`),console.error(t.data)})).catch((t=>{this.$message.error(`${this.fileop.name.join(", ")} ${e} 失败\n${t.message}`),console.error(t)})).finally(t)},copyFiles(){console.debug(this.filecheck,"ready to copy"),this.fileop.name=[...this.filecheck],this.fileop.folder=this.fullpath,this.fileop.operate="copy",this.$message.success("已获取",this.fileop.name.join(", "),"文件地址\n请选择目标文件夹后进行粘贴")},moveFiles(){console.debug(this.filecheck,"ready to move"),this.fileop.name=[...this.filecheck],this.fileop.folder=this.fullpath,this.fileop.operate="move",this.$message.success("已获取",this.fileop.name.join(", "),"文件地址\n请选择目标文件夹后进行粘贴")},deltFiles(){this.eDel([...this.filecheck])},zipFiles(){this.eZip(this.filecheck.map((e=>this.fullpath+"/"+e)),this.fullpath,this.$uStr.surlName(this.fullpath)+".zip"),this.fileMCheck("none")},unzipFile(){this.isSingleCheck?(this.eUnZip(this.fullpath,this.filecheck[0]),this.fileMCheck("none")):this.$message.error("请选择单个 zip 文件进行解压")},fileDownload(){if(!this.filedownloadurl||!1===/^https?:\/\/\S{4}/.test(this.filedownloadurl))return void this.$message.error("该远程文件链接有误",this.filedownloadurl);let e=this.filedownloadurl.match(/ -rename(=| )([^\- ]+)/),t="",n="";e&&e[2]?(t=e[2].replace(/^(\\|\/)+/,""),n=this.filedownloadurl.split(" ")[0]):(t=this.$uStr.surlName(this.filedownloadurl),n=this.filedownloadurl);let r=this.curtshow.list.findIndex((e=>e.name===t));if(-1!==r&&!confirm(t+" 已存在,是否继续?(将会覆盖原文件"))return;Bo.connections.has("efss")||Bo.Recv("efss",(e=>{if("message"===e.type){const{progress:t,mid:n}=e.data;this.$message.success(t,{mid:n})}}));const s=this.$message.loading(`${t} 下载中...`,0);this.$axios.post("/rpc",{method:"download",params:[n,this.fullpath,t]}).then((e=>{0===e.data.rescode?(this.$message.success(t,"下载成功"),-1===r?this.curtshow.list.push({type:"file",name:this.$uStr.surlName(e.data.resdata)||t,mtime:this.$sTime()}):this.curtshow.list[r].mtime=this.$sTime()):1===e.data.rescode?this.$message.success(e.data.resdata||t,"下载任务已存在,请尝试其他链接或目录/文件名"):this.$message.error(t,"下载失败",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("下载失败",e.message),console.error(n,"下载失败",e)})).finally(s)},fileMCheck(e="none"){if("all"===e)this.filecheck=this.showlist.map((e=>e.name));else this.filecheck.length&&this.filecheck.splice(0)}}};const Ho=wi(Uo,yi,[],!1,null,"2fb82df5",null).exports;function Vo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ko}=Object.prototype,{getPrototypeOf:qo}=Object,Wo=(Go=Object.create(null),e=>{const t=Ko.call(e);return Go[t]||(Go[t]=t.slice(8,-1).toLowerCase())});var Go;const Jo=e=>(e=e.toLowerCase(),t=>Wo(t)===e),Xo=e=>t=>typeof t===e,{isArray:Zo}=Array,Yo=Xo("undefined");const Qo=Jo("ArrayBuffer");const ea=Xo("string"),ta=Xo("function"),na=Xo("number"),ra=e=>null!==e&&"object"==typeof e,sa=e=>{if("object"!==Wo(e))return!1;const t=qo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ia=Jo("Date"),oa=Jo("File"),aa=Jo("Blob"),ca=Jo("FileList"),la=Jo("URLSearchParams"),[ua,fa,da,pa]=["ReadableStream","Request","Response","Headers"].map(Jo);function ha(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Zo(e))for(r=0,s=e.length;r0;)if(r=n[s],t===r.toLowerCase())return r;return null}const va="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ga=e=>!Yo(e)&&e!==va;const ya=(ba="undefined"!=typeof Uint8Array&&qo(Uint8Array),e=>ba&&e instanceof ba);var ba;const _a=Jo("HTMLFormElement"),wa=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ka=Jo("RegExp"),Ca=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ha(n,((n,s)=>{let i;!1!==(i=t(n,s,e))&&(r[s]=i||n)})),Object.defineProperties(e,r)},xa="abcdefghijklmnopqrstuvwxyz",$a="0123456789",Sa={DIGIT:$a,ALPHA:xa,ALPHA_DIGIT:xa+xa.toUpperCase()+$a};const Ea=Jo("AsyncFunction"),Oa=(Ta="function"==typeof setImmediate,Aa=ta(va.postMessage),Ta?setImmediate:Aa?((e,t)=>(va.addEventListener("message",(({source:n,data:r})=>{n===va&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),va.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Ta,Aa;const Ra="undefined"!=typeof queueMicrotask?queueMicrotask.bind(va):"undefined"!=typeof process&&process.nextTick||Oa,Na={isArray:Zo,isArrayBuffer:Qo,isBuffer:function(e){return null!==e&&!Yo(e)&&null!==e.constructor&&!Yo(e.constructor)&&ta(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ta(e.append)&&("formdata"===(t=Wo(e))||"object"===t&&ta(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qo(e.buffer),t},isString:ea,isNumber:na,isBoolean:e=>!0===e||!1===e,isObject:ra,isPlainObject:sa,isReadableStream:ua,isRequest:fa,isResponse:da,isHeaders:pa,isUndefined:Yo,isDate:ia,isFile:oa,isBlob:aa,isRegExp:ka,isFunction:ta,isStream:e=>ra(e)&&ta(e.pipe),isURLSearchParams:la,isTypedArray:ya,isFileList:ca,forEach:ha,merge:function e(){const{caseless:t}=ga(this)&&this||{},n={},r=(r,s)=>{const i=t&&ma(n,s)||s;sa(n[i])&&sa(r)?n[i]=e(n[i],r):sa(r)?n[i]=e({},r):Zo(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(ha(t,((t,r)=>{n&&ta(t)?e[r]=Vo(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,i,o;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&qo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Wo,kindOfTest:Jo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Zo(e))return e;let t=e.length;if(!na(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_a,hasOwnProperty:wa,hasOwnProp:wa,reduceDescriptors:Ca,freezeMethods:e=>{Ca(e,((t,n)=>{if(ta(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ta(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Zo(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ma,global:va,isContextDefined:ga,ALPHABET:Sa,generateString:(e=16,t=Sa.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&ta(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ra(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=Zo(e)?[]:{};return ha(e,((e,t)=>{const i=n(e,r+1);!Yo(i)&&(s[t]=i)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Ea,isThenable:e=>e&&(ra(e)||ta(e))&&ta(e.then)&&ta(e.catch),setImmediate:Oa,asap:Ra};function Pa(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Na.inherits(Pa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Na.toJSONObject(this.config),code:this.code,status:this.status}}});const Da=Pa.prototype,ja={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ja[e]={value:e}})),Object.defineProperties(Pa,ja),Object.defineProperty(Da,"isAxiosError",{value:!0}),Pa.from=(e,t,n,r,s,i)=>{const o=Object.create(Da);return Na.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Pa.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Ma=Pa;function La(e){return Na.isPlainObject(e)||Na.isArray(e)}function Ia(e){return Na.endsWith(e,"[]")?e.slice(0,-2):e}function za(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ia(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Fa=Na.toFlatObject(Na,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Ba=function(e,t,n){if(!Na.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Na.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Na.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Na.isSpecCompliantForm(t);if(!Na.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Na.isDate(e))return e.toISOString();if(!a&&Na.isBlob(e))throw new Ma("Blob is not supported. Use a Buffer instead.");return Na.isArrayBuffer(e)||Na.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(Na.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Na.isArray(e)&&function(e){return Na.isArray(e)&&!e.some(La)}(e)||(Na.isFileList(e)||Na.endsWith(n,"[]"))&&(a=Na.toArray(e)))return n=Ia(n),a.forEach((function(e,r){!Na.isUndefined(e)&&null!==e&&t.append(!0===o?za([n],r,i):null===o?n:n+"[]",c(e))})),!1;return!!La(e)||(t.append(za(s,n,i),c(e)),!1)}const u=[],f=Object.assign(Fa,{defaultVisitor:l,convertValue:c,isVisitable:La});if(!Na.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Na.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Na.forEach(n,(function(n,i){!0===(!(Na.isUndefined(n)||null===n)&&s.call(t,n,Na.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t};function Ua(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Ha(e,t){this._pairs=[],e&&Ba(e,this,t)}const Va=Ha.prototype;Va.append=function(e,t){this._pairs.push([e,t])},Va.toString=function(e){const t=e?function(t){return e.call(this,t,Ua)}:Ua;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ka=Ha;function qa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wa(e,t,n){if(!t)return e;const r=n&&n.encode||qa,s=n&&n.serialize;let i;if(i=s?s(t,n):Na.isURLSearchParams(t)?t.toString():new Ka(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ga=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Na.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ja={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xa={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ka,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Za="undefined"!=typeof window&&"undefined"!=typeof document,Ya="object"==typeof navigator&&navigator||void 0,Qa=Za&&(!Ya||["ReactNative","NativeScript","NS"].indexOf(Ya.product)<0),ec="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tc=Za&&window.location.href||"http://localhost",nc={...r,...Xa};const rc=function(e){function t(e,n,r,s){let i=e[s++];if("__proto__"===i)return!0;const o=Number.isFinite(+i),a=s>=e.length;if(i=!i&&Na.isArray(r)?r.length:i,a)return Na.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!o;r[i]&&Na.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],s)&&Na.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r{t(function(e){return Na.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const sc={transitional:Ja,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Na.isObject(e);s&&Na.isHTMLForm(e)&&(e=new FormData(e));if(Na.isFormData(e))return r?JSON.stringify(rc(e)):e;if(Na.isArrayBuffer(e)||Na.isBuffer(e)||Na.isStream(e)||Na.isFile(e)||Na.isBlob(e)||Na.isReadableStream(e))return e;if(Na.isArrayBufferView(e))return e.buffer;if(Na.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ba(e,new nc.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return nc.isNode&&Na.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Na.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ba(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Na.isString(e))try{return(t||JSON.parse)(e),Na.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||sc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Na.isResponse(e)||Na.isReadableStream(e))return e;if(e&&Na.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ma.from(e,Ma.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nc.classes.FormData,Blob:nc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Na.forEach(["delete","get","head","post","put","patch"],(e=>{sc.headers[e]={}}));const ic=sc,oc=Na.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ac=Symbol("internals");function cc(e){return e&&String(e).trim().toLowerCase()}function lc(e){return!1===e||null==e?e:Na.isArray(e)?e.map(lc):String(e)}function uc(e,t,n,r,s){return Na.isFunction(r)?r.call(this,t,n):(s&&(t=n),Na.isString(t)?Na.isString(r)?-1!==t.indexOf(r):Na.isRegExp(r)?r.test(t):void 0:void 0)}class fc{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=cc(t);if(!s)throw new Error("header name must be a non-empty string");const i=Na.findKey(r,s);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=lc(e))}const i=(e,t)=>Na.forEach(e,((e,n)=>s(e,n,t)));if(Na.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Na.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&oc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Na.isHeaders(e))for(const[t,r]of e.entries())s(r,t,n);else null!=e&&s(t,e,n);return this}get(e,t){if(e=cc(e)){const n=Na.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Na.isFunction(t))return t.call(this,e,n);if(Na.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cc(e)){const n=Na.findKey(this,e);return!(!n||void 0===this[n]||t&&!uc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=cc(e)){const s=Na.findKey(n,e);!s||t&&!uc(0,n[s],s,t)||(delete n[s],r=!0)}}return Na.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!uc(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Na.forEach(this,((r,s)=>{const i=Na.findKey(n,s);if(i)return t[i]=lc(r),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();o!==s&&delete t[s],t[o]=lc(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Na.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Na.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ac]=this[ac]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=cc(e);t[r]||(!function(e,t){const n=Na.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return Na.isArray(e)?e.forEach(r):r(e),this}}fc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Na.reduceDescriptors(fc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Na.freezeMethods(fc);const dc=fc;function pc(e,t){const n=this||ic,r=t||n,s=dc.from(r.headers);let i=r.data;return Na.forEach(e,(function(e){i=e.call(n,i,s.normalize(),t?t.status:void 0)})),s.normalize(),i}function hc(e){return!(!e||!e.__CANCEL__)}function mc(e,t,n){Ma.call(this,null==e?"canceled":e,Ma.ERR_CANCELED,t,n),this.name="CanceledError"}Na.inherits(mc,Ma,{__CANCEL__:!0});const vc=mc;function gc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ma("Request failed with status code "+n.status,[Ma.ERR_BAD_REQUEST,Ma.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const yc=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,i=0,o=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[o];s||(s=c),n[i]=a,r[i]=c;let u=o,f=0;for(;u!==i;)f+=n[u++],u%=e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s{s=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=i?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),i-a)))},()=>n&&o(n)]},_c=(e,t,n=3)=>{let r=0;const s=yc(50,250);return bc((n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,a=i-r,c=s(a);r=i;e({loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&i<=o?(o-i)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},wc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kc=e=>(...t)=>Na.asap((()=>e(...t))),Cc=nc.hasStandardBrowserEnv?function(){const e=nc.navigator&&/(msie|trident)/i.test(nc.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=Na.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},xc=nc.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];Na.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Na.isString(r)&&o.push("path="+r),Na.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $c(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Sc=e=>e instanceof dc?{...e}:e;function Ec(e,t){t=t||{};const n={};function r(e,t,n){return Na.isPlainObject(e)&&Na.isPlainObject(t)?Na.merge.call({caseless:n},e,t):Na.isPlainObject(t)?Na.merge({},t):Na.isArray(t)?t.slice():t}function s(e,t,n){return Na.isUndefined(t)?Na.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!Na.isUndefined(t))return r(void 0,t)}function o(e,t){return Na.isUndefined(t)?Na.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,i){return i in t?r(n,s):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>s(Sc(e),Sc(t),!0)};return Na.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||s,o=i(e[r],t[r],r);Na.isUndefined(o)&&i!==a||(n[r]=o)})),n}const Oc=e=>{const t=Ec({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=dc.from(a),t.url=Wa($c(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Na.isFormData(r))if(nc.hasStandardBrowserEnv||nc.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(nc.hasStandardBrowserEnv&&(s&&Na.isFunction(s)&&(s=s(t)),s||!1!==s&&Cc(t.url))){const e=i&&o&&xc.read(o);e&&a.set(i,e)}return t},Tc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Oc(e);let s=r.data;const i=dc.from(r.headers).normalize();let o,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function v(){if(!m)return;const r=dc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());gc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Ma("Request aborted",Ma.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Ma("Network Error",Ma.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||Ja;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ma(t,s.clarifyTimeoutError?Ma.ETIMEDOUT:Ma.ECONNABORTED,e,m)),m=null},void 0===s&&i.setContentType(null),"setRequestHeader"in m&&Na.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Na.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=_c(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=_c(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new vc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===nc.protocols.indexOf(g)?n(new Ma("Unsupported protocol "+g+":",Ma.ERR_BAD_REQUEST,e)):m.send(s||null)}))},Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ma?t:new vc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,s(new Ma(`timeout ${t} of ms exceeded`,Ma.ETIMEDOUT))}),t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)})),e=null)};e.forEach((e=>e.addEventListener("abort",s)));const{signal:a}=r;return a.unsubscribe=()=>Na.asap(o),a}},Rc=function*(e,t){let n=e.byteLength;if(!t||n{const s=async function*(e,t){for await(const n of Nc(e))yield*Rc(n,t)}(e,t);let i,o=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},Dc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,jc=Dc&&"function"==typeof ReadableStream,Mc=Dc&&("function"==typeof TextEncoder?(Lc=new TextEncoder,e=>Lc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Lc;const Ic=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},zc=jc&&Ic((()=>{let e=!1;const t=new Request(nc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Fc=jc&&Ic((()=>Na.isReadableStream(new Response("").body))),Bc={stream:Fc&&(e=>e.body)};var Uc;Dc&&(Uc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Bc[e]&&(Bc[e]=Na.isFunction(Uc[e])?t=>t[e]():(t,n)=>{throw new Ma(`Response type '${e}' is not supported`,Ma.ERR_NOT_SUPPORT,n)})})));const Hc=async(e,t)=>{const n=Na.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Na.isBlob(e))return e.size;if(Na.isSpecCompliantForm(e)){const t=new Request(nc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Na.isArrayBufferView(e)||Na.isArrayBuffer(e)?e.byteLength:(Na.isURLSearchParams(e)&&(e+=""),Na.isString(e)?(await Mc(e)).byteLength:void 0)})(t):n},Vc=Dc&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Oc(e);l=l?(l+"").toLowerCase():"text";let p,h=Ac([s,i&&i.toAbortSignal()],o);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(c&&zc&&"get"!==n&&"head"!==n&&0!==(v=await Hc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Na.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=wc(v,_c(kc(c)));r=Pc(n.body,65536,e,t)}}Na.isString(f)||(f=f?"include":"omit");const s="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:s?f:void 0});let i=await fetch(p);const o=Fc&&("stream"===l||"response"===l);if(Fc&&(a||o&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Na.toFiniteNumber(i.headers.get("content-length")),[n,r]=a&&wc(t,_c(kc(a),!0))||[];i=new Response(Pc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let g=await Bc[Na.findKey(Bc,l)||"text"](i,e);return!o&&m&&m(),await new Promise(((t,n)=>{gc(t,n,{data:g,headers:dc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ma("Network Error",Ma.ERR_NETWORK,e,p),{cause:t.cause||t});throw Ma.from(t,t&&t.code,e,p)}}),Kc={http:null,xhr:Tc,fetch:Vc};Na.forEach(Kc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const qc=e=>`- ${e}`,Wc=e=>Na.isFunction(e)||null===e||!1===e,Gc=e=>{e=Na.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(qc).join("\n"):" "+qc(e[0]):"as no adapter specified";throw new Ma("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Jc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vc(null,e)}function Xc(e){Jc(e),e.headers=dc.from(e.headers),e.data=pc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Gc(e.adapter||ic.adapter)(e).then((function(t){return Jc(e),t.data=pc.call(e,e.transformResponse,t),t.headers=dc.from(t.headers),t}),(function(t){return hc(t)||(Jc(e),t&&t.response&&(t.response.data=pc.call(e,e.transformResponse,t.response),t.response.headers=dc.from(t.response.headers))),Promise.reject(t)}))}const Zc="1.7.7",Yc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Yc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Qc={};Yc.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,i)=>{if(!1===e)throw new Ma(r(s," has been removed"+(t?" in "+t:"")),Ma.ERR_DEPRECATED);return t&&!Qc[s]&&(Qc[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,i)}};const el={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ma("options must be an object",Ma.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const t=e[i],n=void 0===t||o(t,i,e);if(!0!==n)throw new Ma("option "+i+" must be "+n,Ma.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ma("Unknown option "+i,Ma.ERR_BAD_OPTION)}},validators:Yc},tl=el.validators;class nl{constructor(e){this.defaults=e,this.interceptors={request:new Ga,response:new Ga}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ec(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&el.assertOptions(n,{silentJSONParsing:tl.transitional(tl.boolean),forcedJSONParsing:tl.transitional(tl.boolean),clarifyTimeoutError:tl.transitional(tl.boolean)},!1),null!=r&&(Na.isFunction(r)?t.paramsSerializer={serialize:r}:el.assertOptions(r,{encode:tl.function,serialize:tl.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&Na.merge(s.common,s[t.method]);s&&Na.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=dc.concat(i,s);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,f=0;if(!a){const e=[Xc.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new vc(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new sl((function(t){e=t})),cancel:e}}}const il=sl;const ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ol).forEach((([e,t])=>{ol[t]=e}));const al=ol;const cl=function e(t){const n=new rl(t),r=Vo(rl.prototype.request,n);return Na.extend(r,rl.prototype,n,{allOwnKeys:!0}),Na.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ec(t,n))},r}(ic);cl.Axios=rl,cl.CanceledError=vc,cl.CancelToken=il,cl.isCancel=hc,cl.VERSION=Zc,cl.toFormData=Ba,cl.AxiosError=Ma,cl.Cancel=cl.CanceledError,cl.all=function(e){return Promise.all(e)},cl.spread=function(e){return function(t){return e.apply(null,t)}},cl.isAxiosError=function(e){return Na.isObject(e)&&!0===e.isAxiosError},cl.mergeConfig=Ec,cl.AxiosHeaders=dc,cl.formToJSON=e=>rc(Na.isHTMLForm(e)?new FormData(e):e),cl.getAdapter=Gc,cl.HttpStatusCode=al,cl.default=cl;const ll=cl,ul=JSON.parse('{"join_gap":" ","en":"英文","zh":"中文","a":"a","access":"ACCESS","add":"ADD","addition":"ADDITION","address":"ADDRESS","agroup":"A GROUP","all":"ALL","allow":"ALLOW","allowed":"ALLOWED","and":"AND","arch":"ARCH","as":"AS","author":"AUTHOR","auto":"AUTO","autorun":"AUTO","backup":"BACKUP","belong":"BELONG","blacklist":"BLACKLIST","bfreq":"before request","bfres":"before response","browser":"browser","cache":"CACHE","cancel":"CANCEL","certificate":"CERTIFICATE","check":"CHECK","checkall":"CHECK ALL","checked":"CHECKED","checked_short":"CKD","checknone":"CHECK NONE","choose":"CHOOSE","clear":"CLEAR","clickrun":"CLICK","close":"CLOSE","closed":"CLOSED","cmd":"CMD","con_clients":"Connected Clients","confirm":"CONFIRM","connected":"CONNECTED","content":"CONTENT","countdown":"countdown","cron":"cron","current":"CURRENT","date":"DATE","default":"DEFAULT","delete":"DELETE","detail":"detail","disable":"DISABLE","disable_short":"DE","disabled":"DISABLED","disconnected":"DISCONNECTED","document":"document","donation":"DONATION","download":"DOWNLOAD","dthave":"DON\'T HAVE","edit":"EDIT","editexit":"EXIT","editmode":"EDIT","efss_file_manage":"EFSS FILE MANAGE","enable":"ENABLE","enable_short":"EN","enabled":"ENABLED","every":"EVERY","export":"EXPORT","exportsub":"EXPORT","fetch":"FETCH","file":"FILE","files":"FILES","five":"five","forbid":"FORBID","force":"FORCE","format":"FORMAT","generate":"GENERATE","get":"GET","homepage":"HOMEPAGE","host":"HOST","host_info":"Host Information","illegal":"illegal","import":"IMPORT","input":"input","install":"INSTALL","jsruntimes":"Script Run Times","language":"LANGUAGE","last":"LAST","last_three":"last three","level":"LEVEL","list":"LIST","local":"LOCAL","logs":"LOGS","logs_of_script":"LOGS OF SCRIPT","make":"MAKE","manage":"MANAGE","match":"MATCH","memory":"MEMORY","memoryusage":"Memory Usage","mock":"MOCK","modifyto":"MODIFY TO","more":"more","moveto":"MOVE TO","murl":"MATCH URL","name":"NAME","new":"NEW","neweapp":"NEW","next":"NEXT","non-matched":"NON-MATCHED","note":"NOTE","notify":"NOTIFY","noupdate":"no update","on":"on","open":"OPEN","operate":"OPERATE","operate_short":"OP","optional":"optional","or":"or","overview":"OVERVIEW","param":"PARAM","persistence":"Persistence","platform":"PLATFORM","please":"please","port":"PORT","prev":"PREV","proxy":"PROXY","push":"PUSH","random":"random","redirect":"REDIRECT","refresh":"REFRESH","regexp":"REGEXP","reject":"REJECT","remote":"REMOTE","request":"REQUEST","repeat":"repeat","replace":"REPLACE","rest":"rest","restart":"RESTART","rewrite":"REWRITE","root":"ROOT","rule":"RULE","run":"RUN","save":"SAVE","script":"SCRIPT","search":"SEARCH","second":"second","seconds":"seconds","security":"SECURITY","self-signed":"SELF-SIGNED","send":"SEND","setting":"SETTING","setting_of":"SETTING","shortcut":"shortcut","show":"show","sign":"SIGN","six":"six","skip":"SKIP","sponsors":"Sponsors","start":"START","startat":"START AT","status":"STATUS","status_short":"ST","stop":"STOP","style":"STYLE","sub":"SUB","target":"TARGET","task":"TASK","temp":"TEMP","test":"TEST","time":"TIME","timed":"TIMED","times":"times","timing":"TIMING","to":"TO","toggle":"TOGGLE","update":"UPDATE","upload":"UPLOAD","url":"URL","user":"USER","valid":"VALID","version":"VERSION","web":"WEB","whitelist":"WHITELIST"}'),fl=JSON.parse('{"join_gap":"","en":"EN","zh":"zh-CN","a":"一个","access":"访问","add":"添加","addition":"新增","address":"地址","agroup":"某分组","all":"全部","allow":"允许","allowed":"允许","and":"并","arch":"架构","as":"成为","author":"作者","auto":"自动","autorun":"自动运行","backup":"备份","belong":"关联","bfreq":"网络请求前","bfres":"数据返回前","blacklist":"黑名单","browser":"浏览器","cache":"缓存","cancel":"取消","certificate":"证书","check":"查看","checkall":"全部选择","checked":"选中","checked_short":"选择","checknone":"全都不选","choose":"选择","clear":"清空","clickrun":"点击运行","close":"关闭","closed":"已关闭","cmd":"指令","con_clients":"客户端连接数","confirm":"确定","connected":"已连接","content":"内容","countdown":"倒计时","cron":"cron定时","current":"当前","date":"日期","default":"默认","delete":"删除","detail":"详细说明","disable":"关闭","disable_short":"禁用","disabled":"已关闭","disconnected":"已断开","document":"说明文档","donation":"赞助打赏","download":"下载","dthave":"并没有","edit":"编辑","editexit":"退出编辑","editmode":"编辑模式","efss_file_manage":"EFSS 文件管理界面","enable":"启用","enable_short":"启用","enabled":"已启用","every":"每","export":"导出","exportsub":"导出订阅","fetch":"获取内容","file":"文件","files":"文件数","five":"五","forbid":"禁止","force":"强制","format":"格式","generate":"生成","get":"获取","homepage":"主页地址","host":"域名","host_info":"服务器相关信息","illegal":"非法","import":"导入","input":"输入","install":"安装","jsruntimes":"脚本运行总次数","language":"语言偏好","last":"最近","last_three":"后三项","level":"等级","list":"列表","local":"本地","logs":"日志","logs_of_script":"查看程序运行日志","make":"生成","manage":"管理","match":"匹配","memory":"内存","memoryusage":"内存使用情况","mock":"模拟","modifyto":"修改方式","more":"更多","moveto":"移动到","murl":"匹配链接","name":"名称","new":"新建","neweapp":"新建应用","next":"下一个","non-matched":"未匹配","note":"备注","notify":"通知","noupdate":"不自动更新","on":"在","open":"打开","operate":"操作","operate_short":"操作","optional":"可选择项","or":"或","overview":"基础信息","param":"参数","persistence":"常量","platform":"平台","please":"请","port":"端口","prev":"上一个","proxy":"代理","push":"推送","random":"随机","redirect":"重定向","refresh":"刷新","regexp":"正则表达式","reject":"阻止","remote":"远程","request":"请求","repeat":"重复","replace":"替换","rest":"剩余","restart":"重启","rewrite":"重写","root":"根","rule":"规则","run":"运行","save":"保存","script":"脚本","search":"搜索","second":"秒","seconds":"秒数","security":"安全","self-signed":"自签","send":"发送","setting":"设置","setting_of":"相关设置","shortcut":"快捷键","show":"显示","sign":"签发","six":"六","skip":"跳过","sponsors":"广告","start":"开始","startat":"启动时间","status":"状态","status_short":"状态","stop":"停止","style":"风格","sub":"订阅","target":"目标","task":"任务","temp":"临时","test":"测试","time":"时间","timed":"定时","times":"次数","timing":"时间点","to":"至","toggle":"反转","update":"更新","upload":"上传","url":"链接","user":"用户","valid":"有效","version":"后台版本","web":"网络","whitelist":"白名单"}');const dl={locale:function(){let e="";return location.search&&(e=new URLSearchParams(location.search).get("lang")),e||localStorage.getItem("lang")||navigator.language}().startsWith("zh")?"zh-CN":"en",fallbackLocale:"en"},pl={en:ul,"zh-CN":fl};nr.prototype.$axios=ll,nr.prototype.$sType=Ei,nr.prototype.$sString=Ti,nr.prototype.$sJson=Oi,nr.prototype.$sTime=Li,nr.prototype.$logHead=Fi,nr.prototype.$uStr=e,nr.prototype.$uApi=t,nr.prototype.$message=To.message,nr.prototype.$t=function(e){return(pl[dl.locale]||pl[dl.fallbackLocale])[e]||e},nr.prototype.$ta=function(...e){const t=pl[dl.locale]||pl[dl.fallbackLocale],n=t.join_gap;return e.map((e=>t[e]||e)).join(n)},nr.config.productionTip=!1,new nr({el:"#efss",render:e=>e(Ho)})})()})(); \ No newline at end of file +var s=Object.freeze({}),i=Array.isArray;function o(e){return null==e}function a(e){return null!=e}function c(e){return!0===e}function l(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return"function"==typeof e}function f(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function h(e){return"[object RegExp]"===d.call(e)}function m(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,y,2):String(e)}function y(e,t){return t&&t.__v_isRef?t.value:t}function b(e){var t=parseFloat(e);return isNaN(t)?e:t}function _(e,t){for(var n=Object.create(null),r=e.split(","),s=0;s-1)return e.splice(r,1)}}var C=Object.prototype.hasOwnProperty;function x(e,t){return C.call(e,t)}function $(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var S=/-(\w)/g,E=$((function(e){return e.replace(S,(function(e,t){return t?t.toUpperCase():""}))})),O=$((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,A=$((function(e){return e.replace(T,"-$1").toLowerCase()}));var R=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function N(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function P(e,t){for(var n in t)e[n]=t[n];return e}function D(e){for(var t={},n=0;n0,te=Y&&Y.indexOf("edge/")>0;Y&&Y.indexOf("android");var ne=Y&&/iphone|ipad|ipod|ios/.test(Y);Y&&/chrome\/\d+/.test(Y),Y&&/phantomjs/.test(Y);var re,se=Y&&Y.match(/firefox\/(\d+)/),ie={}.watch,oe=!1;if(Z)try{var ae={};Object.defineProperty(ae,"passive",{get:function(){oe=!0}}),window.addEventListener("test-passive",null,ae)}catch(e){}var ce=function(){return void 0===re&&(re=!Z&&void 0!==n.g&&(n.g.process&&"server"===n.g.process.env.VUE_ENV)),re},le=Z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ue(e){return"function"==typeof e&&/native code/.test(e.toString())}var fe,de="undefined"!=typeof Symbol&&ue(Symbol)&&"undefined"!=typeof Reflect&&ue(Reflect.ownKeys);fe="undefined"!=typeof Set&&ue(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var pe=null;function he(e){void 0===e&&(e=null),e||pe&&pe._scope.off(),pe=e,e&&e._scope.on()}var me=function(){function e(e,t,n,r,s,i,o,a){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=s,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=o,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new me;return t.text=e,t.isComment=!0,t};function ge(e){return new me(void 0,void 0,void 0,String(e))}function ye(e){var t=new me(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var be=0,_e=[],we=function(){function e(){this._pending=!1,this.id=be++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,_e.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,r=t.length;n0&&(Qe((r=et(r,"".concat(t||"","_").concat(n)))[0])&&Qe(u)&&(f[s]=ge(u.text+r[0].text),r.shift()),f.push.apply(f,r)):l(r)?Qe(u)?f[s]=ge(u.text+r):""!==r&&f.push(ge(r)):Qe(r)&&Qe(u)?f[s]=ge(u.text+r.text):(c(e._isVList)&&a(r.tag)&&o(r.key)&&a(t)&&(r.key="__vlist".concat(t,"_").concat(n,"__")),f.push(r)));return f}function tt(e,t){var n,r,s,o,c=null;if(i(e)||"string"==typeof e)for(c=new Array(e.length),n=0,r=e.length;n0,a=t?!!t.$stable:!o,c=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==s&&c===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=_t(e,n,l,t[l]))}else i={};for(var u in n)u in i||(i[u]=wt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),G(i,"$stable",a),G(i,"$key",c),G(i,"$hasNormal",o),i}function _t(e,t,n,r){var s=function(){var t=pe;he(e);var n=arguments.length?r.apply(null,arguments):r({}),s=(n=n&&"object"==typeof n&&!i(n)?[n]:Ye(n))&&n[0];return he(t),n&&(!s||1===n.length&&s.isComment&&!yt(s))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:s,enumerable:!0,configurable:!0}),s}function wt(e,t){return function(){return e[t]}}function kt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};G(t,"_v_attr_proxy",!0),Ct(t,e.$attrs,s,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||Ct(e._listenersProxy={},e.$listeners,s,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||$t(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:R(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Ue(e,t,n)}))}}}function Ct(e,t,n,r,s){var i=!1;for(var o in t)o in e?t[o]!==n[o]&&(i=!0):(i=!0,xt(e,o,r,s));for(var o in e)o in t||(i=!0,delete e[o]);return i}function xt(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function $t(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var St=null;function Et(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),f(e)?t.extend(e):e}function Ot(e){if(i(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(yn=function(){return bn.now()})}var _n=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function wn(){var e,t;for(gn=yn(),mn=!0,fn.sort(_n),vn=0;vnvn&&fn[n].id>e.id;)n--;fn.splice(n+1,0,e)}else fn.push(e);hn||(hn=!0,qt(wn))}}function Cn(e,t){if(e){for(var n=Object.create(null),r=de?Reflect.ownKeys(e):Object.keys(e),s=0;s-1)if(i&&!x(s,"default"))o=!1;else if(""===o||o===A(e)){var c=Kn(String,s.type);(c<0||a-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!h(e)&&e.test(t)}function or(e,t){var n=e.cache,r=e.keys,s=e._vnode,i=e.$vnode;for(var o in n){var a=n[o];if(a){var c=a.name;c&&!t(c)&&ar(n,o,r,s)}}i.componentOptions.children=void 0}function ar(e,t,n,r){var s=e[t];!s||r&&s.tag===r.tag||s.componentInstance.$destroy(),e[t]=null,k(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=er++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ke(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var s=r.componentOptions;n.propsData=s.propsData,n._parentListeners=s.listeners,n._renderChildren=s.children,n._componentTag=s.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=zn(tr(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&rn(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=vt(t._renderChildren,r),e.$scopedSlots=n?bt(e.$parent,n.data.scopedSlots,e.$slots):s,e._c=function(t,n,r,s){return Rt(e,t,n,r,s,!1)},e.$createElement=function(t,n,r,s){return Rt(e,t,n,r,s,!0)};var i=n&&n.data;De(e,"$attrs",i&&i.attrs||s,null,!0),De(e,"$listeners",t._parentListeners||s,null,!0)}(t),un(t,"beforeCreate",void 0,!1),function(e){var t=Cn(e.$options.inject,e);t&&(Ae(!1),Object.keys(t).forEach((function(n){De(e,n,t[n])})),Ae(!0))}(t),Gn(t),function(e){var t=e.$options.provide;if(t){var n=u(t)?t.call(e):t;if(!f(n))return;for(var r=qe(e),s=de?Reflect.ownKeys(n):Object.keys(n),i=0;i1?N(n):n;for(var r=N(arguments,1),s='event handler for "'.concat(e,'"'),i=0,o=n.length;iparseInt(this.max)&&ar(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ar(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){or(e,(function(e){return ir(t,e)}))})),this.$watch("exclude",(function(t){or(e,(function(e){return!ir(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ot(e),n=t&&t.componentOptions;if(n){var r=sr(n),s=this.include,i=this.exclude;if(s&&(!r||!ir(s,r))||i&&r&&ir(i,r))return t;var o=this.cache,a=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;o[c]?(t.componentInstance=o[c].componentInstance,k(a,c),a.push(c)):(this.vnodeToCache=t,this.keyToCache=c),t.data.keepAlive=!0}return t||e&&e[0]}},ur={KeepAlive:lr};!function(e){var t={get:function(){return K}};Object.defineProperty(e,"config",t),e.util={warn:Nn,extend:P,mergeOptions:zn,defineReactive:De},e.set=je,e.delete=Me,e.nextTick=qt,e.observable=function(e){return Pe(e),e},e.options=Object.create(null),H.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,P(e.options.components,ur),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=N(arguments,1);return n.unshift(this),u(e.install)?e.install.apply(e,n):u(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=zn(this.options,e),this}}(e),rr(e),function(e){H.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&u(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(nr),Object.defineProperty(nr.prototype,"$isServer",{get:ce}),Object.defineProperty(nr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(nr,"FunctionalRenderContext",{value:xn}),nr.version="2.7.16";var fr=_("style,class"),dr=_("input,textarea,option,select,progress"),pr=_("contenteditable,draggable,spellcheck"),hr=_("events,caret,typing,plaintext-only"),mr=_("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),vr="http://www.w3.org/1999/xlink",gr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},yr=function(e){return gr(e)?e.slice(6,e.length):""},br=function(e){return null==e||!1===e};function _r(e){for(var t=e.data,n=e,r=e;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=wr(r.data,t));for(;a(n=n.parent);)n&&n.data&&(t=wr(t,n.data));return function(e,t){if(a(e)||a(t))return kr(e,Cr(t));return""}(t.staticClass,t.class)}function wr(e,t){return{staticClass:kr(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function kr(e,t){return e?t?e+" "+t:e:t||""}function Cr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,s=e.length;r-1?Wr(e,t,n):mr(t)?br(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):pr(t)?e.setAttribute(t,function(e,t){return br(t)||"false"===t?"false":"contenteditable"===e&&hr(t)?t:"true"}(t,n)):gr(t)?br(n)?e.removeAttributeNS(vr,yr(t)):e.setAttributeNS(vr,t,n):Wr(e,t,n)}function Wr(e,t,n){if(br(n))e.removeAttribute(t);else{if(Q&&!ee&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Gr={create:Kr,update:Kr};function Jr(e,t){var n=t.elm,r=t.data,s=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(s)||o(s.staticClass)&&o(s.class)))){var i=_r(t),c=n._transitionClasses;a(c)&&(i=kr(i,Cr(c))),i!==n._prevClass&&(n.setAttribute("class",i),n._prevClass=i)}}var Xr,Zr={create:Jr,update:Jr},Yr="__r",Qr="__c";function es(e,t,n){var r=Xr;return function s(){null!==t.apply(null,arguments)&&rs(e,s,n,r)}}var ts=It&&!(se&&Number(se[1])<=53);function ns(e,t,n,r){if(ts){var s=gn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=s||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Xr.addEventListener(e,t,oe?{capture:n,passive:r}:n)}function rs(e,t,n,r){(r||Xr).removeEventListener(e,t._wrapper||t,n)}function ss(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Xr=t.elm||e.elm,function(e){if(a(e[Yr])){var t=Q?"change":"input";e[t]=[].concat(e[Yr],e[t]||[]),delete e[Yr]}a(e[Qr])&&(e.change=[].concat(e[Qr],e.change||[]),delete e[Qr])}(n),Je(n,r,ns,rs,es,t.context),Xr=void 0}}var is,os={create:ss,update:ss,destroy:function(e){return ss(e,Dr)}};function as(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,s=t.elm,i=e.data.domProps||{},l=t.data.domProps||{};for(n in(a(l.__ob__)||c(l._v_attr_proxy))&&(l=t.data.domProps=P({},l)),i)n in l||(s[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===i[n])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===n&&"PROGRESS"!==s.tagName){s._value=r;var u=o(r)?"":String(r);cs(s,u)&&(s.value=u)}else if("innerHTML"===n&&Sr(s.tagName)&&o(s.innerHTML)){(is=is||document.createElement("div")).innerHTML="".concat(r,"");for(var f=is.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;f.firstChild;)s.appendChild(f.firstChild)}else if(r!==i[n])try{s[n]=r}catch(e){}}}}function cs(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return b(n)!==b(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var ls={create:as,update:as},us=$((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function fs(e){var t=ds(e.style);return e.staticStyle?P(e.staticStyle,t):t}function ds(e){return Array.isArray(e)?D(e):"string"==typeof e?us(e):e}var ps,hs=/^--/,ms=/\s*!important$/,vs=function(e,t,n){if(hs.test(t))e.style.setProperty(t,n);else if(ms.test(n))e.style.setProperty(A(t),n.replace(ms,""),"important");else{var r=ys(t);if(Array.isArray(n))for(var s=0,i=n.length;s-1?t.split(ws).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Cs(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ws).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function xs(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&P(t,$s(e.name||"v")),P(t,e),t}return"string"==typeof e?$s(e):void 0}}var $s=$((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Ss=Z&&!ee,Es="transition",Os="animation",Ts="transition",As="transitionend",Rs="animation",Ns="animationend";Ss&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ts="WebkitTransition",As="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Rs="WebkitAnimation",Ns="webkitAnimationEnd"));var Ps=Z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ds(e){Ps((function(){Ps(e)}))}function js(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ks(e,t))}function Ms(e,t){e._transitionClasses&&k(e._transitionClasses,t),Cs(e,t)}function Ls(e,t,n){var r=zs(e,t),s=r.type,i=r.timeout,o=r.propCount;if(!s)return n();var a=s===Es?As:Ns,c=0,l=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++c>=o&&l()};setTimeout((function(){c0&&(n=Es,u=o,f=i.length):t===Os?l>0&&(n=Os,u=l,f=c.length):f=(n=(u=Math.max(o,l))>0?o>l?Es:Os:null)?n===Es?i.length:c.length:0,{type:n,timeout:u,propCount:f,hasTransform:n===Es&&Is.test(r[Ts+"Property"])}}function Fs(e,t){for(;e.length1}function qs(e,t){!0!==t.data.show&&Us(t)}var Ws=function(e){var t,n,r={},s=e.modules,u=e.nodeOps;for(t=0;th?b(e,o(n[g+1])?null:n[g+1].elm,n,p,g,r):p>g&&k(t,f,h)}(f,m,g,n,l):a(g)?(a(e.text)&&u.setTextContent(f,""),b(f,null,g,0,g.length-1,n)):a(m)?k(m,0,m.length-1):a(e.text)&&u.setTextContent(f,""):e.text!==t.text&&u.setTextContent(f,t.text),a(h)&&a(p=h.hook)&&a(p=p.postpatch)&&p(e,t)}}}function S(e,t,n){if(c(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,o.selected!==i&&(o.selected=i);else if(I(Ys(o),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));s||(e.selectedIndex=-1)}}function Zs(e,t){return t.every((function(t){return!I(t,e)}))}function Ys(e){return"_value"in e?e._value:e.value}function Qs(e){e.target.composing=!0}function ei(e){e.target.composing&&(e.target.composing=!1,ti(e.target,"input"))}function ti(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ni(e){return!e.componentInstance||e.data&&e.data.transition?e:ni(e.componentInstance._vnode)}var ri={bind:function(e,t,n){var r=t.value,s=(n=ni(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&s?(n.data.show=!0,Us(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=ni(n)).data&&n.data.transition?(n.data.show=!0,r?Us(n,(function(){e.style.display=e.__vOriginalDisplay})):Hs(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,s){s||(e.style.display=e.__vOriginalDisplay)}},si={model:Gs,show:ri},ii={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function oi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?oi(Ot(t.children)):e}function ai(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var s=n._parentListeners;for(var r in s)t[E(r)]=s[r];return t}function ci(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var li=function(e){return e.tag||yt(e)},ui=function(e){return"show"===e.name},fi={name:"transition",props:ii,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(li)).length){0;var r=this.mode;0;var s=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return s;var i=oi(s);if(!i)return s;if(this._leaving)return ci(e,s);var o="__transition-".concat(this._uid,"-");i.key=null==i.key?i.isComment?o+"comment":o+i.tag:l(i.key)?0===String(i.key).indexOf(o)?i.key:o+i.key:i.key;var a=(i.data||(i.data={})).transition=ai(this),c=this._vnode,u=oi(c);if(i.data.directives&&i.data.directives.some(ui)&&(i.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,u)&&!yt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var f=u.data.transition=P({},a);if("out-in"===r)return this._leaving=!0,Xe(f,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ci(e,s);if("in-out"===r){if(yt(i))return c;var d,p=function(){d()};Xe(a,"afterEnter",p),Xe(a,"enterCancelled",p),Xe(f,"delayLeave",(function(e){d=e}))}}return s}}},di=P({tag:String,moveClass:String},ii);delete di.mode;var pi={props:di,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var s=on(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,s(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,s=this.$slots.default||[],i=this.children=[],o=ai(this),a=0;a-1?Or[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Or[e]=/HTMLUnknownElement/.test(t.toString())},P(nr.options.directives,si),P(nr.options.components,gi),nr.prototype.__patch__=Z?Ws:j,nr.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=ve),un(e,"beforeMount"),r=function(){e._update(e._render(),n)},new Qt(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&un(e,"beforeUpdate")}},!0),n=!1;var s=e._preWatchers;if(s)for(var i=0;i1,expression:"filecheck.length>1"}],staticClass:"elecBtn elecBtn--file elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.zipFiles()}}},[e._v("ZIP打包")]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.fileop.name,expression:"fileop.name"}],staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.operateFiles()}}},[e._v("粘贴")]),e._v(" "),t("button",{staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.copyFiles()}}},[e._v("复制")]),e._v(" "),t("button",{staticClass:"elecBtn greenbk elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.moveFiles()}}},[e._v("剪切")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32 emargin",on:{click:function(t){return t.preventDefault(),e.deltFiles()}}},[e._v("删除")])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.collapse.titlearrow,expression:"collapse.titlearrow"}],staticClass:"efssupload"},[t("div",{staticClass:"eflex w100 eflex--between",attrs:{title:"远程文件链接 -rename=文件名"}},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.filedownloadurl,expression:"filedownloadurl",modifiers:{trim:!0}}],staticClass:"elecTable_input wp80",attrs:{type:"text",placeholder:"远程文件链接 -rename=xxx.xx"},domProps:{value:e.filedownloadurl},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.fileDownload()},input:function(t){t.target.composing||(e.filedownloadurl=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn wp19",attrs:{title:"远程文件下载到服务器"},on:{click:function(t){return e.fileDownload()}}},[e._v("开始下载")])]),e._v(" "),t("div",{staticClass:"eflex w100 eflex--between emargin--top"},[t("div",{staticClass:"eupload w80"},[t("input",{ref:"efssfiles",staticClass:"eupload_file",attrs:{type:"file",name:"efss",multiple:""},on:{change:e.nUpload}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.upflists.length,expression:"upflists.length"}],staticClass:"eupload_span"},[e._v(e._s(e.efssfilesname))])]),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:e.eUpload}},[e._v("开始上传")])])]),e._v(" "),t("ul",{staticClass:"efsslist_content",on:{contextmenu:function(t){return t.preventDefault(),e.eMenu(t)},click:function(t){return e.fileOpdelegate(t)},keydown:function(t){return(t.type.indexOf("key")||65===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.fileMCheck("all")):null},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.fileMCheck("none"))}}},e._l(e.showlist,(function(n,r){return t("li",{key:n.name,staticClass:"efssa",class:{"efssa--directory":"directory"===n.type}},["file"===n.type?t("div",{staticClass:"efssa_check"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.filecheck,expression:"filecheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:n.name,checked:Array.isArray(e.filecheck)?e._i(e.filecheck,n.name)>-1:e.filecheck},on:{change:function(t){var r=e.filecheck,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=n.name,a=e._i(r,o);s.checked?a<0&&(e.filecheck=r.concat([o])):a>-1&&(e.filecheck=r.slice(0,a).concat(r.slice(a+1)))}else e.filecheck=i}}})]):e._e(),e._v(" "),t("span",{staticClass:"efssa_name",attrs:{"data-op":"open","data-type":n.type,"data-index":n.index,"data-name":n.name,"data-size":n.size}},[e._v(e._s(n.name))]),e._v(" "),t("span",{staticClass:"efssa_mtime",attrs:{"data-op":"mkdir"}},[e._v(e._s(e.$sTime(n.mtime)))]),e._v(" "),t("div",{staticClass:"efssa_last"},[t("span",{staticClass:"efssa_delete",attrs:{"data-op":"del","data-type":n.type,"data-index":n.index,"data-name":n.name}},[e._v("❌")]),e._v(" "),t("span",{staticClass:"efssa_span"},[e._v(e._s(n.size||(n.list?n.list.length:"")))])])])})),0)])],1)};yi._withStripped=!0;var bi=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.bShow,expression:"bShow"}],staticClass:"codeditor",class:{"codeditor--collapsed":e.collapse,"codeditor--full":e.fullscreen},style:"transform: translate("+e.tranposi[0]+"px, "+e.tranposi[1]+"px);",attrs:{draggable:e.collapse},on:{keydown:function(t){return t.type.indexOf("key")||122===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.fullscreen=!e.fullscreen)):null},dragstart:function(t){return e.dragStart(t)},dragend:function(t){return e.dragEnd(t)}}},[t("h3",{staticClass:"title title--editview"},[t("span",{staticClass:"title_close",attrs:{title:"alt+w"},on:{click:function(t){t.preventDefault(),e.bShow=!1}}},[e._v("X")]),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"按 F2 或双击可修改文件名(原文件将保留)"},on:{dblclick:function(t){return t.preventDefault(),e.nameChange()}}},[e._v(e._s(e.curtfile.path)+"/"+e._s(e.curtfile.name))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){t.preventDefault(),e.tranposi=[0,0],e.collapse=!e.collapse}}})]),e._v(" "),t("div",{staticClass:"codeditor_toolbar"},[t("ul",{staticClass:"codeditor_menu eflex"},[t("li",{staticClass:"toolbar_item"},[t("label",[e._v("自动换行")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"autoWrap"},on:{change:function(t){return e.autoWrap(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("行线显示")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"offUnder"},on:{change:function(t){return e.offUnder(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_separate"}),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("显示不可见字符")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"showInvi"},on:{change:function(t){return e.showInvi(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("Tab 宽度")]),e._v(" "),t("select",{staticClass:"elecTable_select toolbar_select",on:{change:function(t){return e.tabResize(t)}}},[t("option",{attrs:{value:"4"}},[e._v("4 个空格")]),e._v(" "),t("option",{attrs:{value:"2"}},[e._v("2 个空格")])])]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("使用空格代替 Tab")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{checked:"",type:"checkbox",name:"softTabs"},on:{change:function(t){return e.softTabs(t)}}})]),e._v(" "),t("li",{staticClass:"toolbar_separate"}),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("label",[e._v("只读模式")]),e._v(" "),t("input",{staticClass:"echeckbox",attrs:{type:"checkbox",name:"readOnly"},on:{change:function(t){return e.readOnly(t)}}})]),e._v(" "),"hex"===e.curtfile.mode?t("li",{attrs:{title:"尝试将当前内容转化为文本"}},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.hexstrToggle()}}},[e._v("文本模式")])]):e._e(),e._v(" "),t("li",{staticClass:"toolbar_item",attrs:{title:"在新标签页中查看该文件"}},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.fileView()}}},[e._v("查看源文件")])]),e._v(" "),t("li",{staticClass:"toolbar_item"},[t("button",{staticClass:"elecBtn elecBtn--h32 emargin bk_main_cl",on:{click:function(t){return e.moreSet()}}},[e._v("更多设置")])]),e._v(" "),t("li",{staticClass:"toolbar_item toolbar_item--mergebtn",attrs:{title:"仅在 https 环境下有效"}},[t("span",{staticClass:"toolbar_mergebtn",on:{click:function(t){return e.editor.selectAll()}}},[e._v("全选")]),e._v(" "),t("span",{staticClass:"toolbar_copy",on:{click:function(t){return e.copySelection()}}},[e._v("复制")]),e._v(" "),t("span",{staticClass:"toolbar_mergebtn",on:{click:function(t){return e.pasteSelection()}}},[e._v("粘贴")])])])]),e._v(" "),t("div",{attrs:{id:"aceditor"},on:{keydown:[function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.save()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.fileView()):null},function(t){return(t.type.indexOf("key")||87===t.keyCode)&&t.altKey?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.metaKey?null:void(e.bShow=!1)):null}],keyup:function(t){return t.type.indexOf("key")||113===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.nameChange()):null}}},[e._v("elecV2P editor")]),e._v(" "),t("div",{staticClass:"codeditor_button center"},[t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),e.save()}}},[e._v("保存(Ctrl+S)")]),e._v(" "),t("ul",{directives:[{name:"show",rawName:"v-show",value:e.tipshow,expression:"tipshow"}],staticClass:"codeditor_tip",on:{click:function(t){t.preventDefault(),e.tipshow=!e.tipshow}}},[t("li",[e._v("f2: 重命名文件 f11: 全屏")]),e._v(" "),t("li",[e._v("alt+enter: 新标签页中查看该文件")])])])])};bi._withStripped=!0;const _i={name:"editor",props:["file"],data:()=>({curtfile:{burl:"",name:"",path:"",mode:"string"},bShow:!1,editor:null,modelist:null,collapse:!1,tipshow:!0,fullscreen:!1,tranposi:[0,0],dragposi:[0,0]}),mounted(){window.onload=()=>{ace?(this.editor=ace.edit("aceditor",{wrap:!0,fontSize:20,showInvisibles:!0,indentedSoftWrap:!1}),this.modelist=ace.require("ace/ext/modelist"),document.querySelector(".codeditor").addEventListener("transitionend",(()=>{this.editor.resize()}))):this.$message.error("ace editor not ready yet")}},watch:{"file.start":function(e){e&&(this.fileOpen().catch((e=>{this.$message.error("编辑文件",this.file.name,`失败 ${e.message}\n文件已在新标签页打开`),this.$uApi.open(this.file.burl+this.file.name),console.error("编辑文件",this.file.name,"失败",e)})),this.file.start=!1)}},methods:{nameChange(){let e=prompt("新的文件名(不包含路径)",this.curtfile.name);if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void this.$message.error("文件名中保存特殊字符,请修改后重试");this.curtfile.name=e,this.$message.success("文件名修改成功"),this.editor.focus()}},async fileOpen(){if(!this.editor)return void this.$message.error("编辑器暂时不可用,请稍等...,或尝试刷新页面");if(!this.file.name||!this.file.path)return void this.$message.error("没有获取到可编辑的文件信息");let e=this.file.name,t=this.file.burl,n="",r=this.modelist.getModeForPath(e),s=r.name,i=r.mode,o="text"===s&&!/\.txt$/.test(e);if(!o||confirm(e+" 可能并不是文本文件\n点击确定-使用文本编辑器打开\n点击取消-在新标签页面中打开")){if("url"===this.file.start){if(!/^https?:\/\/\S{4}/.test(t))return void this.$message.error("远程链接错误,无法获取文件内容",t+e);let r=this.$message.loading("正在加载",e,"文件内容...",0);try{n=await this.$axios.get(t+e,{responseType:"arraybuffer"}).then((e=>o?(this.curtfile.mode="hex",this.$uStr.bufferToHex(e.data)):(this.curtfile.mode="string",(new TextDecoder).decode(e.data)))),r(),this.curtfile.burl=t,this.$message.success(e,"文件内容加载成功")}catch(t){return r(),this.$message.error("无法加载",e,"文件内容",t.message),void console.error("无法加载",e,"文件内容",t)}}else{if("new"!==this.file.start)return void this.$message.error("未知指令",this.file.start,"无法打开文本编辑器");this.$message.success("新建文件",e),this.curtfile.burl=this.file.burl,n=this.file.content||"欢迎使用 elecV2P 文本文件编辑器\n\nctrl+a 全选\nctrl+s保存"}this.editor.session.setMode(i),console.debug("elecV2P editor current mode",s),"string"!==this.$sType(n)&&(this.$message.error("获取文件内容并非文本格式,已强制进行转换"),n=this.$sString(n)),this.bShow=!0,this.tranposi=[0,0],this.collapse=!1,this.curtfile.path=this.file.path,this.curtfile.name=e,this.editor.session.setValue(n),this.editor.focus()}else this.$uApi.open(this.file.burl+this.file.name)},fileView(){/^https?:\/\/\S{4}/.test(this.curtfile.burl)?this.$uApi.open(this.curtfile.burl+this.curtfile.name):this.$message.error("暂时无法获取该文件的远程查看链接")},autoWrap(e){this.editor.session.setUseWrapMode(e.target.checked),this.editor.focus()},offUnder(e){e.target.checked?document.querySelector(".ace_content").classList.remove("underoff"):document.querySelector(".ace_content").classList.add("underoff"),this.editor.focus()},readOnly(e){this.editor.setReadOnly(e.target.checked),this.editor.focus()},tabResize(e){this.editor.session.setTabSize(Number(e.target.value)),this.editor.focus()},softTabs(e){this.editor.session.setUseSoftTabs(e.target.checked),this.editor.focus()},showInvi(e){this.editor.setShowInvisibles(e.target.checked),this.editor.focus()},hexstrToggle(){if("hex"===this.curtfile.mode){const e=this.$message.loading("正在尝试将当前内容转化为文本");let t=this.editor.getValue();t=(new TextDecoder).decode(this.$uStr.hexToBuffer(t)),this.editor.session.setValue(t),e(),this.$message.success("转化完成"),this.curtfile.mode="string"}else console.log("当前编辑器内容已经是文本格式")},moreSet(){this.editor.execCommand("showSettingsMenu"),this.tipshow=!this.tipshow},dragStart(e){e.dataTransfer.effectAllowed="move",this.dragposi=[e.clientX,e.clientY]},dragEnd(e){e.preventDefault(),this.tranposi=[this.tranposi[0]+e.clientX-this.dragposi[0],this.tranposi[1]+e.clientY-this.dragposi[1]]},copySelection(){if(!navigator.clipboard)return void this.$message.error("粘贴板仅在 https 页面中可访问");let e=this.editor.getCopyText();""!==e?navigator.clipboard.writeText(e).then((()=>{this.$message.success("复制成功")})).catch((e=>{this.$message.error("复制失败",e.message),console.error("复制选择文字失败",e)})):this.$message.error("请先选择文字")},pasteSelection(){navigator.clipboard?navigator.clipboard.readText().then((e=>{e?(this.editor.insert(""),this.editor.session.insert(this.editor.getCursorPosition(),e),this.$message.success("粘贴成功")):(this.$message.error("没有检测到文字内容"),console.log("没有检测到文字内容"))})).catch((e=>{this.$message.error("粘贴失败",e.message),console.error("粘贴失败",e)})):this.$message.error("粘贴板仅在 https 页面中可访问")},save(){const e=this.$message.loading(this.curtfile.name,"上传保存中...",0);let t=this.editor.getValue();"hex"===this.curtfile.mode&&(t=Array.from(this.$uStr.hexToBuffer(t))),this.$axios.post("/rpc",{v:103,method:"save",params:[this.curtfile.path+"/"+this.curtfile.name,t,this.curtfile.mode]}).then((e=>{0===e.data.rescode?this.$message.success(this.curtfile.name,"保存成功"):(this.$message.error(this.curtfile.name,"保存失败",e.data.message),console.error(this.curtfile.name,"保存失败",e.data.message))})).catch((e=>{this.$message.error(this.curtfile.name,"保存失败",e.message),console.error(this.curtfile.name,"保存失败",e)})).finally(e)}}};function wi(e,t,n,r,s,i,o,a){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=c):s&&(c=a?function(){s.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}const ki=wi(_i,bi,[],!1,null,"6f9c736c",null).exports;var Ci=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message"},e._l(e.msgs,(function(n,r){return t("div",{key:r,staticClass:"message_item",style:{textAlign:n.align}},[t("span",{staticClass:"message_type icon",domProps:{innerHTML:e._s(e.icon[n.type])}}),e._v(" "),t("span",{staticClass:"message_text",class:{cursor:n.url},attrs:{title:n.url},on:{click:function(t){return e.$uApi.open(n.url)}}},[e._v(e._s(n.text))]),e._v(" "),t("span",{staticClass:"message_remove",on:{click:function(t){return e.msgRemove(r)}}},[e._v("X")])])})),0)};Ci._withStripped=!0;const xi={home:'',pause:'',sync:'',delete:'',play:'',plays:'',downcircle:'',upcircle:'',stop:'',clear:'',success:'',error:'',loading:'',overview:'',rules:'',rewrite:'',jsmanage:'',task:'',mitm:'',cfilter:'',setting:'',about:'',donation:''};var $i=n(724);const Si={base_url:location.origin,glogslicebegin:0,version:"3.8.2"};function Ei(e){return"object"!=typeof e?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()||"object"}function Oi(e,t=!1){if(!e)return!!t&&Object.create(null);switch(Ei(e)){case"array":case"object":return e;case"set":return Array.from(e);case"map":return Array.from(e).reduce(((e,[t,n])=>(e[t]=n,e)),{})}try{let t=JSON.parse(e);if("object"==typeof t)return t}catch(t){try{let t=new Function("return "+e)();if(/^(object|array)$/.test(Ei(t)))return t}catch(e){}}return!!t&&{0:e}}function Ti(e){if(null==e)return"";let t=Ei(e);switch(t){case"string":return e.trim();case"map":case"set":return JSON.stringify({dataType:t,value:Array.from(e)});case"array":case"object":try{return e[Symbol.toPrimitive]?String(e[Symbol.toPrimitive]()):JSON.stringify(e)}catch(e){return e.message}default:return String(e).trim()}}function Ai(e){if(!e)return!1;if("boolean"==typeof e)return e;if("string"!=typeof e)return!0;switch(e=e.trim()){case"":case"0":case"false":case"null":case"undefined":case"NaN":return!1;default:return!0}}function Ri(e){return!!(""===Ti(e).trim()||/^(object|array)$/.test(Ei(e))&&0===Object.keys(e).length)}function Ni(e){try{return new URL(e)}catch(e){return!1}}function Pi(e=8){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=t[Math.floor(52*Math.random())];for(e--;e--;)n+=t[Math.floor(62*Math.random())];return n}function Di(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}function ji(e,t){return void 0===t&&(t=e,e=0),Math.floor(Math.random()*(t-e+1))+e}Si.vernum=Number(Si.version.replace(/\D/g,""));const Mi=6e4*(new Date).getTimezoneOffset();function Li(e=null,t=0,n=Si.glogslicebegin){return e=e?Number(e)||Date.parse(e):Date.now(),new Date(e-Mi).toISOString().slice(n,t?-1:-5).replace("T"," ")}function Ii(e=Date.now()){let t=(Date.now()-e)/1e3/60/60;return t>100?(t/24).toFixed(2)+" days":t.toFixed(2)+" hours"}const zi=new Map;function Fi(e,t=16){const n=e+t;if(zi.has(n))return zi.get(n);const r=function(e,t=16){if(e.length===t)return e;if(e.lengtht){const n=e.split(/\/|\\/);n.length>1&&(e=n[0].slice(0,1)+"/"+n.pop());const r=e.split(" ").pop();return e.slice(0,t-6-r.length)+"..."+e.slice(-r.length-3)}}(e,t);return zi.set(n,r),r}function Bi(e=""){if(/[&<>"']/.test(e)){const t={'"':""","'":"'","&":"&","<":"<",">":">"};return e.replace(/[&<>"']/g,(e=>t[e]||e))}return e}function Ui(e){return(0,$i.ansiHtml)(Bi(e))}function Hi(e){if(!e)return"";let t="",n=e.split(/\/|\\|\?|#/);for(;""===t&&n.length;)t=n.pop();return t}const Vi=[];for(let e=0;e<=255;++e){const t=e.toString(16).padStart(2,"0");Vi.push(t)}function Ki(e,t=" ",n=2e4){const r=new Uint8Array(e),s=new Array(r.length);r.length>n?console.debug("arrayBuffer length",r.length,"is too big to tranfer, slice to",n):n=r.length;for(let e=0;eVi.indexOf(e))))}function Wi(e="",t=0){if(!e){if(t<1)return"";e="0"}let n=Ki((new TextEncoder).encode(e),"");return 0===t||n.length===t?n:(n.length{const t=r[s++];return s>=r.length&&(i+=1,s=0),e+t*i+r.length})),"")}function Xi(e,t="elecV2"){const n=qi(e,null),r=(new TextEncoder).encode(t);let s=0,i=1;return(new TextDecoder).decode(n.map((e=>{const t=r[s++];return s>=r.length&&(i+=1,s=0),e-t*i-r.length})))}function Zi(e=0,t=1024){return edocument.body.clientWidth&&(r-=t),e.pageY+n>document.body.clientHeight&&(s-=n),[r,s]}const eo=new Map,to=new Map;to.set("082bc4ee40bfef100f79579dc780dff7",{name:"elecV2",homepage:"https://github.com/elecV2"}),to.set("cd2458b5e43827ee9a2009b56f29ffd5",{name:"Public test",homepage:"https://t.me/elecV2"}),to.set("b9b2e3354b6520261c1b5c375dc2bf74",{name:"Oreomeow",homepage:"https://github.com/Oreomeow"});let no=localStorage.getItem("sponsors");if(no)try{JSON.parse(Xi(no,"elecV2P_sponsors")).forEach((e=>{to.set(e,Object.create(null))}))}catch(e){console.debug("parse localStorage sponsors",e)}eo.set("sponsors",to),eo.set("bChecked",localStorage.getItem("bcheck")===(new Date).getDate().toString()),to.has(localStorage.getItem("userid"))&&eo.set("bSponsor",!0);const ro={get:e=>localStorage.getItem(e),set:(e,t)=>localStorage.setItem(e,t),hasCache:e=>eo.has(e),getCache:e=>eo.get(e),setCache:(e,t)=>eo.set(e,t),deleteCache:e=>eo.delete(e)};function so(e){let t=document.querySelector(e);t&&(t.scrollTop=t.scrollHeight)}function io(e){let t=document.querySelector(e);t&&t.scrollIntoView()}function oo(e){let t=document.querySelector(e);t&&t.focus()}function ao(e,t="elecV2P.json",n="application/json"){e=/json/.test(n)?JSON.stringify(e,null,2):String(e);const r=new Blob([e],{type:n});let s=(window.URL||window.webkitURL).createObjectURL(r),i=document.createElement("a");i.download=t,i.href=s,i.click()}function co(e,t=""){fetch(e).then((n=>{if(!t)try{const e=n.headers.get("Content-Disposition").split(";");t=e[1].split("=")[1]}catch(e){console.error("fail to get filename",e)}return n.blob().then((n=>{let r=document.createElement("a");r.href=URL.createObjectURL(n),r.download=t||e.split("/").pop(),r.click()}))}))}function lo(e="",t=".evscript"){if(!e)return void console.log("some code are expect");document.querySelector(t)&&document.querySelector(t).remove();let n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("defer","defer"),n.className="evscript",n.innerHTML=e,document.head.appendChild(n)}function uo(e="",t=".evtheme"){if(!e)return void console.log("some style contexts are expect");document.querySelector(t)&&document.querySelector(t).remove();let n=document.createElement("style");n.className="evtheme",n.innerHTML=e,document.head.appendChild(n)}function fo(e="",t=""){if(!e)return void console.log("a meta name is expect");let n=document.querySelector(`meta[name=${e}]`),r=null;n?r=n:(r=document.createElement("meta"),r.name=e),r.content=t,!n&&document.head.appendChild(r)}function po(e="standalone"){return matchMedia(`(display-mode: ${e})`).matches||navigator.standalone||document.referrer.includes("android-app://")}function ho(e){document.querySelector(e)&&document.querySelector(e).remove()}function mo(e=""){let t=document.querySelector(".copyinput");t&&"INPUT"===t.nodeName||(t=document.createElement("input"),t.className="copyinput",t.style.position="fixed",t.style.top="-6px",t.style.height="0",t.style.border="none",document.body.appendChild(t)),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.blur()}function vo(e){return navigator.clipboard.writeText(e)}function go({accept:e="*",type:t="text",multiple:n=!1}={}){let r=document.createElement("input");return r.type="file",r.accept=e,n&&(r.multiple=!0),new Promise(((e,n)=>{r.onchange=r=>{let s=r.target.files[0];if(s)if(console.debug("get file",s.name,s.type,s.size),"file"===t)e(s);else{let t=new FileReader;t.readAsText(s,"UTF-8"),t.onload=t=>{e({name:s.name,type:s.type,size:s.size,content:t.target.result})}}else n("请先选择文件")},r.click()}))}function yo(){return navigator.userAgent||"Mozilla/5.0 (Linux; U; elecV2P; x64) ePhone Super Max Plus++"}function bo(e=""){return getComputedStyle(document.querySelector("#app")).getPropertyValue(e).trim()}function _o(e=""){document.execCommand("insertText",!1,e)}const wo=new Map;function ko(e="",t="",n=3){if(!e||!t)return void wo.clear();32!==e.length&&(e=Wi(t,32));const r=e+t+n;if(wo.has(r))return wo.get(r);let s="";switch(n){case 4:s=function(e=""){const t=document.createElement("canvas");t.width=180,t.height=180;const n=t.getContext("2d"),r=e.match(/\w{2}/g).map((e=>parseInt(e,16)));n.fillStyle=`rgba(${r[0]}, ${r[4]}, ${r[8]}, ${r[12]/380+.3})`,n.fillRect(0,0,t.width,t.height),n.lineCap="round",n.lineJoin="round";const s=r[0]%4,i=r[1]%10+10;switch(n.beginPath(),n.lineWidth=r[2]%15+5,n.strokeStyle=`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]/380+.3})`,n.fillStyle=`rgba(${r[0]}, ${r[1]}, ${r[2]}, ${r[3]/380+.3})`,s){case 0:n.strokeRect(50-i,60-i,2*i,2*i);break;case 1:n.fillRect(50-i,60-i,2*i,2*i);break;case 2:n.arc(50,60,i,0,2*Math.PI),n.stroke();break;default:n.arc(50,60,i,0,2*Math.PI),n.fill()}const o=r[4]%4,a=r[5]%10+10;switch(n.beginPath(),n.lineWidth=r[6]%15+5,n.strokeStyle=`rgba(${r[4]}, ${r[5]}, ${r[6]}, ${r[7]/380+.3})`,n.fillStyle=`rgba(${r[4]}, ${r[5]}, ${r[6]}, ${r[7]/380+.3})`,o){case 0:n.strokeRect(130-a,60-a,2*a,2*a);break;case 1:n.fillRect(130-a,60-a,2*a,2*a);break;case 2:n.arc(130,60,a,0,2*Math.PI),n.stroke();break;default:n.arc(130,60,a,0,2*Math.PI),n.fill()}return n.beginPath(),n.moveTo(90,(i+a)/2+60),n.quadraticCurveTo(r[8],r[9],90,r[10]%15+105),n.lineWidth=r[11]%15+5,n.strokeStyle=`rgba(${r[8]}, ${r[9]}, ${r[10]}, ${r[11]/380+.3})`,n.stroke(),n.beginPath(),n.moveTo(50,130),n.quadraticCurveTo(r[12],r[13]%50+130,130,130),n.lineWidth=r[14]%15+5,n.strokeStyle=`rgba(${r[12]}, ${r[13]}, ${r[14]}, ${r[15]/380+.3})`,n.stroke(),t.toDataURL()}(e);break;case 3:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d"),s=e.match(/\w{2}/g).map((e=>parseInt(e,16))),i=r.createRadialGradient(90,90,0,90,90,128);i.addColorStop(0,`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/380+.3})`),i.addColorStop(.25,`rgba(${s[4]}, ${s[5]}, ${s[6]}, ${s[7]/380+.3})`),i.addColorStop(.5,`rgba(${s[8]}, ${s[9]}, ${s[10]}, ${s[11]/380+.3})`),i.addColorStop(.75,`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`),i.addColorStop(1,`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`),r.beginPath(),r.fillStyle=i,r.arc(90,90,128,0,2*Math.PI),r.fill(),t&&Co(t,r);return n.toDataURL()}(e,t);break;case 2:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d");e+=e;let s=0;for(let t=0;t<18;t++){for(let n=0;n<18;n++)r.beginPath(),r.fillStyle="#"+e.slice(s+n,s+n+8),r.arc(10*n+5,10*t+5,5,0,2*Math.PI),r.fill();s++}t&&Co(t,r);return n.toDataURL()}(e,t);break;default:s=function(e="",t=""){const n=document.createElement("canvas");n.width=180,n.height=180;const r=n.getContext("2d"),s=e.match(/\w{2}/g).map((e=>parseInt(e,16))),i=[s[0]%120,s[1]%120],o=[s[2]%(180-i[0])+i[0],s[3]%(180-i[1])+i[1]];r.fillStyle=`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${s[3]/380+.3})`,r.fillRect(0,0,o[0],i[1]-2),r.fillStyle=`rgba(${s[4]}, ${s[5]}, ${s[6]}, ${s[7]/380+.3})`,r.fillRect(o[0]+2,0,180-o[0]-2,o[1]),r.fillStyle=`rgba(${s[8]}, ${s[9]}, ${s[10]}, ${s[11]/380+.3})`,r.fillRect(i[0],o[1]+2,180-i[0],180-o[1]-2),r.fillStyle=`rgba(${s[12]}, ${s[13]}, ${s[14]}, ${s[15]/380+.3})`,r.fillRect(0,i[1],i[0]-2,180-i[1]),r.fillStyle=bo("--main-bk")||`rgba(${s[1]}, ${s[5]}, ${s[9]}, ${s[13]/380+.3})`,r.fillRect(i[0],i[1],o[0]-i[0],o[1]-i[1]),r.fillStyle="#000",r.fillRect(o[0],0,2,o[1]),r.fillRect(i[0],o[1],180-i[0],2),r.fillRect(i[0]-2,i[1],2,180-i[1]),r.fillRect(0,i[1]-2,o[0],2),t&&Co(t,r);return n.toDataURL()}(e,t)}return wo.set(r,s),s}function Co(e="",t){e&&(e.length>1&&(e=e.slice(0,1)),e=e.toUpperCase(),t.beginPath(),t.lineWidth=6,t.textAlign="center",t.textBaseline="middle",t.font="bold 140px "+(bo("--font-fm")||"system-ui,sans-serif"),t.strokeStyle=bo("--main-fc")||"#FFFFFF",t.strokeText(e,90,98))}function xo(e=""){if("function"!=typeof eval){const e="eval 函数在当前环境下不可用";return console.error(e),e}try{return(0,eval)(e)}catch(e){return console.error("evalRun fail",e),e.message}}function $o(){return document.title}function So(e="elecV2P"){document.title=e}function Eo({ele:e=document.querySelector(".logo_a"),off:t=!0}={}){return t?e.classList.add("logo_a--offline"):e.classList.remove("logo_a--offline")}function Oo(e,t=""){return t?document.querySelectorAll(e):document.querySelector(e)}const To={message:Object.create(null),evui:()=>{}};const Ao=wi({name:"message",data:()=>({msgs:{},icon:xi}),computed:{},created(){Object.assign(To.message,{success:(...e)=>this.msgShow("success",this.formMsg(e)),error:(...e)=>this.msgShow("error",this.formMsg(e)),loading:(...e)=>this.msgShow("loading",this.formMsg(e)),close:e=>{e?this.msgRemove(e):this.msgs={}}}),this.$wsrecv&&this.$wsrecv.add("message",(e=>{if("object"===Ei(e))switch(e.type){case"success":case"error":case"loading":const t=this.formMsg(e.data);this.msgShow(e.type,t),this.msgNotify(t.msg,{secd:t.secd,url:t.url,tag:t.mid});break;case"close":e.data?this.msgRemove(e.data):this.msgs={};break;default:this.msgShow("error",{msg:"暂不支持的通知类型: "+e.type,secd:10})}else this.msgShow("success",this.formMsg(e))}))},methods:{formMsg(e){if(0===e.length)return{msg:""};if("array"!==Ei(e))return{msg:Ti(e)};if(1===e.length)return{msg:Ti(e[0])};let t,n,r,s,i=e.pop();return Number.isFinite(i)?t=i:"object"===Ei(i)&&(i.secd||i.url||i.mid||i.align)?(t=i.secd,n=i.url,r=i.mid,s=i.align):e.push(i),{msg:e.map((e=>Ti(e))).join(" "),secd:t,url:n,mid:r,align:s}},msgShow(e,{msg:t,secd:n,url:r,mid:s=Pi(),align:i}){return void 0!==t&&""!==t||(t="a empty message",s="empty"),Number.isFinite(n)||(n=(t.match(/\W/g)||t).length/5+(3*Object.keys(this.msgs).length||5)),this.$set(this.msgs,s,{text:t,type:e,secd:n,url:r,align:i}),0!==n&&(this.msgs[s].sTout=setTimeout(this.msgRemove,1e3*n,s)),()=>{this.msgRemove(s)}},msgRemove(e){this.msgs[e]&&(clearTimeout(this.msgs[e].sTout),this.$delete(this.msgs,e))},async getNotifyPerm(){if("undefined"==typeof Notification)return"";let e=Notification.permission;return"granted"===e||"denied"===e?e:(e=await Notification.requestPermission(),void 0===e?new Promise((e=>Notification.requestPermission((t=>e(t))))):e)},async msgNotify(e="",t={}){if("granted"===await this.getNotifyPerm()){t.icon||(t.icon="efss/logo/elecV2P.png");const n=new Notification(t.title||"",{body:e,icon:t.icon,tag:t.tag});t.secd>0&&setTimeout((()=>n.close()),1e3*t.secd),t.url&&(n.onclick=e=>{e.preventDefault(),this.$uApi.open(t.url),n.close()})}}}},Ci,[],!1,null,"40ac18ce",null).exports;var Ro=function(){var e=this,t=e._self._c;return t("div",{staticClass:"checkbox",class:{"checkbox--checked":e.bChecked},on:{click:function(t){e.bChecked=!e.bChecked}}},[t("span",{staticClass:"checkbox_status"})])};Ro._withStripped=!0;const No=wi({name:"checkbox",props:["oCheck","oKey","oInit"],computed:{bKey(){return this.oKey||"enable"},bChecked:{get(){return void 0===this.oCheck[this.bKey]?"false"!==this.oInit:!!this.oCheck[this.bKey]},set(e){this.$set(this.oCheck,this.bKey,e)}}}},Ro,[],!1,null,"40a3a37e",null).exports;var Po=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"menu",style:{left:(e.pos?e.pos[0]:0)+"px",top:(e.pos?e.pos[1]:0)+"px"}},e._l(e.menus,(function(n,r){return t("li",{staticClass:"menu_item",style:{color:n.color,backgroundColor:n.bkcolor,fontSize:n.fontsize,height:n.height},attrs:{"data-method":n.method,"data-param":n.param},on:{click:function(t){return t.preventDefault(),e.click(r)},contextmenu:function(t){return t.preventDefault(),e.rclick(r)},dblclick:function(t){return t.preventDefault(),e.dclick(r)}}},[e._v(e._s(n.label))])})),0)};Po._withStripped=!0;const Do=wi({name:"contextmenu",props:["menus","pos"],methods:{click(e){this.menus.length&&this.menus[e].click?this.menus[e].click():console.debug("点击暂无对应处理函数"),this.menus.splice(0)},rclick(e){this.menus.length&&this.menus[e].rclick?this.menus[e].rclick():console.debug("右键暂无对应处理函数"),this.menus.splice(0)},dclick(e){this.menus.length&&this.menus[e].dclick?this.menus[e].dclick():console.debug("双击暂无对应处理函数"),this.menus.splice(0)}}},Po,[],!1,null,"10ef9a33",null).exports;var jo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"favend",class:{"favend--collapsed":e.collapse}},[t("table",{staticClass:"elecTable",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.favendSave()):null}}},[t("caption",{staticClass:"elecTable_caption"},[t("div",{staticClass:"title padding0"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"刷新 EFSS 相关设置"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.$emit("init","config")}}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"EFSS favorite&backend"}},[e._v("favend 相关设置 - "+e._s(e.favend_total))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})])]),e._v(" "),t("thead",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}]},[t("tr",{attrs:{title:"在输入框内使用 alt + enter 打开 favend 页面"}},[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:"全选/全不选"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.favendCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v("名称")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--input"},[e._v("关键字")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--input"},[e._v("类型")]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v("目标")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v("启用")]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_cell100"},[e._v("操作")])])]),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.favendOpenDelegate(t)):null}}},e._l(e.showlist,(function(n,r){return t("tr",{key:"key"+r,class:{"elecTable_tr--disabled":!n.enable,"elecTable_tr--selected":e.favendChecked[n.key]}},[t("td",{staticClass:"elecTable_td",class:{folderbk:n.collapse}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.favendCheck,expression:"favendCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:n.key,checked:Array.isArray(e.favendCheck)?e._i(e.favendCheck,n.key)>-1:e.favendCheck},on:{change:function(t){var r=e.favendCheck,s=t.target,i=!!s.checked;if(Array.isArray(r)){var o=n.key,a=e._i(r,o);s.checked?a<0&&(e.favendCheck=r.concat([o])):a>-1&&(e.favendCheck=r.slice(0,a).concat(r.slice(a+1)))}else e.favendCheck=i}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.name,expression:"favend.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text","data-key":n.key},domProps:{value:n.name},on:{input:function(t){t.target.composing||e.$set(n,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.key,expression:"favend.key",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text","data-key":n.key},domProps:{value:n.key},on:{input:function(t){t.target.composing||e.$set(n,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:n.type,expression:"favend.type"}],staticClass:"elecTable_select",on:{change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(n,"type",t.target.multiple?r:r[0])}}},[t("option",{attrs:{value:"favorite"}},[e._v("收藏目录")]),e._v(" "),t("option",{attrs:{value:"runjs"}},[e._v("运行脚本")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:n.target,expression:"favend.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"目录地址 或 脚本名称 比如: logs 或 favend.js","data-key":n.key},domProps:{value:n.target},on:{input:function(t){t.target.composing||e.$set(n,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:n}})],1),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100"},[t("span",{staticClass:"icon--op",attrs:{title:"打开查看"},domProps:{innerHTML:e._s(e.icon.play)},on:{click:function(t){return e.favendOpen(n.key)}}}),e._v(" "),t("span",{staticClass:"icon--op",attrs:{title:"删除此项"},domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.favendDel(n.key)}}})])])})),0),e._v(" "),t("tfoot",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}]},[t("tr",[t("td",{staticClass:"center cursor border_top1 border_right1 favend_collanum",class:{"favend_collanum--show":e.coll_show},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.coll_show=!e.coll_show}}},[e._v(e._s(e.coll_keys.length))]),e._v(" "),t("td",{staticClass:"center border_top1",attrs:{colspan:"6"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasChecks,expression:"hasChecks"}],staticClass:"elecTable_addbtn elecBtn--file",on:{click:function(t){return e.favendCol(!0)}}},[e._v("隐藏选择规则")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasCheckCols,expression:"hasCheckCols"}],staticClass:"elecTable_addbtn elecTable_addbtn--stop",on:{click:function(t){return e.favendCol(!1)}}},[e._v("规则隐藏取消")]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.hasChecks,expression:"hasChecks"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.favendDelCks()}}},[e._v("删除选择规则")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.favendNew()}}},[e._v("添加新的规则")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{title:"(CTRL+S)保存后正式生效"},on:{click:function(t){return e.favendSave()}}},[e._v("保存当前列表")])])])])])])};jo._withStripped=!0;const Mo={name:"efss",props:["favendlist","efssdir"],data:()=>({icon:xi,collapse:!0,orglist:[],coll_show:!1,favendCheck:[]}),components:{checkbox:No},computed:{favend_total(){return this.orglist.length},showlist(){return this.coll_show?this.orglist:this.orglist.filter((e=>!e.collapse))},coll_keys(){return this.orglist.filter((e=>e.collapse)).map((e=>e.key))},favendChecked:{get(){let e={};return this.favendCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.favendCheck=this.showlist.map((e=>e.key)):"none"===e&&(this.favendCheck=[])}},hasChecks(){return 0!==this.favendCheck.length},hasCheckCols(){return this.favendCheck.some((e=>this.coll_keys.includes(e)))}},watch:{favendlist(e){let t=[];for(let n in e)t.push(e[n]);this.orglist=t}},methods:{favendOpen(e){this.$uApi.open("/efss/"+e)},favendOpenDelegate(e){e.target.dataset.key&&this.$uApi.open("/efss/"+e.target.dataset.key)},favendDel(e){this.orglist=this.orglist.filter((t=>t.key!==e))},favendDelCks(){this.orglist=this.orglist.filter((e=>!this.favendChecked[e.key])),this.$message.success(`成功删除 ${this.favendCheck.length} 条规则,保存后正式生效`),this.favendCheck=[]},favendNew(e=this.$uStr.euid()){let t=Math.random()<.5?"runjs":"favorite";this.orglist.push({key:e,name:"favend "+(Object.keys(this.orglist).length+1),type:t,target:"favorite"===t?this.efssdir:"test.js",enable:!0})},favendSave(){let e=Object.create(null);for(let t of this.orglist){if(!(t.key&&t.name&&t.target))return void this.$message.error(t.name,t.key,"部分项参数为空,请修改后再进行保存");if(e[t.key])return void this.$message.error("设置了重复关键字:",t.key,"请修改后再进行保存\n重复项:",t.name,"和",e[t.key].name);e[t.key]=t}const t=this.$message.loading("favend 列表更新中...",0);this.$axios.put("/config",{type:"efss",data:{favend:e}}).then((t=>{if(0===t.data.rescode){this.$message.success("favend 设置保存成功");for(let t in this.favendlist)e[t]||delete this.favendlist[t];for(let t in e)this.favendlist[t]=e[t]}else this.$message.error("favend 设置保存失败",t.data.message||"未知错误"),console.error(t.data)})).catch((e=>{this.$message.error("favend 设置失败",e.message),console.error(e)})).finally(t)},favendCkall(e){this.favendChecked=e.target.checked?"all":"none"},favendCol(e=!0){if(!this.hasChecks)return void this.$message.error("请先选择规则");const t=this.$message.loading("隐藏列表更新中...",0);this.$axios.put("/config",{type:"favend",prop:"collapse",keys:this.favendCheck,value:e}).then((t=>{0===t.data.rescode?(this.$message.success("隐藏列表更新成功"),t.data.resdata&&this.$message.error("其中",t.data.resdata.join(", "),"对应规则尚未上传保存"),this.orglist=this.orglist.map((t=>this.favendCheck.includes(t.key)?{...t,collapse:e}:{...t})),this.favendCheck=[]):(this.$message.error("隐藏列表更新失败",t.data.message||t.data||"未知错误"),console.error("隐藏列表更新失败",t.data))})).catch((e=>{this.$message.error("隐藏列表更新失败失败",e.message),console.error("隐藏列表更新失败",e)})).finally(t)}}};const Lo=wi(Mo,jo,[],!1,null,"51f47af4",null).exports;var Io=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.preview.enable,expression:"preview.enable"}],staticClass:"preview",class:{"preview--collapsed":e.collapse},style:"transform: translate("+e.tranposi[0]+"px, "+e.tranposi[1]+"px);",attrs:{draggable:e.collapse},on:{dragstart:function(t){return e.dragStart(t)},dragend:function(t){return e.dragEnd(t)}}},[t("div",{staticClass:"title title--editview"},[t("span",{staticClass:"title_close",on:{click:function(t){return t.preventDefault(),e.previewClose()}}},[e._v("X")]),e._v(" "),t("span",{staticClass:"title_main"},[e._v(e._s(e.preview.name))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){return t.preventDefault(),e.previewCollapse()}}})]),e._v(" "),t("div",{staticClass:"preview_toolbar"},[t("ul",{staticClass:"preview_menu eflex eflex--wrap"},[t("li",{attrs:{title:"保存该文件到本地磁盘上"}},[t("button",{staticClass:"elecBtn elecBtn--h32 folderbk",on:{click:function(t){return e.fileSave()}}},[e._v("下载该文件")])]),e._v(" "),t("li",[t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32",on:{click:function(t){return e.fileDelete()}}},[e._v("删除该文件")])]),e._v(" "),t("li",{attrs:{title:"在新标签页中查看该文件"}},[t("button",{staticClass:"elecBtn elecBtn--check elecBtn--h32",on:{click:function(t){return e.fileOpen()}}},[e._v("新页面打开")])])])]),e._v(" "),t("div",{staticClass:"preview_content"},["image"===e.preview.type?t("img",{staticClass:"preview_image",attrs:{src:e.previewurl,alt:e.preview.name,draggable:"false"}}):"media"===e.preview.type?t("div",{staticClass:"premedia"},[t("video",{staticClass:"preview_media",attrs:{src:e.previewurl,controls:"",autoplay:"true"},on:{play:function(t){return e.playStart()},ended:function(t){return e.playNext()},loadedmetadata:function(t){return e.volumeSet(t)}}},[t("p",[e._v("\n Your browser doesn't support HTML media. Here is a\n "),t("a",{attrs:{href:e.previewurl,target:"_blank"}},[e._v("link to the media")]),e._v(" instead.\n ")])])]):e.preview.type?t("div",[t("p",[e._v("暂时无法预览文件类型 "+e._s(e.preview.type)+"。文件地址:"),t("a",{attrs:{href:e.previewurl,target:"_blank"}},[e._v(e._s(e.previewurl))])])]):e._e(),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.listshow,expression:"listshow"}],staticClass:"preview_list"},[t("ul",{staticClass:"preview_listul"},e._l(e.preview.list,(function(n){return t("li",{key:n,staticClass:"preview_listli",class:{greenbk:n===e.preview.name},on:{click:function(t){e.preview.name=n}}},[e._v(e._s(n))])})),0)]),e._v(" "),t("div",{staticClass:"precontrol"},[t("div",{staticClass:"precontrol_menu"},[t("span",{staticClass:"precontrol_item",attrs:{title:"查看同类型文件列表"},on:{click:function(t){e.listshow=!e.listshow}}},[e._v("☰")]),e._v(" "),t("span",{staticClass:"precontrol_item",attrs:{title:"上一项"},on:{click:function(t){return e.playNext(-1)}}},[e._v("⏮")]),e._v(" "),t("span",{staticClass:"precontrol_item",class:{"precontrol_item--active":e.autonext},attrs:{title:"连续播放"},on:{click:function(t){return e.playMode(1)}}},[e._v("🔁")]),e._v(" "),t("span",{staticClass:"precontrol_item",class:{"precontrol_item--active":e.randnext},attrs:{title:"随机播放"},on:{click:function(t){return e.playMode(2)}}},[e._v("🔀")]),e._v(" "),t("span",{staticClass:"precontrol_item",attrs:{title:"下一项"},on:{click:function(t){return e.playNext(1)}}},[e._v("⏭")])])])])])};Io._withStripped=!0;const zo={name:"preview",props:["preview"],data(){return{collapse:!1,position:[0,0],tranposi:[0,0],listshow:!1,autonext:!1,randnext:!1,b_volume:!0,orgtitle:this.$uApi.getTitle(),autoInter:null,mediaend:!0}},watch:{preview:function(e){e.enable&&(this.collapse=!1,this.listshow=!1,this.tranposi=[0,0])}},computed:{previewurl(){return"/efss"+this.preview.base+"/"+this.preview.name},curtidx(){return this.preview.list.indexOf(this.preview.name)}},methods:{previewClose(){this.preview.enable=!1,this.preview.type="",this.preview.base="",this.preview.name="",this.preview.list=[],this.$uApi.setTitle(this.orgtitle),this.interClear(),this.autonext=!1,this.randnext=!1},previewCollapse(){this.tranposi=[0,0],this.collapse=!this.collapse,this.interClear()},fileOpen(){this.$uApi.open(this.previewurl)},fileSave(){this.$uApi.downloadFile(this.previewurl,this.preview.name)},fileDelete(){const e=this.preview.name;if(!confirm(`确定删除文件 ${e}?(不可恢复)`))return;const t=this.$message.loading("正在删除文件",e,"...",0);this.$axios.delete("/sefss",{data:{path:this.preview.base,files:[e]}}).then((t=>{if(0===t.data.rescode){this.$emit("eRemove",e);const n=this.preview.list.indexOf(e);this.preview.list.splice(n,1),this.preview.list.length&&(this.preview.name=this.preview.list[n]||this.preview.list[0]),this.$message.success("操作完成",t.data.message)}else this.$message.error(e,"删除失败:",t.data.message)})).catch((t=>{this.$message.error(e,"删除失败",t.message),console.error(e,"删除失败",t)})).finally(t)},dragStart(e){e.dataTransfer.effectAllowed="move",this.position=[e.clientX,e.clientY]},dragEnd(e){e.preventDefault(),this.tranposi=[this.tranposi[0]+e.clientX-this.position[0],this.tranposi[1]+e.clientY-this.position[1]]},playStart(){this.$uApi.setTitle(this.preview.name+" - elecV2P Player"),this.mediaend=!1},playNext(e=0){if("media"===this.preview.type&&(this.$uApi.setTitle(this.orgtitle),0===e&&(this.mediaend=!0)),!e&&!this.autonext&&!this.randnext)return;const t=this.preview.list.length;if(t<=1)return;const n=this.randnext?this.$uStr.iRandom(0,t):this.curtidx+(e||1);this.preview.name=this.preview.list[n]||this.preview.list[0]},playMode(e=1){switch(e){case 1:this.autonext=!this.autonext,this.$message.success(this.autonext?"开启连续播放模式":"退出连续播放模式"),this.autonext&&(this.randnext=!1);break;case 2:this.randnext=!this.randnext,this.$message.success(this.randnext?"开启随机播放模式":"退出随机播放模式"),this.randnext&&(this.autonext=!1);break;default:this.message.error("未知操作")}"image"===this.preview.type?this.autoInter||!this.autonext&&!this.randnext?!this.autoInter||this.autonext||this.randnext||this.interClear():this.autoInter=setInterval(this.playNext,5e3,1):this.mediaend&&this.playNext(1)},interClear(){this.autoInter&&(clearInterval(this.autoInter),this.autoInter=null,this.autonext=!1,this.randnext=!1)},volumeSet(e){this.b_volume&&(e.target.volume=.3,this.b_volume=!1)}}};const Fo=wi(zo,Io,[],!1,null,"759ce28a",null).exports,Bo={clients:new Map,connections:new Set,Recv(e,t){let n=this.clients.get(e);if(n?n.add(t):(n=new Set([t]),this.clients.set(e,n)),this.connections.has(e))console.debug("server-sent events:",e,"connected");else{const t=new EventSource("/sse/elecV2P/"+e);t.onmessage=t=>{let n=Oi(t.data),r=this.clients.get(e);r?r.forEach((e=>e(n))):console.debug("no sse method for:",e,t.data)},t.onerror=n=>{t.close(),this.connections.delete(e),console.error("sse close",n)},this.connections.add(e)}}},Uo={name:"efss",data(){return{icon:xi,filelist:{},subpath:[],curtdir:"",upflists:[],esconfig:{enable:!0,directory:"./efss",dotshow:{enable:!1},max:600,skip:{folder:[],file:[]},favend:{}},menu:{pos:[0,0],list:[]},fileop:{name:"",folder:"",operate:""},fileedit:{burl:"",name:"",path:"",start:!1},filecheck:[],collapse:{titlearrow:this.$uStr.iRandom(0,10)>5,efssset:this.$uStr.iRandom(0,10)>7},filedownloadurl:"",preview:{enable:!1,type:"",base:"",name:"",list:[]},imageext:["png","jpg","ico","svg","bmp","gif","jpeg","webp","jfif"],mediaext:["mp4","m4v","m4s","ogm","ogg","ogv","webm","mp3","wav","aac"],uopenext:["exe","dll","msi","zip","gz","rar","7z","iso","img","avi","mov","rmvb","flv","download","bin","wasm","psd","pdf","cbz","epub","mobi","doc","docx","xls","xlsx","ppt","pptx","apk","ipa","ttf","woff","dat"],filesearch:"",locsubpath:this.$sJson(localStorage.getItem("subpath"))}},computed:{efssfilesname(){let e=[];for(let t=0;t0!==n&&t?e+"/"+t[1]:e),"")},fullpath(){return this.curtdir.replace(/\/$/,"")+this.postpath},curtshow(){return this.subpath.reduce(((e,t,n)=>0!==n&&t&&e.list&&e.list[t[0]]?e.list[t[0]]:e),this.filelist)},showlist(){if(this.curtshow&&this.curtshow.list){let e=[],t=[];return this.curtshow.list.forEach(((n,r)=>{this.filesearch&&!n.name.includes(this.filesearch)||("directory"===n.type?e.push({...n,index:r}):t.push({...n,index:r}))})),[...e,...t]}return[]},isSingleCheck(){return 1===this.filecheck.length},isZipCheck(){return this.filecheck[0]&&/\.zip$/.test(this.filecheck[0])},skipfolder:{get(){return this.esconfig.skip.folder.join(", ")},set(e){this.esconfig.skip.folder=e.split(/ ?, ?|,| /)}},skipfile:{get(){return this.esconfig.skip.file.join(", ")},set(e){this.esconfig.skip.file=e.split(/ ?, ?|,| /)}}},mounted(){this.eInit(),window.onbeforeunload=()=>localStorage.setItem("subpath",JSON.stringify(this.subpath))},components:{editor:ki,message:Ao,checkbox:No,favend:Lo,contextmenu:Do,preview:Fo},methods:{eInit(e){const t=this.$message.loading("获取 EFSS 相关数据中...",0);this.$axios.get("/sefss"+(e?"?type="+e:"")).then((e=>{let t="";e.data.config&&(Object.assign(this.esconfig,e.data.config),t+="成功获取 EFSS 相关设置"),e.data.list&&(this.filelist=e.data.list,t+="\n成功获取 EFSS 文件列表"),this.esconfig.enable?(0===this.subpath.length&&(this.locsubpath&&this.locsubpath[0]&&this.locsubpath[0][1]===this.filelist.name?this.subpath=this.locsubpath:this.subpath.push([0,this.filelist.name])),this.curtdir=this.esconfig.directory,this.$message.success(t)):this.$message.success("EFSS 目前处于关闭状态");let n=e.data.userid;if(n&&this.$uApi.store.getCache("sponsors").has(n)){let e=this.$sJson(this.$uApi.store.get("theme"));e&&this.theme(e)}this.fileMCheck("none")})).catch((e=>{this.$message.error("获取失败",e.message),console.error("获取失败",e)})).finally(t)},theme(e=null){if(e)if(e.simple&&(e=e.simple),e.enable){let t="";e.mainbk&&(t=`--main-bk: ${e.mainbk};`,e.mainbk.startsWith("#")&&(t+=`--secd-fc: ${e.mainbk.padEnd(7,8).slice(0,7)}b8;`)),e.maincl&&(t+=`--main-cl: ${e.maincl};`,e.maincl.startsWith("#")&&(t+=`--secd-bk: ${e.maincl.padEnd(7,8).slice(0,7)}b8;`)),e.appbk&&(/^http/.test(e.appbk)&&(e.appbk=`url(${e.appbk})`),t+=`background: ${e.appbk};`),t&&(t=`#app{${t}}`),e.style&&(t+=e.style),this.$uApi.injectCss(t),this.$uApi.injectMeta("theme-color",e.mainbk)}else this.$uApi.removeItem(".evtheme"),this.$uApi.injectMeta("theme-color","#003153")},nUpload(){this.upflists=this.$refs.efssfiles.files},size:e=>e>1048576?(e/1048576).toFixed(2)+" M":e>1024?(e/1024).toFixed(2)+" K":e+" B",eUpload(){let e=new FormData,t=[];if(0===this.upflists.length)return void this.$message.error("请先选择要上传的文件");for(let n of this.upflists)e.append(n.name,n),t.push([n.name,this.size(n.size)]);const n=this.$message.loading("文件上传中...",0);this.$axios.post("/sefss?subpath="+encodeURI(this.postpath),e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{if(0===e.data.rescode){let n=this.curtshow.list.map((e=>e.name)),r=t.map((e=>{let t=n.indexOf(e[0]);return this.$set(this.curtshow.list,-1===t?this.curtshow.list.length:t,{type:"file",name:e[0],size:e[1],mtime:this.$sTime()}),e[0]}));this.$message.success(r.join(","),"上传成功"),this.$refs.efssfiles.value="",console.debug(e.data,r.join(","),"上传成功")}else this.$message.error("上传失败",e.data.message||e.data),console.error("上传失败",e.data)})).catch((e=>{this.$message.error("上传失败",e.message),console.error(e)})).finally(n)},fileOpdelegate(e){switch(e.target.dataset.op){case"open":this.eOpen({type:e.target.dataset.type,name:e.target.dataset.name,size:e.target.dataset.size,index:Number(e.target.dataset.index)});break;case"del":this.eDel([e.target.dataset.name])}},getPreviewList(e="image"){return this.showlist.filter((t=>{if("directory"===t.type)return!1;const n=t.name.match(/.+\.(\w+)/);if(!n)return!1;const r=n[1].toLowerCase();return"image"===e&&this.imageext.includes(r)||"media"===e&&this.mediaext.includes(r)})).map((e=>e.name))},eOpen(e){if("directory"===e.type)this.subpath.push([e.index,e.name]),this.fileMCheck("none");else{const t=/\./.test(e.name)?e.name.split(".").pop().toLowerCase():"";if(!t||-1!==this.uopenext.indexOf(t))return void this.$uApi.open("/efss"+this.postpath+"/"+e.name);-1!==this.imageext.indexOf(t)?this.preview={enable:!0,type:"image",name:e.name,base:this.postpath,list:this.getPreviewList("image")}:-1!==this.mediaext.indexOf(t)?this.preview={enable:!0,type:"media",name:e.name,base:this.postpath,list:this.getPreviewList("media")}:/(M|G)$/.test(e.size)?this.$uApi.open("/efss"+this.postpath+"/"+e.name):(this.fileedit.burl=location.origin+"/efss"+this.postpath+"/",this.fileedit.name=e.name,this.fileedit.path=this.fullpath,this.fileedit.start="url")}},eZip(e,t,n){let r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 已存在,是否继续?(将会覆盖原文件"))return;const s=this.$message.loading(n,"压缩文件生成中...",0);this.$axios.post("/rpc",{method:"zip",params:[e,t+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success("成功生成压缩文件",n,e.data.message),-1!==r?this.curtshow.list[r].mtime=this.$sTime():this.curtshow.list.push({type:"file",name:n,mtime:this.$sTime()}),console.debug(e.data)):(this.$message.error(n,"打包失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{this.$message.error(n,"打包失败",e.message),console.error(e)})).finally(s)},eUnZip(e,t){let n=this.$uStr.surlName(t).replace(/\.zip$/i,""),r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 文件夹已存在,是否继续?(将会覆盖原文件"))return;const s=this.$message.loading(t,"解压中...",0);this.$axios.post("/rpc",{method:"unzip",params:[e+"/"+t,e+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success("成功解压文件",t),-1!==r?this.curtshow.list[r]=e.data.reslist:this.curtshow.list.push(e.data.reslist),console.debug(e.data)):(this.$message.error(t,"解压失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{this.$message.error(t,"解压失败",e.message),console.error(e)})).finally(s)},eMenu(e){let t={};if(!e.target.dataset.type||!e.target.dataset.name)return"mkdir"===e.target.dataset.op?this.eMenuMkdir(e):void 0;t.type=e.target.dataset.type,t.size=e.target.dataset.size,t.name=e.target.dataset.name,t.index=Number(e.target.dataset.index);let n=this.fullpath,r=location.origin+"/efss"+this.postpath+"/",s=this.eOpen,i=this.eDel,o=this.eZip,a=this.eUnZip,c=this.$message,l=this.$axios,u=this.$uApi.copy,f=this.$uApi.open,d=this.fileop,p=this.fileedit,h=this.renameFile,m=[];if("directory"===t.type)m.push({label:"重命名",click(){h(t.name,t.index)}},{label:"zip 压缩打包",click(){o([n+"/"+t.name],n,t.name+".zip")}},{label:"打开该文件夹",click(){s(t)}},{label:"删除该文件夹",bkcolor:"var(--note-bk)",click(){i([t.name])}});else{if(d.name&&d.folder&&d.operate){let e=this.operateFiles;m.push({label:"粘贴",click(){e()}})}m.push({label:"复制",click(){d.name=t.name,d.folder=n,d.operate="copy",u(n+"/"+t.name),c.success(t.name,"文件地址已复制\n请选择目标文件夹后进行粘贴")}},{label:"剪切",click(){d.name=t.name,d.folder=n,d.operate="move",u(n+"/"+t.name),c.success(t.name,"文件地址已获取\n请选择目标文件夹后进行粘贴")}},{label:"编辑",click(){/(M|G)$/.test(t.size)?c.error("当前文件过大,暂时无法处理"):(p.burl=r,p.name=t.name,p.path=n,p.start="url")}},{label:"重命名",click(){h(t.name,t.index)}}),/\.zip$/.test(t.name)?m.push({label:"解压此文件",click(){a(n,t.name)}}):(-1===t.name.indexOf(".")||/\.(js|json|py|sh)$/.test(t.name))&&m.push({label:"使用 PM2 运行",click(){const e=c.loading("命令执行中...",0);l.post("/rpc",{method:"pm2run",params:[t.name,{cwd:n}]}).then((e=>{0===e.data.rescode?(c.success(t.name,"已运行",e.data.message,{align:"left"}),console.debug(e.data)):(c.error(t.name,"运行失败",e.data.message||e.data),console.error(e.data))})).catch((e=>{c.error(t.name,"运行失败",e.message),console.error(e)})).finally(e)}}),m.push({label:"获取文件链接",click(){c.success(r+t.name),u(r+t.name)}},{label:"新标签页打开",bkcolor:"var(--icon-bk)",click(){f(r+t.name)}},{label:"删除该文件",bkcolor:"var(--note-bk)",click(){i([t.name])}})}this.menu={pos:this.$uApi.getCursorPos(e,160,32*m.length),list:m}},eMenuMkdir(e){let t=this.$axios,n=this.$message,r=this.fileedit,s=this.fullpath,i=this.curtshow.list,o=this.$sTime(),a=location.origin+"/efss"+this.postpath+"/",c=[];if(this.fileop.name&&this.fileop.folder&&this.fileop.operate){let e=this.operateFiles;c.push({label:"粘贴到此文件夹",fontsize:"17px",click(){e()}})}c.push({label:"新建文本文件",height:"38px",fontsize:"20px",click(){let e=prompt("新建文本文件名:","新建文本文件.txt");if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void n.error(e,"包含特殊字符,请修改后重试");if(-1!==i.findIndex((t=>t.name===e)))return void n.error(e,"已存在,请使用其他文件名");r.name=e,r.path=s,r.burl=a,r.start="new",i.push({type:"file",size:"0 B",name:e,mtime:o})}}},{label:"新建文件夹",height:"38px",fontsize:"20px",color:"var(--main-bk)",bkcolor:"var(--folder-bk)",click(){let e=prompt("文件夹名称","我的文件夹");if(e){if(/\\|\/|\?|\||<|>|:|\*/.test(e))return void n.error(e,"包含特殊字符,请修改后重试");if(-1!==i.findIndex((t=>t.name===e)))return void n.error(e,"已存在,请使用其他文件名");const r=n.loading("准备新建文件夹...",0);t.post("/rpc",{method:"mkdir",params:[s+"/"+e]}).then((t=>{0===t.data.rescode?(n.success("成功创建文件夹",e,t.data.message),i.push({type:"directory",name:e,list:[],mtime:o}),console.debug(t.data)):(n.error(t.data.message||t.data),console.error(t.data))})).catch((t=>{n.error(e,"文件夹新建失败",t.message),console.error(t)})).finally(r)}}}),this.menu={pos:this.$uApi.getCursorPos(e,160,32*c.length),list:c}},eDel(e){if("string"===this.$sType(e)&&(e=[e]),confirm(`确定删除 ${e.join(", ")}?(不可恢复)`)){const t=this.$message.loading("正在删除",e.join(", "),"...",0);this.$axios.delete("/sefss",{data:{path:this.postpath,files:e}}).then((t=>{t.data&&0===t.data.rescode?(this.$message.success("操作完成",t.data.message),e.forEach((e=>this.eRemove(e))),this.fileMCheck("none")):this.$message.error(e,"删除失败:",t.data.message)})).catch((t=>{this.$message.error(e,"删除失败",t.message),console.error(t)})).finally(t)}},eRemove(e=""){this.curtshow.list.splice(this.curtshow.list.findIndex((t=>t.name===e)),1)},subGo(e){e.target.dataset.index&&(this.subpath.splice(Number(e.target.dataset.index)+1),this.fileMCheck("none"))},efssSave(){if(this.esconfig.enable){if(""===this.esconfig.directory)return void this.$message.error("请填写目录地址")}else if(!confirm("确定关闭 EFSS?"))return;const e=this.$message.loading("EFSS 目录更新中...",0);this.$axios.put("/config",{type:"efss",data:this.esconfig}).then((e=>{console.debug(e.data),0===e.data.rescode?(this.subpath.splice(0),this.$message.success(e.data.message),this.eInit()):404===e.data.rescode?this.$message.error("目录:",this.esconfig.directory,"并不存在,请设置其他目录"):this.$message.error("EFSS 设置失败,未知错误")})).catch((e=>{this.$message.error("EFSS 设置失败",e.message),console.error(e)})).finally(e)},editFile(){this.fileedit.name=this.filecheck[0],this.fileedit.burl=location.origin+"/efss"+this.postpath+"/",this.fileedit.path=this.fullpath,this.fileedit.start="url"},renameFile(e="",t=-1){e||(e=this.filecheck[0]);let n=prompt("请输入新的文件名",e);for(;n&&/\\|\/|\?|\||<|>|:|\*/.test(n);)n=prompt("文件名中保存特殊字符,请重新输入",n);if(!n)return;let r=this.curtshow.list.findIndex((e=>e.name===n));if(-1!==r&&!confirm(n+" 已存在,是否继续?(将会覆盖原文件"))return;-1===t&&(t=this.curtshow.list.findIndex((t=>t.name===e)));const s=this.$message.loading(e,"重命名中...",0);this.$axios.post("/rpc",{method:"rename",params:[this.fullpath+"/"+e,this.fullpath+"/"+n]}).then((e=>{0===e.data.rescode?(this.$message.success(`成功重命名为 ${n} ${e.data.message}`),this.curtshow.list[t].name=n,-1!==r&&this.curtshow.list.splice(r,1),this.fileMCheck("none"),console.debug(e.data)):(this.$message.error(`重命名失败 ${e.data.message}`),console.error(e.data))})).catch((e=>{this.$message.error(`重命名失败 ${e.message}`),console.error(e)})).finally(s)},operateFiles(){if(!(this.fileop.name&&this.fileop.folder&&this.fileop.operate))return void this.$message.error("无法对空对象进行操作");if(this.fileop.folder===this.fullpath)return void this.$message.error("无法在和复制/剪切相同的目录下进行粘贴操作");"string"===this.$sType(this.fileop.name)&&(this.fileop.name=[this.fileop.name]);let e=this.fileop.operate;const t=this.$message.loading(this.fileop.name.join(", "),e,"中...",0);this.$axios.post("/rpc",{method:this.fileop.operate,params:[this.fileop.name,this.fileop.folder,this.fullpath]}).then((t=>{if(0===t.data.rescode){this.$message.success(`${this.fileop.name.join(", ")} ${e}成功\n${t.data.message}`);let n=this.$sTime();this.curtshow.list.push(...this.fileop.name.map((e=>({type:"file",name:e,mtime:n})))),console.debug(t.data),this.fileop.name="",this.fileop.folder="",this.fileop.operate=""}else this.$message.error(`${this.fileop.name.join(", ")} ${e} 失败\n${t.data.message||t.data}`),console.error(t.data)})).catch((t=>{this.$message.error(`${this.fileop.name.join(", ")} ${e} 失败\n${t.message}`),console.error(t)})).finally(t)},copyFiles(){console.debug(this.filecheck,"ready to copy"),this.fileop.name=[...this.filecheck],this.fileop.folder=this.fullpath,this.fileop.operate="copy",this.$message.success("已获取",this.fileop.name.join(", "),"文件地址\n请选择目标文件夹后进行粘贴")},moveFiles(){console.debug(this.filecheck,"ready to move"),this.fileop.name=[...this.filecheck],this.fileop.folder=this.fullpath,this.fileop.operate="move",this.$message.success("已获取",this.fileop.name.join(", "),"文件地址\n请选择目标文件夹后进行粘贴")},deltFiles(){this.eDel([...this.filecheck])},zipFiles(){this.eZip(this.filecheck.map((e=>this.fullpath+"/"+e)),this.fullpath,this.$uStr.surlName(this.fullpath)+".zip"),this.fileMCheck("none")},unzipFile(){this.isSingleCheck?(this.eUnZip(this.fullpath,this.filecheck[0]),this.fileMCheck("none")):this.$message.error("请选择单个 zip 文件进行解压")},fileDownload(){if(!this.filedownloadurl||!1===/^https?:\/\/\S{4}/.test(this.filedownloadurl))return void this.$message.error("该远程文件链接有误",this.filedownloadurl);let e=this.filedownloadurl.match(/ -rename(=| )([^\- ]+)/),t="",n="";e&&e[2]?(t=e[2].replace(/^(\\|\/)+/,""),n=this.filedownloadurl.split(" ")[0]):(t=this.$uStr.surlName(this.filedownloadurl),n=this.filedownloadurl);let r=this.curtshow.list.findIndex((e=>e.name===t));if(-1!==r&&!confirm(t+" 已存在,是否继续?(将会覆盖原文件"))return;Bo.connections.has("efss")||Bo.Recv("efss",(e=>{if("message"===e.type){const{progress:t,mid:n}=e.data;this.$message.success(t,{mid:n})}}));const s=this.$message.loading(`${t} 下载中...`,0);this.$axios.post("/rpc",{method:"download",params:[n,this.fullpath,t]}).then((e=>{0===e.data.rescode?(this.$message.success(t,"下载成功"),-1===r?this.curtshow.list.push({type:"file",name:this.$uStr.surlName(e.data.resdata)||t,mtime:this.$sTime()}):this.curtshow.list[r].mtime=this.$sTime()):1===e.data.rescode?this.$message.success(e.data.resdata||t,"下载任务已存在,请尝试其他链接或目录/文件名"):this.$message.error(t,"下载失败",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("下载失败",e.message),console.error(n,"下载失败",e)})).finally(s)},fileMCheck(e="none"){if("all"===e)this.filecheck=this.showlist.map((e=>e.name));else this.filecheck.length&&this.filecheck.splice(0)}}};const Ho=wi(Uo,yi,[],!1,null,"2fb82df5",null).exports;function Vo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ko}=Object.prototype,{getPrototypeOf:qo}=Object,Wo=(Go=Object.create(null),e=>{const t=Ko.call(e);return Go[t]||(Go[t]=t.slice(8,-1).toLowerCase())});var Go;const Jo=e=>(e=e.toLowerCase(),t=>Wo(t)===e),Xo=e=>t=>typeof t===e,{isArray:Zo}=Array,Yo=Xo("undefined");const Qo=Jo("ArrayBuffer");const ea=Xo("string"),ta=Xo("function"),na=Xo("number"),ra=e=>null!==e&&"object"==typeof e,sa=e=>{if("object"!==Wo(e))return!1;const t=qo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ia=Jo("Date"),oa=Jo("File"),aa=Jo("Blob"),ca=Jo("FileList"),la=Jo("URLSearchParams"),[ua,fa,da,pa]=["ReadableStream","Request","Response","Headers"].map(Jo);function ha(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),Zo(e))for(r=0,s=e.length;r0;)if(r=n[s],t===r.toLowerCase())return r;return null}const va="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ga=e=>!Yo(e)&&e!==va;const ya=(ba="undefined"!=typeof Uint8Array&&qo(Uint8Array),e=>ba&&e instanceof ba);var ba;const _a=Jo("HTMLFormElement"),wa=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ka=Jo("RegExp"),Ca=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ha(n,((n,s)=>{let i;!1!==(i=t(n,s,e))&&(r[s]=i||n)})),Object.defineProperties(e,r)},xa="abcdefghijklmnopqrstuvwxyz",$a="0123456789",Sa={DIGIT:$a,ALPHA:xa,ALPHA_DIGIT:xa+xa.toUpperCase()+$a};const Ea=Jo("AsyncFunction"),Oa=(Ta="function"==typeof setImmediate,Aa=ta(va.postMessage),Ta?setImmediate:Aa?((e,t)=>(va.addEventListener("message",(({source:n,data:r})=>{n===va&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),va.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Ta,Aa;const Ra="undefined"!=typeof queueMicrotask?queueMicrotask.bind(va):"undefined"!=typeof process&&process.nextTick||Oa,Na={isArray:Zo,isArrayBuffer:Qo,isBuffer:function(e){return null!==e&&!Yo(e)&&null!==e.constructor&&!Yo(e.constructor)&&ta(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ta(e.append)&&("formdata"===(t=Wo(e))||"object"===t&&ta(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Qo(e.buffer),t},isString:ea,isNumber:na,isBoolean:e=>!0===e||!1===e,isObject:ra,isPlainObject:sa,isReadableStream:ua,isRequest:fa,isResponse:da,isHeaders:pa,isUndefined:Yo,isDate:ia,isFile:oa,isBlob:aa,isRegExp:ka,isFunction:ta,isStream:e=>ra(e)&&ta(e.pipe),isURLSearchParams:la,isTypedArray:ya,isFileList:ca,forEach:ha,merge:function e(){const{caseless:t}=ga(this)&&this||{},n={},r=(r,s)=>{const i=t&&ma(n,s)||s;sa(n[i])&&sa(r)?n[i]=e(n[i],r):sa(r)?n[i]=e({},r):Zo(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e(ha(t,((t,r)=>{n&&ta(t)?e[r]=Vo(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,i,o;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&qo(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Wo,kindOfTest:Jo,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Zo(e))return e;let t=e.length;if(!na(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:_a,hasOwnProperty:wa,hasOwnProp:wa,reduceDescriptors:Ca,freezeMethods:e=>{Ca(e,((t,n)=>{if(ta(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];ta(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return Zo(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:ma,global:va,isContextDefined:ga,ALPHABET:Sa,generateString:(e=16,t=Sa.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&ta(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ra(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=Zo(e)?[]:{};return ha(e,((e,t)=>{const i=n(e,r+1);!Yo(i)&&(s[t]=i)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:Ea,isThenable:e=>e&&(ra(e)||ta(e))&&ta(e.then)&&ta(e.catch),setImmediate:Oa,asap:Ra};function Pa(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}Na.inherits(Pa,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Na.toJSONObject(this.config),code:this.code,status:this.status}}});const Da=Pa.prototype,ja={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ja[e]={value:e}})),Object.defineProperties(Pa,ja),Object.defineProperty(Da,"isAxiosError",{value:!0}),Pa.from=(e,t,n,r,s,i)=>{const o=Object.create(Da);return Na.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Pa.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const Ma=Pa;function La(e){return Na.isPlainObject(e)||Na.isArray(e)}function Ia(e){return Na.endsWith(e,"[]")?e.slice(0,-2):e}function za(e,t,n){return e?e.concat(t).map((function(e,t){return e=Ia(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Fa=Na.toFlatObject(Na,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Ba=function(e,t,n){if(!Na.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Na.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Na.isUndefined(t[e])}))).metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Na.isSpecCompliantForm(t);if(!Na.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Na.isDate(e))return e.toISOString();if(!a&&Na.isBlob(e))throw new Ma("Blob is not supported. Use a Buffer instead.");return Na.isArrayBuffer(e)||Na.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(Na.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Na.isArray(e)&&function(e){return Na.isArray(e)&&!e.some(La)}(e)||(Na.isFileList(e)||Na.endsWith(n,"[]"))&&(a=Na.toArray(e)))return n=Ia(n),a.forEach((function(e,r){!Na.isUndefined(e)&&null!==e&&t.append(!0===o?za([n],r,i):null===o?n:n+"[]",c(e))})),!1;return!!La(e)||(t.append(za(s,n,i),c(e)),!1)}const u=[],f=Object.assign(Fa,{defaultVisitor:l,convertValue:c,isVisitable:La});if(!Na.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Na.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Na.forEach(n,(function(n,i){!0===(!(Na.isUndefined(n)||null===n)&&s.call(t,n,Na.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t};function Ua(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Ha(e,t){this._pairs=[],e&&Ba(e,this,t)}const Va=Ha.prototype;Va.append=function(e,t){this._pairs.push([e,t])},Va.toString=function(e){const t=e?function(t){return e.call(this,t,Ua)}:Ua;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Ka=Ha;function qa(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wa(e,t,n){if(!t)return e;const r=n&&n.encode||qa,s=n&&n.serialize;let i;if(i=s?s(t,n):Na.isURLSearchParams(t)?t.toString():new Ka(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ga=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Na.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Ja={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xa={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ka,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Za="undefined"!=typeof window&&"undefined"!=typeof document,Ya="object"==typeof navigator&&navigator||void 0,Qa=Za&&(!Ya||["ReactNative","NativeScript","NS"].indexOf(Ya.product)<0),ec="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,tc=Za&&window.location.href||"http://localhost",nc={...r,...Xa};const rc=function(e){function t(e,n,r,s){let i=e[s++];if("__proto__"===i)return!0;const o=Number.isFinite(+i),a=s>=e.length;if(i=!i&&Na.isArray(r)?r.length:i,a)return Na.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!o;r[i]&&Na.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],s)&&Na.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r{t(function(e){return Na.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const sc={transitional:Ja,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Na.isObject(e);s&&Na.isHTMLForm(e)&&(e=new FormData(e));if(Na.isFormData(e))return r?JSON.stringify(rc(e)):e;if(Na.isArrayBuffer(e)||Na.isBuffer(e)||Na.isStream(e)||Na.isFile(e)||Na.isBlob(e)||Na.isReadableStream(e))return e;if(Na.isArrayBufferView(e))return e.buffer;if(Na.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ba(e,new nc.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return nc.isNode&&Na.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=Na.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ba(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(Na.isString(e))try{return(t||JSON.parse)(e),Na.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||sc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Na.isResponse(e)||Na.isReadableStream(e))return e;if(e&&Na.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Ma.from(e,Ma.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nc.classes.FormData,Blob:nc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Na.forEach(["delete","get","head","post","put","patch"],(e=>{sc.headers[e]={}}));const ic=sc,oc=Na.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ac=Symbol("internals");function cc(e){return e&&String(e).trim().toLowerCase()}function lc(e){return!1===e||null==e?e:Na.isArray(e)?e.map(lc):String(e)}function uc(e,t,n,r,s){return Na.isFunction(r)?r.call(this,t,n):(s&&(t=n),Na.isString(t)?Na.isString(r)?-1!==t.indexOf(r):Na.isRegExp(r)?r.test(t):void 0:void 0)}class fc{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=cc(t);if(!s)throw new Error("header name must be a non-empty string");const i=Na.findKey(r,s);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=lc(e))}const i=(e,t)=>Na.forEach(e,((e,n)=>s(e,n,t)));if(Na.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Na.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&oc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(Na.isHeaders(e))for(const[t,r]of e.entries())s(r,t,n);else null!=e&&s(t,e,n);return this}get(e,t){if(e=cc(e)){const n=Na.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Na.isFunction(t))return t.call(this,e,n);if(Na.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=cc(e)){const n=Na.findKey(this,e);return!(!n||void 0===this[n]||t&&!uc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=cc(e)){const s=Na.findKey(n,e);!s||t&&!uc(0,n[s],s,t)||(delete n[s],r=!0)}}return Na.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!uc(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Na.forEach(this,((r,s)=>{const i=Na.findKey(n,s);if(i)return t[i]=lc(r),void delete t[s];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();o!==s&&delete t[s],t[o]=lc(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Na.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Na.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ac]=this[ac]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=cc(e);t[r]||(!function(e,t){const n=Na.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return Na.isArray(e)?e.forEach(r):r(e),this}}fc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Na.reduceDescriptors(fc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Na.freezeMethods(fc);const dc=fc;function pc(e,t){const n=this||ic,r=t||n,s=dc.from(r.headers);let i=r.data;return Na.forEach(e,(function(e){i=e.call(n,i,s.normalize(),t?t.status:void 0)})),s.normalize(),i}function hc(e){return!(!e||!e.__CANCEL__)}function mc(e,t,n){Ma.call(this,null==e?"canceled":e,Ma.ERR_CANCELED,t,n),this.name="CanceledError"}Na.inherits(mc,Ma,{__CANCEL__:!0});const vc=mc;function gc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Ma("Request failed with status code "+n.status,[Ma.ERR_BAD_REQUEST,Ma.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const yc=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,i=0,o=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[o];s||(s=c),n[i]=a,r[i]=c;let u=o,f=0;for(;u!==i;)f+=n[u++],u%=e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s{s=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=i?o(e,t):(n=e,r||(r=setTimeout((()=>{r=null,o(n)}),i-a)))},()=>n&&o(n)]},_c=(e,t,n=3)=>{let r=0;const s=yc(50,250);return bc((n=>{const i=n.loaded,o=n.lengthComputable?n.total:void 0,a=i-r,c=s(a);r=i;e({loaded:i,total:o,progress:o?i/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&i<=o?(o-i)/c:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),n)},wc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},kc=e=>(...t)=>Na.asap((()=>e(...t))),Cc=nc.hasStandardBrowserEnv?function(){const e=nc.navigator&&/(msie|trident)/i.test(nc.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=Na.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},xc=nc.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];Na.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Na.isString(r)&&o.push("path="+r),Na.isString(s)&&o.push("domain="+s),!0===i&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $c(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Sc=e=>e instanceof dc?{...e}:e;function Ec(e,t){t=t||{};const n={};function r(e,t,n){return Na.isPlainObject(e)&&Na.isPlainObject(t)?Na.merge.call({caseless:n},e,t):Na.isPlainObject(t)?Na.merge({},t):Na.isArray(t)?t.slice():t}function s(e,t,n){return Na.isUndefined(t)?Na.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!Na.isUndefined(t))return r(void 0,t)}function o(e,t){return Na.isUndefined(t)?Na.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,i){return i in t?r(n,s):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t)=>s(Sc(e),Sc(t),!0)};return Na.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||s,o=i(e[r],t[r],r);Na.isUndefined(o)&&i!==a||(n[r]=o)})),n}const Oc=e=>{const t=Ec({},e);let n,{data:r,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=dc.from(a),t.url=Wa($c(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Na.isFormData(r))if(nc.hasStandardBrowserEnv||nc.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(nc.hasStandardBrowserEnv&&(s&&Na.isFunction(s)&&(s=s(t)),s||!1!==s&&Cc(t.url))){const e=i&&o&&xc.read(o);e&&a.set(i,e)}return t},Tc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Oc(e);let s=r.data;const i=dc.from(r.headers).normalize();let o,a,c,l,u,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function v(){if(!m)return;const r=dc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());gc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(v)},m.onabort=function(){m&&(n(new Ma("Request aborted",Ma.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Ma("Network Error",Ma.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||Ja;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ma(t,s.clarifyTimeoutError?Ma.ETIMEDOUT:Ma.ECONNABORTED,e,m)),m=null},void 0===s&&i.setContentType(null),"setRequestHeader"in m&&Na.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),Na.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,u]=_c(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=_c(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new vc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===nc.protocols.indexOf(g)?n(new Ma("Unsupported protocol "+g+":",Ma.ERR_BAD_REQUEST,e)):m.send(s||null)}))},Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Ma?t:new vc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,s(new Ma(`timeout ${t} of ms exceeded`,Ma.ETIMEDOUT))}),t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)})),e=null)};e.forEach((e=>e.addEventListener("abort",s)));const{signal:a}=r;return a.unsubscribe=()=>Na.asap(o),a}},Rc=function*(e,t){let n=e.byteLength;if(!t||n{const s=async function*(e,t){for await(const n of Nc(e))yield*Rc(n,t)}(e,t);let i,o=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=o+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},Dc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,jc=Dc&&"function"==typeof ReadableStream,Mc=Dc&&("function"==typeof TextEncoder?(Lc=new TextEncoder,e=>Lc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Lc;const Ic=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},zc=jc&&Ic((()=>{let e=!1;const t=new Request(nc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Fc=jc&&Ic((()=>Na.isReadableStream(new Response("").body))),Bc={stream:Fc&&(e=>e.body)};var Uc;Dc&&(Uc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Bc[e]&&(Bc[e]=Na.isFunction(Uc[e])?t=>t[e]():(t,n)=>{throw new Ma(`Response type '${e}' is not supported`,Ma.ERR_NOT_SUPPORT,n)})})));const Hc=async(e,t)=>{const n=Na.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Na.isBlob(e))return e.size;if(Na.isSpecCompliantForm(e)){const t=new Request(nc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Na.isArrayBufferView(e)||Na.isArrayBuffer(e)?e.byteLength:(Na.isURLSearchParams(e)&&(e+=""),Na.isString(e)?(await Mc(e)).byteLength:void 0)})(t):n},Vc=Dc&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Oc(e);l=l?(l+"").toLowerCase():"text";let p,h=Ac([s,i&&i.toAbortSignal()],o);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let v;try{if(c&&zc&&"get"!==n&&"head"!==n&&0!==(v=await Hc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Na.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=wc(v,_c(kc(c)));r=Pc(n.body,65536,e,t)}}Na.isString(f)||(f=f?"include":"omit");const s="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:s?f:void 0});let i=await fetch(p);const o=Fc&&("stream"===l||"response"===l);if(Fc&&(a||o&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=Na.toFiniteNumber(i.headers.get("content-length")),[n,r]=a&&wc(t,_c(kc(a),!0))||[];i=new Response(Pc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let g=await Bc[Na.findKey(Bc,l)||"text"](i,e);return!o&&m&&m(),await new Promise(((t,n)=>{gc(t,n,{data:g,headers:dc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Ma("Network Error",Ma.ERR_NETWORK,e,p),{cause:t.cause||t});throw Ma.from(t,t&&t.code,e,p)}}),Kc={http:null,xhr:Tc,fetch:Vc};Na.forEach(Kc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const qc=e=>`- ${e}`,Wc=e=>Na.isFunction(e)||null===e||!1===e,Gc=e=>{e=Na.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(qc).join("\n"):" "+qc(e[0]):"as no adapter specified";throw new Ma("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Jc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vc(null,e)}function Xc(e){Jc(e),e.headers=dc.from(e.headers),e.data=pc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Gc(e.adapter||ic.adapter)(e).then((function(t){return Jc(e),t.data=pc.call(e,e.transformResponse,t),t.headers=dc.from(t.headers),t}),(function(t){return hc(t)||(Jc(e),t&&t.response&&(t.response.data=pc.call(e,e.transformResponse,t.response),t.response.headers=dc.from(t.response.headers))),Promise.reject(t)}))}const Zc="1.7.7",Yc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Yc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Qc={};Yc.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,i)=>{if(!1===e)throw new Ma(r(s," has been removed"+(t?" in "+t:"")),Ma.ERR_DEPRECATED);return t&&!Qc[s]&&(Qc[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,i)}};const el={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Ma("options must be an object",Ma.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const t=e[i],n=void 0===t||o(t,i,e);if(!0!==n)throw new Ma("option "+i+" must be "+n,Ma.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Ma("Unknown option "+i,Ma.ERR_BAD_OPTION)}},validators:Yc},tl=el.validators;class nl{constructor(e){this.defaults=e,this.interceptors={request:new Ga,response:new Ga}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ec(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&el.assertOptions(n,{silentJSONParsing:tl.transitional(tl.boolean),forcedJSONParsing:tl.transitional(tl.boolean),clarifyTimeoutError:tl.transitional(tl.boolean)},!1),null!=r&&(Na.isFunction(r)?t.paramsSerializer={serialize:r}:el.assertOptions(r,{encode:tl.function,serialize:tl.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&Na.merge(s.common,s[t.method]);s&&Na.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=dc.concat(i,s);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,f=0;if(!a){const e=[Xc.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new vc(e,r,s),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new sl((function(t){e=t})),cancel:e}}}const il=sl;const ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ol).forEach((([e,t])=>{ol[t]=e}));const al=ol;const cl=function e(t){const n=new rl(t),r=Vo(rl.prototype.request,n);return Na.extend(r,rl.prototype,n,{allOwnKeys:!0}),Na.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ec(t,n))},r}(ic);cl.Axios=rl,cl.CanceledError=vc,cl.CancelToken=il,cl.isCancel=hc,cl.VERSION=Zc,cl.toFormData=Ba,cl.AxiosError=Ma,cl.Cancel=cl.CanceledError,cl.all=function(e){return Promise.all(e)},cl.spread=function(e){return function(t){return e.apply(null,t)}},cl.isAxiosError=function(e){return Na.isObject(e)&&!0===e.isAxiosError},cl.mergeConfig=Ec,cl.AxiosHeaders=dc,cl.formToJSON=e=>rc(Na.isHTMLForm(e)?new FormData(e):e),cl.getAdapter=Gc,cl.HttpStatusCode=al,cl.default=cl;const ll=cl,ul=JSON.parse('{"join_gap":" ","en":"英文","zh":"中文","a":"a","access":"ACCESS","add":"ADD","addition":"ADDITION","address":"ADDRESS","agroup":"A GROUP","all":"ALL","allow":"ALLOW","allowed":"ALLOWED","and":"AND","arch":"ARCH","as":"AS","author":"AUTHOR","auto":"AUTO","autorun":"AUTO","backup":"BACKUP","belong":"BELONG","blacklist":"BLACKLIST","bfreq":"before request","bfres":"before response","browser":"browser","cache":"CACHE","cancel":"CANCEL","certificate":"CERTIFICATE","check":"CHECK","checkall":"CHECK ALL","checked":"CHECKED","checked_short":"CKD","checknone":"CHECK NONE","choose":"CHOOSE","clear":"CLEAR","clickrun":"CLICK","close":"CLOSE","closed":"CLOSED","cmd":"CMD","con_clients":"Connected Clients","confirm":"CONFIRM","connected":"CONNECTED","content":"CONTENT","countdown":"countdown","cron":"cron","current":"CURRENT","date":"DATE","default":"DEFAULT","delete":"DELETE","detail":"detail","disable":"DISABLE","disable_short":"DE","disabled":"DISABLED","disconnected":"DISCONNECTED","document":"document","donation":"DONATION","download":"DOWNLOAD","dthave":"DON\'T HAVE","edit":"EDIT","editexit":"EXIT","editmode":"EDIT","efss_file_manage":"EFSS FILE MANAGE","enable":"ENABLE","enable_short":"EN","enabled":"ENABLED","every":"EVERY","export":"EXPORT","exportsub":"EXPORT","fetch":"FETCH","file":"FILE","files":"FILES","five":"five","forbid":"FORBID","force":"FORCE","format":"FORMAT","generate":"GENERATE","get":"GET","homepage":"HOMEPAGE","host":"HOST","host_info":"Host Information","illegal":"illegal","import":"IMPORT","input":"input","install":"INSTALL","jsruntimes":"Script Run Times","language":"LANGUAGE","last":"LAST","last_three":"last three","level":"LEVEL","list":"LIST","local":"LOCAL","logs":"LOGS","logs_of_script":"LOGS OF SCRIPT","make":"MAKE","manage":"MANAGE","match":"MATCH","memory":"MEMORY","memoryusage":"Memory Usage","mock":"MOCK","modifyto":"MODIFY TO","more":"more","moveto":"MOVE TO","murl":"MATCH URL","name":"NAME","new":"NEW","neweapp":"NEW","next":"NEXT","non-matched":"NON-MATCHED","note":"NOTE","notify":"NOTIFY","noupdate":"no update","on":"on","open":"OPEN","operate":"OPERATE","operate_short":"OP","optional":"optional","or":"or","overview":"OVERVIEW","param":"PARAM","persistence":"Persistence","platform":"PLATFORM","please":"please","port":"PORT","prev":"PREV","proxy":"PROXY","push":"PUSH","random":"random","redirect":"REDIRECT","refresh":"REFRESH","regexp":"REGEXP","reject":"REJECT","remote":"REMOTE","request":"REQUEST","repeat":"repeat","replace":"REPLACE","rest":"rest","restart":"RESTART","rewrite":"REWRITE","root":"ROOT","rule":"RULE","run":"RUN","save":"SAVE","script":"SCRIPT","search":"SEARCH","second":"second","seconds":"seconds","security":"SECURITY","self-signed":"SELF-SIGNED","send":"SEND","setting":"SETTING","setting_of":"SETTING","shortcut":"shortcut","show":"show","sign":"SIGN","six":"six","skip":"SKIP","sponsors":"Sponsors","start":"START","startat":"START AT","status":"STATUS","status_short":"ST","stop":"STOP","style":"STYLE","sub":"SUB","target":"TARGET","task":"TASK","temp":"TEMP","test":"TEST","time":"TIME","timed":"TIMED","times":"times","timing":"TIMING","to":"TO","toggle":"TOGGLE","update":"UPDATE","upload":"UPLOAD","url":"URL","user":"USER","valid":"VALID","version":"VERSION","web":"WEB","whitelist":"WHITELIST"}'),fl=JSON.parse('{"join_gap":"","en":"EN","zh":"zh-CN","a":"一个","access":"访问","add":"添加","addition":"新增","address":"地址","agroup":"某分组","all":"全部","allow":"允许","allowed":"允许","and":"并","arch":"架构","as":"成为","author":"作者","auto":"自动","autorun":"自动运行","backup":"备份","belong":"关联","bfreq":"网络请求前","bfres":"数据返回前","blacklist":"黑名单","browser":"浏览器","cache":"缓存","cancel":"取消","certificate":"证书","check":"查看","checkall":"全部选择","checked":"选中","checked_short":"选择","checknone":"全都不选","choose":"选择","clear":"清空","clickrun":"点击运行","close":"关闭","closed":"已关闭","cmd":"指令","con_clients":"客户端连接数","confirm":"确定","connected":"已连接","content":"内容","countdown":"倒计时","cron":"cron定时","current":"当前","date":"日期","default":"默认","delete":"删除","detail":"详细说明","disable":"关闭","disable_short":"禁用","disabled":"已关闭","disconnected":"已断开","document":"说明文档","donation":"赞助打赏","download":"下载","dthave":"并没有","edit":"编辑","editexit":"退出编辑","editmode":"编辑模式","efss_file_manage":"EFSS 文件管理界面","enable":"启用","enable_short":"启用","enabled":"已启用","every":"每","export":"导出","exportsub":"导出订阅","fetch":"获取内容","file":"文件","files":"文件数","five":"五","forbid":"禁止","force":"强制","format":"格式","generate":"生成","get":"获取","homepage":"主页地址","host":"域名","host_info":"服务器相关信息","illegal":"非法","import":"导入","input":"输入","install":"安装","jsruntimes":"脚本运行总次数","language":"语言偏好","last":"最近","last_three":"后三项","level":"等级","list":"列表","local":"本地","logs":"日志","logs_of_script":"查看程序运行日志","make":"生成","manage":"管理","match":"匹配","memory":"内存","memoryusage":"内存使用情况","mock":"模拟","modifyto":"修改方式","more":"更多","moveto":"移动到","murl":"匹配链接","name":"名称","new":"新建","neweapp":"新建应用","next":"下一个","non-matched":"未匹配","note":"备注","notify":"通知","noupdate":"不自动更新","on":"在","open":"打开","operate":"操作","operate_short":"操作","optional":"可选择项","or":"或","overview":"基础信息","param":"参数","persistence":"常量","platform":"平台","please":"请","port":"端口","prev":"上一个","proxy":"代理","push":"推送","random":"随机","redirect":"重定向","refresh":"刷新","regexp":"正则表达式","reject":"阻止","remote":"远程","request":"请求","repeat":"重复","replace":"替换","rest":"剩余","restart":"重启","rewrite":"重写","root":"根","rule":"规则","run":"运行","save":"保存","script":"脚本","search":"搜索","second":"秒","seconds":"秒数","security":"安全","self-signed":"自签","send":"发送","setting":"设置","setting_of":"相关设置","shortcut":"快捷键","show":"显示","sign":"签发","six":"六","skip":"跳过","sponsors":"广告","start":"开始","startat":"启动时间","status":"状态","status_short":"状态","stop":"停止","style":"风格","sub":"订阅","target":"目标","task":"任务","temp":"临时","test":"测试","time":"时间","timed":"定时","times":"次数","timing":"时间点","to":"至","toggle":"反转","update":"更新","upload":"上传","url":"链接","user":"用户","valid":"有效","version":"后台版本","web":"网络","whitelist":"白名单"}');const dl={locale:function(){let e="";return location.search&&(e=new URLSearchParams(location.search).get("lang")),e||localStorage.getItem("lang")||navigator.language}().startsWith("zh")?"zh-CN":"en",fallbackLocale:"en"},pl={en:ul,"zh-CN":fl};nr.prototype.$axios=ll,nr.prototype.$sType=Ei,nr.prototype.$sString=Ti,nr.prototype.$sJson=Oi,nr.prototype.$sTime=Li,nr.prototype.$logHead=Fi,nr.prototype.$uStr=e,nr.prototype.$uApi=t,nr.prototype.$message=To.message,nr.prototype.$t=function(e){return(pl[dl.locale]||pl[dl.fallbackLocale])[e]||e},nr.prototype.$ta=function(...e){const t=pl[dl.locale]||pl[dl.fallbackLocale],n=t.join_gap;return e.map((e=>t[e]||e)).join(n)},nr.config.productionTip=!1,new nr({el:"#efss",render:e=>e(Ho)})})()})(); \ No newline at end of file diff --git a/web/dist/efss/index.html b/web/dist/efss/index.html index 34f1dca2..2c3e9560 100644 --- a/web/dist/efss/index.html +++ b/web/dist/efss/index.html @@ -10,7 +10,7 @@ EFSS - elecV2P file storage system - + diff --git a/web/dist/index.04e1d48c152d1c961d74.js b/web/dist/index.d0768dbb3b550f28cd4a.js similarity index 99% rename from web/dist/index.04e1d48c152d1c961d74.js rename to web/dist/index.d0768dbb3b550f28cd4a.js index d67d4286..cc8b0442 100644 --- a/web/dist/index.04e1d48c152d1c961d74.js +++ b/web/dist/index.d0768dbb3b550f28cd4a.js @@ -4,4 +4,4 @@ * (c) 2014-2023 Evan You * Released under the MIT License. */ -var n=Object.freeze({}),a=Array.isArray;function r(e){return null==e}function o(e){return null!=e}function l(e){return!0===e}function c(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return"function"==typeof e}function h(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function m(e){return"[object RegExp]"===d.call(e)}function f(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,_,2):String(e)}function _(e,t){return t&&t.__v_isRef?t.value:t}function b(e){var t=parseFloat(e);return isNaN(t)?e:t}function y(e,t){for(var s=Object.create(null),i=e.split(","),n=0;n-1)return e.splice(i,1)}}var k=Object.prototype.hasOwnProperty;function C(e,t){return k.call(e,t)}function x(e){var t=Object.create(null);return function(s){return t[s]||(t[s]=e(s))}}var T=/-(\w)/g,S=x((function(e){return e.replace(T,(function(e,t){return t?t.toUpperCase():""}))})),O=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),E=/\B([A-Z])/g,j=x((function(e){return e.replace(E,"-$1").toLowerCase()}));var N=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function s(s){var i=arguments.length;return i?i>1?e.apply(t,arguments):e.call(t,s):e.call(t)}return s._length=e.length,s};function P(e,t){t=t||0;for(var s=e.length-t,i=new Array(s);s--;)i[s]=e[s+t];return i}function A(e,t){for(var s in t)e[s]=t[s];return e}function I(e){for(var t={},s=0;s0,te=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var se=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var ie,ne=Z&&Z.match(/firefox\/(\d+)/),ae={}.watch,re=!1;if(X)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){re=!0}}),window.addEventListener("test-passive",null,oe)}catch(e){}var le=function(){return void 0===ie&&(ie=!X&&void 0!==s.g&&(s.g.process&&"server"===s.g.process.env.VUE_ENV)),ie},ce=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ue(e){return"function"==typeof e&&/native code/.test(e.toString())}var he,de="undefined"!=typeof Symbol&&ue(Symbol)&&"undefined"!=typeof Reflect&&ue(Reflect.ownKeys);he="undefined"!=typeof Set&&ue(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var pe=null;function me(e){void 0===e&&(e=null),e||pe&&pe._scope.off(),pe=e,e&&e._scope.on()}var fe=function(){function e(e,t,s,i,n,a,r,o){this.tag=e,this.data=t,this.children=s,this.text=i,this.elm=n,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=r,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=o,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new fe;return t.text=e,t.isComment=!0,t};function ge(e){return new fe(void 0,void 0,void 0,String(e))}function _e(e){var t=new fe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var be=0,ye=[],$e=function(){function e(){this._pending=!1,this.id=be++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var s=0,i=t.length;s0&&(Qe((i=et(i,"".concat(t||"","_").concat(s)))[0])&&Qe(u)&&(h[n]=ge(u.text+i[0].text),i.shift()),h.push.apply(h,i)):c(i)?Qe(u)?h[n]=ge(u.text+i):""!==i&&h.push(ge(i)):Qe(i)&&Qe(u)?h[n]=ge(u.text+i.text):(l(e._isVList)&&o(i.tag)&&r(i.key)&&o(t)&&(i.key="__vlist".concat(t,"_").concat(s,"__")),h.push(i)));return h}function tt(e,t){var s,i,n,r,l=null;if(a(e)||"string"==typeof e)for(l=new Array(e.length),s=0,i=e.length;s0,o=t?!!t.$stable:!r,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(o&&i&&i!==n&&l===i.$key&&!r&&!i.$hasNormal)return i;for(var c in a={},t)t[c]&&"$"!==c[0]&&(a[c]=yt(e,s,c,t[c]))}else a={};for(var u in s)u in a||(a[u]=$t(s,u));return t&&Object.isExtensible(t)&&(t._normalized=a),J(a,"$stable",o),J(a,"$key",l),J(a,"$hasNormal",r),a}function yt(e,t,s,i){var n=function(){var t=pe;me(e);var s=arguments.length?i.apply(null,arguments):i({}),n=(s=s&&"object"==typeof s&&!a(s)?[s]:Ze(s))&&s[0];return me(t),s&&(!n||1===s.length&&n.isComment&&!_t(n))?void 0:s};return i.proxy&&Object.defineProperty(t,s,{get:n,enumerable:!0,configurable:!0}),n}function $t(e,t){return function(){return e[t]}}function wt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};J(t,"_v_attr_proxy",!0),kt(t,e.$attrs,n,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||kt(e._listenersProxy={},e.$listeners,n,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||xt(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:N(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(s){return Be(e,t,s)}))}}}function kt(e,t,s,i,n){var a=!1;for(var r in t)r in e?t[r]!==s[r]&&(a=!0):(a=!0,Ct(e,r,i,n));for(var r in e)r in t||(a=!0,delete e[r]);return a}function Ct(e,t,s,i){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return s[i][t]}})}function xt(e,t){for(var s in t)e[s]=t[s];for(var s in e)s in t||delete e[s]}var Tt=null;function St(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),h(e)?t.extend(e):e}function Ot(e){if(a(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(gs=function(){return _s.now()})}var bs=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function ys(){var e,t;for(vs=gs(),ms=!0,us.sort(bs),fs=0;fsfs&&us[s].id>e.id;)s--;us.splice(s+1,0,e)}else us.push(e);ps||(ps=!0,Kt(ys))}}function ws(e,t){if(e){for(var s=Object.create(null),i=de?Reflect.ownKeys(e):Object.keys(e),n=0;n-1)if(a&&!C(n,"default"))r=!1;else if(""===r||r===j(e)){var l=Vs(String,n.type);(l<0||o-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!m(e)&&e.test(t)}function ai(e,t){var s=e.cache,i=e.keys,n=e._vnode,a=e.$vnode;for(var r in s){var o=s[r];if(o){var l=o.name;l&&!t(l)&&ri(s,r,i,n)}}a.componentOptions.children=void 0}function ri(e,t,s,i){var n=e[t];!n||i&&n.tag===i.tag||n.componentInstance.$destroy(),e[t]=null,w(s,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=Qs++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ge(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var s=e.$options=Object.create(e.constructor.options),i=t._parentVnode;s.parent=t.parent,s._parentVnode=i;var n=i.componentOptions;s.propsData=n.propsData,s._parentListeners=n.listeners,s._renderChildren=n.children,s._componentTag=n.tag,t.render&&(s.render=t.render,s.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Ls(ei(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,s=t.parent;if(s&&!t.abstract){for(;s.$options.abstract&&s.$parent;)s=s.$parent;s.$children.push(e)}e.$parent=s,e.$root=s?s.$root:e,e.$children=[],e.$refs={},e._provided=s?s._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&is(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,s=e.$vnode=t._parentVnode,i=s&&s.context;e.$slots=vt(t._renderChildren,i),e.$scopedSlots=s?bt(e.$parent,s.data.scopedSlots,e.$slots):n,e._c=function(t,s,i,n){return Nt(e,t,s,i,n,!1)},e.$createElement=function(t,s,i,n){return Nt(e,t,s,i,n,!0)};var a=s&&s.data;Ie(e,"$attrs",a&&a.attrs||n,null,!0),Ie(e,"$listeners",t._parentListeners||n,null,!0)}(t),cs(t,"beforeCreate",void 0,!1),function(e){var t=ws(e.$options.inject,e);t&&(je(!1),Object.keys(t).forEach((function(s){Ie(e,s,t[s])})),je(!0))}(t),qs(t),function(e){var t=e.$options.provide;if(t){var s=u(t)?t.call(e):t;if(!h(s))return;for(var i=Ke(e),n=de?Reflect.ownKeys(s):Object.keys(s),a=0;a1?P(s):s;for(var i=P(arguments,1),n='event handler for "'.concat(e,'"'),a=0,r=s.length;aparseInt(this.max)&&ri(t,s[0],s,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ri(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){ai(e,(function(e){return ni(t,e)}))})),this.$watch("exclude",(function(t){ai(e,(function(e){return!ni(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ot(e),s=t&&t.componentOptions;if(s){var i=ii(s),n=this.include,a=this.exclude;if(n&&(!i||!ni(n,i))||a&&i&&ni(a,i))return t;var r=this.cache,o=this.keys,l=null==t.key?s.Ctor.cid+(s.tag?"::".concat(s.tag):""):t.key;r[l]?(t.componentInstance=r[l].componentInstance,w(o,l),o.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}},ci={KeepAlive:li};!function(e){var t={get:function(){return G}};Object.defineProperty(e,"config",t),e.util={warn:Ns,extend:A,mergeOptions:Ls,defineReactive:Ie},e.set=Re,e.delete=De,e.nextTick=Kt,e.observable=function(e){return Ae(e),e},e.options=Object.create(null),z.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,A(e.options.components,ci),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var s=P(arguments,1);return s.unshift(this),u(e.install)?e.install.apply(e,s):u(e)&&e.apply(null,s),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ls(this.options,e),this}}(e),si(e),function(e){z.forEach((function(t){e[t]=function(e,s){return s?("component"===t&&p(s)&&(s.name=s.name||e,s=this.options._base.extend(s)),"directive"===t&&u(s)&&(s={bind:s,update:s}),this.options[t+"s"][e]=s,s):this.options[t+"s"][e]}}))}(e)}(ti),Object.defineProperty(ti.prototype,"$isServer",{get:le}),Object.defineProperty(ti.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(ti,"FunctionalRenderContext",{value:ks}),ti.version="2.7.16";var ui=y("style,class"),hi=y("input,textarea,option,select,progress"),di=y("contenteditable,draggable,spellcheck"),pi=y("events,caret,typing,plaintext-only"),mi=y("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),fi="http://www.w3.org/1999/xlink",vi=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},gi=function(e){return vi(e)?e.slice(6,e.length):""},_i=function(e){return null==e||!1===e};function bi(e){for(var t=e.data,s=e,i=e;o(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=yi(i.data,t));for(;o(s=s.parent);)s&&s.data&&(t=yi(t,s.data));return function(e,t){if(o(e)||o(t))return $i(e,wi(t));return""}(t.staticClass,t.class)}function yi(e,t){return{staticClass:$i(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function $i(e,t){return e?t?e+" "+t:e:t||""}function wi(e){return Array.isArray(e)?function(e){for(var t,s="",i=0,n=e.length;i-1?Ki(e,t,s):mi(t)?_i(s)?e.removeAttribute(t):(s="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,s)):di(t)?e.setAttribute(t,function(e,t){return _i(t)||"false"===t?"false":"contenteditable"===e&&pi(t)?t:"true"}(t,s)):vi(t)?_i(s)?e.removeAttributeNS(fi,gi(t)):e.setAttributeNS(fi,t,s):Ki(e,t,s)}function Ki(e,t,s){if(_i(s))e.removeAttribute(t);else{if(Q&&!ee&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==s&&!e.__ieph){var i=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",i)};e.addEventListener("input",i),e.__ieph=!0}e.setAttribute(t,s)}}var qi={create:Vi,update:Vi};function Ji(e,t){var s=t.elm,i=t.data,n=e.data;if(!(r(i.staticClass)&&r(i.class)&&(r(n)||r(n.staticClass)&&r(n.class)))){var a=bi(t),l=s._transitionClasses;o(l)&&(a=$i(a,wi(l))),a!==s._prevClass&&(s.setAttribute("class",a),s._prevClass=a)}}var Wi,Yi={create:Ji,update:Ji},Xi="__r",Zi="__c";function Qi(e,t,s){var i=Wi;return function n(){null!==t.apply(null,arguments)&&sn(e,n,s,i)}}var en=Lt&&!(ne&&Number(ne[1])<=53);function tn(e,t,s,i){if(en){var n=vs,a=t;t=a._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=n||e.timeStamp<=0||e.target.ownerDocument!==document)return a.apply(this,arguments)}}Wi.addEventListener(e,t,re?{capture:s,passive:i}:s)}function sn(e,t,s,i){(i||Wi).removeEventListener(e,t._wrapper||t,s)}function nn(e,t){if(!r(e.data.on)||!r(t.data.on)){var s=t.data.on||{},i=e.data.on||{};Wi=t.elm||e.elm,function(e){if(o(e[Xi])){var t=Q?"change":"input";e[t]=[].concat(e[Xi],e[t]||[]),delete e[Xi]}o(e[Zi])&&(e.change=[].concat(e[Zi],e.change||[]),delete e[Zi])}(s),We(s,i,tn,sn,Qi,t.context),Wi=void 0}}var an,rn={create:nn,update:nn,destroy:function(e){return nn(e,Ai)}};function on(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var s,i,n=t.elm,a=e.data.domProps||{},c=t.data.domProps||{};for(s in(o(c.__ob__)||l(c._v_attr_proxy))&&(c=t.data.domProps=A({},c)),a)s in c||(n[s]="");for(s in c){if(i=c[s],"textContent"===s||"innerHTML"===s){if(t.children&&(t.children.length=0),i===a[s])continue;1===n.childNodes.length&&n.removeChild(n.childNodes[0])}if("value"===s&&"PROGRESS"!==n.tagName){n._value=i;var u=r(i)?"":String(i);ln(n,u)&&(n.value=u)}else if("innerHTML"===s&&xi(n.tagName)&&r(n.innerHTML)){(an=an||document.createElement("div")).innerHTML="".concat(i,"");for(var h=an.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;h.firstChild;)n.appendChild(h.firstChild)}else if(i!==a[s])try{n[s]=i}catch(e){}}}}function ln(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var s=!0;try{s=document.activeElement!==e}catch(e){}return s&&e.value!==t}(e,t)||function(e,t){var s=e.value,i=e._vModifiers;if(o(i)){if(i.number)return b(s)!==b(t);if(i.trim)return s.trim()!==t.trim()}return s!==t}(e,t))}var cn={create:on,update:on},un=x((function(e){var t={},s=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var i=e.split(s);i.length>1&&(t[i[0].trim()]=i[1].trim())}})),t}));function hn(e){var t=dn(e.style);return e.staticStyle?A(e.staticStyle,t):t}function dn(e){return Array.isArray(e)?I(e):"string"==typeof e?un(e):e}var pn,mn=/^--/,fn=/\s*!important$/,vn=function(e,t,s){if(mn.test(t))e.style.setProperty(t,s);else if(fn.test(s))e.style.setProperty(j(t),s.replace(fn,""),"important");else{var i=_n(t);if(Array.isArray(s))for(var n=0,a=s.length;n-1?t.split($n).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var s=" ".concat(e.getAttribute("class")||""," ");s.indexOf(" "+t+" ")<0&&e.setAttribute("class",(s+t).trim())}}function kn(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split($n).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var s=" ".concat(e.getAttribute("class")||""," "),i=" "+t+" ";s.indexOf(i)>=0;)s=s.replace(i," ");(s=s.trim())?e.setAttribute("class",s):e.removeAttribute("class")}}function Cn(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,xn(e.name||"v")),A(t,e),t}return"string"==typeof e?xn(e):void 0}}var xn=x((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Tn=X&&!ee,Sn="transition",On="animation",En="transition",jn="transitionend",Nn="animation",Pn="animationend";Tn&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(En="WebkitTransition",jn="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Nn="WebkitAnimation",Pn="webkitAnimationEnd"));var An=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function In(e){An((function(){An(e)}))}function Rn(e,t){var s=e._transitionClasses||(e._transitionClasses=[]);s.indexOf(t)<0&&(s.push(t),wn(e,t))}function Dn(e,t){e._transitionClasses&&w(e._transitionClasses,t),kn(e,t)}function Fn(e,t,s){var i=Hn(e,t),n=i.type,a=i.timeout,r=i.propCount;if(!n)return s();var o=n===Sn?jn:Pn,l=0,c=function(){e.removeEventListener(o,u),s()},u=function(t){t.target===e&&++l>=r&&c()};setTimeout((function(){l0&&(s=Sn,u=r,h=a.length):t===On?c>0&&(s=On,u=c,h=l.length):h=(s=(u=Math.max(r,c))>0?r>c?Sn:On:null)?s===Sn?a.length:l.length:0,{type:s,timeout:u,propCount:h,hasTransform:s===Sn&&Ln.test(i[En+"Property"])}}function Un(e,t){for(;e.length1}function Kn(e,t){!0!==t.data.show&&Bn(t)}var qn=function(e){var t,s,i={},n=e.modules,u=e.nodeOps;for(t=0;tm?b(e,r(s[g+1])?null:s[g+1].elm,s,p,g,i):p>g&&w(t,h,m)}(h,f,g,s,c):o(g)?(o(e.text)&&u.setTextContent(h,""),b(h,null,g,0,g.length-1,s)):o(f)?w(f,0,f.length-1):o(e.text)&&u.setTextContent(h,""):e.text!==t.text&&u.setTextContent(h,t.text),o(m)&&o(p=m.hook)&&o(p=p.postpatch)&&p(e,t)}}}function T(e,t,s){if(l(s)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var i=0;i-1,r.selected!==a&&(r.selected=a);else if(L(Zn(r),i))return void(e.selectedIndex!==o&&(e.selectedIndex=o));n||(e.selectedIndex=-1)}}function Xn(e,t){return t.every((function(t){return!L(t,e)}))}function Zn(e){return"_value"in e?e._value:e.value}function Qn(e){e.target.composing=!0}function ea(e){e.target.composing&&(e.target.composing=!1,ta(e.target,"input"))}function ta(e,t){var s=document.createEvent("HTMLEvents");s.initEvent(t,!0,!0),e.dispatchEvent(s)}function sa(e){return!e.componentInstance||e.data&&e.data.transition?e:sa(e.componentInstance._vnode)}var ia={bind:function(e,t,s){var i=t.value,n=(s=sa(s)).data&&s.data.transition,a=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;i&&n?(s.data.show=!0,Bn(s,(function(){e.style.display=a}))):e.style.display=i?a:"none"},update:function(e,t,s){var i=t.value;!i!=!t.oldValue&&((s=sa(s)).data&&s.data.transition?(s.data.show=!0,i?Bn(s,(function(){e.style.display=e.__vOriginalDisplay})):zn(s,(function(){e.style.display="none"}))):e.style.display=i?e.__vOriginalDisplay:"none")},unbind:function(e,t,s,i,n){n||(e.style.display=e.__vOriginalDisplay)}},na={model:Jn,show:ia},aa={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ra(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?ra(Ot(t.children)):e}function oa(e){var t={},s=e.$options;for(var i in s.propsData)t[i]=e[i];var n=s._parentListeners;for(var i in n)t[S(i)]=n[i];return t}function la(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ca=function(e){return e.tag||_t(e)},ua=function(e){return"show"===e.name},ha={name:"transition",props:aa,abstract:!0,render:function(e){var t=this,s=this.$slots.default;if(s&&(s=s.filter(ca)).length){0;var i=this.mode;0;var n=s[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return n;var a=ra(n);if(!a)return n;if(this._leaving)return la(e,n);var r="__transition-".concat(this._uid,"-");a.key=null==a.key?a.isComment?r+"comment":r+a.tag:c(a.key)?0===String(a.key).indexOf(r)?a.key:r+a.key:a.key;var o=(a.data||(a.data={})).transition=oa(this),l=this._vnode,u=ra(l);if(a.data.directives&&a.data.directives.some(ua)&&(a.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,u)&&!_t(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=A({},o);if("out-in"===i)return this._leaving=!0,Ye(h,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),la(e,n);if("in-out"===i){if(_t(a))return l;var d,p=function(){d()};Ye(o,"afterEnter",p),Ye(o,"enterCancelled",p),Ye(h,"delayLeave",(function(e){d=e}))}}return n}}},da=A({tag:String,moveClass:String},aa);delete da.mode;var pa={props:da,beforeMount:function(){var e=this,t=this._update;this._update=function(s,i){var n=as(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,n(),t.call(e,s,i)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",s=Object.create(null),i=this.prevChildren=this.children,n=this.$slots.default||[],a=this.children=[],r=oa(this),o=0;o-1?Si[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Si[e]=/HTMLUnknownElement/.test(t.toString())},A(ti.options.directives,na),A(ti.options.components,ga),ti.prototype.__patch__=X?qn:R,ti.prototype.$mount=function(e,t){return function(e,t,s){var i;e.$el=t,e.$options.render||(e.$options.render=ve),cs(e,"beforeMount"),i=function(){e._update(e._render(),s)},new Qt(e,i,R,{before:function(){e._isMounted&&!e._isDestroyed&&cs(e,"beforeUpdate")}},!0),s=!1;var n=e._preWatchers;if(n)for(var a=0;a":"<"))])]),e._v(" "),t("div",{staticClass:"sider_trigger sider_trigger--mobile",on:{click:function(t){e.sidermobile=!e.sidermobile}}},[t("span",[e._v(e._s(e.sidermobile?"☰":"X"))])])]),e._v(" "),t("keep-alive",[t(e.currentpanel,{tag:"panel",staticClass:"section",on:{menunav:e.menunav,theme:e.themeApply}})],1)],1)};_a._withStripped=!0;const ba=s.p+"3a67c6573243e7be6b9246ac6542ae72.png";var ya=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$t("overview")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"overview"},[t("div",{staticClass:"overview_ports"},[t("a",{staticClass:"overview_item overview_item--big",attrs:{href:"./logs/",target:e.isPwa?"_self":"elecV2PLOGS"}},[e._v(e._s(e.$t("logs_of_script")))]),e._v(" "),t("a",{staticClass:"overview_item overview_item--big",attrs:{href:"./efss/",target:e.isPwa?"_self":"elecV2PEFSS"}},[e._v(e._s(e.$t("efss_file_manage")))]),e._v(" "),t("div",{staticClass:"overview_item overview_item--big",class:{"overview_item--disable":!e.anyproxy.enable},attrs:{title:"双击打开/关闭(代理端口不是网页,不能直接访问)"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.eopbtn.open,expression:"eopbtn.open"}],staticClass:"overview_btn",on:{click:function(t){return e.eproxyToggle("open")}}},[e._v(e._s(e.$t("open")))]),e._v(" "),t("span",{on:{click:function(t){return e.eproxyBtn()},dblclick:function(t){return e.eproxyToggle()}}},[e._v("ANYPROXY "+e._s(e.$t("port"))+": "+e._s(e.anyproxy.port))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.eopbtn.close,expression:"eopbtn.close"}],staticClass:"overview_btn overview_btn--close",on:{click:function(t){return e.eproxyToggle("close")}}},[e._v(e._s(e.$t("close")))])]),e._v(" "),t("div",{staticClass:"overview_item overview_item--big",class:{"overview_item--disable":!e.anyproxy.enable},on:{click:function(t){return e.webifOpen()}}},[e._v("ANYPROXY "+e._s(e.$t("logs"))+": "+e._s(e.anyproxy.webPort))])]),e._v(" "),t("div",{staticClass:"overview_rules",attrs:{title:"该部分数据在每次刷新页面时更新"}},[t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.rule},attrs:{"data-method":"nav","data-panel":"rules"}},[e._v("RULES: "+e._s(e.ruleslen))]),e._v(" "),t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.rewrite},attrs:{"data-method":"nav","data-panel":"rewrite"}},[e._v("REWRITE: "+e._s(e.rewriteslen))]),e._v(" "),t("span",{staticClass:"overview_item",attrs:{"data-method":"nav","data-panel":"task"}},[e._v("TASKS: "+e._s(e.taskstatus))]),e._v(" "),t("span",{staticClass:"overview_item",attrs:{"data-method":"nav","data-panel":"jsmanage"}},[e._v("SCRIPTS: "+e._s(e.jslistslen))]),e._v(" "),t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.mitmhost},attrs:{"data-method":"nav","data-panel":"mitm"}},[e._v("MITM HOST: "+e._s(e.mitmhostlen))])])]),e._v(" "),t("status",{attrs:{sysinfo:e.sysinfo},on:{ovInit:function(t){e.ovInit(),e.eappfresh=!e.eappfresh}}}),e._v(" "),t("eapp",{attrs:{fresh:e.eappfresh}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("span",{staticClass:"cursor",class:{newversion:e.newversion},attrs:{title:"当前后台版本号,点击获取更新日志"},on:{click:function(t){return e.showUplog()}}},[e._v(e._s(e.$t("version"))+": "+e._s(e.version))]),e._v(" "),t("span",{on:{mouseover:e.runHour}},[e._v(e._s(e.$t("startat"))+": "+e._s(e.start))])])])};ya._withStripped=!0;var $a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"status"},[t("div",{staticClass:"title title--radius",class:{trasbk:e.boffline}},[t("span",{staticClass:"title_main mleft30 cursor",on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.cinfo_show=!e.cinfo_show}}},[e._v(e._s(e.$t("con_clients"))+": "+e._s(e.clients))]),e._v(" "),t("span",{staticClass:"icon cursor title_sync",attrs:{title:"刷新当前页面数据"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.ovUpdate()}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.cinfo_show,expression:"cinfo_show"}],staticClass:"cinfo"},e._l(e.clientsitem,(function(s,i){return t("div",{key:i,staticClass:"cinfo_item border_top1",class:{greenbk:i===e.$wsrecv.id},attrs:{title:(i===e.$wsrecv.id?"当前客户端 ":"其他客户端 ")+i}},[e._v(e._s(s))])})),0),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.sysinfo,expression:"sysinfo"}],staticClass:"hoststatus",attrs:{title:"该部分数据仅在刷新页面时更新"}},[t("h4",{staticClass:"status_title"},[e._v(e._s(e.$t("host_info")))]),e._v(" "),t("div",{staticClass:"status_memoryusage"},[t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("arch"))+": "+e._s(e.sysinfo.arch))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("platform"))+": "+e._s(e.sysinfo.platform))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("memory"))+": "+e._s(e.sysinfo.memory))]),e._v(" "),t("span",{staticClass:"status_item",attrs:{title:"服务器持续运行时间"}},[e._v("UPTIME: "+e._s(e.sysinfo.uptime))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v("NODEJS: "+e._s(e.sysinfo.nodever))])])]),e._v(" "),t("div",{staticClass:"memorystatus"},[t("h4",{staticClass:"status_title"},[e._v("elecV2P "+e._s(e.$t("memoryusage"))),t("span",{staticClass:"status_toggle",attrs:{title:e.statussendflag?"暂停更新":"保持传输"},domProps:{innerHTML:e._s(e.statussendflag?e.icon.stop:e.icon.plays)},on:{click:function(t){return e.statusSendToggle()}}})]),e._v(" "),t("div",{staticClass:"status_memoryusage"},e._l(e.memoryusage,(function(s,i){return t("span",{key:i,staticClass:"status_item"},[e._v(e._s(i)+": "+e._s(s))])})),0)]),e._v(" "),e.jsruntotal?t("div",{staticClass:"jsrunstatus"},[t("h4",{staticClass:"status_title"},[e._v(e._s(e.$t("jsruntimes"))+" - "+e._s(e.jsruntotal))]),e._v(" "),t("div",{staticClass:"status_jsdetail",on:{click:function(t){return t.preventDefault(),e.logGate(t)}}},e._l(e.jsrundetail,(function(s,i){return t("span",{key:i,staticClass:"status_item cursor",attrs:{"data-method":"open","data-param":i}},[e._v(e._s(i)+": "+e._s(s))])})),0)]):e._e()])};$a._withStripped=!0;const wa={home:'',pause:'',sync:'',delete:'',play:'',plays:'',downcircle:'',upcircle:'',stop:'',clear:'',success:'',error:'',loading:'',overview:'',rules:'',rewrite:'',jsmanage:'',task:'',mitm:'',cfilter:'',setting:'',about:'',donation:''};function ka(e,t,s,i,n,a,r,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=s,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):n&&(l=o?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}const Ca=ka({name:"status",props:["sysinfo"],data:()=>({clients:0,memoryusage:{},jsruntotal:0,jsrundetail:{},statussendflag:!0,icon:wa,clientsinfo:{},cinfo_show:!1}),computed:{boffline(){return"number"!=typeof this.clients},clientsitem(){let e={};for(let t in this.clientsinfo){let s="";for(let e in this.clientsinfo[t])s+=`${e}: ${this.clientsinfo[t][e]} `;e[t]=s.trim()}return e}},created(){this.$wsrecv.add("elecV2Pstatus",(e=>{this.clients=e.clients,e.memoryusage&&(this.memoryusage=e.memoryusage),this.statussendflag=!0,e.clientsinfo&&(this.clientsinfo=e.clientsinfo)})),this.$wsrecv.add("jsrunstatus",(e=>{this.jsruntotal=e.total,this.jsrundetail=e.detail}))},methods:{ovUpdate(){this.$emit("ovInit"),this.$wsrecv.connected||this.$wsrecv.connect()},statusSendToggle(){this.$wsrecv.connected?(this.$wsrecv.send("stopsendstatus",this.statussendflag),this.statussendflag=!this.statussendflag):this.$message.error("当前 websocket 已断开,请连接后再试")},logGate(e){let t=event.target.dataset.param;event.target.dataset.method,this.$uApi.open("./logs/"+t.replace(/\/|\\/g,"-")+".log")}}},$a,[],!1,null,"cf229bcc",null).exports;var xa=function(){var e=this,t=e._self._c;return e.eapp.enable?t("div",{staticClass:"eapp"},[t("div",{staticClass:"eapp_container"},[e._l(e.apps,(function(s,i){return t("div",{key:s.hash,staticClass:"eapp_item",class:{"eapp_item--run":e.bRun[i]},attrs:{draggable:e.bEdit},on:{dragstart:function(t){return e.dragStart(t,i)},dragenter:function(t){return e.dragEnter(t,i)},dragend:function(t){return e.dragEnd(t,i)}}},[t("img",{staticClass:"eapp_logo",class:{shake:e.bEdit,"shake--alt":i%2},attrs:{src:e.applogo[i],alt:s.target,"data-param":i,title:s.note||s.target},on:{click:function(t){return t.preventDefault(),e.epOpera(i)},error:function(t){return e.epLogoErr(i,t)}}}),e._v(" "),t("span",{staticClass:"eapp_name",attrs:{title:s.name}},[e._v(e._s(s.name))]),e._v(" "),t("span",{staticClass:"eapp_delete",class:{hide:!e.bEdit},on:{click:function(t){return t.preventDefault(),e.epMove(i)}}},[e._v("X")])])})),e._v(" "),t("div",{staticClass:"eapp_item eapp_item--edit"},[e.bEdit?t("select",{directives:[{name:"model",rawName:"v-model.number",value:e.eapp.logo_type,expression:"eapp.logo_type",modifiers:{number:!0}}],staticClass:"elecBtn elecBtn--h36 minw100",attrs:{title:e.$t("choose")+" LOGO "+e.$t("style")},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(t){var s="_value"in t?t._value:t.value;return e._n(s)}));e.$set(e.eapp,"logo_type",t.target.multiple?s:s[0])}}},[t("option",{attrs:{value:"1",selected:""}},[e._v(e._s(e.$t("style"))+" 1")]),e._v(" "),t("option",{attrs:{value:"2"}},[e._v(e._s(e.$t("style"))+" 2")]),e._v(" "),t("option",{attrs:{value:"3"}},[e._v(e._s(e.$t("style"))+" 3")])]):t("button",{staticClass:"elecBtn elecBtn--h36 bk_main_bk",on:{click:function(t){return t.preventDefault(),e.epEdit()}}},[e._v(e._s(e.$t("neweapp")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h36",class:{bk_main_bk:!e.bEdit},on:{click:function(t){return t.preventDefault(),e.epSave()}}},[e._v(e._s(e.bEdit?e.$t("editexit"):e.$t("editmode")))])])],2),e._v(" "),t("log",{attrs:{logs:e.logs,title:"EAPP "+e.$t("logs")}})],1):e._e()};xa._withStripped=!0;var Ta=function(){var e=this,t=e._self._c;return t("div",{staticClass:"loginfo",class:{"loginfo--full":!e.collapse.loginfo},attrs:{tabindex:"-1"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.collapse.loginfo=!0))}}},[t("h3",{staticClass:"loginfo_title"},[t("span",{staticClass:"loginfo_clear icon",attrs:{title:e.$t("clear")+e.$t("logs")},domProps:{innerHTML:e._s(e.icon.clear)},on:{click:function(t){return e.logs.splice(0)}}}),e._v(" "),t("span",[e._v(e._s(e.title||"elecV2P "+e.$t("logs")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.loginfo},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.loginfo=!e.collapse.loginfo}}})]),e._v(" "),t("div",{staticClass:"logcontext"},e._l(e.logobj,(function({log:s,key:i}){return t("span",{key:i,staticClass:"loginfo_item",domProps:{innerHTML:e._s(s)}})})),0)])};Ta._withStripped=!0;var Sa=s(724);const Oa={base_url:location.origin,glogslicebegin:0,version:"3.8.1"};function Ea(e){return"object"!=typeof e?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()||"object"}function ja(e,t=!1){if(!e)return!!t&&Object.create(null);switch(Ea(e)){case"array":case"object":return e;case"set":return Array.from(e);case"map":return Array.from(e).reduce(((e,[t,s])=>(e[t]=s,e)),{})}try{let t=JSON.parse(e);if("object"==typeof t)return t}catch(t){try{let t=new Function("return "+e)();if(/^(object|array)$/.test(Ea(t)))return t}catch(e){}}return!!t&&{0:e}}function Na(e){if(null==e)return"";let t=Ea(e);switch(t){case"string":return e.trim();case"map":case"set":return JSON.stringify({dataType:t,value:Array.from(e)});case"array":case"object":try{return e[Symbol.toPrimitive]?String(e[Symbol.toPrimitive]()):JSON.stringify(e)}catch(e){return e.message}default:return String(e).trim()}}function Pa(e){if(!e)return!1;if("boolean"==typeof e)return e;if("string"!=typeof e)return!0;switch(e=e.trim()){case"":case"0":case"false":case"null":case"undefined":case"NaN":return!1;default:return!0}}function Aa(e){return!!(""===Na(e).trim()||/^(object|array)$/.test(Ea(e))&&0===Object.keys(e).length)}function Ia(e){try{return new URL(e)}catch(e){return!1}}function Ra(e=8){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=t[Math.floor(52*Math.random())];for(e--;e--;)s+=t[Math.floor(62*Math.random())];return s}function Da(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let s=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?s:3&s|8).toString(16)}))}function Fa(e,t){return void 0===t&&(t=e,e=0),Math.floor(Math.random()*(t-e+1))+e}Oa.vernum=Number(Oa.version.replace(/\D/g,""));const La=6e4*(new Date).getTimezoneOffset();function Ha(e=null,t=0,s=Oa.glogslicebegin){return e=e?Number(e)||Date.parse(e):Date.now(),new Date(e-La).toISOString().slice(s,t?-1:-5).replace("T"," ")}function Ua(e=Date.now()){let t=(Date.now()-e)/1e3/60/60;return t>100?(t/24).toFixed(2)+" days":t.toFixed(2)+" hours"}const Ma=new Map;function Ba(e,t=16){const s=e+t;if(Ma.has(s))return Ma.get(s);const i=function(e,t=16){if(e.length===t)return e;if(e.lengtht){const s=e.split(/\/|\\/);s.length>1&&(e=s[0].slice(0,1)+"/"+s.pop());const i=e.split(" ").pop();return e.slice(0,t-6-i.length)+"..."+e.slice(-i.length-3)}}(e,t);return Ma.set(s,i),i}function za(e=""){if(/[&<>"']/.test(e)){const t={'"':""","'":"'","&":"&","<":"<",">":">"};return e.replace(/[&<>"']/g,(e=>t[e]||e))}return e}function Va(e){return(0,Sa.ansiHtml)(za(e))}function Ga(e){if(!e)return"";let t="",s=e.split(/\/|\\|\?|#/);for(;""===t&&s.length;)t=s.pop();return t}const Ka=[];for(let e=0;e<=255;++e){const t=e.toString(16).padStart(2,"0");Ka.push(t)}function qa(e,t=" ",s=2e4){const i=new Uint8Array(e),n=new Array(i.length);i.length>s?console.debug("arrayBuffer length",i.length,"is too big to tranfer, slice to",s):s=i.length;for(let e=0;eKa.indexOf(e))))}function Wa(e="",t=0){if(!e){if(t<1)return"";e="0"}let s=qa((new TextEncoder).encode(e),"");return 0===t||s.length===t?s:(s.length{const t=i[n++];return n>=i.length&&(a+=1,n=0),e+t*a+i.length})),"")}function Za(e,t="elecV2"){const s=Ja(e,null),i=(new TextEncoder).encode(t);let n=0,a=1;return(new TextDecoder).decode(s.map((e=>{const t=i[n++];return n>=i.length&&(a+=1,n=0),e-t*a-i.length})))}function Qa(e=0,t=1024){return e({icon:wa,logobj:[]}),watch:{logs(e){let t=[];e.forEach(((s,i)=>{"string"==typeof s&&t.push({log:Va(s),key:e.length-i})})),this.logobj=t}}};const tr=ka(er,Ta,[],!1,null,"62593594",null).exports,sr={name:"eapp",props:["fresh"],data:()=>({eapp:{enable:!0,logo_type:1,apps:[]},apps:[],logs:[],bEdit:!1,dragSce:null,dragIdx:-1,toSave:!1,logo_type_org:1}),computed:{applogo(){return this.apps.map((e=>e.logo||this.$uApi.hashToLogo(e.hash,e.name,Number(this.eapp.logo_type))))},bRun(){return this.apps.map((()=>!1))}},watch:{fresh(){this.epInit(!1)}},components:{log:tr},created(){this.$wsrecv.add("eapp",(e=>{this.logs.length>=100||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)})),this.epInit()},methods:{epInit(e=!0){this.$axios.get("/eapp").then((t=>{0===t.data.rescode&&(this.eapp=t.data.resdata,this.apps=this.eapp.apps.filter((e=>e&&e.name&&e.type&&e.target)),e&&this.apps.forEach(((e,t)=>{"auto"===e.run&&(this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] AUTO RUN EAPP: ${e.name}`),this.epOpen(t))})))})).catch((e=>{this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 首页 eapp 列表获取失败 ${e.message}`),console.error("获取失败",e)}))},epOpera(e){this.bEdit?this.epEdit(e):this.epOpen(e)},epLogoErr(e,t){const s=this.apps[e];this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] EAPP ${s.name} logo 加载失败,生成默认图标`),t.target.src=this.$uApi.hashToLogo(s.hash,s.name,this.eapp.logo_type)},epOpen(e=0){const t={...this.apps[e]};if(!(t.name&&t.type&&t.target))return void this.$message.error("eapp 内容不完整");if(this.bRun[e])return void this.$message.success(t.name,"运行中");if(!/%ei%/.test(t.target))return void this.epRun(t,e);let s=t.target.split("%ei%"),i=this.$uStr.escapeHtml(t.target).replace(/%ei%/g,''),n=(this.$axios,this.$message,this.epRun),a="eapp_"+this.$uStr.euid(4);this.$evui({id:a,title:t.name+" - "+t.type.toUpperCase(),width:600,height:null,style:{content:"margin: .3em; font-family: var(--font-fm);"},content:`
${i}
`,methods:{epRun(){let i=document.querySelectorAll(`.${a} .elecTable_input[name=eapp_arg]`),r="";i.forEach(((e,t)=>{r+=s[t]+e.value})),t.target=r+s.pop(),n(t,e)}}})},epRun(e,t){switch(e.type){case"efh":this.$uApi.open("run/?target="+encodeURI(e.target)),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 执行 EFH: ${e.target}`);break;case"url":this.$uApi.open(e.target),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 打开网址: ${e.target}`);break;case"eval":this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] EVALRUN: ${e.name}`),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] EVALRUN RESULT: ${this.$sString(this.$uApi.evalRun(e.target))||"没有返回数据"}`);break;case"shell":case"js":this.$wsrecv.connected||this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] websocket 尚未连接,运行日志无法传输`),this.bRun[t]=!0,this.$axios.post("/eapp/run",{app:e,id:this.$wsrecv.id}).then((s=>{this.bRun[t]=!1,0===s.data.rescode?this.logs.unshift(`[${this.$logHead("eapp info")}][${this.$sTime(null,1)}] ${s.data.message}`):this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 执行 ${e.target} 失败 ${s.data.message}`)})).catch((s=>{this.bRun[t]=!1,this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 执行 ${e.target} 失败 ${s.message}`),console.error(e.target,"执行失败",s)}));break;default:this.$message.error(`未知 EAPP 类型: ${e.type}`),this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 未知 EAPP 类型: ${e.type}`)}},epEdit(e=-1){const t=this.apps,s=t[e]||{name:this.$t("name"),logo:"",type:"js",target:"test.js"};let i=this.$axios,n=this.$message;this.$evui({id:"eapp_new",title:s.hash?this.$t("edit")+" EAPP - "+s.name:this.$t("new")+" EAPP",width:600,height:null,style:{content:"margin: .3em; font-family: var(--font-fm);"},content:`
`,methods:{moreToggle(e){const t=e.target.classList,s=document.querySelector(".eapp_more").classList;t.contains("elecBtn--moreup")?(t.remove("elecBtn--moreup"),s.add("hide")):(t.add("elecBtn--moreup"),s.remove("hide"))},save(){s.name=document.querySelector(".elecTable_input[name=eapp_name]").value,s.logo=document.querySelector(".elecTable_input[name=eapp_logo]").value,s.type=document.querySelector(".elecTable_select[name=eapp_type]").value,s.target=document.querySelector(".editor_textarea[name=eapp_target]").value,s.run=document.querySelector(".elecTable_select[name=eapp_run]").value,s.note=document.querySelector(".elecTable_input[name=eapp_note]").value,s.name&&s.type&&s.target?i.put("/eapp",{idx:e,...s}).then((i=>{0===i.data.rescode?(n.success("成功添加应用",s.name),s.hash=i.data.resdata,-1===e&&t.push(s)):n.error("添加应用失败",i.data.message)})).catch((e=>{n.error("添加应用失败",e.message),console.error("添加应用失败",e)})):n.error("EAPP 内容填写不完整,请修改后再保存")}}})},epMove(e){if(e=Number(e),this.apps[e]&&confirm(`确定移除应用 ${this.apps[e].name}?`)){const t=this.apps[e].name,s=this.$message.loading(`正在删除应用 ${t}...`,0);this.$axios.delete(`/eapp/${e}`).then((t=>{0===t.data.rescode&&this.apps.splice(e,1)})).catch((e=>{this.$message.error(`${t} 删除失败`,e.message),console.error(`${t} 删除失败`,e)})).finally(s)}},epSave(){if(!this.bEdit)return this.bEdit=!0,void(this.logo_type_org=this.eapp.logo_type||1);if(this.toSave&&confirm(`确定保存当前应用列表 ${this.apps.length}?`)){const e=this.$message.loading("应用列表保存中...",0);this.$axios.post("/eapp",{enable:this.eapp.enable,logo_type:this.eapp.logo_type,apps:this.apps}).then((e=>{0===e.data.rescode?this.$message.success("保存成功"):(this.$message.error("保存失败",e.data.message),console.error("保存失败",e.data))})).catch((e=>{this.$message.error("保存失败",e.message),console.error("保存失败",e)})).finally(e)}else if(this.eapp.logo_type!==this.logo_type_org){const e=this.$message.loading(`应用 LOGO 风格 ${this.eapp.logo_type}...`,0);this.$axios.put("/eapp/logo_type",{logo_type:this.eapp.logo_type}).then((e=>{0===e.data.rescode?(this.$message.success("新的 LOGO 风格应用成功"),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 成功应用新的 LOGO 风格 ${this.eapp.logo_type}`)):(this.$message.error("新的 LOGO 风格应用失败",e.data.message),console.error("新的 LOGO 风格应用失败",e.data))})).catch((e=>{this.$message.error("新的 LOGO 风格保存失败",e.message),console.error("新的 LOGO 风格应用失败",e)})).finally(e)}this.bEdit=!1,this.toSave=!1},dragStart(e,t){e.dataTransfer.effectAllowed="move",this.dragIdx=t,this.dragSce=this.apps[t]},dragEnter(e,t){e.preventDefault(),-1!==this.dragIdx&&this.dragIdx!==t&&(this.apps.splice(this.dragIdx,1),this.apps.splice(t,0,this.dragSce),this.dragIdx=t)},dragEnd(e,t){this.dragIdx=-1,this.toSave=!0}}};const ir=ka(sr,xa,[],!1,null,"fdaa1d28",null).exports,nr=JSON.parse('{"join_gap":" ","en":"英文","zh":"中文","a":"a","access":"ACCESS","add":"ADD","addition":"ADDITION","address":"ADDRESS","agroup":"A GROUP","all":"ALL","allow":"ALLOW","allowed":"ALLOWED","and":"AND","arch":"ARCH","as":"AS","author":"AUTHOR","auto":"AUTO","autorun":"AUTO","backup":"BACKUP","belong":"BELONG","blacklist":"BLACKLIST","bfreq":"before request","bfres":"before response","browser":"browser","cache":"CACHE","cancel":"CANCEL","certificate":"CERTIFICATE","check":"CHECK","checkall":"CHECK ALL","checked":"CHECKED","checked_short":"CKD","checknone":"CHECK NONE","choose":"CHOOSE","clear":"CLEAR","clickrun":"CLICK","close":"CLOSE","closed":"CLOSED","cmd":"CMD","con_clients":"Connected Clients","confirm":"CONFIRM","connected":"CONNECTED","content":"CONTENT","countdown":"countdown","cron":"cron","current":"CURRENT","date":"DATE","default":"DEFAULT","delete":"DELETE","detail":"detail","disable":"DISABLE","disable_short":"DE","disabled":"DISABLED","disconnected":"DISCONNECTED","document":"document","donation":"DONATION","download":"DOWNLOAD","dthave":"DON\'T HAVE","edit":"EDIT","editexit":"EXIT","editmode":"EDIT","efss_file_manage":"EFSS FILE MANAGE","enable":"ENABLE","enable_short":"EN","enabled":"ENABLED","every":"EVERY","export":"EXPORT","exportsub":"EXPORT","fetch":"FETCH","file":"FILE","files":"FILES","five":"five","forbid":"FORBID","force":"FORCE","format":"FORMAT","generate":"GENERATE","get":"GET","homepage":"HOMEPAGE","host":"HOST","host_info":"Host Information","illegal":"illegal","import":"IMPORT","input":"input","install":"INSTALL","jsruntimes":"Script Run Times","language":"LANGUAGE","last":"LAST","last_three":"last three","level":"LEVEL","list":"LIST","local":"LOCAL","logs":"LOGS","logs_of_script":"LOGS OF SCRIPT","make":"MAKE","manage":"MANAGE","match":"MATCH","memory":"MEMORY","memoryusage":"Memory Usage","mock":"MOCK","modifyto":"MODIFY TO","more":"more","moveto":"MOVE TO","murl":"MATCH URL","name":"NAME","new":"NEW","neweapp":"NEW","next":"NEXT","non-matched":"NON-MATCHED","note":"NOTE","notify":"NOTIFY","noupdate":"no update","on":"on","open":"OPEN","operate":"OPERATE","operate_short":"OP","optional":"optional","or":"or","overview":"OVERVIEW","param":"PARAM","persistence":"Persistence","platform":"PLATFORM","please":"please","port":"PORT","prev":"PREV","proxy":"PROXY","push":"PUSH","random":"random","redirect":"REDIRECT","refresh":"REFRESH","regexp":"REGEXP","reject":"REJECT","remote":"REMOTE","request":"REQUEST","repeat":"repeat","replace":"REPLACE","rest":"rest","restart":"RESTART","rewrite":"REWRITE","root":"ROOT","rule":"RULE","run":"RUN","save":"SAVE","script":"SCRIPT","search":"SEARCH","second":"second","seconds":"seconds","security":"SECURITY","self-signed":"SELF-SIGNED","send":"SEND","setting":"SETTING","setting_of":"SETTING","shortcut":"shortcut","show":"show","sign":"SIGN","six":"six","skip":"SKIP","sponsors":"Sponsors","start":"START","startat":"START AT","status":"STATUS","status_short":"ST","stop":"STOP","style":"STYLE","sub":"SUB","target":"TARGET","task":"TASK","temp":"TEMP","test":"TEST","time":"TIME","timed":"TIMED","times":"times","timing":"TIMING","to":"TO","toggle":"TOGGLE","update":"UPDATE","upload":"UPLOAD","url":"URL","user":"USER","valid":"VALID","version":"VERSION","web":"WEB","whitelist":"WHITELIST"}'),ar=JSON.parse('{"join_gap":"","en":"EN","zh":"zh-CN","a":"一个","access":"访问","add":"添加","addition":"新增","address":"地址","agroup":"某分组","all":"全部","allow":"允许","allowed":"允许","and":"并","arch":"架构","as":"成为","author":"作者","auto":"自动","autorun":"自动运行","backup":"备份","belong":"关联","bfreq":"网络请求前","bfres":"数据返回前","blacklist":"黑名单","browser":"浏览器","cache":"缓存","cancel":"取消","certificate":"证书","check":"查看","checkall":"全部选择","checked":"选中","checked_short":"选择","checknone":"全都不选","choose":"选择","clear":"清空","clickrun":"点击运行","close":"关闭","closed":"已关闭","cmd":"指令","con_clients":"客户端连接数","confirm":"确定","connected":"已连接","content":"内容","countdown":"倒计时","cron":"cron定时","current":"当前","date":"日期","default":"默认","delete":"删除","detail":"详细说明","disable":"关闭","disable_short":"禁用","disabled":"已关闭","disconnected":"已断开","document":"说明文档","donation":"赞助打赏","download":"下载","dthave":"并没有","edit":"编辑","editexit":"退出编辑","editmode":"编辑模式","efss_file_manage":"EFSS 文件管理界面","enable":"启用","enable_short":"启用","enabled":"已启用","every":"每","export":"导出","exportsub":"导出订阅","fetch":"获取内容","file":"文件","files":"文件数","five":"五","forbid":"禁止","force":"强制","format":"格式","generate":"生成","get":"获取","homepage":"主页地址","host":"域名","host_info":"服务器相关信息","illegal":"非法","import":"导入","input":"输入","install":"安装","jsruntimes":"脚本运行总次数","language":"语言偏好","last":"最近","last_three":"后三项","level":"等级","list":"列表","local":"本地","logs":"日志","logs_of_script":"查看程序运行日志","make":"生成","manage":"管理","match":"匹配","memory":"内存","memoryusage":"内存使用情况","mock":"模拟","modifyto":"修改方式","more":"更多","moveto":"移动到","murl":"匹配链接","name":"名称","new":"新建","neweapp":"新建应用","next":"下一个","non-matched":"未匹配","note":"备注","notify":"通知","noupdate":"不自动更新","on":"在","open":"打开","operate":"操作","operate_short":"操作","optional":"可选择项","or":"或","overview":"基础信息","param":"参数","persistence":"常量","platform":"平台","please":"请","port":"端口","prev":"上一个","proxy":"代理","push":"推送","random":"随机","redirect":"重定向","refresh":"刷新","regexp":"正则表达式","reject":"阻止","remote":"远程","request":"请求","repeat":"重复","replace":"替换","rest":"剩余","restart":"重启","rewrite":"重写","root":"根","rule":"规则","run":"运行","save":"保存","script":"脚本","search":"搜索","second":"秒","seconds":"秒数","security":"安全","self-signed":"自签","send":"发送","setting":"设置","setting_of":"相关设置","shortcut":"快捷键","show":"显示","sign":"签发","six":"六","skip":"跳过","sponsors":"广告","start":"开始","startat":"启动时间","status":"状态","status_short":"状态","stop":"停止","style":"风格","sub":"订阅","target":"目标","task":"任务","temp":"临时","test":"测试","time":"时间","timed":"定时","times":"次数","timing":"时间点","to":"至","toggle":"反转","update":"更新","upload":"上传","url":"链接","user":"用户","valid":"有效","version":"后台版本","web":"网络","whitelist":"白名单"}');const rr={locale:function(){let e="";return location.search&&(e=new URLSearchParams(location.search).get("lang")),e||localStorage.getItem("lang")||navigator.language}().startsWith("zh")?"zh-CN":"en",fallbackLocale:"en"},or={en:nr,"zh-CN":ar};function lr(e){return(or[rr.locale]||or[rr.fallbackLocale])[e]||e}function cr(e=""){return e=e.startsWith("zh")?"zh-CN":"en",rr.locale=e,console.debug("locale lang set to",e),localStorage.setItem("lang",e),e}const ur={name:"overview",data(){return{version:"1.0.0",baseurl:location.protocol+"//"+location.hostname,anyproxy:{enable:!0,port:8001,webPort:8002},ruleslen:0,rewriteslen:0,jslistslen:0,taskstatus:"0/0/0",mitmhostlen:0,start:this.$sTime(),newversion:"",sysinfo:Object.create(null),eopbtn:{open:!1,close:!1},enablelist:{rule:!0,rewrite:!0,mitmhost:!0},userid:this.$uApi.store.get("userid"),bcheck:this.$uApi.store.getCache("bChecked"),eappfresh:!1,isPwa:this.$uApi.isPwa()}},components:{status:Ca,eapp:ir},created(){this.ovInit(),this.bcheck||(this.$uApi.store.set("bcheck",(new Date).getDate().toString()),this.bcheck=!0,"http:"!==location.protocol||/^(100|10|127|172|192\.168)/.test(location.hostname)||this.$message.error("当前正通过 http 访问,建议升级到 https"))},methods:{ovInit(){const e=this.$message.loading("正在获取 overview 相关数据...",0);this.$axios.get("/data?type=overview"+(this.bcheck?"":`&check=${this.bcheck}`)).then((e=>{if(this.$message.success(`成功获取 overview 相关数据\nwebUI 版本 3.8.1 后台版本 ${e.data.version}`),e.data.lang&&cr(e.data.lang),this.ruleslen=e.data.ruleslen,this.rewriteslen=e.data.rewriteslen,this.jslistslen=e.data.jslistslen,this.mitmhostlen=e.data.mitmhostlen,this.version=e.data.version,this.start=this.$sTime(new Date(e.data.start),0,0),this.anyproxy=e.data.anyproxy,this.newversion=e.data.newversion,this.sysinfo=e.data.sysinfo,this.userid=e.data.userid,this.userid!==this.$uApi.store.get("userid")&&this.$uApi.store.set("userid",this.userid),this.$uApi.store.setCache("bSponsor",this.$uApi.store.getCache("sponsors").has(this.userid)),Object.assign(this.enablelist,e.data.enablelist),"object"==typeof e.data.menunav&&this.$emit("menunav",{...e.data.menunav}),"object"==typeof e.data.logo&&this.$emit("theme",{type:"logo",...e.data.logo}),this.$uApi.store.getCache("bSponsor")){let t=e.data.theme;t&&this.$emit("theme",t.simple||t)}else this.$emit("theme",{enable:!1});e.data.taskstatus&&(this.taskstatus=e.data.taskstatus.running+"/"+e.data.taskstatus.total+"/"+e.data.taskstatus.sub);let t=Number(this.version.replace(/\.|v/g,""));this.newversion&&Number(this.newversion.replace(/\.|v/g,""))>t?(console.log(`elecV2P 有新的版本 v${this.newversion} 可供更新`),this.$uApi.store.get("newversion")!==this.newversion&&(this.$message.success(`elecV2P 有新的版本 v${this.newversion} 可供更新`,{url:"https://github.com/elecV2/elecV2P/blob/master/logs/update.log",secd:0}),this.$uApi.store.set("newversion",this.newversion))):this.newversion=""})).catch((e=>{this.$message.error("获取端口数据失败",e.message),console.error("获取端口数据失败",e)})).finally(e)},showUplog(){const e=this.$message.loading("正在获取更新日志...",0);this.$axios.get("https://raw.githubusercontent.com/elecV2/elecV2P/master/logs/update.log").then((e=>{this.$message.success("获取成功"),this.$evui({title:"当前 elecV2P 版本: "+this.version+" 最近更新日志",width:820,height:460,style:{content:"padding-left: 8px; font-size: 16px;"},content:`
${this.newversion?"检测到有新版本 v"+this.newversion+'
请使用 softupdate.js 或者 docker 命令进行升级':""}
${e.data}
`})})).catch((e=>{this.$message.error("获取失败",e.message),console.error("更新日志获取失败",e),this.$evui({title:"更新日志获取失败",width:400,height:160,content:'

点击此链接 前往 Github 查看最新更新日志

'})})).finally(e)},eproxyBtn(){this.anyproxy.enable?this.eopbtn.close=!this.eopbtn.close:this.eopbtn.open=!this.eopbtn.open},eproxyToggle(e=""){this.$wsrecv.connected?(this.anyproxy&&this.anyproxy.enable?("close"===e||confirm("确定关闭 ANYPROXY?"))&&(this.$wsrecv.send("eproxy","close"),this.anyproxy.enable=!1):("open"===e||confirm("确定打开 ANYPROXY?"))&&(this.$wsrecv.send("eproxy","start"),this.anyproxy.enable=!0),this.eopbtn.open=!1,this.eopbtn.close=!1):this.$message.error("websocket 尚未连接,指令无法发送")},webifOpen(){this.anyproxy.enable?this.$uApi.open(this.baseurl+":"+this.anyproxy.webPort):this.$message.success("当前 ANYPROXY 处于关闭状态,无可查看日志")},runHour(e){e.target.title="elecV2P 已持续运行 "+this.$uStr.hDays(Date.parse(this.start))}}};const hr=ka(ur,ya,[],!1,null,"75f1e158",null).exports;var dr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.rulesSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.ruleble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.ruleble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"启用该列表中的规则(建议在不需要使用时关闭"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.ruleble}})],1),e._v(" "),t("span",[e._v("RULE "+e._s(e.$t("list"))+" - "+e._s(e.rulestatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.rulesInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("match")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v(e._s(e.$t("content"))+"("+e._s(e.$t("regexp"))+")")]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("modifyto")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v(e._s(e.$t("target")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("timing")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.eplists,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable}},[t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.mtype,expression:"el.mtype"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"mtype",t.target.multiple?i:i[0])}}},[t("option",[e._v("url")]),e._v(" "),t("option",[e._v("host")]),e._v(" "),t("option",[e._v("useragent")]),e._v(" "),t("option",[e._v("reqmethod")]),e._v(" "),t("option",[e._v("reqbody")]),e._v(" "),t("option",[e._v("resstatus")]),e._v(" "),t("option",[e._v("restype")]),e._v(" "),t("option",[e._v("resbody")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},["reqmethod"==s.mtype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.match,expression:"el.match"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"match",t.target.multiple?i:i[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("DELETE")])]):"resstatus"==s.mtype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.match,expression:"el.match"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"match",t.target.multiple?i:i[0])}}},[t("option",[e._v("200")]),t("option",[e._v("404")]),t("option",[e._v("30x")]),t("option",[e._v("50x")])]):t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.match,expression:"el.match",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{change:function(t){e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.ctype,expression:"el.ctype"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"ctype",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"js"}},[e._v(e._s(e.script))]),e._v(" "),t("option",{attrs:{value:"block"}},[e._v(e._s(e.reject))]),e._v(" "),t("option",{attrs:{value:"307"}},[e._v(e._s(e.redirect))]),e._v(" "),t("option",{attrs:{value:"hold"}},[e._v("$HOLD")]),e._v(" "),t("option",{attrs:{value:"ua"}},[e._v("User-Agent")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},["block"==s.ctype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.target,expression:"el.target"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"target",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"json"}},[e._v("reject-json")]),e._v(" "),t("option",{attrs:{value:"reject",selected:"selected"}},[e._v("reject-200")]),e._v(" "),t("option",[e._v("tinyimg")])]):"ua"==s.ctype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.target,expression:"el.target"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"target",t.target.multiple?i:i[0])}}},e._l(e.uagentlists,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0):t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.target,expression:"el.target",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{change:function(t){e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"el.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))]),e._v(" "),t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.ruleDel(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_add",attrs:{colspan:"7"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.eplists.push({mtype:"host",match:"host.com",ctype:"js",target:"0body.js",stage:"res",enable:!0})}}},[e._v(e._s(e.$ta("new","rule")))])])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.rulesSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),e._m(0)])};dr._withStripped=!0;var pr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"checkbox",class:{"checkbox--checked":e.bChecked},on:{click:function(t){e.bChecked=!e.bChecked}}},[t("span",{staticClass:"checkbox_status"})])};pr._withStripped=!0;const mr=ka({name:"checkbox",props:["oCheck","oKey","oInit"],computed:{bKey(){return this.oKey||"enable"},bChecked:{get(){return void 0===this.oCheck[this.bKey]?"false"!==this.oInit:!!this.oCheck[this.bKey]},set(e){this.$set(this.oCheck,this.bKey,e)}}}},pr,[],!1,null,"40a3a37e",null).exports,fr={name:"rules",data(){return{header:"RULES",bfreq:this.$t("bfreq"),bfres:this.$t("bfres"),reject:this.$t("reject"),redirect:this.$t("redirect"),script:this.$t("script"),uagentlists:{},eplists:[],ruleble:{enable:!0},icon:wa}},computed:{rulestatus(){return this.eplists.filter((e=>e.enable)).length+"/"+this.eplists.length}},components:{checkbox:mr},created(){this.rulesInit()},methods:{rulesInit(){const e=this.$message.loading("正在获取规则列表...",0);this.$axios.get("/data?type=rules").then((e=>{this.eplists=e.data.eplists.list;for(let t in e.data.uagent)e.data.uagent[t].name&&(this.uagentlists[t]=e.data.uagent[t].name);this.ruleble.enable=!1!==e.data.eplists.enable,this.$message.success(`成功获取规则列表 ${this.rulestatus}`),console.log("成功获取规则列表",this.rulestatus)})).catch((e=>{this.$message.error("获取规则列表失败",e.message),console.error("获取列表失败",e)})).finally(e)},rulesSave(){if(confirm("共 "+this.rulestatus+" 条规则将被保存,"+(this.ruleble.enable?"":"但不启用该规则列表,")+"确定?")){const e=this.$message.loading("规则保存中...",0);this.$axios.put("/data",{type:"rules",eplists:this.eplists,ruleenable:this.ruleble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("RULES 规则保存失败",e.data.message)})).catch((e=>{this.$message.error("保存失败",e.message),console.error(e)})).finally(e)}},ruleDel(e){switch(this.$sType(e)){case"number":this.$delete(this.eplists,e);break;case"array":if(e.length&&confirm(`确定删除这 ${e.length} 条规则吗?\n(手动保存后正式生效)`)){let t=this.eplists.slice();for(let s of e)t[s]&&(t[s]=-1);this.eplists=t.filter((e=>-1!==e))}break;default:this.$message.error("规则删除失败,未知删除参数")}}}};const vr=ka(fr,dr,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",[t("li",[e._v("所有更改在保存后正式生效")]),e._v(" "),t("li",[e._v("仅首条命中规则有效,优先级低于 REWRITE")]),e._v(" "),t("li",[e._v("$HOLD 后面修改内容表示时间(秒) 0: 一直等待")]),e._v(" "),t("li",[e._v("更详细说明,参考 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/03-rules.md",target:"elecV2PDoc"}},[e._v("说明文档: 03-rules")])])])])}],!1,null,null,null).exports;var gr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.reSave()):null},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.rewriteChecked="none"))}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("rewrite","request")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable",on:{click:function(t){return t.stopPropagation(),e.rewriteDelegate(t)}}},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.rewriteble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.rewriteble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"启用/禁用该列表下的所有规则(包含订阅"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.rewriteble}})],1),e._v(" "),t("span",{attrs:{title:"重写/修改某个网络请求的部分数据"}},[e._v("REWRITE "+e._s(e.$t("list"))+" - "+e._s(e.rewritestatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:e.$ta("refresh","current","list")},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.reInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:e.$t("checkall")+"/"+e.$t("checknone")+"(ESC)"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.rewriteCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th minw320"},[e._v(e._s(e.$t("murl"))+"("+e._s(e.$t("regexp"))+")")]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("timing")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw320",attrs:{title:e.$t("script")+" or reject "+e.$t("param")}},[e._v(e._s(e.$t("script")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("note")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable",attrs:{title:e.$t("enable")}},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62",attrs:{title:e.$t("operate")}},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",{attrs:{tabindex:"0"}},[e._l(e.rewritelists,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.rewriteChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewriteCheck,expression:"rewriteCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.rewriteCheck)?e._i(e.rewriteCheck,i)>-1:e.rewriteCheck},on:{change:function(t){var s=e.rewriteCheck,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.rewriteCheck=s.concat([r])):o>-1&&(e.rewriteCheck=s.slice(0,o).concat(s.slice(o+1)))}else e.rewriteCheck=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.match,expression:"rewrite.match",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{input:function(t){t.target.composing||e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"rewrite.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))]),e._v(" "),t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.target,expression:"rewrite.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{input:function(t){t.target.composing||e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"rewrite.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewriteDel(i)}}})])])})),e._v(" "),t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"7"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.rewriteDel(e.rewriteCheck)}}},[e._v(e._s(e.$ta("delete","checked","rule"))+" "+e._s(e.rewriteCheck.length))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"newRewrite"}},[e._v(e._s(e.$ta("add","rewrite","rule")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn folderbk",attrs:{title:"导入备份文件将会覆盖当前所有规则(包括订阅)"},on:{click:function(t){return e.rewriteImport()}}},[e._v(e._s(e.$ta("import","backup","file")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"exportRewrite",title:"备份包含订阅在内的当前所有规则"}},[e._v(e._s(e.$ta("backup","current","list")))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--uncheck",on:{click:function(t){e.rewriteCheck=[]}}},[e._v(e._s(e.$ta("cancel","checked","rule"))+" "+e._s(e.rewriteCheck.length))])])])],2),e._v(" "),e._l(e.rewritesub,(function(s,i){return t("tbody",{key:i,staticClass:"elecTable_group",style:{background:s.bkcolor}},[t("tr",{class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":-1!==e.rewritesubChecked.indexOf(i)}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewritesubChecked,expression:"rewritesubChecked"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.rewritesubChecked)?e._i(e.rewritesubChecked,i)>-1:e.rewritesubChecked},on:{change:[function(t){var s=e.rewritesubChecked,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.rewritesubChecked=s.concat([r])):o>-1&&(e.rewritesubChecked=s.slice(0,o).concat(s.slice(o+1)))}else e.rewritesubChecked=a},function(t){return e.rewritesubCheck(i,t)}]}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"4"}},[t("div",{staticClass:"eflex w100"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"subr.name",modifiers:{trim:!0}}],staticClass:"elecTable_input elecTable_th--name",attrs:{type:"text",placeholder:"订阅名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.resource,expression:"subr.resource",modifiers:{trim:!0}}],staticClass:"elecTable_input elecBtn--mleft",attrs:{type:"text",placeholder:"订阅地址",title:"alt+enter 在新标签页中打开此订阅链接"},domProps:{value:s.resource},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.$uApi.open(s.resource)):null},input:function(t){t.target.composing||e.$set(s,"resource",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--mleft",on:{click:function(t){return e.rewritesubUpdate(s.resource,i)}}},[e._v(e._s(e.$t("fetch")))]),e._v(" "),-1!==e.rewritesubChecked.indexOf(i)?t("button",{staticClass:"elecBtn elecBtn--mleft",attrs:{"data-method":"exportRewrite","data-parm":i,title:"导出当前订阅下的所有规则"}},[e._v(e._s(e.$t("exportsub")))]):s.collapse?t("span",{staticClass:"elecBtn elecBtn--mleft elecBtn--uncheck"},[e._v(e._s(s.enable?s.list.filter((e=>e.enable)).length:"0")+"/"+e._s(s.list.length))]):t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:s.bkcolor,expression:"subr.bkcolor",modifiers:{trim:!0,lazy:!0}}],staticClass:"elecTable_input elecTable_cell100 elecBtn--mleft",attrs:{placeholder:"背景色",title:"当前分组背景颜色/图片"},domProps:{value:s.bkcolor},on:{change:function(t){e.$set(s,"bkcolor",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{title:"启用/禁用该订阅下的所有规则"}},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[s.resource&&-1===e.rewritesubChecked.indexOf(i)?s.collapse?t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.downcircle)},on:{click:function(t){return e.rewritesubOp(i,"collapse")}}}):t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.upcircle)},on:{click:function(t){return e.rewritesubOp(i,"collapse")}}}):t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewritesubOp(i,"delete")}}})])]),e._v(" "),e._l(e.rewritesublist[i],(function(s,n){return t("tr",{class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.rewriteChecked[i+"|"+n]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewriteCheck,expression:"rewriteCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i+"|"+n,checked:Array.isArray(e.rewriteCheck)?e._i(e.rewriteCheck,i+"|"+n)>-1:e.rewriteCheck},on:{change:function(t){var s=e.rewriteCheck,a=t.target,r=!!a.checked;if(Array.isArray(s)){var o=i+"|"+n,l=e._i(s,o);a.checked?l<0&&(e.rewriteCheck=s.concat([o])):l>-1&&(e.rewriteCheck=s.slice(0,l).concat(s.slice(l+1)))}else e.rewriteCheck=r}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.match,expression:"rewrite.match",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{input:function(t){t.target.composing||e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"rewrite.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))]),e._v(" "),t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.target,expression:"rewrite.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{input:function(t){t.target.composing||e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"rewrite.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewriteDel(i+"|"+n)}}})])])}))],2)})),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"7"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn trasbk",attrs:{"data-method":"disOrEn","data-parm":"enable"}},[e._v(e._s(e.$ta("enable_short","/","disable_short","checked","rule")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"newSub"}},[e._v(e._s(e.$ta("add","rewrite","sub")))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn greenbk",attrs:{"data-method":"exportRewrite","data-parm":"checked"}},[e._v(e._s(e.$ta("export","as","sub")))])])])])],2)]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.reSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),e._m(0)])};gr._withStripped=!0;const _r={name:"rewrite",props:[],data(){return{bfreq:this.$t("bfreq"),bfres:this.$t("bfres"),rewritelists:[],rewritesub:[],rewritesubChecked:[],rewriteCheck:[],rewriteble:{enable:!0},icon:wa}},components:{checkbox:mr},computed:{rewritestatus(){let e=Object.keys(this.rewritesub),t=this.rewritelists.length,s=this.rewritelists.filter((e=>e.enable)).length;return e.forEach((e=>{void 0===this.rewritesub[e].list&&(this.rewritesub[e].list=[]),this.rewritesub[e].enable&&(s+=this.rewritesub[e].list.filter((e=>e.enable)).length,t+=this.rewritesub[e].list.length),void 0===this.rewritesub[e].collapse&&(this.rewritesub[e].collapse=!1)})),s+"/"+t+"/"+e.length},rewriteChecked:{get(){let e=[];return this.rewriteCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.rewriteCheck=Object.keys(this.rewritelists):"none"===e&&(this.rewriteCheck=[])}},rewritesublist(){let e={};return Object.keys(this.rewritesub).forEach((t=>{this.rewritesub[t].collapse?e[t]=[]:e[t]=this.rewritesub[t].list||[]})),e}},created(){this.reInit()},methods:{reInit(){const e=this.$message.loading("正在获取 rewrite 列表...",0);this.$axios.get("/data?type=rewritelists").then((e=>{e.data?(this.rewritesub=e.data.rewritesub||{},this.rewritelists=e.data.rewrite.list,this.rewriteCheck=[],this.rewriteble.enable=!1!==e.data.rewrite.enable,this.dealOldList(),this.$message.success("成功获取 REWRITE 规则列表",this.rewritestatus)):this.$message.error("REWRITE 规则列表获取失败")})).catch((e=>{this.$message.error("获取 REWRITE 规则列表失败",e.message),console.error("获取 REWRITE 规则列表失败",e)})).finally(e)},dealOldList(){let e=[];for(let t in this.rewritelists){let s=this.rewritelists[t];if("req"!==s.stage&&"res"!==s.stage&&(s.stage=/^reject(-200|-dict|-json|-array|-img)?$/.test(s.target)?"req":"res"),s.belong){let i=s.belong;delete s.belong,this.rewritesub[i]?(this.rewritesub[i].list?this.rewritesub[i].list.push(s):this.rewritesub[i].list=[s],this.rewritesub[i].bkcolor||(this.rewritesub[i].bkcolor=this.$uStr.randomColor({max:200})),e.push(t)):console.log("规则",s.match,"对应订阅已不存在,删除 belong 属性",i)}}e.reverse().forEach((e=>this.$delete(this.rewritelists,e)))},reSave(){let e=[];if(this.rewritelists.forEach(((t,s)=>{t.match&&t.target||e.push(s+1)})),e.length>0)this.$message.error("当前列表第",e.join(", "),"/",this.rewritelists.length,"项包含空字符,请填写完整或删除后再进行保存");else if(confirm(`保存重写规则列表 ${this.rewritestatus}${this.rewriteble.enable?"":",但不启用"}`)){const e=this.$message.loading("重写规则上传保存中...",0);this.$axios.put("/data",{type:"rewrite",rewritelists:this.rewritelists,rewritesub:this.rewritesub,rewriteenable:this.rewriteble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("REWRITE 规则保存失败",e.data.message)})).catch((e=>{this.$message.error(e.message),console.error("重写规则保存失败",e)})).finally(e)}},rewriteDelegate(e){switch(e.target.dataset.method){case"disOrEn":let t="disable"===e.target.dataset.parm;this.rewriteCheck.forEach((e=>{if("number"===this.$sType(e))this.rewritelists[e].enable=t;else{let[s,i]=e.split("|");s&&i&&this.rewritesublist[s]&&(this.rewritesub[s].list[i].enable=t)}})),e.target.dataset.parm=t?"enable":"disable",this.$message.success("已批量",t?"启用":"禁用",this.rewriteCheck.length,"条规则");break;case"newRewrite":this.rewritelists.push({match:"^https?://httpbin\\.org/get\\?rewrite=elecV2P",stage:"req",target:"0body.js",enable:!0});break;case"newSub":this.rewritesubAdd();break;case"exportRewrite":this.rewriteExport(e.target.dataset.parm)}},async rewritesubUpdate(e,t){if(!e||!/^https?:\/\/\S{4}|^\/?efss\//i.test(e))return void this.$message.error("请输入正确的订阅地址");let s=this.$message.loading("正在获取订阅内容中...",0),i="";try{i=await this.$axios.get(e)}catch(t){if(t.response)return s(),this.$message.error(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`),void console.debug(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`,t.response.data);if(!/^https?:\/\/\S{4}/.test(e))return s(),void this.$message.error("获取订阅内容失败",t.message);try{this.$message.error("获取订阅内容失败",t.message,"即将尝试从服务器端获取该订阅内容"),i=await this.$axios.get("/data?type=stream&url="+e)}catch(e){return s(),void this.$message.error("获取订阅信息失败",e.message,"请检测网络后重试")}}if(200!==i.status||-1===i.data.rescode)return s(),this.$message.error("该订阅返回状态有误,请确认当前网络环境或输入链接是否正常"),void console.error(i.data);s();let n=this.$sJson(i.data);if(!n||!n.list&&!n.rewrite){if(!i.data)return void this.$message.error("没有检测到任何订阅内容");i.data=this.$sString(i.data),this.$message.success("检测到该订阅内容为非 elecV2P 订阅格式,尝试以兼容模式解析该内容"),n={name:this.rewritesub[t].name,mitmhost:[],list:[]};let e=i.data.match(/hostname ?= ?(.+)/);e&&e[1]&&(n.mitmhost=e[1].split(/ ?, ?/)),n.mitmhost.length&&(n.mitmhost[0]=n.mitmhost[0].replace("%APPEND% ","")),i.data.split(/\r|\n/).forEach((e=>{if(/^(#|\[|\/\/)/.test(e)||e.length<3)return;let t=e.split(" "),s=e.match(/script-path=([^,]*)/),i="",a="res",r="";if(s&&s[1])if(r=s[1],a=/http-request/.test(e)?"req":"res",/^http-res/.test(t[0]))i=t[1];else{let t=e.match(/pattern=([^,]*)/);t&&t[1]&&(i=t[1])}else t.length>=2&&(r=t.pop(),/^http|^reject|\.js$/.test(r)&&(i=t[0],a=/^reject/.test(r)||/request/.test(t[2])?"req":"res"));i&&a&&r&&n.list.push({match:i,stage:a,target:r,enable:!0})}))}if(n&&n.rewrite&&n.rewrite.length&&(n.list=n.rewrite),n&&n.list&&n.list.length){let e=`
${n.note||"没有任何备注说明"}
`;n.mitmhost&&n.mitmhost.length&&(e+=`
`),n.task&&n.task.list&&(e+=`
`),e+=`
作者: ${n.author||"无"} 更新: ${n.resource||"无"}
`;let s=this.$axios,i=this.$message,a=this.rewritesub;this.$evui({title:`${n.name||this.rewritesub[t].name||"检测到如下规则"}`,width:600,height:null,style:{title:`background: ${n.bkcolor||this.rewritesub[t].bkcolor};`,content:"text-align: center;margin: .2em;"},content:e,methods:{rewriteAdd(){let e=document.querySelector(".elecBtn[data-method=rewriteAdd]");if(e){if(e.dataset.done)return void i.success("重写规则已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}let s=n.list.filter((e=>{if(e.match&&/^http|^reject|\.js$/.test(e.target))return"req"!==e.stage&&"res"!==e.stage&&(e.stage=/^reject/.test(e.target)?"req":"res"),e.enable=!1!==e.enable,!0}));n.name&&(a[t].name=n.name),void 0!==n.enable&&(a[t].enable=n.enable),n.bkcolor&&(a[t].bkcolor=n.bkcolor),n.resource&&(a[t].resource=n.resource),a[t]={...a[t],list:s},i.success("订阅",n.name,"内容更新完成(保存后正式生效)")},taskAdd(){let e=document.querySelector(".elecBtn[data-method=taskAdd]");if(e){if(e.dataset.done)return void i.success("定时任务已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}for(let e of n.task.list)s.put("/task",{op:"add",data:{type:n.task.type,task:e}}).then((t=>{0===t.data.rescode?i.success("添加定时任务",e.name,t.data.message):i.error("添加定时任务失败",t.data.message)})).catch((e=>{i.error("添加定时任务失败",e.message),console.error("添加定时任务失败",e)}))},hostAdd(){let e=document.querySelector(".elecBtn[data-method=hostAdd]");if(e){if(e.dataset.done)return void i.success("解析域名已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}s.put("/data",{type:"mitmhostadd",data:n.mitmhost,note:n.name}).then((e=>{0===e.data.rescode?i.success("成功更新 MITMHOST",n.mitmhost.join(", ")):i.error("MITMHOST 更新失败",e.data.message)})).catch((e=>{i.error("更新 mitmhost 失败",e.message),console.error("更新 mitmhost 失败",e)}))}}})}else this.$message.error("elecV2P 暂时无法解析该订阅内容"),console.debug(this.rewritesub[t].name,"内容为",i.data)},rewritesubCheck(e,t){if(e&&t)if(t.target.checked)for(let t in this.rewritesub[e].list||[]){let s=e+"|"+t;-1===this.rewriteCheck.indexOf(s)&&this.rewriteCheck.push(s)}else this.rewriteCheck=this.rewriteCheck.filter((t=>!("string"==typeof t&&t.startsWith(e))))},rewriteDel(e){switch(this.$sType(e)){case"number":this.$delete(this.rewritelists,e);break;case"array":if(e.length&&confirm(`确定删除这 ${e.length} 条规则吗?\n(手动保存后正式生效)`)){for(let t of e)this.rewriteDel(t);this.rewriteCheck=[]}break;case"string":let[t,s]=e.split("|");t&&s&&this.rewritesublist[t]&&(this.rewritesublist[t].splice(Number(s),1),this.$forceUpdate());break;default:this.$message.error("规则删除失败,未知删除参数")}},rewritesubAdd(e=this.$uStr.euid()){this.$set(this.rewritesub,e,{name:this.$ta("rewrite","sub")+(Object.keys(this.rewritesub).length+1),resource:"",type:"rewrite",note:"",date:this.$sTime(),total:0,active:0,enable:!0,bkcolor:this.$uStr.randomColor({max:200}),collapse:!1,list:[]})},rewritesubOp(e,t="delete"){"collapse"===t?(this.rewritesub[e].collapse=!this.rewritesub[e].collapse,this.rewritesub[e].collapse?this.rewritesublist[e]=[]:this.rewritesublist[e]=this.rewritesub[e].list,this.$forceUpdate()):this.rewritesub[e]&&(0===this.rewritesub[e].list.length||confirm("确定删除重写订阅:"+this.rewritesub[e].name+" 及其相关规则\n(并不会删除已添加的 MITMHOST/TASK 等)"))&&(this.$delete(this.rewritesub,e),this.rewriteCheck=this.rewriteCheck.filter((t=>!("string"==typeof t&&t.startsWith(e)))))},rewriteCkall(e){this.rewriteChecked=e.target.checked?"all":"none"},rewriteExport(e="all"){let t=Object.create(null),s="rewritesub-elecV2P.json";switch(e){case"all":t={rewrite:{note:"elecV2P 重写规则",date:this.$sTime(),total:this.rewritelists.length,active:this.rewritelists.filter((e=>e.enable)).length,enable:this.rewriteble.enable,list:this.rewritelists},rewritesub:this.rewritesub},s="rewrite.list",this.$message.success("成功使用当前规则列表(包含订阅)生成备份文件,请选择目录进行保存");break;case"checked":t={name:"elecV2P 重写订阅",author:"留个名字 elecV2",note:"xx 导出的重写规则。该订阅目前仅适用于 elecV2P。更多说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",date:this.$sTime(),type:"rewrite",resource:"订阅更新远程链接(待填写",mitmhost:[],list:[]},this.rewriteCheck.forEach((e=>{if("number"===this.$sType(e))e=this.rewritelists[e];else{let[t,s]=e.split("|");t&&s&&this.rewritesublist[t]&&(e=this.rewritesublist[t][s])}e.match&&e.stage&&e.target&&t.list.push(e)}));break;default:this.rewritesub[e]?(t={...this.rewritesub[e],type:"rewrite",note:"关于该订阅的一些说明(可省略)。该订阅目前仅适用于 elecV2P,与其他软件并不兼容。更详细说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",date:this.$sTime()},delete t.total,delete t.active,delete t.collapse,s=this.rewritesub[e].name):this.$message.error("未知导出类型",e)}"rewrite"===t.type||t.rewrite?this.$uApi.saveAsFile(t,s||"rewritesub-elecV2P.json"):this.$message.error("当前并没有检测到任何规则")},rewriteImport(){this.$uApi.getFile({accept:".list,.json",type:"text"}).then((e=>{let t=e.content,s=this.$sJson(t);s&&(s.rewrite&&s.rewrite.list||s.rewritesub)?confirm(`检测到重写规则 ${s.rewrite.list.length} 条,订阅 ${Object.keys(s.rewritesub||{}).length} 个\n确定使用该备份替换当前所有规则及订阅吗?`)&&(this.rewritelists=s.rewrite.list||[],this.rewritesub=s.rewritesub||{},this.rewriteCheck=[],this.rewriteble.enable=!1!==s.rewrite.enable,this.dealOldList(),this.$message.success("成功导入重写规则备份文件,保存后正式生效")):(console.error("elecV2P 无法解析导入文件",t),this.$message.error("无法解析导入文件,仅支持 elecV2P 的备份文件"))})).catch((e=>{console.debug("rewrite import",e)}))}}};const br=ka(_r,gr,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",[t("li",[t("b",[e._v("本页所有规则的更改在点击保存后才正式生效")])]),e._v(" "),t("li",[e._v("订阅规则并不会自动加载更新,需手动获取及保存")]),e._v(" "),t("li",[e._v("规则匹配公式: `(new RegExp('正则表达式')).test(request.url)`")]),e._v(" "),t("li",[e._v("更多说明请查看 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",target:"elecV2PDoc"}},[e._v("文档: 05-rewrite")])])])])}],!1,null,null,null).exports;var yr=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("script","manage")))]),e._v(" "),t("main",{staticClass:"content",on:{click:function(t){e.menu={}}}},[t("contextmenu",{attrs:{menus:e.menu.list,pos:e.menu.pos}}),e._v(" "),t("store",{attrs:{logs:e.logs},on:{belongview:function(t){t&&t.includes("|")?e.jsname=t:e.jsView(t)}}}),e._v(" "),t("div",{staticClass:"title--radius",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.menu={}))}}},[t("h4",{staticClass:"title title--radius"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"更新列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.getJSlist()}}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"当前服务器上存在的本地脚本文件数量"}},[e._v(e._s(e.$ta("script","files"))+" - "+e._s(e.jslists.length))]),e._v(" "),t("span",{staticClass:"title_arrow",class:{"title_arrow--up":e.collapse.titlearrow},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.titlearrow=!e.collapse.titlearrow}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.collapse.titlearrow,expression:"collapse.titlearrow"}],staticClass:"uploadjs"},[t("div",{staticClass:"eflex w100 eflex--between"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.jsdownloadurl,expression:"jsdownloadurl",modifiers:{trim:!0}}],staticClass:"elecTable_input wp80",attrs:{type:"text",placeholder:"远程脚本链接 script url"},domProps:{value:e.jsdownloadurl},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.jsDownload()},input:function(t){t.target.composing||(e.jsdownloadurl=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:function(t){return e.jsDownload()}}},[e._v(e._s(e.$ta("start","push")))])]),e._v(" "),t("div",{staticClass:"eflex eflex--between w100 emargin"},[t("div",{staticClass:"eupload wp80"},[t("input",{ref:"jsfiles",staticClass:"eupload_file",attrs:{type:"file",accept:".js, .efh",multiple:"",title:"choose script files"},on:{change:e.jstoupload}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.jsfiles.length,expression:"jsfiles.length"}],staticClass:"eupload_span"},[e._v(e._s(e.jsfilename))])]),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:function(t){return e.jsUpload()}}},[e._v(e._s(e.$ta("start","upload")))])])]),e._v(" "),t("div",{staticClass:"jslists_cont",attrs:{tabindex:"0"}},[t("ul",{staticClass:"jslists_alljs",on:{click:function(t){return t.preventDefault(),e.jsOp(t)},contextmenu:function(t){return t.preventDefault(),t.stopPropagation(),e.jsOp(t)}}},[e._l(e.jslistsshow,(function(s){return t("li",{key:s,staticClass:"jslists_item"},[t("span",{staticClass:"jsitem_view",attrs:{"data-method":"view","data-param":s}},[e._v("👁️")]),e._v(" "),t("span",{attrs:{"data-method":"menu","data-param":s}},[e._v(e._s(s))]),e._v(" "),t("span",{staticClass:"jsitem_delete",attrs:{"data-method":"delete","data-param":s}},[e._v("X")])])})),e._v(" "),t("li",{directives:[{name:"show",rawName:"v-show",value:!!e.restnum,expression:"!!restnum"}],staticClass:"jslists_item jslists_item--showrest"},[t("span",{on:{click:function(t){e.shownum=-1}}},[e._v(e._s(e.$ta("show","rest"))+" "+e._s(e.restnum))])])],2)])]),e._v(" "),t("div",{staticClass:"editor editor--jsmanage",class:{"editor--full":!e.collapse.editor}},[t("h3",{staticClass:"editor_title"},[t("div",{staticClass:"eflex wp46 minw320 epos_rel"},[t("label",{staticClass:"minw100"},[e._v(e._s(e.$t("name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.jsname,expression:"jsname",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"脚本文件名 enter: 查看,ctrl+del: 删除"},domProps:{value:e.jsname},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.jsView(e.jsname)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:t.ctrlKey?t.shiftKey||t.altKey||t.metaKey?null:e.jsDelete(e.jsname):null},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.jsSave()):null},function(t){e.jsshowall=!1}],input:function(t){t.target.composing||(e.jsname=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.jsname,expression:"jsname"}],staticClass:"elecBtn elecBtn--del",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.jsDelete(e.jsname)}}},[e._v("X")])]),e._v(" "),t("div",{staticClass:"script_info",class:{hide:!e.jsupdate}},[t("span",{staticClass:"eflex script_size",attrs:{title:"脚本大小"}},[e._v(e._s(e.jssize))]),e._v(" "),t("span",{staticClass:"emargin--d5em",attrs:{title:"最近更新"}},[e._v(e._s(e.jsupdate))])]),e._v(" "),t("div",{staticClass:"eflex bk_main_cl radius_bs"},[t("button",{staticClass:"elecBtn greenbk elecBtn--new",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.jsView()}}},[e._v(e._s(e.$ta("new","script")))]),e._v(" "),t("button",{staticClass:"elecBtn bk_secd_fc radius_zero",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.scriptTask()}}},[e._v(e._s(e.$ta("add","task")))]),e._v(" "),t("span",{staticClass:"title_collapse emargin--d5em",class:{"title_collapse--collapsed":e.collapse.editor},attrs:{title:"全屏"},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.editor=!e.collapse.editor}}})])]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.jscontent,expression:"jscontent"}],staticClass:"editor_textarea",class:{"editor_textarea--nowrap":e.textarea_nowrap},attrs:{placeholder:e.orgjs},domProps:{value:e.jscontent},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(t.preventDefault(),t.stopPropagation(),e.$uApi.insertText(" "))},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.jsSave()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?(t.preventDefault(),t.shiftKey||t.altKey||t.metaKey?null:e.jsTest()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:void(e.textarea_nowrap=!e.textarea_nowrap)):null},function(t){return(t.type.indexOf("key")||66===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.jsTest()):null}],input:function(t){t.target.composing||(e.jscontent=t.target.value)}}}),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100",attrs:{title:"tab: 两个空格 ctrl+s: 保存 ctrl+enter/ctrl+b: 测试运行 alt+enter: 不换行"}},[t("button",{staticClass:"elecBtn elecBtn--jseditor",on:{click:function(t){return e.jsSave()}}},[e._v(e._s(e.$ta("save","script"))+"(ctrl+s)")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--jseditor",on:{click:function(t){return e.jsTest()}}},[e._v(e._s(e.$ta("test","run"))+"(ctrl+b)")])])]),e._v(" "),t("mock",{attrs:{jslists:e.jslists}}),e._v(" "),t("log",{attrs:{logs:e.logs,title:e.runlogs,collapse:e.collapse}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("当远程脚本无法推送时,尝试在 SETTING 界面添加代理")]),e._v(" "),t("li",[e._v("远程推送脚本时可附加 -rename=xxx.js 重命名文件")]),e._v(" "),t("li",[e._v("mock 网络请求可用于检查网络及代理是否正常")]),e._v(" "),t("li",[e._v(e._s(e.$ta("more","detail"))+" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/04-JS.md",target:"elecV2PDoc"}},[e._v(e._s(e.$t("document"))+":04-JS.md")])])])])])};yr._withStripped=!0;var $r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"storemanage",class:{"storemanage--collapsed":e.collapse}},[t("h2",{staticClass:"title"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"更新列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:e.storeGet}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"ctrl+f 搜索"}},[e._v("store/cookie "+e._s(e.$t("persistence"))+" - "+e._s(Object.keys(e.store).length))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("ul",{staticClass:"storelists",on:{click:function(t){return t.preventDefault(),e.storeOp(t)}}},[e._l(e.storeshow,(function(s){return t("li",{key:s,staticClass:"storelists_item"},[t("span",{attrs:{"data-edit":s}},[e._v(e._s(s))]),e._v(" "),t("span",{staticClass:"item_delete",attrs:{"data-delete":s}},[e._v("X")])])})),e._v(" "),t("li",{directives:[{name:"show",rawName:"v-show",value:!!e.restnum,expression:"!!restnum"}],staticClass:"storelists_item storelists_item--showrest"},[t("span",{on:{click:function(t){e.shownum=-1}}},[e._v(e._s(e.$ta("show","rest"))+" "+e._s(e.restnum))])])],2),e._v(" "),t("div",{staticClass:"editor editor--inner"},[t("div",{staticClass:"editor_title"},[t("div",{staticClass:"eflex epos_rel"},[t("label",{staticClass:"store_label",attrs:{title:"请注意大小写"}},[e._v("KEY:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.edkey,expression:"edkey",modifiers:{trim:!0}}],staticClass:"editor_input storekey_input",attrs:{type:"text",name:"name",placeholder:"NEWKEY"},domProps:{value:e.edkey},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.storeEdit(e.edkey)},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:t.ctrlKey?t.shiftKey||t.altKey||t.metaKey?null:e.storeDelete(e.edkey):null},input:function(t){t.target.composing||(e.edkey=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.edkey,expression:"edkey"}],staticClass:"elecBtn elecBtn--del",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.storeDelete(e.edkey)}}},[e._v("X")])]),e._v(" "),t("div",{staticClass:"eflex emargin",attrs:{title:"如不清楚就保持默认"}},[t("label",{staticClass:"store_label"},[e._v("TYPE:")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.edvalue.type,expression:"edvalue.type"}],staticClass:"elecTable_select w120",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.edvalue,"type",t.target.multiple?s:s[0])}}},[t("option",{attrs:{selected:"selected"}},[e._v("string")]),e._v(" "),t("option",[e._v("number")]),e._v(" "),t("option",{attrs:{value:"object"}},[e._v("json")]),e._v(" "),t("option",[e._v("array")]),e._v(" "),t("option",[e._v("boolean")])])]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw100"},[e._v(e._s(e.$t("belong"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.edvalue.belong,expression:"edvalue.belong",modifiers:{trim:!0,lazy:!0}}],staticClass:"editor_input storebelong_input",attrs:{type:"text",name:"name",placeholder:"写入或调用该 store 常量的脚本(可省略)"},domProps:{value:e.edvalue.belong},on:{change:function(t){e.$set(e.edvalue,"belong",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"storebelong eflex--wrap"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"store_label"},[e._v(e._s(e.$t("note"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.edvalue.note,expression:"edvalue.note",modifiers:{trim:!0,lazy:!0}}],staticClass:"editor_input storenote_input",attrs:{type:"text",name:"name",placeholder:"关于该 store 常量的一些说明(可省略)"},domProps:{value:e.edvalue.note},on:{change:function(t){e.$set(e.edvalue,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.edvalue.update,expression:"edvalue.update"}],staticClass:"efont",attrs:{title:"该 cookie 的最近更新时间"}},[e._v(e._s(e.$ta("last","update"))+": "+e._s(e.edvalue.update))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h36",on:{click:function(t){return e.viewBelong()}}},[e._v(e._s(e.$ta("check","belong","script")))])])]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.edvalue.value,expression:"edvalue.value"}],staticClass:"editor_textarea",attrs:{placeholder:"the value of key"},domProps:{value:e.edvalue.value},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(t.preventDefault(),t.stopPropagation(),e.$uApi.insertText(" "))},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.storeSave()):null}],input:function(t){t.target.composing||e.$set(e.edvalue,"value",t.target.value)}}}),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("button",{staticClass:"elecBtn elecBtn--store",attrs:{title:"快捷键: ctrl+s"},on:{click:function(t){return e.storeSave()}}},[e._v(e._s(e.$t("save")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store folderbk",attrs:{title:".json 表示单个 Cookie, .zip 表示所有 Cookie"},on:{click:function(t){return e.storeImport()}}},[e._v(e._s(e.$t("import")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store",on:{click:function(t){return e.storeExport()}}},[e._v(e._s(e.$t("export")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store greenbk",on:{click:function(t){return e.storeBackup()}}},[e._v(e._s(e.$ta("backup","all")))])])])])};$r._withStripped=!0;const wr={name:"storemanage",props:["logs"],data:()=>({store:[],edkey:"",edvalue:{type:"string"},collapse:!0,icon:wa,shownum:50,restnum:0}),computed:{storeshow(){let e=this.shownum;if(-1===e||e>=this.store.length)return this.restnum=0,this.store;let t=0,s=[];for(;t++{this.store=e.data,this.$message.success("成功获取 store 常量 "+this.store.length),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] 成功获取 store 常量 ${this.store.length}`)})).catch((e=>{this.$message.error("获取 store 常量失败",e.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] 获取 store/cookie 常量失败 ${e.message}`),console.error("获取 store 常量失败",e)})).finally(e)},storeEdit(e){if(!e)return void this.$message.error("请先确定要获取的 key 值");if(-1===this.store.indexOf(e))return this.$message.error(e,"暂不存在"),void this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 暂不存在`);const t=this.$message.loading("正在获取",e,"的值...",0);this.$axios.get("/store/"+e).then((t=>{this.edkey=e,"object"==typeof t.data&&void 0!==t.data.type&&void 0!==t.data.value?(this.edvalue=t.data,/^(array|object|json)$/.test(t.data.type)&&(this.edvalue.value=JSON.stringify(t.data.value,null,2))):this.edvalue={type:"string",value:"object"==typeof t.data?JSON.stringify(t.data,null,2):t.data},this.$message.success("成功获取",e,"的值"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] 成功获取 ${e} 的值`)})).catch((t=>{this.$message.error("获取",e,"数据失败",t.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] 获取 ${e} 数据失败 ${t.message}`),console.error("获取",e,"数据失败",t)})).finally(t)},storeSave(){if(this.edkey&&this.edvalue.value){if(/array|object|json/.test(this.edvalue.type)){let e=this.$sJson(this.edvalue.value);if(!e)return void this.$message.error("当前输入内容无法转化为 array/object/json 格式");this.edvalue.value=JSON.stringify(e,null,2)}if(-1===this.store.indexOf(this.edkey)||confirm(this.edkey+" 已存在,是否覆盖?")){const e=this.$message.loading("数据上传保存中...",0);this.$axios.put("/store",{type:"save",data:{key:this.edkey,value:this.edvalue}}).then((e=>{-1===e.data.rescode?(this.$message.error(this.edkey,"保存失败"),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${this.edkey} 保存失败 ${e.data.message}`)):(this.$message.success(this.edkey,"已保存"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] ${this.edkey} 已保存 ${e.data.message||e.data}`),-1===this.store.indexOf(this.edkey)&&this.store.push(this.edkey),"number"===this.edvalue.type?this.edvalue.value=Number(this.edvalue.value):"boolean"===this.edvalue.type&&(this.edvalue.value=this.$uStr.sBool(this.edvalue.value)),this.$set(this.edvalue,"update",this.$sTime(null,0,0)))})).catch((e=>{this.$message.error("保存失败:",e.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${this.edkey} 保存失败 ${e.message}`),console.error("提交 store 常量失败",e)})).finally(e)}}else this.$message.error("请先输入 KEY 及对应内容")},storeDelete(e){if(e){if(confirm("确定删除:"+e+",及对应的值?")){const t=this.$message.loading("数据删除中...",0);this.$axios.put("/store",{type:"delete",data:e}).then((t=>{if(0===t.data.rescode){this.$message.success(e,"已删除"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] ${e} 已删除 ${t.data.message}`);const s=this.store.indexOf(e);s>-1&&this.store.splice(s,1),this.edkey===e&&(this.edkey="",this.edvalue={type:"string"})}else this.$message.error(e,"删除失败",t.data.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.data.message}`)})).catch((t=>{this.$message.error("删除失败:"+t.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.message}`),console.error("删除数据失败",t)})).finally(t)}}else this.$message.error("请先输入要删除的 KEY")},storeOp(e){e.target.dataset.edit?this.storeEdit(e.target.dataset.edit):e.target.dataset.delete&&this.storeDelete(e.target.dataset.delete)},viewBelong(){this.edvalue.belong?this.$emit("belongview",this.edvalue.belong.replaceAll(/ ?, ?|,| /g,"|")):this.$message.error("该 cookie 暂无关联脚本")},storeExport(){this.edkey&&this.edvalue.value?this.$uApi.saveAsFile({key:this.edkey,value:this.edvalue,update:this.$sTime()},this.edkey+"_elecV2Pstore.json"):this.$message.error("当前 Cookie 值为空")},async storeImport(){let e=await this.$uApi.getFile({accept:".json,.zip",type:"file"});if("application/x-zip-compressed"===e.type){if(!/elecV2P/.test(e.name)&&!confirm("当前导入 zip 文件可能并不是 elecV2P store 备份\n确定要继续导入吗?"))return;const t=this.$message.loading("正在对上传的备份文件进行解析...");let s=new FormData;return s.append("backup",e),void this.$axios.post("/store/backup",s,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{0===e.data.rescode?(console.debug(e.data),this.store=e.data.resdata,this.$message.success("store 备份成功上传"),this.logs.unshift(`[${this.$logHead("storeImport info")}][${this.$sTime(null,1)}] 备份上传成功 ${e.data.message}`)):(this.$message.error("备份上传失败",e.data.message),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] store 备份上传失败 ${e.data.message}`))})).catch((e=>{this.$message.error("上传备份失败",e.message),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] 上传备份失败 ${e.message}`),console.error(e)})).finally(t)}if("application/json"!==e.type)return void this.$message.error("仅支持 json 格式文件导入");let t=new FileReader;t.onload=e=>{let t=e.target.result,s=this.$sJson(t);s.key&&s.value&&s.value.type&&s.value.value?(this.edkey=s.key,this.edvalue=s.value,this.logs.unshift(`[${this.$logHead("storeImport info")}][${this.$sTime(null,1)}] 成功导入 Cookie ${this.edkey}`),this.$message.success(`成功导入 Cookie ${this.edkey}`)):(console.error("elecV2P 无法解析该文件内容",t),this.$message.error("导入的 Cookie 文件内容格式不正确",8),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] 导入的 Cookie 文件内容并非 elecV2P 可解析的格式\n${t.length>300?t.slice(-300)+"...":t}`))},t.readAsText(e)},storeBackup(){this.$uApi.downloadFile("/backup/store","elecV2P_store.zip")}}};const kr=ka(wr,$r,[],!1,null,"c3b243d4",null).exports;var Cr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mock",class:{"mock--collapsed":e.collapse}},[t("h4",{staticClass:"title title--mock"},[t("span",{staticClass:"title_main"},[e._v(e._s(e.$ta("mock","HTTP","request")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.method,expression:"method"}],staticClass:"elecTable_select w120 emargin--top",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.method=t.target.multiple?s:s[0]}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("DELETE")])]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.apiurl,expression:"apiurl",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input eflex_grow1 wp50 emargin--d5em",domProps:{value:e.apiurl},on:{change:function(t){e.apiurl=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.mocktype,expression:"mocktype"}],staticClass:"elecTable_select w220 emargin--top",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.mocktype=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"fetch"}},[e._v("from "+e._s(e.$t("browser")))]),e._v(" "),t("option",{attrs:{value:"axios"}},[e._v("from elecV2P")])])]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("label",{staticClass:"mock_label",attrs:{title:"网络请求头"}},[e._v("HEADERS:")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.headertype,expression:"headertype"}],staticClass:"elecTable_select w220 emargin--top",attrs:{title:"Content-Type"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.headertype=t.target.multiple?s:s[0]}}},[t("option",[e._v("text/plain")]),e._v(" "),t("option",[e._v("application/json")]),e._v(" "),t("option",[e._v("application/x-www-form-urlencoded")])]),e._v(" "),t("label",{staticClass:"mock_label emargin--left",attrs:{title:"headers more"}},[e._v(e._s(e.$t("more").toUpperCase())+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.headermore,expression:"headermore",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input eflex_grow1 wp50 emargin--top",attrs:{placeholder:"{ Cookie: '123' }"},domProps:{value:e.headermore},on:{change:function(t){e.headermore=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.body,expression:"body",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea editor_textarea--mini",attrs:{placeholder:"request body. 网络请求体"},domProps:{value:e.body},on:{change:function(t){e.body=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("div",{staticClass:"eflex"},[t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.mockreq()}}},[e._v(e._s(e.$ta("send","request")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong emargin--left",on:{click:function(t){e.jsnameshow=!0}}},[e._v(e._s(e.$ta("make","script")))])]),e._v(" "),e.jsnameshow?t("div",{staticClass:"mockjsname"},[t("label",{staticClass:"mock_label"},[e._v(e._s(e.$ta("script","name"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.jsname,expression:"jsname",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input w220",domProps:{value:e.jsname},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.mockjs()},change:function(t){e.jsname=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn emargin--d5em greenbk",on:{click:function(t){return e.mockjs()}}},[e._v(e._s(e.$t("confirm")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stop minw62",on:{click:function(t){e.jsnameshow=!1}}},[e._v("X")])]):e._e()])};Cr._withStripped=!0;const xr={name:"mock",props:["jslists"],data:()=>({method:"GET",apiurl:"https://httpbin.org/get",mocktype:"fetch",headertype:"text/plain",headermore:"{}",body:null,jsname:"elecV2Pmock.js",jsnameshow:!1,collapse:!0}),computed:{headers(){let e={"Content-Type":this.headertype+";charset=utf-8"},t=this.$sJson(this.headermore);return t?Object.assign(e,t):(this.$message.error("headers 附加内容并不是正确的 JSON 格式"),this.$wsrecv.dispatch("jsmanage",`[${this.$logHead("mockreq error")}][${this.$sTime(null,1)}] headers 附加内容 ${this.headermore} 并不是正确的 JSON 格式`)),e}},methods:{mockreq(){const e={url:this.apiurl,method:this.method,headers:this.headers,body:this.body};if(/json/.test(e.headers["Content-Type"])){let t=this.$sJson(this.body);if(!t)return console.error("body 内容并不是正确的 JSON 格式"),void this.$message.error("body 内容并不是正确的 JSON 格式");e.body=t}e.body?e.body=this.$sString(e.body):e.body=null;const t=this.$message.loading("网络请求已执行,等待数据返回...",0);"fetch"===this.mocktype?fetch(e.url,e).then((e=>e.text())).then((e=>{this.$message.success("网络请求成功"),e=`[${this.$logHead("mockFetch result")}][${this.$sTime(null,1)}] ${e}`,this.$wsrecv.dispatch("jsmanage",e)})).catch((e=>{this.$message.error("fetch 请求失败",e.message);let t=`[${this.$logHead("mockFetch error")}][${this.$sTime(null,1)}] fetch 请求失败 ${e.message}`;this.$wsrecv.dispatch("jsmanage",t),console.error("fetch 请求失败",e)})).finally(t):this.$axios.put("/mock",{type:"req",request:e}).then((e=>{this.$message.success("网络请求",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("请求失败",e.message),console.error(e)})).finally(t)},mockjs(){this.jsnameshow=!1;const e={url:this.apiurl,method:this.method,headers:this.headers};if(/json/.test(e.headers["Content-Type"])){let t=this.$sJson(this.body);if(!t)return console.error("body 内容并不是正确的 JSON 格式"),void this.$message.error("body 内容并不是正确的 JSON 格式");e.body=t}else e.body=this.body;if(this.jslists.indexOf(this.jsname)>-1&&!confirm(this.jsname+" 已存在,是否覆盖?"))return;const t=this.$message.loading("JS 脚本生成中...",0);this.$axios.put("/mock",{type:"js",jsname:this.jsname,request:e}).then((e=>{this.$message.success("脚本已保存",e.data.message),this.jslists.push(this.jsname)})).catch((e=>{this.$message.error("请求失败",e.message),console.error(e)})).finally(t)}}};const Tr=ka(xr,Cr,[],!1,null,"732d9c77",null).exports;var Sr=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"menu",style:{left:(e.pos?e.pos[0]:0)+"px",top:(e.pos?e.pos[1]:0)+"px"}},e._l(e.menus,(function(s,i){return t("li",{staticClass:"menu_item",style:{color:s.color,backgroundColor:s.bkcolor,fontSize:s.fontsize,height:s.height},attrs:{"data-method":s.method,"data-param":s.param},on:{click:function(t){return t.preventDefault(),e.click(i)},contextmenu:function(t){return t.preventDefault(),e.rclick(i)},dblclick:function(t){return t.preventDefault(),e.dclick(i)}}},[e._v(e._s(s.label))])})),0)};Sr._withStripped=!0;const Or=ka({name:"contextmenu",props:["menus","pos"],methods:{click(e){this.menus.length&&this.menus[e].click?this.menus[e].click():console.debug("点击暂无对应处理函数"),this.menus.splice(0)},rclick(e){this.menus.length&&this.menus[e].rclick?this.menus[e].rclick():console.debug("右键暂无对应处理函数"),this.menus.splice(0)},dclick(e){this.menus.length&&this.menus[e].dclick?this.menus[e].dclick():console.debug("双击暂无对应处理函数"),this.menus.splice(0)}}},Sr,[],!1,null,"10ef9a33",null).exports,Er={name:"jsmanage",data(){return{jslists:[],jsdownloadurl:"",jsname:"",jscontent:"",jsupdate:"",jssize:"",jsshowall:!1,jsfiles:[],orgjs:"// 每个脚本理论上都有权限对服务器上的任一文件进行随意修改,请勿运行不信任的脚本\nconsole.log('当前 elecV2P 版本', __version)\n// 获取 store/cookie 值\nlet val = $store.get('cookieKEY')\nconsole.log('cookieKEY 对应值:', val)\n\n// 发送通知\n$feed.push('elecV2P 通知', '该通知来自脚本' + __name + '\\n\\n更多说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md', 'https://github.com/elecV2/elecV2P')\n\n// 网络请求\n$axios({\n url: 'https://httpbin.org/post',\n headers: {\n 'User-Agent': 'elecV2P Super Max Plus++',\n },\n method: 'post'\n}).then(res=>{\n console.log(res.data)\n}).catch(e=>console.error(e.message)).finally(()=>{\n $done('网络请求执行完毕')\n})\n\nconsole.log('更多脚本相关说明请查看说明文档: https://github.com/elecV2/elecV2P-dei/tree/master/docs/04-JS.md')\n",logs:[],icon:wa,collapse:{titlearrow:this.$uStr.iRandom(0,10)>2,loginfo:!0,editor:!0},shownum:100,restnum:0,menu:{pos:[0,0],list:[]},textarea_nowrap:!1,runlogs:this.$ta("script","run","logs")}},components:{store:kr,log:tr,mock:Tr,contextmenu:Or},activated(){const e=this.$uApi.store.getCache("scriptview");e&&(this.jslists.length?this.jsView(e):this.getJSlist().then((()=>{this.jsView(e)})),this.$uApi.store.deleteCache("scriptview"))},computed:{jsfilename(){let e=[];for(let t=0;t=this.jslists.length)return this.restnum=0,this.jslists;let t=0,s=[];for(;t++{try{return e.test(t)}catch(e){return!0}}));return 0===t.length&&-1!==this.shownum&&(this.shownum=-1),t}},created(){this.$uApi.store.getCache("scriptview")||this.getJSlist().then((()=>{const e=new URL(location).searchParams.get("fn");e&&this.jsView(e)}));const e=this.$wsrecv.add("jsmanage",(e=>{this.logs.length>=200||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)}));e&&this.logs.unshift(`[${this.$logHead("websocket error")}][${this.$sTime(null,1)}] ${e}, 日志无法传输`)},methods:{async getJSlist(){const e=this.$message.loading("获取脚本列表中...",0);let t=await this.$axios.get("/jsfile").catch((e=>{this.$message.error("获取脚本列表失败",e.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] 脚本列表获取失败 ${e.message}`),console.error("获取失败",e)}));t&&t.data&&(this.jslists=t.data,this.$message.success(`成功获取脚本列表 ${this.jslists.length}`),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] 成功获取脚本 ${this.jslists.length}`)),e()},jsDownload(){if(!this.jsdownloadurl||!1===/^https?:\/\/\S{4}/.test(this.jsdownloadurl))return void this.$message.error("该远程脚本链接有误",this.jsdownloadurl);let e=this.jsdownloadurl.match(/ -rename(=| )([^\- ]+)/),t="",s="";if(e&&e[2]?(t=e[2].replace(/^(\\|\/)+/,""),s=this.jsdownloadurl.replace(/ -rename(=| )([^\- ]+)/,"").trim()):(t=this.$uStr.surlName(this.jsdownloadurl),s=this.jsdownloadurl),(/\.(js|efh)$/.test(s)||confirm("当前远程链接对应文件可能并非脚本文件,是否继续?"))&&(-1===this.jslists.indexOf(t)||confirm(t+" 已存在,是否覆盖?"))){const e=this.$message.loading(`${t} 下载中...`,0);this.$axios.put("/jsfile",{op:"jsdownload",name:t,url:s}).then((e=>{0===e.data.rescode?(this.$message.success(t,"下载成功"),-1===this.jslists.indexOf(t)&&this.jslists.push(t),this.logs.unshift(`[${this.$logHead("jsDownload info")}][${this.$sTime(null,1)}] ${t} 下载成功 ${e.data.message}`)):(this.$message.error(t,"下载失败"),this.logs.unshift(`[${this.$logHead("jsDownload error")}][${this.$sTime(null,1)}] ${s} 下载失败 ${e.data.message}`))})).catch((e=>{this.$message.error("下载失败",e.message),this.logs.unshift(`[${this.$logHead("jsDownload error")}][${this.$sTime(null,1)}] ${s} 下载失败,${e.message}`),console.error(s,"下载失败",e)})).finally(e)}},jsSave(){if(!/\.(js|efh)$/i.test(this.jsname))return this.$message.error("脚本文件名错误"),void this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] ${this.jsname} 并非合法的脚本名称。编辑上传其他类型的文件请前往 EFSS 界面`);if(!this.jscontent)return this.$message.error("请先输入脚本内容"),void this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] 保存脚本失败,请先输入脚本内容`);const e=this.$message.loading(this.jsname,"保存中...",0);this.$axios.post("/jsfile",{jsname:this.jsname,jscontent:this.jscontent}).then((e=>{0===e.data.rescode?(this.$message.success(this.jsname,"保存成功"),-1===this.jslists.indexOf(this.jsname)&&this.jslists.push(this.jsname),this.logs.unshift(`[${this.$logHead("jsSave info")}][${this.$sTime(null,1)}] ${this.jsname} 保存成功`),this.jsupdate=this.$sTime(),this.jssize=this.$uStr.kSize((new TextEncoder).encode(this.jscontent).length)):(this.$message.error(this.jsname,"保存失败",e.data.message),this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] ${this.jsname} 保存失败`))})).catch((e=>{console.error(e),this.$message.error("保存失败",e.message),this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] 保存失败 ${e.message}`)})).finally(e)},jsTest(){if(this.jsname&&this.jscontent){if(/\$request|\$response/.test(this.jscontent)&&!confirm("$request/$response 等参数仅在网络请求中有效,是否继续执行?"))return;let e="";const t=this.$message.loading(this.jsname,"正在上传运行中...",0);this.collapse.loginfo=!1,this.logs.unshift(`[${this.$logHead("jsTestRun info")}][${this.$sTime(null,1)}] 正在测试运行 ${this.jsname}...`),this.$axios.post("/jsfile",{id:this.$wsrecv.id,type:"totest",jsname:this.jsname,jscontent:this.jscontent}).then((t=>{e=this.$sString(t.data),this.$message.success(e)})).catch((t=>{e="测试运行失败 "+t.message,this.$message.error(e),console.error(t)})).finally((()=>{t(),this.logs.unshift(`[${this.$logHead(this.jsname+" result")}][${this.$sTime(null,1)}] ${e||this.jsname+" 返回值为空"}`)}))}else this.$message.error("脚本名称或内容不完整")},jstoupload(){this.jsfiles=this.$refs.jsfiles.files},jsUpload(){let e=new FormData,t=[];for(let s=0;s{0===e.data.rescode?(this.$message.success(t.join(", "),"上传成功"),t.forEach((e=>{-1===this.jslists.indexOf(e)&&this.jslists.push(e)})),this.jsfiles="",this.$refs.jsfiles.value="",this.logs.unshift(`[${this.$logHead("jsUpload info")}][${this.$sTime(null,1)}] ${t.join(", ")} 上传成功`)):(this.$message.error("上传失败",e.data.message),this.logs.unshift(`[${this.$logHead("jsUpload error")}][${this.$sTime(null,1)}] 上传失败 ${e.data.message}`))})).catch((e=>{this.$message.error("上传失败",e.message),this.logs.unshift(`[${this.$logHead("jsUpload error")}][${this.$sTime(null,1)}] 上传失败 ${e.message}`),console.error("文件上传失败",e)})).finally(s)},jsView(e){if(e&&1===this.jslistsshow.length&&(e=this.jslistsshow[0]),e&&-1!==this.jslists.indexOf(e)){this.jsname=e;const t=this.$message.loading("正在获取",e,"文件内容...",0);this.$axios.get("/jsfile?jsfn="+e,{transformResponse:[e=>e]}).then((t=>{this.jscontent=t.data,this.$message.success(e,"文件内容获取成功"),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] ${e} 文件内容获取成功`),t.headers["last-modified"]?(this.jsupdate=this.$sTime(t.headers["last-modified"]),this.jssize=this.$uStr.kSize((new TextEncoder).encode(t.data).length)):this.jsupdate=""})).catch((t=>{this.$message.error(e,"获取失败",t.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] ${e} 获取失败 ${t.message}`),console.error(e,"获取失败",t)})).finally(t)}else if(/^https?:\/\//.test(e)){let t=this.$message.loading("检测到该脚本文件名为远程地址,正在尝试获取其文件内容...",0);this.$axios.get(e,{transformResponse:[e=>e],crossdomain:!0}).then((t=>{this.jsname=this.$uStr.surlName(e),this.jscontent=t.data,this.$message.success("远程脚本文件",this.jsname,"获取成功"),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] ${e} 文件内容获取成功`),this.jsupdate=""})).catch((t=>{this.$message.error("远程脚本内容获取失败",t.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] 获取远程脚本: ${e} 失败,请检测网络后重试 ${t.message}`),console.error(t)})).finally(t)}else this.jsname=e||"new.js","new.js"!==this.jsname&&(this.$message.error(e,"暂不存在"),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] ${e} 暂不存在`)),""!==this.jscontent&&"new.js"!==this.jsname||(this.jscontent=this.orgjs),this.jsupdate="";this.jsshowall=!0,this.$uApi.scrollView(".editor--jsmanage")},jsDelete(e){if(e){if(confirm("确认删除服务器端脚本文件: "+e)){const t=this.$message.loading(`正在删除文件 ${e}...`,0);this.$axios.delete("/jsfile",{data:{jsfn:e}}).then((t=>{if(0===t.data.rescode){const s=this.jslists.indexOf(e);s>-1?(this.jslists.splice(s,1),this.$message.success(e,"已删除"),this.logs.unshift(`[${this.$logHead("jsDelete info")}][${this.$sTime(null,1)}] ${e} 已删除 ${t.data.message}`),this.jsname===e&&(this.jsname="",this.jscontent="")):this.$message.error(e,"文件不存在")}else this.$message.error(e,"删除失败"),this.logs.unshift(`[${this.$logHead("jsDelete error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.data.message}`)})).catch((t=>{this.$message.error("未知错误",t.message),this.logs.unshift(`[${this.$logHead("jsDelete error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.message}`),console.error("未知错误",t)})).finally(t)}}else this.$message.error("请先输入要删除的文件名")},jsOp(e){switch(e.target.dataset.method){case"view":this.jsView(e.target.dataset.param);break;case"delete":this.jsDelete(e.target.dataset.param);break;case"menu":this.jsMenu(e.target.dataset.param)}},jsRun(e){if(!e)return void this.$message.error("请先输入脚本名称");const t=this.$message.loading(e,"准备运行中...",0);this.collapse.loginfo=!1,this.logs.unshift(`[${this.$logHead("jsRun info")}][${this.$sTime(null,1)}] 正在运行 ${e}...`),this.$axios.post("/jsfile",{id:this.$wsrecv.id,type:"torun",jsname:e}).then((e=>{this.$message.success(e.data)})).catch((e=>{this.$message.error(e.message),console.error(e)})).finally(t)},jsMenu(e){let t=[],s=this.jsDelete,i=this.jsView,n=this.jsRun,a=this.$uApi.open,r=this.$uApi.copy,o=this.$message.success,l=/\.efh$/.test(e);t.push({label:"运行",bkcolor:"var(--icon-bk)",click(){n(e)}},{label:"查看",click(){i(e)}},{label:"删除",bkcolor:"var(--note-bk)",click(){s(e)}},{label:"复制脚本名称",click(){r(e),o("复制成功")}},{label:(l?"新标签页":"附带参数")+"运行",bkcolor:"var(--icon-bk)",click(){if(l)return void a("run/?target="+encodeURI(e));let t=prompt("请输入附带参数(比如:-env name=elecV2P 或 -grant nodejs)","-env ");null!==t&&n(e+(t?" "+t.trim():""))}},{label:"打开日志文件",click(){a("./logs/"+e.replace(/\/|\\/g,"-")+".log")}}),this.menu={pos:this.$uApi.getCursorPos(event,120,32*t.length),list:t}},scriptTask(){let e=this.jscontent,t=this.jsname;if(!e)return void this.$message.error("请先获取脚本内容");let s=e.match(/([0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+( [0-9\-\*\/,]+)?) ([^ ,]+), ?tag=([^, \n\r]+)/);s||(s=e.match(/([0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+( [0-9\-\*\/,]+)?)"?( (script\-path=)?([^, \n\r]+\.js))?(, ?tag=([^, \n\r]+))?/)||[],s[5]&&(s[3]=s[5]),s[4]=s[7]||"");let i=this.$axios,n=this.$message;this.$evui({title:"添加新的定时任务",width:800,height:148,style:{title:"background: var(--secd-fc);",content:"margin-top: .5em; font-family: var(--font-fm);"},content:`
运行脚本
`,methods:{addTask(){let e=document.querySelector(".elecBtn[data-method=addTask]");if(e){if(e.dataset.done)return void n.success("该任务已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}let t=document.querySelector(".elecTable_input[name=task_name]").value,s=document.querySelector(".elecTable_input[name=task_time]").value,a=document.querySelector(".elecTable_input[name=task_target]").value;if(!(t&&s&&a))return n.error("请填写完整的任务内容"),void delete e.dataset.done;i.put("/task",{op:"add",data:{type:"addition",task:{name:t,type:document.querySelector(".elecTable_select[name=task_type]").value,time:s,job:{type:"runjs",target:a},running:!0}}}).then((s=>{0===s.data.rescode?n.success("添加定时任务",t,s.data.message):(delete e.dataset.done,n.error("添加定时任务失败",s.data.message))})).catch((t=>{n.error("添加定时任务失败",t.message),console.error("添加定时任务失败",t),delete e.dataset.done}))}}})}}};const jr=ka(Er,yr,[],!1,null,"6c7f3ec2",null).exports;var Nr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.saveAll()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$t("setting")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"setting setting--home"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.homepageSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"可访问此后台界面的完整 URL。用于 RSS 订阅及脚本中的 __home 参数"}},[e._v(e._s(e.$t("homepage"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.homepage,expression:"homepage",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"homepage",placeholder:e.init_url},domProps:{value:e.homepage},on:{input:function(t){t.target.composing||(e.homepage=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.homepageSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.langSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"仅供参考"}},[e._v(e._s(e.$t("language"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.lang,expression:"lang"}],staticClass:"setting_select setting_select--short",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.lang=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"zh-CN"}},[e._v(e._s(e.$t("zh")))]),e._v(" "),t("option",{attrs:{value:"en"}},[e._v(e._s(e.$t("en")))])]),e._v(" "),t("span",{staticClass:"tip"},[e._v("(还有很多地方待翻译)")]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.langSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting setting--log"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.glevelSet()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"后台日志输出等级"}},[e._v(e._s(e.$t("logs"))+e._s(e.$t("level"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.gloglevel,expression:"gloglevel"}],staticClass:"setting_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.gloglevel=t.target.multiple?s:s[0]}}},[t("option",[e._v("error")]),e._v(" "),t("option",[e._v("notify")]),e._v(" "),t("option",[e._v("info")]),e._v(" "),t("option",[e._v("debug")])]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.glevelSet()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.gsliceSet()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"后台日志输出格式"}},[e._v(e._s(e.$t("format"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.glogslicebegin,expression:"glogslicebegin"}],staticClass:"setting_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.glogslicebegin=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"0"}},[e._v("YYYY-MM-DD HH:mm:ss.SSS")]),e._v(" "),t("option",{attrs:{value:"5"}},[e._v("MM-DD HH:mm:ss.SSS")]),e._v(" "),t("option",{attrs:{value:"11"}},[e._v("HH:mm:ss.SSS")])]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.gsliceSet()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting setting--webhook"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.wbrtokenSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"服务器访问 token(非常重要)"}},[e._v("WEBHOOK TOKEN:")]),e._v(" "),t("div",{staticClass:"incon"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.wbrtoken,expression:"wbrtoken",modifiers:{trim:!0}}],staticClass:"setting_input incon_input",attrs:{name:"wbrtoken"},domProps:{value:e.wbrtoken},on:{input:function(t){t.target.composing||(e.wbrtoken=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"icon cursor incon_icon",domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){e.wbrtoken=e.$uStr.UUID()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.wbrtokenSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.wbrscriptSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"webhook 其他 payload 处理脚本"}},[e._v("SCRIPT:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.wbrscript}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.wbrscript.target,expression:"wbrscript.target",modifiers:{trim:!0}}],staticClass:"setting_input setting_input--middle",attrs:{name:"wbrscript",placeholder:"webhook.js"},domProps:{value:e.wbrscript.target},on:{input:function(t){t.target.composing||e.$set(e.wbrscript,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.wbrscriptSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.userid,expression:"userid"}],staticClass:"w100",attrs:{title:"基于 WEBHOOK TOKEN 自动生成 无法自定义及反推"}},[t("span",[e._v(e._s(e.$t("user"))+" ID: ")]),t("span",[e._v(e._s(e.userid))])])]),e._v(" "),t("div",{staticClass:"setting",class:{"setting--collapsed":e.collapse.notify}},[t("h4",{staticClass:"setting_title"},[t("div",{staticClass:"title_main"},[t("a",{staticClass:"cursor--help main_fc",attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md",target:"elecV2PDoc"}},[e._v(e._s(e.$ta("notify","setting_of")))]),e._v(" "),t("span",{staticClass:"mleft30 cursor",attrs:{title:"点击进行测试(先保存)"},domProps:{innerHTML:e._s(e.icon.plays)},on:{click:function(t){return e.feedTest()}}})]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.notify},on:{click:function(t){e.collapse.notify=!e.collapse.notify}}})]),e._v(" "),t("div",{staticClass:"setting--notify"},[e._m(0),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.iftttid}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.iftttid.key,expression:"CONFIG_FEED.iftttid.key",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"ifttt",placeholder:"xxxxxxxxxxxxxxxxxxxxxx"},domProps:{value:e.CONFIG_FEED.iftttid.key},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.iftttid,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.iftttSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[e._m(1),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.barkkey}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.barkkey.key,expression:"CONFIG_FEED.barkkey.key",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"barkkey",placeholder:"xxxxxxxxxxxxxxxxxxxxxx"},domProps:{value:e.CONFIG_FEED.barkkey.key},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.barkkey,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.barkeySave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label"},[e._v("自定义通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.custnotify}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.custnotify.url,expression:"CONFIG_FEED.custnotify.url",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"custnotify",placeholder:"https://xxx.xx.xxx/xxxxxx"},domProps:{value:e.CONFIG_FEED.custnotify.url},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.custnotify,"url",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_FEED.custnotify.type,expression:"CONFIG_FEED.custnotify.type"}],staticClass:"setting_select setting_select--short",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.CONFIG_FEED.custnotify,"type",t.target.multiple?s:s[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")])]),e._v(" "),"POST"==e.CONFIG_FEED.custnotify.type?t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_FEED.custnotify.data,expression:"CONFIG_FEED.custnotify.data",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea editor_textarea--mini emargin--top",attrs:{placeholder:'使用 $title$ 代表通知标题,$body$ 代表通知内容,$url$ 代表附加链接。比如:\n{\n "text": `$title$`,\n "desp": `$body$\\n\\n附加链接: $url$`\n}\n具体格式及使用参数,根据自定义通知的 API 说明进行调整(通知内容尽量使用反引号`包括)'},domProps:{value:e.CONFIG_FEED.custnotify.data},on:{change:function(t){e.$set(e.CONFIG_FEED.custnotify,"data",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}):e._e(),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.custnotifySave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label"},[e._v("通知触发脚本:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.runjs}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_FEED.runjs.list,expression:"CONFIG_FEED.runjs.list",modifiers:{lazy:!0,trim:!0}}],staticClass:"setting_input",attrs:{name:"runjs",placeholder:"notify.js, test.js(多个脚本使用英文逗号进行分隔,支持远程链接)"},domProps:{value:e.CONFIG_FEED.runjs.list},on:{change:function(t){e.$set(e.CONFIG_FEED.runjs,"list",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.notifyjsSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("当通知内容长度超过")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.maxbLength,expression:"CONFIG_FEED.maxbLength",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"maxbLength",placeholder:"0: 不分段"},domProps:{value:e.CONFIG_FEED.maxbLength},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED,"maxbLength",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",[e._v("时,分段发送")])]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("是否在前端网页显示通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.webmessage}})],1),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"默认通知内容包括:定时任务开始与停止,脚本运行达到指定次数等"}},[t("span",[e._v("是否开启默认通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED}})],1),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.feedOp()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting",class:{"setting--collapsed":e.collapse.other},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.mergeSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("default","notify","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.other},on:{click:function(t){e.collapse.other=!e.collapse.other}}})],1),e._v(" "),t("div",{staticClass:"setting setting--other"},[t("div",{staticClass:"eflex eflex--wrap w100"},[t("span",{staticClass:"tip"},[e._v("默认通知内容包括:定时任务开始与停止,脚本运行达到指定次数等")]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"FEED/RSS 包含所有通知内容"}},[e._v("是否输出 "),t("a",{attrs:{href:"/feed",target:"elecV2PFeed"}},[e._v("FEED")]),e._v(":\n "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.rss}})],1),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--wave",on:{click:function(t){return e.feedClear()}}},[e._v("清空 FEED 内容")])]),e._v(" "),t("div",{staticClass:"w100"},[t("div",{staticClass:"setting setting--inline"},[t("label",{staticClass:"setting_label setting_label--flex"},[t("span",{staticClass:"setting_label"},[e._v("是否合并默认通知")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.merge}})],1),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并时间(秒):")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.merge.gaptime,expression:"CONFIG_FEED.merge.gaptime",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"mergetime"},domProps:{value:e.CONFIG_FEED.merge.gaptime},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.merge,"gaptime",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并逻辑:")]),e._v(" "),t("span",{staticClass:"setting_andor",on:{click:function(t){e.CONFIG_FEED.merge.andor=!e.CONFIG_FEED.merge.andor}}},[e._v(e._s(e.CONFIG_FEED.merge.andor?"AND":"OR"))])]),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并条数:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.merge.number,expression:"CONFIG_FEED.merge.number",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"mergenum"},domProps:{value:e.CONFIG_FEED.merge.number},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.merge,"number",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("当前设置表示:至少等 "+e._s(e.CONFIG_FEED.merge.gaptime)+" 秒 "+e._s(e.CONFIG_FEED.merge.andor?"且":"或")+" 共有 "+e._s(e.CONFIG_FEED.merge.number)+" 条通知时合并发送(此设置对脚本内的通知函数无效,即脚本通知还是单独发送)")])])]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.mergeSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse.runjs},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.runjsSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("script","run","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.runjs},on:{click:function(t){e.collapse.runjs=!e.collapse.runjs}}})],1),e._v(" "),t("div",{staticClass:"setting--other"},[t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",[t("label",{attrs:{title:"0 ms 表示不设定超时时间"}},[e._v("TIMEOUT(ms): ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.timeout,expression:"CONFIG_RUNJS.timeout",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不限制"},domProps:{value:e.CONFIG_RUNJS.timeout},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"timeout",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{attrs:{title:"0 秒表示有则不更新"}},[e._v("远程脚本更新最低时间间隔(秒):")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.intervals,expression:"CONFIG_RUNJS.intervals",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:有则不更新",name:"intervals"},domProps:{value:e.CONFIG_RUNJS.intervals},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"intervals",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{attrs:{title:"0 次表示不通知"}},[e._v("每运行 ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.numtofeed,expression:"CONFIG_RUNJS.numtofeed",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不通知",name:"numtofeed"},domProps:{value:e.CONFIG_RUNJS.numtofeed},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"numtofeed",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",[e._v(" 次, 添加一个默认通知")])])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("0 ms: 不设定超过时间,由 $done 控制返回, 0 秒: 表示如果有则不更新, 0 次: 表示不通知")]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",{staticClass:"eflex"},[t("label",[e._v("保存日志")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.jslogfile,expression:"CONFIG_RUNJS.jslogfile"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"jslogs"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.jslogfile)?e._i(e.CONFIG_RUNJS.jslogfile,null)>-1:e.CONFIG_RUNJS.jslogfile},on:{change:function(t){var s=e.CONFIG_RUNJS.jslogfile,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"jslogfile",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"jslogfile",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"jslogfile",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{attrs:{title:"打印并保存脚本运行时所发送的网络请求 url"}},[e._v("保存网络请求 URL 到日志中")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.eaxioslog,expression:"CONFIG_RUNJS.eaxioslog"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"eaxioslog"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.eaxioslog)?e._i(e.CONFIG_RUNJS.eaxioslog,null)>-1:e.CONFIG_RUNJS.eaxioslog},on:{change:function(t){var s=e.CONFIG_RUNJS.eaxioslog,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"eaxioslog",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"eaxioslog",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"eaxioslog",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",[e._v("使用网络请求相关设置中的代理(如有)")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.proxy,expression:"CONFIG_RUNJS.proxy"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"runjsproxy"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.proxy)?e._i(e.CONFIG_RUNJS.proxy,null)>-1:e.CONFIG_RUNJS.proxy},on:{change:function(t){var s=e.CONFIG_RUNJS.proxy,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"proxy",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"proxy",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"proxy",n)}}})])]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"w120",attrs:{title:"白名单脚本不显示网络请求 url"}},[e._v("白名单脚本")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_RUNJS.white}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.jswhitelist,expression:"jswhitelist",modifiers:{lazy:!0,trim:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"完整的脚本文件名,以英文逗号进行分隔,比如: test.js,softupdate.js",title:"远程脚本只需填写文件名部分。本地次级目录文件需带目录填写"},domProps:{value:e.jswhitelist},on:{change:function(t){e.jswhitelist=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("该名单脚本内所有网络请求直接放行,不做屏蔽检测")])])]),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.runjsSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("eAxios",{attrs:{config:e.CONFIG_Axios,uagent:e.uagent}}),e._v(" "),t("webui",e._g({attrs:{menunav:e.webUI.nav,theme:e.webUI.theme,logo:e.webUI.logo}},e.$listeners)),e._v(" "),t("security",{attrs:{config:e.CONFIG_SECURITY}}),e._v(" "),t("env",{attrs:{config:e.CONFIG_env}}),e._v(" "),t("div",{staticClass:"setting setting--init",class:{"setting--collapsed":e.collapse.init}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main",attrs:{title:"重启后生效"}},[e._v("初始化相关设置")]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.init},on:{click:function(t){e.collapse.init=!e.collapse.init}}})],1),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.initSave()):null}}},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"setting_label"},[e._v("启动时检测新版本:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_init,oKey:"checkupdate"}})],1),e._v(" "),t("div",{staticClass:"eflex eflex_grow1 emargin--d5em"},[t("label",{staticClass:"setting_label",attrs:{title:"在 elecV2P 启动时执行的脚本, 可用于配置基础执行环境,或发送启动通知等"}},[e._v("启动时运行脚本:")]),e._v(" "),t("checkbox",{staticClass:"emargin--right",attrs:{oCheck:e.CONFIG_init,oKey:"runjsenable"}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_init.runjs,expression:"CONFIG_init.runjs",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{name:"init",placeholder:"python-install.js, feed.js, process.env.js(多个脚本请使用英文逗号进行分隔)"},domProps:{value:e.CONFIG_init.runjs},on:{change:function(t){e.$set(e.CONFIG_init,"runjs",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})],1),e._v(" "),t("button",{staticClass:"elecBtn emargin--d5em",on:{click:function(t){return e.initSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.webUIPortSave()):null}}},[t("label",{staticClass:"setting_label"},[e._v("webUI 主界面端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.webUI.port,expression:"webUI.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"webuiport",placeholder:"80"},domProps:{value:e.webUI.port},on:{input:function(t){t.target.composing||e.$set(e.webUI,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"是否使用 https 访问"}},[t("span",[e._v("TLS:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.webUI.tls}})],1),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"TLS 证书颁发对象,IP 或 域名"}},[t("span",[e._v("HOST:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.webUI.tls.host,expression:"webUI.tls.host"}],staticClass:"setting_input w220",attrs:{name:"tls_host",placeholder:"IP 或 域名"},domProps:{value:e.webUI.tls.host},on:{input:function(t){t.target.composing||e.$set(e.webUI.tls,"host",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.webUIPortSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.anyproxySave()):null}}},[t("label",{staticClass:"setting_label"},[e._v("ANYPROXY 设置:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.anyproxy,title:"启动时 关闭/打开"}}),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("代理端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.anyproxy.port,expression:"anyproxy.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"anyport",placeholder:"8001"},domProps:{value:e.anyproxy.port},on:{input:function(t){t.target.composing||e.$set(e.anyproxy,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("网络请求查看端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.anyproxy.webPort,expression:"anyproxy.webPort",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"anywebport",placeholder:"8002"},domProps:{value:e.anyproxy.webPort},on:{input:function(t){t.target.composing||e.$set(e.anyproxy,"webPort",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:e.anyproxySave}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting setting--config",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.pathSave()):null}}},[t("label",{staticClass:"title_inline",attrs:{title:"仅可在启动时通过 env.CONFIG 更改"}},[t("span",{staticClass:"elabel_text"},[e._v("当前配置文件")]),e._v(" "),t("input",{staticClass:"emargin elecTable_input wp50 minw320",attrs:{disabled:""},domProps:{value:e.CONFIG_Path.config}})]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.lists_final}},[e._v("规则任务列表等保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.lists,expression:"CONFIG_Path.lists"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.lists_final},domProps:{value:e.CONFIG_Path.lists},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"lists",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.script_final}},[e._v("脚本文件保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.script,expression:"CONFIG_Path.script"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.script_final},domProps:{value:e.CONFIG_Path.script},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"script",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.store_final}},[e._v("store 常量保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.store,expression:"CONFIG_Path.store"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.store_final},domProps:{value:e.CONFIG_Path.store},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"store",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.shell_final}},[e._v("shell 指令默认执行目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.shell,expression:"CONFIG_Path.shell"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.shell_final},domProps:{value:e.CONFIG_Path.shell},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"shell",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong emargin--d5em",on:{click:function(t){return e.pathSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("i",{staticClass:"tip"},[e._v("以上设置将在 elecV2P 重启后正式应用")]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("button",{staticClass:"emargin elecBtn elecBtn--check w220",on:{click:function(t){return e.updateCheck()}}},[e._v("检测更新 elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn greenbk w220",attrs:{title:"请确认已保存好当前规则及任务列表"},on:{click:function(t){return e.evRestart()}}},[e._v(e._s(e.$t("restart"))+" elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn elecBtn--clear w220",attrs:{title:"如只想关闭 ANYPROXY,可在首页双击 ANRPROXY 端口"},on:{click:function(t){return e.evStop()}}},[e._v(e._s(e.$t("stop"))+" elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn elecBtn--file",on:{click:function(t){return e.configImport()}}},[e._v("导入配置文件")]),e._v(" "),t("button",{staticClass:"emargin elecBtn",attrs:{title:"确保当前页面 WEBHOOK TOKEN 是和服务器匹配的"},on:{click:function(t){return e.configExport()}}},[e._v("导出当前配置")])])])],1),e._v(" "),e._m(2),e._v(" "),e.bShowMinishell?t("minishell",{tag:"div"}):e._e()],1)};Nr._withStripped=!0;var Pr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"shell",class:{mini:e.bIsHide}},[t("span",{staticClass:"shell_hide",class:{"shell_hide--close":!e.$wsrecv.connected},on:{click:function(t){e.bIsHide=!e.bIsHide}}},[e._v(e._s(e.subnum))]),e._v(" "),e.bIsHide?e._e():t("div",{staticClass:"shelllogs",on:{click:function(t){e.autoScroll=!1}}},[t("div",{staticClass:"shell_status"},[t("span",{staticClass:"shell_status_item"},[e._v("CLIENTS: "+e._s(e.status.clients))]),e._v(" "),t("span",{staticClass:"shell_status_item"},[e._v("RSS: "+e._s(e.status.rss))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.status.rtimes,expression:"status.rtimes"}],staticClass:"shell_status_item"},[e._v("JSRUNTS: "+e._s(e.status.rtimes))])]),e._v(" "),e._l(e.logs,(function(s){return t("span",{staticClass:"loginfo_item",domProps:{innerHTML:e._s(e.logHtml(s))}})}))],2),e._v(" "),e.bIsHide?e._e():t("ul",{staticClass:"shellsub"},e._l(e.subprocess,(function(s,i){return t("li",{key:i,staticClass:"eflex w100 shellsub_item"},[t("span",{staticClass:"shellsub_command",attrs:{title:i}},[e._v(e._s(e.subCommandAlign(s.command+" %")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.subcommand,expression:"process.subcommand"}],staticClass:"shellsub_input",attrs:{type:"text"},domProps:{value:s.subcommand},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.sendToSub(i))},keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdownSub(i,!0))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdownSub(i))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(s.subcommand=""))}],input:function(t){t.target.composing||e.$set(s,"subcommand",t.target.value)}}}),e._v(" "),t("span",{staticClass:"shellsub_close",on:{click:function(t){return e.subProcessExit(i)}}},[e._v("X")])])})),0),e._v(" "),e.bIsHide?e._e():t("div",{staticClass:"shellcommand",on:{click:function(t){e.autoScroll=!0}}},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fullcommand,expression:"fullcommand"}],staticClass:"shellcommand_input",domProps:{value:e.fullcommand},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.send.apply(null,arguments))},function(t){return(t.type.indexOf("key")||76===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:void(e.logs=[])):null},function(t){return t.type.indexOf("key")||36===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(0,t)):null},function(t){return(t.type.indexOf("key")||65===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(0,t)):null},function(t){return(t.type.indexOf("key")||69===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(-1,t)):null}],keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdown(!0))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdown())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.command=""))}],input:function(t){t.target.composing||(e.fullcommand=t.target.value)}}})])])};function Ar(e=""){switch(e){case"reload":case"?reload":case"refresh":location.reload(!0);break;default:e?/^#/.test(e)?location.hash=e:window.open(e,"elecV2Ptab","noreferrer"):console.debug("no url to open")}}function Ir(e,t=160,s=100){let i=e.pageX,n=e.pageY;return e.pageX+t>document.body.clientWidth&&(i-=t),e.pageY+s>document.body.clientHeight&&(n-=s),[i,n]}Pr._withStripped=!0;const Rr=new Map,Dr=new Map;Dr.set("082bc4ee40bfef100f79579dc780dff7",{name:"elecV2",homepage:"https://github.com/elecV2"}),Dr.set("cd2458b5e43827ee9a2009b56f29ffd5",{name:"Public test",homepage:"https://t.me/elecV2"}),Dr.set("b9b2e3354b6520261c1b5c375dc2bf74",{name:"Oreomeow",homepage:"https://github.com/Oreomeow"});let Fr=localStorage.getItem("sponsors");if(Fr)try{JSON.parse(Za(Fr,"elecV2P_sponsors")).forEach((e=>{Dr.set(e,Object.create(null))}))}catch(e){console.debug("parse localStorage sponsors",e)}Rr.set("sponsors",Dr),Rr.set("bChecked",localStorage.getItem("bcheck")===(new Date).getDate().toString()),Dr.has(localStorage.getItem("userid"))&&Rr.set("bSponsor",!0);const Lr={get:e=>localStorage.getItem(e),set:(e,t)=>localStorage.setItem(e,t),hasCache:e=>Rr.has(e),getCache:e=>Rr.get(e),setCache:(e,t)=>Rr.set(e,t),deleteCache:e=>Rr.delete(e)};function Hr(e){let t=document.querySelector(e);t&&(t.scrollTop=t.scrollHeight)}function Ur(e){let t=document.querySelector(e);t&&t.scrollIntoView()}function Mr(e){let t=document.querySelector(e);t&&t.focus()}function Br(e,t="elecV2P.json",s="application/json"){e=/json/.test(s)?JSON.stringify(e,null,2):String(e);const i=new Blob([e],{type:s});let n=(window.URL||window.webkitURL).createObjectURL(i),a=document.createElement("a");a.download=t,a.href=n,a.click()}function zr(e,t=""){fetch(e).then((s=>{if(!t)try{const e=s.headers.get("Content-Disposition").split(";");t=e[1].split("=")[1]}catch(e){console.error("fail to get filename",e)}return s.blob().then((s=>{let i=document.createElement("a");i.href=URL.createObjectURL(s),i.download=t||e.split("/").pop(),i.click()}))}))}function Vr(e="",t=".evscript"){if(!e)return void console.log("some code are expect");document.querySelector(t)&&document.querySelector(t).remove();let s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("defer","defer"),s.className="evscript",s.innerHTML=e,document.head.appendChild(s)}function Gr(e="",t=".evtheme"){if(!e)return void console.log("some style contexts are expect");document.querySelector(t)&&document.querySelector(t).remove();let s=document.createElement("style");s.className="evtheme",s.innerHTML=e,document.head.appendChild(s)}function Kr(e="",t=""){if(!e)return void console.log("a meta name is expect");let s=document.querySelector(`meta[name=${e}]`),i=null;s?i=s:(i=document.createElement("meta"),i.name=e),i.content=t,!s&&document.head.appendChild(i)}function qr(e="standalone"){return matchMedia(`(display-mode: ${e})`).matches||navigator.standalone||document.referrer.includes("android-app://")}function Jr(e){document.querySelector(e)&&document.querySelector(e).remove()}function Wr(e=""){let t=document.querySelector(".copyinput");t&&"INPUT"===t.nodeName||(t=document.createElement("input"),t.className="copyinput",t.style.position="fixed",t.style.top="-6px",t.style.height="0",t.style.border="none",document.body.appendChild(t)),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.blur()}function Yr(e){return navigator.clipboard.writeText(e)}function Xr({accept:e="*",type:t="text",multiple:s=!1}={}){let i=document.createElement("input");return i.type="file",i.accept=e,s&&(i.multiple=!0),new Promise(((e,s)=>{i.onchange=i=>{let n=i.target.files[0];if(n)if(console.debug("get file",n.name,n.type,n.size),"file"===t)e(n);else{let t=new FileReader;t.readAsText(n,"UTF-8"),t.onload=t=>{e({name:n.name,type:n.type,size:n.size,content:t.target.result})}}else s("请先选择文件")},i.click()}))}function Zr(){return navigator.userAgent||"Mozilla/5.0 (Linux; U; elecV2P; x64) ePhone Super Max Plus++"}function Qr(e=""){return getComputedStyle(document.querySelector("#app")).getPropertyValue(e).trim()}function eo(e=""){document.execCommand("insertText",!1,e)}const to=new Map;function so(e="",t="",s=3){if(!e||!t)return void to.clear();32!==e.length&&(e=Wa(t,32));const i=e+t+s;if(to.has(i))return to.get(i);let n="";switch(s){case 4:n=function(e=""){const t=document.createElement("canvas");t.width=180,t.height=180;const s=t.getContext("2d"),i=e.match(/\w{2}/g).map((e=>parseInt(e,16)));s.fillStyle=`rgba(${i[0]}, ${i[4]}, ${i[8]}, ${i[12]/380+.3})`,s.fillRect(0,0,t.width,t.height),s.lineCap="round",s.lineJoin="round";const n=i[0]%4,a=i[1]%10+10;switch(s.beginPath(),s.lineWidth=i[2]%15+5,s.strokeStyle=`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/380+.3})`,s.fillStyle=`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/380+.3})`,n){case 0:s.strokeRect(50-a,60-a,2*a,2*a);break;case 1:s.fillRect(50-a,60-a,2*a,2*a);break;case 2:s.arc(50,60,a,0,2*Math.PI),s.stroke();break;default:s.arc(50,60,a,0,2*Math.PI),s.fill()}const r=i[4]%4,o=i[5]%10+10;switch(s.beginPath(),s.lineWidth=i[6]%15+5,s.strokeStyle=`rgba(${i[4]}, ${i[5]}, ${i[6]}, ${i[7]/380+.3})`,s.fillStyle=`rgba(${i[4]}, ${i[5]}, ${i[6]}, ${i[7]/380+.3})`,r){case 0:s.strokeRect(130-o,60-o,2*o,2*o);break;case 1:s.fillRect(130-o,60-o,2*o,2*o);break;case 2:s.arc(130,60,o,0,2*Math.PI),s.stroke();break;default:s.arc(130,60,o,0,2*Math.PI),s.fill()}return s.beginPath(),s.moveTo(90,(a+o)/2+60),s.quadraticCurveTo(i[8],i[9],90,i[10]%15+105),s.lineWidth=i[11]%15+5,s.strokeStyle=`rgba(${i[8]}, ${i[9]}, ${i[10]}, ${i[11]/380+.3})`,s.stroke(),s.beginPath(),s.moveTo(50,130),s.quadraticCurveTo(i[12],i[13]%50+130,130,130),s.lineWidth=i[14]%15+5,s.strokeStyle=`rgba(${i[12]}, ${i[13]}, ${i[14]}, ${i[15]/380+.3})`,s.stroke(),t.toDataURL()}(e);break;case 3:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d"),n=e.match(/\w{2}/g).map((e=>parseInt(e,16))),a=i.createRadialGradient(90,90,0,90,90,128);a.addColorStop(0,`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]/380+.3})`),a.addColorStop(.25,`rgba(${n[4]}, ${n[5]}, ${n[6]}, ${n[7]/380+.3})`),a.addColorStop(.5,`rgba(${n[8]}, ${n[9]}, ${n[10]}, ${n[11]/380+.3})`),a.addColorStop(.75,`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`),a.addColorStop(1,`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`),i.beginPath(),i.fillStyle=a,i.arc(90,90,128,0,2*Math.PI),i.fill(),t&&io(t,i);return s.toDataURL()}(e,t);break;case 2:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d");e+=e;let n=0;for(let t=0;t<18;t++){for(let s=0;s<18;s++)i.beginPath(),i.fillStyle="#"+e.slice(n+s,n+s+8),i.arc(10*s+5,10*t+5,5,0,2*Math.PI),i.fill();n++}t&&io(t,i);return s.toDataURL()}(e,t);break;default:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d"),n=e.match(/\w{2}/g).map((e=>parseInt(e,16))),a=[n[0]%120,n[1]%120],r=[n[2]%(180-a[0])+a[0],n[3]%(180-a[1])+a[1]];i.fillStyle=`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]/380+.3})`,i.fillRect(0,0,r[0],a[1]-2),i.fillStyle=`rgba(${n[4]}, ${n[5]}, ${n[6]}, ${n[7]/380+.3})`,i.fillRect(r[0]+2,0,180-r[0]-2,r[1]),i.fillStyle=`rgba(${n[8]}, ${n[9]}, ${n[10]}, ${n[11]/380+.3})`,i.fillRect(a[0],r[1]+2,180-a[0],180-r[1]-2),i.fillStyle=`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`,i.fillRect(0,a[1],a[0]-2,180-a[1]),i.fillStyle=Qr("--main-bk")||`rgba(${n[1]}, ${n[5]}, ${n[9]}, ${n[13]/380+.3})`,i.fillRect(a[0],a[1],r[0]-a[0],r[1]-a[1]),i.fillStyle="#000",i.fillRect(r[0],0,2,r[1]),i.fillRect(a[0],r[1],180-a[0],2),i.fillRect(a[0]-2,a[1],2,180-a[1]),i.fillRect(0,a[1]-2,r[0],2),t&&io(t,i);return s.toDataURL()}(e,t)}return to.set(i,n),n}function io(e="",t){e&&(e.length>1&&(e=e.slice(0,1)),e=e.toUpperCase(),t.beginPath(),t.lineWidth=6,t.textAlign="center",t.textBaseline="middle",t.font="bold 140px "+(Qr("--font-fm")||"system-ui,sans-serif"),t.strokeStyle=Qr("--main-fc")||"#FFFFFF",t.strokeText(e,90,98))}function no(e=""){if("function"!=typeof eval){const e="eval 函数在当前环境下不可用";return console.error(e),e}try{return(0,eval)(e)}catch(e){return console.error("evalRun fail",e),e.message}}function ao(){return document.title}function ro(e="elecV2P"){document.title=e}function oo({ele:e=document.querySelector(".logo_a"),off:t=!0}={}){return t?e.classList.add("logo_a--offline"):e.classList.remove("logo_a--offline")}function lo(e,t=""){return t?document.querySelectorAll(e):document.querySelector(e)}const co={message:Object.create(null),evui:()=>{}};const uo=ka({name:"minishell",data:()=>({logs:[],command:"node -v",cwd:"",bIsHide:!0,status:{clients:0,rss:0,rtimes:0},history:{current:-1,lists:[]},autoScroll:!0,subprocess:Object.create(null),subDelaySend:Object.create(null),tips:"快捷键:\n- esc // 清空当前输入命令\n- ctrl + l // 清空屏幕日志\n- up/down // 上下查找历史执行命令\n- shift + tab // 移动光标到子进程交互输入框(如果存在的话\n- 单击上方日志输出部分,停止自动滚动。单击下方命令输入部分,开启自动滚动\n\n特殊指令:\n- cls/clear // 清空屏幕日志\n- cwd // 获取当前工作目录\n- cd xxx // 更改当前工作目录到xxx\n- docs // 打开 minishell 相关说明文档\n- exit // 最小化 minishell 界面(在子进程交互中输入时表示结束子进程"}),computed:{cwdshow(){return this.cwd?this.cwd.replace(/(\/|\\)$/,"").split(/\\|\//).pop()+"> ":"> "},subnum(){return Object.keys(this.subprocess).length||""},fullcommand:{get(){return this.cwdshow+this.command},set(e){this.command=e.replace(/[^>]*> /,"")}}},created(){this.logs.push(this.tips),this.$wsrecv.add("minishell",(e=>{if(e.data)switch(e.type){case"cwd":this.logs.push("cwd: "+e.data),this.cwd=e.data;break;case"shellinit":this.logs.push("cwd: "+e.data.cwd),this.cwd=e.data.cwd,e.data.subprocess&&(this.subprocess=e.data.subprocess);break;case"subprocessexit":if(this.subDelaySend[e.data]){console.debug("exit subprocess:",e.data),clearTimeout(this.subDelaySend[e.data]),this.subDelaySend[e.data]=null;break}this.subprocess[e.data]?(console.debug("exit subprocess:",e.data,"command:",this.subprocess[e.data].command),this.$delete(this.subprocess,e.data)):console.debug("subprocess: "+e.data+" not exist yet");break;case"subprocessadd":console.debug("run subprocess:",e.data.id,"command:",e.data.command);let{id:t,command:s}=e.data;this.subDelaySend[t]=setTimeout((()=>{this.subDelaySend[t]=null,this.$set(this.subprocess,t,{command:s,history:{current:-1,lists:[]}})}),800);break;case"elecV2Pstatus":this.status.clients=e.data.clients,this.status.rss=e.data.memoryusage.rss;break;case"jsrunstatus":this.status.rtimes=e.data.total;break;default:/\x1b\[H/.test(e.data)?this.logs=[e.data]:/\r|(\x1b\[F)/.test(e.data)?this.logs.splice(-1,1,e.data):this.logs.push(e.data)}else console.debug("minishell recv",e,"expected ms.data")})),this.$wsrecv.connected&&this.$wsrecv.send("shell","init"),setTimeout(Mr,2e3,".shellcommand_input")},watch:{logs(e){this.logBottom()},subprocess(){this.logBottom()}},methods:{logBottom(){this.autoScroll&&(this.autoScroll=!1,setTimeout((()=>{Hr(".shelllogs"),this.autoScroll=!0}),200))},logHtml:Va,send(e){if(!this.$wsrecv.connected)return this.$message.error("websocket 尚未连接"),void this.logs.push(`[${this.$logHead("minishell error")}][${this.$sTime(null,1)}] websocket 尚未连接`);if(!e.ctrlKey&&!e.shiftKey&&this.command){switch(this.command=this.command.trim(),this.command){case"exit":this.bIsHide=!0;break;case"clear":case"CLEAR":case"cls":case"CLS":this.logs.splice(0);break;case"docs":Ar("https://github.com/elecV2/elecV2P-dei/blob/master/docs/Advanced.md");break;default:const e=`${this.$wsrecv.id}_minishell_${this.history.lists.length}`;this.$wsrecv.send("shell",{id:e,type:"main",data:encodeURI(this.command)}),this.logs.push(`[${this.$logHead("minishell notify")}][${this.$sTime(null,1)}] running command: ${this.command}`)}this.history.lists.push(this.command),this.history.current=-1,this.command=""}},sendToSub(e){if(!e)return void this.$message.error("a command id is expected");let t=this.subprocess[e].subcommand;this.subprocess[e]&&t?(this.subprocess[e].subcommand="",this.$wsrecv.send("shell",{id:e,type:"sub",data:encodeURI(t)}),this.subprocess[e].history||(this.subprocess[e].history={lists:[]}),this.subprocess[e].history.lists.push(t),this.subprocess[e].history.current=-1):this.$message.error("请先输入要执行的命令")},subProcessExit(e){this.$wsrecv.send("shell",{id:e,type:"sub",data:"exit"}),this.$delete(this.subprocess,e)},hiupdown(e=!1){0!==this.history.lists.length&&(e?(this.history.current--,this.history.current<0&&(this.history.current=this.history.lists.length-1)):(this.history.current++,this.history.current>=this.history.lists.length&&(this.history.current=0)),this.command=this.history.lists[this.history.current])},hiupdownSub(e,t=!1){let s=this.subprocess[e];s&&s.history&&0!==s.history.lists.length&&(t?(s.history.current--,s.history.current<0&&(s.history.current=s.history.lists.length-1)):(s.history.current++,s.history.current>=s.history.lists.length&&(s.history.current=0)),s.subcommand=s.history.lists[s.history.current])},subCommandAlign:e=>e.length<32?e:Ba(e,32),moveCur(e=0,t){if(0===e){const e=t.target.value.indexOf(">")+2;t.target.setSelectionRange(e,e)}else t.target.setSelectionRange(e,e)}}},Pr,[],!1,null,"007ead95",null).exports;var ho=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.eAxiosSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("web","request","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"w100"},[t("div",{staticClass:"setting setting--inline"},[t("div",[t("label",[e._v("TIMEOUT(ms): ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.timeout,expression:"config.timeout",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不限制"},domProps:{value:e.config.timeout},on:{input:function(t){t.target.composing||e.$set(e.config,"timeout",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"minw320"},[t("label",{attrs:{title:"当 header 中没有 User-Agent 时,使用此 UA"}},[e._v("User-Agent: ")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.config.uagent,expression:"config.uagent"}],staticClass:"elecTable_select w220",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.config,"uagent",t.target.multiple?s:s[0])}}},e._l(e.ualists,(function(s,i){return t("option",{domProps:{value:i}},[e._v(e._s(s))])})),0),e._v(" "),t("button",{staticClass:"elecBtn",class:{"elecBtn--check":e.bUAManage},on:{click:function(t){e.bUAManage=!e.bUAManage}}},[e._v(e._s(e.$t("manage")))])]),e._v(" "),t("div",[t("label",{attrs:{title:"process.env.NODE_TLS_REJECT_UNAUTHORIZED,建议始终勾选"}},[e._v("REJECT_UNAUTHORIZED: ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.config.reject_unauthorized,expression:"config.reject_unauthorized"}],staticClass:"echeckbox emargin",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.config.reject_unauthorized)?e._i(e.config.reject_unauthorized,null)>-1:e.config.reject_unauthorized},on:{change:function(t){var s=e.config.reject_unauthorized,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.config,"reject_unauthorized",s.concat([null])):a>-1&&e.$set(e.config,"reject_unauthorized",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.config,"reject_unauthorized",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",[e._v("HTTP "+e._s(e.$t("proxy"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.proxy}})],1)]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.bUAManage,expression:"bUAManage"}],staticClass:"setting setting--inline setting--ua",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.uaSave()):null}}},[t("table",{staticClass:"elecTable elecTable--ua"},[t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("name")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw600"},[e._v(e._s(e.$t("content")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.uagent,(function(s,i){return t("tr",{key:i},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"ua.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"chrome 浏览器"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.header,expression:"ua.header",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"},domProps:{value:s.header},on:{input:function(t){t.target.composing||e.$set(s,"header",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.uaDelete(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_td padding0",attrs:{colspan:"3"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.uaAdd()}}},[e._v(e._s(e.$t("add"))+" UA")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.uaSave()}}},[e._v(e._s(e.$ta("save","current","list")))])])])])])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.config.proxy.enable,expression:"config.proxy.enable"}],staticClass:"setting_proxy"},[t("div",{staticClass:"setting setting--inline"},[t("label",[t("span",[e._v("PORT:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.proxy.port,expression:"config.proxy.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"8001"},domProps:{value:e.config.proxy.port},on:{input:function(t){t.target.composing||e.$set(e.config.proxy,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("label",{staticClass:"wp46"},[t("span",[e._v("HOST:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.host,expression:"config.proxy.host",modifiers:{lazy:!0}}],staticClass:"setting_input",attrs:{placeholder:"可选。如省略表示使用本地代理"},domProps:{value:e.config.proxy.host},on:{change:function(t){return e.$set(e.config.proxy,"host",t.target.value)}}})]),e._v(" "),t("label",[t("span",[e._v("AUTH:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.isAuth,expression:"isAuth"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.isAuth)?e._i(e.isAuth,null)>-1:e.isAuth},on:{change:function(t){var s=e.isAuth,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.isAuth=s.concat([null])):a>-1&&(e.isAuth=s.slice(0,a).concat(s.slice(a+1)))}else e.isAuth=n}}})])]),e._v(" "),e.isAuth?t("div",{staticClass:"setting setting--inline"},[t("label",{staticClass:"eflex mp46"},[t("span",[e._v("USERNAME:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.auth.username,expression:"config.proxy.auth.username",modifiers:{lazy:!0}}],staticClass:"setting_input",domProps:{value:e.config.proxy.auth.username},on:{change:function(t){return e.$set(e.config.proxy.auth,"username",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"eflex mp46"},[t("span",[e._v("PASSWORD:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.auth.password,expression:"config.proxy.auth.password",modifiers:{lazy:!0}}],staticClass:"setting_input",domProps:{value:e.config.proxy.auth.password},on:{change:function(t){return e.$set(e.config.proxy.auth,"password",t.target.value)}}})])]):e._e()]),e._v(" "),t("div",{staticClass:"setting_proxy",attrs:{title:"谨慎选择是否开启,不合理的设置可能会导致正常的网络请求被屏蔽"}},[t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw160",attrs:{title:"可使用 request.token: '你的webhook token' 绕过屏蔽检测"}},[e._v(e._s(e.$t("forbid"))+" URL")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.block}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.block.regexp,expression:"config.block.regexp",modifiers:{lazy:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"匹配内容 比如: abc|123 匹配方式: new RegExp('该内容').test(url)"},domProps:{value:e.config.block.regexp},on:{change:function(t){return e.$set(e.config.block,"regexp",t.target.value)}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("当网络请求 url 符合此正则表达式时,屏蔽该请求")])]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw160"},[e._v(e._s(e.$t("allowed"))+" URL")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.only}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.only.regexp,expression:"config.only.regexp",modifiers:{lazy:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"匹配内容 其他所有不符合该正则表达式的网络请求将被直接屏蔽掉"},domProps:{value:e.config.only.regexp},on:{change:function(t){return e.$set(e.config.only,"regexp",t.target.value)}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("开启时,仅允许符合此正则表达式的网络请求通过")])])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("该部分设置适用于服务器端 文件下载/JS/mock 等模块发起的网络请求。URL 匹配方式: new RegExp('匹配内容').test(url)")]),e._v(" "),t("div",[t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.eAxiosSave()}}},[e._v(e._s(e.$t("save")))])])])])};ho._withStripped=!0;const po=ka({name:"eAxios",props:["config","uagent"],data(){return{icon:wa,collapse:this.$uStr.iRandom(0,10)>5,bUAManage:!1}},computed:{ualists(){let e={};for(let t in this.uagent)e[t]=this.uagent[t].name;return e},isAuth:{get(){return Boolean(this.config.proxy&&this.config.proxy.auth)},set(e){e?this.$set(this.config.proxy,"auth",{}):this.$delete(this.config.proxy,"auth")}}},components:{checkbox:mr},methods:{uaDelete(e){this.$message.success("User-Agent:",this.uagent[e].name,"已删除,保存后生效"),this.$delete(this.uagent,e)},uaAdd(){this.$set(this.uagent,this.$uStr.euid(),{name:"我的 UA",header:this.$uApi.getUA()})},uaSave(){const e=this.$message.loading("User-Agent 列表上传更新中...",0);this.$axios.put("/config",{type:"uagent",data:this.uagent}).then((e=>{this.$message.success("设置成功",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},eAxiosSave(){const e=this.$message.loading("网络请求相关设置保存中...",0);this.$axios.put("/config",{type:"eAxios",data:this.config}).then((e=>{0===e.data.rescode?this.$message.success("网络请求相关设置更改成功",e.data.message):this.$message.error("设置失败",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)}}},ho,[],!1,null,"487a2786",null).exports;var mo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.securitySave()):null}}},[t("h4",{staticClass:"setting_title"},[t("div",{staticClass:"title_main"},[t("span",{attrs:{title:"仅对 webUI 端口有效"}},[e._v(e._s(e.$ta("security","access","setting_of")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.config.enable,expression:"config.enable"}],staticClass:"echeckbox emargin",attrs:{type:"checkbox",name:"status",title:"是否开启安全访问"},domProps:{checked:Array.isArray(e.config.enable)?e._i(e.config.enable,null)>-1:e.config.enable},on:{change:function(t){var s=e.config.enable,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.config,"enable",s.concat([null])):a>-1&&e.$set(e.config,"enable",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.config,"enable",n)}}})]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse&&e.config.enable,expression:"!collapse && config.enable"}],staticClass:"w100"},[t("div",{staticClass:"radius_bs border emargin"},[t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"wp50"},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$ta("allowed","access"))+" IP("+e._s(e.$t("whitelist"))+"):")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:e.whitelist,expression:"whitelist",modifiers:{trim:!0}}],staticClass:"editor_textarea",attrs:{name:"whitelist",placeholder:"127.0.0.1\n192.168.1.101\n182.xxx.x.125\n(仅可设置为 IP 地址)\n(白名单优先级高于黑名单)"},domProps:{value:e.whitelist},on:{input:function(t){t.target.composing||(e.whitelist=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"wp50"},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$ta("forbid","access"))+" IP("+e._s(e.$t("blacklist"))+"):")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:e.blacklist,expression:"blacklist",modifiers:{trim:!0}}],staticClass:"editor_textarea",attrs:{name:"blacklist",placeholder:"172.20.10.2\n*\n单独星号字符 * 表示屏蔽所有(只允许白名单中的 IP 通过)\n如果设置为 *,请务必先记下 WEBHOOK TOKEN"},domProps:{value:e.blacklist},on:{input:function(t){t.target.composing||(e.blacklist=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",{staticClass:"eflex",attrs:{title:"启用后,仅 webhook 接口可访问"}},[t("label",{staticClass:"setting_label"},[e._v("WEBHOOK ONLY")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config,oKey:"webhook_only",oInit:"false"}})],1),e._v(" "),t("div",{staticClass:"eflex",attrs:{title:"不启用时,webUI 将不可使用授权 cookie 进行访问"}},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$t("allow"))+" cookie")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.cookie}})],1),e._v(" "),t("div",{attrs:{title:"0: 表示不通知"}},[t("label",[e._v(e._s(e.$t("every"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.numtofeed,expression:"config.numtofeed",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"numtofeed",placeholder:"0: 不通知"},domProps:{value:e.config.numtofeed},on:{input:function(t){t.target.composing||e.$set(e.config,"numtofeed",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",[e._v(" "+e._s(e.$ta("times","illegal","access"))+", "+e._s(e.$ta("send","a","notify")))])])])]),e._v(" "),t("div",{staticClass:"setting setting--inline border"},[t("h4",{staticClass:"title_inline"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("temp","access"))+" TOKEN")]),e._v(" "),t("button",{staticClass:"efloat--right elecBtn elecBtn--h32 radius_zero radius-bs--tr greenbk",on:{click:function(t){return e.tokensNew()}}},[e._v(e._s(e.$t("new")))])],1),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100 margin0"},e._l(e.config.tokens,(function(s,i){return t("div",{directives:[{name:"key",rawName:"v-key",value:i,expression:"hash"}],staticClass:"settoken",class:{"settoken--disabled":!s.enable}},[t("div",{staticClass:"eflex w460 minw320 emargin"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.token,expression:"token.token"}],staticClass:"elecTable_input h36",attrs:{placeholder:"临时访问 token"},domProps:{value:s.token},on:{input:function(t){t.target.composing||e.$set(s,"token",t.target.value)}}}),e._v(" "),t("span",{staticClass:"icon--op h36",domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){s.token=e.$uStr.UUID()}}})]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.path,expression:"token.path"}],staticClass:"elecTable_input w360 minw320 emargin h36",attrs:{placeholder:"允许路径,比如 ^/efss(留空:不限制"},domProps:{value:s.path},on:{input:function(t){t.target.composing||e.$set(s,"path",t.target.value)}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.method,expression:"token.method"}],staticClass:"elecTable_input w360 minw320 emargin h36",attrs:{placeholder:"允许方法,比如 GET(留空:不限制"},domProps:{value:s.method},on:{input:function(t){t.target.composing||e.$set(s,"method",t.target.value)}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.note,expression:"token.note"}],staticClass:"elecTable_input minw160 emargin h36",attrs:{placeholder:"备注(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value)}}}),e._v(" "),t("span",{staticClass:"minw100",attrs:{title:"已授权访问次数"}},[e._v(e._s(s.times))]),e._v(" "),t("div",{staticClass:"eflex emargin"},[t("checkbox",{attrs:{oCheck:s}}),e._v(" "),t("span",{staticClass:"icon--op h36",attrs:{title:i},domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$delete(e.config.tokens,i)}}})],1)])})),0)]),e._v(" "),e._m(0)]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.securitySave()}}},[e._v(e._s(e.$t("save")))])])};mo._withStripped=!0;const fo=ka({name:"security",props:["config"],data:()=>({icon:wa,collapse:!1}),components:{checkbox:mr},computed:{whitelist:{get(){return this.config.whitelist?this.config.whitelist.join("\n"):""},set(e){e?this.$set(this.config,"whitelist",e.split(/\r|\n|,/).filter((e=>e.trim()))):this.config.whitelist=[]}},blacklist:{get(){return this.config.blacklist?this.config.blacklist.join("\n"):""},set(e){e?this.$set(this.config,"blacklist",e.split(/\r|\n|,/).filter((e=>e.trim()))):this.config.blacklist=[]}}},methods:{tokensNew(){this.$set(this.config.tokens,this.$uStr.euid(),{enable:!0,token:this.$uStr.UUID(),path:"",method:"",note:"",times:0})},securitySave(){if(this.config.webhook_only&&!confirm("启用 仅开放 webhook 接口 后,webUI 等其他所有接口都不可用\n确定继续?"))return;const e=this.$message.loading("安全访问相关设置保存中...",0);this.$axios.put("/config",{type:"security",data:this.config}).then((e=>{0===e.data.rescode?(this.$message.success("安全访问相关设置保存成功"),e.data.resdata&&(this.config.tokens=e.data.resdata)):(this.$message.error("安全访问相关设置保存失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("安全访问相关设置保存失败",e.message),console.log(e)})).finally(e)}}},mo,[function(){var e=this,t=e._self._c;return t("i",{staticClass:"tip emargin"},[t("span",[e._v("更多说明请参考: ")]),e._v(" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/Advanced.md",target:"elecV2PDoc"}},[e._v("Advanced.md")])])}],!1,null,"2a6fe729",null).exports;var vo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.webuiSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v("webUI "+e._s(e.$t("setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{attrs:{title:"左上角显示信息"}},[e._v("自定义 LOGO:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.logo}})],1),e._v(" "),t("label",{staticClass:"eflex eflex--wrap emargin"},[e._v("图标链接:"),t("input",{directives:[{name:"model",rawName:"v-model",value:e.logo.src,expression:"logo.src"}],staticClass:"elecTable_input logo_src",attrs:{placeholder:"比如 https://x.xx/x.png 或 efss/logo/my.png"},domProps:{value:e.logo.src},on:{input:function(t){t.target.composing||e.$set(e.logo,"src",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"eflex"},[e._v("显示名称:"),t("input",{directives:[{name:"model",rawName:"v-model",value:e.logo.name,expression:"logo.name"}],staticClass:"elecTable_input w120",attrs:{placeholder:"elecV2P"},domProps:{value:e.logo.name},on:{input:function(t){t.target.composing||e.$set(e.logo,"name",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn w120",on:{click:function(t){return t.preventDefault(),e.logoSave()}}},[e._v("保存")])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("h4",{staticClass:"title_inline",attrs:{title:"SETTING/DONATION 暂时不支持隐藏"}},[e._v("左侧导航栏设置")]),e._v(" "),t("ul",{staticClass:"eflex eflex--wrap emargin"},e._l(e.menulist,(function(s,i){return t("li",{key:i,staticClass:"menunav_item"},[t("label",[e._v(e._s(i.toUpperCase())+": 别名")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.name,expression:"nav.name"}],staticClass:"emargin--left elecTable_input w220",attrs:{type:"text",placeholder:"显示为其他名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value)}}}),e._v(" "),t("label",{staticClass:"emargin--left"},[e._v("显示")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.show,expression:"nav.show"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(s.show)?e._i(s.show,null)>-1:s.show},on:{change:function(t){var i=s.show,n=t.target,a=!!n.checked;if(Array.isArray(i)){var r=e._i(i,null);n.checked?r<0&&e.$set(s,"show",i.concat([null])):r>-1&&e.$set(s,"show",i.slice(0,r).concat(i.slice(r+1)))}else e.$set(s,"show",a)}}})])})),0),e._v(" "),t("span",{staticClass:"tip tip--small"},[e._v(" • SETTING/DONATION 暂时不可隐藏 • 隐藏界面可通过 #hash 的形式直接访问")])]),e._v(" "),e.$uApi.store.getCache("bSponsor")?t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",[e._v("启用主题:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.theme_simple}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.name,expression:"theme_simple.name"}],staticClass:"emargin--left elecTable_input w220",attrs:{type:"text",placeholder:"主题名称"},domProps:{value:e.theme_simple.name},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"name",t.target.value)}}})],1),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("主色彩:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.mainbk,expression:"theme_simple.mainbk"}],staticClass:"elecTable_input w120",attrs:{type:"text",placeholder:"#326733"},domProps:{value:e.theme_simple.mainbk},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"mainbk",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("文字色彩:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.maincl,expression:"theme_simple.maincl"}],staticClass:"elecTable_input w120",attrs:{type:"text",placeholder:"#ff9800"},domProps:{value:e.theme_simple.maincl},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"maincl",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("应用背景:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.appbk,expression:"theme_simple.appbk"}],staticClass:"elecTable_input w220",attrs:{type:"text",placeholder:"url(https://x.xx/x.png)"},domProps:{value:e.theme_simple.appbk},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"appbk",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin eflex eflex--wrap w100"},[t("div",{staticClass:"theme_style"},[t("label",[e._v("附加样式:")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.style,expression:"theme_simple.style"}],staticClass:"editor_textarea editor_textarea--oneline",attrs:{placeholder:"#app {--main-bk: #2E3784;--main-fc: #FFCB40;--main-cl: #64AAD0;}"},domProps:{value:e.theme_simple.style},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"style",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.themePreview()}}},[e._v("预览")]),e._v(" "),t("button",{staticClass:"elecBtn w120",on:{click:function(t){return e.themeSave()}}},[e._v("保存为常用")])]),e._v(" "),t("div",{staticClass:"w100"},[t("ul",{staticClass:"w100"},e._l(e.theme_list,(function(s,i){return t("li",{staticClass:"theme_item"},[t("span",{staticClass:"w220"},[e._v(e._s(s.name)+":")]),e._v(" "),t("div",{staticClass:"theme_view"},[t("span",{staticClass:"theme_viewitem",style:{background:s.mainbk},attrs:{title:s.mainbk},on:{click:function(t){return t.preventDefault(),e.copyColor(s.mainbk)}}}),e._v(" "),t("span",{staticClass:"theme_viewitem",style:{background:s.maincl},attrs:{title:s.maincl},on:{click:function(t){return t.preventDefault(),e.copyColor(s.maincl)}}}),e._v(" "),t("span",{staticClass:"theme_viewitem",style:{background:s.appbk},attrs:{title:s.appbk},on:{click:function(t){return t.preventDefault(),e.copyColor(s.appbk)}}})]),e._v(" "),t("div",{staticClass:"theme_op"},[t("button",{staticClass:"elecBtn greenbk elecBtn--h32",on:{click:function(t){return e.themePreview(i)}}},[e._v("预览")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32",on:{click:function(t){return e.theme_list.splice(i,1)}}},[e._v("删除")])])])})),0),e._v(" "),t("div",{staticClass:"theme_imexport"},[t("button",{staticClass:"elecBtn elecBtn--h32 minw160",on:{click:function(t){return t.preventDefault(),e.themeExport()}}},[e._v("导出常用主题")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h32 minw160",on:{click:function(t){return t.preventDefault(),e.themeImport()}}},[e._v("导入常用主题")])])])]):e._e(),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.webuiSave()}}},[e._v(e._s(e.$t("save")))])])};vo._withStripped=!0;const go=ka({name:"webui",props:["menunav","theme","logo"],data(){return{collapse:this.$uStr.iRandom(0,10)>5,navkey:["overview","task","mitm","rules","rewrite","jsmanage","setting","cfilter","about","donation"]}},components:{checkbox:mr},computed:{menulist(){for(let e of this.navkey)this.menunav[e]||(this.menunav[e]=Object.create(null)),!1!==this.menunav[e].show&&(this.menunav[e].show=!0);return this.menunav},theme_simple(){return this.theme.simple||(this.theme.simple=Object.create(null)),this.theme.simple},theme_list(){return this.theme.list||(this.theme.list=[]),this.theme.list}},methods:{webuiSave(){if(this.theme_simple.style&&/{0===e.data.rescode?(this.$message.success("webUI 相关设置修改成功"),this.$emit("menunav",this.menunav,!0),this.$emit("theme",this.theme_simple)):this.$message.error("webUI 相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("webUI 相关设修改失败",e.message),console.error("webUI 相关设修改失败",e)})).finally(e)},themeSave(){let e=prompt("命名将要保存的主题",this.theme_simple.name||"主题名称");e&&(this.theme.list.push({name:e,mainbk:this.theme_simple.mainbk,maincl:this.theme_simple.maincl,appbk:this.theme_simple.appbk,style:this.theme_simple.style}),this.$message.success(e,"已保存"),this.$forceUpdate())},themePreview(e=-1){-1!==e?(this.theme_simple.enable=!0,this.theme_simple.name=this.theme_list[e].name,this.theme_simple.mainbk=this.theme_list[e].mainbk,this.theme_simple.maincl=this.theme_list[e].maincl,this.theme_simple.appbk=this.theme_list[e].appbk,this.theme_simple.style=this.theme_list[e].style,this.$emit("theme",this.theme_simple)):this.$emit("theme",this.theme_simple)},themeExport(){this.$uApi.saveAsFile(this.theme_list,"elecV2P_theme.json")},themeImport(){this.$uApi.getFile({accept:".json"}).then((e=>{try{this.theme_list.push(...JSON.parse(e.content)),this.$forceUpdate(),this.$message.success("常用主题列表导入成功")}catch(e){this.$message.error("常用主题列表导入失败",e.message||e)}})).catch((e=>{this.$message.error("常用主题列表导入失败",e.message||e)}))},logoSave(){const e=this.$message.loading("LOGO 相关设置保存中...",0);this.$axios.put("/config",{type:"webUILogo",data:this.logo}).then((e=>{0===e.data.rescode?(this.$message.success("LOGO 相关设置修改成功"),this.$emit("theme",{type:"logo",...this.logo})):this.$message.error("LOGO 相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("LOGO 相关设修改失败",e.message),console.error("LOGO 相关设修改失败",e)})).finally(e)},copyColor(e=""){e?this.$uApi.copyToClipboard(e).then((t=>{this.$message.success("成功复制",e)})).catch((e=>{this.$message.error("复制失败",e.message)})):this.$message.error("该项暂无对应值可供复制")}}},vo,[],!1,null,"f48c8df4",null).exports;var _o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.envSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v("环境变量相关设置")]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"w100"},[t("div",{staticClass:"eflex w100 emargin"},[t("label",{staticClass:"minw160"},[e._v("PATH")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.config.path,expression:"config.path"}],staticClass:"editor_textarea editor_textarea--mini emargin--left",attrs:{placeholder:"路径/PATH 分隔符 WIN系统-分号(;) 其他系统-冒号(:)"},domProps:{value:e.config.path},on:{input:function(t){t.target.composing||e.$set(e.config,"path",t.target.value)}}})]),e._v(" "),e._l(e.config.other,(function(s,i){return t("div",{key:i,staticClass:"eflex w100 emargin"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s[0],expression:"envk[0]",modifiers:{trim:!0}}],staticClass:"elecTable_input minw160",attrs:{type:"text",placeholder:"变量名称"},domProps:{value:s[0]},on:{input:function(t){t.target.composing||e.$set(s,0,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:s[1],expression:"envk[1]",modifiers:{trim:!0}}],staticClass:"editor_textarea editor_textarea--oneline emargin--left",attrs:{placeholder:"变量对应值"},domProps:{value:s[1]},on:{input:function(t){t.target.composing||e.$set(s,1,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$delete(e.config.other,i)}}})])}))],2),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"eflex w100"},[t("button",{staticClass:"elecBtn elecBtn--stlong wp46",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.envNew()}}},[e._v(e._s(e.$t("new")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong wp46",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.envSave()}}},[e._v(e._s(e.$t("save")))])])])};_o._withStripped=!0;const bo=ka({name:"env",props:["config"],data(){return{icon:wa,collapse:this.$uStr.iRandom(0,10)>5}},methods:{envNew(){this.config.other.push(["",""])},envSave(){if(!this.config.path)return void this.$message.error("请先输入 PATH 变量对应值再进行保存");if(/[\*\?"<>\|]/.test(this.config.path)&&!confirm("PATH 中包含特殊字符,确认继续保存?"))return;let e=[],t=[];if(this.config.other.length)for(const e of this.config.other){if(!e[0]||!e[1])return void this.$message.error("部分环境变量或对应值为空,请填写后再进行保存");t.push(e[0])}this.config.dable.forEach((s=>{-1===t.indexOf(s)&&e.push(s)}));const s=this.$message.loading("环境变量相关设置保存中...",0);this.$axios.put("/config",{type:"env",data:{path:this.config.path,other:this.config.other,todel:e}}).then((e=>{0===e.data.rescode?(this.$message.success("环境变量相关设置修改成功"),this.config.dable=this.config.other.map((e=>e[0]))):this.$message.error("环境变量相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("环境变量相关设修改失败",e.message),console.error("环境变量相关设修改失败",e)})).finally(s)}}},_o,[],!1,null,null,null).exports,yo={name:"setting",props:[],data(){return{icon:wa,collapse:{notify:this.$uStr.iRandom(0,10)>5,runjs:this.$uStr.iRandom(0,10)>5,other:this.$uStr.iRandom(0,10)>5,init:!0},init_url:Oa.base_url,homepage:Oa.base_url,lang:rr.locale,gloglevel:"info",glogslicebegin:"0",wbrtoken:"",userid:this.$uApi.store.get("userid"),wbrscript:{enable:!1,target:""},CONFIG_FEED:{enable:!0,rss:{enable:!0,homepage:"https://github.com/elecV2/elecV2P"},iftttid:{enable:!1,key:""},barkkey:{enable:!1,key:""},custnotify:{enable:!1,url:"",type:"GET",data:""},runjs:{enable:!1,list:""},merge:{enable:!0,gaptime:60,number:10,andor:!1},maxbLength:1200,webmessage:{enable:!1}},CONFIG_RUNJS:{timeout:5e3,intervals:86400,numtofeed:50,jslogfile:!0,eaxioslog:!1,proxy:!0,white:{enable:!1,list:[]}},CONFIG_Axios:{proxy:{enable:!1},timeout:5e3,uagent:"",block:{enable:!1,regexp:""},only:{enable:!1,regexp:""},reject_unauthorized:!0},bShowMinishell:!1,uagent:Object.create(null),CONFIG_SECURITY:{enable:!1,blacklist:[],whitelist:[],cookie:{enable:!0},numtofeed:0,webhook_only:!1,tokens:{}},CONFIG_init:{checkupdate:!0,runjsenable:!0,runjs:""},CONFIG_env:{path:"",other:[],dable:[]},anyproxy:{enable:!0,port:8001,webPort:8002},webUI:{port:80,tls:{enable:!1,host:"127.0.0.1"},nav:Object.create(null),logo:{enable:!1,src:"",name:""},theme:{simple:{enable:!1,name:"",mainbk:"",maincl:"",appbk:"",style:""},list:[{name:"简单暗黑",mainbk:"#000C",maincl:"#6E77FB",appbk:"#000C",style:""},{name:"简单透明",mainbk:"#0000",maincl:"#FFC107",appbk:"url(https://images.unsplash.com/photo-1646505183416-f3301d2a8127?auto=format)",style:".content>div,.elecBtn--long,.efssset_container,.efsslist{border: 1px solid var(--tras-bk);}.eapp_item .eapp_name,.efsslist_content .efssa{color: var(--main-cl);}.loginfo.loginfo--full{background: var(--secd-bk);}.codeditor{--main-bk: var(--secd-bk);}"}]}},CONFIG_Path:{config:"",lists:"",lists_final:"",script:"",script_final:"",store:"",store_final:"",shell:"",shell_final:""},newversion:""}},computed:{jswhitelist:{get(){return this.CONFIG_RUNJS.white.list.join(", ")},set(e){this.CONFIG_RUNJS.white.list=e.split(/ ?, ?|,| /)}}},components:{minishell:uo,eAxios:po,security:fo,checkbox:mr,webui:go,env:bo},created(){const e=this.$message.loading("正在获取 设置 相关数据...",0);this.$axios.get("/config?type=setting").then((e=>{if(this.$message.success("CONFIG 相关数据获取成功"),this.homepage=e.data.homepage||Oa.base_url,this.gloglevel=e.data.gloglevel,this.glogslicebegin=String(e.data.glogslicebegin||"0"),Object.assign(this.CONFIG_SECURITY,e.data.security||{}),Object.assign(this.CONFIG_FEED,e.data.CONFIG_FEED||{}),Object.assign(this.CONFIG_RUNJS,e.data.CONFIG_RUNJS||{}),Object.assign(this.CONFIG_Axios,e.data.CONFIG_Axios||{}),Object.assign(this.CONFIG_Path,e.data.CONFIG_Path||{}),Object.assign(this.CONFIG_init,e.data.init||{}),Object.assign(this.anyproxy,e.data.anyproxy||{}),e.data.CONFIG_env){const{path:t,...s}=e.data.CONFIG_env;this.CONFIG_env.path=t;for(const e in s)this.CONFIG_env.dable.push(e),this.CONFIG_env.other.push([e,s[e]])}if(e.data.uagent)for(let t in e.data.uagent)e.data.uagent[t].name&&this.$set(this.uagent,t,{name:e.data.uagent[t].name,header:e.data.uagent[t].header});if(this.wbrtoken=e.data.wbrtoken,this.userid=e.data.userid,this.userid!==this.$uApi.store.get("userid")&&this.$uApi.store.set("userid",this.userid),this.$uApi.store.setCache("bSponsor",this.$uApi.store.getCache("sponsors").has(this.userid)),e.data.webUI)if(Object.assign(this.webUI,e.data.webUI),e.data.webUI.nav&&this.$emit("menunav",{...e.data.webUI.nav}),e.data.webUI.logo&&this.$emit("theme",{type:"logo",...e.data.webUI.logo}),this.$uApi.store.getCache("bSponsor")){let t=e.data.webUI.theme;t&&this.$emit("theme",t.simple||t)}else this.$emit("theme",{enable:!1});e.data.lang&&this.lang!==e.data.lang&&(this.lang=e.data.lang,this.setLanguage()),"object"==typeof e.data.wbrscript&&Object.assign(this.wbrscript,e.data.wbrscript),this.bShowMinishell=e.data.minishell,this.newversion=e.data.newversion})).catch((e=>{this.$message.error("获取数据失败",e),console.error("获取数据失败",e)})).finally(e)},methods:{homepageSave(){if(this.homepage!==location.origin&&!confirm("设置主页和当前主页 "+location.origin+" 不匹配,确定保存?"))return;const e=this.$message.loading("主页设置保存中...",0);this.$axios.put("/config",{type:"homepage",data:this.homepage}).then((e=>{this.$message.success("设置成功",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},glevelSet(){const e=this.$message.loading("全局日志设置中...",0);this.$axios.put("/config",{type:"gloglevel",data:this.gloglevel}).then((e=>{0===e.data.rescode?this.$message.success("设置成功",e.data.message):this.$message.error("设置失败",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},gsliceSet(){const e=this.$message.loading("日志格式设置中...",0);this.$axios.put("/config",{type:"glogslicebegin",data:this.glogslicebegin}).then((e=>{0===e.data.rescode?(this.$message.success("日志格式设置成功"),Oa.glogslicebegin=this.glogslicebegin):this.$message.error("日志格式设置失败")})).catch((e=>{this.$message.error("日志格式设置失败",e.message),console.log(e)})).finally(e)},feedOp(){const e=this.$message.loading("设置保存中...",0);this.$axios.put("/feed",{type:"op",data:{enable:this.CONFIG_FEED.enable,maxbLength:this.CONFIG_FEED.maxbLength,webmessage:this.CONFIG_FEED.webmessage}}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log(e)})).finally(e)},feedTest(){const e=this.$message.loading("通知准备测试中...",0);this.$axios.put("/feed",{type:"test"}).then((e=>{0===e.data.rescode?this.$message.success(e.data.message):console.log(e.data)})).catch((e=>{this.$message.error("通知测试失败",e.message),console.log(e)})).finally(e)},feedClear(){if(!confirm("确实清空 Feed 内容吗?"))return;const e=this.$message.loading("Feed 清空中...",0);this.$axios.put("/feed",{type:"clear"}).then((e=>{this.$message.success("Feed 内容已重置",e.data.message)})).catch((e=>{this.$message.error("Feed 清空失败",e.message),console.log(e)})).finally(e)},iftttSave(){if(!this.CONFIG_FEED.iftttid.enable||this.CONFIG_FEED.iftttid.key){if(this.CONFIG_FEED.iftttid.enable||confirm("确认关闭 IFTTT 通知?")){const e=this.$message.loading("IFTTT 设置中...",0);this.$axios.put("/feed",{type:"ifttt",data:this.CONFIG_FEED.iftttid}).then((e=>{this.$message.success("IFTTT 设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置保存失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入 IFTTT KEY 值")},barkeySave(){if(!this.CONFIG_FEED.barkkey.enable||this.CONFIG_FEED.barkkey.key){if(this.CONFIG_FEED.barkkey.enable||confirm("确认关闭 BARK 通知?")){const e=this.$message.loading("barkkey 设置中...",0);this.$axios.put("/feed",{type:"barkkey",data:this.CONFIG_FEED.barkkey}).then((e=>{this.$message.success("barkkey 设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入 BARK KEY 值")},custnotifySave(){if(!this.CONFIG_FEED.custnotify.enable||this.CONFIG_FEED.custnotify.url){if(this.CONFIG_FEED.custnotify.enable||confirm("确认关闭自定义通知?")){const e=this.$message.loading("更新自定义通知相关设置中...",0);this.$axios.put("/feed",{type:"custnotify",data:this.CONFIG_FEED.custnotify}).then((e=>{this.$message.success("自定义通知设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入自定义通知链接")},notifyjsSave(){if(!this.CONFIG_FEED.runjs.enable||this.CONFIG_FEED.runjs.list){if(this.CONFIG_FEED.runjs.enable||confirm("确认关闭触发脚本?")){const e=this.$message.loading("通知触发脚本设置保存中...",0);this.$axios.put("/feed",{type:"runjs",data:this.CONFIG_FEED.runjs}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`),console.debug(e.data)})).catch((e=>{this.$message.error("设置保存失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入要触发的脚本")},wbrtokenSave(){if(!this.wbrtoken)return void this.$message.error("请先输入 TOKEN 值");if(this.wbrtoken.length<12)return void this.$message.error("当前设置 TOKEN 太短,请重新填写");const e=this.$message.loading("TOKEN 上传设置中...",0);this.$axios.put("/config",{type:"wbrtoken",data:this.wbrtoken}).then((e=>{0===e.data.rescode?(e.data.resdata&&this.userid!==e.data.resdata.userid&&(this.userid=e.data.resdata.userid,this.$uApi.store.set("userid",this.userid)),this.$message.success("设置成功",e.data.message)):this.$message.error("WEBHOOK TOKEN 修改失败",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},wbrscriptSave(){if(this.wbrscript.enable&&!this.wbrscript.target)return void this.$message.error("请先设置 WEBHOOK SCRIPT 处理脚本");const e=this.$message.loading("WEBHOOK SCRIPT 设置中...",0);this.$axios.put("/config",{type:"wbrscript",data:this.wbrscript}).then((e=>{0===e.data.rescode?this.$message.success("设置成功",e.data.message):this.$message.error("WEBHOOK SCRIPT 设置失败",e.data.message)})).catch((e=>{this.$message.error("WEBHOOK SCRIPT 设置失败",e.message),console.error("WEBHOOK SCRIPT 设置",e)})).finally(e)},mergeSave(){const e=this.$message.loading("默认通知设置中...",0);this.$axios.put("/feed",{type:"merge",data:{rssenable:this.CONFIG_FEED.rss.enable,merge:this.CONFIG_FEED.merge}}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},runjsSave(){const e=this.$message.loading("脚本运行相关设置保存中...",0);this.$axios.put("/config",{type:"runjs",data:this.CONFIG_RUNJS}).then((e=>{0===e.data.rescode?this.$message.success("脚本运行相关设置保存成功",e.data.message):(this.$message.error("脚本运行相关设置保存失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("脚本运行相关设置保存失败",e.message),console.log(e)})).finally(e)},initSave(){const e=this.$message.loading("启动时 相关设置保存中...",0);this.$axios.put("/config",{type:"init",data:{CONFIG_init:this.CONFIG_init}}).then((e=>{0===e.data.rescode?this.$message.success("启动时相关设置保存成功",e.data.message):this.$message.error("启动时相关设置修改失败")})).catch((e=>{this.$message.error("启动时相关设置保存失败",e.message),console.log(e)})).finally(e)},anyproxySave(){if(this.anyproxy.port&&this.anyproxy.webPort){if(this.anyproxy.enable||confirm("确定在下次启动 elecV2P 时不打开 ANYPROXY 吗?")){const e=this.$message.loading("ANYPROXY 相关设置保存中...",0);this.$axios.put("/config",{type:"anyproxy",data:this.anyproxy}).then((e=>{0===e.data.rescode?this.$message.success("ANYPROXY 设置保存成功"):(this.$message.error("ANYPROXY 设置修改失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)}}else this.$message.error("请正确填写端口相关数据")},webUIPortSave(){if(confirm("确定将 webUI 主界面端口更改为: "+this.webUI.port+" 吗?(下次启动时应用)")){const e=this.$message.loading("webUI 主界面端口修改保存中...",0);this.$axios.put("/config",{type:"webUIPort",data:this.webUI}).then((e=>{0===e.data.rescode?this.$message.success("webUI 端口设置保存成功"):(this.$message.error("webUI 端口设置修改失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("webUI 端口设置失败",e.message),console.log(e)})).finally(e)}},pathSave(){const e=this.$message.loading("用户数据保存目录设置中...",0),{lists:t,script:s,store:i,shell:n}=this.CONFIG_Path;this.$axios.put("/config",{type:"datapath",data:{lists:t,script:s,store:i,shell:n}}).then((e=>{0===e.data.rescode?this.$message.success("用户数据保存目录设置成功 重启后正式生效"):this.$message.error("用户数据保存目录设置失败",e.data.message)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log(e)})).finally(e)},saveAll(){const e=this.$message.loading("配置数据上传中...",0);this.$axios.put("/config",{type:"config",data:{homepage:this.homepage,lang:this.lang,gloglevel:this.gloglevel,glogslicebegin:this.glogslicebegin,CONFIG_FEED:this.CONFIG_FEED,CONFIG_RUNJS:this.CONFIG_RUNJS,CONFIG_Axios:this.CONFIG_Axios,wbrtoken:this.wbrtoken,webhook:{script:this.wbrscript},path_lists:this.CONFIG_Path.lists,path_script:this.CONFIG_Path.script,path_store:this.CONFIG_Path.store,path_shell:this.CONFIG_Path.shell,webUI:this.webUI,SECURITY:this.CONFIG_SECURITY,init:this.CONFIG_init}}).then((e=>{this.$message.success(`当前设置保存成功\n${e.data.message}`)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log("设置保存失败",e)})).finally(e)},configExport(){this.$uApi.downloadFile("/config?token="+this.wbrtoken,"config.json")},async configImport(){if(!confirm("导入配置文件将会覆盖当前所有设置,并在重启后正式生效\n确认继续?"))return;let e=await this.$uApi.getFile({accept:".json"});if(e){if(e.content=this.$uStr.sJson(e.content),!e.content)return void this.$message.error("当前导入文件并不是正确的 JSON 格式");this.$axios.post("/config",{file:e}).then((e=>{0===e.data.rescode?this.$message.success("配置文件导入成功,将在重启后正式生效",e.data.message):this.$message.error("配置文件导入失败",e.data.message),console.debug("配置文件导入结果",e.data)})).catch((e=>{this.$message.error("配置文件导入失败",e.message),console.error("配置文件导入失败",e)}))}else this.$message.error("请选择正确的配置文件进行导入")},setLanguage(){const e=cr(this.lang);return this.$forceUpdate(),e},langSave(){if(this.lang===rr.locale)return void this.$message.success(`当前语言偏好为 ${this.lang} 未做修改`);const e=this.$message.loading("语言偏好设置保存中...",0);this.$axios.put("/config",{type:"lang",data:this.lang}).then((e=>{if(0===e.data.rescode){let e=this.setLanguage();this.$message.success("成功设置当前语言偏好为",e)}else this.$message.error("语言偏好修改失败",e.data.message)})).catch((e=>{this.$message.error("语言偏好设置失败",e.message),console.log("语言偏好设置失败",e)})).finally(e)},evRestart(){confirm("即将尝试重启 elecV2P,请提前保存好规则及任务列表,确定继续?")&&this.$axios.post("/webhook",{token:this.wbrtoken,type:"shell",command:"pm2 restart elecV2P"}).then((e=>{this.$message.error("重启失败",e.data.message)})).catch((e=>{this.$message.success("重启命令已发送,将在 5 秒后自动刷新该页面"),setTimeout((()=>location.reload()),5e3)}))},evStop(){confirm("关闭 elecV2P 后,当前网页、定时任务以及 ANYPROXY 都将不可用,确定继续?")&&this.$axios.post("/webhook",{token:this.wbrtoken,type:"shell",command:"pm2 stop elecV2P"}).then((e=>{this.$message.error("关闭失败",e.data.message)})).catch((e=>{this.$message.success("关闭命令已发送,即将自动跳转到首页"),setTimeout((()=>location.reload()),5e3)}))},updateCheck(){if(this.newversion)return void this.$message.success("检测到新版本 v"+this.newversion+"\n请手动运行 softupdate.js 或者使用 docker 命令进行更新\n(等 softupdate.js 稳定后将会集成到这里实现自动更新)");const e=this.$message.loading("正在检测 elecV2P 是否有新的版本可供更新...",0);this.$axios.get("/data?type=update&force=true").then((e=>{e.data.updateversion?(this.$message.success("检测到新版本 elecV2P v"+e.data.updateversion+"\n请手动运行 softupdate.js 或者使用 docker 命令进行更新\n(等 softupdate.js 稳定后将会集成到这部分以实现自动更新)"),this.newversion=e.data.updateversion):this.$message.success(e.data.message+"\n当前 elecV2P v"+e.data.version+" 已是最新版本")})).catch((e=>{this.$message.error("检测更新失败",e.message),console.error("检测更新失败",e)})).finally(e)}}};const $o=ka(yo,Nr,[function(){var e=this,t=e._self._c;return t("label",{staticClass:"setting_label"},[t("a",{staticClass:"cursor--help",attrs:{href:"https://help.ifttt.com/hc/en-us/articles/115010230347-Webhooks-service-FAQ",target:"_blank"}},[e._v("IFTTT")]),e._v(" KEY:")])},function(){var e=this,t=e._self._c;return t("label",{staticClass:"setting_label"},[t("a",{staticClass:"cursor--help",attrs:{href:"https://github.com/Finb/Bark",target:"_blank"}},[e._v("BARK")]),e._v(" KEY:")])},function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("关于配置文件的完整说明,参考文档: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/blob/master/docs/10-config.md",target:"elecV2PDoc"}},[e._v("10-config.md")])]),e._v(" "),t("li",[e._v("通知及脚本运行和网络请求相关设置对使用 nodejs 模式运行的脚本无效")]),e._v(" "),t("li",[e._v("除了初始化相关设置之外,其他设置保存后立即生效。CTRL+S 快捷保存")]),e._v(" "),t("li",[e._v("关于通知类相关设置参考: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md",target:"elecV2PDoc"}},[e._v("07-feed.md")]),e._v("。 其他参考: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs",target:"elecV2PDoc"}},[e._v("全部说明文档")]),e._v(" 相关项")])])])}],!1,null,"b5ef0062",null).exports;var wo=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.taskSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("timed","task")))]),e._v(" "),t("main",{staticClass:"content",on:{click:function(t){e.menu={}},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(e.menu={},void(e.taskChecked="none")))}}},[t("contextmenu",{attrs:{menus:e.menu.list,pos:e.menu.pos}}),e._v(" "),t("movegroup",{attrs:{show:e.show,gpoptions:e.gnamelist},on:{choose:function(t){return e.taskMoveToGroup(t)}}}),e._v(" "),t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable"},[t("caption",{staticClass:"elecTable_caption"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"elecTable_input elecTable_input--caption",class:{eopacity:e.search},attrs:{placeholder:e.$ta("search","task"),title:"输入名称/时间/任务内容中的关键字进行过滤显示"},domProps:{value:e.search},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.search=""))},input:function(t){t.target.composing||(e.search=t.target.value)}}}),e._v(" "),t("span",[e._v(e._s(e.$ta("task","list"))+" - "+e._s(e.taskstatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前任务列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.taskInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:e.$ta("checkall","/","checknone")}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.taskCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("name")))]),e._v(" "),t("th",{staticClass:"elecTable_th task_time",attrs:{colspan:"2"}},[e._v(e._s(e.$t("time")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw600",attrs:{colspan:"2",title:"enter: 开始定时任务\nctrl+enter: 测试运行任务\nalt +enter: 查看任务日志"}},[e._v(e._s(e.$t("task")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62",attrs:{title:e.$t("status")}},[e._v(e._s(e.$t("status_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_cell100",attrs:{colspan:"2",title:e.$t("operate")}},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),e._l(e.grouplist,(function(s,i){return t("tbody",{key:i,class:{elecTable_group:"normal"!==i,"elecTable_group--bottom":"normal"!==i},style:{background:e.tasklists[i]&&e.tasklists[i].bkcolor},attrs:{tabindex:"-1"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.taskLog(t)):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?(t.preventDefault(),t.shiftKey||t.altKey||t.metaKey?null:e.taskTest(t)):null}],keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.taskStartDelegate(t))}}},["normal"!==i?t("tr",[t("td",{staticClass:"elecTable_td"},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.taskGroupCheck(i,t)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.tasklists[i].name,expression:"tasklists[gid].name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"id: "+i},domProps:{value:e.tasklists[i].name},on:{input:function(t){t.target.composing||e.$set(e.tasklists[i],"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"5"}},[t("div",{staticClass:"eflex w100"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.tasklists[i].note,expression:"tasklists[gid].note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"分组备注说明(可省略"},domProps:{value:e.tasklists[i].note},on:{input:function(t){t.target.composing||e.$set(e.tasklists[i],"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.tasklists[i].bkcolor,expression:"tasklists[gid].bkcolor",modifiers:{trim:!0,lazy:!0}}],staticClass:"elecTable_input elecTable_cell100 elecBtn--mleft",attrs:{placeholder:"背景色",title:"当前分组背景颜色/图片"},domProps:{value:e.tasklists[i].bkcolor},on:{change:function(t){e.$set(e.tasklists[i],"bkcolor",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"elecBtn elecBtn--mleft elecBtn--uncheck"},[e._v(e._s(e.tasklists[i].active)+"/"+e._s(e.tasklists[i].total))])])]),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100",attrs:{colspan:"2"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.tasklists[i].collapse,expression:"tasklists[gid].collapse"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.downcircle)},on:{click:function(t){return e.taskGroupOp(i)}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.tasklists[i].collapse,expression:"!tasklists[gid].collapse"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.upcircle)},on:{click:function(t){return e.taskGroupOp(i)}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.taskGroupDelete(i)}}})])]):e._e(),e._v(" "),e._l(s,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.running,"elecTable_tr--selected":e.taskChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.taskChecklist,expression:"taskChecklist"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.taskChecklist)?e._i(e.taskChecklist,i)>-1:e.taskChecklist},on:{change:function(t){var s=e.taskChecklist,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.taskChecklist=s.concat([r])):o>-1&&(e.taskChecklist=s.slice(0,o).concat(s.slice(o+1)))}else e.taskChecklist=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"titem.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i,placeholder:"id: "+s.id},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.type,expression:"titem.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"type",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.time,expression:"titem.time",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i},domProps:{value:s.time},on:{input:function(t){t.target.composing||e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td task_select"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:[function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])},function(e){"exec"===s.job.type&&(s.job.target="node -v")}]}},e._l(e.jobtype_select,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[/^task/.test(s.job.type)?t("select",{directives:[{name:"model",rawName:"v-model.trim",value:s.job.target,expression:"titem.job.target",modifiers:{trim:!0}}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"target",t.target.multiple?i:i[0])}}},e._l(e.normlist,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s.name))])})),0):t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.job.target,expression:"titem.job.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i},domProps:{value:s.job.target},on:{input:function(t){t.target.composing||e.$set(s.job,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.taskMenu(t,i)},contextmenu:function(t){return t.preventDefault(),t.stopPropagation(),e.taskMenu(t,i)}}},[t("span",{directives:[{name:"show",rawName:"v-show",value:s.running,expression:"titem.running"}],staticClass:"icon--op icon--run",domProps:{innerHTML:e._s(e.icon.sync)}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!s.running,expression:"!titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.pause)}})]),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100",attrs:{colspan:"2"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:s.running,expression:"titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.pause)},on:{click:function(t){return e.taskStop(i)}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!s.running,expression:"!titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.play)},on:{click:function(t){return e.taskStart(i)}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.taskDelete(i)}}})])])}))],2)})),e._v(" "),t("tbody",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"9"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.taskNew()}}},[e._v(e._s(e.$ta("new","timed","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.subNew()}}},[e._v(e._s(e.$ta("add","task","sub")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn folderbk",on:{click:function(t){return e.taskImport()}}},[e._v(e._s(e.$ta("import","local","sub")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",class:{"elecTable_addbtn--selected":1===e.subeishow},on:{click:function(t){return e.taskExport()}}},[e._v(e._s(e.$t("export"))+e._s(e.taskChecklist.length?e.$ta("","checked","task"):e.$ta("","task","list")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{title:"更新会覆盖本地同名文件"},on:{click:function(t){return e.jsUpdate()}}},[e._v(e._s(e.$ta("update","remote","script")))])])]),e._v(" "),t("tr",{directives:[{name:"show",rawName:"v-show",value:e.taskChecklist.length,expression:"taskChecklist.length"}]},[t("td",{staticClass:"center",attrs:{colspan:"9"}},[t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--check",on:{click:function(t){e.show.groupchoose=!0}}},[e._v(e._s(e.$ta("moveto","agroup")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--uncheck",on:{click:function(t){return e.taskCkall(t)}}},[e._v(e._s(e.$ta("cancel","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn greenbk",on:{click:function(t){return e.taskStart(e.taskChecklist)}}},[e._v(e._s(e.$ta("start","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--stop",on:{click:function(t){return e.taskStop(e.taskChecklist)}}},[e._v(e._s(e.$ta("stop","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.taskDelete(e.taskChecklist)}}},[e._v(e._s(e.$ta("delete","checked","task"))+" "+e._s(e.taskChecklist.length))])])])]),e._v(" "),t("tbody",e._l(e.sublist,(function(s,i,n){return t("tr",{key:i,class:{"elecTable_tr--selected":e.subimport.tid===i}},[t("td",{staticClass:"elecTable_td"},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.tasksubCheck(i,t)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.name,expression:"titem.name"}],staticClass:"elecTable_input",attrs:{placeholder:"订阅名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:"none"!==s.update_type},attrs:{title:"自动更新订阅任务"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.update_type,expression:"titem.update_type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"update_type",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"none"}},[e._v(e._s(e.type_of_time.noupdate))]),e._v(" "),t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:"none"!==s.update_type}},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.time,expression:"titem.time",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i,placeholder:"自动更新时间"},domProps:{value:s.time},on:{input:function(t){t.target.composing||e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{title:"同名任务更新方式"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])}}},e._l(e.subselect,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.job.target,expression:"titem.job.target"}],staticClass:"elecTable_input",attrs:{placeholder:"订阅链接,不兼容其他软件的订阅格式。请勿添加不信任的来源链接"},domProps:{value:s.job.target},on:{input:function(t){t.target.composing||e.$set(s.job,"target",t.target.value)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"2"}},[t("button",{staticClass:"elecBtn",on:{click:function(t){return e.subGet(s.job.target,i)}}},[e._v(e._s(e.$t("fetch")))])]),e._v(" "),t("td",{staticClass:"elecTable_td minw62"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.subDelete(i)}}})])])})),0),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:1===e.subeishow,expression:"subeishow === 1"}],staticClass:"border_top"},[t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"6"}},[t("div",{staticClass:"subdetail_head"},[t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexport.name,expression:"subexport.name",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_name",attrs:{placeholder:"elecV2P 定时任务订阅"},domProps:{value:e.subexport.name},on:{change:function(t){e.$set(e.subexport,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","note"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexport.note,expression:"subexport.note",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_note",attrs:{placeholder:"这是一个适用于 elecV2P 的定时任务订阅。请不要添加未知来源的订阅"},domProps:{value:e.subexport.note},on:{change:function(t){e.$set(e.subexport,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"3"}},[t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.taskExportDownload()}}},[e._v(e._s(e.$t("exportsub")))])])]),e._v(" "),t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"9"}},[t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexportstr,expression:"subexportstr",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea subdetail_content",attrs:{placeholder:'订阅内容格式如下: \n{\n name: "订阅名称",\n note: "订阅描述,可省略。不兼容其他软件的订阅格式。详细说明参考: https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",\n list: [\n {\n "name": "清空日志",\n "type": "cron",\n "time": "30 59 23 * * *",\n "job": {\n "type": "runjs",\n "target": "https://raw.githubusercontent.com/elecV2/elecV2P/master/script/JSFile/deletelog.js"\n }\n }\n ]\n}'},domProps:{value:e.subexportstr},on:{change:function(t){e.subexportstr=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}})])])]),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:2===e.subeishow,expression:"subeishow === 2"}],staticClass:"border_top"},[t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"6"}},[t("div",{staticClass:"subdetail_head"},[t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.subimport.name,expression:"subimport.name",modifiers:{trim:!0}}],staticClass:"elecTable_input subdetail_name",attrs:{placeholder:"elecV2P 定时任务订阅"},domProps:{value:e.subimport.name},on:{input:function(t){t.target.composing||e.$set(e.subimport,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","note"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subimport.note,expression:"subimport.note",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_note",attrs:{placeholder:"elecV2P 定时任务订阅。请不要添加未知来源的订阅"},domProps:{value:e.subimport.note},on:{change:function(t){e.$set(e.subimport,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"2",title:"绿色背景: 任务添加时即开始定时"}},[t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.subAll()}}},[e._v(e._s(e.tasksubChecklist.length?e.$ta("add","checked_short"):e.$ta("add","all")))])]),e._v(" "),t("td",{staticClass:"elecTable_td minw62"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.subClear()}}})])]),e._v(" "),e._l(e.subimport.list,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--selected":-1!==e.tasksubChecklist.indexOf(i)}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.tasksubChecklist,expression:"tasksubChecklist"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.tasksubChecklist)?e._i(e.tasksubChecklist,i)>-1:e.tasksubChecklist},on:{change:function(t){var s=e.tasksubChecklist,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.tasksubChecklist=s.concat([r])):o>-1&&(e.tasksubChecklist=s.slice(0,o).concat(s.slice(o+1)))}else e.tasksubChecklist=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.name,expression:"titem.name",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.name},on:{change:function(t){e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.type,expression:"titem.type"}],staticClass:"elecTable_select",on:{change:[function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"type",t.target.multiple?i:i[0])},function(e){s.time="cron"===s.type?"30 10 0 * * *":"schedule"===s.type?"3 2 3 2":""}]}},[t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.time,expression:"titem.time",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.time},on:{change:function(t){e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td task_select"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])}}},e._l(e.jobtype_select,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.job.target,expression:"titem.job.target",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.job.target},on:{change:function(t){e.$set(s.job,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:!1!==s.running},attrs:{colspan:"3"}},[t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),e.subTaskAdd(s)}}},[e._v(e._s(e.$t("add","task")))])])])})),e._v(" "),t("tr",{directives:[{name:"show",rawName:"v-show",value:e.subimport.author||e.subimport.date||e.subimport.resource,expression:"(subimport.author || subimport.date || subimport.resource)"}]},[t("td",{staticClass:"elecTable_td elecTable_td--subinfo",attrs:{colspan:"9"}},[t("span",{},[e._v(e._s(e.subimport.author?e.$t("author")+": "+e.subimport.author:""))]),e._v(" "),t("span",{staticClass:"mleft30"},[e._v(e._s(e.subimport.date?e.$ta("update","date")+": "+e.subimport.date:""))]),e._v(" "),t("span",{staticClass:"mleft30"},[e._v(e._s(e.subimport.resource?e.$ta("update","address")+": "+e.subimport.resource:""))])])])],2)],2)]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long elecBtn--tasksave",on:{click:function(t){return e.taskSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("log",{attrs:{logs:e.logs,title:e.tasklogs,collapse:e.collapse}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("ul",[t("li",[t("strong",[e._v(e._s(e.type_of_time.cron))]),e._v(" "+e._s(e.$t("format").toLowerCase())+": (*) * * * * *("+e._s(e.$ta("five","or","six","cron","format").toLowerCase())+")")]),e._v(" "),t("li",[t("strong",[e._v(e._s(e.type_of_time.schedule))]),e._v(" "+e._s(e.$t("format").toLowerCase())+": 30 999 3 2("+e._s(e.$ta("countdown","seconds","/","repeat","times","/","random","seconds","/","random","times"))+")"),t("i",[e._v(e._s(e.$ta("last_three","optional")))])]),e._v(" "),t("li",[e._v(e._s(e.$ta("task","input","shortcut"))+": enter - "+e._s(e.$ta("start","task"))+" ctrl+enter - "+e._s(e.$ta("test","run","task"))+" alt+enter - "+e._s(e.$ta("open","task","run","logs")))]),e._v(" "),t("li",[e._v(e._s(e.$ta("more","detail"))+" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",target:"elecV2PDoc"}},[e._v(e._s(e.$t("document"))+": 06-task.md")])])])])])};wo._withStripped=!0;var ko=function(){var e=this,t=e._self._c;return e.show.groupchoose?t("VueDragResize",{attrs:{className:"ediv",dragHandle:".ediv_title--name",parent:!0,"prevent-deactivation":!1,active:!0,w:"480",h:"92",z:"9",resizable:!1,draggable:!0,handles:["tl","tr","bl","br"],"lock-aspect-ratio":!1}},[t("h3",{staticClass:"ediv_title"},[t("span",{staticClass:"ediv_title--name"},[e._v("请选择分组")]),e._v(" "),t("span",{staticClass:"ediv_title--close",on:{click:function(t){e.show.groupchoose=!e.show.groupchoose}}},[e._v("x")])]),e._v(" "),t("div",{staticClass:"ediv_content"},[t("div",{staticClass:"mgselect"},[t("label",{staticClass:"elecTable_label mgselect_label"},[e._v("移动到此分组: ")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.choose,expression:"choose"}],staticClass:"elecTable_select mgselect_choose",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.choose=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"new"}},[e._v("新的分组")]),e._v(" "),t("option",{attrs:{value:"none"}},[e._v("不属于任何分组")]),e._v(" "),e._l(e.gpoptions,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])}))],2),e._v(" "),t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.groupChoose()}}},[e._v("确定")])])])]):e._e()};ko._withStripped=!0;var Co=s(432),xo=s.n(Co);const To=ka({name:"movegroup",props:["show","gpoptions"],components:{VueDragResize:xo()},data:()=>({choose:"new"}),methods:{groupChoose(){this.$emit("choose",this.choose)}}},ko,[],!1,null,"05f31d25",null).exports,So={name:"task",data(){return{tasklists:{},subexport:{},subimport:{},taskimorn:!1,taskimtid:"",subeishow:0,taskstatus:"",jobtype_select:{runjs:this.$t("run")+" JS",exec:"SHELL "+this.$t("cmd"),taskstart:this.$ta("start","task"),taskstop:this.$ta("stop","","task")},subselect:{skip:this.$t("skip"),replace:this.$t("replace"),addition:this.$t("addition")},type_of_time:{cron:this.$t("cron"),schedule:this.$t("countdown"),noupdate:this.$t("noupdate")},logs:[],icon:wa,taskChecklist:[],tasksubChecklist:[],menu:{pos:[0,0],list:[]},show:{groupchoose:!1},search:"",collapse:{loginfo:!0},tasklogs:this.$ta("task","run","logs")}},components:{log:tr,contextmenu:Or,movegroup:To},computed:{normlist(){let e={};for(let t in this.tasklists)if(this.tasklists[t])switch(this.tasklists[t].type){case"cron":case"schedule":e[t]=this.tasklists[t]}return e},tnamelist(){let e={};for(let t in this.normlist)e[this.normlist[t].name]=t;return e},gnamelist(){let e={};for(let t in this.tasklists)"group"===this.tasklists[t].type&&(e[t]=this.tasklists[t].name);return e},sublist(){let e={};for(let t in this.tasklists)"sub"===this.tasklists[t].type&&(e[t]=this.tasklists[t]);return e},searchlist(){if(!this.search)return this.tasklists;let e={},t=new RegExp(this.search);for(let s in this.normlist)t.test(this.normlist[s].name+this.normlist[s].time+this.normlist[s].job.target)&&(e[s]=this.normlist[s]);return e},grouplist(){let e={},t={},s={running:0,total:0,sub:Object.keys(this.sublist).length};for(let i in this.searchlist){if("sub"===this.searchlist[i].type){this.searchlist[i].update_type||(this.searchlist[i].update_type="none");continue}if("group"===this.searchlist[i].type){e[i]||(e[i]={},this.searchlist[i].total=0,this.searchlist[i].active=0,this.searchlist[i].bkcolor||(this.searchlist[i].bkcolor=this.$uStr.randomColor({max:200})),void 0===this.searchlist[i].collapse&&(this.searchlist[i].collapse=!1));continue}s.total++,this.searchlist[i].running&&s.running++;let n=this.searchlist[i].group;n&&this.searchlist[n]&&"group"===this.searchlist[n].type?(e[n]||(e[n]={},this.searchlist[n].total=0,this.searchlist[n].active=0,this.searchlist[n].bkcolor||(this.searchlist[n].bkcolor=this.$uStr.randomColor({max:200})),void 0===this.searchlist[n].collapse&&(this.searchlist[n].collapse=!1)),this.searchlist[n].collapse||(e[n][i]=this.searchlist[i]),this.searchlist[n].total++,this.searchlist[i].running&&this.searchlist[n].active++):t[i]=this.searchlist[i]}return this.taskstatus=s.running+"/"+s.total+"/"+s.sub,e.normal=t,e},subexportstr:{get(){return JSON.stringify(this.subexport,null,2)},set(e){let t=this.$sJson(e);t?Object.assign(this.subexport,t):this.$message.error("订阅内容格式不正确, 已自动退回到修改前内容",10)}},taskChecked:{get(){let e=[];return this.taskChecklist.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.taskChecklist=Object.keys(this.search?this.searchlist:this.normlist):"none"===e?this.taskChecklist=[]:this.normlist[e]&&-1===this.taskChecklist.indexOf(e)&&this.taskChecklist.push(e)}}},watch:{taskimorn(e){!1===e?this.$delete(this.tasklists,"localtemp"):this.taskimtid=Object.keys(this.sublist)[0]}},created(){this.taskInit();let e=this.$wsrecv.add("tasklog",(e=>{this.logs.length>=200||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)}));e&&this.logs.unshift(`[${this.$logHead("websocket error")}][${this.$sTime(null,1)}] ${e}, 日志无法传输`),this.$wsrecv.add("task",(e=>{if("init"!==e.op)if(this.tasklists[e.tid])switch(e.op){case"start":this.$set(this.tasklists[e.tid],"running",!0);break;case"stop":this.$set(this.tasklists[e.tid],"running",!1);break;default:console.error("unknow task operation")}else e.tid&&e.taskinfo&&this.taskCheck(e.taskinfo)?this.tasklists[e.tid]=e.taskinfo:console.error("任务暂不存在",e);else this.taskInit()}))},methods:{taskInit(){const e=this.$message.loading("获取任务列表中...",0);this.$axios.get("/task").then((e=>{if(-1===e.data.rescode)return this.$message.error("获取任务列表失败",e.data.message),void this.logs.unshift(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}] 获取任务列表失败: ${e.data.message}`);this.tasklists=e.data||{},this.subexport={},this.subimport={},this.subeishow=0,console.debug(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}]`,"当前 elecV2P 任务分组数",Object.keys(this.grouplist).length-1),this.$message.success("成功获取任务列表",this.taskstatus),this.logs.unshift(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}] 成功获取任务列表: ${this.taskstatus}`)})).catch((e=>{this.$message.error("获取任务列表失败",e.message),this.logs.unshift(`[${this.$logHead("taskInit error")}][${this.$sTime(null,1)}] 获取任务列表失败: ${e.message}`),console.error("获取任务列表失败",e)})).finally(e)},taskNewId(e=8){let t=this.$uStr.euid(e);return this.tasklists[t]?this.taskNewId():t},taskNew(e=this.taskNewId()){let t={},s={};Math.random()>.6?(t.type="schedule",t.time="3 2 2"):(t.type="cron",t.time="20 10 0 * * *"),Math.random()<.5?(s.type="runjs",s.target="test.js"):(s.type="exec",s.target="node -v"),this.$set(this.tasklists,e,{id:e,name:this.$ta("new","task")+(Object.keys(this.normlist).length+1),type:t.type,time:t.time,job:s,running:!1})},taskCheck(e){if(!e)return this.$message.error("请输入任务内容"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] 没有任何任务信息`),!1;if(!e.name)return this.$message.error("请输入任务名"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] 没有任务名称`),!1;if(!/schedule|cron/.test(e.type))return this.$message.error("非法任务类型",e.type),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 任务类型 ${e.type} 有误`),!1;let t=e.time.split(" ");return"cron"===e.type&&5!==t.length&&6!==t.length?(this.$message.error(e.time,"不符合 cron 时间格式标准"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 时间: ${e.time} 不符合 cron 时间格式标准`),!1):"schedule"===e.type&&t.filter((e=>/^\d+$/.test(e))).length!==t.length?(this.$message.error(e.time,"不符合",this.type_of_time.schedule,"时间格式标准"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 时间: ${e.time} 不符合 ${this.type_of_time.schedule} 时间格式标准`),!1):!!(e.job&&e.job.type&&e.job.target)||(this.$message.error("任务内容填写不完整"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 任务内容填写不完整`),!1)},taskStart(e){let t,s="array"===this.$sType(e);if(s)t=[],e.forEach((e=>{this.taskCheck(this.tasklists[e])&&(this.tasklists[e].id=e,this.tasklists[e].running=!0,t.push(this.tasklists[e]))}));else{if(!this.taskCheck(this.tasklists[e]))return;if(this.tasklists[e].running)return void this.$message.error(this.tasklists[e].name,"正在运行中");this.tasklists[e].id=e,this.tasklists[e].running=!0,t=this.tasklists[e]}let i=!1;const n=this.$message.loading("任务上传准备执行中...",0);this.$axios.put("/task",{op:"start",data:{task:t}}).then((e=>{0===e.data.rescode?this.$message.success("定时任务已开始"):i=e.data.message})).catch((e=>{console.error(e),i=e.message})).finally((()=>{n(),i&&(s||(this.tasklists[e].running=!1),this.$message.error("开始任务失败"),this.logs.unshift(`[${this.$logHead("taskStart error")}][${this.$sTime(null,1)}] 开始任务执行失败: ${i}`))}))},taskStop(e){let t="array"===this.$sType(e);if(!t){if(!1===this.tasklists[e].running)return void this.$message.success(this.tasklists[e].name,"已停止,无需任何操作");this.tasklists[e].running=!1}let s=!1;const i=this.$message.loading("任务停止命令执行中...",0);this.$axios.put("/task",{op:"stop",data:{tid:e}}).then((e=>{0===e.data.rescode?this.$message.success("相关定时任务已停止"):s=e.data.message})).catch((e=>{s=e.message,console.error(e)})).finally((()=>{i(),s&&(t||(this.tasklists[e].running=!0),this.$message.error("停止任务失败"),this.logs.unshift(`[${this.$logHead("taskStop error")}][${this.$sTime(null,1)}] 停止任务失败: ${s}`))}))},taskDelete(e){if("array"===this.$sType(e)){if(confirm(`确定删除这 ${e.length} 个定时任务?`)){const t=this.$message.loading("定时任务批量删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{0===t.data.rescode?(this.$message.success("定时任务批量删除完成"),e.forEach((e=>this.$delete(this.tasklists,e))),this.logs.unshift(`[${this.$logHead("taskDelete info")}][${this.$sTime(null,1)}] 定时任务批量删除完成`),this.taskChecked="none"):(this.$message.error("定时任务批量删除失败"),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 定时任务批量删除失败 ${t.data.message}`))})).catch((e=>{this.$message.error("定时任务批量删除失败",e.message),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 定时任务批量删除: ${e.message}`),console.error(e)})).finally(t)}}else if(confirm(`确定删除任务 ${this.tasklists[e].name}?`)){const t=this.$message.loading("定时任务",this.tasklists[e].name,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{0===t.data.rescode?(this.$message.success("成功删除任务:",this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskDelete info")}][${this.$sTime(null,1)}] 成功删除任务: ${this.tasklists[e].name}`),this.$delete(this.tasklists,e)):(this.$message.error("任务:",this.tasklists[e].name,"删除失败"),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 任务: ${this.tasklists[e].name} 删除失败 ${t.data.message}`))})).catch((e=>{this.$message.error("删除任务失败",e.message),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 删除任务失败: ${e.message}`),console.error(e)})).finally(t)}},taskSave(){this.search="";const e=this.$message.loading("正在保存当前任务列表...",0);this.$axios.post("/task",this.tasklists).then((e=>{-1===e.data.rescode?(this.$message.error("当前任务列表保存失败"),this.logs.unshift(`[${this.$logHead("taskSave error")}][${this.$sTime(null,1)}] 当前任务列表保存失败:${e.data.message}`)):(this.$message.success("当前任务列表已保存",this.taskstatus),this.logs.unshift(`[${this.$logHead("taskSave info")}][${this.$sTime(null,1)}] 当前任务列表已保存 ${this.taskstatus},将在 elecV2P 下次启动时自动恢复`))})).catch((e=>{console.error(e),this.$message.error("当前任务列表保存失败",e.message),this.logs.unshift(`[${this.$logHead("taskSave error")}][${this.$sTime(null,1)}] 当前任务列表保存失败:${e.message}`)})).finally(e)},taskStartDelegate(e){let t=e.target.dataset.tid;t&&this.taskStart(t)},taskTest(e){let t=e.target?e.target.dataset.tid:e;if(!t)return;if(!this.taskCheck(this.tasklists[t]))return;let s=this.tasklists[t].running;this.tasklists[t].running=!0;const i=this.$message.loading("任务测试运行中...",0);this.logs.unshift(`[${this.$logHead("taskStart info")}][${this.$sTime(null,1)}] 立即测试运行定时任务: ${this.tasklists[t].name}`),this.collapse.loginfo=!1,this.$axios.put("/task",{op:"test",data:{tid:"totest",task:this.tasklists[t]}}).then((e=>{let s=this.$sString(e.data.message)||"无";this.$message.success(this.tasklists[t].name,"测试运行结果:",s),this.logs.unshift(`[${this.$logHead("taskTest info")}][${this.$sTime(null,1)}] ${this.tasklists[t].name} 测试运行结果: ${s}`)})).catch((e=>{console.error(e),this.$message.error(this.tasklists[t].name,"测试运行失败",e.message),this.logs.unshift(`[${this.$logHead("taskTest error")}][${this.$sTime(null,1)}] ${this.tasklists[t].name} 测试运行失败: ${e.message}`)})).finally((()=>{i(),this.tasklists[t].running=s}))},taskLog(e){let t=e.target?e.target.dataset.tid:e;t&&(this.tasklists[t]?"runjs"===this.tasklists[t].job.type?/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)?this.$uApi.open(`./logs/${this.$uStr.surlName(this.tasklists[t].job.target.split(" ")[0])}.log`):this.$uApi.open(`./logs/${this.tasklists[t].job.target.split(" ")[0].replace(/\/|\\/g,"-")}.log`):"exec"===this.tasklists[t].job.type?this.$uApi.open(`./logs/${this.tasklists[t].name}.task.log`):this.$message.error("该任务类型不支持查看日志"):this.$message.error("任务不存在"))},subNew(e=this.taskNewId()){this.$set(this.tasklists,e,{name:this.$ta("task","sub")+(Object.keys(this.sublist).length+1),type:"sub",update_type:"none",time:"26 5 * * *",job:{type:"skip",target:""}})},async subGet(e,t){if(!e||!/^https?:\/\/\S{4}|^\/?efss\//.test(e))return void this.$message.error("请输入正确的订阅地址",6);if(!/\.json$/.test(e)&&!confirm("该订阅内容可能并不是 JSON 格式,确认继续?"))return;let s=this.$message.loading("正在获取订阅信息...",0),i="";try{i=await this.$axios.get(e,{crossdomain:!0})}catch(t){if(this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 获取订阅信息失败 ${t.message}`),t.response)return s(),this.$message.error(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`),void console.debug(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`,t.response.data);if(/^https?:\/\/\S{4}/.test(e)){this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 即将尝试从服务器端获取该订阅内容`),this.$message.error("获取订阅信息失败",t.message,"即将尝试从服务器端获取该订阅内容");try{i=await this.$axios.get("/data?type=stream&url="+e)}catch(t){return s(),this.$message.error("获取订阅信息失败",t.message,"请检测网络后重试"),void this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 从 ${e} 获取订阅信息失败 ${t.message},请检测网络后重试`)}}}if(200!==i.status||-1===i.data.rescode)return s(),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 该订阅链接 ${e} 返回结果有误 ${this.$sString(i.data)} 请确认输入地址是否正确`),this.$message.error("该订阅返回状态不正确,请确认当前网络环境或输入地址是否正常"),void console.error(i);s();let n=this.$sJson(i.data);n&&n.name&&n.list?("localtemp"===t&&(t=this.taskNewId(),this.$set(this.tasklists,t,this.tasklists.localtemp)),n.tid=t,n.resource=n.resource||n.surl,n.note=n.note||n.desc,this.subimport=n,this.taskimorn=!1,this.subeishow=2,this.$message.success("成功获取订阅信息"),this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 成功获取订阅 ${n.name} 内容`),n.time&&!this.sublist[t].time&&(this.sublist[t].time=n.time,this.sublist[t].update_type=n.update_type||n.type||"none"),"定时任务订阅"===this.sublist[t].name&&(this.sublist[t].name=n.name)):(this.$message.error("该订阅内容无法解析"),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 该订阅 ${e} 内容并不符合 elecV2P 订阅格式,请确认订阅链接及内容无误后再次添加`))},subDelete(e){if(this.subimport.tid===e)return this.subeishow=0,void(this.subimport.tid=null);if(!this.tasklists[e].job.target||confirm("确定删除订阅:"+this.tasklists[e].name+" (并不会删除相关任务)")){const t=this.$message.loading(this.tasklists[e].name,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{this.$message.success("成功删除订阅:",this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 成功删除订阅: ${this.tasklists[e].name}`),this.$delete(this.tasklists,e)})).catch((e=>{console.error(e),this.$message.error("删除订阅失败",e.message),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 删除订阅失败 ${e.message}`)})).finally(t)}},subClear(){this.subeishow=0,this.subimport.tid=null,this.taskimorn&&(this.taskimorn=!1)},taskExport(){if(1===this.subeishow)return void(this.subeishow=0);let e={name:"elecV2P 定时任务订阅",author:"留个名字",note:"xx 导出的任务订阅。该订阅适用于 elecV2P,与其他软件并不兼容。相关说明参考:https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",date:this.$sTime(),type:"task",list:[]};if(this.taskChecklist.length)this.taskChecklist.forEach((t=>{this.normlist[t]&&this.normlist[t].name&&this.normlist[t].time&&this.normlist[t].job&&e.list.push({name:this.normlist[t].name,type:this.normlist[t].type,time:this.normlist[t].time,running:this.normlist[t].running,job:this.normlist[t].job})}));else for(let t in this.normlist)e.list.push({name:this.normlist[t].name,type:this.normlist[t].type,time:this.normlist[t].time,running:this.normlist[t].running,job:this.normlist[t].job});this.subimport={},this.subexport=e,this.subeishow=1,this.taskimorn=!1},taskExportDownload(){this.subexport.name&&this.subexport.list?(this.$uApi.saveAsFile(this.subexport,this.subexport.name+".json"),this.logs.unshift(`[${this.$logHead("taskExport info")}][${this.$sTime(null,1)}] 成功导出订阅:${this.subexport.name}`)):(this.$message.error("订阅信息不完整"),this.logs.unshift(`[${this.$logHead("taskExport error")}][${this.$sTime(null,1)}] 订阅导出失败,订阅信息填写不完整`))},taskImport(){this.$uApi.getFile({accept:".json",type:"text"}).then((e=>{let t=e.content,s=this.$sJson(t);s&&s.name&&s.list?(s.resource=s.resource||s.surl,s.note=s.note||s.desc,this.subimport=s,this.subimport.tid="local",this.subeishow=2,0===Object.keys(this.sublist).length&&this.subNew("localtemp"),this.logs.unshift(`[${this.$logHead("taskImport info")}][${this.$sTime(null,1)}] 成功获取本地订阅: ${s.name}`),this.taskimorn=!0,this.$message.success("成功获取本地订阅任务列表")):(console.error("elecV2P 无法解析该订阅内容",t),this.$message.error("该订阅内容无法解析"),this.logs.unshift(`[${this.$logHead("taskImport error")}][${this.$sTime(null,1)}] 导入的本地订阅内容并不符合 elecV2P 订阅格式,请尝试修改后再次添加\n${this.$sString(t).slice(-300)}`))})).catch((e=>{this.subimport={},console.debug(e)}))},async jsUpdate(){let e=[];if(this.taskChecklist.length)this.taskChecklist.forEach((t=>{this.tasklists[t]&&this.tasklists[t].job&&"runjs"===this.tasklists[t].job.type&&/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)&&e.push(this.tasklists[t].job.target.split(" ")[0])}));else for(let t in this.tasklists)this.tasklists[t]&&this.tasklists[t].job&&"runjs"===this.tasklists[t].job.type&&/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)&&e.push(this.tasklists[t].job.target.split(" ")[0]);if(e.length){if(confirm("共有 "+e.length+" 个远程脚本等待更新,确定继续?")){const t=this.$message.loading("正在更新远程 JS...",0);for(let t of e){this.logs.unshift(`[${this.$logHead("taskJSUP info")}][${this.$sTime(null,1)}] 开始更新下载 ${t}`);let e=await this.$axios.put("/jsfile",{op:"jsdownload",name:this.$uStr.surlName(t),url:t}).catch((e=>this.$message.error(e.message)));0===e.data.rescode?this.logs.unshift(`[${this.$logHead("taskJSUP info")}][${this.$sTime(null,1)}] 更新完成 ${e.data.message} `):this.logs.unshift(`[${this.$logHead("taskJSUP error")}][${this.$sTime(null,1)}] 更新失败 ${e.data.message} `)}t(),this.$message.success("全部远程脚本更新完成")}}else{const e=this.$ta("current","")+(this.taskChecklist.length?this.$ta("checked","task"):this.$ta("task","list"))+this.$ta("","dthave","remote","script");this.$message.error(e),this.logs.unshift(`[${this.$logHead("taskJSUP error")}][${this.$sTime(null,1)}] ${e}`)}},subTaskForm(e,{type:t="skip",belong:s}){if(!this.taskCheck(e))return!1;if(!e.id)if(this.tnamelist[e.name])if(this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 检测到同名任务: ${e.name},当前同名任务更新方式为: ${this.subselect[t]}`),"replace"===t)e.id=this.tnamelist[e.name];else{if("addition"!==t)return this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 跳过添加同名任务: ${e.name}`),!1;e.id=this.taskNewId()}else e.id=this.taskNewId();return!1!==e.running&&(e.running=!0),s&&"local"!==s&&(e.belong=s),e},subTaskAdd(e){let t=this.subimport.tid,s="";if("local"===t)s=this.sublist[this.taskimtid].job.type;else{if(!this.sublist[t]||!this.sublist[t].job)return Promise.reject("未知错误,订阅可能不存在");s=this.sublist[t].job.type}let i=[],n=e=>{let n=this.subTaskForm(e,{type:s,belong:t});n&&i.push(n)};if("array"===this.$sType(e)?e.forEach((e=>n(e))):n(e),0===i.length){let e="没有新的任务需要添加";return this.$message.success(e),this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] ${e}`),Promise.resolve(e)}let a=this.$message.loading("正在添加定时任务...",0);return new Promise(((e,t)=>{this.$axios.put("/task",{op:"add",data:{task:i,type:s}}).then((e=>{0===e.data.rescode?(this.$message.success("定时任务添加成功"),this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 定时任务添加完成`),JSON.parse(JSON.stringify(i)).forEach((e=>{this.$set(this.tasklists,e.id,e)}))):(this.$message.error("定时任务添加失败"),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 添加定时任务失败 ${e.data.message}`))})).catch((e=>{console.error(e),this.$message.error("定时任务添加失败",e.message),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 添加定时任务失败 ${e.message}`)})).finally((()=>{e(),a()}))}))},subAll(){if(this.subimport.list&&this.subimport.list.length){let e=[];this.tasksubChecklist.length?this.tasksubChecklist.forEach((t=>{e.push(this.subimport.list[t])})):e=this.subimport.list,this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 开始添加订阅 ${this.subimport.name} 中的任务`),this.subTaskAdd(e).catch((e=>this.$message.error(e))).finally((()=>{this.tasksubChecklist=[]}))}else this.$message.error("并没有可以导入的定时任务"),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 当前订阅列表为空`)},tasksubCheck(e,t){if(e&&t)if(t.target.checked){let t=JSON.parse(JSON.stringify(this.normlist)),s=!0;this.taskChecklist.forEach((e=>{t[e]=-1}));for(let i in t){t[i].belong===e&&(this.taskChecklist.push(i),s&&(s=!1))}s&&this.$message.success("列表中暂时还没有该订阅内的定时任务")}else this.taskChecklist=this.taskChecklist.filter((t=>this.tasklists[t]&&this.tasklists[t].belong!==e))},taskCkall(e){this.taskChecked=e.target.checked?"all":"none"},taskMenu(e,t){let s=[],i=this.taskTest,n=this.taskLog;if(s.push({label:"立即测试运行",bkcolor:"var(--icon-bk)",click(){i(t)}},{label:"查看任务日志",click(){n(t)}}),"runjs"===this.tasklists[t].job.type){let e=this.tasklists[t].job.target.split(" ")[0],i=this.$uApi.store.setCache;s.push({label:"查看脚本内容",method:"nav",param:"jsmanage",click(){i("scriptview",e)}})}this.menu={pos:this.$uApi.getCursorPos(e,160,32*s.length),list:s}},taskGroupCheck(e,t){if(e&&t)if(t.target.checked)for(let t in this.normlist)this.normlist[t].group===e&&(this.taskChecked=t);else this.taskChecklist=this.taskChecklist.filter((t=>this.normlist[t].group!==e))},taskGroupDelete(e){if(!this.tasklists[e])return void this.$message.error("分组",e,"暂不存在");let t=this.tasklists[e].name,s=Object.keys(this.grouplist[e]);if(0===s.length||confirm("确定删除分组 "+t+"(并不会删除该分组下的任务)?")){const i=this.$message.loading(t,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((i=>{this.$message.success("成功删除分组",t,""+(s.length?s.length+"个任务已移动到普通列表":"")),this.logs.unshift(`[${this.$logHead("taskGroup info")}][${this.$sTime(null,1)}] 成功删除分组: ${t}`),s.forEach((e=>{this.$delete(this.normlist[e],"group")})),this.$delete(this.tasklists,e),console.debug(i.data)})).catch((e=>{console.error(e),this.$message.error("删除分组失败",e.message),this.logs.unshift(`[${this.$logHead("taskGroup error")}][${this.$sTime(null,1)}] 删除分组失败 ${e.message}`)})).finally(i)}},taskGroupOp(e){this.$set(this.tasklists[e],"collapse",!this.tasklists[e].collapse)},taskMoveToGroup(e){"new"===e&&(e=this.taskNewId(),this.$set(this.tasklists,e,{name:"新的分组 "+Object.keys(this.grouplist).length,type:"group",note:"关于该分组的一些备注说明",bkcolor:this.$uStr.randomColor({max:200}),collapse:!1})),"none"===e||this.tasklists[e]&&"group"===this.tasklists[e].type?(this.taskChecklist.forEach((t=>{"none"===e?this.$delete(this.tasklists[t],"group"):this.$set(this.tasklists[t],"group",e)})),this.$message.success("成功移动",this.taskChecklist.length,"个定时任务到","none"===e?"普通列表":this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskGroup info")}][${this.$sTime(null,1)}] 成功移动 ${this.taskChecklist.length} 个定时任务到 ${"none"===e?"普通列表":this.tasklists[e].name},保存后生效`),this.show.groupchoose=!1,this.taskChecked="none"):this.$message.error("所选分组不存在,请重新选择")}}};const Oo=ka(So,wo,[],!1,null,"6e5c5756",null).exports;var Eo=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.hostSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"mitmset",class:{"mitmset--close":!e.eproxy.enable}},[t("div",{staticClass:"mitmset_status emargin",class:{"mitmset--close":!e.eproxy.enable}},[e._v(e._s(e.$t("status"))+":"+e._s(e.$t(e.eproxy.enable?"enabled":"disabled")))]),e._v(" "),t("div",{staticClass:"mitmset_item emargin"},[t("label",[e._v("ANYPROXY "+e._s(e.$t("port"))+": "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.eproxy.port,expression:"eproxy.port"}],staticClass:"elecTable_input elecTable_input--number mitmset_bl1",attrs:{type:"number"},domProps:{value:e.eproxy.port},on:{input:function(t){t.target.composing||e.$set(e.eproxy,"port",t.target.value)}}})])]),e._v(" "),t("div",{staticClass:"mitmset_item emargin"},[t("label",[e._v("ANYPROXY "+e._s(e.$t("logs"))+": "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.eproxy.webPort,expression:"eproxy.webPort"}],staticClass:"elecTable_input elecTable_input--number mitmset_bl1",attrs:{type:"number"},domProps:{value:e.eproxy.webPort},on:{input:function(t){t.target.composing||e.$set(e.eproxy,"webPort",t.target.value)}}})])]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.eproxy.enable,expression:"!eproxy.enable"}],staticClass:"elecBtn w220 greenbk emargin",on:{click:function(t){return e.eproxyToggle("open")}}},[e._v(e._s(e.$t("enable"))+" MITM")]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.eproxy.enable,expression:"eproxy.enable"}],staticClass:"elecBtn w220 elecBtn--stop emargin",on:{click:function(t){return e.eproxyToggle("close")}}},[e._v(e._s(e.$t("disable"))+" MITM")])]),e._v(" "),t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.mitmhosteble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.mitmhosteble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"按照下表进行解析(解析全部可使用单星号 *"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.mitmhosteble}})],1),e._v(" "),t("span",[e._v("MITM HOST "+e._s(e.$t("list"))+" - "+e._s(e.mitmhost.length))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.mitmInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:"全选/全不选"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.mitmCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th minw320"},[e._v(e._s(e.$t("host")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("note")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.mitmhost,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.mitmChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.mitmCheck,expression:"mitmCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:String(i),checked:Array.isArray(e.mitmCheck)?e._i(e.mitmCheck,String(i))>-1:e.mitmCheck},on:{change:function(t){var s=e.mitmCheck,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=String(i),o=e._i(s,r);n.checked?o<0&&(e.mitmCheck=s.concat([r])):o>-1&&(e.mitmCheck=s.slice(0,o).concat(s.slice(o+1)))}else e.mitmCheck=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.host,expression:"host.host",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"e.test.com"},domProps:{value:s.host},on:{input:function(t){t.target.composing||e.$set(s,"host",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"host.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op cursor",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.mhostDel(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"5"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.mitmCheck.length,expression:"mitmCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.mhostDelCks()}}},[e._v(e._s(e.$ta("delete","checked")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.mitmhost.push({host:"",enable:!0})}}},[e._v(e._s(e.$ta("add","host")))])])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.hostSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("pac",{attrs:{config:e.config_pac}}),e._v(" "),t("div",{staticClass:"mitmcrt"},[t("h4",{staticClass:"mitmcrt_title"},[e._v(e._s(e.$ta("self-signed","root","certificate","manage")))]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("certificate"))+": ")]),t("span",{staticClass:"sfcrt_info"},[e._v(e._s(e.crtinfo.commonName))])]),e._v(" "),t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("valid","date"))+": ")]),t("span",{staticClass:"sfcrt_info"},[e._v(e._s(e.crtinfo.notBefore)+" "+e._s(e.$t("to"))+" "+e._s(e.crtinfo.notAfter))])]),e._v(" "),t("select",{directives:[{name:"show",rawName:"v-show",value:0===e.crtinfo.rescode,expression:"crtinfo.rescode === 0"},{name:"model",rawName:"v-model",value:e.crt_type,expression:"crt_type"}],staticClass:"elecTable_select minw160",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.crt_type=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"crt"}},[e._v("CRT "+e._s(e.$t("certificate")))]),e._v(" "),t("option",{attrs:{value:"p12"}},[e._v("P12 "+e._s(e.$t("certificate")))]),e._v(" "),t("option",{attrs:{value:"dot"}},[e._v(".0 "+e._s(e.$t("certificate")))])]),e._v(" "),t("button",{staticClass:"elecBtn",attrs:{title:"下载当前使用的根证书文件"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.crtInstall()}}},[e._v(e._s(e.$ta("download","current","certificate")))]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){t.preventDefault(),t.stopPropagation(),e.crthostshow=!e.crthostshow}}},[e._v(e._s(e.$ta("sign","host","certificate")))]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.crthostshow,expression:"crthostshow"}],staticClass:"sfcrt_self"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("host")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.crt_host,expression:"crt_host"}],staticClass:"elecTable_input sfcrt_host",attrs:{placeholder:"域名 比如 test.com"},domProps:{value:e.crt_host},on:{input:function(t){t.target.composing||(e.crt_host=t.target.value)}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.crtHost()}}},[e._v(e._s(e.$ta("generate","and","download")))])])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("new","root","certificate"))+":")]),e._v(" "),t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("name"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newcrt.commonName,expression:"newcrt.commonName"}],staticClass:"elecTable_input w220",attrs:{type:"text",name:"commonName",placeholder:"elecV2P (全英文字符)"},domProps:{value:e.newcrt.commonName},on:{input:function(t){t.target.composing||e.$set(e.newcrt,"commonName",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("force","replace"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newcrt.overwrite,expression:"newcrt.overwrite"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"overwrite"},domProps:{checked:Array.isArray(e.newcrt.overwrite)?e._i(e.newcrt.overwrite,null)>-1:e.newcrt.overwrite},on:{change:function(t){var s=e.newcrt.overwrite,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.newcrt,"overwrite",s.concat([null])):a>-1&&e.$set(e.newcrt,"overwrite",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.newcrt,"overwrite",n)}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.crtNew()}}},[e._v(e._s(e.$t("generate")))])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("div",{staticClass:"eupload eupload--crt",attrs:{title:"根证书包含 rootCA.crt/rootCA.key 两部分"}},[t("input",{ref:"crtfiles",staticClass:"eupload_file eupload_file--crt",attrs:{type:"file",multiple:""},on:{change:function(t){return e.crtstoupload()}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.crtfiles.length,expression:"crtfiles.length"}],staticClass:"eupload_span"},[e._v(e._s(e.crtfilename))])]),e._v(" "),t("button",{staticClass:"elecBtn w220 emargin",on:{click:function(t){return e.crtUpload()}}},[e._v(e._s(e.$ta("start","upload")))])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("button",{staticClass:"elecBtn minw320 emargin",attrs:{title:"清空 ANYPROXY temp cache 文件夹"},on:{click:function(t){return e.cacheClear()}}},[e._v(e._s(e.$ta("clear","cache","file")))]),e._v(" "),t("button",{staticClass:"elecBtn minw320 emargin",attrs:{title:"删除由根证书签发的其他域名证书"},on:{click:function(t){return e.crtClear()}}},[e._v(e._s(e.$ta("clear","host","certificate")))]),e._v(" "),t("button",{staticClass:"elecBtn minw320 greenbk",on:{click:function(t){return e.eproxyToggle("restart")}}},[e._v(e._s(e.$t("restart"))+" ANYPROXY")])])])],1),e._v(" "),e._m(0)])};Eo._withStripped=!0;var jo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pacset"},[t("div",{staticClass:"pacaddr eflex"},[t("label",{staticClass:"elabel",attrs:{title:"根据上面的 MITM HOST 列表自动生成 base on mitmhost list"}},[e._v("PAC "+e._s(e.$t("file")))]),e._v(" "),t("span",{staticClass:"elecBtn",on:{click:function(t){return e.pacCopy()}}},[e._v(e._s(e.config.addr))])]),e._v(" "),t("div",{staticClass:"pacproxy eflex emargin"},[t("label",{staticClass:"elabel",attrs:{title:"需要 MITM 的网络请求分流代理地址"}},[e._v(e._s(e.$t("proxy")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.config.proxy,expression:"config.proxy",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"127.0.0.1:8001"},domProps:{value:e.config.proxy},on:{input:function(t){t.target.composing||e.$set(e.config,"proxy",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"pacproxy eflex emargin"},[t("label",{staticClass:"elabel",attrs:{title:"未匹配到的网络请求走向"}},[e._v(e._s(e.$t("non-matched")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.config.final,expression:"config.final",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"DIRECT"},domProps:{value:e.config.final},on:{input:function(t){t.target.composing||e.$set(e.config,"final",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.pacSave()}}},[e._v(e._s(e.$t("save")))])])};jo._withStripped=!0;const No={name:"mitm",props:["config"],data:()=>({}),methods:{pacCopy(){this.$uApi.copyToClipboard(this.config.addr+"?u="+Date.now()+"&token="),this.$message.success("成功复制 PAC 文件链接")},pacSave(){const e=this.$message.loading("正在更新 PAC 默认代理...",0);this.$axios.put("/pac",{proxy:this.config.proxy,final:this.config.final}).then((e=>{console.debug("PAC SAVE 返回结果",e.data),0===e.data.rescode?this.$message.success("成功更新 PAC 默认代理",e.data.message):this.$message.error("更新 PAC 默认代理失败",e.data.message)})).catch((e=>{this.$message.error("更新 PAC 默认代理失败",e.message),console.error(e)})).finally(e)}}};const Po={name:"mitm",props:[],data:()=>({header:"MITM",crtfiles:[],mitmhost:[],newcrt:{commonName:"elecV2P",overwrite:!1},crtinfo:{},mitmhosteble:{enable:!0},icon:wa,crt_type:"crt",crt_host:"",mitmCheck:[],eproxy:{enable:!1,port:8001,webPort:8002},crthostshow:!1,config_pac:{addr:Oa.base_url+"/pac",proxy:"127.0.0.1:8001",final:"DIRECT"}}),components:{pac:ka(No,jo,[],!1,null,null,null).exports,checkbox:mr},created(){this.mitmInit()},computed:{mitmChecked:{get(){let e={};return this.mitmCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.mitmCheck=Object.keys(this.mitmhost):"none"===e&&(this.mitmCheck=[])}},crtfilename(){let e=[];for(let t=0;t{e.data.host&&(this.mitmhost=[],e.data.host.forEach((e=>{switch(this.$sType(e)){case"string":this.mitmhost.push({host:e,enable:!0});break;case"object":!1!==e.enable&&(e.enable=!0),this.mitmhost.push(e)}}))),e.data.eproxy&&Object.assign(this.eproxy,e.data.eproxy),this.mitmhosteble.enable=!1!==e.data.enable,e.data.crtinfo&&0===e.data.crtinfo.rescode?this.crtinfo=e.data.crtinfo:this.crtinfo={commonName:"没有检测到相关证书(可能是 ANYPROXY 尚未开启)",notBefore:"无",notAfter:"无"},e.data.pacproxy&&(this.config_pac.proxy=e.data.pacproxy),e.data.pacfinal&&(this.config_pac.final=e.data.pacfinal),this.$message.success("成功获取 mitmhost 列表 "+this.mitmhost.length)})).catch((e=>{this.$message.error("获取 mitmhost 数据失败 "+e.message),console.error("获取 mitmhost 数据失败",e)})).finally(e)},crtstoupload(){this.crtfiles=this.$refs.crtfiles.files},crtUpload(){if(-1===this.crtfilename.indexOf("rootCA.crt")||-1===this.crtfilename.indexOf("rootCA.key"))return void this.$message.error("根证书应该包含 rootCA.crt/rootCA.key 两部分");let e=new FormData;for(let t of this.crtfiles)e.append(t.name,t);this.$axios.post("/crt",e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{console.log(e.data,e.status),0===e.data.rescode?(this.$message.success("上传成功 "+e.data.message+"\n将在 ANYPROXY 重启后自动应用"),this.crtfiles="",this.$refs.crtfiles.value=""):this.$message.success("上传失败 "+e.data.message)})).catch((()=>{this.$message.error("上传失败 FAILURE!!")}))},crtClear(){if(confirm("清空由之前根证书已签发的所有证书?")){const e=this.$message.loading("证书清除中...",0);this.$axios.put("/crt",{op:"clearcrt"}).then((e=>{this.$message.success("清除完成",e.data.message)})).catch((e=>{this.$message.error("操作失败",e.message),console.error(e)})).finally(e)}},crtInstall(){0===this.crtinfo.rescode?window.open("/crt"+("crt"!==this.crt_type?"?type="+this.crt_type:"")):this.$message.error("当前并没有证书可供下载,可能是 ANYPROXY 尚未开启")},crtNew(){if(!this.newcrt.commonName)return void this.$message.error("请先输入证书名称");const e=this.$message.loading("证书生成中...",0);this.$axios.put("/crt",{op:"new",data:this.newcrt}).then((e=>{0===e.data.rescode?this.$message.success("成功生成新的根证书\n"+e.data.message+"\n将在 ANYPROXY 重启后自动应用"):this.$message.success("自签根证书生成失败\n"+e.data.message)})).catch((e=>{this.$message.error("操作失败 "+e.message),console.error(e)})).finally(e)},hostSave(){let e=0,t=!1,s=this.mitmhost.filter((s=>{if(s.host)return s.enable&&(e++,"*"===s.host&&(t=!0)),!0}));if(confirm(`共 ${e}/${s.length} 个 mitmhost 将被保存,${this.mitmhosteble.enable?t?"包含单独 * 项,将解析所有域名,":"":"但不启用,"}确定保存?`)){this.mitmhost=s;const e=this.$message.loading("mitmhost 上传保存中...",0);this.$axios.put("/data",{type:"mitmhost",data:this.mitmhost,mitmhostenable:this.mitmhosteble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("mitmhost 保存失败",e.data.message)})).catch((e=>{this.$message.error("mitmhost 保存失败",e.message),console.error("mitmhost 保存失败",e)})).finally(e)}},cacheClear(){const e=this.$message.loading("清空 ANYPROXY temp cache 文件夹中...",0);this.$axios.delete("/tempcaches").then((e=>{console.debug("清空 ANYPROXY temp cache 返回结果",e.data),0===e.data.rescode?this.$message.success("清空完成",e.data.message):this.$message.error("清空失败",e.data.message)})).catch((e=>{this.$message.error("清空失败",e.message),console.error(e)})).finally(e)},mhostDel(e){this.$delete(this.mitmhost,e)},mhostDelCks(){this.mitmhost=this.mitmhost.filter(((e,t)=>!this.mitmChecked[t])),this.$message.success(`成功删除 ${this.mitmCheck.length} 条规则,保存后正式生效`),this.mitmCheck=[]},crtHost(){this.crt_host?window.open("./crt/new/"+this.crt_host):this.$message.error("请先输入要签发证书的域名")},mitmCkall(e){this.mitmChecked=e.target.checked?"all":"none"},eproxyToggle(e=""){if(this.$wsrecv.connected)switch(e){case"open":if(this.eproxy.enable)return void this.$message.success("当前 MITM 功能已处于启用状态");confirm("确定打开 ANYPROXY,启用 MITM 功能?")&&(this.eproxy.enable=!0,this.$wsrecv.send("eproxy",{...this.eproxy}));break;case"close":if(!this.eproxy.enable)return void this.$message.success("当前 MITM 功能已处于关闭状态");confirm("确定关闭 ANYPROXY,暂停 MITM 功能?")&&(this.eproxy.enable=!1,this.$wsrecv.send("eproxy","close"));break;case"restart":confirm("确定重启 ANYPROXY?")&&(this.eproxy.enable=!0,this.$wsrecv.send("eproxy",{op:"restart",...this.eproxy}));break;default:this.$message.error("未知操作",e)}else this.$message.error("websocket 尚未连接,指令无法发送")}}};const Ao=ka(Po,Eo,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("关于 PAC 文件的说明参考文档:"),t("a",{staticClass:"tip",attrs:{href:"https://github.com/elecV2/elecV2P-dei/blob/master/docs/Advanced.md",target:"_blank"}},[e._v("Advanced.md")]),e._v(" 相关部分")]),e._v(" "),t("li",[e._v("各个系统的证书安装与信任 参考: "),t("a",{staticClass:"tip",attrs:{href:"https://github.com/alibaba/anyproxy/tree/master/docs-src/cn",target:"_blank"}},[e._v("此页面")]),e._v(" 的证书配置相关部分")]),e._v(" "),t("li",[e._v("生成或上传新的根证书在重启后生效,需要重新下载安装和信任")]),e._v(" "),t("li",[e._v("解析 https 请求的条件:安装信任根证书且相关域名在解析列表中")]),e._v(" "),t("li",[e._v("经常使用 ANYPROXY 代理会产生大量缓存文件,请定期进行清理")])])])}],!1,null,"0b31b9a4",null).exports;var Io=function(){var e=this,t=e._self._c;return t("main",[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.filterSave()):null}}},[t("caption",{staticClass:"elecTable_caption"},[t("span",[e._v("filter.list - "+e._s(e.lists.length))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.cfInit()}}})]),e._v(" "),e._m(0),e._v(" "),t("tbody",e._l(e.lists,(function({data:s,index:i}){return t("tr",{key:"filter"+i},[t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s[0],expression:"data[0]"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,0,t.target.multiple?i:i[0])}}},[t("option",[e._v("DOMAIN")]),e._v(" "),t("option",[e._v("DOMAIN-SUFFIX")]),e._v(" "),t("option",[e._v("IP-CIDR")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s[1],expression:"data[1]",modifiers:{trim:!0}}],staticClass:"elecTable_input",domProps:{value:s[1]},on:{input:function(t){t.target.composing||e.$set(s,1,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$set(e.orglist[i],"status",-1)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_add",attrs:{colspan:"3"},on:{click:function(t){return e.orglist.push({data:["DOMAIN",""],index:e.orglist.length,status:1})}}},[e._v("+")])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.filterSave()}}},[e._v("保存当前列表")])])]),e._v(" "),t("footer",{staticClass:"footer footer--h48"},[t("div",[t("span",[e._v("该列表用于客户端分流(filter)订阅 地址:")]),e._v(" "),t("strong",[t("a",{attrs:{href:"/filter",target:"elecV2PFilter"}},[e._v(e._s(e.homepage)+"/filter")])])])])])};Io._withStripped=!0;const Ro={name:"filter",data:()=>({icon:wa,header:"客户端订阅分流列表",homepage:location.origin,orglist:[]}),created(){this.cfInit()},computed:{lists(){return this.orglist.filter((e=>-1!==e.status))}},methods:{cfInit(){const e=this.$message.loading("正在获取 filter 列表...",0);this.$axios.get("/data?type=filter").then((e=>{let t=e.data,s=[];t&&t.split(/\n|\r/).forEach((e=>{if(3===e.split(",").length&&!/^(#|\[)/.test(e)){let t=e.split(",");s.push({data:[t[0],t[1]],index:s.length,status:0})}})),this.orglist=s,this.$message.success("成功获取 filter 列表 "+this.orglist.length)})).catch((e=>{this.$message.error("获取 filter 列表失败",e.message),console.error("获取 filter 数据失败",e)})).finally(e)},filterSave(){let e=[];if(e=this.lists.filter((e=>e.data[1]&&/^(DOMAIN(-SUFFIX)?|IP-CIDR)$/.test(e.data[0]))),this.lists.length-e.length)return void this.$message.error("部分规则为空,请填写完成或删除后再进行保存");e=this.lists.map((e=>e.data));const t=this.$message.loading("filter 列表保存中...",0);this.$axios.post("/filterlist",{filterlist:e}).then((e=>{this.$message.success("保存成功",e.data.message)})).catch((e=>{this.$message.error("保存失败",e.message),console.error(e)})).finally(t)}}};const Do=ka(Ro,Io,[function(){var e=this,t=e._self._c;return t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v("匹配方式")]),e._v(" "),t("th",{staticClass:"elecTable_th"},[e._v("匹配内容")]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v("操作")])])])}],!1,null,null,null).exports;var Fo=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),e._m(0),e._v(" "),t("footer",{staticClass:"footer footer--h48"},[t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[t("i",{staticClass:"icon icon-github",attrs:{"aria-label":"icon: github"}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"github",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}})])]),e._v(" Github ")]),e._v(" "),t("a",{attrs:{href:"https://t.me/elecV2",target:"elecV2PTG"}},[t("i",{staticClass:"icon icon-robot",attrs:{"aria-label":"icon: robot"}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"robot",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M300 328a60 60 0 1 0 120 0 60 60 0 1 0-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 1 0 120 0 60 60 0 1 0-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}})])]),e._v(" Telegram ")])])])};Fo._withStripped=!0;const Lo=ka({name:"about",data:()=>({header:"ABOUT"})},Fo,[function(){var e=this,t=e._self._c;return t("main",{staticClass:"content"},[t("div",{staticClass:"about"},[t("h4",{staticClass:"about_title"},[e._v("简介")]),e._v(" "),t("p",[e._v("elecV2P - customize personal network.")]),e._v(" "),t("p",[e._v("elecV2P 是一款基于 NodeJS,可通过 JS 修改网络请求,以及定时运行脚本或 SHELL 指令的网络工具。")]),e._v(" "),t("br"),e._v(" "),t("p",[e._v("项目地址:"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[e._v("https://github.com/elecV2/elecV2P")]),t("br"),e._v("说明文档:"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs",target:"elecV2PDoc"}},[e._v("https://github.com/elecV2/elecV2P-dei/tree/master/docs")])]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("功能")]),e._v(" "),t("ul",[t("li",[e._v("查看/修改 网络请求 (MITM)")]),e._v(" "),t("li",[e._v("定时执行 JS/SHELL 脚本")]),e._v(" "),t("li",[e._v("FEED/IFTTT/自定义 通知")]),e._v(" "),t("li",[e._v("EFSS 基础文件管理")])]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("项目已开源")]),e._v(" "),t("p",[e._v("前端源文件位于 web/src 目录,修改后使用 yarn build 命令进行打包。")]),e._v(" "),t("p",[e._v("在使用时,如果有任何问题或建议,欢迎一起交流 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P/issues",target:"elecV2PGit"}},[e._v("open a issue")]),e._v("。")]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("贡献/参考")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://github.com/alibaba/anyproxy",target:"_blank"}},[e._v("anyproxy")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/axios/axios",target:"_blank"}},[e._v("axios")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/cheeriojs/cheerio",target:"_blank"}},[e._v("cheerio")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://expressjs.com",target:"_blank"}},[e._v("express")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/merencia/node-cron",target:"_blank"}},[e._v("node-cron")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/dylang/node-rss",target:"_blank"}},[e._v("node-rss")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://pm2.keymetrics.io/",target:"_blank"}},[e._v("pm2")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://vuejs.org",target:"_blank"}},[e._v("vue")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/mauricius/vue-draggable-resizable",target:"_blank"}},[e._v("vue-draggable-resizable")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/ajaxorg/ace",target:"_blank"}},[e._v("ace")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/cthackers/adm-zip",target:"_blank"}},[e._v("adm-zip")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://www.antdv.com",target:"_blank"}},[e._v("Ant Design Vue")])])]),e._v(" "),t("h5",{staticClass:"about_tip"},[t("i",[e._v(" • Don't be evil. "),t("small",[e._v("(Because I am already one)")])])])])])}],!1,null,"055bd4a3",null).exports;var Ho=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$t("donation")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"donation"},[e._m(0),e._v(" "),e._m(1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.userid,expression:"userid"}],attrs:{title:"可多台设备共用(设置相同 WEBHOOK TOKEN)"}},[t("p",[e._v("当前用户 ID: "+e._s(e.userid))]),e._v(" "),e._m(2)])]),e._v(" "),t("div",{staticClass:"todo"},[t("h2",{directives:[{name:"show",rawName:"v-show",value:!e.tododata,expression:"!tododata"}],staticClass:"todotitle",on:{click:e.todoget}},[e._v("查看 Todo-Done-Project")]),e._v(" "),t("div",{domProps:{innerHTML:e._s(e.tododata)}})])]),e._v(" "),e._m(3)])};Ho._withStripped=!0;const Uo={name:"donation",data(){return{userid:this.$uApi.store.get("userid"),tododata:""}},created(){this.$uApi.store.getCache("bSponsor")||this.$axios.get("/data?type=sponsors").then((e=>{if(0===e.data.rescode){let t=e.data.resdata;this.$uApi.store.set("sponsors",this.$uStr.ebufEncrypt(JSON.stringify(t.sponsors),"elecV2P_sponsors")),this.userid!==t.userid&&(this.userid=t.userid,this.$uApi.store.set("userid",this.userid)),(this.$uApi.store.getCache("sponsors").has(this.userid)||-1!==t.sponsors.indexOf(this.userid))&&(this.$message.success("感谢您的赞助,相关权益已激活,请回到首页并刷新"),this.$uApi.store.setCache("bSponsor",!0))}console.debug("get sponsors lists",e.data)})).catch((e=>{console.debug("获取 sponsors lists 失败",e.message)}))},methods:{todoget(){if(this.tododata)return;const e=this.$message.loading("获取 todo lists 中...",0);this.$axios.get("https://raw.githubusercontent.com/elecV2/elecV2P/master/Todo.md").then((e=>{this.$message.success("获取成功"),this.tododata=e.data})).catch((e=>{this.$message.error("获取失败 "+e.message),console.error(e),this.tododata="点击前往:https://github.com/elecV2/elecV2P 查看"})).finally(e)}}};const Mo=ka(Uo,Ho,[function(){var e=this,t=e._self._c;return t("p",[e._v("如果你觉得本项目还不错的话,"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[e._v("给个 Star")]),e._v(" ,或者赞助打赏一下")])},function(){var e=this._self._c;return e("div",{staticClass:"donationpic"},[e("img",{staticClass:"donationpic_item",attrs:{alt:"wechat",src:"https://elecv2.github.io/src/wechat.png"}}),this._v(" "),e("img",{staticClass:"donationpic_item",attrs:{alt:"alipay",src:"https://elecv2.github.io/src/alipay.png"}})])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"tip"},[e._v("* 赞助 10 元及以上,体验"),t("a",{staticClass:"tip",attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/examples/theme",target:"elecV2PDoc"}},[e._v(" 主题功能")]),e._v("(请附上用户 ID)")])},function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("span",[e._v("BTC: 1GtN4T1GB4YUf4YWynqr1Vgv4sdgLepoo9")]),e._v(" "),t("span",[e._v("ETH: 0x2455850dAC2f44309E3e208E5ffAF5945308E76a")])])}],!1,null,"51001bdc",null).exports;var Bo=function(){var e=this,t=e._self._c;return e.bIsHide?e._e():t("div",{staticClass:"hold"},[t("h4",{staticClass:"hold_title"},[e._v("$HOLD: "+e._s(e.title))]),e._v(" "),t("div",{staticClass:"hold_edit"},[t("div",{staticClass:"hold_left"},[e.request?t("div",{staticClass:"hold_request"},[t("div",{staticClass:"hold_request_flex"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.request.method,expression:"request.method"}],staticClass:"elecTable_select header_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.request,"method",t.target.multiple?s:s[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("DELETE")])]),e._v(" "),t("label",{staticClass:"header_label"},[e._v("HOST : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.hostname,expression:"request.hostname"}],staticClass:"elecTable_input hostname_input",domProps:{value:e.request.hostname},on:{input:function(t){t.target.composing||e.$set(e.request,"hostname",t.target.value)}}}),e._v(" "),t("label",{staticClass:"header_label"},[e._v(" : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.port,expression:"request.port"}],staticClass:"elecTable_input port_input",domProps:{value:e.request.port},on:{input:function(t){t.target.composing||e.$set(e.request,"port",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"hold_request_flex"},[t("label",{staticClass:"header_label"},[e._v("PATH : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.path,expression:"request.path"}],staticClass:"elecTable_input path_input",domProps:{value:e.request.path},on:{input:function(t){t.target.composing||e.$set(e.request,"path",t.target.value)}}})])]):e._e(),e._v(" "),t("div",{staticClass:"hold_header"},[t("h4",{staticClass:"hold_title"},[e._v("header"),t("span",{staticClass:"icon icon-interaction",attrs:{"aria-label":"icon: interaction"},on:{click:function(t){e.bIsTheader=!e.bIsTheader}}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"interaction",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM304.8 524h50.7c3.7 0 6.8-3 6.8-6.8v-78.9c0-19.7 15.9-35.6 35.5-35.6h205.7v53.4c0 5.7 6.5 8.8 10.9 5.3l109.1-85.7c3.5-2.7 3.5-8 0-10.7l-109.1-85.7c-4.4-3.5-10.9-.3-10.9 5.3V338H397.7c-55.1 0-99.7 44.8-99.7 100.1V517c0 4 3 7 6.8 7zm-4.2 134.9l109.1 85.7c4.4 3.5 10.9.3 10.9-5.3v-53.4h205.7c55.1 0 99.7-44.8 99.7-100.1v-78.9c0-3.7-3-6.8-6.8-6.8h-50.7c-3.7 0-6.8 3-6.8 6.8v78.9c0 19.7-15.9 35.6-35.5 35.6H420.6V568c0-5.7-6.5-8.8-10.9-5.3l-109.1 85.7c-3.5 2.5-3.5 7.8 0 10.5z"}})])])]),e._v(" "),e.bIsTheader?t("textarea",{directives:[{name:"model",rawName:"v-model.lazy",value:e.strheader,expression:"strheader",modifiers:{lazy:!0}}],staticClass:"editor_textarea header_text",domProps:{value:e.strheader},on:{change:function(t){e.strheader=t.target.value}}}):t("div",e._l(e.header,(function(s,i){return t("span",{key:i,staticClass:"header_item"},[t("label",{staticClass:"header_label",attrs:{title:i}},[e._v(e._s(i)+":")]),e._v(" "),t("span",{staticClass:"button_delete",on:{click:function(t){return e.headerDelete(i)}}},[e._v("X")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.header[i],expression:"header[key]"}],staticClass:"elecTable_input header_input",domProps:{value:e.header[i]},on:{input:function(t){t.target.composing||e.$set(e.header,i,t.target.value)}}})])})),0)])]),e._v(" "),t("div",{staticClass:"hold_body"},[t("h4",{staticClass:"hold_title"},[e._v("body")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.lazy",value:e.body,expression:"body",modifiers:{lazy:!0}}],staticClass:"editor_textarea body_text",domProps:{value:e.body},on:{change:function(t){e.body=t.target.value}}})])]),e._v(" "),t("p",{staticClass:"hold_bcont center"},[t("button",{staticClass:"elecBtn hold_button",on:{click:e.holdDone}},[e._v("完成")]),e._v(" "),e.request?t("button",{staticClass:"elecBtn hold_button",on:{click:e.reject}},[e._v("直接返回当前数据")]):e._e()])])};Bo._withStripped=!0;const zo={name:"hold",data:()=>({title:"waiting hold data",request:null,header:{},body:"hello elecV2P",bIsHide:!0,bIsTheader:!1}),computed:{strheader:{get(){return JSON.stringify(this.header,null,4)},set(e){try{this.header=JSON.parse(e)}catch{console.log("hold header string is not a json"),this.$message.error("header 内容并不是正确的 JSON 格式",10)}}}},created(){this.$wsrecv.add("hold",(e=>{"over"===e?(this.bIsHide=!0,this.request=null,this.header={},this.body="hello elecV2P"):(this.title=e.title,this.request=e.request||null,this.header=e.header||{},this.body=e.body,this.bIsHide=!1)}))},methods:{holdDone(){const e={header:this.header,body:this.body};this.request&&(this.request.path=encodeURI(this.request.path),e.request=this.request),this.$wsrecv.send("hold",e),this.bIsHide=!0},reject(){const e={reject:!0,header:this.header,body:this.body};this.$wsrecv.send("hold",e),this.bIsHide=!0},headerDelete(e){this.$delete(this.header,e)}}};const Vo=ka(zo,Bo,[],!1,null,"3afbbebb",null).exports;var Go=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message"},e._l(e.msgs,(function(s,i){return t("div",{key:i,staticClass:"message_item",style:{textAlign:s.align}},[t("span",{staticClass:"message_type icon",domProps:{innerHTML:e._s(e.icon[s.type])}}),e._v(" "),t("span",{staticClass:"message_text",class:{cursor:s.url},attrs:{title:s.url},on:{click:function(t){return e.$uApi.open(s.url)}}},[e._v(e._s(s.text))]),e._v(" "),t("span",{staticClass:"message_remove",on:{click:function(t){return e.msgRemove(i)}}},[e._v("X")])])})),0)};Go._withStripped=!0;const Ko=ka({name:"message",data:()=>({msgs:{},icon:wa}),computed:{},created(){Object.assign(co.message,{success:(...e)=>this.msgShow("success",this.formMsg(e)),error:(...e)=>this.msgShow("error",this.formMsg(e)),loading:(...e)=>this.msgShow("loading",this.formMsg(e)),close:e=>{e?this.msgRemove(e):this.msgs={}}}),this.$wsrecv&&this.$wsrecv.add("message",(e=>{if("object"===Ea(e))switch(e.type){case"success":case"error":case"loading":const t=this.formMsg(e.data);this.msgShow(e.type,t),this.msgNotify(t.msg,{secd:t.secd,url:t.url,tag:t.mid});break;case"close":e.data?this.msgRemove(e.data):this.msgs={};break;default:this.msgShow("error",{msg:"暂不支持的通知类型: "+e.type,secd:10})}else this.msgShow("success",this.formMsg(e))}))},methods:{formMsg(e){if(0===e.length)return{msg:""};if("array"!==Ea(e))return{msg:Na(e)};if(1===e.length)return{msg:Na(e[0])};let t,s,i,n,a=e.pop();return Number.isFinite(a)?t=a:"object"===Ea(a)&&(a.secd||a.url||a.mid||a.align)?(t=a.secd,s=a.url,i=a.mid,n=a.align):e.push(a),{msg:e.map((e=>Na(e))).join(" "),secd:t,url:s,mid:i,align:n}},msgShow(e,{msg:t,secd:s,url:i,mid:n=Ra(),align:a}){return void 0!==t&&""!==t||(t="a empty message",n="empty"),Number.isFinite(s)||(s=(t.match(/\W/g)||t).length/5+(3*Object.keys(this.msgs).length||5)),this.$set(this.msgs,n,{text:t,type:e,secd:s,url:i,align:a}),0!==s&&(this.msgs[n].sTout=setTimeout(this.msgRemove,1e3*s,n)),()=>{this.msgRemove(n)}},msgRemove(e){this.msgs[e]&&(clearTimeout(this.msgs[e].sTout),this.$delete(this.msgs,e))},async getNotifyPerm(){if("undefined"==typeof Notification)return"";let e=Notification.permission;return"granted"===e||"denied"===e?e:(e=await Notification.requestPermission(),void 0===e?new Promise((e=>Notification.requestPermission((t=>e(t))))):e)},async msgNotify(e="",t={}){if("granted"===await this.getNotifyPerm()){t.icon||(t.icon="efss/logo/elecV2P.png");const s=new Notification(t.title||"",{body:e,icon:t.icon,tag:t.tag});t.secd>0&&setTimeout((()=>s.close()),1e3*t.secd),t.url&&(s.onclick=e=>{e.preventDefault(),this.$uApi.open(t.url),s.close()})}}}},Go,[],!1,null,"40ac18ce",null).exports;var qo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"evui"},e._l(e.draglist,(function(s,i){return t("VueDragResize",{key:i,attrs:{className:"ediv",dragHandle:".ediv_title--name",parent:!0,"prevent-deactivation":!1,active:s.active,w:s.width,h:s.height,x:s.left,y:s.top,z:s.z,resizable:s.resizable,draggable:s.draggable,handles:["tl","tr","bl","br"],"lock-aspect-ratio":!1},on:{deactivated:function(e){s.z=1},activated:function(e){s.z=2},resizestop:function(t){return e.updateVal(arguments,i)},dragstop:function(t){return e.updateVal(arguments,i)}}},[t("h3",{staticClass:"ediv_title",style:s.style.title,on:{click:function(e){s.z=2}}},[t("span",{staticClass:"ediv_title--name",attrs:{title:i}},[e._v(e._s(s.title))]),e._v(" "),t("span",{staticClass:"ediv_title--close",on:{click:function(t){return e.evRemove(i)}}},[e._v("x")])]),e._v(" "),t("div",{staticClass:"ediv_content",style:s.style.content,domProps:{innerHTML:e._s(s.content)},on:{click:function(t){return e.evDelegate(t,i)},keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.evSave(i)):null}}}),e._v(" "),s.cbable?t("div",{staticClass:"ediv_btncontainer"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.cbdata,expression:"ediv.cbdata"}],staticClass:"elecTable_input ediv_cbdata",style:s.style.cbdata,attrs:{placeholder:s.cbhint},domProps:{value:s.cbdata},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?e.cbsubmit(i):null},input:function(t){t.target.composing||e.$set(s,"cbdata",t.target.value)}}}),e._v(" "),t("button",{staticClass:"elecBtn ediv_cbbtn",style:s.style.cbbtn,on:{click:function(t){return e.cbsubmit(i)}}},[e._v(e._s(s.cblabel))])]):e._e()])})),1)};qo._withStripped=!0;const Jo={name:"evui",components:{VueDragResize:xo()},data:()=>({init:{title:"elecV2P 显示窗口",top:0,left:0,width:620,height:360,z:1,active:!0,resizable:!1,draggable:!0,content:"

暂时没有添加任何内容

关于 $evui 的使用可参考:说明文档 $evui 部分

",style:{content:"font-size: 15px"},cbable:!1,cbdata:"",cblabel:"提交",cbhint:"输入返回给后台的数据"},script:"",draglist:{}}),created(){co.evui=e=>this.neweu({...e,type:"local"}),this.$wsrecv&&this.$wsrecv.add("evui",(e=>{let t=this.$sJson(e);if(t)switch(t.data&&t.data.script&&(this.script=t.data.script),t.type){case"neweu":this.neweu(t.data);break;case"close":case"delete":this.draglist[t.id]&&(this.$message.success("收到服务器端关闭",this.draglist[t.id].title,"evui 界面的命令",t.message&&"\n附带信息: "+t.message),this.evRemove(t.id));break;case"contentadd":this.$set(this.draglist[t.id],"content",this.draglist[t.id].content+this.$sString(t.data));break;case"content":this.$set(this.draglist[t.id],"content",this.$sString(t.data));break;case"cbdataadd":let e=this.draglist[t.id].cbdata+"\n"+this.$sString(t.data);this.$set(this.draglist[t.id],"cbdata",e);break;default:this.$set(this.draglist[t.id],"cbdata",this.$sString(t.data))}else this.$message.error("evui 输送的数据有误")}))},watch:{script(e){this.$uApi.injectJs(e)}},methods:{updateVal({...e},t){let s={left:e[0],top:e[1]};void 0!==e[2]&&void 0!==e[3]&&(s.width=e[2],s.height=e[3]),Object.assign(this.draglist[t],s)},neweu(e={}){let t=e.id||this.$uStr.euid();(e={...this.init,...e}).top=e.top||(document.body.clientHeight-Number(e.height||460))/2,e.left=e.left||(document.body.clientWidth-Number(e.width||800))/2,e.top<0&&(e.top=0),e.left<0&&(e.left=0),e.content&&(e.content=this.$sString(e.content)),e.cbdata&&(e.cbdata=this.$sString(e.cbdata)),"object"!==this.$sType(e.style)&&(e.style={content:e.style}),e.script&&(this.script=e.script),this.$set(this.draglist,t,e)},evRemove(e){e?this.draglist[e]&&("local"!==this.draglist[e].type&&this.$wsrecv&&this.$wsrecv.connected&&this.$wsrecv.send(e,"close"),this.$delete(this.draglist,e)):this.$message.error("a id of the evui is expect")},cbsubmit(e){this.$message.success(this.draglist[e].title,"send data:\n",this.draglist[e].cbdata),this.$wsrecv&&this.$wsrecv.send(e,this.draglist[e].cbdata)},evDelegate(e,t){const s=e&&e.target.dataset.method;if(!s)return;this.draglist[t].methods&&this.draglist[t].methods[s]&&this.draglist[t].methods[s](e);"true"!==e.target.dataset.close&&"close"!==s||this.evRemove(t)},evSave(e){this.draglist[e].methods&&this.draglist[e].methods.save&&(this.draglist[e].methods.save(),this.evRemove(e))}}};const Wo=ka(Jo,qo,[],!1,null,null,null).exports;const Yo=ka({name:"app",data:()=>({icon:wa,logo_src:ba,logo_name:"elecV2P",collapsed:window.innerWidth<960,sidermobile:!0,currentpanel:"overview",islangzh:rr.locale.startsWith("zh"),menulist:{overview:Object.create(null),task:Object.create(null),mitm:Object.create(null),rules:Object.create(null),rewrite:Object.create(null),jsmanage:Object.create(null),setting:Object.create(null),cfilter:Object.create(null),about:Object.create(null),donation:Object.create(null)}}),created(){let e=location.hash.slice(1).toLowerCase();this.currentpanel=this.menulist[e]?e:"overview";let t=this.$sJson(this.$uApi.store.get("menunav"));t?this.menulist=t:this.islangzh&&(this.menulist.overview.name="基础信息",this.menulist.task.name="定时任务",this.menulist.rewrite.name="重写请求",this.menulist.jsmanage.name="脚本管理",this.menulist.setting.name="设置相关",this.menulist.cfilter.name="分流列表",this.menulist.about.name="简介说明",this.menulist.donation.name="赞助打赏");let s=this.$sJson(this.$uApi.store.get("theme"));s&&this.themeApply(s),addEventListener("hashchange",(e=>{let t=location.hash.slice(1).toLowerCase();this.currentpanel=this.menulist[t]?t:"overview"})),addEventListener("load",(e=>{"serviceWorker"in navigator?(navigator.serviceWorker.register("/sw.js").catch((e=>{console.error("service worker registration failed",e)})),navigator.serviceWorker.addEventListener("controllerchange",(()=>{console.debug("a new service worker activated"),this.$message.success("a new service worker activated")}))):("http:"===location.protocol||this.$uApi.store.getCache("bChecked")||this.$message.error("该浏览器暂不支持 service workers,webUI 部分功能可能受限"),console.error("This browser does not support service workers. webUI 部分功能可能受限")),location.search.includes("token")&&history.replaceState(null,"","/"+location.hash)}))},components:{overview:hr,rules:vr,rewrite:br,jsmanage:jr,setting:$o,task:Oo,mitm:Ao,cfilter:Do,about:Lo,donation:Mo,hold:Vo,message:Ko,evui:Wo},computed:{navlist(){let e=Object.create(null),t=this.$uApi.store.getCache("bSponsor");for(let s in this.menulist)"setting"===s||"donation"===s&&!t?(this.menulist[s].show=!0,e[s]=this.menulist[s]):!1!==this.menulist[s].show&&(e[s]=this.menulist[s]);return e}},methods:{nav(e){location.hash="#"+e,this.sidermobile||(this.sidermobile=!0)},edelegate(e){if("nav"===e.target.dataset.method){let t=e.target.dataset.panel||e.target.dataset.param;t&&this.nav(t)}},menunav(e=null,t=!1){if(!e)return void console.debug("menu nav are expect");if(!t&&JSON.stringify(e)===JSON.stringify(this.menulist))return void console.debug("same menu nav, no need to update");let s={...this.menulist};for(let t in e)s[t]&&(s[t]=e[t]);this.menulist=s,this.$uApi.store.set("menunav",JSON.stringify(s))},themeApply(e=null){if(!e)return void console.error("theme object is expect");if("logo"===e.type)return!1===e.enable?(this.logo_src=ba,void(this.logo_name="elecV2P")):(e.src&&(this.logo_src=e.src),void(e.name&&(this.logo_name=e.name)));if(e.simple&&(e=e.simple),!0!==e.enable)return this.$uApi.removeItem(".evtheme"),this.$uApi.injectMeta("theme-color","#003153"),void this.$uApi.store.set("theme",JSON.stringify(e));let t="";e.mainbk&&(t=`--main-bk: ${e.mainbk};`,e.mainbk.startsWith("#")&&(t+=`--secd-fc: ${e.mainbk.padEnd(7,8).slice(0,7)}b8;`)),e.maincl&&(t+=`--main-cl: ${e.maincl};`,e.maincl.startsWith("#")&&(t+=`--secd-bk: ${e.maincl.padEnd(7,8).slice(0,7)}b8;`)),e.appbk&&(/^http/.test(e.appbk)&&(e.appbk=`url(${e.appbk})`),t+=`background: ${e.appbk};`),t&&(t=`#app{${t}}`),e.style&&(t+=e.style,/--main-fc/.test(e.style)&&this.$uApi.hashToLogo()),this.$uApi.injectCss(t),this.$uApi.injectMeta("theme-color",e.mainbk),this.$uApi.store.set("theme",JSON.stringify(e))},srcErr(){this.$message.error("LOGO 图标加载失败,自动生成替换图标"),this.logo_src=this.$uApi.hashToLogo(this.$uApi.store.get("userid"),this.logo_name,4)}}},_a,[],!1,null,"10ee03bb",null).exports;function Xo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zo}=Object.prototype,{getPrototypeOf:Qo}=Object,el=(tl=Object.create(null),e=>{const t=Zo.call(e);return tl[t]||(tl[t]=t.slice(8,-1).toLowerCase())});var tl;const sl=e=>(e=e.toLowerCase(),t=>el(t)===e),il=e=>t=>typeof t===e,{isArray:nl}=Array,al=il("undefined");const rl=sl("ArrayBuffer");const ol=il("string"),ll=il("function"),cl=il("number"),ul=e=>null!==e&&"object"==typeof e,hl=e=>{if("object"!==el(e))return!1;const t=Qo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},dl=sl("Date"),pl=sl("File"),ml=sl("Blob"),fl=sl("FileList"),vl=sl("URLSearchParams"),[gl,_l,bl,yl]=["ReadableStream","Request","Response","Headers"].map(sl);function $l(e,t,{allOwnKeys:s=!1}={}){if(null==e)return;let i,n;if("object"!=typeof e&&(e=[e]),nl(e))for(i=0,n=e.length;i0;)if(i=s[n],t===i.toLowerCase())return i;return null}const kl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cl=e=>!al(e)&&e!==kl;const xl=(Tl="undefined"!=typeof Uint8Array&&Qo(Uint8Array),e=>Tl&&e instanceof Tl);var Tl;const Sl=sl("HTMLFormElement"),Ol=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),El=sl("RegExp"),jl=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),i={};$l(s,((s,n)=>{let a;!1!==(a=t(s,n,e))&&(i[n]=a||s)})),Object.defineProperties(e,i)},Nl="abcdefghijklmnopqrstuvwxyz",Pl="0123456789",Al={DIGIT:Pl,ALPHA:Nl,ALPHA_DIGIT:Nl+Nl.toUpperCase()+Pl};const Il=sl("AsyncFunction"),Rl=(Dl="function"==typeof setImmediate,Fl=ll(kl.postMessage),Dl?setImmediate:Fl?((e,t)=>(kl.addEventListener("message",(({source:s,data:i})=>{s===kl&&i===e&&t.length&&t.shift()()}),!1),s=>{t.push(s),kl.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Dl,Fl;const Ll="undefined"!=typeof queueMicrotask?queueMicrotask.bind(kl):"undefined"!=typeof process&&process.nextTick||Rl,Hl={isArray:nl,isArrayBuffer:rl,isBuffer:function(e){return null!==e&&!al(e)&&null!==e.constructor&&!al(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ll(e.append)&&("formdata"===(t=el(e))||"object"===t&&ll(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&rl(e.buffer),t},isString:ol,isNumber:cl,isBoolean:e=>!0===e||!1===e,isObject:ul,isPlainObject:hl,isReadableStream:gl,isRequest:_l,isResponse:bl,isHeaders:yl,isUndefined:al,isDate:dl,isFile:pl,isBlob:ml,isRegExp:El,isFunction:ll,isStream:e=>ul(e)&&ll(e.pipe),isURLSearchParams:vl,isTypedArray:xl,isFileList:fl,forEach:$l,merge:function e(){const{caseless:t}=Cl(this)&&this||{},s={},i=(i,n)=>{const a=t&&wl(s,n)||n;hl(s[a])&&hl(i)?s[a]=e(s[a],i):hl(i)?s[a]=e({},i):nl(i)?s[a]=i.slice():s[a]=i};for(let e=0,t=arguments.length;e($l(t,((t,i)=>{s&&ll(t)?e[i]=Xo(t,s):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,s,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},toFlatObject:(e,t,s,i)=>{let n,a,r;const o={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)r=n[a],i&&!i(r,e,t)||o[r]||(t[r]=e[r],o[r]=!0);e=!1!==s&&Qo(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},kindOf:el,kindOfTest:sl,endsWith:(e,t,s)=>{e=String(e),(void 0===s||s>e.length)&&(s=e.length),s-=t.length;const i=e.indexOf(t,s);return-1!==i&&i===s},toArray:e=>{if(!e)return null;if(nl(e))return e;let t=e.length;if(!cl(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},forEachEntry:(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=s.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},matchAll:(e,t)=>{let s;const i=[];for(;null!==(s=e.exec(t));)i.push(s);return i},isHTMLForm:Sl,hasOwnProperty:Ol,hasOwnProp:Ol,reduceDescriptors:jl,freezeMethods:e=>{jl(e,((t,s)=>{if(ll(e)&&-1!==["arguments","caller","callee"].indexOf(s))return!1;const i=e[s];ll(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")}))}))},toObjectSet:(e,t)=>{const s={},i=e=>{e.forEach((e=>{s[e]=!0}))};return nl(e)?i(e):i(String(e).split(t)),s},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,s){return t.toUpperCase()+s})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:wl,global:kl,isContextDefined:Cl,ALPHABET:Al,generateString:(e=16,t=Al.ALPHA_DIGIT)=>{let s="";const{length:i}=t;for(;e--;)s+=t[Math.random()*i|0];return s},isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),s=(e,i)=>{if(ul(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const n=nl(e)?[]:{};return $l(e,((e,t)=>{const a=s(e,i+1);!al(a)&&(n[t]=a)})),t[i]=void 0,n}}return e};return s(e,0)},isAsyncFn:Il,isThenable:e=>e&&(ul(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:Rl,asap:Ll};function Ul(e,t,s,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}Hl.inherits(Ul,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Hl.toJSONObject(this.config),code:this.code,status:this.status}}});const Ml=Ul.prototype,Bl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Bl[e]={value:e}})),Object.defineProperties(Ul,Bl),Object.defineProperty(Ml,"isAxiosError",{value:!0}),Ul.from=(e,t,s,i,n,a)=>{const r=Object.create(Ml);return Hl.toFlatObject(e,r,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ul.call(r,e.message,t,s,i,n),r.cause=e,r.name=e.name,a&&Object.assign(r,a),r};const zl=Ul;function Vl(e){return Hl.isPlainObject(e)||Hl.isArray(e)}function Gl(e){return Hl.endsWith(e,"[]")?e.slice(0,-2):e}function Kl(e,t,s){return e?e.concat(t).map((function(e,t){return e=Gl(e),!s&&t?"["+e+"]":e})).join(s?".":""):t}const ql=Hl.toFlatObject(Hl,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Jl=function(e,t,s){if(!Hl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(s=Hl.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Hl.isUndefined(t[e])}))).metaTokens,n=s.visitor||c,a=s.dots,r=s.indexes,o=(s.Blob||"undefined"!=typeof Blob&&Blob)&&Hl.isSpecCompliantForm(t);if(!Hl.isFunction(n))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Hl.isDate(e))return e.toISOString();if(!o&&Hl.isBlob(e))throw new zl("Blob is not supported. Use a Buffer instead.");return Hl.isArrayBuffer(e)||Hl.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,s,n){let o=e;if(e&&!n&&"object"==typeof e)if(Hl.endsWith(s,"{}"))s=i?s:s.slice(0,-2),e=JSON.stringify(e);else if(Hl.isArray(e)&&function(e){return Hl.isArray(e)&&!e.some(Vl)}(e)||(Hl.isFileList(e)||Hl.endsWith(s,"[]"))&&(o=Hl.toArray(e)))return s=Gl(s),o.forEach((function(e,i){!Hl.isUndefined(e)&&null!==e&&t.append(!0===r?Kl([s],i,a):null===r?s:s+"[]",l(e))})),!1;return!!Vl(e)||(t.append(Kl(n,s,a),l(e)),!1)}const u=[],h=Object.assign(ql,{defaultVisitor:c,convertValue:l,isVisitable:Vl});if(!Hl.isObject(e))throw new TypeError("data must be an object");return function e(s,i){if(!Hl.isUndefined(s)){if(-1!==u.indexOf(s))throw Error("Circular reference detected in "+i.join("."));u.push(s),Hl.forEach(s,(function(s,a){!0===(!(Hl.isUndefined(s)||null===s)&&n.call(t,s,Hl.isString(a)?a.trim():a,i,h))&&e(s,i?i.concat(a):[a])})),u.pop()}}(e),t};function Wl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Yl(e,t){this._pairs=[],e&&Jl(e,this,t)}const Xl=Yl.prototype;Xl.append=function(e,t){this._pairs.push([e,t])},Xl.toString=function(e){const t=e?function(t){return e.call(this,t,Wl)}:Wl;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Zl=Yl;function Ql(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ec(e,t,s){if(!t)return e;const i=s&&s.encode||Ql,n=s&&s.serialize;let a;if(a=n?n(t,s):Hl.isURLSearchParams(t)?t.toString():new Zl(t,s).toString(i),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const tc=class{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!s&&s.synchronous,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Hl.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},sc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ic={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zl,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nc="undefined"!=typeof window&&"undefined"!=typeof document,ac="object"==typeof navigator&&navigator||void 0,rc=nc&&(!ac||["ReactNative","NativeScript","NS"].indexOf(ac.product)<0),oc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,lc=nc&&window.location.href||"http://localhost",cc={...i,...ic};const uc=function(e){function t(e,s,i,n){let a=e[n++];if("__proto__"===a)return!0;const r=Number.isFinite(+a),o=n>=e.length;if(a=!a&&Hl.isArray(i)?i.length:a,o)return Hl.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!r;i[a]&&Hl.isObject(i[a])||(i[a]=[]);return t(e,s,i[a],n)&&Hl.isArray(i[a])&&(i[a]=function(e){const t={},s=Object.keys(e);let i;const n=s.length;let a;for(i=0;i{t(function(e){return Hl.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,s,0)})),s}return null};const hc={transitional:sc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",i=s.indexOf("application/json")>-1,n=Hl.isObject(e);n&&Hl.isHTMLForm(e)&&(e=new FormData(e));if(Hl.isFormData(e))return i?JSON.stringify(uc(e)):e;if(Hl.isArrayBuffer(e)||Hl.isBuffer(e)||Hl.isStream(e)||Hl.isFile(e)||Hl.isBlob(e)||Hl.isReadableStream(e))return e;if(Hl.isArrayBufferView(e))return e.buffer;if(Hl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Jl(e,new cc.classes.URLSearchParams,Object.assign({visitor:function(e,t,s,i){return cc.isNode&&Hl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Hl.isFileList(e))||s.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Jl(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),function(e,t,s){if(Hl.isString(e))try{return(t||JSON.parse)(e),Hl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(s||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||hc.transitional,s=t&&t.forcedJSONParsing,i="json"===this.responseType;if(Hl.isResponse(e)||Hl.isReadableStream(e))return e;if(e&&Hl.isString(e)&&(s&&!this.responseType||i)){const s=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw zl.from(e,zl.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cc.classes.FormData,Blob:cc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hl.forEach(["delete","get","head","post","put","patch"],(e=>{hc.headers[e]={}}));const dc=hc,pc=Hl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mc=Symbol("internals");function fc(e){return e&&String(e).trim().toLowerCase()}function vc(e){return!1===e||null==e?e:Hl.isArray(e)?e.map(vc):String(e)}function gc(e,t,s,i,n){return Hl.isFunction(i)?i.call(this,t,s):(n&&(t=s),Hl.isString(t)?Hl.isString(i)?-1!==t.indexOf(i):Hl.isRegExp(i)?i.test(t):void 0:void 0)}class _c{constructor(e){e&&this.set(e)}set(e,t,s){const i=this;function n(e,t,s){const n=fc(t);if(!n)throw new Error("header name must be a non-empty string");const a=Hl.findKey(i,n);(!a||void 0===i[a]||!0===s||void 0===s&&!1!==i[a])&&(i[a||t]=vc(e))}const a=(e,t)=>Hl.forEach(e,((e,s)=>n(e,s,t)));if(Hl.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Hl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let s,i,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),s=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!s||t[s]&&pc[s]||("set-cookie"===s?t[s]?t[s].push(i):t[s]=[i]:t[s]=t[s]?t[s]+", "+i:i)})),t})(e),t);else if(Hl.isHeaders(e))for(const[t,i]of e.entries())n(i,t,s);else null!=e&&n(t,e,s);return this}get(e,t){if(e=fc(e)){const s=Hl.findKey(this,e);if(s){const e=this[s];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=s.exec(e);)t[i[1]]=i[2];return t}(e);if(Hl.isFunction(t))return t.call(this,e,s);if(Hl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=fc(e)){const s=Hl.findKey(this,e);return!(!s||void 0===this[s]||t&&!gc(0,this[s],s,t))}return!1}delete(e,t){const s=this;let i=!1;function n(e){if(e=fc(e)){const n=Hl.findKey(s,e);!n||t&&!gc(0,s[n],n,t)||(delete s[n],i=!0)}}return Hl.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let s=t.length,i=!1;for(;s--;){const n=t[s];e&&!gc(0,this[n],n,e,!0)||(delete this[n],i=!0)}return i}normalize(e){const t=this,s={};return Hl.forEach(this,((i,n)=>{const a=Hl.findKey(s,n);if(a)return t[a]=vc(i),void delete t[n];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,s)=>t.toUpperCase()+s))}(n):String(n).trim();r!==n&&delete t[n],t[r]=vc(i),s[r]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Hl.forEach(this,((s,i)=>{null!=s&&!1!==s&&(t[i]=e&&Hl.isArray(s)?s.join(", "):s)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach((e=>s.set(e))),s}static accessor(e){const t=(this[mc]=this[mc]={accessors:{}}).accessors,s=this.prototype;function i(e){const i=fc(e);t[i]||(!function(e,t){const s=Hl.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+s,{value:function(e,s,n){return this[i].call(this,t,e,s,n)},configurable:!0})}))}(s,e),t[i]=!0)}return Hl.isArray(e)?e.forEach(i):i(e),this}}_c.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Hl.reduceDescriptors(_c.prototype,(({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[s]=e}}})),Hl.freezeMethods(_c);const bc=_c;function yc(e,t){const s=this||dc,i=t||s,n=bc.from(i.headers);let a=i.data;return Hl.forEach(e,(function(e){a=e.call(s,a,n.normalize(),t?t.status:void 0)})),n.normalize(),a}function $c(e){return!(!e||!e.__CANCEL__)}function wc(e,t,s){zl.call(this,null==e?"canceled":e,zl.ERR_CANCELED,t,s),this.name="CanceledError"}Hl.inherits(wc,zl,{__CANCEL__:!0});const kc=wc;function Cc(e,t,s){const i=s.config.validateStatus;s.status&&i&&!i(s.status)?t(new zl("Request failed with status code "+s.status,[zl.ERR_BAD_REQUEST,zl.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s)):e(s)}const xc=function(e,t){e=e||10;const s=new Array(e),i=new Array(e);let n,a=0,r=0;return t=void 0!==t?t:1e3,function(o){const l=Date.now(),c=i[r];n||(n=l),s[a]=o,i[a]=l;let u=r,h=0;for(;u!==a;)h+=s[u++],u%=e;if(a=(a+1)%e,a===r&&(r=(r+1)%e),l-n{n=a,s=null,i&&(clearTimeout(i),i=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-n;o>=a?r(e,t):(s=e,i||(i=setTimeout((()=>{i=null,r(s)}),a-o)))},()=>s&&r(s)]},Sc=(e,t,s=3)=>{let i=0;const n=xc(50,250);return Tc((s=>{const a=s.loaded,r=s.lengthComputable?s.total:void 0,o=a-i,l=n(o);i=a;e({loaded:a,total:r,progress:r?a/r:void 0,bytes:o,rate:l||void 0,estimated:l&&r&&a<=r?(r-a)/l:void 0,event:s,lengthComputable:null!=r,[t?"download":"upload"]:!0})}),s)},Oc=(e,t)=>{const s=null!=e;return[i=>t[0]({lengthComputable:s,total:e,loaded:i}),t[1]]},Ec=e=>(...t)=>Hl.asap((()=>e(...t))),jc=cc.hasStandardBrowserEnv?function(){const e=cc.navigator&&/(msie|trident)/i.test(cc.navigator.userAgent),t=document.createElement("a");let s;function i(s){let i=s;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return s=i(window.location.href),function(e){const t=Hl.isString(e)?i(e):e;return t.protocol===s.protocol&&t.host===s.host}}():function(){return!0},Nc=cc.hasStandardBrowserEnv?{write(e,t,s,i,n,a){const r=[e+"="+encodeURIComponent(t)];Hl.isNumber(s)&&r.push("expires="+new Date(s).toGMTString()),Hl.isString(i)&&r.push("path="+i),Hl.isString(n)&&r.push("domain="+n),!0===a&&r.push("secure"),document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Pc(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ac=e=>e instanceof bc?{...e}:e;function Ic(e,t){t=t||{};const s={};function i(e,t,s){return Hl.isPlainObject(e)&&Hl.isPlainObject(t)?Hl.merge.call({caseless:s},e,t):Hl.isPlainObject(t)?Hl.merge({},t):Hl.isArray(t)?t.slice():t}function n(e,t,s){return Hl.isUndefined(t)?Hl.isUndefined(e)?void 0:i(void 0,e,s):i(e,t,s)}function a(e,t){if(!Hl.isUndefined(t))return i(void 0,t)}function r(e,t){return Hl.isUndefined(t)?Hl.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(s,n,a){return a in t?i(s,n):a in e?i(void 0,s):void 0}const l={url:a,method:a,data:a,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:o,headers:(e,t)=>n(Ac(e),Ac(t),!0)};return Hl.forEach(Object.keys(Object.assign({},e,t)),(function(i){const a=l[i]||n,r=a(e[i],t[i],i);Hl.isUndefined(r)&&a!==o||(s[i]=r)})),s}const Rc=e=>{const t=Ic({},e);let s,{data:i,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:r,headers:o,auth:l}=t;if(t.headers=o=bc.from(o),t.url=ec(Pc(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Hl.isFormData(i))if(cc.hasStandardBrowserEnv||cc.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(s=o.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(cc.hasStandardBrowserEnv&&(n&&Hl.isFunction(n)&&(n=n(t)),n||!1!==n&&jc(t.url))){const e=a&&r&&Nc.read(r);e&&o.set(a,e)}return t},Dc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,s){const i=Rc(e);let n=i.data;const a=bc.from(i.headers).normalize();let r,o,l,c,u,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=i;function m(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(r),i.signal&&i.signal.removeEventListener("abort",r)}let f=new XMLHttpRequest;function v(){if(!f)return;const i=bc.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Cc((function(e){t(e),m()}),(function(e){s(e),m()}),{data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:i,config:e,request:f}),f=null}f.open(i.method.toUpperCase(),i.url,!0),f.timeout=i.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(s(new zl("Request aborted",zl.ECONNABORTED,e,f)),f=null)},f.onerror=function(){s(new zl("Network Error",zl.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const n=i.transitional||sc;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),s(new zl(t,n.clarifyTimeoutError?zl.ETIMEDOUT:zl.ECONNABORTED,e,f)),f=null},void 0===n&&a.setContentType(null),"setRequestHeader"in f&&Hl.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Hl.isUndefined(i.withCredentials)||(f.withCredentials=!!i.withCredentials),h&&"json"!==h&&(f.responseType=i.responseType),p&&([l,u]=Sc(p,!0),f.addEventListener("progress",l)),d&&f.upload&&([o,c]=Sc(d),f.upload.addEventListener("progress",o),f.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(r=t=>{f&&(s(!t||t.type?new kc(null,e,f):t),f.abort(),f=null)},i.cancelToken&&i.cancelToken.subscribe(r),i.signal&&(i.signal.aborted?r():i.signal.addEventListener("abort",r)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);g&&-1===cc.protocols.indexOf(g)?s(new zl("Unsupported protocol "+g+":",zl.ERR_BAD_REQUEST,e)):f.send(n||null)}))},Fc=(e,t)=>{const{length:s}=e=e?e.filter(Boolean):[];if(t||s){let s,i=new AbortController;const n=function(e){if(!s){s=!0,r();const t=e instanceof Error?e:this.reason;i.abort(t instanceof zl?t:new kc(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,n(new zl(`timeout ${t} of ms exceeded`,zl.ETIMEDOUT))}),t);const r=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)})),e=null)};e.forEach((e=>e.addEventListener("abort",n)));const{signal:o}=i;return o.unsubscribe=()=>Hl.asap(r),o}},Lc=function*(e,t){let s=e.byteLength;if(!t||s{const n=async function*(e,t){for await(const s of Hc(e))yield*Lc(s,t)}(e,t);let a,r=0,o=e=>{a||(a=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await n.next();if(t)return o(),void e.close();let a=i.byteLength;if(s){let e=r+=a;s(e)}e.enqueue(new Uint8Array(i))}catch(e){throw o(e),e}},cancel:e=>(o(e),n.return())},{highWaterMark:2})},Mc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Bc=Mc&&"function"==typeof ReadableStream,zc=Mc&&("function"==typeof TextEncoder?(Vc=new TextEncoder,e=>Vc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vc;const Gc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Kc=Bc&&Gc((()=>{let e=!1;const t=new Request(cc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),qc=Bc&&Gc((()=>Hl.isReadableStream(new Response("").body))),Jc={stream:qc&&(e=>e.body)};var Wc;Mc&&(Wc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Jc[e]&&(Jc[e]=Hl.isFunction(Wc[e])?t=>t[e]():(t,s)=>{throw new zl(`Response type '${e}' is not supported`,zl.ERR_NOT_SUPPORT,s)})})));const Yc=async(e,t)=>{const s=Hl.toFiniteNumber(e.getContentLength());return null==s?(async e=>{if(null==e)return 0;if(Hl.isBlob(e))return e.size;if(Hl.isSpecCompliantForm(e)){const t=new Request(cc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Hl.isArrayBufferView(e)||Hl.isArrayBuffer(e)?e.byteLength:(Hl.isURLSearchParams(e)&&(e+=""),Hl.isString(e)?(await zc(e)).byteLength:void 0)})(t):s},Xc=Mc&&(async e=>{let{url:t,method:s,data:i,signal:n,cancelToken:a,timeout:r,onDownloadProgress:o,onUploadProgress:l,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=Rc(e);c=c?(c+"").toLowerCase():"text";let p,m=Fc([n,a&&a.toAbortSignal()],r);const f=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(l&&Kc&&"get"!==s&&"head"!==s&&0!==(v=await Yc(u,i))){let e,s=new Request(t,{method:"POST",body:i,duplex:"half"});if(Hl.isFormData(i)&&(e=s.headers.get("content-type"))&&u.setContentType(e),s.body){const[e,t]=Oc(v,Sc(Ec(l)));i=Uc(s.body,65536,e,t)}}Hl.isString(h)||(h=h?"include":"omit");const n="credentials"in Request.prototype;p=new Request(t,{...d,signal:m,method:s.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:n?h:void 0});let a=await fetch(p);const r=qc&&("stream"===c||"response"===c);if(qc&&(o||r&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=Hl.toFiniteNumber(a.headers.get("content-length")),[s,i]=o&&Oc(t,Sc(Ec(o),!0))||[];a=new Response(Uc(a.body,65536,s,(()=>{i&&i(),f&&f()})),e)}c=c||"text";let g=await Jc[Hl.findKey(Jc,c)||"text"](a,e);return!r&&f&&f(),await new Promise(((t,s)=>{Cc(t,s,{data:g,headers:bc.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:p})}))}catch(t){if(f&&f(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new zl("Network Error",zl.ERR_NETWORK,e,p),{cause:t.cause||t});throw zl.from(t,t&&t.code,e,p)}}),Zc={http:null,xhr:Dc,fetch:Xc};Hl.forEach(Zc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Qc=e=>`- ${e}`,eu=e=>Hl.isFunction(e)||null===e||!1===e,tu=e=>{e=Hl.isArray(e)?e:[e];const{length:t}=e;let s,i;const n={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let s=t?e.length>1?"since :\n"+e.map(Qc).join("\n"):" "+Qc(e[0]):"as no adapter specified";throw new zl("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i};function su(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new kc(null,e)}function iu(e){su(e),e.headers=bc.from(e.headers),e.data=yc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tu(e.adapter||dc.adapter)(e).then((function(t){return su(e),t.data=yc.call(e,e.transformResponse,t),t.headers=bc.from(t.headers),t}),(function(t){return $c(t)||(su(e),t&&t.response&&(t.response.data=yc.call(e,e.transformResponse,t.response),t.response.headers=bc.from(t.response.headers))),Promise.reject(t)}))}const nu="1.7.7",au={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{au[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}}));const ru={};au.transitional=function(e,t,s){function i(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(s?". "+s:"")}return(s,n,a)=>{if(!1===e)throw new zl(i(n," has been removed"+(t?" in "+t:"")),zl.ERR_DEPRECATED);return t&&!ru[n]&&(ru[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(s,n,a)}};const ou={assertOptions:function(e,t,s){if("object"!=typeof e)throw new zl("options must be an object",zl.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const a=i[n],r=t[a];if(r){const t=e[a],s=void 0===t||r(t,a,e);if(!0!==s)throw new zl("option "+a+" must be "+s,zl.ERR_BAD_OPTION_VALUE)}else if(!0!==s)throw new zl("Unknown option "+a,zl.ERR_BAD_OPTION)}},validators:au},lu=ou.validators;class cu{constructor(e){this.defaults=e,this.interceptors={request:new tc,response:new tc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const s=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?s&&!String(e.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+s):e.stack=s}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ic(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:n}=t;void 0!==s&&ou.assertOptions(s,{silentJSONParsing:lu.transitional(lu.boolean),forcedJSONParsing:lu.transitional(lu.boolean),clarifyTimeoutError:lu.transitional(lu.boolean)},!1),null!=i&&(Hl.isFunction(i)?t.paramsSerializer={serialize:i}:ou.assertOptions(i,{encode:lu.function,serialize:lu.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&Hl.merge(n.common,n[t.method]);n&&Hl.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=bc.concat(a,n);const r=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,h=0;if(!o){const e=[iu.bind(this),void 0];for(e.unshift.apply(e,r),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);h{if(!s._listeners)return;let t=s._listeners.length;for(;t-- >0;)s._listeners[t](e);s._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{s.subscribe(e),t=e})).then(e);return i.cancel=function(){s.unsubscribe(t)},i},e((function(e,i,n){s.reason||(s.reason=new kc(e,i,n),t(s.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new hu((function(t){e=t})),cancel:e}}}const du=hu;const pu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pu).forEach((([e,t])=>{pu[t]=e}));const mu=pu;const fu=function e(t){const s=new uu(t),i=Xo(uu.prototype.request,s);return Hl.extend(i,uu.prototype,s,{allOwnKeys:!0}),Hl.extend(i,s,null,{allOwnKeys:!0}),i.create=function(s){return e(Ic(t,s))},i}(dc);fu.Axios=uu,fu.CanceledError=kc,fu.CancelToken=du,fu.isCancel=$c,fu.VERSION=nu,fu.toFormData=Jl,fu.AxiosError=zl,fu.Cancel=fu.CanceledError,fu.all=function(e){return Promise.all(e)},fu.spread=function(e){return function(t){return e.apply(null,t)}},fu.isAxiosError=function(e){return Hl.isObject(e)&&!0===e.isAxiosError},fu.mergeConfig=Ic,fu.AxiosHeaders=bc,fu.formToJSON=e=>uc(Hl.isHTMLForm(e)?new FormData(e):e),fu.getAdapter=tu,fu.HttpStatusCode=mu,fu.default=fu;const vu=fu,gu={address:Oa.base_url.replace("http","ws")+"/elecV2P",trynum:0,trying:!1,reconnectnum:5,reconnectgap:10,wsrecv:{connected:!1,add(e,t){if(e&&"function"==typeof t)return this.lists[e]?this.lists[e].push(t):(this.lists[e]=[t],this.id&&function(e){if(gu.wsrecv.send)gu.wsrecv.send("ready",e);else{const t={times:5,gap:3};t.tmpInt=setInterval((()=>{gu.wsrecv.send?(gu.wsrecv.send("ready",e),clearInterval(t.tmpInt),delete t.tmpInt):t.times<=0?(console.debug("wsrecv no send method yet"),clearInterval(t.tmpInt),delete t.tmpInt):t.times--}),1e3*t.gap)}}(e)),this.connected?void 0:"websocket "+lr("disconnected");console.error("websocket recver and a callbak function is expect")},dispatch(e,t){this.lists.minishell&&this.lists.minishell.forEach((s=>s({type:e,data:t}))),"minishell"!==e&&this.lists[e]?this.lists[e].forEach((e=>e(t))):this.lists.minishell||console.debug("there are no recver",e,"to render data",t)},lists:{},connect(){_u()}},upstatus(e){this.wsrecv.lists.elecV2Pstatus&&this.wsrecv.lists.elecV2Pstatus.forEach((t=>t({clients:e})))}};async function _u(){if(gu.trynum++,gu.wsrecv.connected)return void console.log(`[${Ba("websocket info")}][${Ha(null,1)}] websocket ${lr("connected")}`);if(gu.trying)return void console.log(`[${Ba("websocket info")}][${Ha(null,1)}] websocket is trying to connect...`);console.log(`[${Ba("websocket info")}][${Ha(null,1)}] 第 ${gu.trynum} 次尝试 websocket 连接中`),gu.upstatus(`第 ${gu.trynum} 次尝试连接中`);const e=new WebSocket(gu.address);gu.trying=!0,e.onopen=()=>{console.log(`[${Ba("websocket info")}][${Ha(null,1)}] WebSocket connected: ${gu.address}`),oo({off:!1}),gu.trynum=0,gu.trying=!1,gu.wsrecv.connected=!0,gu.upstatus(lr("connected")),gu.wsrecv.send=(t,s)=>{e.send(JSON.stringify({type:t,data:s,id:gu.wsrecv.id}))}},e.onmessage=e=>{try{e=JSON.parse(e.data),gu.wsrecv.dispatch(e.type,e.data)}catch(e){console.error("websocket data error:",e)}},e.onclose=e=>{console.error("WebSocket closed",e),gu.wsrecv.connected=!1,1008===e.code||4003===e.code?(gu.upstatus("无访问权限"),gu.wsrecv.dispatch("message",{type:"error",data:[`websocket 连接失败\n${e.reason}`]})):(gu.upstatus(lr("disconnected")),function(){if(gu.trynum>=gu.reconnectnum){let e="连接失败,请检查网络后尝试刷新页面";return console.error(`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`),gu.upstatus(e),gu.wsrecv.dispatch("tasklog",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`),void gu.wsrecv.dispatch("jsmanage",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`)}oo();const e=gu.reconnectgap*gu.trynum+5;console.log(`[${Ba("websocket info")}][${Ha(null,1)}] 客户端将在 ${e} 秒后尝试第 ${gu.trynum+1}/${gu.reconnectnum} 次重连`),gu.upstatus(`${lr("disconnected")},${e} 秒后尝试第 ${gu.trynum+1}/${gu.reconnectnum} 次重连 ${Ha().split(" ").pop()}`),gu.wsrecv.dispatch("tasklog",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${lr("disconnected")},将在 ${e} 秒后尝试重连(如果不是手动断开或网络问题,可能是某个脚本运行出错,导致 elecV2P 重启,请根据 errors.log 和当前时间,找到相应脚本进行修改)`),gu.wsrecv.dispatch("jsmanage",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${lr("disconnected")},将在 ${e} 秒后尝试重连(如果不是手动断开或网络问题,可能是某个脚本运行出错,导致 elecV2P 重启,请根据 errors.log 和当前时间,找到相应脚本进行修改)`),setTimeout((()=>{_u()}),1e3*e)}())},e.onerror=e=>{console.debug("WebSocket error",e),gu.trying=!1,gu.wsrecv.connected=!1}}gu.wsrecv.add("init",(e=>{e.secunset&&!Lr.get("secunset")&&(gu.wsrecv.dispatch("message",{type:"success",data:["当前 webUI 端口所有用户可访问,如部署在公网\n请务必前往 SETTING/设置 界面打开安全访问",{url:"#setting",secd:0}]}),console.log(`[${Ba("elecV2P notify")}][${Ha(null,1)}] 当前 webUI 端口所有用户可访问,如部署在公网请务必前往 SETTING/设置 界面打开安全访问`),Lr.set("secunset","true")),e.vernum?(gu.wsrecv.id=e.id,Object.keys(gu.wsrecv.lists).forEach((e=>{gu.wsrecv.send("ready",e),"jsmanage"!==e&&"tasklog"!==e||gu.wsrecv.lists[e].forEach((e=>e(`[${Ba("websocket info")}][${Ha(null,1)}] websocket ${lr("connected")}`)))})),console.log(`[${Ba("elecV2P info")}][${Ha(null,1)}] 当前 elecV2P 后台版本 ${e.version}`),console.log(`[${Ba("elecV2P info")}][${Ha(null,1)}] 当前 elecV2P webUI 版本 ${Oa.version}`),Oa.vernumco.evui(e),ti.prototype.$message=co.message,ti.prototype.$t=lr,ti.prototype.$ta=function(...e){const t=or[rr.locale]||or[rr.fallbackLocale],s=t.join_gap;return e.map((e=>t[e]||e)).join(s)},ti.config.productionTip=!1,new ti({el:"#app",render:e=>e(Yo)})})()})(); \ No newline at end of file +var n=Object.freeze({}),a=Array.isArray;function r(e){return null==e}function o(e){return null!=e}function l(e){return!0===e}function c(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function u(e){return"function"==typeof e}function h(e){return null!==e&&"object"==typeof e}var d=Object.prototype.toString;function p(e){return"[object Object]"===d.call(e)}function m(e){return"[object RegExp]"===d.call(e)}function f(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function g(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===d?JSON.stringify(e,_,2):String(e)}function _(e,t){return t&&t.__v_isRef?t.value:t}function b(e){var t=parseFloat(e);return isNaN(t)?e:t}function y(e,t){for(var s=Object.create(null),i=e.split(","),n=0;n-1)return e.splice(i,1)}}var k=Object.prototype.hasOwnProperty;function C(e,t){return k.call(e,t)}function x(e){var t=Object.create(null);return function(s){return t[s]||(t[s]=e(s))}}var T=/-(\w)/g,S=x((function(e){return e.replace(T,(function(e,t){return t?t.toUpperCase():""}))})),O=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),E=/\B([A-Z])/g,j=x((function(e){return e.replace(E,"-$1").toLowerCase()}));var N=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function s(s){var i=arguments.length;return i?i>1?e.apply(t,arguments):e.call(t,s):e.call(t)}return s._length=e.length,s};function P(e,t){t=t||0;for(var s=e.length-t,i=new Array(s);s--;)i[s]=e[s+t];return i}function A(e,t){for(var s in t)e[s]=t[s];return e}function I(e){for(var t={},s=0;s0,te=Z&&Z.indexOf("edge/")>0;Z&&Z.indexOf("android");var se=Z&&/iphone|ipad|ipod|ios/.test(Z);Z&&/chrome\/\d+/.test(Z),Z&&/phantomjs/.test(Z);var ie,ne=Z&&Z.match(/firefox\/(\d+)/),ae={}.watch,re=!1;if(X)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){re=!0}}),window.addEventListener("test-passive",null,oe)}catch(e){}var le=function(){return void 0===ie&&(ie=!X&&void 0!==s.g&&(s.g.process&&"server"===s.g.process.env.VUE_ENV)),ie},ce=X&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ue(e){return"function"==typeof e&&/native code/.test(e.toString())}var he,de="undefined"!=typeof Symbol&&ue(Symbol)&&"undefined"!=typeof Reflect&&ue(Reflect.ownKeys);he="undefined"!=typeof Set&&ue(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var pe=null;function me(e){void 0===e&&(e=null),e||pe&&pe._scope.off(),pe=e,e&&e._scope.on()}var fe=function(){function e(e,t,s,i,n,a,r,o){this.tag=e,this.data=t,this.children=s,this.text=i,this.elm=n,this.ns=void 0,this.context=a,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=r,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=o,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),ve=function(e){void 0===e&&(e="");var t=new fe;return t.text=e,t.isComment=!0,t};function ge(e){return new fe(void 0,void 0,void 0,String(e))}function _e(e){var t=new fe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var be=0,ye=[],$e=function(){function e(){this._pending=!1,this.id=be++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var s=0,i=t.length;s0&&(Qe((i=et(i,"".concat(t||"","_").concat(s)))[0])&&Qe(u)&&(h[n]=ge(u.text+i[0].text),i.shift()),h.push.apply(h,i)):c(i)?Qe(u)?h[n]=ge(u.text+i):""!==i&&h.push(ge(i)):Qe(i)&&Qe(u)?h[n]=ge(u.text+i.text):(l(e._isVList)&&o(i.tag)&&r(i.key)&&o(t)&&(i.key="__vlist".concat(t,"_").concat(s,"__")),h.push(i)));return h}function tt(e,t){var s,i,n,r,l=null;if(a(e)||"string"==typeof e)for(l=new Array(e.length),s=0,i=e.length;s0,o=t?!!t.$stable:!r,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(o&&i&&i!==n&&l===i.$key&&!r&&!i.$hasNormal)return i;for(var c in a={},t)t[c]&&"$"!==c[0]&&(a[c]=yt(e,s,c,t[c]))}else a={};for(var u in s)u in a||(a[u]=$t(s,u));return t&&Object.isExtensible(t)&&(t._normalized=a),J(a,"$stable",o),J(a,"$key",l),J(a,"$hasNormal",r),a}function yt(e,t,s,i){var n=function(){var t=pe;me(e);var s=arguments.length?i.apply(null,arguments):i({}),n=(s=s&&"object"==typeof s&&!a(s)?[s]:Ze(s))&&s[0];return me(t),s&&(!n||1===s.length&&n.isComment&&!_t(n))?void 0:s};return i.proxy&&Object.defineProperty(t,s,{get:n,enumerable:!0,configurable:!0}),n}function $t(e,t){return function(){return e[t]}}function wt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};J(t,"_v_attr_proxy",!0),kt(t,e.$attrs,n,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||kt(e._listenersProxy={},e.$listeners,n,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||xt(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:N(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(s){return Be(e,t,s)}))}}}function kt(e,t,s,i,n){var a=!1;for(var r in t)r in e?t[r]!==s[r]&&(a=!0):(a=!0,Ct(e,r,i,n));for(var r in e)r in t||(a=!0,delete e[r]);return a}function Ct(e,t,s,i){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return s[i][t]}})}function xt(e,t){for(var s in t)e[s]=t[s];for(var s in e)s in t||delete e[s]}var Tt=null;function St(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),h(e)?t.extend(e):e}function Ot(e){if(a(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(gs=function(){return _s.now()})}var bs=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function ys(){var e,t;for(vs=gs(),ms=!0,us.sort(bs),fs=0;fsfs&&us[s].id>e.id;)s--;us.splice(s+1,0,e)}else us.push(e);ps||(ps=!0,Kt(ys))}}function ws(e,t){if(e){for(var s=Object.create(null),i=de?Reflect.ownKeys(e):Object.keys(e),n=0;n-1)if(a&&!C(n,"default"))r=!1;else if(""===r||r===j(e)){var l=Vs(String,n.type);(l<0||o-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!m(e)&&e.test(t)}function ai(e,t){var s=e.cache,i=e.keys,n=e._vnode,a=e.$vnode;for(var r in s){var o=s[r];if(o){var l=o.name;l&&!t(l)&&ri(s,r,i,n)}}a.componentOptions.children=void 0}function ri(e,t,s,i){var n=e[t];!n||i&&n.tag===i.tag||n.componentInstance.$destroy(),e[t]=null,w(s,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=Qs++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ge(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var s=e.$options=Object.create(e.constructor.options),i=t._parentVnode;s.parent=t.parent,s._parentVnode=i;var n=i.componentOptions;s.propsData=n.propsData,s._parentListeners=n.listeners,s._renderChildren=n.children,s._componentTag=n.tag,t.render&&(s.render=t.render,s.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Ls(ei(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,s=t.parent;if(s&&!t.abstract){for(;s.$options.abstract&&s.$parent;)s=s.$parent;s.$children.push(e)}e.$parent=s,e.$root=s?s.$root:e,e.$children=[],e.$refs={},e._provided=s?s._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&is(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,s=e.$vnode=t._parentVnode,i=s&&s.context;e.$slots=vt(t._renderChildren,i),e.$scopedSlots=s?bt(e.$parent,s.data.scopedSlots,e.$slots):n,e._c=function(t,s,i,n){return Nt(e,t,s,i,n,!1)},e.$createElement=function(t,s,i,n){return Nt(e,t,s,i,n,!0)};var a=s&&s.data;Ie(e,"$attrs",a&&a.attrs||n,null,!0),Ie(e,"$listeners",t._parentListeners||n,null,!0)}(t),cs(t,"beforeCreate",void 0,!1),function(e){var t=ws(e.$options.inject,e);t&&(je(!1),Object.keys(t).forEach((function(s){Ie(e,s,t[s])})),je(!0))}(t),qs(t),function(e){var t=e.$options.provide;if(t){var s=u(t)?t.call(e):t;if(!h(s))return;for(var i=Ke(e),n=de?Reflect.ownKeys(s):Object.keys(s),a=0;a1?P(s):s;for(var i=P(arguments,1),n='event handler for "'.concat(e,'"'),a=0,r=s.length;aparseInt(this.max)&&ri(t,s[0],s,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)ri(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){ai(e,(function(e){return ni(t,e)}))})),this.$watch("exclude",(function(t){ai(e,(function(e){return!ni(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ot(e),s=t&&t.componentOptions;if(s){var i=ii(s),n=this.include,a=this.exclude;if(n&&(!i||!ni(n,i))||a&&i&&ni(a,i))return t;var r=this.cache,o=this.keys,l=null==t.key?s.Ctor.cid+(s.tag?"::".concat(s.tag):""):t.key;r[l]?(t.componentInstance=r[l].componentInstance,w(o,l),o.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}},ci={KeepAlive:li};!function(e){var t={get:function(){return G}};Object.defineProperty(e,"config",t),e.util={warn:Ns,extend:A,mergeOptions:Ls,defineReactive:Ie},e.set=Re,e.delete=De,e.nextTick=Kt,e.observable=function(e){return Ae(e),e},e.options=Object.create(null),z.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,A(e.options.components,ci),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var s=P(arguments,1);return s.unshift(this),u(e.install)?e.install.apply(e,s):u(e)&&e.apply(null,s),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Ls(this.options,e),this}}(e),si(e),function(e){z.forEach((function(t){e[t]=function(e,s){return s?("component"===t&&p(s)&&(s.name=s.name||e,s=this.options._base.extend(s)),"directive"===t&&u(s)&&(s={bind:s,update:s}),this.options[t+"s"][e]=s,s):this.options[t+"s"][e]}}))}(e)}(ti),Object.defineProperty(ti.prototype,"$isServer",{get:le}),Object.defineProperty(ti.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(ti,"FunctionalRenderContext",{value:ks}),ti.version="2.7.16";var ui=y("style,class"),hi=y("input,textarea,option,select,progress"),di=y("contenteditable,draggable,spellcheck"),pi=y("events,caret,typing,plaintext-only"),mi=y("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),fi="http://www.w3.org/1999/xlink",vi=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},gi=function(e){return vi(e)?e.slice(6,e.length):""},_i=function(e){return null==e||!1===e};function bi(e){for(var t=e.data,s=e,i=e;o(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=yi(i.data,t));for(;o(s=s.parent);)s&&s.data&&(t=yi(t,s.data));return function(e,t){if(o(e)||o(t))return $i(e,wi(t));return""}(t.staticClass,t.class)}function yi(e,t){return{staticClass:$i(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function $i(e,t){return e?t?e+" "+t:e:t||""}function wi(e){return Array.isArray(e)?function(e){for(var t,s="",i=0,n=e.length;i-1?Ki(e,t,s):mi(t)?_i(s)?e.removeAttribute(t):(s="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,s)):di(t)?e.setAttribute(t,function(e,t){return _i(t)||"false"===t?"false":"contenteditable"===e&&pi(t)?t:"true"}(t,s)):vi(t)?_i(s)?e.removeAttributeNS(fi,gi(t)):e.setAttributeNS(fi,t,s):Ki(e,t,s)}function Ki(e,t,s){if(_i(s))e.removeAttribute(t);else{if(Q&&!ee&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==s&&!e.__ieph){var i=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",i)};e.addEventListener("input",i),e.__ieph=!0}e.setAttribute(t,s)}}var qi={create:Vi,update:Vi};function Ji(e,t){var s=t.elm,i=t.data,n=e.data;if(!(r(i.staticClass)&&r(i.class)&&(r(n)||r(n.staticClass)&&r(n.class)))){var a=bi(t),l=s._transitionClasses;o(l)&&(a=$i(a,wi(l))),a!==s._prevClass&&(s.setAttribute("class",a),s._prevClass=a)}}var Wi,Yi={create:Ji,update:Ji},Xi="__r",Zi="__c";function Qi(e,t,s){var i=Wi;return function n(){null!==t.apply(null,arguments)&&sn(e,n,s,i)}}var en=Lt&&!(ne&&Number(ne[1])<=53);function tn(e,t,s,i){if(en){var n=vs,a=t;t=a._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=n||e.timeStamp<=0||e.target.ownerDocument!==document)return a.apply(this,arguments)}}Wi.addEventListener(e,t,re?{capture:s,passive:i}:s)}function sn(e,t,s,i){(i||Wi).removeEventListener(e,t._wrapper||t,s)}function nn(e,t){if(!r(e.data.on)||!r(t.data.on)){var s=t.data.on||{},i=e.data.on||{};Wi=t.elm||e.elm,function(e){if(o(e[Xi])){var t=Q?"change":"input";e[t]=[].concat(e[Xi],e[t]||[]),delete e[Xi]}o(e[Zi])&&(e.change=[].concat(e[Zi],e.change||[]),delete e[Zi])}(s),We(s,i,tn,sn,Qi,t.context),Wi=void 0}}var an,rn={create:nn,update:nn,destroy:function(e){return nn(e,Ai)}};function on(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var s,i,n=t.elm,a=e.data.domProps||{},c=t.data.domProps||{};for(s in(o(c.__ob__)||l(c._v_attr_proxy))&&(c=t.data.domProps=A({},c)),a)s in c||(n[s]="");for(s in c){if(i=c[s],"textContent"===s||"innerHTML"===s){if(t.children&&(t.children.length=0),i===a[s])continue;1===n.childNodes.length&&n.removeChild(n.childNodes[0])}if("value"===s&&"PROGRESS"!==n.tagName){n._value=i;var u=r(i)?"":String(i);ln(n,u)&&(n.value=u)}else if("innerHTML"===s&&xi(n.tagName)&&r(n.innerHTML)){(an=an||document.createElement("div")).innerHTML="".concat(i,"");for(var h=an.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;h.firstChild;)n.appendChild(h.firstChild)}else if(i!==a[s])try{n[s]=i}catch(e){}}}}function ln(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var s=!0;try{s=document.activeElement!==e}catch(e){}return s&&e.value!==t}(e,t)||function(e,t){var s=e.value,i=e._vModifiers;if(o(i)){if(i.number)return b(s)!==b(t);if(i.trim)return s.trim()!==t.trim()}return s!==t}(e,t))}var cn={create:on,update:on},un=x((function(e){var t={},s=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var i=e.split(s);i.length>1&&(t[i[0].trim()]=i[1].trim())}})),t}));function hn(e){var t=dn(e.style);return e.staticStyle?A(e.staticStyle,t):t}function dn(e){return Array.isArray(e)?I(e):"string"==typeof e?un(e):e}var pn,mn=/^--/,fn=/\s*!important$/,vn=function(e,t,s){if(mn.test(t))e.style.setProperty(t,s);else if(fn.test(s))e.style.setProperty(j(t),s.replace(fn,""),"important");else{var i=_n(t);if(Array.isArray(s))for(var n=0,a=s.length;n-1?t.split($n).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var s=" ".concat(e.getAttribute("class")||""," ");s.indexOf(" "+t+" ")<0&&e.setAttribute("class",(s+t).trim())}}function kn(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split($n).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var s=" ".concat(e.getAttribute("class")||""," "),i=" "+t+" ";s.indexOf(i)>=0;)s=s.replace(i," ");(s=s.trim())?e.setAttribute("class",s):e.removeAttribute("class")}}function Cn(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,xn(e.name||"v")),A(t,e),t}return"string"==typeof e?xn(e):void 0}}var xn=x((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),Tn=X&&!ee,Sn="transition",On="animation",En="transition",jn="transitionend",Nn="animation",Pn="animationend";Tn&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(En="WebkitTransition",jn="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Nn="WebkitAnimation",Pn="webkitAnimationEnd"));var An=X?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function In(e){An((function(){An(e)}))}function Rn(e,t){var s=e._transitionClasses||(e._transitionClasses=[]);s.indexOf(t)<0&&(s.push(t),wn(e,t))}function Dn(e,t){e._transitionClasses&&w(e._transitionClasses,t),kn(e,t)}function Fn(e,t,s){var i=Hn(e,t),n=i.type,a=i.timeout,r=i.propCount;if(!n)return s();var o=n===Sn?jn:Pn,l=0,c=function(){e.removeEventListener(o,u),s()},u=function(t){t.target===e&&++l>=r&&c()};setTimeout((function(){l0&&(s=Sn,u=r,h=a.length):t===On?c>0&&(s=On,u=c,h=l.length):h=(s=(u=Math.max(r,c))>0?r>c?Sn:On:null)?s===Sn?a.length:l.length:0,{type:s,timeout:u,propCount:h,hasTransform:s===Sn&&Ln.test(i[En+"Property"])}}function Un(e,t){for(;e.length1}function Kn(e,t){!0!==t.data.show&&Bn(t)}var qn=function(e){var t,s,i={},n=e.modules,u=e.nodeOps;for(t=0;tm?b(e,r(s[g+1])?null:s[g+1].elm,s,p,g,i):p>g&&w(t,h,m)}(h,f,g,s,c):o(g)?(o(e.text)&&u.setTextContent(h,""),b(h,null,g,0,g.length-1,s)):o(f)?w(f,0,f.length-1):o(e.text)&&u.setTextContent(h,""):e.text!==t.text&&u.setTextContent(h,t.text),o(m)&&o(p=m.hook)&&o(p=p.postpatch)&&p(e,t)}}}function T(e,t,s){if(l(s)&&o(e.parent))e.parent.data.pendingInsert=t;else for(var i=0;i-1,r.selected!==a&&(r.selected=a);else if(L(Zn(r),i))return void(e.selectedIndex!==o&&(e.selectedIndex=o));n||(e.selectedIndex=-1)}}function Xn(e,t){return t.every((function(t){return!L(t,e)}))}function Zn(e){return"_value"in e?e._value:e.value}function Qn(e){e.target.composing=!0}function ea(e){e.target.composing&&(e.target.composing=!1,ta(e.target,"input"))}function ta(e,t){var s=document.createEvent("HTMLEvents");s.initEvent(t,!0,!0),e.dispatchEvent(s)}function sa(e){return!e.componentInstance||e.data&&e.data.transition?e:sa(e.componentInstance._vnode)}var ia={bind:function(e,t,s){var i=t.value,n=(s=sa(s)).data&&s.data.transition,a=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;i&&n?(s.data.show=!0,Bn(s,(function(){e.style.display=a}))):e.style.display=i?a:"none"},update:function(e,t,s){var i=t.value;!i!=!t.oldValue&&((s=sa(s)).data&&s.data.transition?(s.data.show=!0,i?Bn(s,(function(){e.style.display=e.__vOriginalDisplay})):zn(s,(function(){e.style.display="none"}))):e.style.display=i?e.__vOriginalDisplay:"none")},unbind:function(e,t,s,i,n){n||(e.style.display=e.__vOriginalDisplay)}},na={model:Jn,show:ia},aa={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ra(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?ra(Ot(t.children)):e}function oa(e){var t={},s=e.$options;for(var i in s.propsData)t[i]=e[i];var n=s._parentListeners;for(var i in n)t[S(i)]=n[i];return t}function la(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ca=function(e){return e.tag||_t(e)},ua=function(e){return"show"===e.name},ha={name:"transition",props:aa,abstract:!0,render:function(e){var t=this,s=this.$slots.default;if(s&&(s=s.filter(ca)).length){0;var i=this.mode;0;var n=s[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return n;var a=ra(n);if(!a)return n;if(this._leaving)return la(e,n);var r="__transition-".concat(this._uid,"-");a.key=null==a.key?a.isComment?r+"comment":r+a.tag:c(a.key)?0===String(a.key).indexOf(r)?a.key:r+a.key:a.key;var o=(a.data||(a.data={})).transition=oa(this),l=this._vnode,u=ra(l);if(a.data.directives&&a.data.directives.some(ua)&&(a.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,u)&&!_t(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=A({},o);if("out-in"===i)return this._leaving=!0,Ye(h,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),la(e,n);if("in-out"===i){if(_t(a))return l;var d,p=function(){d()};Ye(o,"afterEnter",p),Ye(o,"enterCancelled",p),Ye(h,"delayLeave",(function(e){d=e}))}}return n}}},da=A({tag:String,moveClass:String},aa);delete da.mode;var pa={props:da,beforeMount:function(){var e=this,t=this._update;this._update=function(s,i){var n=as(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,n(),t.call(e,s,i)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",s=Object.create(null),i=this.prevChildren=this.children,n=this.$slots.default||[],a=this.children=[],r=oa(this),o=0;o-1?Si[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Si[e]=/HTMLUnknownElement/.test(t.toString())},A(ti.options.directives,na),A(ti.options.components,ga),ti.prototype.__patch__=X?qn:R,ti.prototype.$mount=function(e,t){return function(e,t,s){var i;e.$el=t,e.$options.render||(e.$options.render=ve),cs(e,"beforeMount"),i=function(){e._update(e._render(),s)},new Qt(e,i,R,{before:function(){e._isMounted&&!e._isDestroyed&&cs(e,"beforeUpdate")}},!0),s=!1;var n=e._preWatchers;if(n)for(var a=0;a":"<"))])]),e._v(" "),t("div",{staticClass:"sider_trigger sider_trigger--mobile",on:{click:function(t){e.sidermobile=!e.sidermobile}}},[t("span",[e._v(e._s(e.sidermobile?"☰":"X"))])])]),e._v(" "),t("keep-alive",[t(e.currentpanel,{tag:"panel",staticClass:"section",on:{menunav:e.menunav,theme:e.themeApply}})],1)],1)};_a._withStripped=!0;const ba=s.p+"3a67c6573243e7be6b9246ac6542ae72.png";var ya=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$t("overview")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"overview"},[t("div",{staticClass:"overview_ports"},[t("a",{staticClass:"overview_item overview_item--big",attrs:{href:"./logs/",target:e.isPwa?"_self":"elecV2PLOGS"}},[e._v(e._s(e.$t("logs_of_script")))]),e._v(" "),t("a",{staticClass:"overview_item overview_item--big",attrs:{href:"./efss/",target:e.isPwa?"_self":"elecV2PEFSS"}},[e._v(e._s(e.$t("efss_file_manage")))]),e._v(" "),t("div",{staticClass:"overview_item overview_item--big",class:{"overview_item--disable":!e.anyproxy.enable},attrs:{title:"双击打开/关闭(代理端口不是网页,不能直接访问)"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.eopbtn.open,expression:"eopbtn.open"}],staticClass:"overview_btn",on:{click:function(t){return e.eproxyToggle("open")}}},[e._v(e._s(e.$t("open")))]),e._v(" "),t("span",{on:{click:function(t){return e.eproxyBtn()},dblclick:function(t){return e.eproxyToggle()}}},[e._v("ANYPROXY "+e._s(e.$t("port"))+": "+e._s(e.anyproxy.port))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.eopbtn.close,expression:"eopbtn.close"}],staticClass:"overview_btn overview_btn--close",on:{click:function(t){return e.eproxyToggle("close")}}},[e._v(e._s(e.$t("close")))])]),e._v(" "),t("div",{staticClass:"overview_item overview_item--big",class:{"overview_item--disable":!e.anyproxy.enable},on:{click:function(t){return e.webifOpen()}}},[e._v("ANYPROXY "+e._s(e.$t("logs"))+": "+e._s(e.anyproxy.webPort))])]),e._v(" "),t("div",{staticClass:"overview_rules",attrs:{title:"该部分数据在每次刷新页面时更新"}},[t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.rule},attrs:{"data-method":"nav","data-panel":"rules"}},[e._v("RULES: "+e._s(e.ruleslen))]),e._v(" "),t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.rewrite},attrs:{"data-method":"nav","data-panel":"rewrite"}},[e._v("REWRITE: "+e._s(e.rewriteslen))]),e._v(" "),t("span",{staticClass:"overview_item",attrs:{"data-method":"nav","data-panel":"task"}},[e._v("TASKS: "+e._s(e.taskstatus))]),e._v(" "),t("span",{staticClass:"overview_item",attrs:{"data-method":"nav","data-panel":"jsmanage"}},[e._v("SCRIPTS: "+e._s(e.jslistslen))]),e._v(" "),t("span",{staticClass:"overview_item",class:{"overview_item--disable":!e.enablelist.mitmhost},attrs:{"data-method":"nav","data-panel":"mitm"}},[e._v("MITM HOST: "+e._s(e.mitmhostlen))])])]),e._v(" "),t("status",{attrs:{sysinfo:e.sysinfo},on:{ovInit:function(t){e.ovInit(),e.eappfresh=!e.eappfresh}}}),e._v(" "),t("eapp",{attrs:{fresh:e.eappfresh}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("span",{staticClass:"cursor",class:{newversion:e.newversion},attrs:{title:"当前后台版本号,点击获取更新日志"},on:{click:function(t){return e.showUplog()}}},[e._v(e._s(e.$t("version"))+": "+e._s(e.version))]),e._v(" "),t("span",{on:{mouseover:e.runHour}},[e._v(e._s(e.$t("startat"))+": "+e._s(e.start))])])])};ya._withStripped=!0;var $a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"status"},[t("div",{staticClass:"title title--radius",class:{trasbk:e.boffline}},[t("span",{staticClass:"title_main mleft30 cursor",on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.cinfo_show=!e.cinfo_show}}},[e._v(e._s(e.$t("con_clients"))+": "+e._s(e.clients))]),e._v(" "),t("span",{staticClass:"icon cursor title_sync",attrs:{title:"刷新当前页面数据"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.ovUpdate()}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.cinfo_show,expression:"cinfo_show"}],staticClass:"cinfo"},e._l(e.clientsitem,(function(s,i){return t("div",{key:i,staticClass:"cinfo_item border_top1",class:{greenbk:i===e.$wsrecv.id},attrs:{title:(i===e.$wsrecv.id?"当前客户端 ":"其他客户端 ")+i}},[e._v(e._s(s))])})),0),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.sysinfo,expression:"sysinfo"}],staticClass:"hoststatus",attrs:{title:"该部分数据仅在刷新页面时更新"}},[t("h4",{staticClass:"status_title"},[e._v(e._s(e.$t("host_info")))]),e._v(" "),t("div",{staticClass:"status_memoryusage"},[t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("arch"))+": "+e._s(e.sysinfo.arch))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("platform"))+": "+e._s(e.sysinfo.platform))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v(e._s(e.$t("memory"))+": "+e._s(e.sysinfo.memory))]),e._v(" "),t("span",{staticClass:"status_item",attrs:{title:"服务器持续运行时间"}},[e._v("UPTIME: "+e._s(e.sysinfo.uptime))]),e._v(" "),t("span",{staticClass:"status_item"},[e._v("NODEJS: "+e._s(e.sysinfo.nodever))])])]),e._v(" "),t("div",{staticClass:"memorystatus"},[t("h4",{staticClass:"status_title"},[e._v("elecV2P "+e._s(e.$t("memoryusage"))),t("span",{staticClass:"status_toggle",attrs:{title:e.statussendflag?"暂停更新":"保持传输"},domProps:{innerHTML:e._s(e.statussendflag?e.icon.stop:e.icon.plays)},on:{click:function(t){return e.statusSendToggle()}}})]),e._v(" "),t("div",{staticClass:"status_memoryusage"},e._l(e.memoryusage,(function(s,i){return t("span",{key:i,staticClass:"status_item"},[e._v(e._s(i)+": "+e._s(s))])})),0)]),e._v(" "),e.jsruntotal?t("div",{staticClass:"jsrunstatus"},[t("h4",{staticClass:"status_title"},[e._v(e._s(e.$t("jsruntimes"))+" - "+e._s(e.jsruntotal))]),e._v(" "),t("div",{staticClass:"status_jsdetail",on:{click:function(t){return t.preventDefault(),e.logGate(t)}}},e._l(e.jsrundetail,(function(s,i){return t("span",{key:i,staticClass:"status_item cursor",attrs:{"data-method":"open","data-param":i}},[e._v(e._s(i)+": "+e._s(s))])})),0)]):e._e()])};$a._withStripped=!0;const wa={home:'',pause:'',sync:'',delete:'',play:'',plays:'',downcircle:'',upcircle:'',stop:'',clear:'',success:'',error:'',loading:'',overview:'',rules:'',rewrite:'',jsmanage:'',task:'',mitm:'',cfilter:'',setting:'',about:'',donation:''};function ka(e,t,s,i,n,a,r,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=s,c._compiled=!0),i&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),r?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):n&&(l=o?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}const Ca=ka({name:"status",props:["sysinfo"],data:()=>({clients:0,memoryusage:{},jsruntotal:0,jsrundetail:{},statussendflag:!0,icon:wa,clientsinfo:{},cinfo_show:!1}),computed:{boffline(){return"number"!=typeof this.clients},clientsitem(){let e={};for(let t in this.clientsinfo){let s="";for(let e in this.clientsinfo[t])s+=`${e}: ${this.clientsinfo[t][e]} `;e[t]=s.trim()}return e}},created(){this.$wsrecv.add("elecV2Pstatus",(e=>{this.clients=e.clients,e.memoryusage&&(this.memoryusage=e.memoryusage),this.statussendflag=!0,e.clientsinfo&&(this.clientsinfo=e.clientsinfo)})),this.$wsrecv.add("jsrunstatus",(e=>{this.jsruntotal=e.total,this.jsrundetail=e.detail}))},methods:{ovUpdate(){this.$emit("ovInit"),this.$wsrecv.connected||this.$wsrecv.connect()},statusSendToggle(){this.$wsrecv.connected?(this.$wsrecv.send("stopsendstatus",this.statussendflag),this.statussendflag=!this.statussendflag):this.$message.error("当前 websocket 已断开,请连接后再试")},logGate(e){let t=event.target.dataset.param;event.target.dataset.method,this.$uApi.open("./logs/"+t.replace(/\/|\\/g,"-")+".log")}}},$a,[],!1,null,"cf229bcc",null).exports;var xa=function(){var e=this,t=e._self._c;return e.eapp.enable?t("div",{staticClass:"eapp"},[t("div",{staticClass:"eapp_container"},[e._l(e.apps,(function(s,i){return t("div",{key:s.hash,staticClass:"eapp_item",class:{"eapp_item--run":e.bRun[i]},attrs:{draggable:e.bEdit},on:{dragstart:function(t){return e.dragStart(t,i)},dragenter:function(t){return e.dragEnter(t,i)},dragend:function(t){return e.dragEnd(t,i)}}},[t("img",{staticClass:"eapp_logo",class:{shake:e.bEdit,"shake--alt":i%2},attrs:{src:e.applogo[i],alt:s.target,"data-param":i,title:s.note||s.target},on:{click:function(t){return t.preventDefault(),e.epOpera(i)},error:function(t){return e.epLogoErr(i,t)}}}),e._v(" "),t("span",{staticClass:"eapp_name",attrs:{title:s.name}},[e._v(e._s(s.name))]),e._v(" "),t("span",{staticClass:"eapp_delete",class:{hide:!e.bEdit},on:{click:function(t){return t.preventDefault(),e.epMove(i)}}},[e._v("X")])])})),e._v(" "),t("div",{staticClass:"eapp_item eapp_item--edit"},[e.bEdit?t("select",{directives:[{name:"model",rawName:"v-model.number",value:e.eapp.logo_type,expression:"eapp.logo_type",modifiers:{number:!0}}],staticClass:"elecBtn elecBtn--h36 minw100",attrs:{title:e.$t("choose")+" LOGO "+e.$t("style")},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(t){var s="_value"in t?t._value:t.value;return e._n(s)}));e.$set(e.eapp,"logo_type",t.target.multiple?s:s[0])}}},[t("option",{attrs:{value:"1",selected:""}},[e._v(e._s(e.$t("style"))+" 1")]),e._v(" "),t("option",{attrs:{value:"2"}},[e._v(e._s(e.$t("style"))+" 2")]),e._v(" "),t("option",{attrs:{value:"3"}},[e._v(e._s(e.$t("style"))+" 3")])]):t("button",{staticClass:"elecBtn elecBtn--h36 bk_main_bk",on:{click:function(t){return t.preventDefault(),e.epEdit()}}},[e._v(e._s(e.$t("neweapp")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h36",class:{bk_main_bk:!e.bEdit},on:{click:function(t){return t.preventDefault(),e.epSave()}}},[e._v(e._s(e.bEdit?e.$t("editexit"):e.$t("editmode")))])])],2),e._v(" "),t("log",{attrs:{logs:e.logs,title:"EAPP "+e.$t("logs")}})],1):e._e()};xa._withStripped=!0;var Ta=function(){var e=this,t=e._self._c;return t("div",{staticClass:"loginfo",class:{"loginfo--full":!e.collapse.loginfo},attrs:{tabindex:"-1"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.collapse.loginfo=!0))}}},[t("h3",{staticClass:"loginfo_title"},[t("span",{staticClass:"loginfo_clear icon",attrs:{title:e.$t("clear")+e.$t("logs")},domProps:{innerHTML:e._s(e.icon.clear)},on:{click:function(t){return e.logs.splice(0)}}}),e._v(" "),t("span",[e._v(e._s(e.title||"elecV2P "+e.$t("logs")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.loginfo},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.loginfo=!e.collapse.loginfo}}})]),e._v(" "),t("div",{staticClass:"logcontext"},e._l(e.logobj,(function({log:s,key:i}){return t("span",{key:i,staticClass:"loginfo_item",domProps:{innerHTML:e._s(s)}})})),0)])};Ta._withStripped=!0;var Sa=s(724);const Oa={base_url:location.origin,glogslicebegin:0,version:"3.8.2"};function Ea(e){return"object"!=typeof e?typeof e:Object.prototype.toString.call(e).slice(8,-1).toLowerCase()||"object"}function ja(e,t=!1){if(!e)return!!t&&Object.create(null);switch(Ea(e)){case"array":case"object":return e;case"set":return Array.from(e);case"map":return Array.from(e).reduce(((e,[t,s])=>(e[t]=s,e)),{})}try{let t=JSON.parse(e);if("object"==typeof t)return t}catch(t){try{let t=new Function("return "+e)();if(/^(object|array)$/.test(Ea(t)))return t}catch(e){}}return!!t&&{0:e}}function Na(e){if(null==e)return"";let t=Ea(e);switch(t){case"string":return e.trim();case"map":case"set":return JSON.stringify({dataType:t,value:Array.from(e)});case"array":case"object":try{return e[Symbol.toPrimitive]?String(e[Symbol.toPrimitive]()):JSON.stringify(e)}catch(e){return e.message}default:return String(e).trim()}}function Pa(e){if(!e)return!1;if("boolean"==typeof e)return e;if("string"!=typeof e)return!0;switch(e=e.trim()){case"":case"0":case"false":case"null":case"undefined":case"NaN":return!1;default:return!0}}function Aa(e){return!!(""===Na(e).trim()||/^(object|array)$/.test(Ea(e))&&0===Object.keys(e).length)}function Ia(e){try{return new URL(e)}catch(e){return!1}}function Ra(e=8){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=t[Math.floor(52*Math.random())];for(e--;e--;)s+=t[Math.floor(62*Math.random())];return s}function Da(){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{let s=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?s:3&s|8).toString(16)}))}function Fa(e,t){return void 0===t&&(t=e,e=0),Math.floor(Math.random()*(t-e+1))+e}Oa.vernum=Number(Oa.version.replace(/\D/g,""));const La=6e4*(new Date).getTimezoneOffset();function Ha(e=null,t=0,s=Oa.glogslicebegin){return e=e?Number(e)||Date.parse(e):Date.now(),new Date(e-La).toISOString().slice(s,t?-1:-5).replace("T"," ")}function Ua(e=Date.now()){let t=(Date.now()-e)/1e3/60/60;return t>100?(t/24).toFixed(2)+" days":t.toFixed(2)+" hours"}const Ma=new Map;function Ba(e,t=16){const s=e+t;if(Ma.has(s))return Ma.get(s);const i=function(e,t=16){if(e.length===t)return e;if(e.lengtht){const s=e.split(/\/|\\/);s.length>1&&(e=s[0].slice(0,1)+"/"+s.pop());const i=e.split(" ").pop();return e.slice(0,t-6-i.length)+"..."+e.slice(-i.length-3)}}(e,t);return Ma.set(s,i),i}function za(e=""){if(/[&<>"']/.test(e)){const t={'"':""","'":"'","&":"&","<":"<",">":">"};return e.replace(/[&<>"']/g,(e=>t[e]||e))}return e}function Va(e){return(0,Sa.ansiHtml)(za(e))}function Ga(e){if(!e)return"";let t="",s=e.split(/\/|\\|\?|#/);for(;""===t&&s.length;)t=s.pop();return t}const Ka=[];for(let e=0;e<=255;++e){const t=e.toString(16).padStart(2,"0");Ka.push(t)}function qa(e,t=" ",s=2e4){const i=new Uint8Array(e),n=new Array(i.length);i.length>s?console.debug("arrayBuffer length",i.length,"is too big to tranfer, slice to",s):s=i.length;for(let e=0;eKa.indexOf(e))))}function Wa(e="",t=0){if(!e){if(t<1)return"";e="0"}let s=qa((new TextEncoder).encode(e),"");return 0===t||s.length===t?s:(s.length{const t=i[n++];return n>=i.length&&(a+=1,n=0),e+t*a+i.length})),"")}function Za(e,t="elecV2"){const s=Ja(e,null),i=(new TextEncoder).encode(t);let n=0,a=1;return(new TextDecoder).decode(s.map((e=>{const t=i[n++];return n>=i.length&&(a+=1,n=0),e-t*a-i.length})))}function Qa(e=0,t=1024){return e({icon:wa,logobj:[]}),watch:{logs(e){let t=[];e.forEach(((s,i)=>{"string"==typeof s&&t.push({log:Va(s),key:e.length-i})})),this.logobj=t}}};const tr=ka(er,Ta,[],!1,null,"62593594",null).exports,sr={name:"eapp",props:["fresh"],data:()=>({eapp:{enable:!0,logo_type:1,apps:[]},apps:[],logs:[],bEdit:!1,dragSce:null,dragIdx:-1,toSave:!1,logo_type_org:1}),computed:{applogo(){return this.apps.map((e=>e.logo||this.$uApi.hashToLogo(e.hash,e.name,Number(this.eapp.logo_type))))},bRun(){return this.apps.map((()=>!1))}},watch:{fresh(){this.epInit(!1)}},components:{log:tr},created(){this.$wsrecv.add("eapp",(e=>{this.logs.length>=100||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)})),this.epInit()},methods:{epInit(e=!0){this.$axios.get("/eapp").then((t=>{0===t.data.rescode&&(this.eapp=t.data.resdata,this.apps=this.eapp.apps.filter((e=>e&&e.name&&e.type&&e.target)),e&&this.apps.forEach(((e,t)=>{"auto"===e.run&&(this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] AUTO RUN EAPP: ${e.name}`),this.epOpen(t))})))})).catch((e=>{this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 首页 eapp 列表获取失败 ${e.message}`),console.error("获取失败",e)}))},epOpera(e){this.bEdit?this.epEdit(e):this.epOpen(e)},epLogoErr(e,t){const s=this.apps[e];this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] EAPP ${s.name} logo 加载失败,生成默认图标`),t.target.src=this.$uApi.hashToLogo(s.hash,s.name,this.eapp.logo_type)},epOpen(e=0){const t={...this.apps[e]};if(!(t.name&&t.type&&t.target))return void this.$message.error("eapp 内容不完整");if(this.bRun[e])return void this.$message.success(t.name,"运行中");if(!/%ei%/.test(t.target))return void this.epRun(t,e);let s=t.target.split("%ei%"),i=this.$uStr.escapeHtml(t.target).replace(/%ei%/g,''),n=(this.$axios,this.$message,this.epRun),a="eapp_"+this.$uStr.euid(4);this.$evui({id:a,title:t.name+" - "+t.type.toUpperCase(),width:600,height:null,style:{content:"margin: .3em; font-family: var(--font-fm);"},content:`
${i}
`,methods:{epRun(){let i=document.querySelectorAll(`.${a} .elecTable_input[name=eapp_arg]`),r="";i.forEach(((e,t)=>{r+=s[t]+e.value})),t.target=r+s.pop(),n(t,e)}}})},epRun(e,t){switch(e.type){case"efh":this.$uApi.open("run/?target="+encodeURI(e.target)),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 执行 EFH: ${e.target}`);break;case"url":this.$uApi.open(e.target),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 打开网址: ${e.target}`);break;case"eval":this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] EVALRUN: ${e.name}`),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] EVALRUN RESULT: ${this.$sString(this.$uApi.evalRun(e.target))||"没有返回数据"}`);break;case"shell":case"js":this.$wsrecv.connected||this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] websocket 尚未连接,运行日志无法传输`),this.bRun[t]=!0,this.$axios.post("/eapp/run",{app:e,id:this.$wsrecv.id}).then((s=>{this.bRun[t]=!1,0===s.data.rescode?this.logs.unshift(`[${this.$logHead("eapp info")}][${this.$sTime(null,1)}] ${s.data.message}`):this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 执行 ${e.target} 失败 ${s.data.message}`)})).catch((s=>{this.bRun[t]=!1,this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 执行 ${e.target} 失败 ${s.message}`),console.error(e.target,"执行失败",s)}));break;default:this.$message.error(`未知 EAPP 类型: ${e.type}`),this.logs.unshift(`[${this.$logHead("eapp error")}][${this.$sTime(null,1)}] 未知 EAPP 类型: ${e.type}`)}},epEdit(e=-1){const t=this.apps,s=t[e]||{name:this.$t("name"),logo:"",type:"js",target:"test.js"};let i=this.$axios,n=this.$message;this.$evui({id:"eapp_new",title:s.hash?this.$t("edit")+" EAPP - "+s.name:this.$t("new")+" EAPP",width:600,height:null,style:{content:"margin: .3em; font-family: var(--font-fm);"},content:`
`,methods:{moreToggle(e){const t=e.target.classList,s=document.querySelector(".eapp_more").classList;t.contains("elecBtn--moreup")?(t.remove("elecBtn--moreup"),s.add("hide")):(t.add("elecBtn--moreup"),s.remove("hide"))},save(){s.name=document.querySelector(".elecTable_input[name=eapp_name]").value,s.logo=document.querySelector(".elecTable_input[name=eapp_logo]").value,s.type=document.querySelector(".elecTable_select[name=eapp_type]").value,s.target=document.querySelector(".editor_textarea[name=eapp_target]").value,s.run=document.querySelector(".elecTable_select[name=eapp_run]").value,s.note=document.querySelector(".elecTable_input[name=eapp_note]").value,s.name&&s.type&&s.target?i.put("/eapp",{idx:e,...s}).then((i=>{0===i.data.rescode?(n.success("成功添加应用",s.name),s.hash=i.data.resdata,-1===e&&t.push(s)):n.error("添加应用失败",i.data.message)})).catch((e=>{n.error("添加应用失败",e.message),console.error("添加应用失败",e)})):n.error("EAPP 内容填写不完整,请修改后再保存")}}})},epMove(e){if(e=Number(e),this.apps[e]&&confirm(`确定移除应用 ${this.apps[e].name}?`)){const t=this.apps[e].name,s=this.$message.loading(`正在删除应用 ${t}...`,0);this.$axios.delete(`/eapp/${e}`).then((t=>{0===t.data.rescode&&this.apps.splice(e,1)})).catch((e=>{this.$message.error(`${t} 删除失败`,e.message),console.error(`${t} 删除失败`,e)})).finally(s)}},epSave(){if(!this.bEdit)return this.bEdit=!0,void(this.logo_type_org=this.eapp.logo_type||1);if(this.toSave&&confirm(`确定保存当前应用列表 ${this.apps.length}?`)){const e=this.$message.loading("应用列表保存中...",0);this.$axios.post("/eapp",{enable:this.eapp.enable,logo_type:this.eapp.logo_type,apps:this.apps}).then((e=>{0===e.data.rescode?this.$message.success("保存成功"):(this.$message.error("保存失败",e.data.message),console.error("保存失败",e.data))})).catch((e=>{this.$message.error("保存失败",e.message),console.error("保存失败",e)})).finally(e)}else if(this.eapp.logo_type!==this.logo_type_org){const e=this.$message.loading(`应用 LOGO 风格 ${this.eapp.logo_type}...`,0);this.$axios.put("/eapp/logo_type",{logo_type:this.eapp.logo_type}).then((e=>{0===e.data.rescode?(this.$message.success("新的 LOGO 风格应用成功"),this.logs.unshift(`[${this.$logHead("eapp notify")}][${this.$sTime(null,1)}] 成功应用新的 LOGO 风格 ${this.eapp.logo_type}`)):(this.$message.error("新的 LOGO 风格应用失败",e.data.message),console.error("新的 LOGO 风格应用失败",e.data))})).catch((e=>{this.$message.error("新的 LOGO 风格保存失败",e.message),console.error("新的 LOGO 风格应用失败",e)})).finally(e)}this.bEdit=!1,this.toSave=!1},dragStart(e,t){e.dataTransfer.effectAllowed="move",this.dragIdx=t,this.dragSce=this.apps[t]},dragEnter(e,t){e.preventDefault(),-1!==this.dragIdx&&this.dragIdx!==t&&(this.apps.splice(this.dragIdx,1),this.apps.splice(t,0,this.dragSce),this.dragIdx=t)},dragEnd(e,t){this.dragIdx=-1,this.toSave=!0}}};const ir=ka(sr,xa,[],!1,null,"fdaa1d28",null).exports,nr=JSON.parse('{"join_gap":" ","en":"英文","zh":"中文","a":"a","access":"ACCESS","add":"ADD","addition":"ADDITION","address":"ADDRESS","agroup":"A GROUP","all":"ALL","allow":"ALLOW","allowed":"ALLOWED","and":"AND","arch":"ARCH","as":"AS","author":"AUTHOR","auto":"AUTO","autorun":"AUTO","backup":"BACKUP","belong":"BELONG","blacklist":"BLACKLIST","bfreq":"before request","bfres":"before response","browser":"browser","cache":"CACHE","cancel":"CANCEL","certificate":"CERTIFICATE","check":"CHECK","checkall":"CHECK ALL","checked":"CHECKED","checked_short":"CKD","checknone":"CHECK NONE","choose":"CHOOSE","clear":"CLEAR","clickrun":"CLICK","close":"CLOSE","closed":"CLOSED","cmd":"CMD","con_clients":"Connected Clients","confirm":"CONFIRM","connected":"CONNECTED","content":"CONTENT","countdown":"countdown","cron":"cron","current":"CURRENT","date":"DATE","default":"DEFAULT","delete":"DELETE","detail":"detail","disable":"DISABLE","disable_short":"DE","disabled":"DISABLED","disconnected":"DISCONNECTED","document":"document","donation":"DONATION","download":"DOWNLOAD","dthave":"DON\'T HAVE","edit":"EDIT","editexit":"EXIT","editmode":"EDIT","efss_file_manage":"EFSS FILE MANAGE","enable":"ENABLE","enable_short":"EN","enabled":"ENABLED","every":"EVERY","export":"EXPORT","exportsub":"EXPORT","fetch":"FETCH","file":"FILE","files":"FILES","five":"five","forbid":"FORBID","force":"FORCE","format":"FORMAT","generate":"GENERATE","get":"GET","homepage":"HOMEPAGE","host":"HOST","host_info":"Host Information","illegal":"illegal","import":"IMPORT","input":"input","install":"INSTALL","jsruntimes":"Script Run Times","language":"LANGUAGE","last":"LAST","last_three":"last three","level":"LEVEL","list":"LIST","local":"LOCAL","logs":"LOGS","logs_of_script":"LOGS OF SCRIPT","make":"MAKE","manage":"MANAGE","match":"MATCH","memory":"MEMORY","memoryusage":"Memory Usage","mock":"MOCK","modifyto":"MODIFY TO","more":"more","moveto":"MOVE TO","murl":"MATCH URL","name":"NAME","new":"NEW","neweapp":"NEW","next":"NEXT","non-matched":"NON-MATCHED","note":"NOTE","notify":"NOTIFY","noupdate":"no update","on":"on","open":"OPEN","operate":"OPERATE","operate_short":"OP","optional":"optional","or":"or","overview":"OVERVIEW","param":"PARAM","persistence":"Persistence","platform":"PLATFORM","please":"please","port":"PORT","prev":"PREV","proxy":"PROXY","push":"PUSH","random":"random","redirect":"REDIRECT","refresh":"REFRESH","regexp":"REGEXP","reject":"REJECT","remote":"REMOTE","request":"REQUEST","repeat":"repeat","replace":"REPLACE","rest":"rest","restart":"RESTART","rewrite":"REWRITE","root":"ROOT","rule":"RULE","run":"RUN","save":"SAVE","script":"SCRIPT","search":"SEARCH","second":"second","seconds":"seconds","security":"SECURITY","self-signed":"SELF-SIGNED","send":"SEND","setting":"SETTING","setting_of":"SETTING","shortcut":"shortcut","show":"show","sign":"SIGN","six":"six","skip":"SKIP","sponsors":"Sponsors","start":"START","startat":"START AT","status":"STATUS","status_short":"ST","stop":"STOP","style":"STYLE","sub":"SUB","target":"TARGET","task":"TASK","temp":"TEMP","test":"TEST","time":"TIME","timed":"TIMED","times":"times","timing":"TIMING","to":"TO","toggle":"TOGGLE","update":"UPDATE","upload":"UPLOAD","url":"URL","user":"USER","valid":"VALID","version":"VERSION","web":"WEB","whitelist":"WHITELIST"}'),ar=JSON.parse('{"join_gap":"","en":"EN","zh":"zh-CN","a":"一个","access":"访问","add":"添加","addition":"新增","address":"地址","agroup":"某分组","all":"全部","allow":"允许","allowed":"允许","and":"并","arch":"架构","as":"成为","author":"作者","auto":"自动","autorun":"自动运行","backup":"备份","belong":"关联","bfreq":"网络请求前","bfres":"数据返回前","blacklist":"黑名单","browser":"浏览器","cache":"缓存","cancel":"取消","certificate":"证书","check":"查看","checkall":"全部选择","checked":"选中","checked_short":"选择","checknone":"全都不选","choose":"选择","clear":"清空","clickrun":"点击运行","close":"关闭","closed":"已关闭","cmd":"指令","con_clients":"客户端连接数","confirm":"确定","connected":"已连接","content":"内容","countdown":"倒计时","cron":"cron定时","current":"当前","date":"日期","default":"默认","delete":"删除","detail":"详细说明","disable":"关闭","disable_short":"禁用","disabled":"已关闭","disconnected":"已断开","document":"说明文档","donation":"赞助打赏","download":"下载","dthave":"并没有","edit":"编辑","editexit":"退出编辑","editmode":"编辑模式","efss_file_manage":"EFSS 文件管理界面","enable":"启用","enable_short":"启用","enabled":"已启用","every":"每","export":"导出","exportsub":"导出订阅","fetch":"获取内容","file":"文件","files":"文件数","five":"五","forbid":"禁止","force":"强制","format":"格式","generate":"生成","get":"获取","homepage":"主页地址","host":"域名","host_info":"服务器相关信息","illegal":"非法","import":"导入","input":"输入","install":"安装","jsruntimes":"脚本运行总次数","language":"语言偏好","last":"最近","last_three":"后三项","level":"等级","list":"列表","local":"本地","logs":"日志","logs_of_script":"查看程序运行日志","make":"生成","manage":"管理","match":"匹配","memory":"内存","memoryusage":"内存使用情况","mock":"模拟","modifyto":"修改方式","more":"更多","moveto":"移动到","murl":"匹配链接","name":"名称","new":"新建","neweapp":"新建应用","next":"下一个","non-matched":"未匹配","note":"备注","notify":"通知","noupdate":"不自动更新","on":"在","open":"打开","operate":"操作","operate_short":"操作","optional":"可选择项","or":"或","overview":"基础信息","param":"参数","persistence":"常量","platform":"平台","please":"请","port":"端口","prev":"上一个","proxy":"代理","push":"推送","random":"随机","redirect":"重定向","refresh":"刷新","regexp":"正则表达式","reject":"阻止","remote":"远程","request":"请求","repeat":"重复","replace":"替换","rest":"剩余","restart":"重启","rewrite":"重写","root":"根","rule":"规则","run":"运行","save":"保存","script":"脚本","search":"搜索","second":"秒","seconds":"秒数","security":"安全","self-signed":"自签","send":"发送","setting":"设置","setting_of":"相关设置","shortcut":"快捷键","show":"显示","sign":"签发","six":"六","skip":"跳过","sponsors":"广告","start":"开始","startat":"启动时间","status":"状态","status_short":"状态","stop":"停止","style":"风格","sub":"订阅","target":"目标","task":"任务","temp":"临时","test":"测试","time":"时间","timed":"定时","times":"次数","timing":"时间点","to":"至","toggle":"反转","update":"更新","upload":"上传","url":"链接","user":"用户","valid":"有效","version":"后台版本","web":"网络","whitelist":"白名单"}');const rr={locale:function(){let e="";return location.search&&(e=new URLSearchParams(location.search).get("lang")),e||localStorage.getItem("lang")||navigator.language}().startsWith("zh")?"zh-CN":"en",fallbackLocale:"en"},or={en:nr,"zh-CN":ar};function lr(e){return(or[rr.locale]||or[rr.fallbackLocale])[e]||e}function cr(e=""){return e=e.startsWith("zh")?"zh-CN":"en",rr.locale=e,console.debug("locale lang set to",e),localStorage.setItem("lang",e),e}const ur={name:"overview",data(){return{version:"1.0.0",baseurl:location.protocol+"//"+location.hostname,anyproxy:{enable:!0,port:8001,webPort:8002},ruleslen:0,rewriteslen:0,jslistslen:0,taskstatus:"0/0/0",mitmhostlen:0,start:this.$sTime(),newversion:"",sysinfo:Object.create(null),eopbtn:{open:!1,close:!1},enablelist:{rule:!0,rewrite:!0,mitmhost:!0},userid:this.$uApi.store.get("userid"),bcheck:this.$uApi.store.getCache("bChecked"),eappfresh:!1,isPwa:this.$uApi.isPwa()}},components:{status:Ca,eapp:ir},created(){this.ovInit(),this.bcheck||(this.$uApi.store.set("bcheck",(new Date).getDate().toString()),this.bcheck=!0,"http:"!==location.protocol||/^(100|10|127|172|192\.168)/.test(location.hostname)||this.$message.error("当前正通过 http 访问,建议升级到 https"))},methods:{ovInit(){const e=this.$message.loading("正在获取 overview 相关数据...",0);this.$axios.get("/data?type=overview"+(this.bcheck?"":`&check=${this.bcheck}`)).then((e=>{if(this.$message.success(`成功获取 overview 相关数据\nwebUI 版本 3.8.2 后台版本 ${e.data.version}`),e.data.lang&&cr(e.data.lang),this.ruleslen=e.data.ruleslen,this.rewriteslen=e.data.rewriteslen,this.jslistslen=e.data.jslistslen,this.mitmhostlen=e.data.mitmhostlen,this.version=e.data.version,this.start=this.$sTime(new Date(e.data.start),0,0),this.anyproxy=e.data.anyproxy,this.newversion=e.data.newversion,this.sysinfo=e.data.sysinfo,this.userid=e.data.userid,this.userid!==this.$uApi.store.get("userid")&&this.$uApi.store.set("userid",this.userid),this.$uApi.store.setCache("bSponsor",this.$uApi.store.getCache("sponsors").has(this.userid)),Object.assign(this.enablelist,e.data.enablelist),"object"==typeof e.data.menunav&&this.$emit("menunav",{...e.data.menunav}),"object"==typeof e.data.logo&&this.$emit("theme",{type:"logo",...e.data.logo}),this.$uApi.store.getCache("bSponsor")){let t=e.data.theme;t&&this.$emit("theme",t.simple||t)}else this.$emit("theme",{enable:!1});e.data.taskstatus&&(this.taskstatus=e.data.taskstatus.running+"/"+e.data.taskstatus.total+"/"+e.data.taskstatus.sub);let t=Number(this.version.replace(/\.|v/g,""));this.newversion&&Number(this.newversion.replace(/\.|v/g,""))>t?(console.log(`elecV2P 有新的版本 v${this.newversion} 可供更新`),this.$uApi.store.get("newversion")!==this.newversion&&(this.$message.success(`elecV2P 有新的版本 v${this.newversion} 可供更新`,{url:"https://github.com/elecV2/elecV2P/blob/master/logs/update.log",secd:0}),this.$uApi.store.set("newversion",this.newversion))):this.newversion=""})).catch((e=>{this.$message.error("获取端口数据失败",e.message),console.error("获取端口数据失败",e)})).finally(e)},showUplog(){const e=this.$message.loading("正在获取更新日志...",0);this.$axios.get("https://raw.githubusercontent.com/elecV2/elecV2P/master/logs/update.log").then((e=>{this.$message.success("获取成功"),this.$evui({title:"当前 elecV2P 版本: "+this.version+" 最近更新日志",width:820,height:460,style:{content:"padding-left: 8px; font-size: 16px;"},content:`
${this.newversion?"检测到有新版本 v"+this.newversion+'
请使用 softupdate.js 或者 docker 命令进行升级':""}
${e.data}
`})})).catch((e=>{this.$message.error("获取失败",e.message),console.error("更新日志获取失败",e),this.$evui({title:"更新日志获取失败",width:400,height:160,content:'

点击此链接 前往 Github 查看最新更新日志

'})})).finally(e)},eproxyBtn(){this.anyproxy.enable?this.eopbtn.close=!this.eopbtn.close:this.eopbtn.open=!this.eopbtn.open},eproxyToggle(e=""){this.$wsrecv.connected?(this.anyproxy&&this.anyproxy.enable?("close"===e||confirm("确定关闭 ANYPROXY?"))&&(this.$wsrecv.send("eproxy","close"),this.anyproxy.enable=!1):("open"===e||confirm("确定打开 ANYPROXY?"))&&(this.$wsrecv.send("eproxy","start"),this.anyproxy.enable=!0),this.eopbtn.open=!1,this.eopbtn.close=!1):this.$message.error("websocket 尚未连接,指令无法发送")},webifOpen(){this.anyproxy.enable?this.$uApi.open(this.baseurl+":"+this.anyproxy.webPort):this.$message.success("当前 ANYPROXY 处于关闭状态,无可查看日志")},runHour(e){e.target.title="elecV2P 已持续运行 "+this.$uStr.hDays(Date.parse(this.start))}}};const hr=ka(ur,ya,[],!1,null,"75f1e158",null).exports;var dr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.rulesSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.ruleble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.ruleble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"启用该列表中的规则(建议在不需要使用时关闭"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.ruleble}})],1),e._v(" "),t("span",[e._v("RULE "+e._s(e.$t("list"))+" - "+e._s(e.rulestatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.rulesInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("match")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v(e._s(e.$t("content"))+"("+e._s(e.$t("regexp"))+")")]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("modifyto")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw480"},[e._v(e._s(e.$t("target")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("timing")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.eplists,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable}},[t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.mtype,expression:"el.mtype"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"mtype",t.target.multiple?i:i[0])}}},[t("option",[e._v("url")]),e._v(" "),t("option",[e._v("host")]),e._v(" "),t("option",[e._v("useragent")]),e._v(" "),t("option",[e._v("reqmethod")]),e._v(" "),t("option",[e._v("reqbody")]),e._v(" "),t("option",[e._v("resstatus")]),e._v(" "),t("option",[e._v("restype")]),e._v(" "),t("option",[e._v("resbody")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},["reqmethod"==s.mtype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.match,expression:"el.match"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"match",t.target.multiple?i:i[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("DELETE")])]):"resstatus"==s.mtype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.match,expression:"el.match"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"match",t.target.multiple?i:i[0])}}},[t("option",[e._v("200")]),t("option",[e._v("404")]),t("option",[e._v("30x")]),t("option",[e._v("50x")])]):t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.match,expression:"el.match",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{change:function(t){e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.ctype,expression:"el.ctype"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"ctype",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"js"}},[e._v(e._s(e.script))]),e._v(" "),t("option",{attrs:{value:"block"}},[e._v(e._s(e.reject))]),e._v(" "),t("option",{attrs:{value:"307"}},[e._v(e._s(e.redirect))]),e._v(" "),t("option",{attrs:{value:"hold"}},[e._v("$HOLD")]),e._v(" "),t("option",{attrs:{value:"ua"}},[e._v("User-Agent")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},["block"==s.ctype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.target,expression:"el.target"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"target",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"json"}},[e._v("reject-json")]),e._v(" "),t("option",{attrs:{value:"reject",selected:"selected"}},[e._v("reject-200")]),e._v(" "),t("option",[e._v("tinyimg")])]):"ua"==s.ctype?t("select",{directives:[{name:"model",rawName:"v-model",value:s.target,expression:"el.target"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"target",t.target.multiple?i:i[0])}}},e._l(e.uagentlists,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0):t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.target,expression:"el.target",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{change:function(t){e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"el.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))]),e._v(" "),t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.ruleDel(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_add",attrs:{colspan:"7"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.eplists.push({mtype:"host",match:"host.com",ctype:"js",target:"0body.js",stage:"res",enable:!0})}}},[e._v(e._s(e.$ta("new","rule")))])])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.rulesSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),e._m(0)])};dr._withStripped=!0;var pr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"checkbox",class:{"checkbox--checked":e.bChecked},on:{click:function(t){e.bChecked=!e.bChecked}}},[t("span",{staticClass:"checkbox_status"})])};pr._withStripped=!0;const mr=ka({name:"checkbox",props:["oCheck","oKey","oInit"],computed:{bKey(){return this.oKey||"enable"},bChecked:{get(){return void 0===this.oCheck[this.bKey]?"false"!==this.oInit:!!this.oCheck[this.bKey]},set(e){this.$set(this.oCheck,this.bKey,e)}}}},pr,[],!1,null,"40a3a37e",null).exports,fr={name:"rules",data(){return{header:"RULES",bfreq:this.$t("bfreq"),bfres:this.$t("bfres"),reject:this.$t("reject"),redirect:this.$t("redirect"),script:this.$t("script"),uagentlists:{},eplists:[],ruleble:{enable:!0},icon:wa}},computed:{rulestatus(){return this.eplists.filter((e=>e.enable)).length+"/"+this.eplists.length}},components:{checkbox:mr},created(){this.rulesInit()},methods:{rulesInit(){const e=this.$message.loading("正在获取规则列表...",0);this.$axios.get("/data?type=rules").then((e=>{this.eplists=e.data.eplists.list;for(let t in e.data.uagent)e.data.uagent[t].name&&(this.uagentlists[t]=e.data.uagent[t].name);this.ruleble.enable=!1!==e.data.eplists.enable,this.$message.success(`成功获取规则列表 ${this.rulestatus}`),console.log("成功获取规则列表",this.rulestatus)})).catch((e=>{this.$message.error("获取规则列表失败",e.message),console.error("获取列表失败",e)})).finally(e)},rulesSave(){if(confirm("共 "+this.rulestatus+" 条规则将被保存,"+(this.ruleble.enable?"":"但不启用该规则列表,")+"确定?")){const e=this.$message.loading("规则保存中...",0);this.$axios.put("/data",{type:"rules",eplists:this.eplists,ruleenable:this.ruleble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("RULES 规则保存失败",e.data.message)})).catch((e=>{this.$message.error("保存失败",e.message),console.error(e)})).finally(e)}},ruleDel(e){switch(this.$sType(e)){case"number":this.$delete(this.eplists,e);break;case"array":if(e.length&&confirm(`确定删除这 ${e.length} 条规则吗?\n(手动保存后正式生效)`)){let t=this.eplists.slice();for(let s of e)t[s]&&(t[s]=-1);this.eplists=t.filter((e=>-1!==e))}break;default:this.$message.error("规则删除失败,未知删除参数")}}}};const vr=ka(fr,dr,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",[t("li",[e._v("所有更改在保存后正式生效")]),e._v(" "),t("li",[e._v("仅首条命中规则有效,优先级低于 REWRITE")]),e._v(" "),t("li",[e._v("$HOLD 后面修改内容表示时间(秒) 0: 一直等待")]),e._v(" "),t("li",[e._v("更详细说明,参考 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/03-rules.md",target:"elecV2PDoc"}},[e._v("说明文档: 03-rules")])])])])}],!1,null,null,null).exports;var gr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.reSave()):null},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.rewriteChecked="none"))}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("rewrite","request")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable",on:{click:function(t){return t.stopPropagation(),e.rewriteDelegate(t)}}},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.rewriteble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.rewriteble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"启用/禁用该列表下的所有规则(包含订阅"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.rewriteble}})],1),e._v(" "),t("span",{attrs:{title:"重写/修改某个网络请求的部分数据"}},[e._v("REWRITE "+e._s(e.$t("list"))+" - "+e._s(e.rewritestatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:e.$ta("refresh","current","list")},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.reInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:e.$t("checkall")+"/"+e.$t("checknone")+"(ESC)"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.rewriteCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th minw320"},[e._v(e._s(e.$t("murl"))+"("+e._s(e.$t("regexp"))+")")]),e._v(" "),t("th",{staticClass:"elecTable_th minw160"},[e._v(e._s(e.$t("timing")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw320",attrs:{title:e.$t("script")+" or reject "+e.$t("param")}},[e._v(e._s(e.$t("script")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("note")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable",attrs:{title:e.$t("enable")}},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62",attrs:{title:e.$t("operate")}},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",{attrs:{tabindex:"0"}},[e._l(e.rewritelists,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.rewriteChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewriteCheck,expression:"rewriteCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.rewriteCheck)?e._i(e.rewriteCheck,i)>-1:e.rewriteCheck},on:{change:function(t){var s=e.rewriteCheck,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.rewriteCheck=s.concat([r])):o>-1&&(e.rewriteCheck=s.slice(0,o).concat(s.slice(o+1)))}else e.rewriteCheck=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.match,expression:"rewrite.match",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{input:function(t){t.target.composing||e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"rewrite.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))]),e._v(" "),t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.target,expression:"rewrite.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{input:function(t){t.target.composing||e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"rewrite.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewriteDel(i)}}})])])})),e._v(" "),t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"7"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.rewriteDel(e.rewriteCheck)}}},[e._v(e._s(e.$ta("delete","checked","rule"))+" "+e._s(e.rewriteCheck.length))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"newRewrite"}},[e._v(e._s(e.$ta("add","rewrite","rule")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn folderbk",attrs:{title:"导入备份文件将会覆盖当前所有规则(包括订阅)"},on:{click:function(t){return e.rewriteImport()}}},[e._v(e._s(e.$ta("import","backup","file")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"exportRewrite",title:"备份包含订阅在内的当前所有规则"}},[e._v(e._s(e.$ta("backup","current","list")))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--uncheck",on:{click:function(t){e.rewriteCheck=[]}}},[e._v(e._s(e.$ta("cancel","checked","rule"))+" "+e._s(e.rewriteCheck.length))])])])],2),e._v(" "),e._l(e.rewritesub,(function(s,i){return t("tbody",{key:i,staticClass:"elecTable_group",style:{background:s.bkcolor}},[t("tr",{class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":-1!==e.rewritesubChecked.indexOf(i)}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewritesubChecked,expression:"rewritesubChecked"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.rewritesubChecked)?e._i(e.rewritesubChecked,i)>-1:e.rewritesubChecked},on:{change:[function(t){var s=e.rewritesubChecked,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.rewritesubChecked=s.concat([r])):o>-1&&(e.rewritesubChecked=s.slice(0,o).concat(s.slice(o+1)))}else e.rewritesubChecked=a},function(t){return e.rewritesubCheck(i,t)}]}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"4"}},[t("div",{staticClass:"eflex w100"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"subr.name",modifiers:{trim:!0}}],staticClass:"elecTable_input elecTable_th--name",attrs:{type:"text",placeholder:"订阅名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.resource,expression:"subr.resource",modifiers:{trim:!0}}],staticClass:"elecTable_input elecBtn--mleft",attrs:{type:"text",placeholder:"订阅地址",title:"alt+enter 在新标签页中打开此订阅链接"},domProps:{value:s.resource},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.$uApi.open(s.resource)):null},input:function(t){t.target.composing||e.$set(s,"resource",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--mleft",on:{click:function(t){return e.rewritesubUpdate(s.resource,i)}}},[e._v(e._s(e.$t("fetch")))]),e._v(" "),-1!==e.rewritesubChecked.indexOf(i)?t("button",{staticClass:"elecBtn elecBtn--mleft",attrs:{"data-method":"exportRewrite","data-parm":i,title:"导出当前订阅下的所有规则"}},[e._v(e._s(e.$t("exportsub")))]):s.collapse?t("span",{staticClass:"elecBtn elecBtn--mleft elecBtn--uncheck"},[e._v(e._s(s.enable?s.list.filter((e=>e.enable)).length:"0")+"/"+e._s(s.list.length))]):t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:s.bkcolor,expression:"subr.bkcolor",modifiers:{trim:!0,lazy:!0}}],staticClass:"elecTable_input elecTable_cell100 elecBtn--mleft",attrs:{placeholder:"背景色",title:"当前分组背景颜色/图片"},domProps:{value:s.bkcolor},on:{change:function(t){e.$set(s,"bkcolor",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{title:"启用/禁用该订阅下的所有规则"}},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[s.resource&&-1===e.rewritesubChecked.indexOf(i)?s.collapse?t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.downcircle)},on:{click:function(t){return e.rewritesubOp(i,"collapse")}}}):t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.upcircle)},on:{click:function(t){return e.rewritesubOp(i,"collapse")}}}):t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewritesubOp(i,"delete")}}})])]),e._v(" "),e._l(e.rewritesublist[i],(function(s,n){return t("tr",{class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.rewriteChecked[i+"|"+n]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.rewriteCheck,expression:"rewriteCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i+"|"+n,checked:Array.isArray(e.rewriteCheck)?e._i(e.rewriteCheck,i+"|"+n)>-1:e.rewriteCheck},on:{change:function(t){var s=e.rewriteCheck,a=t.target,r=!!a.checked;if(Array.isArray(s)){var o=i+"|"+n,l=e._i(s,o);a.checked?l<0&&(e.rewriteCheck=s.concat([o])):l>-1&&(e.rewriteCheck=s.slice(0,l).concat(s.slice(l+1)))}else e.rewriteCheck=r}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.match,expression:"rewrite.match",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.match},on:{input:function(t){t.target.composing||e.$set(s,"match",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:["req"===s.stage?"elecTable_td--req":"elecTable_td--res"]},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.stage,expression:"rewrite.stage"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"stage",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"res",selected:"selected"}},[e._v(e._s(e.bfres))]),e._v(" "),t("option",{attrs:{value:"req"}},[e._v(e._s(e.bfreq))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.target,expression:"rewrite.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text"},domProps:{value:s.target},on:{input:function(t){t.target.composing||e.$set(s,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"rewrite.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.rewriteDel(i+"|"+n)}}})])])}))],2)})),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"7"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn trasbk",attrs:{"data-method":"disOrEn","data-parm":"enable"}},[e._v(e._s(e.$ta("enable_short","/","disable_short","checked","rule")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{"data-method":"newSub"}},[e._v(e._s(e.$ta("add","rewrite","sub")))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.rewriteCheck.length,expression:"rewriteCheck.length"}],staticClass:"elecTable_addbtn greenbk",attrs:{"data-method":"exportRewrite","data-parm":"checked"}},[e._v(e._s(e.$ta("export","as","sub")))])])])])],2)]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.reSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),e._m(0)])};gr._withStripped=!0;const _r={name:"rewrite",props:[],data(){return{bfreq:this.$t("bfreq"),bfres:this.$t("bfres"),rewritelists:[],rewritesub:[],rewritesubChecked:[],rewriteCheck:[],rewriteble:{enable:!0},icon:wa}},components:{checkbox:mr},computed:{rewritestatus(){let e=Object.keys(this.rewritesub),t=this.rewritelists.length,s=this.rewritelists.filter((e=>e.enable)).length;return e.forEach((e=>{void 0===this.rewritesub[e].list&&(this.rewritesub[e].list=[]),this.rewritesub[e].enable&&(s+=this.rewritesub[e].list.filter((e=>e.enable)).length,t+=this.rewritesub[e].list.length),void 0===this.rewritesub[e].collapse&&(this.rewritesub[e].collapse=!1)})),s+"/"+t+"/"+e.length},rewriteChecked:{get(){let e=[];return this.rewriteCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.rewriteCheck=Object.keys(this.rewritelists):"none"===e&&(this.rewriteCheck=[])}},rewritesublist(){let e={};return Object.keys(this.rewritesub).forEach((t=>{this.rewritesub[t].collapse?e[t]=[]:e[t]=this.rewritesub[t].list||[]})),e}},created(){this.reInit()},methods:{reInit(){const e=this.$message.loading("正在获取 rewrite 列表...",0);this.$axios.get("/data?type=rewritelists").then((e=>{e.data?(this.rewritesub=e.data.rewritesub||{},this.rewritelists=e.data.rewrite.list,this.rewriteCheck=[],this.rewriteble.enable=!1!==e.data.rewrite.enable,this.dealOldList(),this.$message.success("成功获取 REWRITE 规则列表",this.rewritestatus)):this.$message.error("REWRITE 规则列表获取失败")})).catch((e=>{this.$message.error("获取 REWRITE 规则列表失败",e.message),console.error("获取 REWRITE 规则列表失败",e)})).finally(e)},dealOldList(){let e=[];for(let t in this.rewritelists){let s=this.rewritelists[t];if("req"!==s.stage&&"res"!==s.stage&&(s.stage=/^reject(-200|-dict|-json|-array|-img)?$/.test(s.target)?"req":"res"),s.belong){let i=s.belong;delete s.belong,this.rewritesub[i]?(this.rewritesub[i].list?this.rewritesub[i].list.push(s):this.rewritesub[i].list=[s],this.rewritesub[i].bkcolor||(this.rewritesub[i].bkcolor=this.$uStr.randomColor({max:200})),e.push(t)):console.log("规则",s.match,"对应订阅已不存在,删除 belong 属性",i)}}e.reverse().forEach((e=>this.$delete(this.rewritelists,e)))},reSave(){let e=[];if(this.rewritelists.forEach(((t,s)=>{t.match&&t.target||e.push(s+1)})),e.length>0)this.$message.error("当前列表第",e.join(", "),"/",this.rewritelists.length,"项包含空字符,请填写完整或删除后再进行保存");else if(confirm(`保存重写规则列表 ${this.rewritestatus}${this.rewriteble.enable?"":",但不启用"}`)){const e=this.$message.loading("重写规则上传保存中...",0);this.$axios.put("/data",{type:"rewrite",rewritelists:this.rewritelists,rewritesub:this.rewritesub,rewriteenable:this.rewriteble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("REWRITE 规则保存失败",e.data.message)})).catch((e=>{this.$message.error(e.message),console.error("重写规则保存失败",e)})).finally(e)}},rewriteDelegate(e){switch(e.target.dataset.method){case"disOrEn":let t="disable"===e.target.dataset.parm;this.rewriteCheck.forEach((e=>{if("number"===this.$sType(e))this.rewritelists[e].enable=t;else{let[s,i]=e.split("|");s&&i&&this.rewritesublist[s]&&(this.rewritesub[s].list[i].enable=t)}})),e.target.dataset.parm=t?"enable":"disable",this.$message.success("已批量",t?"启用":"禁用",this.rewriteCheck.length,"条规则");break;case"newRewrite":this.rewritelists.push({match:"^https?://httpbin\\.org/get\\?rewrite=elecV2P",stage:"req",target:"0body.js",enable:!0});break;case"newSub":this.rewritesubAdd();break;case"exportRewrite":this.rewriteExport(e.target.dataset.parm)}},async rewritesubUpdate(e,t){if(!e||!/^https?:\/\/\S{4}|^\/?efss\//i.test(e))return void this.$message.error("请输入正确的订阅地址");let s=this.$message.loading("正在获取订阅内容中...",0),i="";try{i=await this.$axios.get(e)}catch(t){if(t.response)return s(),this.$message.error(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`),void console.debug(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`,t.response.data);if(!/^https?:\/\/\S{4}/.test(e))return s(),void this.$message.error("获取订阅内容失败",t.message);try{this.$message.error("获取订阅内容失败",t.message,"即将尝试从服务器端获取该订阅内容"),i=await this.$axios.get("/data?type=stream&url="+e)}catch(e){return s(),void this.$message.error("获取订阅信息失败",e.message,"请检测网络后重试")}}if(200!==i.status||-1===i.data.rescode)return s(),this.$message.error("该订阅返回状态有误,请确认当前网络环境或输入链接是否正常"),void console.error(i.data);s();let n=this.$sJson(i.data);if(!n||!n.list&&!n.rewrite){if(!i.data)return void this.$message.error("没有检测到任何订阅内容");i.data=this.$sString(i.data),this.$message.success("检测到该订阅内容为非 elecV2P 订阅格式,尝试以兼容模式解析该内容"),n={name:this.rewritesub[t].name,mitmhost:[],list:[]};let e=i.data.match(/hostname ?= ?(.+)/);e&&e[1]&&(n.mitmhost=e[1].split(/ ?, ?/)),n.mitmhost.length&&(n.mitmhost[0]=n.mitmhost[0].replace("%APPEND% ","")),i.data.split(/\r|\n/).forEach((e=>{if(/^(#|\[|\/\/)/.test(e)||e.length<3)return;let t=e.split(" "),s=e.match(/script-path=([^,]*)/),i="",a="res",r="";if(s&&s[1])if(r=s[1],a=/http-request/.test(e)?"req":"res",/^http-res/.test(t[0]))i=t[1];else{let t=e.match(/pattern=([^,]*)/);t&&t[1]&&(i=t[1])}else t.length>=2&&(r=t.pop(),/^http|^reject|\.js$/.test(r)&&(i=t[0],a=/^reject/.test(r)||/request/.test(t[2])?"req":"res"));i&&a&&r&&n.list.push({match:i,stage:a,target:r,enable:!0})}))}if(n&&n.rewrite&&n.rewrite.length&&(n.list=n.rewrite),n&&n.list&&n.list.length){let e=`
${n.note||"没有任何备注说明"}
`;n.mitmhost&&n.mitmhost.length&&(e+=`
`),n.task&&n.task.list&&(e+=`
`),e+=`
作者: ${n.author||"无"} 更新: ${n.resource||"无"}
`;let s=this.$axios,i=this.$message,a=this.rewritesub;this.$evui({title:`${n.name||this.rewritesub[t].name||"检测到如下规则"}`,width:600,height:null,style:{title:`background: ${n.bkcolor||this.rewritesub[t].bkcolor};`,content:"text-align: center;margin: .2em;"},content:e,methods:{rewriteAdd(){let e=document.querySelector(".elecBtn[data-method=rewriteAdd]");if(e){if(e.dataset.done)return void i.success("重写规则已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}let s=n.list.filter((e=>{if(e.match&&/^http|^reject|\.js$/.test(e.target))return"req"!==e.stage&&"res"!==e.stage&&(e.stage=/^reject/.test(e.target)?"req":"res"),e.enable=!1!==e.enable,!0}));n.name&&(a[t].name=n.name),void 0!==n.enable&&(a[t].enable=n.enable),n.bkcolor&&(a[t].bkcolor=n.bkcolor),n.resource&&(a[t].resource=n.resource),a[t]={...a[t],list:s},i.success("订阅",n.name,"内容更新完成(保存后正式生效)")},taskAdd(){let e=document.querySelector(".elecBtn[data-method=taskAdd]");if(e){if(e.dataset.done)return void i.success("定时任务已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}for(let e of n.task.list)s.put("/task",{op:"add",data:{type:n.task.type,task:e}}).then((t=>{0===t.data.rescode?i.success("添加定时任务",e.name,t.data.message):i.error("添加定时任务失败",t.data.message)})).catch((e=>{i.error("添加定时任务失败",e.message),console.error("添加定时任务失败",e)}))},hostAdd(){let e=document.querySelector(".elecBtn[data-method=hostAdd]");if(e){if(e.dataset.done)return void i.success("解析域名已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}s.put("/data",{type:"mitmhostadd",data:n.mitmhost,note:n.name}).then((e=>{0===e.data.rescode?i.success("成功更新 MITMHOST",n.mitmhost.join(", ")):i.error("MITMHOST 更新失败",e.data.message)})).catch((e=>{i.error("更新 mitmhost 失败",e.message),console.error("更新 mitmhost 失败",e)}))}}})}else this.$message.error("elecV2P 暂时无法解析该订阅内容"),console.debug(this.rewritesub[t].name,"内容为",i.data)},rewritesubCheck(e,t){if(e&&t)if(t.target.checked)for(let t in this.rewritesub[e].list||[]){let s=e+"|"+t;-1===this.rewriteCheck.indexOf(s)&&this.rewriteCheck.push(s)}else this.rewriteCheck=this.rewriteCheck.filter((t=>!("string"==typeof t&&t.startsWith(e))))},rewriteDel(e){switch(this.$sType(e)){case"number":this.$delete(this.rewritelists,e);break;case"array":if(e.length&&confirm(`确定删除这 ${e.length} 条规则吗?\n(手动保存后正式生效)`)){for(let t of e)this.rewriteDel(t);this.rewriteCheck=[]}break;case"string":let[t,s]=e.split("|");t&&s&&this.rewritesublist[t]&&(this.rewritesublist[t].splice(Number(s),1),this.$forceUpdate());break;default:this.$message.error("规则删除失败,未知删除参数")}},rewritesubAdd(e=this.$uStr.euid()){this.$set(this.rewritesub,e,{name:this.$ta("rewrite","sub")+(Object.keys(this.rewritesub).length+1),resource:"",type:"rewrite",note:"",date:this.$sTime(),total:0,active:0,enable:!0,bkcolor:this.$uStr.randomColor({max:200}),collapse:!1,list:[]})},rewritesubOp(e,t="delete"){"collapse"===t?(this.rewritesub[e].collapse=!this.rewritesub[e].collapse,this.rewritesub[e].collapse?this.rewritesublist[e]=[]:this.rewritesublist[e]=this.rewritesub[e].list,this.$forceUpdate()):this.rewritesub[e]&&(0===this.rewritesub[e].list.length||confirm("确定删除重写订阅:"+this.rewritesub[e].name+" 及其相关规则\n(并不会删除已添加的 MITMHOST/TASK 等)"))&&(this.$delete(this.rewritesub,e),this.rewriteCheck=this.rewriteCheck.filter((t=>!("string"==typeof t&&t.startsWith(e)))))},rewriteCkall(e){this.rewriteChecked=e.target.checked?"all":"none"},rewriteExport(e="all"){let t=Object.create(null),s="rewritesub-elecV2P.json";switch(e){case"all":t={rewrite:{note:"elecV2P 重写规则",date:this.$sTime(),total:this.rewritelists.length,active:this.rewritelists.filter((e=>e.enable)).length,enable:this.rewriteble.enable,list:this.rewritelists},rewritesub:this.rewritesub},s="rewrite.list",this.$message.success("成功使用当前规则列表(包含订阅)生成备份文件,请选择目录进行保存");break;case"checked":t={name:"elecV2P 重写订阅",author:"留个名字 elecV2",note:"xx 导出的重写规则。该订阅目前仅适用于 elecV2P。更多说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",date:this.$sTime(),type:"rewrite",resource:"订阅更新远程链接(待填写",mitmhost:[],list:[]},this.rewriteCheck.forEach((e=>{if("number"===this.$sType(e))e=this.rewritelists[e];else{let[t,s]=e.split("|");t&&s&&this.rewritesublist[t]&&(e=this.rewritesublist[t][s])}e.match&&e.stage&&e.target&&t.list.push(e)}));break;default:this.rewritesub[e]?(t={...this.rewritesub[e],type:"rewrite",note:"关于该订阅的一些说明(可省略)。该订阅目前仅适用于 elecV2P,与其他软件并不兼容。更详细说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",date:this.$sTime()},delete t.total,delete t.active,delete t.collapse,s=this.rewritesub[e].name):this.$message.error("未知导出类型",e)}"rewrite"===t.type||t.rewrite?this.$uApi.saveAsFile(t,s||"rewritesub-elecV2P.json"):this.$message.error("当前并没有检测到任何规则")},rewriteImport(){this.$uApi.getFile({accept:".list,.json",type:"text"}).then((e=>{let t=e.content,s=this.$sJson(t);s&&(s.rewrite&&s.rewrite.list||s.rewritesub)?confirm(`检测到重写规则 ${s.rewrite.list.length} 条,订阅 ${Object.keys(s.rewritesub||{}).length} 个\n确定使用该备份替换当前所有规则及订阅吗?`)&&(this.rewritelists=s.rewrite.list||[],this.rewritesub=s.rewritesub||{},this.rewriteCheck=[],this.rewriteble.enable=!1!==s.rewrite.enable,this.dealOldList(),this.$message.success("成功导入重写规则备份文件,保存后正式生效")):(console.error("elecV2P 无法解析导入文件",t),this.$message.error("无法解析导入文件,仅支持 elecV2P 的备份文件"))})).catch((e=>{console.debug("rewrite import",e)}))}}};const br=ka(_r,gr,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",[t("li",[t("b",[e._v("本页所有规则的更改在点击保存后才正式生效")])]),e._v(" "),t("li",[e._v("订阅规则并不会自动加载更新,需手动获取及保存")]),e._v(" "),t("li",[e._v("规则匹配公式: `(new RegExp('正则表达式')).test(request.url)`")]),e._v(" "),t("li",[e._v("更多说明请查看 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/05-rewrite.md",target:"elecV2PDoc"}},[e._v("文档: 05-rewrite")])])])])}],!1,null,null,null).exports;var yr=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("script","manage")))]),e._v(" "),t("main",{staticClass:"content",on:{click:function(t){e.menu={}}}},[t("contextmenu",{attrs:{menus:e.menu.list,pos:e.menu.pos}}),e._v(" "),t("store",{attrs:{logs:e.logs},on:{belongview:function(t){t&&t.includes("|")?e.jsname=t:e.jsView(t)}}}),e._v(" "),t("div",{staticClass:"title--radius",on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.menu={}))}}},[t("h4",{staticClass:"title title--radius"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"更新列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.getJSlist()}}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"当前服务器上存在的本地脚本文件数量"}},[e._v(e._s(e.$ta("script","files"))+" - "+e._s(e.jslists.length))]),e._v(" "),t("span",{staticClass:"title_arrow",class:{"title_arrow--up":e.collapse.titlearrow},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.titlearrow=!e.collapse.titlearrow}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.collapse.titlearrow,expression:"collapse.titlearrow"}],staticClass:"uploadjs"},[t("div",{staticClass:"eflex w100 eflex--between"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.jsdownloadurl,expression:"jsdownloadurl",modifiers:{trim:!0}}],staticClass:"elecTable_input wp80",attrs:{type:"text",placeholder:"远程脚本链接 script url"},domProps:{value:e.jsdownloadurl},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.jsDownload()},input:function(t){t.target.composing||(e.jsdownloadurl=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:function(t){return e.jsDownload()}}},[e._v(e._s(e.$ta("start","push")))])]),e._v(" "),t("div",{staticClass:"eflex eflex--between w100 emargin"},[t("div",{staticClass:"eupload wp80"},[t("input",{ref:"jsfiles",staticClass:"eupload_file",attrs:{type:"file",accept:".js, .efh",multiple:"",title:"choose script files"},on:{change:e.jstoupload}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.jsfiles.length,expression:"jsfiles.length"}],staticClass:"eupload_span"},[e._v(e._s(e.jsfilename))])]),e._v(" "),t("button",{staticClass:"elecBtn wp19",on:{click:function(t){return e.jsUpload()}}},[e._v(e._s(e.$ta("start","upload")))])])]),e._v(" "),t("div",{staticClass:"jslists_cont",attrs:{tabindex:"0"}},[t("ul",{staticClass:"jslists_alljs",on:{click:function(t){return t.preventDefault(),e.jsOp(t)},contextmenu:function(t){return t.preventDefault(),t.stopPropagation(),e.jsOp(t)}}},[e._l(e.jslistsshow,(function(s){return t("li",{key:s,staticClass:"jslists_item"},[t("span",{staticClass:"jsitem_view",attrs:{"data-method":"view","data-param":s}},[e._v("👁️")]),e._v(" "),t("span",{attrs:{"data-method":"menu","data-param":s}},[e._v(e._s(s))]),e._v(" "),t("span",{staticClass:"jsitem_delete",attrs:{"data-method":"delete","data-param":s}},[e._v("X")])])})),e._v(" "),t("li",{directives:[{name:"show",rawName:"v-show",value:!!e.restnum,expression:"!!restnum"}],staticClass:"jslists_item jslists_item--showrest"},[t("span",{on:{click:function(t){e.shownum=-1}}},[e._v(e._s(e.$ta("show","rest"))+" "+e._s(e.restnum))])])],2)])]),e._v(" "),t("div",{staticClass:"editor editor--jsmanage",class:{"editor--full":!e.collapse.editor}},[t("h3",{staticClass:"editor_title"},[t("div",{staticClass:"eflex wp46 minw320 epos_rel"},[t("label",{staticClass:"minw100"},[e._v(e._s(e.$t("name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.jsname,expression:"jsname",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"脚本文件名 enter: 查看,ctrl+del: 删除"},domProps:{value:e.jsname},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.jsView(e.jsname)},keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:t.ctrlKey?t.shiftKey||t.altKey||t.metaKey?null:e.jsDelete(e.jsname):null},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.jsSave()):null},function(t){e.jsshowall=!1}],input:function(t){t.target.composing||(e.jsname=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.jsname,expression:"jsname"}],staticClass:"elecBtn elecBtn--del",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.jsDelete(e.jsname)}}},[e._v("X")])]),e._v(" "),t("div",{staticClass:"script_info",class:{hide:!e.jsupdate}},[t("span",{staticClass:"eflex script_size",attrs:{title:"脚本大小"}},[e._v(e._s(e.jssize))]),e._v(" "),t("span",{staticClass:"emargin--d5em",attrs:{title:"最近更新"}},[e._v(e._s(e.jsupdate))])]),e._v(" "),t("div",{staticClass:"eflex bk_main_cl radius_bs"},[t("button",{staticClass:"elecBtn greenbk elecBtn--new",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.jsView()}}},[e._v(e._s(e.$ta("new","script")))]),e._v(" "),t("button",{staticClass:"elecBtn bk_secd_fc radius_zero",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.scriptTask()}}},[e._v(e._s(e.$ta("add","task")))]),e._v(" "),t("span",{staticClass:"title_collapse emargin--d5em",class:{"title_collapse--collapsed":e.collapse.editor},attrs:{title:"全屏"},on:{click:function(t){if(t.preventDefault(),t.target!==t.currentTarget)return null;e.collapse.editor=!e.collapse.editor}}})])]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.jscontent,expression:"jscontent"}],staticClass:"editor_textarea",class:{"editor_textarea--nowrap":e.textarea_nowrap},attrs:{placeholder:e.orgjs},domProps:{value:e.jscontent},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(t.preventDefault(),t.stopPropagation(),e.$uApi.insertText(" "))},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.jsSave()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?(t.preventDefault(),t.shiftKey||t.altKey||t.metaKey?null:e.jsTest()):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:void(e.textarea_nowrap=!e.textarea_nowrap)):null},function(t){return(t.type.indexOf("key")||66===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.jsTest()):null}],input:function(t){t.target.composing||(e.jscontent=t.target.value)}}}),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100",attrs:{title:"tab: 两个空格 ctrl+s: 保存 ctrl+enter/ctrl+b: 测试运行 alt+enter: 不换行"}},[t("button",{staticClass:"elecBtn elecBtn--jseditor",on:{click:function(t){return e.jsSave()}}},[e._v(e._s(e.$ta("save","script"))+"(ctrl+s)")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--jseditor",on:{click:function(t){return e.jsTest()}}},[e._v(e._s(e.$ta("test","run"))+"(ctrl+b)")])])]),e._v(" "),t("mock",{attrs:{jslists:e.jslists}}),e._v(" "),t("log",{attrs:{logs:e.logs,title:e.runlogs,collapse:e.collapse}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("当远程脚本无法推送时,尝试在 SETTING 界面添加代理")]),e._v(" "),t("li",[e._v("远程推送脚本时可附加 -rename=xxx.js 重命名文件")]),e._v(" "),t("li",[e._v("mock 网络请求可用于检查网络及代理是否正常")]),e._v(" "),t("li",[e._v(e._s(e.$ta("more","detail"))+" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/04-JS.md",target:"elecV2PDoc"}},[e._v(e._s(e.$t("document"))+":04-JS.md")])])])])])};yr._withStripped=!0;var $r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"storemanage",class:{"storemanage--collapsed":e.collapse}},[t("h2",{staticClass:"title"},[t("span",{staticClass:"icon cursor title_sync",attrs:{title:"更新列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:e.storeGet}}),e._v(" "),t("span",{staticClass:"title_main",attrs:{title:"ctrl+f 搜索"}},[e._v("store/cookie "+e._s(e.$t("persistence"))+" - "+e._s(Object.keys(e.store).length))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("ul",{staticClass:"storelists",on:{click:function(t){return t.preventDefault(),e.storeOp(t)}}},[e._l(e.storeshow,(function(s){return t("li",{key:s,staticClass:"storelists_item"},[t("span",{attrs:{"data-edit":s}},[e._v(e._s(s))]),e._v(" "),t("span",{staticClass:"item_delete",attrs:{"data-delete":s}},[e._v("X")])])})),e._v(" "),t("li",{directives:[{name:"show",rawName:"v-show",value:!!e.restnum,expression:"!!restnum"}],staticClass:"storelists_item storelists_item--showrest"},[t("span",{on:{click:function(t){e.shownum=-1}}},[e._v(e._s(e.$ta("show","rest"))+" "+e._s(e.restnum))])])],2),e._v(" "),t("div",{staticClass:"editor editor--inner"},[t("div",{staticClass:"editor_title"},[t("div",{staticClass:"eflex epos_rel"},[t("label",{staticClass:"store_label",attrs:{title:"请注意大小写"}},[e._v("KEY:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.edkey,expression:"edkey",modifiers:{trim:!0}}],staticClass:"editor_input storekey_input",attrs:{type:"text",name:"name",placeholder:"NEWKEY"},domProps:{value:e.edkey},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.storeEdit(e.edkey)},keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:t.ctrlKey?t.shiftKey||t.altKey||t.metaKey?null:e.storeDelete(e.edkey):null},input:function(t){t.target.composing||(e.edkey=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.edkey,expression:"edkey"}],staticClass:"elecBtn elecBtn--del",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.storeDelete(e.edkey)}}},[e._v("X")])]),e._v(" "),t("div",{staticClass:"eflex emargin",attrs:{title:"如不清楚就保持默认"}},[t("label",{staticClass:"store_label"},[e._v("TYPE:")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.edvalue.type,expression:"edvalue.type"}],staticClass:"elecTable_select w120",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.edvalue,"type",t.target.multiple?s:s[0])}}},[t("option",{attrs:{selected:"selected"}},[e._v("string")]),e._v(" "),t("option",[e._v("number")]),e._v(" "),t("option",{attrs:{value:"object"}},[e._v("json")]),e._v(" "),t("option",[e._v("array")]),e._v(" "),t("option",[e._v("boolean")])])]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw100"},[e._v(e._s(e.$t("belong"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.edvalue.belong,expression:"edvalue.belong",modifiers:{trim:!0,lazy:!0}}],staticClass:"editor_input storebelong_input",attrs:{type:"text",name:"name",placeholder:"写入或调用该 store 常量的脚本(可省略)"},domProps:{value:e.edvalue.belong},on:{change:function(t){e.$set(e.edvalue,"belong",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"storebelong eflex--wrap"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"store_label"},[e._v(e._s(e.$t("note"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.edvalue.note,expression:"edvalue.note",modifiers:{trim:!0,lazy:!0}}],staticClass:"editor_input storenote_input",attrs:{type:"text",name:"name",placeholder:"关于该 store 常量的一些说明(可省略)"},domProps:{value:e.edvalue.note},on:{change:function(t){e.$set(e.edvalue,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.edvalue.update,expression:"edvalue.update"}],staticClass:"efont",attrs:{title:"该 cookie 的最近更新时间"}},[e._v(e._s(e.$ta("last","update"))+": "+e._s(e.edvalue.update))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h36",on:{click:function(t){return e.viewBelong()}}},[e._v(e._s(e.$ta("check","belong","script")))])])]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.edvalue.value,expression:"edvalue.value"}],staticClass:"editor_textarea",attrs:{placeholder:"the value of key"},domProps:{value:e.edvalue.value},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"tab",9,t.key,"Tab")||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(t.preventDefault(),t.stopPropagation(),e.$uApi.insertText(" "))},function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.storeSave()):null}],input:function(t){t.target.composing||e.$set(e.edvalue,"value",t.target.value)}}}),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("button",{staticClass:"elecBtn elecBtn--store",attrs:{title:"快捷键: ctrl+s"},on:{click:function(t){return e.storeSave()}}},[e._v(e._s(e.$t("save")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store folderbk",attrs:{title:".json 表示单个 Cookie, .zip 表示所有 Cookie"},on:{click:function(t){return e.storeImport()}}},[e._v(e._s(e.$t("import")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store",on:{click:function(t){return e.storeExport()}}},[e._v(e._s(e.$t("export")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--store greenbk",on:{click:function(t){return e.storeBackup()}}},[e._v(e._s(e.$ta("backup","all")))])])])])};$r._withStripped=!0;const wr={name:"storemanage",props:["logs"],data:()=>({store:[],edkey:"",edvalue:{type:"string"},collapse:!0,icon:wa,shownum:50,restnum:0}),computed:{storeshow(){let e=this.shownum;if(-1===e||e>=this.store.length)return this.restnum=0,this.store;let t=0,s=[];for(;t++{this.store=e.data,this.$message.success("成功获取 store 常量 "+this.store.length),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] 成功获取 store 常量 ${this.store.length}`)})).catch((e=>{this.$message.error("获取 store 常量失败",e.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] 获取 store/cookie 常量失败 ${e.message}`),console.error("获取 store 常量失败",e)})).finally(e)},storeEdit(e){if(!e)return void this.$message.error("请先确定要获取的 key 值");if(-1===this.store.indexOf(e))return this.$message.error(e,"暂不存在"),void this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 暂不存在`);const t=this.$message.loading("正在获取",e,"的值...",0);this.$axios.get("/store/"+e).then((t=>{this.edkey=e,"object"==typeof t.data&&void 0!==t.data.type&&void 0!==t.data.value?(this.edvalue=t.data,/^(array|object|json)$/.test(t.data.type)&&(this.edvalue.value=JSON.stringify(t.data.value,null,2))):this.edvalue={type:"string",value:"object"==typeof t.data?JSON.stringify(t.data,null,2):t.data},this.$message.success("成功获取",e,"的值"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] 成功获取 ${e} 的值`)})).catch((t=>{this.$message.error("获取",e,"数据失败",t.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] 获取 ${e} 数据失败 ${t.message}`),console.error("获取",e,"数据失败",t)})).finally(t)},storeSave(){if(this.edkey&&this.edvalue.value){if(/array|object|json/.test(this.edvalue.type)){let e=this.$sJson(this.edvalue.value);if(!e)return void this.$message.error("当前输入内容无法转化为 array/object/json 格式");this.edvalue.value=JSON.stringify(e,null,2)}if(-1===this.store.indexOf(this.edkey)||confirm(this.edkey+" 已存在,是否覆盖?")){const e=this.$message.loading("数据上传保存中...",0);this.$axios.put("/store",{type:"save",data:{key:this.edkey,value:this.edvalue}}).then((e=>{-1===e.data.rescode?(this.$message.error(this.edkey,"保存失败"),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${this.edkey} 保存失败 ${e.data.message}`)):(this.$message.success(this.edkey,"已保存"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] ${this.edkey} 已保存 ${e.data.message||e.data}`),-1===this.store.indexOf(this.edkey)&&this.store.push(this.edkey),"number"===this.edvalue.type?this.edvalue.value=Number(this.edvalue.value):"boolean"===this.edvalue.type&&(this.edvalue.value=this.$uStr.sBool(this.edvalue.value)),this.$set(this.edvalue,"update",this.$sTime(null,0,0)))})).catch((e=>{this.$message.error("保存失败:",e.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${this.edkey} 保存失败 ${e.message}`),console.error("提交 store 常量失败",e)})).finally(e)}}else this.$message.error("请先输入 KEY 及对应内容")},storeDelete(e){if(e){if(confirm("确定删除:"+e+",及对应的值?")){const t=this.$message.loading("数据删除中...",0);this.$axios.put("/store",{type:"delete",data:e}).then((t=>{if(0===t.data.rescode){this.$message.success(e,"已删除"),this.logs.unshift(`[${this.$logHead("storemanage info")}][${this.$sTime(null,1)}] ${e} 已删除 ${t.data.message}`);const s=this.store.indexOf(e);s>-1&&this.store.splice(s,1),this.edkey===e&&(this.edkey="",this.edvalue={type:"string"})}else this.$message.error(e,"删除失败",t.data.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.data.message}`)})).catch((t=>{this.$message.error("删除失败:"+t.message),this.logs.unshift(`[${this.$logHead("storemanage error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.message}`),console.error("删除数据失败",t)})).finally(t)}}else this.$message.error("请先输入要删除的 KEY")},storeOp(e){e.target.dataset.edit?this.storeEdit(e.target.dataset.edit):e.target.dataset.delete&&this.storeDelete(e.target.dataset.delete)},viewBelong(){this.edvalue.belong?this.$emit("belongview",this.edvalue.belong.replaceAll(/ ?, ?|,| /g,"|")):this.$message.error("该 cookie 暂无关联脚本")},storeExport(){this.edkey&&this.edvalue.value?this.$uApi.saveAsFile({key:this.edkey,value:this.edvalue,update:this.$sTime()},this.edkey+"_elecV2Pstore.json"):this.$message.error("当前 Cookie 值为空")},async storeImport(){let e=await this.$uApi.getFile({accept:".json,.zip",type:"file"});if("application/x-zip-compressed"===e.type){if(!/elecV2P/.test(e.name)&&!confirm("当前导入 zip 文件可能并不是 elecV2P store 备份\n确定要继续导入吗?"))return;const t=this.$message.loading("正在对上传的备份文件进行解析...");let s=new FormData;return s.append("backup",e),void this.$axios.post("/store/backup",s,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{0===e.data.rescode?(console.debug(e.data),this.store=e.data.resdata,this.$message.success("store 备份成功上传"),this.logs.unshift(`[${this.$logHead("storeImport info")}][${this.$sTime(null,1)}] 备份上传成功 ${e.data.message}`)):(this.$message.error("备份上传失败",e.data.message),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] store 备份上传失败 ${e.data.message}`))})).catch((e=>{this.$message.error("上传备份失败",e.message),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] 上传备份失败 ${e.message}`),console.error(e)})).finally(t)}if("application/json"!==e.type)return void this.$message.error("仅支持 json 格式文件导入");let t=new FileReader;t.onload=e=>{let t=e.target.result,s=this.$sJson(t);s.key&&s.value&&s.value.type&&s.value.value?(this.edkey=s.key,this.edvalue=s.value,this.logs.unshift(`[${this.$logHead("storeImport info")}][${this.$sTime(null,1)}] 成功导入 Cookie ${this.edkey}`),this.$message.success(`成功导入 Cookie ${this.edkey}`)):(console.error("elecV2P 无法解析该文件内容",t),this.$message.error("导入的 Cookie 文件内容格式不正确",8),this.logs.unshift(`[${this.$logHead("storeImport error")}][${this.$sTime(null,1)}] 导入的 Cookie 文件内容并非 elecV2P 可解析的格式\n${t.length>300?t.slice(-300)+"...":t}`))},t.readAsText(e)},storeBackup(){this.$uApi.downloadFile("/backup/store","elecV2P_store.zip")}}};const kr=ka(wr,$r,[],!1,null,"c3b243d4",null).exports;var Cr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mock",class:{"mock--collapsed":e.collapse}},[t("h4",{staticClass:"title title--mock"},[t("span",{staticClass:"title_main"},[e._v(e._s(e.$ta("mock","HTTP","request")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.method,expression:"method"}],staticClass:"elecTable_select w120 emargin--top",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.method=t.target.multiple?s:s[0]}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("DELETE")])]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.apiurl,expression:"apiurl",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input eflex_grow1 wp50 emargin--d5em",domProps:{value:e.apiurl},on:{change:function(t){e.apiurl=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.mocktype,expression:"mocktype"}],staticClass:"elecTable_select w220 emargin--top",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.mocktype=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"fetch"}},[e._v("from "+e._s(e.$t("browser")))]),e._v(" "),t("option",{attrs:{value:"axios"}},[e._v("from elecV2P")])])]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("label",{staticClass:"mock_label",attrs:{title:"网络请求头"}},[e._v("HEADERS:")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.headertype,expression:"headertype"}],staticClass:"elecTable_select w220 emargin--top",attrs:{title:"Content-Type"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.headertype=t.target.multiple?s:s[0]}}},[t("option",[e._v("text/plain")]),e._v(" "),t("option",[e._v("application/json")]),e._v(" "),t("option",[e._v("application/x-www-form-urlencoded")])]),e._v(" "),t("label",{staticClass:"mock_label emargin--left",attrs:{title:"headers more"}},[e._v(e._s(e.$t("more").toUpperCase())+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.headermore,expression:"headermore",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input eflex_grow1 wp50 emargin--top",attrs:{placeholder:"{ Cookie: '123' }"},domProps:{value:e.headermore},on:{change:function(t){e.headermore=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.body,expression:"body",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea editor_textarea--mini",attrs:{placeholder:"request body. 网络请求体"},domProps:{value:e.body},on:{change:function(t){e.body=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("div",{staticClass:"eflex"},[t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.mockreq()}}},[e._v(e._s(e.$ta("send","request")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong emargin--left",on:{click:function(t){e.jsnameshow=!0}}},[e._v(e._s(e.$ta("make","script")))])]),e._v(" "),e.jsnameshow?t("div",{staticClass:"mockjsname"},[t("label",{staticClass:"mock_label"},[e._v(e._s(e.$ta("script","name"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.jsname,expression:"jsname",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input w220",domProps:{value:e.jsname},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.mockjs()},change:function(t){e.jsname=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn emargin--d5em greenbk",on:{click:function(t){return e.mockjs()}}},[e._v(e._s(e.$t("confirm")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stop minw62",on:{click:function(t){e.jsnameshow=!1}}},[e._v("X")])]):e._e()])};Cr._withStripped=!0;const xr={name:"mock",props:["jslists"],data:()=>({method:"GET",apiurl:"https://httpbin.org/get",mocktype:"fetch",headertype:"text/plain",headermore:"{}",body:null,jsname:"elecV2Pmock.js",jsnameshow:!1,collapse:!0}),computed:{headers(){let e={"Content-Type":this.headertype+";charset=utf-8"},t=this.$sJson(this.headermore);return t?Object.assign(e,t):(this.$message.error("headers 附加内容并不是正确的 JSON 格式"),this.$wsrecv.dispatch("jsmanage",`[${this.$logHead("mockreq error")}][${this.$sTime(null,1)}] headers 附加内容 ${this.headermore} 并不是正确的 JSON 格式`)),e}},methods:{mockreq(){const e={url:this.apiurl,method:this.method,headers:this.headers,body:this.body};if(/json/.test(e.headers["Content-Type"])){let t=this.$sJson(this.body);if(!t)return console.error("body 内容并不是正确的 JSON 格式"),void this.$message.error("body 内容并不是正确的 JSON 格式");e.body=t}e.body?e.body=this.$sString(e.body):e.body=null;const t=this.$message.loading("网络请求已执行,等待数据返回...",0);"fetch"===this.mocktype?fetch(e.url,e).then((e=>e.text())).then((e=>{this.$message.success("网络请求成功"),e=`[${this.$logHead("mockFetch result")}][${this.$sTime(null,1)}] ${e}`,this.$wsrecv.dispatch("jsmanage",e)})).catch((e=>{this.$message.error("fetch 请求失败",e.message);let t=`[${this.$logHead("mockFetch error")}][${this.$sTime(null,1)}] fetch 请求失败 ${e.message}`;this.$wsrecv.dispatch("jsmanage",t),console.error("fetch 请求失败",e)})).finally(t):this.$axios.put("/mock",{type:"req",request:e}).then((e=>{this.$message.success("网络请求",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("请求失败",e.message),console.error(e)})).finally(t)},mockjs(){this.jsnameshow=!1;const e={url:this.apiurl,method:this.method,headers:this.headers};if(/json/.test(e.headers["Content-Type"])){let t=this.$sJson(this.body);if(!t)return console.error("body 内容并不是正确的 JSON 格式"),void this.$message.error("body 内容并不是正确的 JSON 格式");e.body=t}else e.body=this.body;if(this.jslists.indexOf(this.jsname)>-1&&!confirm(this.jsname+" 已存在,是否覆盖?"))return;const t=this.$message.loading("JS 脚本生成中...",0);this.$axios.put("/mock",{type:"js",jsname:this.jsname,request:e}).then((e=>{this.$message.success("脚本已保存",e.data.message),this.jslists.push(this.jsname)})).catch((e=>{this.$message.error("请求失败",e.message),console.error(e)})).finally(t)}}};const Tr=ka(xr,Cr,[],!1,null,"732d9c77",null).exports;var Sr=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"menu",style:{left:(e.pos?e.pos[0]:0)+"px",top:(e.pos?e.pos[1]:0)+"px"}},e._l(e.menus,(function(s,i){return t("li",{staticClass:"menu_item",style:{color:s.color,backgroundColor:s.bkcolor,fontSize:s.fontsize,height:s.height},attrs:{"data-method":s.method,"data-param":s.param},on:{click:function(t){return t.preventDefault(),e.click(i)},contextmenu:function(t){return t.preventDefault(),e.rclick(i)},dblclick:function(t){return t.preventDefault(),e.dclick(i)}}},[e._v(e._s(s.label))])})),0)};Sr._withStripped=!0;const Or=ka({name:"contextmenu",props:["menus","pos"],methods:{click(e){this.menus.length&&this.menus[e].click?this.menus[e].click():console.debug("点击暂无对应处理函数"),this.menus.splice(0)},rclick(e){this.menus.length&&this.menus[e].rclick?this.menus[e].rclick():console.debug("右键暂无对应处理函数"),this.menus.splice(0)},dclick(e){this.menus.length&&this.menus[e].dclick?this.menus[e].dclick():console.debug("双击暂无对应处理函数"),this.menus.splice(0)}}},Sr,[],!1,null,"10ef9a33",null).exports,Er={name:"jsmanage",data(){return{jslists:[],jsdownloadurl:"",jsname:"",jscontent:"",jsupdate:"",jssize:"",jsshowall:!1,jsfiles:[],orgjs:"// 每个脚本理论上都有权限对服务器上的任一文件进行随意修改,请勿运行不信任的脚本\nconsole.log('当前 elecV2P 版本', __version)\n// 获取 store/cookie 值\nlet val = $store.get('cookieKEY')\nconsole.log('cookieKEY 对应值:', val)\n\n// 发送通知\n$feed.push('elecV2P 通知', '该通知来自脚本' + __name + '\\n\\n更多说明请查看: https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md', 'https://github.com/elecV2/elecV2P')\n\n// 网络请求\n$axios({\n url: 'https://httpbin.org/post',\n headers: {\n 'User-Agent': 'elecV2P Super Max Plus++',\n },\n method: 'post'\n}).then(res=>{\n console.log(res.data)\n}).catch(e=>console.error(e.message)).finally(()=>{\n $done('网络请求执行完毕')\n})\n\nconsole.log('更多脚本相关说明请查看说明文档: https://github.com/elecV2/elecV2P-dei/tree/master/docs/04-JS.md')\n",logs:[],icon:wa,collapse:{titlearrow:this.$uStr.iRandom(0,10)>2,loginfo:!0,editor:!0},shownum:100,restnum:0,menu:{pos:[0,0],list:[]},textarea_nowrap:!1,runlogs:this.$ta("script","run","logs")}},components:{store:kr,log:tr,mock:Tr,contextmenu:Or},activated(){const e=this.$uApi.store.getCache("scriptview");e&&(this.jslists.length?this.jsView(e):this.getJSlist().then((()=>{this.jsView(e)})),this.$uApi.store.deleteCache("scriptview"))},computed:{jsfilename(){let e=[];for(let t=0;t=this.jslists.length)return this.restnum=0,this.jslists;let t=0,s=[];for(;t++{try{return e.test(t)}catch(e){return!0}}));return 0===t.length&&-1!==this.shownum&&(this.shownum=-1),t}},created(){this.$uApi.store.getCache("scriptview")||this.getJSlist().then((()=>{const e=new URL(location).searchParams.get("fn");e&&this.jsView(e)}));const e=this.$wsrecv.add("jsmanage",(e=>{this.logs.length>=200||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)}));e&&this.logs.unshift(`[${this.$logHead("websocket error")}][${this.$sTime(null,1)}] ${e}, 日志无法传输`)},methods:{async getJSlist(){const e=this.$message.loading("获取脚本列表中...",0);let t=await this.$axios.get("/jsfile").catch((e=>{this.$message.error("获取脚本列表失败",e.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] 脚本列表获取失败 ${e.message}`),console.error("获取失败",e)}));t&&t.data&&(this.jslists=t.data,this.$message.success(`成功获取脚本列表 ${this.jslists.length}`),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] 成功获取脚本 ${this.jslists.length}`)),e()},jsDownload(){if(!this.jsdownloadurl||!1===/^https?:\/\/\S{4}/.test(this.jsdownloadurl))return void this.$message.error("该远程脚本链接有误",this.jsdownloadurl);let e=this.jsdownloadurl.match(/ -rename(=| )([^\- ]+)/),t="",s="";if(e&&e[2]?(t=e[2].replace(/^(\\|\/)+/,""),s=this.jsdownloadurl.replace(/ -rename(=| )([^\- ]+)/,"").trim()):(t=this.$uStr.surlName(this.jsdownloadurl),s=this.jsdownloadurl),(/\.(js|efh)$/.test(s)||confirm("当前远程链接对应文件可能并非脚本文件,是否继续?"))&&(-1===this.jslists.indexOf(t)||confirm(t+" 已存在,是否覆盖?"))){const e=this.$message.loading(`${t} 下载中...`,0);this.$axios.put("/jsfile",{op:"jsdownload",name:t,url:s}).then((e=>{0===e.data.rescode?(this.$message.success(t,"下载成功"),-1===this.jslists.indexOf(t)&&this.jslists.push(t),this.logs.unshift(`[${this.$logHead("jsDownload info")}][${this.$sTime(null,1)}] ${t} 下载成功 ${e.data.message}`)):(this.$message.error(t,"下载失败"),this.logs.unshift(`[${this.$logHead("jsDownload error")}][${this.$sTime(null,1)}] ${s} 下载失败 ${e.data.message}`))})).catch((e=>{this.$message.error("下载失败",e.message),this.logs.unshift(`[${this.$logHead("jsDownload error")}][${this.$sTime(null,1)}] ${s} 下载失败,${e.message}`),console.error(s,"下载失败",e)})).finally(e)}},jsSave(){if(!/\.(js|efh)$/i.test(this.jsname))return this.$message.error("脚本文件名错误"),void this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] ${this.jsname} 并非合法的脚本名称。编辑上传其他类型的文件请前往 EFSS 界面`);if(!this.jscontent)return this.$message.error("请先输入脚本内容"),void this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] 保存脚本失败,请先输入脚本内容`);const e=this.$message.loading(this.jsname,"保存中...",0);this.$axios.post("/jsfile",{jsname:this.jsname,jscontent:this.jscontent}).then((e=>{0===e.data.rescode?(this.$message.success(this.jsname,"保存成功"),-1===this.jslists.indexOf(this.jsname)&&this.jslists.push(this.jsname),this.logs.unshift(`[${this.$logHead("jsSave info")}][${this.$sTime(null,1)}] ${this.jsname} 保存成功`),this.jsupdate=this.$sTime(),this.jssize=this.$uStr.kSize((new TextEncoder).encode(this.jscontent).length)):(this.$message.error(this.jsname,"保存失败",e.data.message),this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] ${this.jsname} 保存失败`))})).catch((e=>{console.error(e),this.$message.error("保存失败",e.message),this.logs.unshift(`[${this.$logHead("jsSave error")}][${this.$sTime(null,1)}] 保存失败 ${e.message}`)})).finally(e)},jsTest(){if(this.jsname&&this.jscontent){if(/\$request|\$response/.test(this.jscontent)&&!confirm("$request/$response 等参数仅在网络请求中有效,是否继续执行?"))return;let e="";const t=this.$message.loading(this.jsname,"正在上传运行中...",0);this.collapse.loginfo=!1,this.logs.unshift(`[${this.$logHead("jsTestRun info")}][${this.$sTime(null,1)}] 正在测试运行 ${this.jsname}...`),this.$axios.post("/jsfile",{id:this.$wsrecv.id,type:"totest",jsname:this.jsname,jscontent:this.jscontent}).then((t=>{e=this.$sString(t.data),this.$message.success(e)})).catch((t=>{e="测试运行失败 "+t.message,this.$message.error(e),console.error(t)})).finally((()=>{t(),this.logs.unshift(`[${this.$logHead(this.jsname+" result")}][${this.$sTime(null,1)}] ${e||this.jsname+" 返回值为空"}`)}))}else this.$message.error("脚本名称或内容不完整")},jstoupload(){this.jsfiles=this.$refs.jsfiles.files},jsUpload(){let e=new FormData,t=[];for(let s=0;s{0===e.data.rescode?(this.$message.success(t.join(", "),"上传成功"),t.forEach((e=>{-1===this.jslists.indexOf(e)&&this.jslists.push(e)})),this.jsfiles="",this.$refs.jsfiles.value="",this.logs.unshift(`[${this.$logHead("jsUpload info")}][${this.$sTime(null,1)}] ${t.join(", ")} 上传成功`)):(this.$message.error("上传失败",e.data.message),this.logs.unshift(`[${this.$logHead("jsUpload error")}][${this.$sTime(null,1)}] 上传失败 ${e.data.message}`))})).catch((e=>{this.$message.error("上传失败",e.message),this.logs.unshift(`[${this.$logHead("jsUpload error")}][${this.$sTime(null,1)}] 上传失败 ${e.message}`),console.error("文件上传失败",e)})).finally(s)},jsView(e){if(e&&1===this.jslistsshow.length&&(e=this.jslistsshow[0]),e&&-1!==this.jslists.indexOf(e)){this.jsname=e;const t=this.$message.loading("正在获取",e,"文件内容...",0);this.$axios.get("/jsfile?jsfn="+e,{transformResponse:[e=>e]}).then((t=>{this.jscontent=t.data,this.$message.success(e,"文件内容获取成功"),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] ${e} 文件内容获取成功`),t.headers["last-modified"]?(this.jsupdate=this.$sTime(t.headers["last-modified"]),this.jssize=this.$uStr.kSize((new TextEncoder).encode(t.data).length)):this.jsupdate=""})).catch((t=>{this.$message.error(e,"获取失败",t.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] ${e} 获取失败 ${t.message}`),console.error(e,"获取失败",t)})).finally(t)}else if(/^https?:\/\//.test(e)){let t=this.$message.loading("检测到该脚本文件名为远程地址,正在尝试获取其文件内容...",0);this.$axios.get(e,{transformResponse:[e=>e],crossdomain:!0}).then((t=>{this.jsname=this.$uStr.surlName(e),this.jscontent=t.data,this.$message.success("远程脚本文件",this.jsname,"获取成功"),this.logs.unshift(`[${this.$logHead("jsmanage info")}][${this.$sTime(null,1)}] ${e} 文件内容获取成功`),this.jsupdate=""})).catch((t=>{this.$message.error("远程脚本内容获取失败",t.message),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] 获取远程脚本: ${e} 失败,请检测网络后重试 ${t.message}`),console.error(t)})).finally(t)}else this.jsname=e||"new.js","new.js"!==this.jsname&&(this.$message.error(e,"暂不存在"),this.logs.unshift(`[${this.$logHead("jsmanage error")}][${this.$sTime(null,1)}] ${e} 暂不存在`)),""!==this.jscontent&&"new.js"!==this.jsname||(this.jscontent=this.orgjs),this.jsupdate="";this.jsshowall=!0,this.$uApi.scrollView(".editor--jsmanage")},jsDelete(e){if(e){if(confirm("确认删除服务器端脚本文件: "+e)){const t=this.$message.loading(`正在删除文件 ${e}...`,0);this.$axios.delete("/jsfile",{data:{jsfn:e}}).then((t=>{if(0===t.data.rescode){const s=this.jslists.indexOf(e);s>-1?(this.jslists.splice(s,1),this.$message.success(e,"已删除"),this.logs.unshift(`[${this.$logHead("jsDelete info")}][${this.$sTime(null,1)}] ${e} 已删除 ${t.data.message}`),this.jsname===e&&(this.jsname="",this.jscontent="")):this.$message.error(e,"文件不存在")}else this.$message.error(e,"删除失败"),this.logs.unshift(`[${this.$logHead("jsDelete error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.data.message}`)})).catch((t=>{this.$message.error("未知错误",t.message),this.logs.unshift(`[${this.$logHead("jsDelete error")}][${this.$sTime(null,1)}] ${e} 删除失败 ${t.message}`),console.error("未知错误",t)})).finally(t)}}else this.$message.error("请先输入要删除的文件名")},jsOp(e){switch(e.target.dataset.method){case"view":this.jsView(e.target.dataset.param);break;case"delete":this.jsDelete(e.target.dataset.param);break;case"menu":this.jsMenu(e.target.dataset.param)}},jsRun(e){if(!e)return void this.$message.error("请先输入脚本名称");const t=this.$message.loading(e,"准备运行中...",0);this.collapse.loginfo=!1,this.logs.unshift(`[${this.$logHead("jsRun info")}][${this.$sTime(null,1)}] 正在运行 ${e}...`),this.$axios.post("/jsfile",{id:this.$wsrecv.id,type:"torun",jsname:e}).then((e=>{this.$message.success(e.data)})).catch((e=>{this.$message.error(e.message),console.error(e)})).finally(t)},jsMenu(e){let t=[],s=this.jsDelete,i=this.jsView,n=this.jsRun,a=this.$uApi.open,r=this.$uApi.copy,o=this.$message.success,l=/\.efh$/.test(e);t.push({label:"运行",bkcolor:"var(--icon-bk)",click(){n(e)}},{label:"查看",click(){i(e)}},{label:"删除",bkcolor:"var(--note-bk)",click(){s(e)}},{label:"复制脚本名称",click(){r(e),o("复制成功")}},{label:(l?"新标签页":"附带参数")+"运行",bkcolor:"var(--icon-bk)",click(){if(l)return void a("run/?target="+encodeURI(e));let t=prompt("请输入附带参数(比如:-env name=elecV2P 或 -grant nodejs)","-env ");null!==t&&n(e+(t?" "+t.trim():""))}},{label:"打开日志文件",click(){a("./logs/"+e.replace(/\/|\\/g,"-")+".log")}}),this.menu={pos:this.$uApi.getCursorPos(event,120,32*t.length),list:t}},scriptTask(){let e=this.jscontent,t=this.jsname;if(!e)return void this.$message.error("请先获取脚本内容");let s=e.match(/([0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+( [0-9\-\*\/,]+)?) ([^ ,]+), ?tag=([^, \n\r]+)/);s||(s=e.match(/([0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+ [0-9\-\*\/,]+( [0-9\-\*\/,]+)?)"?( (script\-path=)?([^, \n\r]+\.js))?(, ?tag=([^, \n\r]+))?/)||[],s[5]&&(s[3]=s[5]),s[4]=s[7]||"");let i=this.$axios,n=this.$message;this.$evui({title:"添加新的定时任务",width:800,height:148,style:{title:"background: var(--secd-fc);",content:"margin-top: .5em; font-family: var(--font-fm);"},content:`
运行脚本
`,methods:{addTask(){let e=document.querySelector(".elecBtn[data-method=addTask]");if(e){if(e.dataset.done)return void n.success("该任务已添加");e.dataset.done="1",e.classList.remove("greenbk"),e.classList.add("elecBtn--stop")}let t=document.querySelector(".elecTable_input[name=task_name]").value,s=document.querySelector(".elecTable_input[name=task_time]").value,a=document.querySelector(".elecTable_input[name=task_target]").value;if(!(t&&s&&a))return n.error("请填写完整的任务内容"),void delete e.dataset.done;i.put("/task",{op:"add",data:{type:"addition",task:{name:t,type:document.querySelector(".elecTable_select[name=task_type]").value,time:s,job:{type:"runjs",target:a},running:!0}}}).then((s=>{0===s.data.rescode?n.success("添加定时任务",t,s.data.message):(delete e.dataset.done,n.error("添加定时任务失败",s.data.message))})).catch((t=>{n.error("添加定时任务失败",t.message),console.error("添加定时任务失败",t),delete e.dataset.done}))}}})}}};const jr=ka(Er,yr,[],!1,null,"6c7f3ec2",null).exports;var Nr=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.saveAll()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$t("setting")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"setting setting--home"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.homepageSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"可访问此后台界面的完整 URL。用于 RSS 订阅及脚本中的 __home 参数"}},[e._v(e._s(e.$t("homepage"))+":")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.homepage,expression:"homepage",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"homepage",placeholder:e.init_url},domProps:{value:e.homepage},on:{input:function(t){t.target.composing||(e.homepage=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.homepageSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.langSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"仅供参考"}},[e._v(e._s(e.$t("language"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.lang,expression:"lang"}],staticClass:"setting_select setting_select--short",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.lang=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"zh-CN"}},[e._v(e._s(e.$t("zh")))]),e._v(" "),t("option",{attrs:{value:"en"}},[e._v(e._s(e.$t("en")))])]),e._v(" "),t("span",{staticClass:"tip"},[e._v("(还有很多地方待翻译)")]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.langSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting setting--log"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.glevelSet()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"后台日志输出等级"}},[e._v(e._s(e.$t("logs"))+e._s(e.$t("level"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.gloglevel,expression:"gloglevel"}],staticClass:"setting_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.gloglevel=t.target.multiple?s:s[0]}}},[t("option",[e._v("error")]),e._v(" "),t("option",[e._v("notify")]),e._v(" "),t("option",[e._v("info")]),e._v(" "),t("option",[e._v("debug")])]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.glevelSet()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.gsliceSet()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"后台日志输出格式"}},[e._v(e._s(e.$t("format"))+":")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.glogslicebegin,expression:"glogslicebegin"}],staticClass:"setting_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.glogslicebegin=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"0"}},[e._v("YYYY-MM-DD HH:mm:ss.SSS")]),e._v(" "),t("option",{attrs:{value:"5"}},[e._v("MM-DD HH:mm:ss.SSS")]),e._v(" "),t("option",{attrs:{value:"11"}},[e._v("HH:mm:ss.SSS")])]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.gsliceSet()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting setting--webhook"},[t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.wbrtokenSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"服务器访问 token(非常重要)"}},[e._v("WEBHOOK TOKEN:")]),e._v(" "),t("div",{staticClass:"incon"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.wbrtoken,expression:"wbrtoken",modifiers:{trim:!0}}],staticClass:"setting_input incon_input",attrs:{name:"wbrtoken"},domProps:{value:e.wbrtoken},on:{input:function(t){t.target.composing||(e.wbrtoken=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"icon cursor incon_icon",domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){e.wbrtoken=e.$uStr.UUID()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.wbrtokenSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"wp50 minw320 eflex_grow1",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.wbrscriptSave()):null}}},[t("label",{staticClass:"setting_label",attrs:{title:"webhook 其他 payload 处理脚本"}},[e._v("SCRIPT:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.wbrscript}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.wbrscript.target,expression:"wbrscript.target",modifiers:{trim:!0}}],staticClass:"setting_input setting_input--middle",attrs:{name:"wbrscript",placeholder:"webhook.js"},domProps:{value:e.wbrscript.target},on:{input:function(t){t.target.composing||e.$set(e.wbrscript,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.wbrscriptSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.userid,expression:"userid"}],staticClass:"w100",attrs:{title:"基于 WEBHOOK TOKEN 自动生成 无法自定义及反推"}},[t("span",[e._v(e._s(e.$t("user"))+" ID: ")]),t("span",[e._v(e._s(e.userid))])])]),e._v(" "),t("div",{staticClass:"setting",class:{"setting--collapsed":e.collapse.notify}},[t("h4",{staticClass:"setting_title"},[t("div",{staticClass:"title_main"},[t("a",{staticClass:"cursor--help main_fc",attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md",target:"elecV2PDoc"}},[e._v(e._s(e.$ta("notify","setting_of")))]),e._v(" "),t("span",{staticClass:"mleft30 cursor",attrs:{title:"点击进行测试(先保存)"},domProps:{innerHTML:e._s(e.icon.plays)},on:{click:function(t){return e.feedTest()}}})]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.notify},on:{click:function(t){e.collapse.notify=!e.collapse.notify}}})]),e._v(" "),t("div",{staticClass:"setting--notify"},[e._m(0),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.iftttid}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.iftttid.key,expression:"CONFIG_FEED.iftttid.key",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"ifttt",placeholder:"xxxxxxxxxxxxxxxxxxxxxx"},domProps:{value:e.CONFIG_FEED.iftttid.key},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.iftttid,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.iftttSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[e._m(1),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.barkkey}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.barkkey.key,expression:"CONFIG_FEED.barkkey.key",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"barkkey",placeholder:"xxxxxxxxxxxxxxxxxxxxxx"},domProps:{value:e.CONFIG_FEED.barkkey.key},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.barkkey,"key",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.barkeySave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label"},[e._v("自定义通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.custnotify}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.CONFIG_FEED.custnotify.url,expression:"CONFIG_FEED.custnotify.url",modifiers:{trim:!0}}],staticClass:"setting_input",attrs:{name:"custnotify",placeholder:"https://xxx.xx.xxx/xxxxxx"},domProps:{value:e.CONFIG_FEED.custnotify.url},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.custnotify,"url",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_FEED.custnotify.type,expression:"CONFIG_FEED.custnotify.type"}],staticClass:"setting_select setting_select--short",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.CONFIG_FEED.custnotify,"type",t.target.multiple?s:s[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")])]),e._v(" "),"POST"==e.CONFIG_FEED.custnotify.type?t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_FEED.custnotify.data,expression:"CONFIG_FEED.custnotify.data",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea editor_textarea--mini emargin--top",attrs:{placeholder:'使用 $title$ 代表通知标题,$body$ 代表通知内容,$url$ 代表附加链接。比如:\n{\n "text": `$title$`,\n "desp": `$body$\\n\\n附加链接: $url$`\n}\n具体格式及使用参数,根据自定义通知的 API 说明进行调整(通知内容尽量使用反引号`包括)'},domProps:{value:e.CONFIG_FEED.custnotify.data},on:{change:function(t){e.$set(e.CONFIG_FEED.custnotify,"data",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}):e._e(),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.custnotifySave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label"},[e._v("通知触发脚本:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.runjs}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_FEED.runjs.list,expression:"CONFIG_FEED.runjs.list",modifiers:{lazy:!0,trim:!0}}],staticClass:"setting_input",attrs:{name:"runjs",placeholder:"notify.js, test.js(多个脚本使用英文逗号进行分隔,支持远程链接)"},domProps:{value:e.CONFIG_FEED.runjs.list},on:{change:function(t){e.$set(e.CONFIG_FEED.runjs,"list",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.notifyjsSave()}}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting--notify"},[t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("当通知内容长度超过")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.maxbLength,expression:"CONFIG_FEED.maxbLength",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"maxbLength",placeholder:"0: 不分段"},domProps:{value:e.CONFIG_FEED.maxbLength},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED,"maxbLength",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",[e._v("时,分段发送")])]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("是否在前端网页显示通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.webmessage}})],1),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"默认通知内容包括:定时任务开始与停止,脚本运行达到指定次数等"}},[t("span",[e._v("是否开启默认通知:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED}})],1),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.feedOp()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("div",{staticClass:"setting",class:{"setting--collapsed":e.collapse.other},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.mergeSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("default","notify","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.other},on:{click:function(t){e.collapse.other=!e.collapse.other}}})],1),e._v(" "),t("div",{staticClass:"setting setting--other"},[t("div",{staticClass:"eflex eflex--wrap w100"},[t("span",{staticClass:"tip"},[e._v("默认通知内容包括:定时任务开始与停止,脚本运行达到指定次数等")]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"FEED/RSS 包含所有通知内容"}},[e._v("是否输出 "),t("a",{attrs:{href:"/feed",target:"elecV2PFeed"}},[e._v("FEED")]),e._v(":\n "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.rss}})],1),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--wave",on:{click:function(t){return e.feedClear()}}},[e._v("清空 FEED 内容")])]),e._v(" "),t("div",{staticClass:"w100"},[t("div",{staticClass:"setting setting--inline"},[t("label",{staticClass:"setting_label setting_label--flex"},[t("span",{staticClass:"setting_label"},[e._v("是否合并默认通知")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_FEED.merge}})],1),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并时间(秒):")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.merge.gaptime,expression:"CONFIG_FEED.merge.gaptime",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"mergetime"},domProps:{value:e.CONFIG_FEED.merge.gaptime},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.merge,"gaptime",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并逻辑:")]),e._v(" "),t("span",{staticClass:"setting_andor",on:{click:function(t){e.CONFIG_FEED.merge.andor=!e.CONFIG_FEED.merge.andor}}},[e._v(e._s(e.CONFIG_FEED.merge.andor?"AND":"OR"))])]),e._v(" "),t("div",[t("label",{staticClass:"setting_label"},[e._v("合并条数:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_FEED.merge.number,expression:"CONFIG_FEED.merge.number",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"mergenum"},domProps:{value:e.CONFIG_FEED.merge.number},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_FEED.merge,"number",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("当前设置表示:至少等 "+e._s(e.CONFIG_FEED.merge.gaptime)+" 秒 "+e._s(e.CONFIG_FEED.merge.andor?"且":"或")+" 共有 "+e._s(e.CONFIG_FEED.merge.number)+" 条通知时合并发送(此设置对脚本内的通知函数无效,即脚本通知还是单独发送)")])])]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.mergeSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse.runjs},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.runjsSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("script","run","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.runjs},on:{click:function(t){e.collapse.runjs=!e.collapse.runjs}}})],1),e._v(" "),t("div",{staticClass:"setting--other"},[t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",[t("label",{attrs:{title:"0 ms 表示不设定超时时间"}},[e._v("TIMEOUT(ms): ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.timeout,expression:"CONFIG_RUNJS.timeout",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不限制"},domProps:{value:e.CONFIG_RUNJS.timeout},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"timeout",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{attrs:{title:"0 秒表示有则不更新"}},[e._v("远程脚本更新最低时间间隔(秒):")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.intervals,expression:"CONFIG_RUNJS.intervals",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:有则不更新",name:"intervals"},domProps:{value:e.CONFIG_RUNJS.intervals},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"intervals",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",[t("label",{attrs:{title:"0 次表示不通知"}},[e._v("每运行 ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.CONFIG_RUNJS.numtofeed,expression:"CONFIG_RUNJS.numtofeed",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不通知",name:"numtofeed"},domProps:{value:e.CONFIG_RUNJS.numtofeed},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_RUNJS,"numtofeed",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",[e._v(" 次, 添加一个默认通知")])])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("0 ms: 不设定超过时间,由 $done 控制返回, 0 秒: 表示如果有则不更新, 0 次: 表示不通知")]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",{staticClass:"eflex"},[t("label",[e._v("保存日志")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.jslogfile,expression:"CONFIG_RUNJS.jslogfile"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"jslogs"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.jslogfile)?e._i(e.CONFIG_RUNJS.jslogfile,null)>-1:e.CONFIG_RUNJS.jslogfile},on:{change:function(t){var s=e.CONFIG_RUNJS.jslogfile,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"jslogfile",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"jslogfile",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"jslogfile",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{attrs:{title:"打印并保存脚本运行时所发送的网络请求 url"}},[e._v("保存网络请求 URL 到日志中")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.eaxioslog,expression:"CONFIG_RUNJS.eaxioslog"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"eaxioslog"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.eaxioslog)?e._i(e.CONFIG_RUNJS.eaxioslog,null)>-1:e.CONFIG_RUNJS.eaxioslog},on:{change:function(t){var s=e.CONFIG_RUNJS.eaxioslog,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"eaxioslog",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"eaxioslog",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"eaxioslog",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",[e._v("使用网络请求相关设置中的代理(如有)")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_RUNJS.proxy,expression:"CONFIG_RUNJS.proxy"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"runjsproxy"},domProps:{checked:Array.isArray(e.CONFIG_RUNJS.proxy)?e._i(e.CONFIG_RUNJS.proxy,null)>-1:e.CONFIG_RUNJS.proxy},on:{change:function(t){var s=e.CONFIG_RUNJS.proxy,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.CONFIG_RUNJS,"proxy",s.concat([null])):a>-1&&e.$set(e.CONFIG_RUNJS,"proxy",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.CONFIG_RUNJS,"proxy",n)}}})])]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"w120",attrs:{title:"白名单脚本不显示网络请求 url"}},[e._v("白名单脚本")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_RUNJS.white}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.jswhitelist,expression:"jswhitelist",modifiers:{lazy:!0,trim:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"完整的脚本文件名,以英文逗号进行分隔,比如: test.js,softupdate.js",title:"远程脚本只需填写文件名部分。本地次级目录文件需带目录填写"},domProps:{value:e.jswhitelist},on:{change:function(t){e.jswhitelist=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("该名单脚本内所有网络请求直接放行,不做屏蔽检测")])])]),t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.runjsSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("eAxios",{attrs:{config:e.CONFIG_Axios,uagent:e.uagent}}),e._v(" "),t("webui",e._g({attrs:{menunav:e.webUI.nav,theme:e.webUI.theme,logo:e.webUI.logo}},e.$listeners)),e._v(" "),t("security",{attrs:{config:e.CONFIG_SECURITY}}),e._v(" "),t("env",{attrs:{config:e.CONFIG_env}}),e._v(" "),t("div",{staticClass:"setting setting--init",class:{"setting--collapsed":e.collapse.init}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main",attrs:{title:"重启后生效"}},[e._v("初始化相关设置")]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse.init},on:{click:function(t){e.collapse.init=!e.collapse.init}}})],1),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.initSave()):null}}},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"setting_label"},[e._v("启动时检测新版本:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.CONFIG_init,oKey:"checkupdate"}})],1),e._v(" "),t("div",{staticClass:"eflex eflex_grow1 emargin--d5em"},[t("label",{staticClass:"setting_label",attrs:{title:"在 elecV2P 启动时执行的脚本, 可用于配置基础执行环境,或发送启动通知等"}},[e._v("启动时运行脚本:")]),e._v(" "),t("checkbox",{staticClass:"emargin--right",attrs:{oCheck:e.CONFIG_init,oKey:"runjsenable"}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.CONFIG_init.runjs,expression:"CONFIG_init.runjs",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",attrs:{name:"init",placeholder:"python-install.js, feed.js, process.env.js(多个脚本请使用英文逗号进行分隔)"},domProps:{value:e.CONFIG_init.runjs},on:{change:function(t){e.$set(e.CONFIG_init,"runjs",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})],1),e._v(" "),t("button",{staticClass:"elecBtn emargin--d5em",on:{click:function(t){return e.initSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.webUIPortSave()):null}}},[t("label",{staticClass:"setting_label"},[e._v("webUI 主界面端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.webUI.port,expression:"webUI.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"webuiport",placeholder:"80"},domProps:{value:e.webUI.port},on:{input:function(t){t.target.composing||e.$set(e.webUI,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"是否使用 https 访问"}},[t("span",[e._v("TLS:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.webUI.tls}})],1),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex",attrs:{title:"TLS 证书颁发对象,IP 或 域名"}},[t("span",[e._v("HOST:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.webUI.tls.host,expression:"webUI.tls.host"}],staticClass:"setting_input w220",attrs:{name:"tls_host",placeholder:"IP 或 域名"},domProps:{value:e.webUI.tls.host},on:{input:function(t){t.target.composing||e.$set(e.webUI.tls,"host",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.webUIPortSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("div",{staticClass:"setting setting--inline",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.anyproxySave()):null}}},[t("label",{staticClass:"setting_label"},[e._v("ANYPROXY 设置:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.anyproxy,title:"启动时 关闭/打开"}}),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("代理端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.anyproxy.port,expression:"anyproxy.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"anyport",placeholder:"8001"},domProps:{value:e.anyproxy.port},on:{input:function(t){t.target.composing||e.$set(e.anyproxy,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("label",{staticClass:"setting_label setting_label--flex"},[t("span",[e._v("网络请求查看端口:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.anyproxy.webPort,expression:"anyproxy.webPort",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"anywebport",placeholder:"8002"},domProps:{value:e.anyproxy.webPort},on:{input:function(t){t.target.composing||e.$set(e.anyproxy,"webPort",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:e.anyproxySave}},[e._v(e._s(e.$t("save")))])],1),e._v(" "),t("div",{staticClass:"setting setting--config",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.pathSave()):null}}},[t("label",{staticClass:"title_inline",attrs:{title:"仅可在启动时通过 env.CONFIG 更改"}},[t("span",{staticClass:"elabel_text"},[e._v("当前配置文件")]),e._v(" "),t("input",{staticClass:"emargin elecTable_input wp50 minw320",attrs:{disabled:""},domProps:{value:e.CONFIG_Path.config}})]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap"},[t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.lists_final}},[e._v("规则任务列表等保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.lists,expression:"CONFIG_Path.lists"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.lists_final},domProps:{value:e.CONFIG_Path.lists},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"lists",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.script_final}},[e._v("脚本文件保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.script,expression:"CONFIG_Path.script"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.script_final},domProps:{value:e.CONFIG_Path.script},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"script",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.store_final}},[e._v("store 常量保存目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.store,expression:"CONFIG_Path.store"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.store_final},domProps:{value:e.CONFIG_Path.store},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"store",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"w100"},[t("span",{staticClass:"elabel_text",attrs:{title:"当前使用目录:"+e.CONFIG_Path.shell_final}},[e._v("shell 指令默认执行目录")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.CONFIG_Path.shell,expression:"CONFIG_Path.shell"}],staticClass:"elecTable_input wp50 minw320 emargin",attrs:{placeholder:e.CONFIG_Path.shell_final},domProps:{value:e.CONFIG_Path.shell},on:{input:function(t){t.target.composing||e.$set(e.CONFIG_Path,"shell",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong emargin--d5em",on:{click:function(t){return e.pathSave()}}},[e._v(e._s(e.$t("save")))])])]),e._v(" "),t("i",{staticClass:"tip"},[e._v("以上设置将在 elecV2P 重启后正式应用")]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("button",{staticClass:"emargin elecBtn elecBtn--check w220",on:{click:function(t){return e.updateCheck()}}},[e._v("检测更新 elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn greenbk w220",attrs:{title:"请确认已保存好当前规则及任务列表"},on:{click:function(t){return e.evRestart()}}},[e._v(e._s(e.$t("restart"))+" elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn elecBtn--clear w220",attrs:{title:"如只想关闭 ANYPROXY,可在首页双击 ANRPROXY 端口"},on:{click:function(t){return e.evStop()}}},[e._v(e._s(e.$t("stop"))+" elecV2P")]),e._v(" "),t("button",{staticClass:"emargin elecBtn elecBtn--file",on:{click:function(t){return e.configImport()}}},[e._v("导入配置文件")]),e._v(" "),t("button",{staticClass:"emargin elecBtn",attrs:{title:"确保当前页面 WEBHOOK TOKEN 是和服务器匹配的"},on:{click:function(t){return e.configExport()}}},[e._v("导出当前配置")])])])],1),e._v(" "),e._m(2),e._v(" "),e.bShowMinishell?t("minishell",{tag:"div"}):e._e()],1)};Nr._withStripped=!0;var Pr=function(){var e=this,t=e._self._c;return t("div",{staticClass:"shell",class:{mini:e.bIsHide}},[t("span",{staticClass:"shell_hide",class:{"shell_hide--close":!e.$wsrecv.connected},on:{click:function(t){e.bIsHide=!e.bIsHide}}},[e._v(e._s(e.subnum))]),e._v(" "),e.bIsHide?e._e():t("div",{staticClass:"shelllogs",on:{click:function(t){e.autoScroll=!1}}},[t("div",{staticClass:"shell_status"},[t("span",{staticClass:"shell_status_item"},[e._v("CLIENTS: "+e._s(e.status.clients))]),e._v(" "),t("span",{staticClass:"shell_status_item"},[e._v("RSS: "+e._s(e.status.rss))]),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.status.rtimes,expression:"status.rtimes"}],staticClass:"shell_status_item"},[e._v("JSRUNTS: "+e._s(e.status.rtimes))])]),e._v(" "),e._l(e.logs,(function(s){return t("span",{staticClass:"loginfo_item",domProps:{innerHTML:e._s(e.logHtml(s))}})}))],2),e._v(" "),e.bIsHide?e._e():t("ul",{staticClass:"shellsub"},e._l(e.subprocess,(function(s,i){return t("li",{key:i,staticClass:"eflex w100 shellsub_item"},[t("span",{staticClass:"shellsub_command",attrs:{title:i}},[e._v(e._s(e.subCommandAlign(s.command+" %")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.subcommand,expression:"process.subcommand"}],staticClass:"shellsub_input",attrs:{type:"text"},domProps:{value:s.subcommand},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.sendToSub(i))},keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdownSub(i,!0))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdownSub(i))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(s.subcommand=""))}],input:function(t){t.target.composing||e.$set(s,"subcommand",t.target.value)}}}),e._v(" "),t("span",{staticClass:"shellsub_close",on:{click:function(t){return e.subProcessExit(i)}}},[e._v("X")])])})),0),e._v(" "),e.bIsHide?e._e():t("div",{staticClass:"shellcommand",on:{click:function(t){e.autoScroll=!0}}},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fullcommand,expression:"fullcommand"}],staticClass:"shellcommand_input",domProps:{value:e.fullcommand},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.send.apply(null,arguments))},function(t){return(t.type.indexOf("key")||76===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:void(e.logs=[])):null},function(t){return t.type.indexOf("key")||36===t.keyCode?(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(0,t)):null},function(t){return(t.type.indexOf("key")||65===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(0,t)):null},function(t){return(t.type.indexOf("key")||69===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.moveCur(-1,t)):null}],keyup:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdown(!0))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.hiupdown())},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.command=""))}],input:function(t){t.target.composing||(e.fullcommand=t.target.value)}}})])])};function Ar(e=""){switch(e){case"reload":case"?reload":case"refresh":location.reload(!0);break;default:e?/^#/.test(e)?location.hash=e:window.open(e,"elecV2Ptab","noreferrer"):console.debug("no url to open")}}function Ir(e,t=160,s=100){let i=e.pageX,n=e.pageY;return e.pageX+t>document.body.clientWidth&&(i-=t),e.pageY+s>document.body.clientHeight&&(n-=s),[i,n]}Pr._withStripped=!0;const Rr=new Map,Dr=new Map;Dr.set("082bc4ee40bfef100f79579dc780dff7",{name:"elecV2",homepage:"https://github.com/elecV2"}),Dr.set("cd2458b5e43827ee9a2009b56f29ffd5",{name:"Public test",homepage:"https://t.me/elecV2"}),Dr.set("b9b2e3354b6520261c1b5c375dc2bf74",{name:"Oreomeow",homepage:"https://github.com/Oreomeow"});let Fr=localStorage.getItem("sponsors");if(Fr)try{JSON.parse(Za(Fr,"elecV2P_sponsors")).forEach((e=>{Dr.set(e,Object.create(null))}))}catch(e){console.debug("parse localStorage sponsors",e)}Rr.set("sponsors",Dr),Rr.set("bChecked",localStorage.getItem("bcheck")===(new Date).getDate().toString()),Dr.has(localStorage.getItem("userid"))&&Rr.set("bSponsor",!0);const Lr={get:e=>localStorage.getItem(e),set:(e,t)=>localStorage.setItem(e,t),hasCache:e=>Rr.has(e),getCache:e=>Rr.get(e),setCache:(e,t)=>Rr.set(e,t),deleteCache:e=>Rr.delete(e)};function Hr(e){let t=document.querySelector(e);t&&(t.scrollTop=t.scrollHeight)}function Ur(e){let t=document.querySelector(e);t&&t.scrollIntoView()}function Mr(e){let t=document.querySelector(e);t&&t.focus()}function Br(e,t="elecV2P.json",s="application/json"){e=/json/.test(s)?JSON.stringify(e,null,2):String(e);const i=new Blob([e],{type:s});let n=(window.URL||window.webkitURL).createObjectURL(i),a=document.createElement("a");a.download=t,a.href=n,a.click()}function zr(e,t=""){fetch(e).then((s=>{if(!t)try{const e=s.headers.get("Content-Disposition").split(";");t=e[1].split("=")[1]}catch(e){console.error("fail to get filename",e)}return s.blob().then((s=>{let i=document.createElement("a");i.href=URL.createObjectURL(s),i.download=t||e.split("/").pop(),i.click()}))}))}function Vr(e="",t=".evscript"){if(!e)return void console.log("some code are expect");document.querySelector(t)&&document.querySelector(t).remove();let s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("defer","defer"),s.className="evscript",s.innerHTML=e,document.head.appendChild(s)}function Gr(e="",t=".evtheme"){if(!e)return void console.log("some style contexts are expect");document.querySelector(t)&&document.querySelector(t).remove();let s=document.createElement("style");s.className="evtheme",s.innerHTML=e,document.head.appendChild(s)}function Kr(e="",t=""){if(!e)return void console.log("a meta name is expect");let s=document.querySelector(`meta[name=${e}]`),i=null;s?i=s:(i=document.createElement("meta"),i.name=e),i.content=t,!s&&document.head.appendChild(i)}function qr(e="standalone"){return matchMedia(`(display-mode: ${e})`).matches||navigator.standalone||document.referrer.includes("android-app://")}function Jr(e){document.querySelector(e)&&document.querySelector(e).remove()}function Wr(e=""){let t=document.querySelector(".copyinput");t&&"INPUT"===t.nodeName||(t=document.createElement("input"),t.className="copyinput",t.style.position="fixed",t.style.top="-6px",t.style.height="0",t.style.border="none",document.body.appendChild(t)),t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.blur()}function Yr(e){return navigator.clipboard.writeText(e)}function Xr({accept:e="*",type:t="text",multiple:s=!1}={}){let i=document.createElement("input");return i.type="file",i.accept=e,s&&(i.multiple=!0),new Promise(((e,s)=>{i.onchange=i=>{let n=i.target.files[0];if(n)if(console.debug("get file",n.name,n.type,n.size),"file"===t)e(n);else{let t=new FileReader;t.readAsText(n,"UTF-8"),t.onload=t=>{e({name:n.name,type:n.type,size:n.size,content:t.target.result})}}else s("请先选择文件")},i.click()}))}function Zr(){return navigator.userAgent||"Mozilla/5.0 (Linux; U; elecV2P; x64) ePhone Super Max Plus++"}function Qr(e=""){return getComputedStyle(document.querySelector("#app")).getPropertyValue(e).trim()}function eo(e=""){document.execCommand("insertText",!1,e)}const to=new Map;function so(e="",t="",s=3){if(!e||!t)return void to.clear();32!==e.length&&(e=Wa(t,32));const i=e+t+s;if(to.has(i))return to.get(i);let n="";switch(s){case 4:n=function(e=""){const t=document.createElement("canvas");t.width=180,t.height=180;const s=t.getContext("2d"),i=e.match(/\w{2}/g).map((e=>parseInt(e,16)));s.fillStyle=`rgba(${i[0]}, ${i[4]}, ${i[8]}, ${i[12]/380+.3})`,s.fillRect(0,0,t.width,t.height),s.lineCap="round",s.lineJoin="round";const n=i[0]%4,a=i[1]%10+10;switch(s.beginPath(),s.lineWidth=i[2]%15+5,s.strokeStyle=`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/380+.3})`,s.fillStyle=`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]/380+.3})`,n){case 0:s.strokeRect(50-a,60-a,2*a,2*a);break;case 1:s.fillRect(50-a,60-a,2*a,2*a);break;case 2:s.arc(50,60,a,0,2*Math.PI),s.stroke();break;default:s.arc(50,60,a,0,2*Math.PI),s.fill()}const r=i[4]%4,o=i[5]%10+10;switch(s.beginPath(),s.lineWidth=i[6]%15+5,s.strokeStyle=`rgba(${i[4]}, ${i[5]}, ${i[6]}, ${i[7]/380+.3})`,s.fillStyle=`rgba(${i[4]}, ${i[5]}, ${i[6]}, ${i[7]/380+.3})`,r){case 0:s.strokeRect(130-o,60-o,2*o,2*o);break;case 1:s.fillRect(130-o,60-o,2*o,2*o);break;case 2:s.arc(130,60,o,0,2*Math.PI),s.stroke();break;default:s.arc(130,60,o,0,2*Math.PI),s.fill()}return s.beginPath(),s.moveTo(90,(a+o)/2+60),s.quadraticCurveTo(i[8],i[9],90,i[10]%15+105),s.lineWidth=i[11]%15+5,s.strokeStyle=`rgba(${i[8]}, ${i[9]}, ${i[10]}, ${i[11]/380+.3})`,s.stroke(),s.beginPath(),s.moveTo(50,130),s.quadraticCurveTo(i[12],i[13]%50+130,130,130),s.lineWidth=i[14]%15+5,s.strokeStyle=`rgba(${i[12]}, ${i[13]}, ${i[14]}, ${i[15]/380+.3})`,s.stroke(),t.toDataURL()}(e);break;case 3:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d"),n=e.match(/\w{2}/g).map((e=>parseInt(e,16))),a=i.createRadialGradient(90,90,0,90,90,128);a.addColorStop(0,`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]/380+.3})`),a.addColorStop(.25,`rgba(${n[4]}, ${n[5]}, ${n[6]}, ${n[7]/380+.3})`),a.addColorStop(.5,`rgba(${n[8]}, ${n[9]}, ${n[10]}, ${n[11]/380+.3})`),a.addColorStop(.75,`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`),a.addColorStop(1,`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`),i.beginPath(),i.fillStyle=a,i.arc(90,90,128,0,2*Math.PI),i.fill(),t&&io(t,i);return s.toDataURL()}(e,t);break;case 2:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d");e+=e;let n=0;for(let t=0;t<18;t++){for(let s=0;s<18;s++)i.beginPath(),i.fillStyle="#"+e.slice(n+s,n+s+8),i.arc(10*s+5,10*t+5,5,0,2*Math.PI),i.fill();n++}t&&io(t,i);return s.toDataURL()}(e,t);break;default:n=function(e="",t=""){const s=document.createElement("canvas");s.width=180,s.height=180;const i=s.getContext("2d"),n=e.match(/\w{2}/g).map((e=>parseInt(e,16))),a=[n[0]%120,n[1]%120],r=[n[2]%(180-a[0])+a[0],n[3]%(180-a[1])+a[1]];i.fillStyle=`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]/380+.3})`,i.fillRect(0,0,r[0],a[1]-2),i.fillStyle=`rgba(${n[4]}, ${n[5]}, ${n[6]}, ${n[7]/380+.3})`,i.fillRect(r[0]+2,0,180-r[0]-2,r[1]),i.fillStyle=`rgba(${n[8]}, ${n[9]}, ${n[10]}, ${n[11]/380+.3})`,i.fillRect(a[0],r[1]+2,180-a[0],180-r[1]-2),i.fillStyle=`rgba(${n[12]}, ${n[13]}, ${n[14]}, ${n[15]/380+.3})`,i.fillRect(0,a[1],a[0]-2,180-a[1]),i.fillStyle=Qr("--main-bk")||`rgba(${n[1]}, ${n[5]}, ${n[9]}, ${n[13]/380+.3})`,i.fillRect(a[0],a[1],r[0]-a[0],r[1]-a[1]),i.fillStyle="#000",i.fillRect(r[0],0,2,r[1]),i.fillRect(a[0],r[1],180-a[0],2),i.fillRect(a[0]-2,a[1],2,180-a[1]),i.fillRect(0,a[1]-2,r[0],2),t&&io(t,i);return s.toDataURL()}(e,t)}return to.set(i,n),n}function io(e="",t){e&&(e.length>1&&(e=e.slice(0,1)),e=e.toUpperCase(),t.beginPath(),t.lineWidth=6,t.textAlign="center",t.textBaseline="middle",t.font="bold 140px "+(Qr("--font-fm")||"system-ui,sans-serif"),t.strokeStyle=Qr("--main-fc")||"#FFFFFF",t.strokeText(e,90,98))}function no(e=""){if("function"!=typeof eval){const e="eval 函数在当前环境下不可用";return console.error(e),e}try{return(0,eval)(e)}catch(e){return console.error("evalRun fail",e),e.message}}function ao(){return document.title}function ro(e="elecV2P"){document.title=e}function oo({ele:e=document.querySelector(".logo_a"),off:t=!0}={}){return t?e.classList.add("logo_a--offline"):e.classList.remove("logo_a--offline")}function lo(e,t=""){return t?document.querySelectorAll(e):document.querySelector(e)}const co={message:Object.create(null),evui:()=>{}};const uo=ka({name:"minishell",data:()=>({logs:[],command:"node -v",cwd:"",bIsHide:!0,status:{clients:0,rss:0,rtimes:0},history:{current:-1,lists:[]},autoScroll:!0,subprocess:Object.create(null),subDelaySend:Object.create(null),tips:"快捷键:\n- esc // 清空当前输入命令\n- ctrl + l // 清空屏幕日志\n- up/down // 上下查找历史执行命令\n- shift + tab // 移动光标到子进程交互输入框(如果存在的话\n- 单击上方日志输出部分,停止自动滚动。单击下方命令输入部分,开启自动滚动\n\n特殊指令:\n- cls/clear // 清空屏幕日志\n- cwd // 获取当前工作目录\n- cd xxx // 更改当前工作目录到xxx\n- docs // 打开 minishell 相关说明文档\n- exit // 最小化 minishell 界面(在子进程交互中输入时表示结束子进程"}),computed:{cwdshow(){return this.cwd?this.cwd.replace(/(\/|\\)$/,"").split(/\\|\//).pop()+"> ":"> "},subnum(){return Object.keys(this.subprocess).length||""},fullcommand:{get(){return this.cwdshow+this.command},set(e){this.command=e.replace(/[^>]*> /,"")}}},created(){this.logs.push(this.tips),this.$wsrecv.add("minishell",(e=>{if(e.data)switch(e.type){case"cwd":this.logs.push("cwd: "+e.data),this.cwd=e.data;break;case"shellinit":this.logs.push("cwd: "+e.data.cwd),this.cwd=e.data.cwd,e.data.subprocess&&(this.subprocess=e.data.subprocess);break;case"subprocessexit":if(this.subDelaySend[e.data]){console.debug("exit subprocess:",e.data),clearTimeout(this.subDelaySend[e.data]),this.subDelaySend[e.data]=null;break}this.subprocess[e.data]?(console.debug("exit subprocess:",e.data,"command:",this.subprocess[e.data].command),this.$delete(this.subprocess,e.data)):console.debug("subprocess: "+e.data+" not exist yet");break;case"subprocessadd":console.debug("run subprocess:",e.data.id,"command:",e.data.command);let{id:t,command:s}=e.data;this.subDelaySend[t]=setTimeout((()=>{this.subDelaySend[t]=null,this.$set(this.subprocess,t,{command:s,history:{current:-1,lists:[]}})}),800);break;case"elecV2Pstatus":this.status.clients=e.data.clients,this.status.rss=e.data.memoryusage.rss;break;case"jsrunstatus":this.status.rtimes=e.data.total;break;default:/\x1b\[H/.test(e.data)?this.logs=[e.data]:/\r|(\x1b\[F)/.test(e.data)?this.logs.splice(-1,1,e.data):this.logs.push(e.data)}else console.debug("minishell recv",e,"expected ms.data")})),this.$wsrecv.connected&&this.$wsrecv.send("shell","init"),setTimeout(Mr,2e3,".shellcommand_input")},watch:{logs(e){this.logBottom()},subprocess(){this.logBottom()}},methods:{logBottom(){this.autoScroll&&(this.autoScroll=!1,setTimeout((()=>{Hr(".shelllogs"),this.autoScroll=!0}),200))},logHtml:Va,send(e){if(!this.$wsrecv.connected)return this.$message.error("websocket 尚未连接"),void this.logs.push(`[${this.$logHead("minishell error")}][${this.$sTime(null,1)}] websocket 尚未连接`);if(!e.ctrlKey&&!e.shiftKey&&this.command){switch(this.command=this.command.trim(),this.command){case"exit":this.bIsHide=!0;break;case"clear":case"CLEAR":case"cls":case"CLS":this.logs.splice(0);break;case"docs":Ar("https://github.com/elecV2/elecV2P-dei/blob/master/docs/Advanced.md");break;default:const e=`${this.$wsrecv.id}_minishell_${this.history.lists.length}`;this.$wsrecv.send("shell",{id:e,type:"main",data:encodeURI(this.command)}),this.logs.push(`[${this.$logHead("minishell notify")}][${this.$sTime(null,1)}] running command: ${this.command}`)}this.history.lists.push(this.command),this.history.current=-1,this.command=""}},sendToSub(e){if(!e)return void this.$message.error("a command id is expected");let t=this.subprocess[e].subcommand;this.subprocess[e]&&t?(this.subprocess[e].subcommand="",this.$wsrecv.send("shell",{id:e,type:"sub",data:encodeURI(t)}),this.subprocess[e].history||(this.subprocess[e].history={lists:[]}),this.subprocess[e].history.lists.push(t),this.subprocess[e].history.current=-1):this.$message.error("请先输入要执行的命令")},subProcessExit(e){this.$wsrecv.send("shell",{id:e,type:"sub",data:"exit"}),this.$delete(this.subprocess,e)},hiupdown(e=!1){0!==this.history.lists.length&&(e?(this.history.current--,this.history.current<0&&(this.history.current=this.history.lists.length-1)):(this.history.current++,this.history.current>=this.history.lists.length&&(this.history.current=0)),this.command=this.history.lists[this.history.current])},hiupdownSub(e,t=!1){let s=this.subprocess[e];s&&s.history&&0!==s.history.lists.length&&(t?(s.history.current--,s.history.current<0&&(s.history.current=s.history.lists.length-1)):(s.history.current++,s.history.current>=s.history.lists.length&&(s.history.current=0)),s.subcommand=s.history.lists[s.history.current])},subCommandAlign:e=>e.length<32?e:Ba(e,32),moveCur(e=0,t){if(0===e){const e=t.target.value.indexOf(">")+2;t.target.setSelectionRange(e,e)}else t.target.setSelectionRange(e,e)}}},Pr,[],!1,null,"007ead95",null).exports;var ho=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.eAxiosSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("web","request","setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"w100"},[t("div",{staticClass:"setting setting--inline"},[t("div",[t("label",[e._v("TIMEOUT(ms): ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.timeout,expression:"config.timeout",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"0:不限制"},domProps:{value:e.config.timeout},on:{input:function(t){t.target.composing||e.$set(e.config,"timeout",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"minw320"},[t("label",{attrs:{title:"当 header 中没有 User-Agent 时,使用此 UA"}},[e._v("User-Agent: ")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.config.uagent,expression:"config.uagent"}],staticClass:"elecTable_select w220",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.config,"uagent",t.target.multiple?s:s[0])}}},e._l(e.ualists,(function(s,i){return t("option",{domProps:{value:i}},[e._v(e._s(s))])})),0),e._v(" "),t("button",{staticClass:"elecBtn",class:{"elecBtn--check":e.bUAManage},on:{click:function(t){e.bUAManage=!e.bUAManage}}},[e._v(e._s(e.$t("manage")))])]),e._v(" "),t("div",[t("label",{attrs:{title:"process.env.NODE_TLS_REJECT_UNAUTHORIZED,建议始终勾选"}},[e._v("REJECT_UNAUTHORIZED: ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.config.reject_unauthorized,expression:"config.reject_unauthorized"}],staticClass:"echeckbox emargin",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.config.reject_unauthorized)?e._i(e.config.reject_unauthorized,null)>-1:e.config.reject_unauthorized},on:{change:function(t){var s=e.config.reject_unauthorized,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.config,"reject_unauthorized",s.concat([null])):a>-1&&e.$set(e.config,"reject_unauthorized",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.config,"reject_unauthorized",n)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",[e._v("HTTP "+e._s(e.$t("proxy"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.proxy}})],1)]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.bUAManage,expression:"bUAManage"}],staticClass:"setting setting--inline setting--ua",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.uaSave()):null}}},[t("table",{staticClass:"elecTable elecTable--ua"},[t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("name")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw600"},[e._v(e._s(e.$t("content")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.uagent,(function(s,i){return t("tr",{key:i},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"ua.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"chrome 浏览器"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.header,expression:"ua.header",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36"},domProps:{value:s.header},on:{input:function(t){t.target.composing||e.$set(s,"header",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.uaDelete(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_td padding0",attrs:{colspan:"3"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.uaAdd()}}},[e._v(e._s(e.$t("add"))+" UA")]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.uaSave()}}},[e._v(e._s(e.$ta("save","current","list")))])])])])])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.config.proxy.enable,expression:"config.proxy.enable"}],staticClass:"setting_proxy"},[t("div",{staticClass:"setting setting--inline"},[t("label",[t("span",[e._v("PORT:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.proxy.port,expression:"config.proxy.port",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",placeholder:"8001"},domProps:{value:e.config.proxy.port},on:{input:function(t){t.target.composing||e.$set(e.config.proxy,"port",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("label",{staticClass:"wp46"},[t("span",[e._v("HOST:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.host,expression:"config.proxy.host",modifiers:{lazy:!0}}],staticClass:"setting_input",attrs:{placeholder:"可选。如省略表示使用本地代理"},domProps:{value:e.config.proxy.host},on:{change:function(t){return e.$set(e.config.proxy,"host",t.target.value)}}})]),e._v(" "),t("label",[t("span",[e._v("AUTH:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.isAuth,expression:"isAuth"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.isAuth)?e._i(e.isAuth,null)>-1:e.isAuth},on:{change:function(t){var s=e.isAuth,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&(e.isAuth=s.concat([null])):a>-1&&(e.isAuth=s.slice(0,a).concat(s.slice(a+1)))}else e.isAuth=n}}})])]),e._v(" "),e.isAuth?t("div",{staticClass:"setting setting--inline"},[t("label",{staticClass:"eflex mp46"},[t("span",[e._v("USERNAME:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.auth.username,expression:"config.proxy.auth.username",modifiers:{lazy:!0}}],staticClass:"setting_input",domProps:{value:e.config.proxy.auth.username},on:{change:function(t){return e.$set(e.config.proxy.auth,"username",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"eflex mp46"},[t("span",[e._v("PASSWORD:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.proxy.auth.password,expression:"config.proxy.auth.password",modifiers:{lazy:!0}}],staticClass:"setting_input",domProps:{value:e.config.proxy.auth.password},on:{change:function(t){return e.$set(e.config.proxy.auth,"password",t.target.value)}}})])]):e._e()]),e._v(" "),t("div",{staticClass:"setting_proxy",attrs:{title:"谨慎选择是否开启,不合理的设置可能会导致正常的网络请求被屏蔽"}},[t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw160",attrs:{title:"可使用 request.token: '你的webhook token' 绕过屏蔽检测"}},[e._v(e._s(e.$t("forbid"))+" URL")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.block}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.block.regexp,expression:"config.block.regexp",modifiers:{lazy:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"匹配内容 比如: abc|123 匹配方式: new RegExp('该内容').test(url)"},domProps:{value:e.config.block.regexp},on:{change:function(t){return e.$set(e.config.block,"regexp",t.target.value)}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("当网络请求 url 符合此正则表达式时,屏蔽该请求")])]),e._v(" "),t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{staticClass:"minw160"},[e._v(e._s(e.$t("allowed"))+" URL")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.only}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.config.only.regexp,expression:"config.only.regexp",modifiers:{lazy:!0}}],staticClass:"setting_input setting_input--middle",attrs:{placeholder:"匹配内容 其他所有不符合该正则表达式的网络请求将被直接屏蔽掉"},domProps:{value:e.config.only.regexp},on:{change:function(t){return e.$set(e.config.only,"regexp",t.target.value)}}}),e._v(" "),t("span",{staticClass:"tip"},[e._v("开启时,仅允许符合此正则表达式的网络请求通过")])])]),e._v(" "),t("i",{staticClass:"tip tip--small"},[e._v("该部分设置适用于服务器端 文件下载/JS/mock 等模块发起的网络请求。URL 匹配方式: new RegExp('匹配内容').test(url)")]),e._v(" "),t("div",[t("button",{staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.eAxiosSave()}}},[e._v(e._s(e.$t("save")))])])])])};ho._withStripped=!0;const po=ka({name:"eAxios",props:["config","uagent"],data(){return{icon:wa,collapse:this.$uStr.iRandom(0,10)>5,bUAManage:!1}},computed:{ualists(){let e={};for(let t in this.uagent)e[t]=this.uagent[t].name;return e},isAuth:{get(){return Boolean(this.config.proxy&&this.config.proxy.auth)},set(e){e?this.$set(this.config.proxy,"auth",{}):this.$delete(this.config.proxy,"auth")}}},components:{checkbox:mr},methods:{uaDelete(e){this.$message.success("User-Agent:",this.uagent[e].name,"已删除,保存后生效"),this.$delete(this.uagent,e)},uaAdd(){this.$set(this.uagent,this.$uStr.euid(),{name:"我的 UA",header:this.$uApi.getUA()})},uaSave(){const e=this.$message.loading("User-Agent 列表上传更新中...",0);this.$axios.put("/config",{type:"uagent",data:this.uagent}).then((e=>{this.$message.success("设置成功",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},eAxiosSave(){const e=this.$message.loading("网络请求相关设置保存中...",0);this.$axios.put("/config",{type:"eAxios",data:this.config}).then((e=>{0===e.data.rescode?this.$message.success("网络请求相关设置更改成功",e.data.message):this.$message.error("设置失败",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)}}},ho,[],!1,null,"487a2786",null).exports;var mo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.securitySave()):null}}},[t("h4",{staticClass:"setting_title"},[t("div",{staticClass:"title_main"},[t("span",{attrs:{title:"仅对 webUI 端口有效"}},[e._v(e._s(e.$ta("security","access","setting_of")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.config.enable,expression:"config.enable"}],staticClass:"echeckbox emargin",attrs:{type:"checkbox",name:"status",title:"是否开启安全访问"},domProps:{checked:Array.isArray(e.config.enable)?e._i(e.config.enable,null)>-1:e.config.enable},on:{change:function(t){var s=e.config.enable,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.config,"enable",s.concat([null])):a>-1&&e.$set(e.config,"enable",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.config,"enable",n)}}})]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse&&e.config.enable,expression:"!collapse && config.enable"}],staticClass:"w100"},[t("div",{staticClass:"radius_bs border emargin"},[t("div",{staticClass:"setting setting--inline"},[t("div",{staticClass:"wp50"},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$ta("allowed","access"))+" IP("+e._s(e.$t("whitelist"))+"):")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:e.whitelist,expression:"whitelist",modifiers:{trim:!0}}],staticClass:"editor_textarea",attrs:{name:"whitelist",placeholder:"127.0.0.1\n192.168.1.101\n182.xxx.x.125\n(仅可设置为 IP 地址)\n(白名单优先级高于黑名单)"},domProps:{value:e.whitelist},on:{input:function(t){t.target.composing||(e.whitelist=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"wp50"},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$ta("forbid","access"))+" IP("+e._s(e.$t("blacklist"))+"):")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:e.blacklist,expression:"blacklist",modifiers:{trim:!0}}],staticClass:"editor_textarea",attrs:{name:"blacklist",placeholder:"172.20.10.2\n*\n单独星号字符 * 表示屏蔽所有(只允许白名单中的 IP 通过)\n如果设置为 *,请务必先记下 WEBHOOK TOKEN"},domProps:{value:e.blacklist},on:{input:function(t){t.target.composing||(e.blacklist=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100"},[t("div",{staticClass:"eflex",attrs:{title:"启用后,仅 webhook 接口可访问"}},[t("label",{staticClass:"setting_label"},[e._v("WEBHOOK ONLY")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config,oKey:"webhook_only",oInit:"false"}})],1),e._v(" "),t("div",{staticClass:"eflex",attrs:{title:"不启用时,webUI 将不可使用授权 cookie 进行访问"}},[t("label",{staticClass:"setting_label"},[e._v(e._s(e.$t("allow"))+" cookie")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.config.cookie}})],1),e._v(" "),t("div",{attrs:{title:"0: 表示不通知"}},[t("label",[e._v(e._s(e.$t("every"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.config.numtofeed,expression:"config.numtofeed",modifiers:{number:!0}}],staticClass:"setting_input setting_input--number",attrs:{type:"number",name:"numtofeed",placeholder:"0: 不通知"},domProps:{value:e.config.numtofeed},on:{input:function(t){t.target.composing||e.$set(e.config,"numtofeed",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",[e._v(" "+e._s(e.$ta("times","illegal","access"))+", "+e._s(e.$ta("send","a","notify")))])])])]),e._v(" "),t("div",{staticClass:"setting setting--inline border"},[t("h4",{staticClass:"title_inline"},[t("sapn",{staticClass:"title_main"},[e._v(e._s(e.$ta("temp","access"))+" TOKEN")]),e._v(" "),t("button",{staticClass:"efloat--right elecBtn elecBtn--h32 radius_zero radius-bs--tr greenbk",on:{click:function(t){return e.tokensNew()}}},[e._v(e._s(e.$t("new")))])],1),e._v(" "),t("div",{staticClass:"eflex eflex--wrap w100 margin0"},e._l(e.config.tokens,(function(s,i){return t("div",{directives:[{name:"key",rawName:"v-key",value:i,expression:"hash"}],staticClass:"settoken",class:{"settoken--disabled":!s.enable}},[t("div",{staticClass:"eflex w460 minw320 emargin"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.token,expression:"token.token"}],staticClass:"elecTable_input h36",attrs:{placeholder:"临时访问 token"},domProps:{value:s.token},on:{input:function(t){t.target.composing||e.$set(s,"token",t.target.value)}}}),e._v(" "),t("span",{staticClass:"icon--op h36",domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){s.token=e.$uStr.UUID()}}})]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.path,expression:"token.path"}],staticClass:"elecTable_input w360 minw320 emargin h36",attrs:{placeholder:"允许路径,比如 ^/efss(留空:不限制"},domProps:{value:s.path},on:{input:function(t){t.target.composing||e.$set(s,"path",t.target.value)}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.method,expression:"token.method"}],staticClass:"elecTable_input w360 minw320 emargin h36",attrs:{placeholder:"允许方法,比如 GET(留空:不限制"},domProps:{value:s.method},on:{input:function(t){t.target.composing||e.$set(s,"method",t.target.value)}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.note,expression:"token.note"}],staticClass:"elecTable_input minw160 emargin h36",attrs:{placeholder:"备注(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value)}}}),e._v(" "),t("span",{staticClass:"minw100",attrs:{title:"已授权访问次数"}},[e._v(e._s(s.times))]),e._v(" "),t("div",{staticClass:"eflex emargin"},[t("checkbox",{attrs:{oCheck:s}}),e._v(" "),t("span",{staticClass:"icon--op h36",attrs:{title:i},domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$delete(e.config.tokens,i)}}})],1)])})),0)]),e._v(" "),e._m(0)]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.securitySave()}}},[e._v(e._s(e.$t("save")))])])};mo._withStripped=!0;const fo=ka({name:"security",props:["config"],data:()=>({icon:wa,collapse:!1}),components:{checkbox:mr},computed:{whitelist:{get(){return this.config.whitelist?this.config.whitelist.join("\n"):""},set(e){e?this.$set(this.config,"whitelist",e.split(/\r|\n|,/).filter((e=>e.trim()))):this.config.whitelist=[]}},blacklist:{get(){return this.config.blacklist?this.config.blacklist.join("\n"):""},set(e){e?this.$set(this.config,"blacklist",e.split(/\r|\n|,/).filter((e=>e.trim()))):this.config.blacklist=[]}}},methods:{tokensNew(){this.$set(this.config.tokens,this.$uStr.euid(),{enable:!0,token:this.$uStr.UUID(),path:"",method:"",note:"",times:0})},securitySave(){if(this.config.webhook_only&&!confirm("启用 仅开放 webhook 接口 后,webUI 等其他所有接口都不可用\n确定继续?"))return;const e=this.$message.loading("安全访问相关设置保存中...",0);this.$axios.put("/config",{type:"security",data:this.config}).then((e=>{0===e.data.rescode?(this.$message.success("安全访问相关设置保存成功"),e.data.resdata&&(this.config.tokens=e.data.resdata)):(this.$message.error("安全访问相关设置保存失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("安全访问相关设置保存失败",e.message),console.log(e)})).finally(e)}}},mo,[function(){var e=this,t=e._self._c;return t("i",{staticClass:"tip emargin"},[t("span",[e._v("更多说明请参考: ")]),e._v(" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/Advanced.md",target:"elecV2PDoc"}},[e._v("Advanced.md")])])}],!1,null,"2a6fe729",null).exports;var vo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.webuiSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v("webUI "+e._s(e.$t("setting_of")))]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",{attrs:{title:"左上角显示信息"}},[e._v("自定义 LOGO:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.logo}})],1),e._v(" "),t("label",{staticClass:"eflex eflex--wrap emargin"},[e._v("图标链接:"),t("input",{directives:[{name:"model",rawName:"v-model",value:e.logo.src,expression:"logo.src"}],staticClass:"elecTable_input logo_src",attrs:{placeholder:"比如 https://x.xx/x.png 或 efss/logo/my.png"},domProps:{value:e.logo.src},on:{input:function(t){t.target.composing||e.$set(e.logo,"src",t.target.value)}}})]),e._v(" "),t("label",{staticClass:"eflex"},[e._v("显示名称:"),t("input",{directives:[{name:"model",rawName:"v-model",value:e.logo.name,expression:"logo.name"}],staticClass:"elecTable_input w120",attrs:{placeholder:"elecV2P"},domProps:{value:e.logo.name},on:{input:function(t){t.target.composing||e.$set(e.logo,"name",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn w120",on:{click:function(t){return t.preventDefault(),e.logoSave()}}},[e._v("保存")])]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("h4",{staticClass:"title_inline",attrs:{title:"SETTING/DONATION 暂时不支持隐藏"}},[e._v("左侧导航栏设置")]),e._v(" "),t("ul",{staticClass:"eflex eflex--wrap emargin"},e._l(e.menulist,(function(s,i){return t("li",{key:i,staticClass:"menunav_item"},[t("label",[e._v(e._s(i.toUpperCase())+": 别名")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.name,expression:"nav.name"}],staticClass:"emargin--left elecTable_input w220",attrs:{type:"text",placeholder:"显示为其他名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value)}}}),e._v(" "),t("label",{staticClass:"emargin--left"},[e._v("显示")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:s.show,expression:"nav.show"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(s.show)?e._i(s.show,null)>-1:s.show},on:{change:function(t){var i=s.show,n=t.target,a=!!n.checked;if(Array.isArray(i)){var r=e._i(i,null);n.checked?r<0&&e.$set(s,"show",i.concat([null])):r>-1&&e.$set(s,"show",i.slice(0,r).concat(i.slice(r+1)))}else e.$set(s,"show",a)}}})])})),0),e._v(" "),t("span",{staticClass:"tip tip--small"},[e._v(" • SETTING/DONATION 暂时不可隐藏 • 隐藏界面可通过 #hash 的形式直接访问")])]),e._v(" "),e.$uApi.store.getCache("bSponsor")?t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"border setting setting--inline"},[t("div",{staticClass:"eflex"},[t("label",[e._v("启用主题:")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.theme_simple}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.name,expression:"theme_simple.name"}],staticClass:"emargin--left elecTable_input w220",attrs:{type:"text",placeholder:"主题名称"},domProps:{value:e.theme_simple.name},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"name",t.target.value)}}})],1),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("主色彩:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.mainbk,expression:"theme_simple.mainbk"}],staticClass:"elecTable_input w120",attrs:{type:"text",placeholder:"#326733"},domProps:{value:e.theme_simple.mainbk},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"mainbk",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("文字色彩:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.maincl,expression:"theme_simple.maincl"}],staticClass:"elecTable_input w120",attrs:{type:"text",placeholder:"#ff9800"},domProps:{value:e.theme_simple.maincl},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"maincl",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin"},[t("label",[e._v("应用背景:")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.appbk,expression:"theme_simple.appbk"}],staticClass:"elecTable_input w220",attrs:{type:"text",placeholder:"url(https://x.xx/x.png)"},domProps:{value:e.theme_simple.appbk},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"appbk",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"emargin eflex eflex--wrap w100"},[t("div",{staticClass:"theme_style"},[t("label",[e._v("附加样式:")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.theme_simple.style,expression:"theme_simple.style"}],staticClass:"editor_textarea editor_textarea--oneline",attrs:{placeholder:"#app {--main-bk: #2E3784;--main-fc: #FFCB40;--main-cl: #64AAD0;}"},domProps:{value:e.theme_simple.style},on:{input:function(t){t.target.composing||e.$set(e.theme_simple,"style",t.target.value)}}})]),e._v(" "),t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.themePreview()}}},[e._v("预览")]),e._v(" "),t("button",{staticClass:"elecBtn w120",on:{click:function(t){return e.themeSave()}}},[e._v("保存为常用")])]),e._v(" "),t("div",{staticClass:"w100"},[t("ul",{staticClass:"w100"},e._l(e.theme_list,(function(s,i){return t("li",{staticClass:"theme_item"},[t("span",{staticClass:"w220"},[e._v(e._s(s.name)+":")]),e._v(" "),t("div",{staticClass:"theme_view"},[t("span",{staticClass:"theme_viewitem",style:{background:s.mainbk},attrs:{title:s.mainbk},on:{click:function(t){return t.preventDefault(),e.copyColor(s.mainbk)}}}),e._v(" "),t("span",{staticClass:"theme_viewitem",style:{background:s.maincl},attrs:{title:s.maincl},on:{click:function(t){return t.preventDefault(),e.copyColor(s.maincl)}}}),e._v(" "),t("span",{staticClass:"theme_viewitem",style:{background:s.appbk},attrs:{title:s.appbk},on:{click:function(t){return t.preventDefault(),e.copyColor(s.appbk)}}})]),e._v(" "),t("div",{staticClass:"theme_op"},[t("button",{staticClass:"elecBtn greenbk elecBtn--h32",on:{click:function(t){return e.themePreview(i)}}},[e._v("预览")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--clear elecBtn--h32",on:{click:function(t){return e.theme_list.splice(i,1)}}},[e._v("删除")])])])})),0),e._v(" "),t("div",{staticClass:"theme_imexport"},[t("button",{staticClass:"elecBtn elecBtn--h32 minw160",on:{click:function(t){return t.preventDefault(),e.themeExport()}}},[e._v("导出常用主题")]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--h32 minw160",on:{click:function(t){return t.preventDefault(),e.themeImport()}}},[e._v("导入常用主题")])])])]):e._e(),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"elecBtn elecBtn--stlong",on:{click:function(t){return e.webuiSave()}}},[e._v(e._s(e.$t("save")))])])};vo._withStripped=!0;const go=ka({name:"webui",props:["menunav","theme","logo"],data(){return{collapse:this.$uStr.iRandom(0,10)>5,navkey:["overview","task","mitm","rules","rewrite","jsmanage","setting","cfilter","about","donation"]}},components:{checkbox:mr},computed:{menulist(){for(let e of this.navkey)this.menunav[e]||(this.menunav[e]=Object.create(null)),!1!==this.menunav[e].show&&(this.menunav[e].show=!0);return this.menunav},theme_simple(){return this.theme.simple||(this.theme.simple=Object.create(null)),this.theme.simple},theme_list(){return this.theme.list||(this.theme.list=[]),this.theme.list}},methods:{webuiSave(){if(this.theme_simple.style&&/{0===e.data.rescode?(this.$message.success("webUI 相关设置修改成功"),this.$emit("menunav",this.menunav,!0),this.$emit("theme",this.theme_simple)):this.$message.error("webUI 相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("webUI 相关设修改失败",e.message),console.error("webUI 相关设修改失败",e)})).finally(e)},themeSave(){let e=prompt("命名将要保存的主题",this.theme_simple.name||"主题名称");e&&(this.theme.list.push({name:e,mainbk:this.theme_simple.mainbk,maincl:this.theme_simple.maincl,appbk:this.theme_simple.appbk,style:this.theme_simple.style}),this.$message.success(e,"已保存"),this.$forceUpdate())},themePreview(e=-1){-1!==e?(this.theme_simple.enable=!0,this.theme_simple.name=this.theme_list[e].name,this.theme_simple.mainbk=this.theme_list[e].mainbk,this.theme_simple.maincl=this.theme_list[e].maincl,this.theme_simple.appbk=this.theme_list[e].appbk,this.theme_simple.style=this.theme_list[e].style,this.$emit("theme",this.theme_simple)):this.$emit("theme",this.theme_simple)},themeExport(){this.$uApi.saveAsFile(this.theme_list,"elecV2P_theme.json")},themeImport(){this.$uApi.getFile({accept:".json"}).then((e=>{try{this.theme_list.push(...JSON.parse(e.content)),this.$forceUpdate(),this.$message.success("常用主题列表导入成功")}catch(e){this.$message.error("常用主题列表导入失败",e.message||e)}})).catch((e=>{this.$message.error("常用主题列表导入失败",e.message||e)}))},logoSave(){const e=this.$message.loading("LOGO 相关设置保存中...",0);this.$axios.put("/config",{type:"webUILogo",data:this.logo}).then((e=>{0===e.data.rescode?(this.$message.success("LOGO 相关设置修改成功"),this.$emit("theme",{type:"logo",...this.logo})):this.$message.error("LOGO 相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("LOGO 相关设修改失败",e.message),console.error("LOGO 相关设修改失败",e)})).finally(e)},copyColor(e=""){e?this.$uApi.copyToClipboard(e).then((t=>{this.$message.success("成功复制",e)})).catch((e=>{this.$message.error("复制失败",e.message)})):this.$message.error("该项暂无对应值可供复制")}}},vo,[],!1,null,"f48c8df4",null).exports;var _o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"setting setting--vflex",class:{"setting--collapsed":e.collapse},on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.envSave()):null}}},[t("h4",{staticClass:"setting_title"},[t("sapn",{staticClass:"title_main"},[e._v("环境变量相关设置")]),e._v(" "),t("span",{staticClass:"title_collapse",class:{"title_collapse--collapsed":e.collapse},on:{click:function(t){e.collapse=!e.collapse}}})],1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"w100"},[t("div",{staticClass:"eflex w100 emargin"},[t("label",{staticClass:"minw160"},[e._v("PATH")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.config.path,expression:"config.path"}],staticClass:"editor_textarea editor_textarea--mini emargin--left",attrs:{placeholder:"路径/PATH 分隔符 WIN系统-分号(;) 其他系统-冒号(:)"},domProps:{value:e.config.path},on:{input:function(t){t.target.composing||e.$set(e.config,"path",t.target.value)}}})]),e._v(" "),e._l(e.config.other,(function(s,i){return t("div",{key:i,staticClass:"eflex w100 emargin"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s[0],expression:"envk[0]",modifiers:{trim:!0}}],staticClass:"elecTable_input minw160",attrs:{type:"text",placeholder:"变量名称"},domProps:{value:s[0]},on:{input:function(t){t.target.composing||e.$set(s,0,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.trim",value:s[1],expression:"envk[1]",modifiers:{trim:!0}}],staticClass:"editor_textarea editor_textarea--oneline emargin--left",attrs:{placeholder:"变量对应值"},domProps:{value:s[1]},on:{input:function(t){t.target.composing||e.$set(s,1,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$delete(e.config.other,i)}}})])}))],2),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.collapse,expression:"!collapse"}],staticClass:"eflex w100"},[t("button",{staticClass:"elecBtn elecBtn--stlong wp46",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.envNew()}}},[e._v(e._s(e.$t("new")))]),e._v(" "),t("button",{staticClass:"elecBtn elecBtn--stlong wp46",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.envSave()}}},[e._v(e._s(e.$t("save")))])])])};_o._withStripped=!0;const bo=ka({name:"env",props:["config"],data(){return{icon:wa,collapse:this.$uStr.iRandom(0,10)>5}},methods:{envNew(){this.config.other.push(["",""])},envSave(){if(!this.config.path)return void this.$message.error("请先输入 PATH 变量对应值再进行保存");if(/[\*\?"<>\|]/.test(this.config.path)&&!confirm("PATH 中包含特殊字符,确认继续保存?"))return;let e=[],t=[];if(this.config.other.length)for(const e of this.config.other){if(!e[0]||!e[1])return void this.$message.error("部分环境变量或对应值为空,请填写后再进行保存");t.push(e[0])}this.config.dable.forEach((s=>{-1===t.indexOf(s)&&e.push(s)}));const s=this.$message.loading("环境变量相关设置保存中...",0);this.$axios.put("/config",{type:"env",data:{path:this.config.path,other:this.config.other,todel:e}}).then((e=>{0===e.data.rescode?(this.$message.success("环境变量相关设置修改成功"),this.config.dable=this.config.other.map((e=>e[0]))):this.$message.error("环境变量相关设置修改失败",e.data.message)})).catch((e=>{this.$message.error("环境变量相关设修改失败",e.message),console.error("环境变量相关设修改失败",e)})).finally(s)}}},_o,[],!1,null,null,null).exports,yo={name:"setting",props:[],data(){return{icon:wa,collapse:{notify:this.$uStr.iRandom(0,10)>5,runjs:this.$uStr.iRandom(0,10)>5,other:this.$uStr.iRandom(0,10)>5,init:!0},init_url:Oa.base_url,homepage:Oa.base_url,lang:rr.locale,gloglevel:"info",glogslicebegin:"0",wbrtoken:"",userid:this.$uApi.store.get("userid"),wbrscript:{enable:!1,target:""},CONFIG_FEED:{enable:!0,rss:{enable:!0,homepage:"https://github.com/elecV2/elecV2P"},iftttid:{enable:!1,key:""},barkkey:{enable:!1,key:""},custnotify:{enable:!1,url:"",type:"GET",data:""},runjs:{enable:!1,list:""},merge:{enable:!0,gaptime:60,number:10,andor:!1},maxbLength:1200,webmessage:{enable:!1}},CONFIG_RUNJS:{timeout:5e3,intervals:86400,numtofeed:50,jslogfile:!0,eaxioslog:!1,proxy:!0,white:{enable:!1,list:[]}},CONFIG_Axios:{proxy:{enable:!1},timeout:5e3,uagent:"",block:{enable:!1,regexp:""},only:{enable:!1,regexp:""},reject_unauthorized:!0},bShowMinishell:!1,uagent:Object.create(null),CONFIG_SECURITY:{enable:!1,blacklist:[],whitelist:[],cookie:{enable:!0},numtofeed:0,webhook_only:!1,tokens:{}},CONFIG_init:{checkupdate:!0,runjsenable:!0,runjs:""},CONFIG_env:{path:"",other:[],dable:[]},anyproxy:{enable:!0,port:8001,webPort:8002},webUI:{port:80,tls:{enable:!1,host:"127.0.0.1"},nav:Object.create(null),logo:{enable:!1,src:"",name:""},theme:{simple:{enable:!1,name:"",mainbk:"",maincl:"",appbk:"",style:""},list:[{name:"简单暗黑",mainbk:"#000C",maincl:"#6E77FB",appbk:"#000C",style:""},{name:"简单透明",mainbk:"#0000",maincl:"#FFC107",appbk:"url(https://images.unsplash.com/photo-1646505183416-f3301d2a8127?auto=format)",style:".content>div,.elecBtn--long,.efssset_container,.efsslist{border: 1px solid var(--tras-bk);}.eapp_item .eapp_name,.efsslist_content .efssa{color: var(--main-cl);}.loginfo.loginfo--full{background: var(--secd-bk);}.codeditor{--main-bk: var(--secd-bk);}"}]}},CONFIG_Path:{config:"",lists:"",lists_final:"",script:"",script_final:"",store:"",store_final:"",shell:"",shell_final:""},newversion:""}},computed:{jswhitelist:{get(){return this.CONFIG_RUNJS.white.list.join(", ")},set(e){this.CONFIG_RUNJS.white.list=e.split(/ ?, ?|,| /)}}},components:{minishell:uo,eAxios:po,security:fo,checkbox:mr,webui:go,env:bo},created(){const e=this.$message.loading("正在获取 设置 相关数据...",0);this.$axios.get("/config?type=setting").then((e=>{if(this.$message.success("CONFIG 相关数据获取成功"),this.homepage=e.data.homepage||Oa.base_url,this.gloglevel=e.data.gloglevel,this.glogslicebegin=String(e.data.glogslicebegin||"0"),Object.assign(this.CONFIG_SECURITY,e.data.security||{}),Object.assign(this.CONFIG_FEED,e.data.CONFIG_FEED||{}),Object.assign(this.CONFIG_RUNJS,e.data.CONFIG_RUNJS||{}),Object.assign(this.CONFIG_Axios,e.data.CONFIG_Axios||{}),Object.assign(this.CONFIG_Path,e.data.CONFIG_Path||{}),Object.assign(this.CONFIG_init,e.data.init||{}),Object.assign(this.anyproxy,e.data.anyproxy||{}),e.data.CONFIG_env){const{path:t,...s}=e.data.CONFIG_env;this.CONFIG_env.path=t;for(const e in s)this.CONFIG_env.dable.push(e),this.CONFIG_env.other.push([e,s[e]])}if(e.data.uagent)for(let t in e.data.uagent)e.data.uagent[t].name&&this.$set(this.uagent,t,{name:e.data.uagent[t].name,header:e.data.uagent[t].header});if(this.wbrtoken=e.data.wbrtoken,this.userid=e.data.userid,this.userid!==this.$uApi.store.get("userid")&&this.$uApi.store.set("userid",this.userid),this.$uApi.store.setCache("bSponsor",this.$uApi.store.getCache("sponsors").has(this.userid)),e.data.webUI)if(Object.assign(this.webUI,e.data.webUI),e.data.webUI.nav&&this.$emit("menunav",{...e.data.webUI.nav}),e.data.webUI.logo&&this.$emit("theme",{type:"logo",...e.data.webUI.logo}),this.$uApi.store.getCache("bSponsor")){let t=e.data.webUI.theme;t&&this.$emit("theme",t.simple||t)}else this.$emit("theme",{enable:!1});e.data.lang&&this.lang!==e.data.lang&&(this.lang=e.data.lang,this.setLanguage()),"object"==typeof e.data.wbrscript&&Object.assign(this.wbrscript,e.data.wbrscript),this.bShowMinishell=e.data.minishell,this.newversion=e.data.newversion})).catch((e=>{this.$message.error("获取数据失败",e),console.error("获取数据失败",e)})).finally(e)},methods:{homepageSave(){if(this.homepage!==location.origin&&!confirm("设置主页和当前主页 "+location.origin+" 不匹配,确定保存?"))return;const e=this.$message.loading("主页设置保存中...",0);this.$axios.put("/config",{type:"homepage",data:this.homepage}).then((e=>{this.$message.success("设置成功",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},glevelSet(){const e=this.$message.loading("全局日志设置中...",0);this.$axios.put("/config",{type:"gloglevel",data:this.gloglevel}).then((e=>{0===e.data.rescode?this.$message.success("设置成功",e.data.message):this.$message.error("设置失败",e.data.message)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},gsliceSet(){const e=this.$message.loading("日志格式设置中...",0);this.$axios.put("/config",{type:"glogslicebegin",data:this.glogslicebegin}).then((e=>{0===e.data.rescode?(this.$message.success("日志格式设置成功"),Oa.glogslicebegin=this.glogslicebegin):this.$message.error("日志格式设置失败")})).catch((e=>{this.$message.error("日志格式设置失败",e.message),console.log(e)})).finally(e)},feedOp(){const e=this.$message.loading("设置保存中...",0);this.$axios.put("/feed",{type:"op",data:{enable:this.CONFIG_FEED.enable,maxbLength:this.CONFIG_FEED.maxbLength,webmessage:this.CONFIG_FEED.webmessage}}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log(e)})).finally(e)},feedTest(){const e=this.$message.loading("通知准备测试中...",0);this.$axios.put("/feed",{type:"test"}).then((e=>{0===e.data.rescode?this.$message.success(e.data.message):console.log(e.data)})).catch((e=>{this.$message.error("通知测试失败",e.message),console.log(e)})).finally(e)},feedClear(){if(!confirm("确实清空 Feed 内容吗?"))return;const e=this.$message.loading("Feed 清空中...",0);this.$axios.put("/feed",{type:"clear"}).then((e=>{this.$message.success("Feed 内容已重置",e.data.message)})).catch((e=>{this.$message.error("Feed 清空失败",e.message),console.log(e)})).finally(e)},iftttSave(){if(!this.CONFIG_FEED.iftttid.enable||this.CONFIG_FEED.iftttid.key){if(this.CONFIG_FEED.iftttid.enable||confirm("确认关闭 IFTTT 通知?")){const e=this.$message.loading("IFTTT 设置中...",0);this.$axios.put("/feed",{type:"ifttt",data:this.CONFIG_FEED.iftttid}).then((e=>{this.$message.success("IFTTT 设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置保存失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入 IFTTT KEY 值")},barkeySave(){if(!this.CONFIG_FEED.barkkey.enable||this.CONFIG_FEED.barkkey.key){if(this.CONFIG_FEED.barkkey.enable||confirm("确认关闭 BARK 通知?")){const e=this.$message.loading("barkkey 设置中...",0);this.$axios.put("/feed",{type:"barkkey",data:this.CONFIG_FEED.barkkey}).then((e=>{this.$message.success("barkkey 设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入 BARK KEY 值")},custnotifySave(){if(!this.CONFIG_FEED.custnotify.enable||this.CONFIG_FEED.custnotify.url){if(this.CONFIG_FEED.custnotify.enable||confirm("确认关闭自定义通知?")){const e=this.$message.loading("更新自定义通知相关设置中...",0);this.$axios.put("/feed",{type:"custnotify",data:this.CONFIG_FEED.custnotify}).then((e=>{this.$message.success("自定义通知设置已保存",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入自定义通知链接")},notifyjsSave(){if(!this.CONFIG_FEED.runjs.enable||this.CONFIG_FEED.runjs.list){if(this.CONFIG_FEED.runjs.enable||confirm("确认关闭触发脚本?")){const e=this.$message.loading("通知触发脚本设置保存中...",0);this.$axios.put("/feed",{type:"runjs",data:this.CONFIG_FEED.runjs}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`),console.debug(e.data)})).catch((e=>{this.$message.error("设置保存失败",e.response?e.response.data:e.message),console.error(e)})).finally(e)}}else this.$message.error("请输入要触发的脚本")},wbrtokenSave(){if(!this.wbrtoken)return void this.$message.error("请先输入 TOKEN 值");if(this.wbrtoken.length<12)return void this.$message.error("当前设置 TOKEN 太短,请重新填写");const e=this.$message.loading("TOKEN 上传设置中...",0);this.$axios.put("/config",{type:"wbrtoken",data:this.wbrtoken}).then((e=>{0===e.data.rescode?(e.data.resdata&&this.userid!==e.data.resdata.userid&&(this.userid=e.data.resdata.userid,this.$uApi.store.set("userid",this.userid)),this.$message.success("设置成功",e.data.message)):this.$message.error("WEBHOOK TOKEN 修改失败",e.data.message),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},wbrscriptSave(){if(this.wbrscript.enable&&!this.wbrscript.target)return void this.$message.error("请先设置 WEBHOOK SCRIPT 处理脚本");const e=this.$message.loading("WEBHOOK SCRIPT 设置中...",0);this.$axios.put("/config",{type:"wbrscript",data:this.wbrscript}).then((e=>{0===e.data.rescode?this.$message.success("设置成功",e.data.message):this.$message.error("WEBHOOK SCRIPT 设置失败",e.data.message)})).catch((e=>{this.$message.error("WEBHOOK SCRIPT 设置失败",e.message),console.error("WEBHOOK SCRIPT 设置",e)})).finally(e)},mergeSave(){const e=this.$message.loading("默认通知设置中...",0);this.$axios.put("/feed",{type:"merge",data:{rssenable:this.CONFIG_FEED.rss.enable,merge:this.CONFIG_FEED.merge}}).then((e=>{this.$message.success(`设置已保存\n${e.data.message}`),console.debug(e.data)})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)},runjsSave(){const e=this.$message.loading("脚本运行相关设置保存中...",0);this.$axios.put("/config",{type:"runjs",data:this.CONFIG_RUNJS}).then((e=>{0===e.data.rescode?this.$message.success("脚本运行相关设置保存成功",e.data.message):(this.$message.error("脚本运行相关设置保存失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("脚本运行相关设置保存失败",e.message),console.log(e)})).finally(e)},initSave(){const e=this.$message.loading("启动时 相关设置保存中...",0);this.$axios.put("/config",{type:"init",data:{CONFIG_init:this.CONFIG_init}}).then((e=>{0===e.data.rescode?this.$message.success("启动时相关设置保存成功",e.data.message):this.$message.error("启动时相关设置修改失败")})).catch((e=>{this.$message.error("启动时相关设置保存失败",e.message),console.log(e)})).finally(e)},anyproxySave(){if(this.anyproxy.port&&this.anyproxy.webPort){if(this.anyproxy.enable||confirm("确定在下次启动 elecV2P 时不打开 ANYPROXY 吗?")){const e=this.$message.loading("ANYPROXY 相关设置保存中...",0);this.$axios.put("/config",{type:"anyproxy",data:this.anyproxy}).then((e=>{0===e.data.rescode?this.$message.success("ANYPROXY 设置保存成功"):(this.$message.error("ANYPROXY 设置修改失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("设置失败",e.message),console.log(e)})).finally(e)}}else this.$message.error("请正确填写端口相关数据")},webUIPortSave(){if(confirm("确定将 webUI 主界面端口更改为: "+this.webUI.port+" 吗?(下次启动时应用)")){const e=this.$message.loading("webUI 主界面端口修改保存中...",0);this.$axios.put("/config",{type:"webUIPort",data:this.webUI}).then((e=>{0===e.data.rescode?this.$message.success("webUI 端口设置保存成功"):(this.$message.error("webUI 端口设置修改失败",e.data.message),console.error(e.data))})).catch((e=>{this.$message.error("webUI 端口设置失败",e.message),console.log(e)})).finally(e)}},pathSave(){const e=this.$message.loading("用户数据保存目录设置中...",0),{lists:t,script:s,store:i,shell:n}=this.CONFIG_Path;this.$axios.put("/config",{type:"datapath",data:{lists:t,script:s,store:i,shell:n}}).then((e=>{0===e.data.rescode?this.$message.success("用户数据保存目录设置成功 重启后正式生效"):this.$message.error("用户数据保存目录设置失败",e.data.message)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log(e)})).finally(e)},saveAll(){const e=this.$message.loading("配置数据上传中...",0);this.$axios.put("/config",{type:"config",data:{homepage:this.homepage,lang:this.lang,gloglevel:this.gloglevel,glogslicebegin:this.glogslicebegin,CONFIG_FEED:this.CONFIG_FEED,CONFIG_RUNJS:this.CONFIG_RUNJS,CONFIG_Axios:this.CONFIG_Axios,wbrtoken:this.wbrtoken,webhook:{script:this.wbrscript},path_lists:this.CONFIG_Path.lists,path_script:this.CONFIG_Path.script,path_store:this.CONFIG_Path.store,path_shell:this.CONFIG_Path.shell,webUI:this.webUI,SECURITY:this.CONFIG_SECURITY,init:this.CONFIG_init}}).then((e=>{this.$message.success(`当前设置保存成功\n${e.data.message}`)})).catch((e=>{this.$message.error("设置保存失败",e.message),console.log("设置保存失败",e)})).finally(e)},configExport(){this.$uApi.downloadFile("/config?token="+this.wbrtoken,"config.json")},async configImport(){if(!confirm("导入配置文件将会覆盖当前所有设置,并在重启后正式生效\n确认继续?"))return;let e=await this.$uApi.getFile({accept:".json"});if(e){if(e.content=this.$uStr.sJson(e.content),!e.content)return void this.$message.error("当前导入文件并不是正确的 JSON 格式");this.$axios.post("/config",{file:e}).then((e=>{0===e.data.rescode?this.$message.success("配置文件导入成功,将在重启后正式生效",e.data.message):this.$message.error("配置文件导入失败",e.data.message),console.debug("配置文件导入结果",e.data)})).catch((e=>{this.$message.error("配置文件导入失败",e.message),console.error("配置文件导入失败",e)}))}else this.$message.error("请选择正确的配置文件进行导入")},setLanguage(){const e=cr(this.lang);return this.$forceUpdate(),e},langSave(){if(this.lang===rr.locale)return void this.$message.success(`当前语言偏好为 ${this.lang} 未做修改`);const e=this.$message.loading("语言偏好设置保存中...",0);this.$axios.put("/config",{type:"lang",data:this.lang}).then((e=>{if(0===e.data.rescode){let e=this.setLanguage();this.$message.success("成功设置当前语言偏好为",e)}else this.$message.error("语言偏好修改失败",e.data.message)})).catch((e=>{this.$message.error("语言偏好设置失败",e.message),console.log("语言偏好设置失败",e)})).finally(e)},evRestart(){confirm("即将尝试重启 elecV2P,请提前保存好规则及任务列表,确定继续?")&&this.$axios.post("/webhook",{token:this.wbrtoken,type:"shell",command:"pm2 restart elecV2P"}).then((e=>{this.$message.error("重启失败",e.data.message)})).catch((e=>{this.$message.success("重启命令已发送,将在 5 秒后自动刷新该页面"),setTimeout((()=>location.reload()),5e3)}))},evStop(){confirm("关闭 elecV2P 后,当前网页、定时任务以及 ANYPROXY 都将不可用,确定继续?")&&this.$axios.post("/webhook",{token:this.wbrtoken,type:"shell",command:"pm2 stop elecV2P"}).then((e=>{this.$message.error("关闭失败",e.data.message)})).catch((e=>{this.$message.success("关闭命令已发送,即将自动跳转到首页"),setTimeout((()=>location.reload()),5e3)}))},updateCheck(){if(this.newversion)return void this.$message.success("检测到新版本 v"+this.newversion+"\n请手动运行 softupdate.js 或者使用 docker 命令进行更新\n(等 softupdate.js 稳定后将会集成到这里实现自动更新)");const e=this.$message.loading("正在检测 elecV2P 是否有新的版本可供更新...",0);this.$axios.get("/data?type=update&force=true").then((e=>{e.data.updateversion?(this.$message.success("检测到新版本 elecV2P v"+e.data.updateversion+"\n请手动运行 softupdate.js 或者使用 docker 命令进行更新\n(等 softupdate.js 稳定后将会集成到这部分以实现自动更新)"),this.newversion=e.data.updateversion):this.$message.success(e.data.message+"\n当前 elecV2P v"+e.data.version+" 已是最新版本")})).catch((e=>{this.$message.error("检测更新失败",e.message),console.error("检测更新失败",e)})).finally(e)}}};const $o=ka(yo,Nr,[function(){var e=this,t=e._self._c;return t("label",{staticClass:"setting_label"},[t("a",{staticClass:"cursor--help",attrs:{href:"https://help.ifttt.com/hc/en-us/articles/115010230347-Webhooks-service-FAQ",target:"_blank"}},[e._v("IFTTT")]),e._v(" KEY:")])},function(){var e=this,t=e._self._c;return t("label",{staticClass:"setting_label"},[t("a",{staticClass:"cursor--help",attrs:{href:"https://github.com/Finb/Bark",target:"_blank"}},[e._v("BARK")]),e._v(" KEY:")])},function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("关于配置文件的完整说明,参考文档: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/blob/master/docs/10-config.md",target:"elecV2PDoc"}},[e._v("10-config.md")])]),e._v(" "),t("li",[e._v("通知及脚本运行和网络请求相关设置对使用 nodejs 模式运行的脚本无效")]),e._v(" "),t("li",[e._v("除了初始化相关设置之外,其他设置保存后立即生效。CTRL+S 快捷保存")]),e._v(" "),t("li",[e._v("关于通知类相关设置参考: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/07-feed¬ify.md",target:"elecV2PDoc"}},[e._v("07-feed.md")]),e._v("。 其他参考: "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs",target:"elecV2PDoc"}},[e._v("全部说明文档")]),e._v(" 相关项")])])])}],!1,null,"b5ef0062",null).exports;var wo=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.taskSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.$ta("timed","task")))]),e._v(" "),t("main",{staticClass:"content",on:{click:function(t){e.menu={}},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:(e.menu={},void(e.taskChecked="none")))}}},[t("contextmenu",{attrs:{menus:e.menu.list,pos:e.menu.pos}}),e._v(" "),t("movegroup",{attrs:{show:e.show,gpoptions:e.gnamelist},on:{choose:function(t){return e.taskMoveToGroup(t)}}}),e._v(" "),t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable"},[t("caption",{staticClass:"elecTable_caption"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.search,expression:"search"}],staticClass:"elecTable_input elecTable_input--caption",class:{eopacity:e.search},attrs:{placeholder:e.$ta("search","task"),title:"输入名称/时间/任务内容中的关键字进行过滤显示"},domProps:{value:e.search},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:(t.preventDefault(),t.stopPropagation(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:void(e.search=""))},input:function(t){t.target.composing||(e.search=t.target.value)}}}),e._v(" "),t("span",[e._v(e._s(e.$ta("task","list"))+" - "+e._s(e.taskstatus))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前任务列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.taskInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:e.$ta("checkall","/","checknone")}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.taskCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("name")))]),e._v(" "),t("th",{staticClass:"elecTable_th task_time",attrs:{colspan:"2"}},[e._v(e._s(e.$t("time")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw600",attrs:{colspan:"2",title:"enter: 开始定时任务\nctrl+enter: 测试运行任务\nalt +enter: 查看任务日志"}},[e._v(e._s(e.$t("task")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62",attrs:{title:e.$t("status")}},[e._v(e._s(e.$t("status_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_cell100",attrs:{colspan:"2",title:e.$t("operate")}},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),e._l(e.grouplist,(function(s,i){return t("tbody",{key:i,class:{elecTable_group:"normal"!==i,"elecTable_group--bottom":"normal"!==i},style:{background:e.tasklists[i]&&e.tasklists[i].bkcolor},attrs:{tabindex:"-1"},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.altKey?(t.preventDefault(),t.ctrlKey||t.shiftKey||t.metaKey?null:e.taskLog(t)):null},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?(t.preventDefault(),t.shiftKey||t.altKey||t.metaKey?null:e.taskTest(t)):null}],keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?null:e.taskStartDelegate(t))}}},["normal"!==i?t("tr",[t("td",{staticClass:"elecTable_td"},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.taskGroupCheck(i,t)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.tasklists[i].name,expression:"tasklists[gid].name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"id: "+i},domProps:{value:e.tasklists[i].name},on:{input:function(t){t.target.composing||e.$set(e.tasklists[i],"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"5"}},[t("div",{staticClass:"eflex w100"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.tasklists[i].note,expression:"tasklists[gid].note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"分组备注说明(可省略"},domProps:{value:e.tasklists[i].note},on:{input:function(t){t.target.composing||e.$set(e.tasklists[i],"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim.lazy",value:e.tasklists[i].bkcolor,expression:"tasklists[gid].bkcolor",modifiers:{trim:!0,lazy:!0}}],staticClass:"elecTable_input elecTable_cell100 elecBtn--mleft",attrs:{placeholder:"背景色",title:"当前分组背景颜色/图片"},domProps:{value:e.tasklists[i].bkcolor},on:{change:function(t){e.$set(e.tasklists[i],"bkcolor",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("span",{staticClass:"elecBtn elecBtn--mleft elecBtn--uncheck"},[e._v(e._s(e.tasklists[i].active)+"/"+e._s(e.tasklists[i].total))])])]),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100",attrs:{colspan:"2"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.tasklists[i].collapse,expression:"tasklists[gid].collapse"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.downcircle)},on:{click:function(t){return e.taskGroupOp(i)}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!e.tasklists[i].collapse,expression:"!tasklists[gid].collapse"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.upcircle)},on:{click:function(t){return e.taskGroupOp(i)}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.taskGroupDelete(i)}}})])]):e._e(),e._v(" "),e._l(s,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.running,"elecTable_tr--selected":e.taskChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.taskChecklist,expression:"taskChecklist"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.taskChecklist)?e._i(e.taskChecklist,i)>-1:e.taskChecklist},on:{change:function(t){var s=e.taskChecklist,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.taskChecklist=s.concat([r])):o>-1&&(e.taskChecklist=s.slice(0,o).concat(s.slice(o+1)))}else e.taskChecklist=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.name,expression:"titem.name",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i,placeholder:"id: "+s.id},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.type,expression:"titem.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"type",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.time,expression:"titem.time",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i},domProps:{value:s.time},on:{input:function(t){t.target.composing||e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td task_select"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:[function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])},function(e){"exec"===s.job.type&&(s.job.target="node -v")}]}},e._l(e.jobtype_select,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[/^task/.test(s.job.type)?t("select",{directives:[{name:"model",rawName:"v-model.trim",value:s.job.target,expression:"titem.job.target",modifiers:{trim:!0}}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"target",t.target.multiple?i:i[0])}}},e._l(e.normlist,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s.name))])})),0):t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.job.target,expression:"titem.job.target",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i},domProps:{value:s.job.target},on:{input:function(t){t.target.composing||e.$set(s.job,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.taskMenu(t,i)},contextmenu:function(t){return t.preventDefault(),t.stopPropagation(),e.taskMenu(t,i)}}},[t("span",{directives:[{name:"show",rawName:"v-show",value:s.running,expression:"titem.running"}],staticClass:"icon--op icon--run",domProps:{innerHTML:e._s(e.icon.sync)}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!s.running,expression:"!titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.pause)}})]),e._v(" "),t("td",{staticClass:"elecTable_td elecTable_cell100",attrs:{colspan:"2"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:s.running,expression:"titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.pause)},on:{click:function(t){return e.taskStop(i)}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:!s.running,expression:"!titem.running"}],staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.play)},on:{click:function(t){return e.taskStart(i)}}}),e._v(" "),t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.taskDelete(i)}}})])])}))],2)})),e._v(" "),t("tbody",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"9"}},[t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.taskNew()}}},[e._v(e._s(e.$ta("new","timed","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.subNew()}}},[e._v(e._s(e.$ta("add","task","sub")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn folderbk",on:{click:function(t){return e.taskImport()}}},[e._v(e._s(e.$ta("import","local","sub")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",class:{"elecTable_addbtn--selected":1===e.subeishow},on:{click:function(t){return e.taskExport()}}},[e._v(e._s(e.$t("export"))+e._s(e.taskChecklist.length?e.$ta("","checked","task"):e.$ta("","task","list")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",attrs:{title:"更新会覆盖本地同名文件"},on:{click:function(t){return e.jsUpdate()}}},[e._v(e._s(e.$ta("update","remote","script")))])])]),e._v(" "),t("tr",{directives:[{name:"show",rawName:"v-show",value:e.taskChecklist.length,expression:"taskChecklist.length"}]},[t("td",{staticClass:"center",attrs:{colspan:"9"}},[t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--check",on:{click:function(t){e.show.groupchoose=!0}}},[e._v(e._s(e.$ta("moveto","agroup")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--uncheck",on:{click:function(t){return e.taskCkall(t)}}},[e._v(e._s(e.$ta("cancel","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn greenbk",on:{click:function(t){return e.taskStart(e.taskChecklist)}}},[e._v(e._s(e.$ta("start","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--stop",on:{click:function(t){return e.taskStop(e.taskChecklist)}}},[e._v(e._s(e.$ta("stop","checked","task")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.taskDelete(e.taskChecklist)}}},[e._v(e._s(e.$ta("delete","checked","task"))+" "+e._s(e.taskChecklist.length))])])])]),e._v(" "),t("tbody",e._l(e.sublist,(function(s,i,n){return t("tr",{key:i,class:{"elecTable_tr--selected":e.subimport.tid===i}},[t("td",{staticClass:"elecTable_td"},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.tasksubCheck(i,t)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.name,expression:"titem.name"}],staticClass:"elecTable_input",attrs:{placeholder:"订阅名称"},domProps:{value:s.name},on:{input:function(t){t.target.composing||e.$set(s,"name",t.target.value)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:"none"!==s.update_type},attrs:{title:"自动更新订阅任务"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.update_type,expression:"titem.update_type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"update_type",t.target.multiple?i:i[0])}}},[t("option",{attrs:{value:"none"}},[e._v(e._s(e.type_of_time.noupdate))]),e._v(" "),t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:"none"!==s.update_type}},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.time,expression:"titem.time",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{"data-tid":i,placeholder:"自动更新时间"},domProps:{value:s.time},on:{input:function(t){t.target.composing||e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{title:"同名任务更新方式"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])}}},e._l(e.subselect,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.job.target,expression:"titem.job.target"}],staticClass:"elecTable_input",attrs:{placeholder:"订阅链接,不兼容其他软件的订阅格式。请勿添加不信任的来源链接"},domProps:{value:s.job.target},on:{input:function(t){t.target.composing||e.$set(s.job,"target",t.target.value)}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"2"}},[t("button",{staticClass:"elecBtn",on:{click:function(t){return e.subGet(s.job.target,i)}}},[e._v(e._s(e.$t("fetch")))])]),e._v(" "),t("td",{staticClass:"elecTable_td minw62"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.subDelete(i)}}})])])})),0),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:1===e.subeishow,expression:"subeishow === 1"}],staticClass:"border_top"},[t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"6"}},[t("div",{staticClass:"subdetail_head"},[t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexport.name,expression:"subexport.name",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_name",attrs:{placeholder:"elecV2P 定时任务订阅"},domProps:{value:e.subexport.name},on:{change:function(t){e.$set(e.subexport,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","note"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexport.note,expression:"subexport.note",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_note",attrs:{placeholder:"这是一个适用于 elecV2P 的定时任务订阅。请不要添加未知来源的订阅"},domProps:{value:e.subexport.note},on:{change:function(t){e.$set(e.subexport,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"3"}},[t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.taskExportDownload()}}},[e._v(e._s(e.$t("exportsub")))])])]),e._v(" "),t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"9"}},[t("textarea",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subexportstr,expression:"subexportstr",modifiers:{lazy:!0,trim:!0}}],staticClass:"editor_textarea subdetail_content",attrs:{placeholder:'订阅内容格式如下: \n{\n name: "订阅名称",\n note: "订阅描述,可省略。不兼容其他软件的订阅格式。详细说明参考: https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",\n list: [\n {\n "name": "清空日志",\n "type": "cron",\n "time": "30 59 23 * * *",\n "job": {\n "type": "runjs",\n "target": "https://raw.githubusercontent.com/elecV2/elecV2P/master/script/JSFile/deletelog.js"\n }\n }\n ]\n}'},domProps:{value:e.subexportstr},on:{change:function(t){e.subexportstr=t.target.value.trim()},blur:function(t){return e.$forceUpdate()}}})])])]),e._v(" "),t("tbody",{directives:[{name:"show",rawName:"v-show",value:2===e.subeishow,expression:"subeishow === 2"}],staticClass:"border_top"},[t("tr",[t("td",{staticClass:"elecTable_td",attrs:{colspan:"6"}},[t("div",{staticClass:"subdetail_head"},[t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","name"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.subimport.name,expression:"subimport.name",modifiers:{trim:!0}}],staticClass:"elecTable_input subdetail_name",attrs:{placeholder:"elecV2P 定时任务订阅"},domProps:{value:e.subimport.name},on:{input:function(t){t.target.composing||e.$set(e.subimport,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}}),e._v(" "),t("label",{staticClass:"subdetail_label"},[e._v(e._s(e.$ta("sub","note"))+": ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:e.subimport.note,expression:"subimport.note",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input subdetail_note",attrs:{placeholder:"elecV2P 定时任务订阅。请不要添加未知来源的订阅"},domProps:{value:e.subimport.note},on:{change:function(t){e.$set(e.subimport,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e._v(" "),t("td",{staticClass:"elecTable_td",attrs:{colspan:"2",title:"绿色背景: 任务添加时即开始定时"}},[t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.subAll()}}},[e._v(e._s(e.tasksubChecklist.length?e.$ta("add","checked_short"):e.$ta("add","all")))])]),e._v(" "),t("td",{staticClass:"elecTable_td minw62"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.subClear()}}})])]),e._v(" "),e._l(e.subimport.list,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--selected":-1!==e.tasksubChecklist.indexOf(i)}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.tasksubChecklist,expression:"tasksubChecklist"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:i,checked:Array.isArray(e.tasksubChecklist)?e._i(e.tasksubChecklist,i)>-1:e.tasksubChecklist},on:{change:function(t){var s=e.tasksubChecklist,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=i,o=e._i(s,r);n.checked?o<0&&(e.tasksubChecklist=s.concat([r])):o>-1&&(e.tasksubChecklist=s.slice(0,o).concat(s.slice(o+1)))}else e.tasksubChecklist=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.name,expression:"titem.name",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.name},on:{change:function(t){e.$set(s,"name",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.type,expression:"titem.type"}],staticClass:"elecTable_select",on:{change:[function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,"type",t.target.multiple?i:i[0])},function(e){s.time="cron"===s.type?"30 10 0 * * *":"schedule"===s.type?"3 2 3 2":""}]}},[t("option",{attrs:{value:"cron"}},[e._v(e._s(e.type_of_time.cron))]),e._v(" "),t("option",{attrs:{value:"schedule"}},[e._v(e._s(e.type_of_time.schedule))])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.time,expression:"titem.time",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.time},on:{change:function(t){e.$set(s,"time",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td task_select"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s.job.type,expression:"titem.job.type"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s.job,"type",t.target.multiple?i:i[0])}}},e._l(e.jobtype_select,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])})),0)]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.lazy.trim",value:s.job.target,expression:"titem.job.target",modifiers:{lazy:!0,trim:!0}}],staticClass:"elecTable_input",domProps:{value:s.job.target},on:{change:function(t){e.$set(s.job,"target",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td",class:{greenbk:!1!==s.running},attrs:{colspan:"3"}},[t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),e.subTaskAdd(s)}}},[e._v(e._s(e.$t("add","task")))])])])})),e._v(" "),t("tr",{directives:[{name:"show",rawName:"v-show",value:e.subimport.author||e.subimport.date||e.subimport.resource,expression:"(subimport.author || subimport.date || subimport.resource)"}]},[t("td",{staticClass:"elecTable_td elecTable_td--subinfo",attrs:{colspan:"9"}},[t("span",{},[e._v(e._s(e.subimport.author?e.$t("author")+": "+e.subimport.author:""))]),e._v(" "),t("span",{staticClass:"mleft30"},[e._v(e._s(e.subimport.date?e.$ta("update","date")+": "+e.subimport.date:""))]),e._v(" "),t("span",{staticClass:"mleft30"},[e._v(e._s(e.subimport.resource?e.$ta("update","address")+": "+e.subimport.resource:""))])])])],2)],2)]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long elecBtn--tasksave",on:{click:function(t){return e.taskSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("log",{attrs:{logs:e.logs,title:e.tasklogs,collapse:e.collapse}})],1),e._v(" "),t("footer",{staticClass:"footer"},[t("ul",[t("li",[t("strong",[e._v(e._s(e.type_of_time.cron))]),e._v(" "+e._s(e.$t("format").toLowerCase())+": (*) * * * * *("+e._s(e.$ta("five","or","six","cron","format").toLowerCase())+")")]),e._v(" "),t("li",[t("strong",[e._v(e._s(e.type_of_time.schedule))]),e._v(" "+e._s(e.$t("format").toLowerCase())+": 30 999 3 2("+e._s(e.$ta("countdown","seconds","/","repeat","times","/","random","seconds","/","random","times"))+")"),t("i",[e._v(e._s(e.$ta("last_three","optional")))])]),e._v(" "),t("li",[e._v(e._s(e.$ta("task","input","shortcut"))+": enter - "+e._s(e.$ta("start","task"))+" ctrl+enter - "+e._s(e.$ta("test","run","task"))+" alt+enter - "+e._s(e.$ta("open","task","run","logs")))]),e._v(" "),t("li",[e._v(e._s(e.$ta("more","detail"))+" "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",target:"elecV2PDoc"}},[e._v(e._s(e.$t("document"))+": 06-task.md")])])])])])};wo._withStripped=!0;var ko=function(){var e=this,t=e._self._c;return e.show.groupchoose?t("VueDragResize",{attrs:{className:"ediv",dragHandle:".ediv_title--name",parent:!0,"prevent-deactivation":!1,active:!0,w:"480",h:"92",z:"9",resizable:!1,draggable:!0,handles:["tl","tr","bl","br"],"lock-aspect-ratio":!1}},[t("h3",{staticClass:"ediv_title"},[t("span",{staticClass:"ediv_title--name"},[e._v("请选择分组")]),e._v(" "),t("span",{staticClass:"ediv_title--close",on:{click:function(t){e.show.groupchoose=!e.show.groupchoose}}},[e._v("x")])]),e._v(" "),t("div",{staticClass:"ediv_content"},[t("div",{staticClass:"mgselect"},[t("label",{staticClass:"elecTable_label mgselect_label"},[e._v("移动到此分组: ")]),e._v(" "),t("select",{directives:[{name:"model",rawName:"v-model",value:e.choose,expression:"choose"}],staticClass:"elecTable_select mgselect_choose",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.choose=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"new"}},[e._v("新的分组")]),e._v(" "),t("option",{attrs:{value:"none"}},[e._v("不属于任何分组")]),e._v(" "),e._l(e.gpoptions,(function(s,i){return t("option",{key:i,domProps:{value:i}},[e._v(e._s(s))])}))],2),e._v(" "),t("button",{staticClass:"elecBtn greenbk",on:{click:function(t){return e.groupChoose()}}},[e._v("确定")])])])]):e._e()};ko._withStripped=!0;var Co=s(432),xo=s.n(Co);const To=ka({name:"movegroup",props:["show","gpoptions"],components:{VueDragResize:xo()},data:()=>({choose:"new"}),methods:{groupChoose(){this.$emit("choose",this.choose)}}},ko,[],!1,null,"05f31d25",null).exports,So={name:"task",data(){return{tasklists:{},subexport:{},subimport:{},taskimorn:!1,taskimtid:"",subeishow:0,taskstatus:"",jobtype_select:{runjs:this.$t("run")+" JS",exec:"SHELL "+this.$t("cmd"),taskstart:this.$ta("start","task"),taskstop:this.$ta("stop","","task")},subselect:{skip:this.$t("skip"),replace:this.$t("replace"),addition:this.$t("addition")},type_of_time:{cron:this.$t("cron"),schedule:this.$t("countdown"),noupdate:this.$t("noupdate")},logs:[],icon:wa,taskChecklist:[],tasksubChecklist:[],menu:{pos:[0,0],list:[]},show:{groupchoose:!1},search:"",collapse:{loginfo:!0},tasklogs:this.$ta("task","run","logs")}},components:{log:tr,contextmenu:Or,movegroup:To},computed:{normlist(){let e={};for(let t in this.tasklists)if(this.tasklists[t])switch(this.tasklists[t].type){case"cron":case"schedule":e[t]=this.tasklists[t]}return e},tnamelist(){let e={};for(let t in this.normlist)e[this.normlist[t].name]=t;return e},gnamelist(){let e={};for(let t in this.tasklists)"group"===this.tasklists[t].type&&(e[t]=this.tasklists[t].name);return e},sublist(){let e={};for(let t in this.tasklists)"sub"===this.tasklists[t].type&&(e[t]=this.tasklists[t]);return e},searchlist(){if(!this.search)return this.tasklists;let e={},t=new RegExp(this.search);for(let s in this.normlist)t.test(this.normlist[s].name+this.normlist[s].time+this.normlist[s].job.target)&&(e[s]=this.normlist[s]);return e},grouplist(){let e={},t={},s={running:0,total:0,sub:Object.keys(this.sublist).length};for(let i in this.searchlist){if("sub"===this.searchlist[i].type){this.searchlist[i].update_type||(this.searchlist[i].update_type="none");continue}if("group"===this.searchlist[i].type){e[i]||(e[i]={},this.searchlist[i].total=0,this.searchlist[i].active=0,this.searchlist[i].bkcolor||(this.searchlist[i].bkcolor=this.$uStr.randomColor({max:200})),void 0===this.searchlist[i].collapse&&(this.searchlist[i].collapse=!1));continue}s.total++,this.searchlist[i].running&&s.running++;let n=this.searchlist[i].group;n&&this.searchlist[n]&&"group"===this.searchlist[n].type?(e[n]||(e[n]={},this.searchlist[n].total=0,this.searchlist[n].active=0,this.searchlist[n].bkcolor||(this.searchlist[n].bkcolor=this.$uStr.randomColor({max:200})),void 0===this.searchlist[n].collapse&&(this.searchlist[n].collapse=!1)),this.searchlist[n].collapse||(e[n][i]=this.searchlist[i]),this.searchlist[n].total++,this.searchlist[i].running&&this.searchlist[n].active++):t[i]=this.searchlist[i]}return this.taskstatus=s.running+"/"+s.total+"/"+s.sub,e.normal=t,e},subexportstr:{get(){return JSON.stringify(this.subexport,null,2)},set(e){let t=this.$sJson(e);t?Object.assign(this.subexport,t):this.$message.error("订阅内容格式不正确, 已自动退回到修改前内容",10)}},taskChecked:{get(){let e=[];return this.taskChecklist.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.taskChecklist=Object.keys(this.search?this.searchlist:this.normlist):"none"===e?this.taskChecklist=[]:this.normlist[e]&&-1===this.taskChecklist.indexOf(e)&&this.taskChecklist.push(e)}}},watch:{taskimorn(e){!1===e?this.$delete(this.tasklists,"localtemp"):this.taskimtid=Object.keys(this.sublist)[0]}},created(){this.taskInit();let e=this.$wsrecv.add("tasklog",(e=>{this.logs.length>=200||/\x1b\[H/.test(e)?this.logs=[e]:/\r|(\x1b\[F)/.test(e)?this.logs.splice(0,1,e):this.logs.unshift(e)}));e&&this.logs.unshift(`[${this.$logHead("websocket error")}][${this.$sTime(null,1)}] ${e}, 日志无法传输`),this.$wsrecv.add("task",(e=>{if("init"!==e.op)if(this.tasklists[e.tid])switch(e.op){case"start":this.$set(this.tasklists[e.tid],"running",!0);break;case"stop":this.$set(this.tasklists[e.tid],"running",!1);break;default:console.error("unknow task operation")}else e.tid&&e.taskinfo&&this.taskCheck(e.taskinfo)?this.tasklists[e.tid]=e.taskinfo:console.error("任务暂不存在",e);else this.taskInit()}))},methods:{taskInit(){const e=this.$message.loading("获取任务列表中...",0);this.$axios.get("/task").then((e=>{if(-1===e.data.rescode)return this.$message.error("获取任务列表失败",e.data.message),void this.logs.unshift(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}] 获取任务列表失败: ${e.data.message}`);this.tasklists=e.data||{},this.subexport={},this.subimport={},this.subeishow=0,console.debug(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}]`,"当前 elecV2P 任务分组数",Object.keys(this.grouplist).length-1),this.$message.success("成功获取任务列表",this.taskstatus),this.logs.unshift(`[${this.$logHead("taskInit info")}][${this.$sTime(null,1)}] 成功获取任务列表: ${this.taskstatus}`)})).catch((e=>{this.$message.error("获取任务列表失败",e.message),this.logs.unshift(`[${this.$logHead("taskInit error")}][${this.$sTime(null,1)}] 获取任务列表失败: ${e.message}`),console.error("获取任务列表失败",e)})).finally(e)},taskNewId(e=8){let t=this.$uStr.euid(e);return this.tasklists[t]?this.taskNewId():t},taskNew(e=this.taskNewId()){let t={},s={};Math.random()>.6?(t.type="schedule",t.time="3 2 2"):(t.type="cron",t.time="20 10 0 * * *"),Math.random()<.5?(s.type="runjs",s.target="test.js"):(s.type="exec",s.target="node -v"),this.$set(this.tasklists,e,{id:e,name:this.$ta("new","task")+(Object.keys(this.normlist).length+1),type:t.type,time:t.time,job:s,running:!1})},taskCheck(e){if(!e)return this.$message.error("请输入任务内容"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] 没有任何任务信息`),!1;if(!e.name)return this.$message.error("请输入任务名"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] 没有任务名称`),!1;if(!/schedule|cron/.test(e.type))return this.$message.error("非法任务类型",e.type),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 任务类型 ${e.type} 有误`),!1;let t=e.time.split(" ");return"cron"===e.type&&5!==t.length&&6!==t.length?(this.$message.error(e.time,"不符合 cron 时间格式标准"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 时间: ${e.time} 不符合 cron 时间格式标准`),!1):"schedule"===e.type&&t.filter((e=>/^\d+$/.test(e))).length!==t.length?(this.$message.error(e.time,"不符合",this.type_of_time.schedule,"时间格式标准"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 时间: ${e.time} 不符合 ${this.type_of_time.schedule} 时间格式标准`),!1):!!(e.job&&e.job.type&&e.job.target)||(this.$message.error("任务内容填写不完整"),this.logs.unshift(`[${this.$logHead("taskAdd error")}][${this.$sTime(null,1)}] ${e.name} 任务内容填写不完整`),!1)},taskStart(e){let t,s="array"===this.$sType(e);if(s)t=[],e.forEach((e=>{this.taskCheck(this.tasklists[e])&&(this.tasklists[e].id=e,this.tasklists[e].running=!0,t.push(this.tasklists[e]))}));else{if(!this.taskCheck(this.tasklists[e]))return;if(this.tasklists[e].running)return void this.$message.error(this.tasklists[e].name,"正在运行中");this.tasklists[e].id=e,this.tasklists[e].running=!0,t=this.tasklists[e]}let i=!1;const n=this.$message.loading("任务上传准备执行中...",0);this.$axios.put("/task",{op:"start",data:{task:t}}).then((e=>{0===e.data.rescode?this.$message.success("定时任务已开始"):i=e.data.message})).catch((e=>{console.error(e),i=e.message})).finally((()=>{n(),i&&(s||(this.tasklists[e].running=!1),this.$message.error("开始任务失败"),this.logs.unshift(`[${this.$logHead("taskStart error")}][${this.$sTime(null,1)}] 开始任务执行失败: ${i}`))}))},taskStop(e){let t="array"===this.$sType(e);if(!t){if(!1===this.tasklists[e].running)return void this.$message.success(this.tasklists[e].name,"已停止,无需任何操作");this.tasklists[e].running=!1}let s=!1;const i=this.$message.loading("任务停止命令执行中...",0);this.$axios.put("/task",{op:"stop",data:{tid:e}}).then((e=>{0===e.data.rescode?this.$message.success("相关定时任务已停止"):s=e.data.message})).catch((e=>{s=e.message,console.error(e)})).finally((()=>{i(),s&&(t||(this.tasklists[e].running=!0),this.$message.error("停止任务失败"),this.logs.unshift(`[${this.$logHead("taskStop error")}][${this.$sTime(null,1)}] 停止任务失败: ${s}`))}))},taskDelete(e){if("array"===this.$sType(e)){if(confirm(`确定删除这 ${e.length} 个定时任务?`)){const t=this.$message.loading("定时任务批量删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{0===t.data.rescode?(this.$message.success("定时任务批量删除完成"),e.forEach((e=>this.$delete(this.tasklists,e))),this.logs.unshift(`[${this.$logHead("taskDelete info")}][${this.$sTime(null,1)}] 定时任务批量删除完成`),this.taskChecked="none"):(this.$message.error("定时任务批量删除失败"),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 定时任务批量删除失败 ${t.data.message}`))})).catch((e=>{this.$message.error("定时任务批量删除失败",e.message),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 定时任务批量删除: ${e.message}`),console.error(e)})).finally(t)}}else if(confirm(`确定删除任务 ${this.tasklists[e].name}?`)){const t=this.$message.loading("定时任务",this.tasklists[e].name,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{0===t.data.rescode?(this.$message.success("成功删除任务:",this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskDelete info")}][${this.$sTime(null,1)}] 成功删除任务: ${this.tasklists[e].name}`),this.$delete(this.tasklists,e)):(this.$message.error("任务:",this.tasklists[e].name,"删除失败"),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 任务: ${this.tasklists[e].name} 删除失败 ${t.data.message}`))})).catch((e=>{this.$message.error("删除任务失败",e.message),this.logs.unshift(`[${this.$logHead("taskDelete error")}][${this.$sTime(null,1)}] 删除任务失败: ${e.message}`),console.error(e)})).finally(t)}},taskSave(){this.search="";const e=this.$message.loading("正在保存当前任务列表...",0);this.$axios.post("/task",this.tasklists).then((e=>{-1===e.data.rescode?(this.$message.error("当前任务列表保存失败"),this.logs.unshift(`[${this.$logHead("taskSave error")}][${this.$sTime(null,1)}] 当前任务列表保存失败:${e.data.message}`)):(this.$message.success("当前任务列表已保存",this.taskstatus),this.logs.unshift(`[${this.$logHead("taskSave info")}][${this.$sTime(null,1)}] 当前任务列表已保存 ${this.taskstatus},将在 elecV2P 下次启动时自动恢复`))})).catch((e=>{console.error(e),this.$message.error("当前任务列表保存失败",e.message),this.logs.unshift(`[${this.$logHead("taskSave error")}][${this.$sTime(null,1)}] 当前任务列表保存失败:${e.message}`)})).finally(e)},taskStartDelegate(e){let t=e.target.dataset.tid;t&&this.taskStart(t)},taskTest(e){let t=e.target?e.target.dataset.tid:e;if(!t)return;if(!this.taskCheck(this.tasklists[t]))return;let s=this.tasklists[t].running;this.tasklists[t].running=!0;const i=this.$message.loading("任务测试运行中...",0);this.logs.unshift(`[${this.$logHead("taskStart info")}][${this.$sTime(null,1)}] 立即测试运行定时任务: ${this.tasklists[t].name}`),this.collapse.loginfo=!1,this.$axios.put("/task",{op:"test",data:{tid:"totest",task:this.tasklists[t]}}).then((e=>{let s=this.$sString(e.data.message)||"无";this.$message.success(this.tasklists[t].name,"测试运行结果:",s),this.logs.unshift(`[${this.$logHead("taskTest info")}][${this.$sTime(null,1)}] ${this.tasklists[t].name} 测试运行结果: ${s}`)})).catch((e=>{console.error(e),this.$message.error(this.tasklists[t].name,"测试运行失败",e.message),this.logs.unshift(`[${this.$logHead("taskTest error")}][${this.$sTime(null,1)}] ${this.tasklists[t].name} 测试运行失败: ${e.message}`)})).finally((()=>{i(),this.tasklists[t].running=s}))},taskLog(e){let t=e.target?e.target.dataset.tid:e;t&&(this.tasklists[t]?"runjs"===this.tasklists[t].job.type?/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)?this.$uApi.open(`./logs/${this.$uStr.surlName(this.tasklists[t].job.target.split(" ")[0])}.log`):this.$uApi.open(`./logs/${this.tasklists[t].job.target.split(" ")[0].replace(/\/|\\/g,"-")}.log`):"exec"===this.tasklists[t].job.type?this.$uApi.open(`./logs/${this.tasklists[t].name}.task.log`):this.$message.error("该任务类型不支持查看日志"):this.$message.error("任务不存在"))},subNew(e=this.taskNewId()){this.$set(this.tasklists,e,{name:this.$ta("task","sub")+(Object.keys(this.sublist).length+1),type:"sub",update_type:"none",time:"26 5 * * *",job:{type:"skip",target:""}})},async subGet(e,t){if(!e||!/^https?:\/\/\S{4}|^\/?efss\//.test(e))return void this.$message.error("请输入正确的订阅地址",6);if(!/\.json$/.test(e)&&!confirm("该订阅内容可能并不是 JSON 格式,确认继续?"))return;let s=this.$message.loading("正在获取订阅信息...",0),i="";try{i=await this.$axios.get(e,{crossdomain:!0})}catch(t){if(this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 获取订阅信息失败 ${t.message}`),t.response)return s(),this.$message.error(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`),void console.debug(`获取订阅内容失败,服务器返回状态码 ${t.response.status}`,t.response.data);if(/^https?:\/\/\S{4}/.test(e)){this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 即将尝试从服务器端获取该订阅内容`),this.$message.error("获取订阅信息失败",t.message,"即将尝试从服务器端获取该订阅内容");try{i=await this.$axios.get("/data?type=stream&url="+e)}catch(t){return s(),this.$message.error("获取订阅信息失败",t.message,"请检测网络后重试"),void this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 从 ${e} 获取订阅信息失败 ${t.message},请检测网络后重试`)}}}if(200!==i.status||-1===i.data.rescode)return s(),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 该订阅链接 ${e} 返回结果有误 ${this.$sString(i.data)} 请确认输入地址是否正确`),this.$message.error("该订阅返回状态不正确,请确认当前网络环境或输入地址是否正常"),void console.error(i);s();let n=this.$sJson(i.data);n&&n.name&&n.list?("localtemp"===t&&(t=this.taskNewId(),this.$set(this.tasklists,t,this.tasklists.localtemp)),n.tid=t,n.resource=n.resource||n.surl,n.note=n.note||n.desc,this.subimport=n,this.taskimorn=!1,this.subeishow=2,this.$message.success("成功获取订阅信息"),this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 成功获取订阅 ${n.name} 内容`),n.time&&!this.sublist[t].time&&(this.sublist[t].time=n.time,this.sublist[t].update_type=n.update_type||n.type||"none"),"定时任务订阅"===this.sublist[t].name&&(this.sublist[t].name=n.name)):(this.$message.error("该订阅内容无法解析"),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 该订阅 ${e} 内容并不符合 elecV2P 订阅格式,请确认订阅链接及内容无误后再次添加`))},subDelete(e){if(this.subimport.tid===e)return this.subeishow=0,void(this.subimport.tid=null);if(!this.tasklists[e].job.target||confirm("确定删除订阅:"+this.tasklists[e].name+" (并不会删除相关任务)")){const t=this.$message.loading(this.tasklists[e].name,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((t=>{this.$message.success("成功删除订阅:",this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskSub info")}][${this.$sTime(null,1)}] 成功删除订阅: ${this.tasklists[e].name}`),this.$delete(this.tasklists,e)})).catch((e=>{console.error(e),this.$message.error("删除订阅失败",e.message),this.logs.unshift(`[${this.$logHead("taskSub error")}][${this.$sTime(null,1)}] 删除订阅失败 ${e.message}`)})).finally(t)}},subClear(){this.subeishow=0,this.subimport.tid=null,this.taskimorn&&(this.taskimorn=!1)},taskExport(){if(1===this.subeishow)return void(this.subeishow=0);let e={name:"elecV2P 定时任务订阅",author:"留个名字",note:"xx 导出的任务订阅。该订阅适用于 elecV2P,与其他软件并不兼容。相关说明参考:https://github.com/elecV2/elecV2P-dei/tree/master/docs/06-task.md",date:this.$sTime(),type:"task",list:[]};if(this.taskChecklist.length)this.taskChecklist.forEach((t=>{this.normlist[t]&&this.normlist[t].name&&this.normlist[t].time&&this.normlist[t].job&&e.list.push({name:this.normlist[t].name,type:this.normlist[t].type,time:this.normlist[t].time,running:this.normlist[t].running,job:this.normlist[t].job})}));else for(let t in this.normlist)e.list.push({name:this.normlist[t].name,type:this.normlist[t].type,time:this.normlist[t].time,running:this.normlist[t].running,job:this.normlist[t].job});this.subimport={},this.subexport=e,this.subeishow=1,this.taskimorn=!1},taskExportDownload(){this.subexport.name&&this.subexport.list?(this.$uApi.saveAsFile(this.subexport,this.subexport.name+".json"),this.logs.unshift(`[${this.$logHead("taskExport info")}][${this.$sTime(null,1)}] 成功导出订阅:${this.subexport.name}`)):(this.$message.error("订阅信息不完整"),this.logs.unshift(`[${this.$logHead("taskExport error")}][${this.$sTime(null,1)}] 订阅导出失败,订阅信息填写不完整`))},taskImport(){this.$uApi.getFile({accept:".json",type:"text"}).then((e=>{let t=e.content,s=this.$sJson(t);s&&s.name&&s.list?(s.resource=s.resource||s.surl,s.note=s.note||s.desc,this.subimport=s,this.subimport.tid="local",this.subeishow=2,0===Object.keys(this.sublist).length&&this.subNew("localtemp"),this.logs.unshift(`[${this.$logHead("taskImport info")}][${this.$sTime(null,1)}] 成功获取本地订阅: ${s.name}`),this.taskimorn=!0,this.$message.success("成功获取本地订阅任务列表")):(console.error("elecV2P 无法解析该订阅内容",t),this.$message.error("该订阅内容无法解析"),this.logs.unshift(`[${this.$logHead("taskImport error")}][${this.$sTime(null,1)}] 导入的本地订阅内容并不符合 elecV2P 订阅格式,请尝试修改后再次添加\n${this.$sString(t).slice(-300)}`))})).catch((e=>{this.subimport={},console.debug(e)}))},async jsUpdate(){let e=[];if(this.taskChecklist.length)this.taskChecklist.forEach((t=>{this.tasklists[t]&&this.tasklists[t].job&&"runjs"===this.tasklists[t].job.type&&/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)&&e.push(this.tasklists[t].job.target.split(" ")[0])}));else for(let t in this.tasklists)this.tasklists[t]&&this.tasklists[t].job&&"runjs"===this.tasklists[t].job.type&&/^https?:\/\/\S{4}/.test(this.tasklists[t].job.target)&&e.push(this.tasklists[t].job.target.split(" ")[0]);if(e.length){if(confirm("共有 "+e.length+" 个远程脚本等待更新,确定继续?")){const t=this.$message.loading("正在更新远程 JS...",0);for(let t of e){this.logs.unshift(`[${this.$logHead("taskJSUP info")}][${this.$sTime(null,1)}] 开始更新下载 ${t}`);let e=await this.$axios.put("/jsfile",{op:"jsdownload",name:this.$uStr.surlName(t),url:t}).catch((e=>this.$message.error(e.message)));0===e.data.rescode?this.logs.unshift(`[${this.$logHead("taskJSUP info")}][${this.$sTime(null,1)}] 更新完成 ${e.data.message} `):this.logs.unshift(`[${this.$logHead("taskJSUP error")}][${this.$sTime(null,1)}] 更新失败 ${e.data.message} `)}t(),this.$message.success("全部远程脚本更新完成")}}else{const e=this.$ta("current","")+(this.taskChecklist.length?this.$ta("checked","task"):this.$ta("task","list"))+this.$ta("","dthave","remote","script");this.$message.error(e),this.logs.unshift(`[${this.$logHead("taskJSUP error")}][${this.$sTime(null,1)}] ${e}`)}},subTaskForm(e,{type:t="skip",belong:s}){if(!this.taskCheck(e))return!1;if(!e.id)if(this.tnamelist[e.name])if(this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 检测到同名任务: ${e.name},当前同名任务更新方式为: ${this.subselect[t]}`),"replace"===t)e.id=this.tnamelist[e.name];else{if("addition"!==t)return this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 跳过添加同名任务: ${e.name}`),!1;e.id=this.taskNewId()}else e.id=this.taskNewId();return!1!==e.running&&(e.running=!0),s&&"local"!==s&&(e.belong=s),e},subTaskAdd(e){let t=this.subimport.tid,s="";if("local"===t)s=this.sublist[this.taskimtid].job.type;else{if(!this.sublist[t]||!this.sublist[t].job)return Promise.reject("未知错误,订阅可能不存在");s=this.sublist[t].job.type}let i=[],n=e=>{let n=this.subTaskForm(e,{type:s,belong:t});n&&i.push(n)};if("array"===this.$sType(e)?e.forEach((e=>n(e))):n(e),0===i.length){let e="没有新的任务需要添加";return this.$message.success(e),this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] ${e}`),Promise.resolve(e)}let a=this.$message.loading("正在添加定时任务...",0);return new Promise(((e,t)=>{this.$axios.put("/task",{op:"add",data:{task:i,type:s}}).then((e=>{0===e.data.rescode?(this.$message.success("定时任务添加成功"),this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 定时任务添加完成`),JSON.parse(JSON.stringify(i)).forEach((e=>{this.$set(this.tasklists,e.id,e)}))):(this.$message.error("定时任务添加失败"),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 添加定时任务失败 ${e.data.message}`))})).catch((e=>{console.error(e),this.$message.error("定时任务添加失败",e.message),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 添加定时任务失败 ${e.message}`)})).finally((()=>{e(),a()}))}))},subAll(){if(this.subimport.list&&this.subimport.list.length){let e=[];this.tasksubChecklist.length?this.tasksubChecklist.forEach((t=>{e.push(this.subimport.list[t])})):e=this.subimport.list,this.logs.unshift(`[${this.$logHead("taskSubAdd info")}][${this.$sTime(null,1)}] 开始添加订阅 ${this.subimport.name} 中的任务`),this.subTaskAdd(e).catch((e=>this.$message.error(e))).finally((()=>{this.tasksubChecklist=[]}))}else this.$message.error("并没有可以导入的定时任务"),this.logs.unshift(`[${this.$logHead("taskSubAdd error")}][${this.$sTime(null,1)}] 当前订阅列表为空`)},tasksubCheck(e,t){if(e&&t)if(t.target.checked){let t=JSON.parse(JSON.stringify(this.normlist)),s=!0;this.taskChecklist.forEach((e=>{t[e]=-1}));for(let i in t){t[i].belong===e&&(this.taskChecklist.push(i),s&&(s=!1))}s&&this.$message.success("列表中暂时还没有该订阅内的定时任务")}else this.taskChecklist=this.taskChecklist.filter((t=>this.tasklists[t]&&this.tasklists[t].belong!==e))},taskCkall(e){this.taskChecked=e.target.checked?"all":"none"},taskMenu(e,t){let s=[],i=this.taskTest,n=this.taskLog;if(s.push({label:"立即测试运行",bkcolor:"var(--icon-bk)",click(){i(t)}},{label:"查看任务日志",click(){n(t)}}),"runjs"===this.tasklists[t].job.type){let e=this.tasklists[t].job.target.split(" ")[0],i=this.$uApi.store.setCache;s.push({label:"查看脚本内容",method:"nav",param:"jsmanage",click(){i("scriptview",e)}})}this.menu={pos:this.$uApi.getCursorPos(e,160,32*s.length),list:s}},taskGroupCheck(e,t){if(e&&t)if(t.target.checked)for(let t in this.normlist)this.normlist[t].group===e&&(this.taskChecked=t);else this.taskChecklist=this.taskChecklist.filter((t=>this.normlist[t].group!==e))},taskGroupDelete(e){if(!this.tasklists[e])return void this.$message.error("分组",e,"暂不存在");let t=this.tasklists[e].name,s=Object.keys(this.grouplist[e]);if(0===s.length||confirm("确定删除分组 "+t+"(并不会删除该分组下的任务)?")){const i=this.$message.loading(t,"删除中...",0);this.$axios.put("/task",{op:"delete",data:{tid:e}}).then((i=>{this.$message.success("成功删除分组",t,""+(s.length?s.length+"个任务已移动到普通列表":"")),this.logs.unshift(`[${this.$logHead("taskGroup info")}][${this.$sTime(null,1)}] 成功删除分组: ${t}`),s.forEach((e=>{this.$delete(this.normlist[e],"group")})),this.$delete(this.tasklists,e),console.debug(i.data)})).catch((e=>{console.error(e),this.$message.error("删除分组失败",e.message),this.logs.unshift(`[${this.$logHead("taskGroup error")}][${this.$sTime(null,1)}] 删除分组失败 ${e.message}`)})).finally(i)}},taskGroupOp(e){this.$set(this.tasklists[e],"collapse",!this.tasklists[e].collapse)},taskMoveToGroup(e){"new"===e&&(e=this.taskNewId(),this.$set(this.tasklists,e,{name:"新的分组 "+Object.keys(this.grouplist).length,type:"group",note:"关于该分组的一些备注说明",bkcolor:this.$uStr.randomColor({max:200}),collapse:!1})),"none"===e||this.tasklists[e]&&"group"===this.tasklists[e].type?(this.taskChecklist.forEach((t=>{"none"===e?this.$delete(this.tasklists[t],"group"):this.$set(this.tasklists[t],"group",e)})),this.$message.success("成功移动",this.taskChecklist.length,"个定时任务到","none"===e?"普通列表":this.tasklists[e].name),this.logs.unshift(`[${this.$logHead("taskGroup info")}][${this.$sTime(null,1)}] 成功移动 ${this.taskChecklist.length} 个定时任务到 ${"none"===e?"普通列表":this.tasklists[e].name},保存后生效`),this.show.groupchoose=!1,this.taskChecked="none"):this.$message.error("所选分组不存在,请重新选择")}}};const Oo=ka(So,wo,[],!1,null,"6e5c5756",null).exports;var Eo=function(){var e=this,t=e._self._c;return t("section",{on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.hostSave()):null}}},[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"mitmset",class:{"mitmset--close":!e.eproxy.enable}},[t("div",{staticClass:"mitmset_status emargin",class:{"mitmset--close":!e.eproxy.enable}},[e._v(e._s(e.$t("status"))+":"+e._s(e.$t(e.eproxy.enable?"enabled":"disabled")))]),e._v(" "),t("div",{staticClass:"mitmset_item emargin"},[t("label",[e._v("ANYPROXY "+e._s(e.$t("port"))+": "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.eproxy.port,expression:"eproxy.port"}],staticClass:"elecTable_input elecTable_input--number mitmset_bl1",attrs:{type:"number"},domProps:{value:e.eproxy.port},on:{input:function(t){t.target.composing||e.$set(e.eproxy,"port",t.target.value)}}})])]),e._v(" "),t("div",{staticClass:"mitmset_item emargin"},[t("label",[e._v("ANYPROXY "+e._s(e.$t("logs"))+": "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.eproxy.webPort,expression:"eproxy.webPort"}],staticClass:"elecTable_input elecTable_input--number mitmset_bl1",attrs:{type:"number"},domProps:{value:e.eproxy.webPort},on:{input:function(t){t.target.composing||e.$set(e.eproxy,"webPort",t.target.value)}}})])]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:!e.eproxy.enable,expression:"!eproxy.enable"}],staticClass:"elecBtn w220 greenbk emargin",on:{click:function(t){return e.eproxyToggle("open")}}},[e._v(e._s(e.$t("enable"))+" MITM")]),e._v(" "),t("button",{directives:[{name:"show",rawName:"v-show",value:e.eproxy.enable,expression:"eproxy.enable"}],staticClass:"elecBtn w220 elecBtn--stop emargin",on:{click:function(t){return e.eproxyToggle("close")}}},[e._v(e._s(e.$t("disable"))+" MITM")])]),e._v(" "),t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",class:{"elecTable--disabled":!e.mitmhosteble.enable}},[t("caption",{staticClass:"elecTable_caption",class:{"elecTable--disabled":!e.mitmhosteble.enable}},[t("div",{staticClass:"eflex elecTable_caption--left"},[t("span",{attrs:{title:"按照下表进行解析(解析全部可使用单星号 *"}},[e._v(e._s(e.$t("enable"))+":")]),e._v(" "),t("checkbox",{attrs:{oCheck:e.mitmhosteble}})],1),e._v(" "),t("span",[e._v("MITM HOST "+e._s(e.$t("list"))+" - "+e._s(e.mitmhost.length))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.mitmInit()}}})]),e._v(" "),t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--check",attrs:{title:"全选/全不选"}},[t("input",{staticClass:"echeckbox",attrs:{type:"checkbox"},on:{change:function(t){return e.mitmCkall(t)}}})]),e._v(" "),t("th",{staticClass:"elecTable_th minw320"},[e._v(e._s(e.$t("host")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v(e._s(e.$t("note")))]),e._v(" "),t("th",{staticClass:"elecTable_th elecTable_th--enable"},[e._v(e._s(e.$t("enable_short")))]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v(e._s(e.$t("operate_short")))])])]),e._v(" "),t("tbody",e._l(e.mitmhost,(function(s,i){return t("tr",{key:i,class:{"elecTable_tr--disabled":!s.enable,"elecTable_tr--selected":e.mitmChecked[i]}},[t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.mitmCheck,expression:"mitmCheck"}],staticClass:"echeckbox",attrs:{type:"checkbox"},domProps:{value:String(i),checked:Array.isArray(e.mitmCheck)?e._i(e.mitmCheck,String(i))>-1:e.mitmCheck},on:{change:function(t){var s=e.mitmCheck,n=t.target,a=!!n.checked;if(Array.isArray(s)){var r=String(i),o=e._i(s,r);n.checked?o<0&&(e.mitmCheck=s.concat([r])):o>-1&&(e.mitmCheck=s.slice(0,o).concat(s.slice(o+1)))}else e.mitmCheck=a}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.host,expression:"host.host",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"e.test.com"},domProps:{value:s.host},on:{input:function(t){t.target.composing||e.$set(s,"host",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s.note,expression:"host.note",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{type:"text",placeholder:"备注信息(可省略"},domProps:{value:s.note},on:{input:function(t){t.target.composing||e.$set(s,"note",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("checkbox",{attrs:{oCheck:s}})],1),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op cursor",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.mhostDel(i)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"center border_top1",attrs:{colspan:"5"}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.mitmCheck.length,expression:"mitmCheck.length"}],staticClass:"elecTable_addbtn elecTable_addbtn--clear",on:{click:function(t){return e.mhostDelCks()}}},[e._v(e._s(e.$ta("delete","checked")))]),e._v(" "),t("span",{staticClass:"elecTable_addbtn",on:{click:function(t){return e.mitmhost.push({host:"",enable:!0})}}},[e._v(e._s(e.$ta("add","host")))])])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.hostSave()}}},[e._v(e._s(e.$t("save")))])]),e._v(" "),t("pac",{attrs:{config:e.config_pac}}),e._v(" "),t("div",{staticClass:"mitmcrt"},[t("h4",{staticClass:"mitmcrt_title"},[e._v(e._s(e.$ta("self-signed","root","certificate","manage")))]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("certificate"))+": ")]),t("span",{staticClass:"sfcrt_info"},[e._v(e._s(e.crtinfo.commonName))])]),e._v(" "),t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("valid","date"))+": ")]),t("span",{staticClass:"sfcrt_info"},[e._v(e._s(e.crtinfo.notBefore)+" "+e._s(e.$t("to"))+" "+e._s(e.crtinfo.notAfter))])]),e._v(" "),t("select",{directives:[{name:"show",rawName:"v-show",value:0===e.crtinfo.rescode,expression:"crtinfo.rescode === 0"},{name:"model",rawName:"v-model",value:e.crt_type,expression:"crt_type"}],staticClass:"elecTable_select minw160",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.crt_type=t.target.multiple?s:s[0]}}},[t("option",{attrs:{value:"crt"}},[e._v("CRT "+e._s(e.$t("certificate")))]),e._v(" "),t("option",{attrs:{value:"p12"}},[e._v("P12 "+e._s(e.$t("certificate")))]),e._v(" "),t("option",{attrs:{value:"dot"}},[e._v(".0 "+e._s(e.$t("certificate")))])]),e._v(" "),t("button",{staticClass:"elecBtn",attrs:{title:"下载当前使用的根证书文件"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.crtInstall()}}},[e._v(e._s(e.$ta("download","current","certificate")))]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){t.preventDefault(),t.stopPropagation(),e.crthostshow=!e.crthostshow}}},[e._v(e._s(e.$ta("sign","host","certificate")))]),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.crthostshow,expression:"crthostshow"}],staticClass:"sfcrt_self"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("host")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.crt_host,expression:"crt_host"}],staticClass:"elecTable_input sfcrt_host",attrs:{placeholder:"域名 比如 test.com"},domProps:{value:e.crt_host},on:{input:function(t){t.target.composing||(e.crt_host=t.target.value)}}}),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.crtHost()}}},[e._v(e._s(e.$ta("generate","and","download")))])])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("new","root","certificate"))+":")]),e._v(" "),t("div",[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$t("name"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newcrt.commonName,expression:"newcrt.commonName"}],staticClass:"elecTable_input w220",attrs:{type:"text",name:"commonName",placeholder:"elecV2P (全英文字符)"},domProps:{value:e.newcrt.commonName},on:{input:function(t){t.target.composing||e.$set(e.newcrt,"commonName",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"eflex"},[t("label",{staticClass:"sfcrt_label"},[e._v(e._s(e.$ta("force","replace"))+" ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.newcrt.overwrite,expression:"newcrt.overwrite"}],staticClass:"echeckbox",attrs:{type:"checkbox",name:"overwrite"},domProps:{checked:Array.isArray(e.newcrt.overwrite)?e._i(e.newcrt.overwrite,null)>-1:e.newcrt.overwrite},on:{change:function(t){var s=e.newcrt.overwrite,i=t.target,n=!!i.checked;if(Array.isArray(s)){var a=e._i(s,null);i.checked?a<0&&e.$set(e.newcrt,"overwrite",s.concat([null])):a>-1&&e.$set(e.newcrt,"overwrite",s.slice(0,a).concat(s.slice(a+1)))}else e.$set(e.newcrt,"overwrite",n)}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.crtNew()}}},[e._v(e._s(e.$t("generate")))])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("div",{staticClass:"eupload eupload--crt",attrs:{title:"根证书包含 rootCA.crt/rootCA.key 两部分"}},[t("input",{ref:"crtfiles",staticClass:"eupload_file eupload_file--crt",attrs:{type:"file",multiple:""},on:{change:function(t){return e.crtstoupload()}}}),e._v(" "),t("span",{directives:[{name:"show",rawName:"v-show",value:e.crtfiles.length,expression:"crtfiles.length"}],staticClass:"eupload_span"},[e._v(e._s(e.crtfilename))])]),e._v(" "),t("button",{staticClass:"elecBtn w220 emargin",on:{click:function(t){return e.crtUpload()}}},[e._v(e._s(e.$ta("start","upload")))])]),e._v(" "),t("div",{staticClass:"eflex mitm_border"},[t("button",{staticClass:"elecBtn minw320 emargin",attrs:{title:"清空 ANYPROXY temp cache 文件夹"},on:{click:function(t){return e.cacheClear()}}},[e._v(e._s(e.$ta("clear","cache","file")))]),e._v(" "),t("button",{staticClass:"elecBtn minw320 emargin",attrs:{title:"删除由根证书签发的其他域名证书"},on:{click:function(t){return e.crtClear()}}},[e._v(e._s(e.$ta("clear","host","certificate")))]),e._v(" "),t("button",{staticClass:"elecBtn minw320 greenbk",on:{click:function(t){return e.eproxyToggle("restart")}}},[e._v(e._s(e.$t("restart"))+" ANYPROXY")])])])],1),e._v(" "),e._m(0)])};Eo._withStripped=!0;var jo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"pacset"},[t("div",{staticClass:"pacaddr eflex"},[t("label",{staticClass:"elabel",attrs:{title:"根据上面的 MITM HOST 列表自动生成 base on mitmhost list"}},[e._v("PAC "+e._s(e.$t("file")))]),e._v(" "),t("span",{staticClass:"elecBtn",on:{click:function(t){return e.pacCopy()}}},[e._v(e._s(e.config.addr))])]),e._v(" "),t("div",{staticClass:"pacproxy eflex emargin"},[t("label",{staticClass:"elabel",attrs:{title:"需要 MITM 的网络请求分流代理地址"}},[e._v(e._s(e.$t("proxy")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.config.proxy,expression:"config.proxy",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"127.0.0.1:8001"},domProps:{value:e.config.proxy},on:{input:function(t){t.target.composing||e.$set(e.config,"proxy",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("div",{staticClass:"pacproxy eflex emargin"},[t("label",{staticClass:"elabel",attrs:{title:"未匹配到的网络请求走向"}},[e._v(e._s(e.$t("non-matched")))]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.config.final,expression:"config.final",modifiers:{trim:!0}}],staticClass:"elecTable_input",attrs:{placeholder:"DIRECT"},domProps:{value:e.config.final},on:{input:function(t){t.target.composing||e.$set(e.config,"final",t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("button",{staticClass:"elecBtn",on:{click:function(t){return e.pacSave()}}},[e._v(e._s(e.$t("save")))])])};jo._withStripped=!0;const No={name:"mitm",props:["config"],data:()=>({}),methods:{pacCopy(){this.$uApi.copyToClipboard(this.config.addr+"?u="+Date.now()+"&token="),this.$message.success("成功复制 PAC 文件链接")},pacSave(){const e=this.$message.loading("正在更新 PAC 默认代理...",0);this.$axios.put("/pac",{proxy:this.config.proxy,final:this.config.final}).then((e=>{console.debug("PAC SAVE 返回结果",e.data),0===e.data.rescode?this.$message.success("成功更新 PAC 默认代理",e.data.message):this.$message.error("更新 PAC 默认代理失败",e.data.message)})).catch((e=>{this.$message.error("更新 PAC 默认代理失败",e.message),console.error(e)})).finally(e)}}};const Po={name:"mitm",props:[],data:()=>({header:"MITM",crtfiles:[],mitmhost:[],newcrt:{commonName:"elecV2P",overwrite:!1},crtinfo:{},mitmhosteble:{enable:!0},icon:wa,crt_type:"crt",crt_host:"",mitmCheck:[],eproxy:{enable:!1,port:8001,webPort:8002},crthostshow:!1,config_pac:{addr:Oa.base_url+"/pac",proxy:"127.0.0.1:8001",final:"DIRECT"}}),components:{pac:ka(No,jo,[],!1,null,null,null).exports,checkbox:mr},created(){this.mitmInit()},computed:{mitmChecked:{get(){let e={};return this.mitmCheck.forEach((t=>{e[t]=!0})),e},set(e){"all"===e?this.mitmCheck=Object.keys(this.mitmhost):"none"===e&&(this.mitmCheck=[])}},crtfilename(){let e=[];for(let t=0;t{e.data.host&&(this.mitmhost=[],e.data.host.forEach((e=>{switch(this.$sType(e)){case"string":this.mitmhost.push({host:e,enable:!0});break;case"object":!1!==e.enable&&(e.enable=!0),this.mitmhost.push(e)}}))),e.data.eproxy&&Object.assign(this.eproxy,e.data.eproxy),this.mitmhosteble.enable=!1!==e.data.enable,e.data.crtinfo&&0===e.data.crtinfo.rescode?this.crtinfo=e.data.crtinfo:this.crtinfo={commonName:"没有检测到相关证书(可能是 ANYPROXY 尚未开启)",notBefore:"无",notAfter:"无"},e.data.pacproxy&&(this.config_pac.proxy=e.data.pacproxy),e.data.pacfinal&&(this.config_pac.final=e.data.pacfinal),this.$message.success("成功获取 mitmhost 列表 "+this.mitmhost.length)})).catch((e=>{this.$message.error("获取 mitmhost 数据失败 "+e.message),console.error("获取 mitmhost 数据失败",e)})).finally(e)},crtstoupload(){this.crtfiles=this.$refs.crtfiles.files},crtUpload(){if(-1===this.crtfilename.indexOf("rootCA.crt")||-1===this.crtfilename.indexOf("rootCA.key"))return void this.$message.error("根证书应该包含 rootCA.crt/rootCA.key 两部分");let e=new FormData;for(let t of this.crtfiles)e.append(t.name,t);this.$axios.post("/crt",e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{console.log(e.data,e.status),0===e.data.rescode?(this.$message.success("上传成功 "+e.data.message+"\n将在 ANYPROXY 重启后自动应用"),this.crtfiles="",this.$refs.crtfiles.value=""):this.$message.success("上传失败 "+e.data.message)})).catch((()=>{this.$message.error("上传失败 FAILURE!!")}))},crtClear(){if(confirm("清空由之前根证书已签发的所有证书?")){const e=this.$message.loading("证书清除中...",0);this.$axios.put("/crt",{op:"clearcrt"}).then((e=>{this.$message.success("清除完成",e.data.message)})).catch((e=>{this.$message.error("操作失败",e.message),console.error(e)})).finally(e)}},crtInstall(){0===this.crtinfo.rescode?window.open("/crt"+("crt"!==this.crt_type?"?type="+this.crt_type:"")):this.$message.error("当前并没有证书可供下载,可能是 ANYPROXY 尚未开启")},crtNew(){if(!this.newcrt.commonName)return void this.$message.error("请先输入证书名称");const e=this.$message.loading("证书生成中...",0);this.$axios.put("/crt",{op:"new",data:this.newcrt}).then((e=>{0===e.data.rescode?this.$message.success("成功生成新的根证书\n"+e.data.message+"\n将在 ANYPROXY 重启后自动应用"):this.$message.success("自签根证书生成失败\n"+e.data.message)})).catch((e=>{this.$message.error("操作失败 "+e.message),console.error(e)})).finally(e)},hostSave(){let e=0,t=!1,s=this.mitmhost.filter((s=>{if(s.host)return s.enable&&(e++,"*"===s.host&&(t=!0)),!0}));if(confirm(`共 ${e}/${s.length} 个 mitmhost 将被保存,${this.mitmhosteble.enable?t?"包含单独 * 项,将解析所有域名,":"":"但不启用,"}确定保存?`)){this.mitmhost=s;const e=this.$message.loading("mitmhost 上传保存中...",0);this.$axios.put("/data",{type:"mitmhost",data:this.mitmhost,mitmhostenable:this.mitmhosteble.enable}).then((e=>{0===e.data.rescode?this.$message.success("保存成功",e.data.message):this.$message.error("mitmhost 保存失败",e.data.message)})).catch((e=>{this.$message.error("mitmhost 保存失败",e.message),console.error("mitmhost 保存失败",e)})).finally(e)}},cacheClear(){const e=this.$message.loading("清空 ANYPROXY temp cache 文件夹中...",0);this.$axios.delete("/tempcaches").then((e=>{console.debug("清空 ANYPROXY temp cache 返回结果",e.data),0===e.data.rescode?this.$message.success("清空完成",e.data.message):this.$message.error("清空失败",e.data.message)})).catch((e=>{this.$message.error("清空失败",e.message),console.error(e)})).finally(e)},mhostDel(e){this.$delete(this.mitmhost,e)},mhostDelCks(){this.mitmhost=this.mitmhost.filter(((e,t)=>!this.mitmChecked[t])),this.$message.success(`成功删除 ${this.mitmCheck.length} 条规则,保存后正式生效`),this.mitmCheck=[]},crtHost(){this.crt_host?window.open("./crt/new/"+this.crt_host):this.$message.error("请先输入要签发证书的域名")},mitmCkall(e){this.mitmChecked=e.target.checked?"all":"none"},eproxyToggle(e=""){if(this.$wsrecv.connected)switch(e){case"open":if(this.eproxy.enable)return void this.$message.success("当前 MITM 功能已处于启用状态");confirm("确定打开 ANYPROXY,启用 MITM 功能?")&&(this.eproxy.enable=!0,this.$wsrecv.send("eproxy",{...this.eproxy}));break;case"close":if(!this.eproxy.enable)return void this.$message.success("当前 MITM 功能已处于关闭状态");confirm("确定关闭 ANYPROXY,暂停 MITM 功能?")&&(this.eproxy.enable=!1,this.$wsrecv.send("eproxy","close"));break;case"restart":confirm("确定重启 ANYPROXY?")&&(this.eproxy.enable=!0,this.$wsrecv.send("eproxy",{op:"restart",...this.eproxy}));break;default:this.$message.error("未知操作",e)}else this.$message.error("websocket 尚未连接,指令无法发送")}}};const Ao=ka(Po,Eo,[function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("ul",{staticClass:"footer_tip"},[t("li",[e._v("关于 PAC 文件的说明参考文档:"),t("a",{staticClass:"tip",attrs:{href:"https://github.com/elecV2/elecV2P-dei/blob/master/docs/Advanced.md",target:"_blank"}},[e._v("Advanced.md")]),e._v(" 相关部分")]),e._v(" "),t("li",[e._v("各个系统的证书安装与信任 参考: "),t("a",{staticClass:"tip",attrs:{href:"https://github.com/alibaba/anyproxy/tree/master/docs-src/cn",target:"_blank"}},[e._v("此页面")]),e._v(" 的证书配置相关部分")]),e._v(" "),t("li",[e._v("生成或上传新的根证书在重启后生效,需要重新下载安装和信任")]),e._v(" "),t("li",[e._v("解析 https 请求的条件:安装信任根证书且相关域名在解析列表中")]),e._v(" "),t("li",[e._v("经常使用 ANYPROXY 代理会产生大量缓存文件,请定期进行清理")])])])}],!1,null,"0b31b9a4",null).exports;var Io=function(){var e=this,t=e._self._c;return t("main",[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"etable"},[t("table",{staticClass:"elecTable",on:{keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),t.shiftKey||t.altKey||t.metaKey?null:e.filterSave()):null}}},[t("caption",{staticClass:"elecTable_caption"},[t("span",[e._v("filter.list - "+e._s(e.lists.length))]),e._v(" "),t("span",{staticClass:"icon icon_caption--sync",attrs:{title:"刷新当前列表"},domProps:{innerHTML:e._s(e.icon.sync)},on:{click:function(t){return e.cfInit()}}})]),e._v(" "),e._m(0),e._v(" "),t("tbody",e._l(e.lists,(function({data:s,index:i}){return t("tr",{key:"filter"+i},[t("td",{staticClass:"elecTable_td"},[t("select",{directives:[{name:"model",rawName:"v-model",value:s[0],expression:"data[0]"}],staticClass:"elecTable_select",on:{change:function(t){var i=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(s,0,t.target.multiple?i:i[0])}}},[t("option",[e._v("DOMAIN")]),e._v(" "),t("option",[e._v("DOMAIN-SUFFIX")]),e._v(" "),t("option",[e._v("IP-CIDR")])])]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("input",{directives:[{name:"model",rawName:"v-model.trim",value:s[1],expression:"data[1]",modifiers:{trim:!0}}],staticClass:"elecTable_input",domProps:{value:s[1]},on:{input:function(t){t.target.composing||e.$set(s,1,t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})]),e._v(" "),t("td",{staticClass:"elecTable_td"},[t("span",{staticClass:"icon--op",domProps:{innerHTML:e._s(e.icon.delete)},on:{click:function(t){return e.$set(e.orglist[i],"status",-1)}}})])])})),0),e._v(" "),t("tfoot",[t("tr",[t("td",{staticClass:"elecTable_add",attrs:{colspan:"3"},on:{click:function(t){return e.orglist.push({data:["DOMAIN",""],index:e.orglist.length,status:1})}}},[e._v("+")])])])])]),e._v(" "),t("p",{staticClass:"center"},[t("button",{staticClass:"elecBtn elecBtn--long",on:{click:function(t){return e.filterSave()}}},[e._v("保存当前列表")])])]),e._v(" "),t("footer",{staticClass:"footer footer--h48"},[t("div",[t("span",[e._v("该列表用于客户端分流(filter)订阅 地址:")]),e._v(" "),t("strong",[t("a",{attrs:{href:"/filter",target:"elecV2PFilter"}},[e._v(e._s(e.homepage)+"/filter")])])])])])};Io._withStripped=!0;const Ro={name:"filter",data:()=>({icon:wa,header:"客户端订阅分流列表",homepage:location.origin,orglist:[]}),created(){this.cfInit()},computed:{lists(){return this.orglist.filter((e=>-1!==e.status))}},methods:{cfInit(){const e=this.$message.loading("正在获取 filter 列表...",0);this.$axios.get("/data?type=filter").then((e=>{let t=e.data,s=[];t&&t.split(/\n|\r/).forEach((e=>{if(3===e.split(",").length&&!/^(#|\[)/.test(e)){let t=e.split(",");s.push({data:[t[0],t[1]],index:s.length,status:0})}})),this.orglist=s,this.$message.success("成功获取 filter 列表 "+this.orglist.length)})).catch((e=>{this.$message.error("获取 filter 列表失败",e.message),console.error("获取 filter 数据失败",e)})).finally(e)},filterSave(){let e=[];if(e=this.lists.filter((e=>e.data[1]&&/^(DOMAIN(-SUFFIX)?|IP-CIDR)$/.test(e.data[0]))),this.lists.length-e.length)return void this.$message.error("部分规则为空,请填写完成或删除后再进行保存");e=this.lists.map((e=>e.data));const t=this.$message.loading("filter 列表保存中...",0);this.$axios.post("/filterlist",{filterlist:e}).then((e=>{this.$message.success("保存成功",e.data.message)})).catch((e=>{this.$message.error("保存失败",e.message),console.error(e)})).finally(t)}}};const Do=ka(Ro,Io,[function(){var e=this,t=e._self._c;return t("thead",[t("tr",[t("th",{staticClass:"elecTable_th elecTable_th--name"},[e._v("匹配方式")]),e._v(" "),t("th",{staticClass:"elecTable_th"},[e._v("匹配内容")]),e._v(" "),t("th",{staticClass:"elecTable_th minw62"},[e._v("操作")])])])}],!1,null,null,null).exports;var Fo=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.header))]),e._v(" "),e._m(0),e._v(" "),t("footer",{staticClass:"footer footer--h48"},[t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[t("i",{staticClass:"icon icon-github",attrs:{"aria-label":"icon: github"}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"github",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0 1 38.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}})])]),e._v(" Github ")]),e._v(" "),t("a",{attrs:{href:"https://t.me/elecV2",target:"elecV2PTG"}},[t("i",{staticClass:"icon icon-robot",attrs:{"aria-label":"icon: robot"}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"robot",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M300 328a60 60 0 1 0 120 0 60 60 0 1 0-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 1 0 120 0 60 60 0 1 0-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}})])]),e._v(" Telegram ")])])])};Fo._withStripped=!0;const Lo=ka({name:"about",data:()=>({header:"ABOUT"})},Fo,[function(){var e=this,t=e._self._c;return t("main",{staticClass:"content"},[t("div",{staticClass:"about"},[t("h4",{staticClass:"about_title"},[e._v("简介")]),e._v(" "),t("p",[e._v("elecV2P - customize personal network.")]),e._v(" "),t("p",[e._v("elecV2P 是一款基于 NodeJS,可通过 JS 修改网络请求,以及定时运行脚本或 SHELL 指令的网络工具。")]),e._v(" "),t("br"),e._v(" "),t("p",[e._v("项目地址:"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[e._v("https://github.com/elecV2/elecV2P")]),t("br"),e._v("说明文档:"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/docs",target:"elecV2PDoc"}},[e._v("https://github.com/elecV2/elecV2P-dei/tree/master/docs")])]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("功能")]),e._v(" "),t("ul",[t("li",[e._v("查看/修改 网络请求 (MITM)")]),e._v(" "),t("li",[e._v("定时执行 JS/SHELL 脚本")]),e._v(" "),t("li",[e._v("FEED/IFTTT/自定义 通知")]),e._v(" "),t("li",[e._v("EFSS 基础文件管理")])]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("项目已开源")]),e._v(" "),t("p",[e._v("前端源文件位于 web/src 目录,修改后使用 yarn build 命令进行打包。")]),e._v(" "),t("p",[e._v("在使用时,如果有任何问题或建议,欢迎一起交流 "),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P/issues",target:"elecV2PGit"}},[e._v("open a issue")]),e._v("。")]),e._v(" "),t("h4",{staticClass:"about_title"},[e._v("贡献/参考")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://github.com/alibaba/anyproxy",target:"_blank"}},[e._v("anyproxy")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/axios/axios",target:"_blank"}},[e._v("axios")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/cheeriojs/cheerio",target:"_blank"}},[e._v("cheerio")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://expressjs.com",target:"_blank"}},[e._v("express")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/merencia/node-cron",target:"_blank"}},[e._v("node-cron")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/dylang/node-rss",target:"_blank"}},[e._v("node-rss")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://pm2.keymetrics.io/",target:"_blank"}},[e._v("pm2")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://vuejs.org",target:"_blank"}},[e._v("vue")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/mauricius/vue-draggable-resizable",target:"_blank"}},[e._v("vue-draggable-resizable")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/ajaxorg/ace",target:"_blank"}},[e._v("ace")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/cthackers/adm-zip",target:"_blank"}},[e._v("adm-zip")])]),e._v(" "),t("li",[t("a",{attrs:{href:"https://www.antdv.com",target:"_blank"}},[e._v("Ant Design Vue")])])]),e._v(" "),t("h5",{staticClass:"about_tip"},[t("i",[e._v(" • Don't be evil. "),t("small",[e._v("(Because I am already one)")])])])])])}],!1,null,"055bd4a3",null).exports;var Ho=function(){var e=this,t=e._self._c;return t("section",[t("header",{staticClass:"header"},[e._v(e._s(e.$t("donation")))]),e._v(" "),t("main",{staticClass:"content"},[t("div",{staticClass:"donation"},[e._m(0),e._v(" "),e._m(1),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.userid,expression:"userid"}],attrs:{title:"可多台设备共用(设置相同 WEBHOOK TOKEN)"}},[t("p",[e._v("当前用户 ID: "+e._s(e.userid))]),e._v(" "),e._m(2)])]),e._v(" "),t("div",{staticClass:"todo"},[t("h2",{directives:[{name:"show",rawName:"v-show",value:!e.tododata,expression:"!tododata"}],staticClass:"todotitle",on:{click:e.todoget}},[e._v("查看 Todo-Done-Project")]),e._v(" "),t("div",{domProps:{innerHTML:e._s(e.tododata)}})])]),e._v(" "),e._m(3)])};Ho._withStripped=!0;const Uo={name:"donation",data(){return{userid:this.$uApi.store.get("userid"),tododata:""}},created(){this.$uApi.store.getCache("bSponsor")||this.$axios.get("/data?type=sponsors").then((e=>{if(0===e.data.rescode){let t=e.data.resdata;this.$uApi.store.set("sponsors",this.$uStr.ebufEncrypt(JSON.stringify(t.sponsors),"elecV2P_sponsors")),this.userid!==t.userid&&(this.userid=t.userid,this.$uApi.store.set("userid",this.userid)),(this.$uApi.store.getCache("sponsors").has(this.userid)||-1!==t.sponsors.indexOf(this.userid))&&(this.$message.success("感谢您的赞助,相关权益已激活,请回到首页并刷新"),this.$uApi.store.setCache("bSponsor",!0))}console.debug("get sponsors lists",e.data)})).catch((e=>{console.debug("获取 sponsors lists 失败",e.message)}))},methods:{todoget(){if(this.tododata)return;const e=this.$message.loading("获取 todo lists 中...",0);this.$axios.get("https://raw.githubusercontent.com/elecV2/elecV2P/master/Todo.md").then((e=>{this.$message.success("获取成功"),this.tododata=e.data})).catch((e=>{this.$message.error("获取失败 "+e.message),console.error(e),this.tododata="点击前往:https://github.com/elecV2/elecV2P 查看"})).finally(e)}}};const Mo=ka(Uo,Ho,[function(){var e=this,t=e._self._c;return t("p",[e._v("如果你觉得本项目还不错的话,"),t("a",{attrs:{href:"https://github.com/elecV2/elecV2P",target:"elecV2PGit"}},[e._v("给个 Star")]),e._v(" ,或者赞助打赏一下")])},function(){var e=this._self._c;return e("div",{staticClass:"donationpic"},[e("img",{staticClass:"donationpic_item",attrs:{alt:"wechat",src:"https://elecv2.github.io/src/wechat.png"}}),this._v(" "),e("img",{staticClass:"donationpic_item",attrs:{alt:"alipay",src:"https://elecv2.github.io/src/alipay.png"}})])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"tip"},[e._v("* 赞助 10 元及以上,体验"),t("a",{staticClass:"tip",attrs:{href:"https://github.com/elecV2/elecV2P-dei/tree/master/examples/theme",target:"elecV2PDoc"}},[e._v(" 主题功能")]),e._v("(请附上用户 ID)")])},function(){var e=this,t=e._self._c;return t("footer",{staticClass:"footer"},[t("span",[e._v("BTC: 1GtN4T1GB4YUf4YWynqr1Vgv4sdgLepoo9")]),e._v(" "),t("span",[e._v("ETH: 0x2455850dAC2f44309E3e208E5ffAF5945308E76a")])])}],!1,null,"51001bdc",null).exports;var Bo=function(){var e=this,t=e._self._c;return e.bIsHide?e._e():t("div",{staticClass:"hold"},[t("h4",{staticClass:"hold_title"},[e._v("$HOLD: "+e._s(e.title))]),e._v(" "),t("div",{staticClass:"hold_edit"},[t("div",{staticClass:"hold_left"},[e.request?t("div",{staticClass:"hold_request"},[t("div",{staticClass:"hold_request_flex"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.request.method,expression:"request.method"}],staticClass:"elecTable_select header_select",on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.$set(e.request,"method",t.target.multiple?s:s[0])}}},[t("option",[e._v("GET")]),e._v(" "),t("option",[e._v("POST")]),e._v(" "),t("option",[e._v("PUT")]),e._v(" "),t("option",[e._v("DELETE")])]),e._v(" "),t("label",{staticClass:"header_label"},[e._v("HOST : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.hostname,expression:"request.hostname"}],staticClass:"elecTable_input hostname_input",domProps:{value:e.request.hostname},on:{input:function(t){t.target.composing||e.$set(e.request,"hostname",t.target.value)}}}),e._v(" "),t("label",{staticClass:"header_label"},[e._v(" : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.port,expression:"request.port"}],staticClass:"elecTable_input port_input",domProps:{value:e.request.port},on:{input:function(t){t.target.composing||e.$set(e.request,"port",t.target.value)}}})]),e._v(" "),t("div",{staticClass:"hold_request_flex"},[t("label",{staticClass:"header_label"},[e._v("PATH : ")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.request.path,expression:"request.path"}],staticClass:"elecTable_input path_input",domProps:{value:e.request.path},on:{input:function(t){t.target.composing||e.$set(e.request,"path",t.target.value)}}})])]):e._e(),e._v(" "),t("div",{staticClass:"hold_header"},[t("h4",{staticClass:"hold_title"},[e._v("header"),t("span",{staticClass:"icon icon-interaction",attrs:{"aria-label":"icon: interaction"},on:{click:function(t){e.bIsTheader=!e.bIsTheader}}},[t("svg",{attrs:{viewBox:"64 64 896 896","data-icon":"interaction",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false"}},[t("path",{attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM304.8 524h50.7c3.7 0 6.8-3 6.8-6.8v-78.9c0-19.7 15.9-35.6 35.5-35.6h205.7v53.4c0 5.7 6.5 8.8 10.9 5.3l109.1-85.7c3.5-2.7 3.5-8 0-10.7l-109.1-85.7c-4.4-3.5-10.9-.3-10.9 5.3V338H397.7c-55.1 0-99.7 44.8-99.7 100.1V517c0 4 3 7 6.8 7zm-4.2 134.9l109.1 85.7c4.4 3.5 10.9.3 10.9-5.3v-53.4h205.7c55.1 0 99.7-44.8 99.7-100.1v-78.9c0-3.7-3-6.8-6.8-6.8h-50.7c-3.7 0-6.8 3-6.8 6.8v78.9c0 19.7-15.9 35.6-35.5 35.6H420.6V568c0-5.7-6.5-8.8-10.9-5.3l-109.1 85.7c-3.5 2.5-3.5 7.8 0 10.5z"}})])])]),e._v(" "),e.bIsTheader?t("textarea",{directives:[{name:"model",rawName:"v-model.lazy",value:e.strheader,expression:"strheader",modifiers:{lazy:!0}}],staticClass:"editor_textarea header_text",domProps:{value:e.strheader},on:{change:function(t){e.strheader=t.target.value}}}):t("div",e._l(e.header,(function(s,i){return t("span",{key:i,staticClass:"header_item"},[t("label",{staticClass:"header_label",attrs:{title:i}},[e._v(e._s(i)+":")]),e._v(" "),t("span",{staticClass:"button_delete",on:{click:function(t){return e.headerDelete(i)}}},[e._v("X")]),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.header[i],expression:"header[key]"}],staticClass:"elecTable_input header_input",domProps:{value:e.header[i]},on:{input:function(t){t.target.composing||e.$set(e.header,i,t.target.value)}}})])})),0)])]),e._v(" "),t("div",{staticClass:"hold_body"},[t("h4",{staticClass:"hold_title"},[e._v("body")]),e._v(" "),t("textarea",{directives:[{name:"model",rawName:"v-model.lazy",value:e.body,expression:"body",modifiers:{lazy:!0}}],staticClass:"editor_textarea body_text",domProps:{value:e.body},on:{change:function(t){e.body=t.target.value}}})])]),e._v(" "),t("p",{staticClass:"hold_bcont center"},[t("button",{staticClass:"elecBtn hold_button",on:{click:e.holdDone}},[e._v("完成")]),e._v(" "),e.request?t("button",{staticClass:"elecBtn hold_button",on:{click:e.reject}},[e._v("直接返回当前数据")]):e._e()])])};Bo._withStripped=!0;const zo={name:"hold",data:()=>({title:"waiting hold data",request:null,header:{},body:"hello elecV2P",bIsHide:!0,bIsTheader:!1}),computed:{strheader:{get(){return JSON.stringify(this.header,null,4)},set(e){try{this.header=JSON.parse(e)}catch{console.log("hold header string is not a json"),this.$message.error("header 内容并不是正确的 JSON 格式",10)}}}},created(){this.$wsrecv.add("hold",(e=>{"over"===e?(this.bIsHide=!0,this.request=null,this.header={},this.body="hello elecV2P"):(this.title=e.title,this.request=e.request||null,this.header=e.header||{},this.body=e.body,this.bIsHide=!1)}))},methods:{holdDone(){const e={header:this.header,body:this.body};this.request&&(this.request.path=encodeURI(this.request.path),e.request=this.request),this.$wsrecv.send("hold",e),this.bIsHide=!0},reject(){const e={reject:!0,header:this.header,body:this.body};this.$wsrecv.send("hold",e),this.bIsHide=!0},headerDelete(e){this.$delete(this.header,e)}}};const Vo=ka(zo,Bo,[],!1,null,"3afbbebb",null).exports;var Go=function(){var e=this,t=e._self._c;return t("div",{staticClass:"message"},e._l(e.msgs,(function(s,i){return t("div",{key:i,staticClass:"message_item",style:{textAlign:s.align}},[t("span",{staticClass:"message_type icon",domProps:{innerHTML:e._s(e.icon[s.type])}}),e._v(" "),t("span",{staticClass:"message_text",class:{cursor:s.url},attrs:{title:s.url},on:{click:function(t){return e.$uApi.open(s.url)}}},[e._v(e._s(s.text))]),e._v(" "),t("span",{staticClass:"message_remove",on:{click:function(t){return e.msgRemove(i)}}},[e._v("X")])])})),0)};Go._withStripped=!0;const Ko=ka({name:"message",data:()=>({msgs:{},icon:wa}),computed:{},created(){Object.assign(co.message,{success:(...e)=>this.msgShow("success",this.formMsg(e)),error:(...e)=>this.msgShow("error",this.formMsg(e)),loading:(...e)=>this.msgShow("loading",this.formMsg(e)),close:e=>{e?this.msgRemove(e):this.msgs={}}}),this.$wsrecv&&this.$wsrecv.add("message",(e=>{if("object"===Ea(e))switch(e.type){case"success":case"error":case"loading":const t=this.formMsg(e.data);this.msgShow(e.type,t),this.msgNotify(t.msg,{secd:t.secd,url:t.url,tag:t.mid});break;case"close":e.data?this.msgRemove(e.data):this.msgs={};break;default:this.msgShow("error",{msg:"暂不支持的通知类型: "+e.type,secd:10})}else this.msgShow("success",this.formMsg(e))}))},methods:{formMsg(e){if(0===e.length)return{msg:""};if("array"!==Ea(e))return{msg:Na(e)};if(1===e.length)return{msg:Na(e[0])};let t,s,i,n,a=e.pop();return Number.isFinite(a)?t=a:"object"===Ea(a)&&(a.secd||a.url||a.mid||a.align)?(t=a.secd,s=a.url,i=a.mid,n=a.align):e.push(a),{msg:e.map((e=>Na(e))).join(" "),secd:t,url:s,mid:i,align:n}},msgShow(e,{msg:t,secd:s,url:i,mid:n=Ra(),align:a}){return void 0!==t&&""!==t||(t="a empty message",n="empty"),Number.isFinite(s)||(s=(t.match(/\W/g)||t).length/5+(3*Object.keys(this.msgs).length||5)),this.$set(this.msgs,n,{text:t,type:e,secd:s,url:i,align:a}),0!==s&&(this.msgs[n].sTout=setTimeout(this.msgRemove,1e3*s,n)),()=>{this.msgRemove(n)}},msgRemove(e){this.msgs[e]&&(clearTimeout(this.msgs[e].sTout),this.$delete(this.msgs,e))},async getNotifyPerm(){if("undefined"==typeof Notification)return"";let e=Notification.permission;return"granted"===e||"denied"===e?e:(e=await Notification.requestPermission(),void 0===e?new Promise((e=>Notification.requestPermission((t=>e(t))))):e)},async msgNotify(e="",t={}){if("granted"===await this.getNotifyPerm()){t.icon||(t.icon="efss/logo/elecV2P.png");const s=new Notification(t.title||"",{body:e,icon:t.icon,tag:t.tag});t.secd>0&&setTimeout((()=>s.close()),1e3*t.secd),t.url&&(s.onclick=e=>{e.preventDefault(),this.$uApi.open(t.url),s.close()})}}}},Go,[],!1,null,"40ac18ce",null).exports;var qo=function(){var e=this,t=e._self._c;return t("div",{staticClass:"evui"},e._l(e.draglist,(function(s,i){return t("VueDragResize",{key:i,attrs:{className:"ediv",dragHandle:".ediv_title--name",parent:!0,"prevent-deactivation":!1,active:s.active,w:s.width,h:s.height,x:s.left,y:s.top,z:s.z,resizable:s.resizable,draggable:s.draggable,handles:["tl","tr","bl","br"],"lock-aspect-ratio":!1},on:{deactivated:function(e){s.z=1},activated:function(e){s.z=2},resizestop:function(t){return e.updateVal(arguments,i)},dragstop:function(t){return e.updateVal(arguments,i)}}},[t("h3",{staticClass:"ediv_title",style:s.style.title,on:{click:function(e){s.z=2}}},[t("span",{staticClass:"ediv_title--name",attrs:{title:i}},[e._v(e._s(s.title))]),e._v(" "),t("span",{staticClass:"ediv_title--close",on:{click:function(t){return e.evRemove(i)}}},[e._v("x")])]),e._v(" "),t("div",{staticClass:"ediv_content",style:s.style.content,domProps:{innerHTML:e._s(s.content)},on:{click:function(t){return e.evDelegate(t,i)},keydown:function(t){return(t.type.indexOf("key")||83===t.keyCode)&&t.ctrlKey?(t.preventDefault(),t.stopPropagation(),e.evSave(i)):null}}}),e._v(" "),s.cbable?t("div",{staticClass:"ediv_btncontainer"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.cbdata,expression:"ediv.cbdata"}],staticClass:"elecTable_input ediv_cbdata",style:s.style.cbdata,attrs:{placeholder:s.cbhint},domProps:{value:s.cbdata},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:t.ctrlKey?e.cbsubmit(i):null},input:function(t){t.target.composing||e.$set(s,"cbdata",t.target.value)}}}),e._v(" "),t("button",{staticClass:"elecBtn ediv_cbbtn",style:s.style.cbbtn,on:{click:function(t){return e.cbsubmit(i)}}},[e._v(e._s(s.cblabel))])]):e._e()])})),1)};qo._withStripped=!0;const Jo={name:"evui",components:{VueDragResize:xo()},data:()=>({init:{title:"elecV2P 显示窗口",top:0,left:0,width:620,height:360,z:1,active:!0,resizable:!1,draggable:!0,content:"

暂时没有添加任何内容

关于 $evui 的使用可参考:说明文档 $evui 部分

",style:{content:"font-size: 15px"},cbable:!1,cbdata:"",cblabel:"提交",cbhint:"输入返回给后台的数据"},script:"",draglist:{}}),created(){co.evui=e=>this.neweu({...e,type:"local"}),this.$wsrecv&&this.$wsrecv.add("evui",(e=>{let t=this.$sJson(e);if(t)switch(t.data&&t.data.script&&(this.script=t.data.script),t.type){case"neweu":this.neweu(t.data);break;case"close":case"delete":this.draglist[t.id]&&(this.$message.success("收到服务器端关闭",this.draglist[t.id].title,"evui 界面的命令",t.message&&"\n附带信息: "+t.message),this.evRemove(t.id));break;case"contentadd":this.$set(this.draglist[t.id],"content",this.draglist[t.id].content+this.$sString(t.data));break;case"content":this.$set(this.draglist[t.id],"content",this.$sString(t.data));break;case"cbdataadd":let e=this.draglist[t.id].cbdata+"\n"+this.$sString(t.data);this.$set(this.draglist[t.id],"cbdata",e);break;default:this.$set(this.draglist[t.id],"cbdata",this.$sString(t.data))}else this.$message.error("evui 输送的数据有误")}))},watch:{script(e){this.$uApi.injectJs(e)}},methods:{updateVal({...e},t){let s={left:e[0],top:e[1]};void 0!==e[2]&&void 0!==e[3]&&(s.width=e[2],s.height=e[3]),Object.assign(this.draglist[t],s)},neweu(e={}){let t=e.id||this.$uStr.euid();(e={...this.init,...e}).top=e.top||(document.body.clientHeight-Number(e.height||460))/2,e.left=e.left||(document.body.clientWidth-Number(e.width||800))/2,e.top<0&&(e.top=0),e.left<0&&(e.left=0),e.content&&(e.content=this.$sString(e.content)),e.cbdata&&(e.cbdata=this.$sString(e.cbdata)),"object"!==this.$sType(e.style)&&(e.style={content:e.style}),e.script&&(this.script=e.script),this.$set(this.draglist,t,e)},evRemove(e){e?this.draglist[e]&&("local"!==this.draglist[e].type&&this.$wsrecv&&this.$wsrecv.connected&&this.$wsrecv.send(e,"close"),this.$delete(this.draglist,e)):this.$message.error("a id of the evui is expect")},cbsubmit(e){this.$message.success(this.draglist[e].title,"send data:\n",this.draglist[e].cbdata),this.$wsrecv&&this.$wsrecv.send(e,this.draglist[e].cbdata)},evDelegate(e,t){const s=e&&e.target.dataset.method;if(!s)return;this.draglist[t].methods&&this.draglist[t].methods[s]&&this.draglist[t].methods[s](e);"true"!==e.target.dataset.close&&"close"!==s||this.evRemove(t)},evSave(e){this.draglist[e].methods&&this.draglist[e].methods.save&&(this.draglist[e].methods.save(),this.evRemove(e))}}};const Wo=ka(Jo,qo,[],!1,null,null,null).exports;const Yo=ka({name:"app",data:()=>({icon:wa,logo_src:ba,logo_name:"elecV2P",collapsed:window.innerWidth<960,sidermobile:!0,currentpanel:"overview",islangzh:rr.locale.startsWith("zh"),menulist:{overview:Object.create(null),task:Object.create(null),mitm:Object.create(null),rules:Object.create(null),rewrite:Object.create(null),jsmanage:Object.create(null),setting:Object.create(null),cfilter:Object.create(null),about:Object.create(null),donation:Object.create(null)}}),created(){let e=location.hash.slice(1).toLowerCase();this.currentpanel=this.menulist[e]?e:"overview";let t=this.$sJson(this.$uApi.store.get("menunav"));t?this.menulist=t:this.islangzh&&(this.menulist.overview.name="基础信息",this.menulist.task.name="定时任务",this.menulist.rewrite.name="重写请求",this.menulist.jsmanage.name="脚本管理",this.menulist.setting.name="设置相关",this.menulist.cfilter.name="分流列表",this.menulist.about.name="简介说明",this.menulist.donation.name="赞助打赏");let s=this.$sJson(this.$uApi.store.get("theme"));s&&this.themeApply(s),addEventListener("hashchange",(e=>{let t=location.hash.slice(1).toLowerCase();this.currentpanel=this.menulist[t]?t:"overview"})),addEventListener("load",(e=>{"serviceWorker"in navigator?(navigator.serviceWorker.register("/sw.js").catch((e=>{console.error("service worker registration failed",e)})),navigator.serviceWorker.addEventListener("controllerchange",(()=>{console.debug("a new service worker activated"),this.$message.success("a new service worker activated")}))):("http:"===location.protocol||this.$uApi.store.getCache("bChecked")||this.$message.error("该浏览器暂不支持 service workers,webUI 部分功能可能受限"),console.error("This browser does not support service workers. webUI 部分功能可能受限")),location.search.includes("token")&&history.replaceState(null,"","/"+location.hash)}))},components:{overview:hr,rules:vr,rewrite:br,jsmanage:jr,setting:$o,task:Oo,mitm:Ao,cfilter:Do,about:Lo,donation:Mo,hold:Vo,message:Ko,evui:Wo},computed:{navlist(){let e=Object.create(null),t=this.$uApi.store.getCache("bSponsor");for(let s in this.menulist)"setting"===s||"donation"===s&&!t?(this.menulist[s].show=!0,e[s]=this.menulist[s]):!1!==this.menulist[s].show&&(e[s]=this.menulist[s]);return e}},methods:{nav(e){location.hash="#"+e,this.sidermobile||(this.sidermobile=!0)},edelegate(e){if("nav"===e.target.dataset.method){let t=e.target.dataset.panel||e.target.dataset.param;t&&this.nav(t)}},menunav(e=null,t=!1){if(!e)return void console.debug("menu nav are expect");if(!t&&JSON.stringify(e)===JSON.stringify(this.menulist))return void console.debug("same menu nav, no need to update");let s={...this.menulist};for(let t in e)s[t]&&(s[t]=e[t]);this.menulist=s,this.$uApi.store.set("menunav",JSON.stringify(s))},themeApply(e=null){if(!e)return void console.error("theme object is expect");if("logo"===e.type)return!1===e.enable?(this.logo_src=ba,void(this.logo_name="elecV2P")):(e.src&&(this.logo_src=e.src),void(e.name&&(this.logo_name=e.name)));if(e.simple&&(e=e.simple),!0!==e.enable)return this.$uApi.removeItem(".evtheme"),this.$uApi.injectMeta("theme-color","#003153"),void this.$uApi.store.set("theme",JSON.stringify(e));let t="";e.mainbk&&(t=`--main-bk: ${e.mainbk};`,e.mainbk.startsWith("#")&&(t+=`--secd-fc: ${e.mainbk.padEnd(7,8).slice(0,7)}b8;`)),e.maincl&&(t+=`--main-cl: ${e.maincl};`,e.maincl.startsWith("#")&&(t+=`--secd-bk: ${e.maincl.padEnd(7,8).slice(0,7)}b8;`)),e.appbk&&(/^http/.test(e.appbk)&&(e.appbk=`url(${e.appbk})`),t+=`background: ${e.appbk};`),t&&(t=`#app{${t}}`),e.style&&(t+=e.style,/--main-fc/.test(e.style)&&this.$uApi.hashToLogo()),this.$uApi.injectCss(t),this.$uApi.injectMeta("theme-color",e.mainbk),this.$uApi.store.set("theme",JSON.stringify(e))},srcErr(){this.$message.error("LOGO 图标加载失败,自动生成替换图标"),this.logo_src=this.$uApi.hashToLogo(this.$uApi.store.get("userid"),this.logo_name,4)}}},_a,[],!1,null,"10ee03bb",null).exports;function Xo(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zo}=Object.prototype,{getPrototypeOf:Qo}=Object,el=(tl=Object.create(null),e=>{const t=Zo.call(e);return tl[t]||(tl[t]=t.slice(8,-1).toLowerCase())});var tl;const sl=e=>(e=e.toLowerCase(),t=>el(t)===e),il=e=>t=>typeof t===e,{isArray:nl}=Array,al=il("undefined");const rl=sl("ArrayBuffer");const ol=il("string"),ll=il("function"),cl=il("number"),ul=e=>null!==e&&"object"==typeof e,hl=e=>{if("object"!==el(e))return!1;const t=Qo(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},dl=sl("Date"),pl=sl("File"),ml=sl("Blob"),fl=sl("FileList"),vl=sl("URLSearchParams"),[gl,_l,bl,yl]=["ReadableStream","Request","Response","Headers"].map(sl);function $l(e,t,{allOwnKeys:s=!1}={}){if(null==e)return;let i,n;if("object"!=typeof e&&(e=[e]),nl(e))for(i=0,n=e.length;i0;)if(i=s[n],t===i.toLowerCase())return i;return null}const kl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cl=e=>!al(e)&&e!==kl;const xl=(Tl="undefined"!=typeof Uint8Array&&Qo(Uint8Array),e=>Tl&&e instanceof Tl);var Tl;const Sl=sl("HTMLFormElement"),Ol=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),El=sl("RegExp"),jl=(e,t)=>{const s=Object.getOwnPropertyDescriptors(e),i={};$l(s,((s,n)=>{let a;!1!==(a=t(s,n,e))&&(i[n]=a||s)})),Object.defineProperties(e,i)},Nl="abcdefghijklmnopqrstuvwxyz",Pl="0123456789",Al={DIGIT:Pl,ALPHA:Nl,ALPHA_DIGIT:Nl+Nl.toUpperCase()+Pl};const Il=sl("AsyncFunction"),Rl=(Dl="function"==typeof setImmediate,Fl=ll(kl.postMessage),Dl?setImmediate:Fl?((e,t)=>(kl.addEventListener("message",(({source:s,data:i})=>{s===kl&&i===e&&t.length&&t.shift()()}),!1),s=>{t.push(s),kl.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Dl,Fl;const Ll="undefined"!=typeof queueMicrotask?queueMicrotask.bind(kl):"undefined"!=typeof process&&process.nextTick||Rl,Hl={isArray:nl,isArrayBuffer:rl,isBuffer:function(e){return null!==e&&!al(e)&&null!==e.constructor&&!al(e.constructor)&&ll(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ll(e.append)&&("formdata"===(t=el(e))||"object"===t&&ll(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&rl(e.buffer),t},isString:ol,isNumber:cl,isBoolean:e=>!0===e||!1===e,isObject:ul,isPlainObject:hl,isReadableStream:gl,isRequest:_l,isResponse:bl,isHeaders:yl,isUndefined:al,isDate:dl,isFile:pl,isBlob:ml,isRegExp:El,isFunction:ll,isStream:e=>ul(e)&&ll(e.pipe),isURLSearchParams:vl,isTypedArray:xl,isFileList:fl,forEach:$l,merge:function e(){const{caseless:t}=Cl(this)&&this||{},s={},i=(i,n)=>{const a=t&&wl(s,n)||n;hl(s[a])&&hl(i)?s[a]=e(s[a],i):hl(i)?s[a]=e({},i):nl(i)?s[a]=i.slice():s[a]=i};for(let e=0,t=arguments.length;e($l(t,((t,i)=>{s&&ll(t)?e[i]=Xo(t,s):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,s,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},toFlatObject:(e,t,s,i)=>{let n,a,r;const o={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)r=n[a],i&&!i(r,e,t)||o[r]||(t[r]=e[r],o[r]=!0);e=!1!==s&&Qo(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},kindOf:el,kindOfTest:sl,endsWith:(e,t,s)=>{e=String(e),(void 0===s||s>e.length)&&(s=e.length),s-=t.length;const i=e.indexOf(t,s);return-1!==i&&i===s},toArray:e=>{if(!e)return null;if(nl(e))return e;let t=e.length;if(!cl(t))return null;const s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},forEachEntry:(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=s.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},matchAll:(e,t)=>{let s;const i=[];for(;null!==(s=e.exec(t));)i.push(s);return i},isHTMLForm:Sl,hasOwnProperty:Ol,hasOwnProp:Ol,reduceDescriptors:jl,freezeMethods:e=>{jl(e,((t,s)=>{if(ll(e)&&-1!==["arguments","caller","callee"].indexOf(s))return!1;const i=e[s];ll(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")}))}))},toObjectSet:(e,t)=>{const s={},i=e=>{e.forEach((e=>{s[e]=!0}))};return nl(e)?i(e):i(String(e).split(t)),s},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,s){return t.toUpperCase()+s})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:wl,global:kl,isContextDefined:Cl,ALPHABET:Al,generateString:(e=16,t=Al.ALPHA_DIGIT)=>{let s="";const{length:i}=t;for(;e--;)s+=t[Math.random()*i|0];return s},isSpecCompliantForm:function(e){return!!(e&&ll(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),s=(e,i)=>{if(ul(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[i]=e;const n=nl(e)?[]:{};return $l(e,((e,t)=>{const a=s(e,i+1);!al(a)&&(n[t]=a)})),t[i]=void 0,n}}return e};return s(e,0)},isAsyncFn:Il,isThenable:e=>e&&(ul(e)||ll(e))&&ll(e.then)&&ll(e.catch),setImmediate:Rl,asap:Ll};function Ul(e,t,s,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}Hl.inherits(Ul,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Hl.toJSONObject(this.config),code:this.code,status:this.status}}});const Ml=Ul.prototype,Bl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Bl[e]={value:e}})),Object.defineProperties(Ul,Bl),Object.defineProperty(Ml,"isAxiosError",{value:!0}),Ul.from=(e,t,s,i,n,a)=>{const r=Object.create(Ml);return Hl.toFlatObject(e,r,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Ul.call(r,e.message,t,s,i,n),r.cause=e,r.name=e.name,a&&Object.assign(r,a),r};const zl=Ul;function Vl(e){return Hl.isPlainObject(e)||Hl.isArray(e)}function Gl(e){return Hl.endsWith(e,"[]")?e.slice(0,-2):e}function Kl(e,t,s){return e?e.concat(t).map((function(e,t){return e=Gl(e),!s&&t?"["+e+"]":e})).join(s?".":""):t}const ql=Hl.toFlatObject(Hl,{},null,(function(e){return/^is[A-Z]/.test(e)}));const Jl=function(e,t,s){if(!Hl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(s=Hl.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Hl.isUndefined(t[e])}))).metaTokens,n=s.visitor||c,a=s.dots,r=s.indexes,o=(s.Blob||"undefined"!=typeof Blob&&Blob)&&Hl.isSpecCompliantForm(t);if(!Hl.isFunction(n))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Hl.isDate(e))return e.toISOString();if(!o&&Hl.isBlob(e))throw new zl("Blob is not supported. Use a Buffer instead.");return Hl.isArrayBuffer(e)||Hl.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,s,n){let o=e;if(e&&!n&&"object"==typeof e)if(Hl.endsWith(s,"{}"))s=i?s:s.slice(0,-2),e=JSON.stringify(e);else if(Hl.isArray(e)&&function(e){return Hl.isArray(e)&&!e.some(Vl)}(e)||(Hl.isFileList(e)||Hl.endsWith(s,"[]"))&&(o=Hl.toArray(e)))return s=Gl(s),o.forEach((function(e,i){!Hl.isUndefined(e)&&null!==e&&t.append(!0===r?Kl([s],i,a):null===r?s:s+"[]",l(e))})),!1;return!!Vl(e)||(t.append(Kl(n,s,a),l(e)),!1)}const u=[],h=Object.assign(ql,{defaultVisitor:c,convertValue:l,isVisitable:Vl});if(!Hl.isObject(e))throw new TypeError("data must be an object");return function e(s,i){if(!Hl.isUndefined(s)){if(-1!==u.indexOf(s))throw Error("Circular reference detected in "+i.join("."));u.push(s),Hl.forEach(s,(function(s,a){!0===(!(Hl.isUndefined(s)||null===s)&&n.call(t,s,Hl.isString(a)?a.trim():a,i,h))&&e(s,i?i.concat(a):[a])})),u.pop()}}(e),t};function Wl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Yl(e,t){this._pairs=[],e&&Jl(e,this,t)}const Xl=Yl.prototype;Xl.append=function(e,t){this._pairs.push([e,t])},Xl.toString=function(e){const t=e?function(t){return e.call(this,t,Wl)}:Wl;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Zl=Yl;function Ql(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ec(e,t,s){if(!t)return e;const i=s&&s.encode||Ql,n=s&&s.serialize;let a;if(a=n?n(t,s):Hl.isURLSearchParams(t)?t.toString():new Zl(t,s).toString(i),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}const tc=class{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!s&&s.synchronous,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Hl.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},sc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ic={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zl,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nc="undefined"!=typeof window&&"undefined"!=typeof document,ac="object"==typeof navigator&&navigator||void 0,rc=nc&&(!ac||["ReactNative","NativeScript","NS"].indexOf(ac.product)<0),oc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,lc=nc&&window.location.href||"http://localhost",cc={...i,...ic};const uc=function(e){function t(e,s,i,n){let a=e[n++];if("__proto__"===a)return!0;const r=Number.isFinite(+a),o=n>=e.length;if(a=!a&&Hl.isArray(i)?i.length:a,o)return Hl.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!r;i[a]&&Hl.isObject(i[a])||(i[a]=[]);return t(e,s,i[a],n)&&Hl.isArray(i[a])&&(i[a]=function(e){const t={},s=Object.keys(e);let i;const n=s.length;let a;for(i=0;i{t(function(e){return Hl.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,s,0)})),s}return null};const hc={transitional:sc,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",i=s.indexOf("application/json")>-1,n=Hl.isObject(e);n&&Hl.isHTMLForm(e)&&(e=new FormData(e));if(Hl.isFormData(e))return i?JSON.stringify(uc(e)):e;if(Hl.isArrayBuffer(e)||Hl.isBuffer(e)||Hl.isStream(e)||Hl.isFile(e)||Hl.isBlob(e)||Hl.isReadableStream(e))return e;if(Hl.isArrayBufferView(e))return e.buffer;if(Hl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Jl(e,new cc.classes.URLSearchParams,Object.assign({visitor:function(e,t,s,i){return cc.isNode&&Hl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Hl.isFileList(e))||s.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Jl(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),function(e,t,s){if(Hl.isString(e))try{return(t||JSON.parse)(e),Hl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(s||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||hc.transitional,s=t&&t.forcedJSONParsing,i="json"===this.responseType;if(Hl.isResponse(e)||Hl.isReadableStream(e))return e;if(e&&Hl.isString(e)&&(s&&!this.responseType||i)){const s=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw zl.from(e,zl.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cc.classes.FormData,Blob:cc.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Hl.forEach(["delete","get","head","post","put","patch"],(e=>{hc.headers[e]={}}));const dc=hc,pc=Hl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mc=Symbol("internals");function fc(e){return e&&String(e).trim().toLowerCase()}function vc(e){return!1===e||null==e?e:Hl.isArray(e)?e.map(vc):String(e)}function gc(e,t,s,i,n){return Hl.isFunction(i)?i.call(this,t,s):(n&&(t=s),Hl.isString(t)?Hl.isString(i)?-1!==t.indexOf(i):Hl.isRegExp(i)?i.test(t):void 0:void 0)}class _c{constructor(e){e&&this.set(e)}set(e,t,s){const i=this;function n(e,t,s){const n=fc(t);if(!n)throw new Error("header name must be a non-empty string");const a=Hl.findKey(i,n);(!a||void 0===i[a]||!0===s||void 0===s&&!1!==i[a])&&(i[a||t]=vc(e))}const a=(e,t)=>Hl.forEach(e,((e,s)=>n(e,s,t)));if(Hl.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Hl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let s,i,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),s=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!s||t[s]&&pc[s]||("set-cookie"===s?t[s]?t[s].push(i):t[s]=[i]:t[s]=t[s]?t[s]+", "+i:i)})),t})(e),t);else if(Hl.isHeaders(e))for(const[t,i]of e.entries())n(i,t,s);else null!=e&&n(t,e,s);return this}get(e,t){if(e=fc(e)){const s=Hl.findKey(this,e);if(s){const e=this[s];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=s.exec(e);)t[i[1]]=i[2];return t}(e);if(Hl.isFunction(t))return t.call(this,e,s);if(Hl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=fc(e)){const s=Hl.findKey(this,e);return!(!s||void 0===this[s]||t&&!gc(0,this[s],s,t))}return!1}delete(e,t){const s=this;let i=!1;function n(e){if(e=fc(e)){const n=Hl.findKey(s,e);!n||t&&!gc(0,s[n],n,t)||(delete s[n],i=!0)}}return Hl.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let s=t.length,i=!1;for(;s--;){const n=t[s];e&&!gc(0,this[n],n,e,!0)||(delete this[n],i=!0)}return i}normalize(e){const t=this,s={};return Hl.forEach(this,((i,n)=>{const a=Hl.findKey(s,n);if(a)return t[a]=vc(i),void delete t[n];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,s)=>t.toUpperCase()+s))}(n):String(n).trim();r!==n&&delete t[n],t[r]=vc(i),s[r]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Hl.forEach(this,((s,i)=>{null!=s&&!1!==s&&(t[i]=e&&Hl.isArray(s)?s.join(", "):s)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach((e=>s.set(e))),s}static accessor(e){const t=(this[mc]=this[mc]={accessors:{}}).accessors,s=this.prototype;function i(e){const i=fc(e);t[i]||(!function(e,t){const s=Hl.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+s,{value:function(e,s,n){return this[i].call(this,t,e,s,n)},configurable:!0})}))}(s,e),t[i]=!0)}return Hl.isArray(e)?e.forEach(i):i(e),this}}_c.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Hl.reduceDescriptors(_c.prototype,(({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[s]=e}}})),Hl.freezeMethods(_c);const bc=_c;function yc(e,t){const s=this||dc,i=t||s,n=bc.from(i.headers);let a=i.data;return Hl.forEach(e,(function(e){a=e.call(s,a,n.normalize(),t?t.status:void 0)})),n.normalize(),a}function $c(e){return!(!e||!e.__CANCEL__)}function wc(e,t,s){zl.call(this,null==e?"canceled":e,zl.ERR_CANCELED,t,s),this.name="CanceledError"}Hl.inherits(wc,zl,{__CANCEL__:!0});const kc=wc;function Cc(e,t,s){const i=s.config.validateStatus;s.status&&i&&!i(s.status)?t(new zl("Request failed with status code "+s.status,[zl.ERR_BAD_REQUEST,zl.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s)):e(s)}const xc=function(e,t){e=e||10;const s=new Array(e),i=new Array(e);let n,a=0,r=0;return t=void 0!==t?t:1e3,function(o){const l=Date.now(),c=i[r];n||(n=l),s[a]=o,i[a]=l;let u=r,h=0;for(;u!==a;)h+=s[u++],u%=e;if(a=(a+1)%e,a===r&&(r=(r+1)%e),l-n{n=a,s=null,i&&(clearTimeout(i),i=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),o=t-n;o>=a?r(e,t):(s=e,i||(i=setTimeout((()=>{i=null,r(s)}),a-o)))},()=>s&&r(s)]},Sc=(e,t,s=3)=>{let i=0;const n=xc(50,250);return Tc((s=>{const a=s.loaded,r=s.lengthComputable?s.total:void 0,o=a-i,l=n(o);i=a;e({loaded:a,total:r,progress:r?a/r:void 0,bytes:o,rate:l||void 0,estimated:l&&r&&a<=r?(r-a)/l:void 0,event:s,lengthComputable:null!=r,[t?"download":"upload"]:!0})}),s)},Oc=(e,t)=>{const s=null!=e;return[i=>t[0]({lengthComputable:s,total:e,loaded:i}),t[1]]},Ec=e=>(...t)=>Hl.asap((()=>e(...t))),jc=cc.hasStandardBrowserEnv?function(){const e=cc.navigator&&/(msie|trident)/i.test(cc.navigator.userAgent),t=document.createElement("a");let s;function i(s){let i=s;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return s=i(window.location.href),function(e){const t=Hl.isString(e)?i(e):e;return t.protocol===s.protocol&&t.host===s.host}}():function(){return!0},Nc=cc.hasStandardBrowserEnv?{write(e,t,s,i,n,a){const r=[e+"="+encodeURIComponent(t)];Hl.isNumber(s)&&r.push("expires="+new Date(s).toGMTString()),Hl.isString(i)&&r.push("path="+i),Hl.isString(n)&&r.push("domain="+n),!0===a&&r.push("secure"),document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Pc(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ac=e=>e instanceof bc?{...e}:e;function Ic(e,t){t=t||{};const s={};function i(e,t,s){return Hl.isPlainObject(e)&&Hl.isPlainObject(t)?Hl.merge.call({caseless:s},e,t):Hl.isPlainObject(t)?Hl.merge({},t):Hl.isArray(t)?t.slice():t}function n(e,t,s){return Hl.isUndefined(t)?Hl.isUndefined(e)?void 0:i(void 0,e,s):i(e,t,s)}function a(e,t){if(!Hl.isUndefined(t))return i(void 0,t)}function r(e,t){return Hl.isUndefined(t)?Hl.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function o(s,n,a){return a in t?i(s,n):a in e?i(void 0,s):void 0}const l={url:a,method:a,data:a,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:o,headers:(e,t)=>n(Ac(e),Ac(t),!0)};return Hl.forEach(Object.keys(Object.assign({},e,t)),(function(i){const a=l[i]||n,r=a(e[i],t[i],i);Hl.isUndefined(r)&&a!==o||(s[i]=r)})),s}const Rc=e=>{const t=Ic({},e);let s,{data:i,withXSRFToken:n,xsrfHeaderName:a,xsrfCookieName:r,headers:o,auth:l}=t;if(t.headers=o=bc.from(o),t.url=ec(Pc(t.baseURL,t.url),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Hl.isFormData(i))if(cc.hasStandardBrowserEnv||cc.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(!1!==(s=o.getContentType())){const[e,...t]=s?s.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}if(cc.hasStandardBrowserEnv&&(n&&Hl.isFunction(n)&&(n=n(t)),n||!1!==n&&jc(t.url))){const e=a&&r&&Nc.read(r);e&&o.set(a,e)}return t},Dc="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,s){const i=Rc(e);let n=i.data;const a=bc.from(i.headers).normalize();let r,o,l,c,u,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=i;function m(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(r),i.signal&&i.signal.removeEventListener("abort",r)}let f=new XMLHttpRequest;function v(){if(!f)return;const i=bc.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());Cc((function(e){t(e),m()}),(function(e){s(e),m()}),{data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:i,config:e,request:f}),f=null}f.open(i.method.toUpperCase(),i.url,!0),f.timeout=i.timeout,"onloadend"in f?f.onloadend=v:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(v)},f.onabort=function(){f&&(s(new zl("Request aborted",zl.ECONNABORTED,e,f)),f=null)},f.onerror=function(){s(new zl("Network Error",zl.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const n=i.transitional||sc;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),s(new zl(t,n.clarifyTimeoutError?zl.ETIMEDOUT:zl.ECONNABORTED,e,f)),f=null},void 0===n&&a.setContentType(null),"setRequestHeader"in f&&Hl.forEach(a.toJSON(),(function(e,t){f.setRequestHeader(t,e)})),Hl.isUndefined(i.withCredentials)||(f.withCredentials=!!i.withCredentials),h&&"json"!==h&&(f.responseType=i.responseType),p&&([l,u]=Sc(p,!0),f.addEventListener("progress",l)),d&&f.upload&&([o,c]=Sc(d),f.upload.addEventListener("progress",o),f.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(r=t=>{f&&(s(!t||t.type?new kc(null,e,f):t),f.abort(),f=null)},i.cancelToken&&i.cancelToken.subscribe(r),i.signal&&(i.signal.aborted?r():i.signal.addEventListener("abort",r)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);g&&-1===cc.protocols.indexOf(g)?s(new zl("Unsupported protocol "+g+":",zl.ERR_BAD_REQUEST,e)):f.send(n||null)}))},Fc=(e,t)=>{const{length:s}=e=e?e.filter(Boolean):[];if(t||s){let s,i=new AbortController;const n=function(e){if(!s){s=!0,r();const t=e instanceof Error?e:this.reason;i.abort(t instanceof zl?t:new kc(t instanceof Error?t.message:t))}};let a=t&&setTimeout((()=>{a=null,n(new zl(`timeout ${t} of ms exceeded`,zl.ETIMEDOUT))}),t);const r=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)})),e=null)};e.forEach((e=>e.addEventListener("abort",n)));const{signal:o}=i;return o.unsubscribe=()=>Hl.asap(r),o}},Lc=function*(e,t){let s=e.byteLength;if(!t||s{const n=async function*(e,t){for await(const s of Hc(e))yield*Lc(s,t)}(e,t);let a,r=0,o=e=>{a||(a=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await n.next();if(t)return o(),void e.close();let a=i.byteLength;if(s){let e=r+=a;s(e)}e.enqueue(new Uint8Array(i))}catch(e){throw o(e),e}},cancel:e=>(o(e),n.return())},{highWaterMark:2})},Mc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Bc=Mc&&"function"==typeof ReadableStream,zc=Mc&&("function"==typeof TextEncoder?(Vc=new TextEncoder,e=>Vc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Vc;const Gc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Kc=Bc&&Gc((()=>{let e=!1;const t=new Request(cc.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),qc=Bc&&Gc((()=>Hl.isReadableStream(new Response("").body))),Jc={stream:qc&&(e=>e.body)};var Wc;Mc&&(Wc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Jc[e]&&(Jc[e]=Hl.isFunction(Wc[e])?t=>t[e]():(t,s)=>{throw new zl(`Response type '${e}' is not supported`,zl.ERR_NOT_SUPPORT,s)})})));const Yc=async(e,t)=>{const s=Hl.toFiniteNumber(e.getContentLength());return null==s?(async e=>{if(null==e)return 0;if(Hl.isBlob(e))return e.size;if(Hl.isSpecCompliantForm(e)){const t=new Request(cc.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Hl.isArrayBufferView(e)||Hl.isArrayBuffer(e)?e.byteLength:(Hl.isURLSearchParams(e)&&(e+=""),Hl.isString(e)?(await zc(e)).byteLength:void 0)})(t):s},Xc=Mc&&(async e=>{let{url:t,method:s,data:i,signal:n,cancelToken:a,timeout:r,onDownloadProgress:o,onUploadProgress:l,responseType:c,headers:u,withCredentials:h="same-origin",fetchOptions:d}=Rc(e);c=c?(c+"").toLowerCase():"text";let p,m=Fc([n,a&&a.toAbortSignal()],r);const f=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let v;try{if(l&&Kc&&"get"!==s&&"head"!==s&&0!==(v=await Yc(u,i))){let e,s=new Request(t,{method:"POST",body:i,duplex:"half"});if(Hl.isFormData(i)&&(e=s.headers.get("content-type"))&&u.setContentType(e),s.body){const[e,t]=Oc(v,Sc(Ec(l)));i=Uc(s.body,65536,e,t)}}Hl.isString(h)||(h=h?"include":"omit");const n="credentials"in Request.prototype;p=new Request(t,{...d,signal:m,method:s.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:n?h:void 0});let a=await fetch(p);const r=qc&&("stream"===c||"response"===c);if(qc&&(o||r&&f)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=a[t]}));const t=Hl.toFiniteNumber(a.headers.get("content-length")),[s,i]=o&&Oc(t,Sc(Ec(o),!0))||[];a=new Response(Uc(a.body,65536,s,(()=>{i&&i(),f&&f()})),e)}c=c||"text";let g=await Jc[Hl.findKey(Jc,c)||"text"](a,e);return!r&&f&&f(),await new Promise(((t,s)=>{Cc(t,s,{data:g,headers:bc.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:p})}))}catch(t){if(f&&f(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new zl("Network Error",zl.ERR_NETWORK,e,p),{cause:t.cause||t});throw zl.from(t,t&&t.code,e,p)}}),Zc={http:null,xhr:Dc,fetch:Xc};Hl.forEach(Zc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Qc=e=>`- ${e}`,eu=e=>Hl.isFunction(e)||null===e||!1===e,tu=e=>{e=Hl.isArray(e)?e:[e];const{length:t}=e;let s,i;const n={};for(let a=0;a`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let s=t?e.length>1?"since :\n"+e.map(Qc).join("\n"):" "+Qc(e[0]):"as no adapter specified";throw new zl("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i};function su(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new kc(null,e)}function iu(e){su(e),e.headers=bc.from(e.headers),e.data=yc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tu(e.adapter||dc.adapter)(e).then((function(t){return su(e),t.data=yc.call(e,e.transformResponse,t),t.headers=bc.from(t.headers),t}),(function(t){return $c(t)||(su(e),t&&t.response&&(t.response.data=yc.call(e,e.transformResponse,t.response),t.response.headers=bc.from(t.response.headers))),Promise.reject(t)}))}const nu="1.7.7",au={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{au[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}}));const ru={};au.transitional=function(e,t,s){function i(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(s?". "+s:"")}return(s,n,a)=>{if(!1===e)throw new zl(i(n," has been removed"+(t?" in "+t:"")),zl.ERR_DEPRECATED);return t&&!ru[n]&&(ru[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(s,n,a)}};const ou={assertOptions:function(e,t,s){if("object"!=typeof e)throw new zl("options must be an object",zl.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const a=i[n],r=t[a];if(r){const t=e[a],s=void 0===t||r(t,a,e);if(!0!==s)throw new zl("option "+a+" must be "+s,zl.ERR_BAD_OPTION_VALUE)}else if(!0!==s)throw new zl("Unknown option "+a,zl.ERR_BAD_OPTION)}},validators:au},lu=ou.validators;class cu{constructor(e){this.defaults=e,this.interceptors={request:new tc,response:new tc}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const s=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?s&&!String(e.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+s):e.stack=s}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ic(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:n}=t;void 0!==s&&ou.assertOptions(s,{silentJSONParsing:lu.transitional(lu.boolean),forcedJSONParsing:lu.transitional(lu.boolean),clarifyTimeoutError:lu.transitional(lu.boolean)},!1),null!=i&&(Hl.isFunction(i)?t.paramsSerializer={serialize:i}:ou.assertOptions(i,{encode:lu.function,serialize:lu.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&Hl.merge(n.common,n[t.method]);n&&Hl.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=bc.concat(a,n);const r=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,h=0;if(!o){const e=[iu.bind(this),void 0];for(e.unshift.apply(e,r),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);h{if(!s._listeners)return;let t=s._listeners.length;for(;t-- >0;)s._listeners[t](e);s._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{s.subscribe(e),t=e})).then(e);return i.cancel=function(){s.unsubscribe(t)},i},e((function(e,i,n){s.reason||(s.reason=new kc(e,i,n),t(s.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new hu((function(t){e=t})),cancel:e}}}const du=hu;const pu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pu).forEach((([e,t])=>{pu[t]=e}));const mu=pu;const fu=function e(t){const s=new uu(t),i=Xo(uu.prototype.request,s);return Hl.extend(i,uu.prototype,s,{allOwnKeys:!0}),Hl.extend(i,s,null,{allOwnKeys:!0}),i.create=function(s){return e(Ic(t,s))},i}(dc);fu.Axios=uu,fu.CanceledError=kc,fu.CancelToken=du,fu.isCancel=$c,fu.VERSION=nu,fu.toFormData=Jl,fu.AxiosError=zl,fu.Cancel=fu.CanceledError,fu.all=function(e){return Promise.all(e)},fu.spread=function(e){return function(t){return e.apply(null,t)}},fu.isAxiosError=function(e){return Hl.isObject(e)&&!0===e.isAxiosError},fu.mergeConfig=Ic,fu.AxiosHeaders=bc,fu.formToJSON=e=>uc(Hl.isHTMLForm(e)?new FormData(e):e),fu.getAdapter=tu,fu.HttpStatusCode=mu,fu.default=fu;const vu=fu,gu={address:Oa.base_url.replace("http","ws")+"/elecV2P",trynum:0,trying:!1,reconnectnum:5,reconnectgap:10,wsrecv:{connected:!1,add(e,t){if(e&&"function"==typeof t)return this.lists[e]?this.lists[e].push(t):(this.lists[e]=[t],this.id&&function(e){if(gu.wsrecv.send)gu.wsrecv.send("ready",e);else{const t={times:5,gap:3};t.tmpInt=setInterval((()=>{gu.wsrecv.send?(gu.wsrecv.send("ready",e),clearInterval(t.tmpInt),delete t.tmpInt):t.times<=0?(console.debug("wsrecv no send method yet"),clearInterval(t.tmpInt),delete t.tmpInt):t.times--}),1e3*t.gap)}}(e)),this.connected?void 0:"websocket "+lr("disconnected");console.error("websocket recver and a callbak function is expect")},dispatch(e,t){this.lists.minishell&&this.lists.minishell.forEach((s=>s({type:e,data:t}))),"minishell"!==e&&this.lists[e]?this.lists[e].forEach((e=>e(t))):this.lists.minishell||console.debug("there are no recver",e,"to render data",t)},lists:{},connect(){_u()}},upstatus(e){this.wsrecv.lists.elecV2Pstatus&&this.wsrecv.lists.elecV2Pstatus.forEach((t=>t({clients:e})))}};async function _u(){if(gu.trynum++,gu.wsrecv.connected)return void console.log(`[${Ba("websocket info")}][${Ha(null,1)}] websocket ${lr("connected")}`);if(gu.trying)return void console.log(`[${Ba("websocket info")}][${Ha(null,1)}] websocket is trying to connect...`);console.log(`[${Ba("websocket info")}][${Ha(null,1)}] 第 ${gu.trynum} 次尝试 websocket 连接中`),gu.upstatus(`第 ${gu.trynum} 次尝试连接中`);const e=new WebSocket(gu.address);gu.trying=!0,e.onopen=()=>{console.log(`[${Ba("websocket info")}][${Ha(null,1)}] WebSocket connected: ${gu.address}`),oo({off:!1}),gu.trynum=0,gu.trying=!1,gu.wsrecv.connected=!0,gu.upstatus(lr("connected")),gu.wsrecv.send=(t,s)=>{e.send(JSON.stringify({type:t,data:s,id:gu.wsrecv.id}))}},e.onmessage=e=>{try{e=JSON.parse(e.data),gu.wsrecv.dispatch(e.type,e.data)}catch(e){console.error("websocket data error:",e)}},e.onclose=e=>{console.error("WebSocket closed",e),gu.wsrecv.connected=!1,1008===e.code||4003===e.code?(gu.upstatus("无访问权限"),gu.wsrecv.dispatch("message",{type:"error",data:[`websocket 连接失败\n${e.reason}`]})):(gu.upstatus(lr("disconnected")),function(){if(gu.trynum>=gu.reconnectnum){let e="连接失败,请检查网络后尝试刷新页面";return console.error(`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`),gu.upstatus(e),gu.wsrecv.dispatch("tasklog",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`),void gu.wsrecv.dispatch("jsmanage",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${e}`)}oo();const e=gu.reconnectgap*gu.trynum+5;console.log(`[${Ba("websocket info")}][${Ha(null,1)}] 客户端将在 ${e} 秒后尝试第 ${gu.trynum+1}/${gu.reconnectnum} 次重连`),gu.upstatus(`${lr("disconnected")},${e} 秒后尝试第 ${gu.trynum+1}/${gu.reconnectnum} 次重连 ${Ha().split(" ").pop()}`),gu.wsrecv.dispatch("tasklog",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${lr("disconnected")},将在 ${e} 秒后尝试重连(如果不是手动断开或网络问题,可能是某个脚本运行出错,导致 elecV2P 重启,请根据 errors.log 和当前时间,找到相应脚本进行修改)`),gu.wsrecv.dispatch("jsmanage",`[${Ba("websocket error")}][${Ha(null,1)}] websocket ${lr("disconnected")},将在 ${e} 秒后尝试重连(如果不是手动断开或网络问题,可能是某个脚本运行出错,导致 elecV2P 重启,请根据 errors.log 和当前时间,找到相应脚本进行修改)`),setTimeout((()=>{_u()}),1e3*e)}())},e.onerror=e=>{console.debug("WebSocket error",e),gu.trying=!1,gu.wsrecv.connected=!1}}gu.wsrecv.add("init",(e=>{e.secunset&&!Lr.get("secunset")&&(gu.wsrecv.dispatch("message",{type:"success",data:["当前 webUI 端口所有用户可访问,如部署在公网\n请务必前往 SETTING/设置 界面打开安全访问",{url:"#setting",secd:0}]}),console.log(`[${Ba("elecV2P notify")}][${Ha(null,1)}] 当前 webUI 端口所有用户可访问,如部署在公网请务必前往 SETTING/设置 界面打开安全访问`),Lr.set("secunset","true")),e.vernum?(gu.wsrecv.id=e.id,Object.keys(gu.wsrecv.lists).forEach((e=>{gu.wsrecv.send("ready",e),"jsmanage"!==e&&"tasklog"!==e||gu.wsrecv.lists[e].forEach((e=>e(`[${Ba("websocket info")}][${Ha(null,1)}] websocket ${lr("connected")}`)))})),console.log(`[${Ba("elecV2P info")}][${Ha(null,1)}] 当前 elecV2P 后台版本 ${e.version}`),console.log(`[${Ba("elecV2P info")}][${Ha(null,1)}] 当前 elecV2P webUI 版本 ${Oa.version}`),Oa.vernumco.evui(e),ti.prototype.$message=co.message,ti.prototype.$t=lr,ti.prototype.$ta=function(...e){const t=or[rr.locale]||or[rr.fallbackLocale],s=t.join_gap;return e.map((e=>t[e]||e)).join(s)},ti.config.productionTip=!1,new ti({el:"#app",render:e=>e(Yo)})})()})(); \ No newline at end of file diff --git a/web/dist/index.html b/web/dist/index.html index b1cef450..c3e7bb32 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -10,7 +10,7 @@ elecV2P - customize personal network - + diff --git a/webmodule.js b/webmodule.js index aac9ed16..70fada6f 100644 --- a/webmodule.js +++ b/webmodule.js @@ -3,6 +3,7 @@ const http = require('http') const path = require('path') const express = require('express') const compression = require('compression') +const { createProxyMiddleware } = require('http-proxy-middleware') const { CONFIG, CONFIG_Port } = require('./config') @@ -69,6 +70,14 @@ module.exports = () => { wbrun(app) wbeapp(app) + app.use(['/eproxy-logs', '/dist', '/latestLog', '/do-not-proxy', '/api/getInitData', '/fetchBody'], createProxyMiddleware({ + target: 'http://localhost:' + CONFIG_Port.webif, + changeOrigin: true, + logLevel: CONFIG.gloglevel || 'info', + pathRewrite: { + '^/eproxy-logs': '/', + }, + })) app.use((req, res, next) => { res.status(404).send(htmlTemplate(`

${req.method} ${req.originalUrl}

404, Not Found