w-dwdata-tweqod 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,6 +12,7 @@ A downloader for earthquake data from Taiwan CWA OpenData.
12
12
  To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-dwdata-tweqod/global.html).
13
13
 
14
14
  ## Installation
15
+
15
16
  ### Using npm(ES6 module):
16
17
  ```alias
17
18
  npm i w-dwdata-tweqod
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * w-dwdata-tweqod v1.0.30
2
+ * w-dwdata-tweqod v1.0.32
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("fs"),require("path"),require("crypto"),require("events"),require("chokidar"),require("url"),require("pino")):"function"==typeof define&&define.amd?define(["fs","path","crypto","events","chokidar","url","pino"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-dwdata-tweqod"]=t(e.fs,e.path,e.crypto,e.events,e.chokidar,e.url,e.pino)}(this,function(e,t,r,n,o,i,a){"use strict";var s="undefined"!=typeof document?document.currentScript:null,c=Array.isArray,u="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,f=u||l||Function("return this")(),d=f.Symbol,p=Object.prototype,h=p.hasOwnProperty,y=p.toString,m=d?d.toStringTag:void 0;var g=Object.prototype.toString;var v=d?d.toStringTag:void 0;function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?function(e){var t=h.call(e,m),r=e[m];try{e[m]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[m]=r:delete e[m]),o}(e):function(e){return g.call(e)}(e)}function w(e){return null!=e&&"object"==typeof e}function S(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}var _=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/;function j(e,t){if(c(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!S(e))||(O.test(e)||!_.test(e)||null!=t&&e in Object(t))}function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function R(e){if(!E(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var A,T=f["__core-js_shared__"],k=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var x=Function.prototype.toString;function C(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var $=/^\[object .+?Constructor\]$/,N=Function.prototype,D=Object.prototype,P=N.toString,F=D.hasOwnProperty,M=RegExp("^"+P.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L(e){return!(!E(e)||(t=e,k&&k in t))&&(R(e)?M:$).test(C(e));var t}function U(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return L(r)?r:void 0}var B=U(Object,"create");var I=Object.prototype.hasOwnProperty;var q=Object.prototype.hasOwnProperty;function z(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function H(e,t){return e===t||e!=e&&t!=t}function J(e,t){for(var r=e.length;r--;)if(H(e[r][0],t))return r;return-1}z.prototype.clear=function(){this.__data__=B?B(null):{},this.size=0},z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},z.prototype.get=function(e){var t=this.__data__;if(B){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return I.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return B?void 0!==t[e]:q.call(t,e)},z.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=B&&void 0===t?"__lodash_hash_undefined__":t,this};var Y=Array.prototype.splice;function W(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}W.prototype.clear=function(){this.__data__=[],this.size=0},W.prototype.delete=function(e){var t=this.__data__,r=J(t,e);return!(r<0)&&(r==t.length-1?t.pop():Y.call(t,r,1),--this.size,!0)},W.prototype.get=function(e){var t=this.__data__,r=J(t,e);return r<0?void 0:t[r][1]},W.prototype.has=function(e){return J(this.__data__,e)>-1},W.prototype.set=function(e,t){var r=this.__data__,n=J(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var V=U(f,"Map");function K(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function G(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}G.prototype.clear=function(){this.size=0,this.__data__={hash:new z,map:new(V||W),string:new z}},G.prototype.delete=function(e){var t=K(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return K(this,e).get(e)},G.prototype.has=function(e){return K(this,e).has(e)},G.prototype.set=function(e,t){var r=K(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Z(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Z.Cache||G),r}Z.Cache=G;var X,Q,ee,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=(X=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,function(e,r,n,o){t.push(n?o.replace(re,"$1"):r||e)}),t},Q=Z(X,function(e){return 500===ee.size&&ee.clear(),e}),ee=Q.cache,Q),oe=ne;function ie(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var ae=d?d.prototype:void 0,se=ae?ae.toString:void 0;function ce(e){if("string"==typeof e)return e;if(c(e))return ie(e,ce)+"";if(S(e))return se?se.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ue(e){return null==e?"":ce(e)}function le(e,t){return c(e)?e:j(e,t)?[e]:oe(ue(e))}function fe(e){if("string"==typeof e||S(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function de(e,t){for(var r=0,n=(t=le(t,e)).length;null!=e&&r<n;)e=e[fe(t[r++])];return r&&r==n?e:void 0}function pe(e,t,r){var n=null==e?void 0:de(e,t);return void 0===n?r:n}function he(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}var ye,me=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[ye?a:++n];if(!1===t(o[s],s,o))break}return e};function ge(e){return w(e)&&"[object Arguments]"==b(e)}var ve=Object.prototype,be=ve.hasOwnProperty,we=ve.propertyIsEnumerable,Se=ge(function(){return arguments}())?ge:function(e){return w(e)&&be.call(e,"callee")&&!we.call(e,"callee")},_e=Se;var Oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,Ee=je&&je.exports===Oe?f.Buffer:void 0,Re=(Ee?Ee.isBuffer:void 0)||function(){return!1},Ae=/^(?:0|[1-9]\d*)$/;function Te(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Ae.test(e))&&e>-1&&e%1==0&&e<t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var xe={};xe["[object Float32Array]"]=xe["[object Float64Array]"]=xe["[object Int8Array]"]=xe["[object Int16Array]"]=xe["[object Int32Array]"]=xe["[object Uint8Array]"]=xe["[object Uint8ClampedArray]"]=xe["[object Uint16Array]"]=xe["[object Uint32Array]"]=!0,xe["[object Arguments]"]=xe["[object Array]"]=xe["[object ArrayBuffer]"]=xe["[object Boolean]"]=xe["[object DataView]"]=xe["[object Date]"]=xe["[object Error]"]=xe["[object Function]"]=xe["[object Map]"]=xe["[object Number]"]=xe["[object Object]"]=xe["[object RegExp]"]=xe["[object Set]"]=xe["[object String]"]=xe["[object WeakMap]"]=!1;var Ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,$e=Ce&&"object"==typeof module&&module&&!module.nodeType&&module,Ne=$e&&$e.exports===Ce&&u.process,De=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||Ne&&Ne.binding&&Ne.binding("util")}catch(e){}}(),Pe=De&&De.isTypedArray,Fe=Pe?function(e){return function(t){return e(t)}}(Pe):function(e){return w(e)&&ke(e.length)&&!!xe[b(e)]},Me=Fe,Le=Object.prototype.hasOwnProperty;function Ue(e,t){var r=c(e),n=!r&&_e(e),o=!r&&!n&&Re(e),i=!r&&!n&&!o&&Me(e),a=r||n||o||i,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var l in e)!t&&!Le.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Te(l,u))||s.push(l);return s}var Be=Object.prototype;function Ie(e,t){return function(r){return e(t(r))}}var qe=Ie(Object.keys,Object),ze=Object.prototype.hasOwnProperty;function He(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||Be))return qe(e);var t,r,n=[];for(var o in Object(e))ze.call(e,o)&&"constructor"!=o&&n.push(o);return n}function Je(e){return null!=e&&ke(e.length)&&!R(e)}function Ye(e){return Je(e)?Ue(e):He(e)}var We=function(e,t){return function(r,n){if(null==r)return r;if(!Je(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(function(e,t){return e&&me(e,t,Ye)}),Ve=We;function Ke(e){return e}function Ge(e,t){var r;return(c(e)?he:Ve)(e,"function"==typeof(r=t)?r:Ke)}var Ze=Array.prototype.reverse;function Xe(e){return null==e?[]:function(e,t){return ie(t,function(t){return e[t]})}(e,Ye(e))}function Qe(e){return!0===(t=e)||!1===t||w(t)&&"[object Boolean]"==b(t);var t}function et(e){return"[object String]"===Object.prototype.toString.call(e)}function tt(e){return!(!et(e)||""===e)}var rt=/\s/;var nt=/^\s+/;function ot(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&rt.test(e.charAt(t)););return t}(e)+1).replace(nt,""):e}var it=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,st=/^0o[0-7]+$/i,ct=parseInt;function ut(e){if("number"==typeof e)return e;if(S(e))return NaN;if(E(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ot(e);var r=at.test(e);return r||st.test(e)?ct(e.slice(2),r?2:8):it.test(e)?NaN:+e}var lt=1/0;function ft(e){return e?(e=ut(e))===lt||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function dt(e){var t=ft(e),r=t%1;return t==t?r?t-r:t:0}function pt(e){return e!=e}function ht(e){let t=!1;if(tt(e))t=!isNaN(Number(e));else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(pt(e))return!1;t=!0}return t}function yt(e){if(!ht(e))return 0;return ft(e)}function mt(e){return!!ht(e)&&(e=yt(e),"number"==typeof(t=e)&&t==dt(t));var t}var gt=f.isFinite,vt=Math.min;var bt=function(e){var t=Math[e];return function(e,r){if(e=ut(e),(r=null==r?0:vt(dt(r),292))&&gt(e)){var n=(ue(e)+"e").split("e");return+((n=(ue(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}("round"),wt=bt;function St(e){if(!ht(e))return 0;e=yt(e);let t=wt(e);return"0"===String(t)?0:t}function _t(e){if(!mt(e))return!1;return St(e)>=0}function Ot(e){let t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}function jt(e){let t,r=Object.prototype.toString.call(e);if(t="[object Promise]"===r,t)return!0;if("[object Function]"!==r)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}function Et(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rt(e,t){return!!Et(e)&&(!(!tt(t)&&!ht(t))&&t in e)}function At(e,t,r){var n=null==e?0:e.length;return n?function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,(t=r||void 0===t?1:dt(t))<0?0:t,n):[]}function Tt(){let e,t,r=new Promise(function(){e=arguments[0],t=arguments[1]});return r.resolve=e,r.reject=t,r}function kt(e){return"[object Array]"===Object.prototype.toString.call(e)}function xt(e,t){let r=Tt();if(!kt(e)&&!Et(e))return r.reject("rs is not an array or object"),r;let n=!1;if(Et(e)){n=!0;let t=[];Ge(e,(e,r)=>{t.push({k:r,v:e})}),e=t}Ot(t)||(t=function(e){return e});let o=-1,i=[];return e.reduce(function(e,r){return e.then(function(e){i.push(e),o+=1;let a=o,s=r;return n&&(a=r.k,s=r.v),Ot(t)?t(s,a):s})},Promise.resolve()).then(function(e){i.push(e),i=At(i),r.resolve(i)}).catch(function(e){r.reject(e)}),r}function Ct(e,t={}){let r=pe(t,"fs");if(!r.existsSync(e))return!1;let n=r.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function $t(t){return Ct(t,{fs:e})}function Nt(e,t={}){let r=pe(t,"fs");return!!r.existsSync(e)&&(!r.lstatSync(e).isDirectory()&&!r.lstatSync(e).isSymbolicLink())}function Dt(e,t={}){let r=pe(t,"fs");if(Ct(e,{fs:r}))return{success:"input folder is already exists: "+e};if(r.existsSync(e))return{error:"input path already exists: "+e};try{r.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function Pt(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"useSync","");Qe(i)||(i=!0);let a="";return a=i?function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Nt(e,{fs:o}))return{error:`fpSrc[${e}] is not a file`};try{Dt(n.dirname(t),{fs:o}),o.copyFileSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}(e,t,{path:n,fs:o}):async function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Nt(e,{fs:o}))return{error:`fpSrc[${e}] is not a file`};let i=null;return await(async(e,t)=>{Dt(n.dirname(t),{fs:o}),await new Promise((r,n)=>{let i=o.createReadStream(e),a=o.createWriteStream(t);i.on("error",n),a.on("error",n),a.on("finish",r),i.pipe(a)})})(e,t).then(()=>{i={success:"done: "+t}}).catch(e=>{i={error:e}}),i}(e,t,{path:n,fs:o}),a}function Ft(r,n,o={}){return Pt(r,n,{path:t,fs:e,...o})}function Mt(r){return function(e,t={}){let r=pe(t,"path"),n=pe(t,"fs");if(!n.existsSync(e)){let t=Dt(e,{fs:n});return t.error?t.error:{success:"done: "+e}}if(!Ct(e,{fs:n}))return{error:"input path is not a folder"};try{let t=n.readdirSync(e);for(let o of t){let t=r.join(e,o);n.statSync(t).isDirectory()?n.rmSync(t,{recursive:!0,force:!0}):n.unlinkSync(t)}}catch(e){return{error:e}}return{success:"done: "+e}}(r,{path:t,fs:e})}function Lt(t){return Dt(t,{fs:e})}function Ut(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Ct(e,{fs:o}))return{error:`fpSrc[${e}] is not a folder`};try{o.readdirSync(e).forEach(function(r){let i=n.resolve(e,r),a=n.resolve(t,r),s=o.lstatSync(i);if(s.isDirectory())Dt(a,{fs:o}),Ut(i,a,{path:n,fs:o});else if(s.isSymbolicLink()){let e=o.readlinkSync(i);o.symlinkSync(e,a)}else Dt(n.dirname(a),{fs:o}),o.copyFileSync(i,a)})}catch(e){return{error:e}}return{success:"done: "+t}}function Bt(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"useSync","");Qe(i)||(i=!0);let a="";return a=i?Ut(e,t,{path:n,fs:o}):async function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Ct(e,{fs:o}))return{error:`fpSrc[${e}] is not a folder`};let i=async(e,t)=>{let r=o.readdirSync(e);for(let a of r){let r=n.join(e,a),s=n.join(t,a),c=o.lstatSync(r);if(c.isDirectory())Dt(s,{fs:o}),await i(r,s);else if(c.isSymbolicLink()){let e=o.readlinkSync(r);o.symlinkSync(e,s)}else Dt(n.dirname(s),{fs:o}),await new Promise((e,t)=>{let n=o.createReadStream(r),i=o.createWriteStream(s);n.on("error",t),i.on("error",t),i.on("finish",e),n.pipe(i)})}},a=null;return await i(e,t).then(()=>{a={success:"done: "+t}}).catch(e=>{a={error:e}}),a}(e,t,{path:n,fs:o}),a}function It(r,n,o={}){return Bt(r,n,{path:t,fs:e,...o})}function qt(e,t={}){let r=pe(t,"fs");if(!r.existsSync(e))return{success:"folder does not exist: "+e};if(!Ct(e,{fs:r}))return{error:"input path is not a folder: "+e};try{r.rmSync(e,{recursive:!0,force:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function zt(e){if(!mt(e))return!1;return St(e)>0}function Ht(e,t=1,r={}){let n=1,o=pe(r,"path"),i=pe(r,"fs");if(!Ct(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&zt(t)&&(t=St(t))<1&&(t=1),function e(r){let a=[];return Ct(r,{fs:i})?(Ge(i.readdirSync(r),function(s){let c=o.resolve(r,s),u=null;try{u=i.statSync(c)}catch(e){}u&&u.isDirectory()?(a.push({isFolder:!0,level:n,path:c,name:o.basename(c)}),n+=1,(n<=t||null===t)&&(a=a.concat(e(c))),n-=1):a.push({isFolder:!1,level:n,path:c,name:o.basename(c)})}),a):a}(e)}function Jt(r,n=1){return Ht(r,n,{path:t,fs:e})}function Yt(e,t={}){let r=pe(t,"fs"),n=pe(t,"crypto"),o=pe(t,"type","");tt(o)||(o="sha512");let i=Tt();if(!Nt(e,{fs:r}))return i.reject(`fp[${e}] is not a file`),i;try{let t=n.createHash(o),a=r.createReadStream(e);a.on("readable",()=>{let e=a.read();e?t.update(e):i.resolve(t.digest("hex"))}),a.on("error",e=>{i.reject(e.toString())})}catch(e){i.reject(e.toString())}return i}function Wt(e){var t=this.__data__=new W(e);this.size=t.size}Wt.prototype.clear=function(){this.__data__=new W,this.size=0},Wt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Wt.prototype.get=function(e){return this.__data__.get(e)},Wt.prototype.has=function(e){return this.__data__.has(e)},Wt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof W){var n=r.__data__;if(!V||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(e,t),this.size=r.size,this};function Vt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new G;++t<r;)this.add(e[t])}function Kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Gt(e,t){return e.has(t)}Vt.prototype.add=Vt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Vt.prototype.has=function(e){return this.__data__.has(e)};function Zt(e,t,r,n,o,i){var a=1&r,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,d=!0,p=2&r?new Vt:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var h=e[f],y=t[f];if(n)var m=a?n(y,h,f,t,e,i):n(h,y,f,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!Kt(t,function(e,t){if(!Gt(p,t)&&(h===e||o(h,e,r,n,i)))return p.push(t)})){d=!1;break}}else if(h!==y&&!o(h,y,r,n,i)){d=!1;break}}return i.delete(e),i.delete(t),d}var Xt=f.Uint8Array;function Qt(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function er(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var tr=d?d.prototype:void 0,rr=tr?tr.valueOf:void 0;function nr(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var or=Object.prototype.propertyIsEnumerable,ir=Object.getOwnPropertySymbols,ar=ir?function(e){return null==e?[]:(e=Object(e),nr(ir(e),function(t){return or.call(e,t)}))}:function(){return[]};function sr(e){return function(e,t,r){var n=t(e);return c(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Ye,ar)}var cr=Object.prototype.hasOwnProperty;var ur=U(f,"DataView"),lr=U(f,"Promise"),fr=U(f,"Set"),dr=U(f,"WeakMap"),pr="[object Map]",hr="[object Promise]",yr="[object Set]",mr="[object WeakMap]",gr="[object DataView]",vr=C(ur),br=C(V),wr=C(lr),Sr=C(fr),_r=C(dr),Or=b;(ur&&Or(new ur(new ArrayBuffer(1)))!=gr||V&&Or(new V)!=pr||lr&&Or(lr.resolve())!=hr||fr&&Or(new fr)!=yr||dr&&Or(new dr)!=mr)&&(Or=function(e){var t=b(e),r="[object Object]"==t?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case vr:return gr;case br:return pr;case wr:return hr;case Sr:return yr;case _r:return mr}return t});var jr=Or,Er="[object Arguments]",Rr="[object Array]",Ar="[object Object]",Tr=Object.prototype.hasOwnProperty;function kr(e,t,r,n,o,i){var a=c(e),s=c(t),u=a?Rr:jr(e),l=s?Rr:jr(t),f=(u=u==Er?Ar:u)==Ar,d=(l=l==Er?Ar:l)==Ar,p=u==l;if(p&&Re(e)){if(!Re(t))return!1;a=!0,f=!1}if(p&&!f)return i||(i=new Wt),a||Me(e)?Zt(e,t,r,n,o,i):function(e,t,r,n,o,i,a){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Xt(e),new Xt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return H(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Qt;case"[object Set]":var c=1&n;if(s||(s=er),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var l=Zt(s(e),s(t),n,o,i,a);return a.delete(e),l;case"[object Symbol]":if(rr)return rr.call(e)==rr.call(t)}return!1}(e,t,u,r,n,o,i);if(!(1&r)){var h=f&&Tr.call(e,"__wrapped__"),y=d&&Tr.call(t,"__wrapped__");if(h||y){var m=h?e.value():e,g=y?t.value():t;return i||(i=new Wt),o(m,g,r,n,i)}}return!!p&&(i||(i=new Wt),function(e,t,r,n,o,i){var a=1&r,s=sr(e),c=s.length;if(c!=sr(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:cr.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++u<c;){var y=e[l=s[u]],m=t[l];if(n)var g=a?n(m,y,l,t,e,i):n(y,m,l,e,t,i);if(!(void 0===g?y===m||o(y,m,r,n,i):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,r,n,o,i))}function xr(e,t,r,n,o){return e===t||(null==e||null==t||!w(e)&&!w(t)?e!=e&&t!=t:kr(e,t,r,n,xr,o))}function Cr(e){return e==e&&!E(e)}function $r(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function Nr(e){var t=function(e){for(var t=Ye(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,Cr(o)]}return t}(e);return 1==t.length&&t[0][2]?$r(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,n){var o=r.length,i=o,a=!n;if(null==e)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var c=(s=r[o])[0],u=e[c],l=s[1];if(a&&s[2]){if(void 0===u&&!(c in e))return!1}else{var f=new Wt;if(n)var d=n(u,l,c,e,t,f);if(!(void 0===d?xr(l,u,3,n,f):d))return!1}}return!0}(r,e,t)}}function Dr(e,t){return null!=e&&t in Object(e)}function Pr(e,t){return null!=e&&function(e,t,r){for(var n=-1,o=(t=le(t,e)).length,i=!1;++n<o;){var a=fe(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&ke(o)&&Te(a,o)&&(c(e)||_e(e))}(e,t,Dr)}function Fr(e){return function(t){return null==t?void 0:t[e]}}function Mr(e){return j(e)?Fr(fe(e)):function(e){return function(t){return de(t,e)}}(e)}function Lr(e){return"function"==typeof e?e:null==e?Ke:"object"==typeof e?c(e)?function(e,t){return j(e)&&Cr(t)?$r(fe(e),t):function(r){var n=pe(r,e);return void 0===n&&n===t?Pr(r,e):xr(t,n,3)}}(e[0],e[1]):Nr(e):Mr(e)}function Ur(e,t){var r=-1,n=Je(e)?Array(e.length):[];return Ve(e,function(e,o,i){n[++r]=t(e,o,i)}),n}function Br(e,t){return tt(e)&&_t(t)?0===(t=St(t))?e:function(e,t){if(!tt(e))return"";if(!_t(t))return"";if(0===(t=St(t)))return"";let r=e.length-t;return r<0&&(r=0),e.substring(r,r+t)}(e,e.length-t):""}function Ir(e,t){var r=[];return Ve(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r}function qr(e,t){return(c(e)?nr:Ir)(e,Lr(t))}function zr(e,t,r,n={}){let o=pe(n,"withInfor");Qe(o)||(o=!0);let i={del:[],add:[],same:[],diff:[]};if(!tt(r))return console.log("invalid key"),o&&(i.infor={}),i;kt(e)||(e=[e]),kt(t)||(t=[t]),e=qr(e,e=>Rt(e,r)),t=qr(t,e=>Rt(e,r));let a=new Map(t.map(e=>[e[r],e]));for(let t of e){let e=a.get(t[r]);if(e){JSON.stringify(t)===JSON.stringify(e)?i.same.push(e):i.diff.push(e),a.delete(t[r])}else i.del.push(t)}if(i.add=Array.from(a.values()),o){let e={};for(let t of i.del)e[t[r]]="del";for(let t of i.add)e[t[r]]="add";for(let t of i.diff)e[t[r]]="diff";for(let t of i.same)e[t[r]]="same";i.infor=e}return i}function Hr(e,t={}){let r=pe(t,"fs");if(!r.existsSync(e))return{success:"file does not exist: "+e};if(!Nt(e,{fs:r}))return{error:"input path is not a file: "+e};try{r.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}var Jr=Array.prototype.join;async function Yr(e,t={}){let r=pe(t,"path"),n=pe(t,"fs"),o=pe(t,"crypto"),i=pe(t,"type","");tt(i)||(i="md5");let a=[],s=Ht(e,null,{path:r,fs:n});var c,u;return await xt(s,async e=>{if(e.isFolder)return;let t=await Yt(e.path,{fs:n,crypto:o,type:i});a.push(t)}),u="|",null==(c=a)?"":Jr.call(c,u)}async function Wr(e,t=1,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"crypto"),a=pe(r,"type","");tt(a)||(a="md5");let s=pe(r,"forFile",null);Qe(s)||(s=!0);let c=pe(r,"forFolder",null);if(Qe(c)||(c=!1),!Ct(e,{fs:o}))throw new Error(`fd[${e}] is not a folder`);let u=Ht(e,t,{path:n,fs:o});return u=await xt(u,async e=>{let t="";return s&&!e.isFolder&&(t=await Yt(e.path,{fs:o,crypto:i,type:a})),c&&e.isFolder&&(t=await Yr(e.path,{path:n,fs:o,crypto:i,type:a})),e.hash=t,e}),u}async function Vr(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"crypto"),a=pe(r,"type","");if(tt(a)||(a="md5"),!Ct(e,{fs:o}))throw new Error(`fdSrc[${e}] is not a folder`);if(!Ct(t,{fs:o}))return void await Bt(e,t,{path:n,fs:o,useSync:!1});let s=n.sep,u=n.sep.length,l=(e,t)=>{let r=e.isFolder?"folder":"file",n=e.path.replace(t,"");var o,i;return i=u,(tt(o=n)&&_t(i)?0===(i=St(i))?"":o.substring(0,i):"")===s&&(n=Br(n,u)),n=n.replaceAll("\\","/"),{id:`${r}|${n}`,isFolder:e.isFolder,name:e.name,rpath:n,hash:e.hash}},f=(e,t)=>{var r,n;return n=e=>l(e,t),e=(c(r=e)?ie:Ur)(r,Lr(n))},d=await Wr(e,null,{path:n,fs:o,crypto:i,type:a,forFile:!0,forFolder:!1});d=f(d,n.resolve(e));let p=await Wr(t,null,{path:n,fs:o,crypto:i,type:a,forFile:!0,forFolder:!1});p=f(p,n.resolve(t));let h=zr(p,d,"id",{withInfor:!1});await xt(h.del,async e=>{if(e.isFolder){qt(n.resolve(t,e.rpath),{fs:o})}}),await xt(h.del,async e=>{if(!e.isFolder){Hr(n.resolve(t,e.rpath),{fs:o})}}),await xt([...h.add,...h.diff],async r=>{if(!r.isFolder){let i=n.resolve(e,r.rpath),a=n.resolve(t,r.rpath);await Pt(i,a,{path:n,fs:o,useSync:!1})}})}var Kr=Fr("length"),Gr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Zr="\\ud800-\\udfff",Xr="["+Zr+"]",Qr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",en="\\ud83c[\\udffb-\\udfff]",tn="[^"+Zr+"]",rn="(?:\\ud83c[\\udde6-\\uddff]){2}",nn="[\\ud800-\\udbff][\\udc00-\\udfff]",on="(?:"+Qr+"|"+en+")"+"?",an="[\\ufe0e\\ufe0f]?",sn=an+on+("(?:\\u200d(?:"+[tn,rn,nn].join("|")+")"+an+on+")*"),cn="(?:"+[tn+Qr+"?",Qr,rn,nn,Xr].join("|")+")",un=RegExp(en+"(?="+en+")|"+cn+sn,"g");function ln(e){return function(e){return Gr.test(e)}(e)?function(e){for(var t=un.lastIndex=0;un.test(e);)++t;return t}(e):Kr(e)}function fn(e){if(null==e)return 0;if(Je(e))return"string"==typeof(t=e)||!c(t)&&w(t)&&"[object String]"==b(t)?ln(e):e.length;var t,r=jr(e);return"[object Map]"==r||"[object Set]"==r?e.size:He(e).length}function dn(e){if(Et(e)){for(let t in e)return!0;return!1}return!1}var pn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function hn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var mn={exports:{}};var gn,vn={exports:{}},bn=yn(Object.freeze({__proto__:null,default:{}}));function wn(){return gn||(gn=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==pn&&pn.crypto&&(r=pn.crypto),!r)try{r=bn}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(o,f);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}});var h=i.algo={};return i}(Math),t)}(vn)),vn.exports}!function(e){e.exports=wn().enc.Utf8}(mn);var Sn=hn(mn.exports),_n={exports:{}};!function(e){var t;e.exports=(t=wn(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var o=[],i=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return r.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(_n);var On=hn(_n.exports);function jn(e){if(!tt(e))return"";let t=Sn.parse(e);return On.stringify(t)}var En={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},g=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},v={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),o=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(o,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),o=t.clone().add(n,u),i=r-o<0,a=t.clone().add(n+(i?-1:1),u);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:i,s:o,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=m;var S="$isDayjsObject",_=function(e){return e instanceof R||!(!e||!e[S])},O=function e(t,r,n){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;w[s]=t,o=s}return!n&&o&&(b=o),o||!n&&b},j=function(e,t){if(_(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new R(r)},E=v;E.l=O,E.i=_,E.w=function(e,t){return j(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var R=function(){function m(e){this.$L=O(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[S]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return E},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var r=j(e);return this.startOf(t)<=r&&r<=this.endOf(t)},g.isAfter=function(e,t){return j(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<j(e)},g.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var r=this,n=!!E.u(t)||t,l=E.p(e),p=function(e,t){var o=E.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?o:o.endOf(s)},h=function(e,t){return E.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},y=this.$W,m=this.$M,g=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case u:return n?p(1,m):p(0,m+1);case c:var b=this.$locale().weekStart||0,w=(y<b?y+7:y)-b;return p(n?g-w:g+(6-w),m);case s:case d:return h(v+"Hours",0);case a:return h(v+"Minutes",1);case i:return h(v+"Seconds",2);case o:return h(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var r,c=E.p(e),l="set"+(this.$u?"UTC":""),p=(r={},r[s]=l+"Date",r[d]=l+"Date",r[u]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[i]=l+"Minutes",r[o]=l+"Seconds",r[n]=l+"Milliseconds",r)[c],h=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var y=this.clone().set(d,1);y.$d[p](h),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[E.p(e)]()},g.add=function(n,l){var d,p=this;n=Number(n);var h=E.p(l),y=function(e){var t=j(p);return E.w(t.date(t.date()+Math.round(e*n)),p)};if(h===u)return this.set(u,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===s)return y(1);if(h===c)return y(7);var m=(d={},d[i]=t,d[a]=r,d[o]=e,d)[h]||1,g=this.$d.getTime()+n*m;return E.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,l=r.meridiem,f=function(e,r,o,i){return e&&(e[r]||e(t,n))||o[r].slice(0,i)},d=function(e){return E.s(i%12||12,e,"0")},h=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(y,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(i);case"HH":return E.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,p){var h,y=this,m=E.p(d),g=j(n),v=(g.utcOffset()-this.utcOffset())*t,b=this-g,w=function(){return E.m(y,g)};switch(m){case f:h=w()/12;break;case u:h=w();break;case l:h=w()/3;break;case c:h=(b-v)/6048e5;break;case s:h=(b-v)/864e5;break;case a:h=b/r;break;case i:h=b/t;break;case o:h=b/e;break;default:h=b}return p?h:E.a(h)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=O(e,t,!0);return n&&(r.$L=n),r},g.clone=function(){return E.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),A=R.prototype;return j.prototype=A,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach(function(e){A[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),j.extend=function(e,t){return e.$i||(e(t,R,j),e.$i=!0),j},j.locale=O,j.isDayjs=_,j.unix=function(e){return j(1e3*e)},j.en=w[b],j.Ls=w,j.p={},j}()}(En);var Rn=hn(En.exports);function An(){if(!Ot(Rn))throw new Error("invalid dayjs");return Rn().format("YYYY-MM-DDTHH:mm:ssZ")}var Tn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,o);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(Tn);var kn=hn(Tn.exports);function xn(){return new kn}var Cn=Ie(Object.getPrototypeOf,Object),$n=Function.prototype,Nn=Object.prototype,Dn=$n.toString,Pn=Nn.hasOwnProperty,Fn=Dn.call(Object);function Mn(e){if(!w(e))return!1;var t=b(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!function(e){if(!w(e)||"[object Object]"!=b(e))return!1;var t=Cn(e);if(null===t)return!0;var r=Pn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Dn.call(r)==Fn}(e)}function Ln(e){if(!tt(e)&&!ht(e)&&!S(e))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}function Un(e){let t="";if(Mn(e))t=e.message;else{if(et(e))return e;if(Et(e))return Rt(e,"message")?e.message:JSON.stringify(e);if(kt(e))return JSON.stringify(e);t=Ln(e)}return t}function Bn(t){return Nt(t,{fs:e})}function In(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function qn(e=300){return new function(e){let t=[],r=null,n=null;return zt(e)||(e=300),e=St(e),function(o,...i){Ot(o)?(n=Date.now(),t.push({func:o,input:i}),null===r&&(r=setInterval(()=>{if(Date.now()-n>e){let e=t.pop();t=[],e.func(...e.input)}0===t.length&&(clearInterval(r),r=null)},10))):console.log("func is not a function")}}(e)}function zn(e,r={}){let i=pe(r,"polling");Qe(i)||(i=!1);let a=pe(r,"timeInterval");zt(a)||(a=100),a=St(a);let s=pe(r,"timeBinaryInterval");zt(s)||(s=300),s=St(s);let c=new n.EventEmitter,u=e,l=null,f=setInterval(()=>{null===l&&Bn(u)&&(l=o.watch(u,{usePolling:i,interval:a,binaryInterval:s,awaitWriteFinish:!0}),l.on("all",(e,r,n)=>{r=t.resolve(r),c.emit("change",{type:e,fp:r,stats:n})}))},a);return c.clear=()=>{(()=>{if(null!==l){try{l.unwatch(u)}catch(e){console.log(e)}l.close().catch(e=>{console.log(e)}).finally(()=>{l=null})}})(),clearInterval(f)},c}function Hn(t,r,n={}){$t(t)||Lt(t),$t(r)||Lt(r);let o=`${t}/fpHash.json`,i=`${r}/fpHash.json`,a=t=>{let r={};try{r=function(e){if(!tt(e))return{};let t={};try{t=JSON.parse(e)}catch(e){t={}}return t}(e.readFileSync(t,"utf8"))}catch(e){}return r},s=(t,r)=>{try{let n=function(e,t=!1){if(In(e))return"";let r="";try{r=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){r=""}return r}(r);e.writeFileSync(t,n,"utf8")}catch(e){}},c=(e,t)=>pe(a(e),t,""),u=(e,t,r)=>{let n=a(e);n[t]=r,s(e,n)},l=(e,t)=>{let r=a(e);Rt(r,t)&&delete r[t],s(e,r)},f=()=>a(o),d=e=>s(o,e),p=e=>c(o,e),h=()=>a(i),y=e=>s(i,e),m=e=>c(i,e),g=(e,t)=>u(i,e,t),v=e=>l(i,e),b=e=>{let t=[];return Ge(e,(e,r)=>{t.push({fp:r,hash:e})}),t};return{buildSrc:()=>{let e=xn();return e.set=(t,r)=>{((e,t)=>{u(o,e,t)})(t,r),e.emit("set",{type:"set",fp:t,hash:r})},e.get=p,e.remove=t=>{(e=>{l(o,e)})(t),e.emit("remove",{type:"remove",fp:t})},e.readKp=f,e.writeKp=d,e},buildTar:()=>{let e=xn(),t=qn(300),r=zn(o);return r.on("change",r=>{t(()=>{(async()=>{let t=Tt(),r=f();if(!dn(r))return t.resolve("no src"),t;let n=h(),o=b(r),i=zr(b(n),o,"fp",{withInfor:!1}),a=Tt();return a.then(e=>{y(r)}).catch(()=>{}),e.emit("change",{kpSrc:r,kpTar:n,kpCmp:i,pm:a}),t})().catch(()=>{})})}),e.set=g,e.get=m,e.remove=v,e.readKp=h,e.writeKp=y,e.clear=r.clear,e}}}let Jn=i.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(Jn).href:"undefined"==typeof document?location.href:s&&"SCRIPT"===s.tagName.toUpperCase()&&s.src||new URL("w-dwdata-tweqod.umd.js",document.baseURI).href),Yn=t.dirname(Jn);let Wn=async(r={})=>{let n=pe(r,"keyId");tt(n)||(n="id");let o=pe(r,"fdTagRemove");tt(o)||(o="./_tagRemove");let i=pe(r,"fdTaskCpActualSrc");tt(i)||(i="./_taskCpActualSrc"),$t(i)||Lt(i);let s=pe(r,"fdTaskCpSrc");tt(s)||(s="./_taskCpSrc"),$t(s)||Lt(s);let c=pe(r,"fdLog");tt(c)||(c="./_logs"),$t(c)||Lt(c);let u=pe(r,"funGetNew");if(!Ot(u))throw new Error("invalid funGetNew");let l=pe(r,"funGetCurrent");if(!Ot(l))throw new Error("invalid funGetCurrent");let f=pe(r,"funAdd"),d=pe(r,"funModify"),p=pe(r,"funRemove"),h=pe(r,"funAfterStart"),y=pe(r,"funBeforeEnd"),m=pe(r,"timeToleranceRemove");_t(m)||(m=0),m=yt(m),m>0&&!$t(o)&&Lt(o);let g=pe(r,"eventNameProcCallfunGetNew");tt(g)||(g="proc-callfun-getNew");let v=pe(r,"eventNameProcCallfunGetCurrent");tt(v)||(v="proc-callfun-getCurrent");let b=pe(r,"eventNameProcAddCallfunAdd");tt(b)||(b="proc-add-callfun-add");let w=pe(r,"eventNameProcDiffCallfunModify");tt(w)||(w="proc-diff-callfun-modify");let S=pe(r,"eventNameProcRemoveCallfunRemove");tt(S)||(S="proc-remove-callfun-remove");let _=pe(r,"eventNameProcCallfunAfterStart");tt(_)||(_="proc-callfun-afterStart");let O=pe(r,"eventNameProcCallfunBeforeEnd");tt(O)||(O="proc-callfun-beforeEnd");let j=pe(r,"eventNameProcCoreDetect");tt(j)||(j="proc-coreDetect");let E=pe(r,"eventNameProcRetakeRemove");tt(E)||(E="proc-retake-remove");let R=pe(r,"eventNameProcCoreRetake");tt(R)||(R="proc-coreRetake");let A=xn(),T=function(e={}){let r=pe(e,"fdLog");tt(r)||(r="./_logs");let n=pe(e,"interval");"day"!==n&&"hr"!==n&&(n="day");let o=a.transport({targets:[{level:"info",target:t.resolve(Yn,"./formatter.mjs"),options:{interval:n,fdLog:r}}]});return a(o)}({fdLog:c,interval:"hr"}),k={info:e=>{T.info(e),A.emit("change",{type:"info",...e})},warn:e=>{T.warn(e),A.emit("change",{type:"warn",...e})},error:e=>{T.error(e),A.emit("change",{type:"error",...e})}},x=async t=>{let r=await(async(t,r,n="")=>{let i="";if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);i=o;let a=`${i}/${r}`,s={time:An(),hash:n};e.writeFileSync(a,JSON.stringify(s),"utf8")})("remove",t);return r},C=async(t,r={})=>{let n=await(async(t,r,n={})=>{let i=pe(n,"checkTime");Qe(i)||(i=!0);let a=pe(n,"timeNow"),s="",c=0;if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);s=o,c=m;let u=`${s}/${r}`;if(!Bn(u))return{b:!1,msg:`fp[${u}] is not a file`};if(!i)return{b:!0,msg:`fp[${u}] exists`};if(!dn(a))throw new Error("invalid timeNow");let l=e.readFileSync(u,"utf8"),f=pe(JSON.parse(l),"time"),d=Rn(f),p=a.diff(d,"millisecond"),h=p>=c;return h?{b:h,msg:`time difference[${p}] >= time tolerance[${c}]`}:{b:h,msg:"allowable time difference"}})("remove",t,r);return n},$=async(t,r)=>{let n="";if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);n=o;let i=`${n}/${r}`;if(!Bn(i))return;let a=e.readFileSync(i,"utf8"),s=JSON.parse(a),c=Hr(i,{fs:e});if(c.error)throw new Error(c.error);return s},N=async e=>await $("remove",e),D=null,P=null,F=(async()=>{await function(e=10){ht(e)||(e=10);let t=Tt();return setTimeout(function(){t.resolve()},e),t}(1);let e=Rn();k.info({event:"start",timeRunStart:e.format("YYYY-MM-DDTHH:mm:ssZ"),msg:"running..."});let t=Hn(i,i);D=t.buildSrc();let r=Hn(s,s);P=r.buildSrc();let o="";tt(o)||await(async()=>{if(Ot(h))try{k.info({event:_,msg:"start..."});let e=h();jt(e)&&(e=await e),k.info({event:_,msg:"done"})}catch(e){console.log(e),k.error({event:_,msg:Un(e)}),o="error at proc-callfun-afterStart"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-afterStart",msg:o})):null})().catch(()=>{});tt(o)||await(async()=>{let e=[];try{k.info({event:g,msg:"start..."});let t=u();jt(t)&&(t=await t),e=t,k.info({event:g,num:fn(t),msg:"done"})}catch(e){console.log(e),k.error({event:g,msg:Un(e)}),o="error at proc-callfun-getNew"}if(tt(o))return console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o});let t=[];try{k.info({event:v,msg:"start..."});let e=l();jt(e)&&(e=await e),t=e,k.info({event:v,num:fn(e),msg:"done"})}catch(e){console.log(e),k.error({event:v,msg:Un(e)}),o="error at proc-callfun-getCurrent"}if(tt(o))return console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o});if(0===fn(e))return console.log("invalid data, task canceled"),void k.info({event:"cancel-stage-main",msg:"no data"});let r=null;try{k.info({event:"proc-compare",msg:"start..."}),r=zr(t,e,n,{withInfor:!1});let o=fn(r.del),i=fn(r.add),a=fn(r.diff),s=fn(r.same);k.info({event:"proc-compare",numRemove:o,numAdd:i,numModify:a,numSame:s,msg:"done"})}catch(e){console.log(e),k.error({event:"proc-compare",msg:Un(e)}),o="error at proc-compare"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):dn(r)?0!==fn(r.del)||0!==fn(r.add)||0!==fn(r.diff)?(await xt(r.del,async e=>{if(!tt(o)){try{if(k.info({event:S,[n]:e[n],msg:"start..."}),Ot(p)){let t=p(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:S,[n]:e[n],msg:Un(t)}),o="error at proc-remove-callfun-remove"}if(!tt(o))try{D.remove(e[n]),m<=0?(P.remove(e[n]),k.info({event:S,[n]:e[n],msg:"done"})):(await C(e[n],{checkTime:!1})).b||(await x(e[n]),k.info({event:S,[n]:e[n],msg:"add-tag"}))}catch(t){console.log(t),k.error({event:S,[n]:e[n],msg:Un(t)}),o="error at proc-remove-callfun-remove"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):(await xt(r.add,async e=>{if(!tt(o)){try{if(k.info({event:b,[n]:e[n],msg:"start..."}),Ot(f)){let t=f(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:b,[n]:e[n],msg:Un(t)}),o="error at proc-add-callfun-add"}if(!tt(o))try{let t=jn(JSON.stringify(e));D.set(e[n],t),P.set(e[n],t),m>0&&(await C(e[n],{checkTime:!1})).b&&(await N(e[n]),k.info({event:b,[n]:e[n],msg:"release-tag"})),k.info({event:b,[n]:e[n],msg:"done"})}catch(t){console.log(t),k.error({event:b,[n]:e[n],msg:Un(t)}),o="error at proc-add-callfun-add"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):(await xt(r.diff,async e=>{if(!tt(o)){try{if(k.info({event:w,[n]:e[n],msg:"start..."}),Ot(d)){let t=d(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:w,[n]:e[n],msg:Un(t)}),o="error at proc-diff-callfun-modify"}if(!tt(o))try{let t=jn(JSON.stringify(e));D.set(e[n],t),P.set(e[n],t),k.info({event:w,[n]:e[n],msg:"done"})}catch(t){console.log(t),k.error({event:w,[n]:e[n],msg:Un(t)}),o="error at proc-diff-callfun-modify"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):null))):void k.info({event:"cancel-stage-main",msg:"no difference"}):(console.log("can not calculate the difference, task canceled"),void k.info({event:"cancel-stage-main",msg:"can not calculate the difference between the data before and after"}))})().catch(()=>{});await(async()=>{if(Ot(y))try{k.info({event:O,msg:"start..."});let e=y();jt(e)&&(e=await e),k.info({event:O,msg:"done"})}catch(e){console.log(e),k.error({event:O,msg:Un(e)}),o="error at proc-callfun-beforeEnd"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-beforeEnd",msg:o})):null})().catch(()=>{}),k.info({event:"end",...(()=>{let t=Rn(),r=t.diff(e,"second");return{timeRunStart:e.format("YYYY-MM-DDTHH:mm:ssZ"),timeRunEnd:t.format("YYYY-MM-DDTHH:mm:ssZ"),timeRunSpent:`${r}s`}})(),msg:"done"})})().catch(e=>{console.log(e),k.error({event:j,msg:Un(e)})}),M=(async()=>{if(m<=0)return;await async function(e,t={}){let r=null,n=Tt();if(!Ot(e))return n.reject("waitfunction需輸入函數f"),n;let o=async()=>{let t=e();return jt(t)&&(t=await t),t};if(r=await o(),!0===r)return n.resolve(),n;let i=pe(t,"attemptNum",null);zt(i)||(i=200);let a=pe(t,"timeInterval",null);zt(a)||(a=1e3);let s=0,c=setInterval(async()=>{s+=1,r=await o(),!0===r&&(clearInterval(c),n.resolve()),s>i&&(clearInterval(c),n.reject(`exceeded attemptNum[${i}]`))},a);return n}(()=>null!==P);let e=Rn(),t=Jt(o,1);0!==fn(t)&&await xt(t,async t=>{let r=(await C(t.name,{timeNow:e,checkTime:!0})).b,o=!tt(D.get(t.name)),i=tt(P.get(t.name));r&&o&&i&&(await N(t.name),k.info({event:E,[n]:t.name,from:"debounce",msg:"release-tag"}),P.remove(t.name),k.info({event:E,[n]:t.name,from:"debounce",msg:"done"}))})})().catch(e=>{console.log(e),k.error({event:R,msg:Un(e)})});return A.srlog=k,Promise.all([F,M]).finally(()=>{A.emit("end")}),A},Vn=async(n={})=>{let o=pe(n,"keyId");tt(o)||(o="id");let i=pe(n,"fdTagRemove");tt(i)||(i="./_tagRemove");let a=pe(n,"fdDwAttime");tt(a)||(a="./_dwAttime"),$t(a)||Lt(a);let s=pe(n,"fdDwCurrent");tt(s)||(s="./_dwCurrent"),$t(s)||Lt(s);let c=pe(n,"fdTaskCpActualSrc");tt(c)||(c="./_taskCpActualSrc"),$t(c)||Lt(c);let u=pe(n,"fdTaskCpSrc");tt(u)||(u="./_taskCpSrc"),$t(u)||Lt(u);let l=pe(n,"fdLog");tt(l)||(l="./_logs"),$t(l)||Lt(l);let f=pe(n,"funDownload");if(!Ot(f))throw new Error("invalid funDownload");let d=pe(n,"funGetCurrent");if(!Ot(d))throw new Error("invalid funGetCurrent");let p=pe(n,"funAdd");if(!Ot(p))throw new Error("invalid funAdd");let h=pe(n,"funModify");if(!Ot(h))throw new Error("invalid funModify");let y=pe(n,"funRemove");if(!Ot(y))throw new Error("invalid funRemove");let m=pe(n,"funAfterStart"),g=pe(n,"funBeforeEnd"),v=pe(n,"timeToleranceRemove");_t(v)||(v=0),v=yt(v);let b=async()=>{await function(n,o,i={}){return Vr(n,o,{path:t,fs:e,crypto:r,...i})}(a,s)};return Wn({keyId:o,fdTagRemove:i,fdTaskCpActualSrc:c,fdTaskCpSrc:u,fdLog:l,funGetNew:f,funGetCurrent:d,funAdd:p,funModify:h,funRemove:y,funAfterStart:async()=>{if(Ot(m)){let e=m();jt(e)&&(e=await e)}},funBeforeEnd:async()=>{if(await b(),Ot(g)){let e=g();jt(e)&&(e=await e)}},timeToleranceRemove:v,eventNameProcCallfunGetNew:"proc-callfun-download"})};function Kn(e){return!!In(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!function(e){if(Et(e)){for(let t in e)return!1;return!0}return!1}(e)||(!!function(e){return!(!et(e)||""!==e)}(e)||(!!function(e){return!!kt(e)&&0===e.length}(e)||!!pt(e)))))}function Gn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Zn}=Object.prototype,{getPrototypeOf:Xn}=Object,{iterator:Qn,toStringTag:eo}=Symbol,to=(e=>t=>{const r=Zn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ro=e=>(e=e.toLowerCase(),t=>to(t)===e),no=e=>t=>typeof t===e,{isArray:oo}=Array,io=no("undefined");function ao(e){return null!==e&&!io(e)&&null!==e.constructor&&!io(e.constructor)&&uo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const so=ro("ArrayBuffer");const co=no("string"),uo=no("function"),lo=no("number"),fo=e=>null!==e&&"object"==typeof e,po=e=>{if("object"!==to(e))return!1;const t=Xn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||eo in e||Qn in e)},ho=ro("Date"),yo=ro("File"),mo=ro("Blob"),go=ro("FileList"),vo=ro("URLSearchParams"),[bo,wo,So,_o]=["ReadableStream","Request","Response","Headers"].map(ro);function Oo(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),oo(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(ao(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function jo(e,t){if(ao(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Eo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ro=e=>!io(e)&&e!==Eo;const Ao=(To="undefined"!=typeof Uint8Array&&Xn(Uint8Array),e=>To&&e instanceof To);var To;const ko=ro("HTMLFormElement"),xo=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Co=ro("RegExp"),$o=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Oo(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)};const No=ro("AsyncFunction"),Do=(Po="function"==typeof setImmediate,Fo=uo(Eo.postMessage),Po?setImmediate:Fo?(Mo=`axios@${Math.random()}`,Lo=[],Eo.addEventListener("message",({source:e,data:t})=>{e===Eo&&t===Mo&&Lo.length&&Lo.shift()()},!1),e=>{Lo.push(e),Eo.postMessage(Mo,"*")}):e=>setTimeout(e));var Po,Fo,Mo,Lo;const Uo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Eo):"undefined"!=typeof process&&process.nextTick||Do;var Bo={isArray:oo,isArrayBuffer:so,isBuffer:ao,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||uo(e.append)&&("formdata"===(t=to(e))||"object"===t&&uo(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&so(e.buffer),t},isString:co,isNumber:lo,isBoolean:e=>!0===e||!1===e,isObject:fo,isPlainObject:po,isEmptyObject:e=>{if(!fo(e)||ao(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:bo,isRequest:wo,isResponse:So,isHeaders:_o,isUndefined:io,isDate:ho,isFile:yo,isBlob:mo,isRegExp:Co,isFunction:uo,isStream:e=>fo(e)&&uo(e.pipe),isURLSearchParams:vo,isTypedArray:Ao,isFileList:go,forEach:Oo,merge:function e(){const{caseless:t,skipUndefined:r}=Ro(this)&&this||{},n={},o=(o,i)=>{const a=t&&jo(n,i)||i;po(n[a])&&po(o)?n[a]=e(n[a],o):po(o)?n[a]=e({},o):oo(o)?n[a]=o.slice():r&&io(o)||(n[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Oo(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(Oo(t,(t,n)=>{r&&uo(t)?e[n]=Gn(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&Xn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:to,kindOfTest:ro,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(oo(e))return e;let t=e.length;if(!lo(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Qn]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:ko,hasOwnProperty:xo,hasOwnProp:xo,reduceDescriptors:$o,freezeMethods:e=>{$o(e,(t,r)=>{if(uo(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];uo(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return oo(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:jo,global:Eo,isContextDefined:Ro,isSpecCompliantForm:function(e){return!!(e&&uo(e.append)&&"FormData"===e[eo]&&e[Qn])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(fo(e)){if(t.indexOf(e)>=0)return;if(ao(e))return e;if(!("toJSON"in e)){t[n]=e;const o=oo(e)?[]:{};return Oo(e,(e,t)=>{const i=r(e,n+1);!io(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:No,isThenable:e=>e&&(fo(e)||uo(e))&&uo(e.then)&&uo(e.catch),setImmediate:Do,asap:Uo,isIterable:e=>null!=e&&uo(e[Qn])};function Io(e,t,r,n,o){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),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Bo.inherits(Io,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:Bo.toJSONObject(this.config),code:this.code,status:this.status}}});const qo=Io.prototype,zo={};["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=>{zo[e]={value:e}}),Object.defineProperties(Io,zo),Object.defineProperty(qo,"isAxiosError",{value:!0}),Io.from=(e,t,r,n,o,i)=>{const a=Object.create(qo);Bo.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Io.call(a,s,c,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};function Ho(e){return Bo.isPlainObject(e)||Bo.isArray(e)}function Jo(e){return Bo.endsWith(e,"[]")?e.slice(0,-2):e}function Yo(e,t,r){return e?e.concat(t).map(function(e,t){return e=Jo(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Wo=Bo.toFlatObject(Bo,{},null,function(e){return/^is[A-Z]/.test(e)});function Vo(e,t,r){if(!Bo.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Bo.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Bo.isUndefined(t[e])})).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Bo.isSpecCompliantForm(t);if(!Bo.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Bo.isDate(e))return e.toISOString();if(Bo.isBoolean(e))return e.toString();if(!s&&Bo.isBlob(e))throw new Io("Blob is not supported. Use a Buffer instead.");return Bo.isArrayBuffer(e)||Bo.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(Bo.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Bo.isArray(e)&&function(e){return Bo.isArray(e)&&!e.some(Ho)}(e)||(Bo.isFileList(e)||Bo.endsWith(r,"[]"))&&(s=Bo.toArray(e)))return r=Jo(r),s.forEach(function(e,n){!Bo.isUndefined(e)&&null!==e&&t.append(!0===a?Yo([r],n,i):null===a?r:r+"[]",c(e))}),!1;return!!Ho(e)||(t.append(Yo(o,r,i),c(e)),!1)}const l=[],f=Object.assign(Wo,{defaultVisitor:u,convertValue:c,isVisitable:Ho});if(!Bo.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Bo.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Bo.forEach(r,function(r,i){!0===(!(Bo.isUndefined(r)||null===r)&&o.call(t,r,Bo.isString(i)?i.trim():i,n,f))&&e(r,n?n.concat(i):[i])}),l.pop()}}(e),t}function Ko(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Go(e,t){this._pairs=[],e&&Vo(e,this,t)}const Zo=Go.prototype;function Xo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Qo(e,t,r){if(!t)return e;const n=r&&r.encode||Xo;Bo.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Bo.isURLSearchParams(t)?t.toString():new Go(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Zo.append=function(e,t){this._pairs.push([e,t])},Zo.toString=function(e){const t=e?function(t){return e.call(this,t,Ko)}:Ko;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ei=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Bo.forEach(this.handlers,function(t){null!==t&&e(t)})}},ti={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ri={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Go,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ni="undefined"!=typeof window&&"undefined"!=typeof document,oi="object"==typeof navigator&&navigator||void 0,ii=ni&&(!oi||["ReactNative","NativeScript","NS"].indexOf(oi.product)<0),ai="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,si=ni&&window.location.href||"http://localhost";var ci={...Object.freeze({__proto__:null,hasBrowserEnv:ni,hasStandardBrowserEnv:ii,hasStandardBrowserWebWorkerEnv:ai,navigator:oi,origin:si}),...ri};function ui(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&Bo.isArray(n)?n.length:i,s)return Bo.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&Bo.isObject(n[i])||(n[i]=[]);return t(e,r,n[i],o)&&Bo.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!a}if(Bo.isFormData(e)&&Bo.isFunction(e.entries)){const r={};return Bo.forEachEntry(e,(e,n)=>{t(function(e){return Bo.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const li={transitional:ti,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Bo.isObject(e);o&&Bo.isHTMLForm(e)&&(e=new FormData(e));if(Bo.isFormData(e))return n?JSON.stringify(ui(e)):e;if(Bo.isArrayBuffer(e)||Bo.isBuffer(e)||Bo.isStream(e)||Bo.isFile(e)||Bo.isBlob(e)||Bo.isReadableStream(e))return e;if(Bo.isArrayBufferView(e))return e.buffer;if(Bo.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Vo(e,new ci.classes.URLSearchParams,{visitor:function(e,t,r,n){return ci.isNode&&Bo.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Bo.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Vo(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(Bo.isString(e))try{return(t||JSON.parse)(e),Bo.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||li.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Bo.isResponse(e)||Bo.isReadableStream(e))return e;if(e&&Bo.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Io.from(e,Io.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:ci.classes.FormData,Blob:ci.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Bo.forEach(["delete","get","head","post","put","patch"],e=>{li.headers[e]={}});var fi=li;const di=Bo.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"]);const pi=Symbol("internals");function hi(e){return e&&String(e).trim().toLowerCase()}function yi(e){return!1===e||null==e?e:Bo.isArray(e)?e.map(yi):String(e)}function mi(e,t,r,n,o){return Bo.isFunction(n)?n.call(this,t,r):(o&&(t=r),Bo.isString(t)?Bo.isString(n)?-1!==t.indexOf(n):Bo.isRegExp(n)?n.test(t):void 0:void 0)}class gi{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=hi(t);if(!o)throw new Error("header name must be a non-empty string");const i=Bo.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=yi(e))}const i=(e,t)=>Bo.forEach(e,(e,r)=>o(e,r,t));if(Bo.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Bo.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&di[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Bo.isObject(e)&&Bo.isIterable(e)){let r,n,o={};for(const t of e){if(!Bo.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Bo.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=hi(e)){const r=Bo.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Bo.isFunction(t))return t.call(this,e,r);if(Bo.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=hi(e)){const r=Bo.findKey(this,e);return!(!r||void 0===this[r]||t&&!mi(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=hi(e)){const o=Bo.findKey(r,e);!o||t&&!mi(0,r[o],o,t)||(delete r[o],n=!0)}}return Bo.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!mi(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Bo.forEach(this,(n,o)=>{const i=Bo.findKey(r,o);if(i)return t[i]=yi(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=yi(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Bo.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Bo.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[pi]=this[pi]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=hi(e);t[n]||(!function(e,t){const r=Bo.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return Bo.isArray(e)?e.forEach(n):n(e),this}}gi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Bo.reduceDescriptors(gi.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Bo.freezeMethods(gi);var vi=gi;function bi(e,t){const r=this||fi,n=t||r,o=vi.from(n.headers);let i=n.data;return Bo.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function wi(e){return!(!e||!e.__CANCEL__)}function Si(e,t,r){Io.call(this,null==e?"canceled":e,Io.ERR_CANCELED,t,r),this.name="CanceledError"}function _i(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Io("Request failed with status code "+r.status,[Io.ERR_BAD_REQUEST,Io.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Bo.inherits(Si,Io,{__CANCEL__:!0});const Oi=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]}(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},ji=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ei=e=>(...t)=>Bo.asap(()=>e(...t));var Ri=ci.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ci.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ci.origin),ci.navigator&&/(msie|trident)/i.test(ci.navigator.userAgent)):()=>!0,Ai=ci.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const a=[e+"="+encodeURIComponent(t)];Bo.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Bo.isString(n)&&a.push("path="+n),Bo.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.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 Ti(e,t,r){let n=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const ki=e=>e instanceof vi?{...e}:e;function xi(e,t){t=t||{};const r={};function n(e,t,r,n){return Bo.isPlainObject(e)&&Bo.isPlainObject(t)?Bo.merge.call({caseless:n},e,t):Bo.isPlainObject(t)?Bo.merge({},t):Bo.isArray(t)?t.slice():t}function o(e,t,r,o){return Bo.isUndefined(t)?Bo.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Bo.isUndefined(t))return n(void 0,t)}function a(e,t){return Bo.isUndefined(t)?Bo.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,r)=>o(ki(e),ki(t),0,!0)};return Bo.forEach(Object.keys({...e,...t}),function(n){const i=c[n]||o,a=i(e[n],t[n],n);Bo.isUndefined(a)&&i!==s||(r[n]=a)}),r}var Ci=e=>{const t=xi({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=vi.from(a),t.url=Qo(Ti(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Bo.isFormData(r))if(ci.hasStandardBrowserEnv||ci.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Bo.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(ci.hasStandardBrowserEnv&&(n&&Bo.isFunction(n)&&(n=n(t)),n||!1!==n&&Ri(t.url))){const e=o&&i&&Ai.read(i);e&&a.set(o,e)}return t};var $i="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Ci(e);let o=n.data;const i=vi.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=vi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());_i(function(e){t(e),h()},function(e){r(e),h()},{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new Io("Request aborted",Io.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const n=new Io(t&&t.message?t.message:"Network Error",Io.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ti;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Io(t,o.clarifyTimeoutError?Io.ETIMEDOUT:Io.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Bo.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Bo.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=Oi(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=Oi(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=t=>{y&&(r(!t||t.type?new Si(null,e,y):t),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===ci.protocols.indexOf(g)?r(new Io("Unsupported protocol "+g+":",Io.ERR_BAD_REQUEST,e)):y.send(o||null)})};var Ni=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Io?t:new Si(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new Io(`timeout ${t} of ms exceeded`,Io.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=n;return s.unsubscribe=()=>Bo.asap(a),s}};const Di=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Pi=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Fi=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of Pi(e))yield*Di(r,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Mi}=Bo,Li=(({Request:e,Response:t})=>({Request:e,Response:t}))(Bo.global),{ReadableStream:Ui,TextEncoder:Bi}=Bo.global,Ii=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},qi=e=>{e=Bo.merge.call({skipUndefined:!0},Li,e);const{fetch:t,Request:r,Response:n}=e,o=t?Mi(t):"function"==typeof fetch,i=Mi(r),a=Mi(n);if(!o)return!1;const s=o&&Mi(Ui),c=o&&("function"==typeof Bi?(u=new Bi,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const l=i&&s&&Ii(()=>{let e=!1;const t=new r(ci.origin,{body:new Ui,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=a&&s&&Ii(()=>Bo.isReadableStream(new n("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Io(`Response type '${e}' is not supported`,Io.ERR_NOT_SUPPORT,r)})});const p=async(e,t)=>{const n=Bo.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Bo.isBlob(e))return e.size;if(Bo.isSpecCompliantForm(e)){const t=new r(ci.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Bo.isArrayBufferView(e)||Bo.isArrayBuffer(e)?e.byteLength:(Bo.isURLSearchParams(e)&&(e+=""),Bo.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:v,withCredentials:b="same-origin",fetchOptions:w}=Ci(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let _=Ni([c,u&&u.toAbortSignal()],h),O=null;const j=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let E;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(E=await p(v,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(Bo.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=ji(E,Oi(Ei(m)));s=Fi(t.body,65536,e,r)}}Bo.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in r.prototype,c={...w,signal:_,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};O=i&&new r(o,c);let u=await(i?S(O,w):S(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(y||h&&j)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Bo.toFiniteNumber(u.headers.get("content-length")),[r,o]=y&&ji(t,Oi(Ei(y),!0))||[];u=new n(Fi(u.body,65536,r,()=>{o&&o(),j&&j()}),e)}g=g||"text";let R=await d[Bo.findKey(d,g)||"text"](u,e);return!h&&j&&j(),await new Promise((t,r)=>{_i(t,r,{data:R,headers:vi.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(j&&j(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Io("Network Error",Io.ERR_NETWORK,e,O),{cause:t.cause||t});throw Io.from(t,t&&t.code,e,O)}}},zi=new Map,Hi=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let a,s,c=i.length,u=zi;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:qi(t)),u=s;return s};Hi();const Ji={http:null,xhr:$i,fetch:{get:Hi}};Bo.forEach(Ji,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Yi=e=>`- ${e}`,Wi=e=>Bo.isFunction(e)||null===e||!1===e;var Vi=(e,t)=>{e=Bo.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let a=0;a<r;a++){let r;if(n=e[a],o=n,!Wi(n)&&(o=Ji[(r=String(n)).toLowerCase()],void 0===o))throw new Io(`Unknown adapter '${r}'`);if(o&&(Bo.isFunction(o)||(o=o.get(t))))break;i[r||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Io("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Yi).join("\n"):" "+Yi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Ki(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Si(null,e)}function Gi(e){Ki(e),e.headers=vi.from(e.headers),e.data=bi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Vi(e.adapter||fi.adapter,e)(e).then(function(t){return Ki(e),t.data=bi.call(e,e.transformResponse,t),t.headers=vi.from(t.headers),t},function(t){return wi(t)||(Ki(e),t&&t.response&&(t.response.data=bi.call(e,e.transformResponse,t.response),t.response.headers=vi.from(t.response.headers))),Promise.reject(t)})}const Zi="1.12.2",Xi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Xi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Qi={};Xi.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Zi+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new Io(n(o," has been removed"+(t?" in "+t:"")),Io.ERR_DEPRECATED);return t&&!Qi[o]&&(Qi[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},Xi.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var ea={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Io("options must be an object",Io.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new Io("option "+i+" must be "+r,Io.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Io("Unknown option "+i,Io.ERR_BAD_OPTION)}},validators:Xi};const ta=ea.validators;class ra{constructor(e){this.defaults=e||{},this.interceptors={request:new ei,response:new ei}}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 r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=xi(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&ea.assertOptions(r,{silentJSONParsing:ta.transitional(ta.boolean),forcedJSONParsing:ta.transitional(ta.boolean),clarifyTimeoutError:ta.transitional(ta.boolean)},!1),null!=n&&(Bo.isFunction(n)?t.paramsSerializer={serialize:n}:ea.assertOptions(n,{encode:ta.function,serialize:ta.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ea.assertOptions(t,{baseUrl:ta.spelling("baseURL"),withXsrfToken:ta.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Bo.merge(o.common,o[t.method]);o&&Bo.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=vi.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!s){const e=[Gi.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=a.length;let d=t;for(;f<l;){const e=a[f++],t=a[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Gi.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return Qo(Ti((e=xi(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Bo.forEach(["delete","get","head","options"],function(e){ra.prototype[e]=function(t,r){return this.request(xi(r||{},{method:e,url:t,data:(r||{}).data}))}}),Bo.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(xi(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ra.prototype[e]=t(),ra.prototype[e+"Form"]=t(!0)});var na=ra;class oa{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new Si(e,n,o),t(r.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 oa(function(t){e=t}),cancel:e}}}var ia=oa;const aa={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(aa).forEach(([e,t])=>{aa[t]=e});var sa=aa;const ca=function e(t){const r=new na(t),n=Gn(na.prototype.request,r);return Bo.extend(n,na.prototype,r,{allOwnKeys:!0}),Bo.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(xi(t,r))},n}(fi);ca.Axios=na,ca.CanceledError=Si,ca.CancelToken=ia,ca.isCancel=wi,ca.VERSION=Zi,ca.toFormData=Vo,ca.AxiosError=Io,ca.Cancel=ca.CanceledError,ca.all=function(e){return Promise.all(e)},ca.spread=function(e){return function(t){return e.apply(null,t)}},ca.isAxiosError=function(e){return Bo.isObject(e)&&!0===e.isAxiosError},ca.mergeConfig=xi,ca.AxiosHeaders=vi,ca.formToJSON=e=>ui(Bo.isHTMLForm(e)?new FormData(e):e),ca.getAdapter=Vi,ca.HttpStatusCode=sa,ca.default=ca;var ua=ca;let la=async(e,t={})=>{let r=null,n=pe(t,"keepAllData");Qe(n)||(n=!0);let o=await ua.get(`https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001?Authorization=${e}`).catch(e=>{r=e});if(null!==r)return;let i=[...pe(o,"data.records.earthquake",[]),...pe(o,"data.records.Earthquake",[])];if(!kt(a=i)||0===a.length||1===a.length&&Kn(a[0]))throw console.log("rEqsL",o),new Error("無法取得顯著有感地震之earthquake數據");var a;let s=[];return Ge(i,e=>{let t=pe(e,"earthquakeInfo.originTime",""),r=pe(e,"EarthquakeInfo.OriginTime",""),o=t||r;if(!tt(o))throw console.log("v",e),new Error(`無法取得originTime[${o}]`);let i=pe(e,"earthquakeInfo.magnitude.magnitudeType",""),a=pe(e,"EarthquakeInfo.EarthquakeMagnitude.MagnitudeType",""),c=i||a;if(!tt(c))throw console.log("v",e),new Error(`無法取得magnitudeType[${c}]`);let u=pe(e,"earthquakeInfo.magnitude.magnitudeValue",""),l=pe(e,"EarthquakeInfo.EarthquakeMagnitude.MagnitudeValue",""),f=u||l;if(!ht(f))throw console.log("v",e),new Error(`無法取得magnitudeValue[${f}]`);let d=pe(e,"ReportContent",""),p=f;p=Ln(p);let h=Rn(o),y=pe(e,"EarthquakeNo","");y=Ln(y);let m=Br(y,3),g=o,v=h.format("YYYY-MM-DDTHH:mm:ssZ"),b=h.format("YYYYMMDDHHmmss"),w=pe(e,"EarthquakeInfo.FocalDepth","");w=Ln(w);let S=pe(e,"EarthquakeInfo.Epicenter.Location",""),_=pe(e,"EarthquakeInfo.Epicenter.EpicenterLongitude","");_=Ln(_);let O=pe(e,"EarthquakeInfo.Epicenter.EpicenterLatitude","");O=Ln(O);let j={id:y,tag:"",number:m,time:v,timeRec:g,timeTag:b,ml:p,depth:w,description:d,location:S,intensity:"",longitude:_,latitude:O};n&&(j.data=e),s.push(j)}),s};return async(t,n={})=>{let o=pe(n,"keepAllData");Qe(o)||(o=!0);let i=pe(n,"fdTagRemove");tt(i)||(i="./_tagRemove");let a=pe(n,"fdDwStorage");tt(a)||(a="./_dwStorage"),$t(a)||Lt(a);let s=pe(n,"fdDwAttime");tt(s)||(s="./_dwAttime"),$t(s)||Lt(s);let c=pe(n,"fdDwCurrent");tt(c)||(c="./_dwCurrent"),$t(c)||Lt(c);let u=pe(n,"fdResultTemp");tt(u)||(u="./_resultTemp"),$t(u)||Lt(u);let l=pe(n,"fdResult");tt(l)||(l="./_result"),$t(l)||Lt(l);let f=pe(n,"fdTaskCpActualSrc");tt(f)||(f="./_taskCpActualSrc"),$t(f)||Lt(f);let d=pe(n,"fdTaskCpSrc");tt(d)||(d="./_taskCpSrc"),$t(d)||Lt(d);let p=pe(n,"fdLog");tt(p)||(p="./_logs"),$t(p)||Lt(p);let h=pe(n,"funDownloadEqs"),y=pe(n,"funDownload"),m=pe(n,"funGetCurrent"),g=pe(n,"funAdd"),v=pe(n,"funModify"),b=pe(n,"funRemove"),w=pe(n,"timeToleranceRemove");_t(w)||(w=0),w=yt(w);let S=async()=>{let n=[];var i;Ot(h)?(n=h(),jt(n)&&(n=await n)):n=await la(t,{keepAllData:o}),n=null==(i=n)?i:Ze.call(i),Mt(s),It(c,s);let u=(t=>{let r=Jt(t,1),n=[];return Ge(r,t=>{let r=e.readFileSync(t.path,"utf8"),o=JSON.parse(r);n.push(o)}),n})(s),l={};return Ge(u,e=>{l[e.id]=e}),await xt(n,async t=>{let n=`${a}/${t.id}.json`;e.writeFileSync(n,JSON.stringify(t),"utf8");let o=await function(t,n={}){return Yt(t,{fs:e,crypto:r,...n})}(n,{type:"md5"});if(Rt(l,t.id)){if(o!==l[t.id].hash){l[t.id].hash=o;let r=`${s}/${t.id}.json`;e.writeFileSync(r,JSON.stringify(l[t.id]),"utf8")}}else{l[t.id]={id:t.id,hash:o};let r=`${s}/${t.id}.json`;e.writeFileSync(r,JSON.stringify(l[t.id]),"utf8")}}),Xe(l)};Ot(y)||(y=S);let _=async()=>{let t=Jt(c,1),r=[];return Ge(t,t=>{let n=e.readFileSync(t.path,"utf8"),o=JSON.parse(n);r.push(o)}),r};Ot(m)||(m=_);let O=async t=>{let r=`${l}/${t.id}`;$t(r)&&qt(r,{fs:e})};Ot(b)||(b=O);let j=async e=>{let t=`${l}/${e.id}`;$t(t)||Lt(t),Mt(t),Ft(`${a}/${e.id}.json`,`${t}/${e.id}.json`)};Ot(g)||(g=j);let E=async e=>{It(`${l}/${e.id}`,`${u}/${e.id}`);{let t=`${l}/${e.id}`;$t(t)||Lt(t),Mt(t),Ft(`${a}/${e.id}.json`,`${t}/${e.id}.json`)}};Ot(v)||(v=E);let R={fdTagRemove:i,fdDwAttime:s,fdDwCurrent:c,fdResult:l,fdTaskCpActualSrc:f,fdTaskCpSrc:d,fdLog:p,funDownload:y,funGetCurrent:m,funRemove:b,funAdd:g,funModify:v,funAfterStart:async()=>{Mt(u)},funBeforeEnd:async()=>{Mt(u)},timeToleranceRemove:w};return await Vn(R)}});
6
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("fs"),require("path"),require("crypto"),require("events"),require("chokidar"),require("url"),require("pino")):"function"==typeof define&&define.amd?define(["fs","path","crypto","events","chokidar","url","pino"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-dwdata-tweqod"]=t(e.fs,e.path,e.crypto,e.events,e.chokidar,e.url,e.pino)}(this,function(e,t,r,n,o,i,a){"use strict";var s="undefined"!=typeof document?document.currentScript:null,c=Array.isArray,u="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,f=u||l||Function("return this")(),d=f.Symbol,p=Object.prototype,h=p.hasOwnProperty,y=p.toString,m=d?d.toStringTag:void 0;var g=Object.prototype.toString;var v=d?d.toStringTag:void 0;function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?function(e){var t=h.call(e,m),r=e[m];try{e[m]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[m]=r:delete e[m]),o}(e):function(e){return g.call(e)}(e)}function w(e){return null!=e&&"object"==typeof e}function S(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==b(e)}var _=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/;function j(e,t){if(c(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!S(e))||(O.test(e)||!_.test(e)||null!=t&&e in Object(t))}function E(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function R(e){if(!E(e))return!1;var t=b(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var A,T=f["__core-js_shared__"],k=(A=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"";var x=Function.prototype.toString;function C(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var $=/^\[object .+?Constructor\]$/,N=Function.prototype,D=Object.prototype,P=N.toString,F=D.hasOwnProperty,M=RegExp("^"+P.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L(e){return!(!E(e)||(t=e,k&&k in t))&&(R(e)?M:$).test(C(e));var t}function B(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return L(r)?r:void 0}var U=B(Object,"create");var I=Object.prototype.hasOwnProperty;var q=Object.prototype.hasOwnProperty;function z(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function H(e,t){return e===t||e!=e&&t!=t}function Y(e,t){for(var r=e.length;r--;)if(H(e[r][0],t))return r;return-1}z.prototype.clear=function(){this.__data__=U?U(null):{},this.size=0},z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},z.prototype.get=function(e){var t=this.__data__;if(U){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return I.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return U?void 0!==t[e]:q.call(t,e)},z.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=U&&void 0===t?"__lodash_hash_undefined__":t,this};var J=Array.prototype.splice;function W(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}W.prototype.clear=function(){this.__data__=[],this.size=0},W.prototype.delete=function(e){var t=this.__data__,r=Y(t,e);return!(r<0)&&(r==t.length-1?t.pop():J.call(t,r,1),--this.size,!0)},W.prototype.get=function(e){var t=this.__data__,r=Y(t,e);return r<0?void 0:t[r][1]},W.prototype.has=function(e){return Y(this.__data__,e)>-1},W.prototype.set=function(e,t){var r=this.__data__,n=Y(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var V=B(f,"Map");function K(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function G(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}G.prototype.clear=function(){this.size=0,this.__data__={hash:new z,map:new(V||W),string:new z}},G.prototype.delete=function(e){var t=K(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return K(this,e).get(e)},G.prototype.has=function(e){return K(this,e).has(e)},G.prototype.set=function(e,t){var r=K(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Z(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(Z.Cache||G),r}Z.Cache=G;var X,Q,ee,te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=(X=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(te,function(e,r,n,o){t.push(n?o.replace(re,"$1"):r||e)}),t},Q=Z(X,function(e){return 500===ee.size&&ee.clear(),e}),ee=Q.cache,Q),oe=ne;function ie(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var ae=d?d.prototype:void 0,se=ae?ae.toString:void 0;function ce(e){if("string"==typeof e)return e;if(c(e))return ie(e,ce)+"";if(S(e))return se?se.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ue(e){return null==e?"":ce(e)}function le(e,t){return c(e)?e:j(e,t)?[e]:oe(ue(e))}function fe(e){if("string"==typeof e||S(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function de(e,t){for(var r=0,n=(t=le(t,e)).length;null!=e&&r<n;)e=e[fe(t[r++])];return r&&r==n?e:void 0}function pe(e,t,r){var n=null==e?void 0:de(e,t);return void 0===n?r:n}function he(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}var ye,me=function(e,t,r){for(var n=-1,o=Object(e),i=r(e),a=i.length;a--;){var s=i[ye?a:++n];if(!1===t(o[s],s,o))break}return e};function ge(e){return w(e)&&"[object Arguments]"==b(e)}var ve=Object.prototype,be=ve.hasOwnProperty,we=ve.propertyIsEnumerable,Se=ge(function(){return arguments}())?ge:function(e){return w(e)&&be.call(e,"callee")&&!we.call(e,"callee")},_e=Se;var Oe="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=Oe&&"object"==typeof module&&module&&!module.nodeType&&module,Ee=je&&je.exports===Oe?f.Buffer:void 0,Re=(Ee?Ee.isBuffer:void 0)||function(){return!1},Ae=/^(?:0|[1-9]\d*)$/;function Te(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Ae.test(e))&&e>-1&&e%1==0&&e<t}function ke(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var xe={};xe["[object Float32Array]"]=xe["[object Float64Array]"]=xe["[object Int8Array]"]=xe["[object Int16Array]"]=xe["[object Int32Array]"]=xe["[object Uint8Array]"]=xe["[object Uint8ClampedArray]"]=xe["[object Uint16Array]"]=xe["[object Uint32Array]"]=!0,xe["[object Arguments]"]=xe["[object Array]"]=xe["[object ArrayBuffer]"]=xe["[object Boolean]"]=xe["[object DataView]"]=xe["[object Date]"]=xe["[object Error]"]=xe["[object Function]"]=xe["[object Map]"]=xe["[object Number]"]=xe["[object Object]"]=xe["[object RegExp]"]=xe["[object Set]"]=xe["[object String]"]=xe["[object WeakMap]"]=!1;var Ce="object"==typeof exports&&exports&&!exports.nodeType&&exports,$e=Ce&&"object"==typeof module&&module&&!module.nodeType&&module,Ne=$e&&$e.exports===Ce&&u.process,De=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||Ne&&Ne.binding&&Ne.binding("util")}catch(e){}}(),Pe=De&&De.isTypedArray,Fe=Pe?function(e){return function(t){return e(t)}}(Pe):function(e){return w(e)&&ke(e.length)&&!!xe[b(e)]},Me=Fe,Le=Object.prototype.hasOwnProperty;function Be(e,t){var r=c(e),n=!r&&_e(e),o=!r&&!n&&Re(e),i=!r&&!n&&!o&&Me(e),a=r||n||o||i,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var l in e)!t&&!Le.call(e,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Te(l,u))||s.push(l);return s}var Ue=Object.prototype;function Ie(e,t){return function(r){return e(t(r))}}var qe=Ie(Object.keys,Object),ze=Object.prototype.hasOwnProperty;function He(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||Ue))return qe(e);var t,r,n=[];for(var o in Object(e))ze.call(e,o)&&"constructor"!=o&&n.push(o);return n}function Ye(e){return null!=e&&ke(e.length)&&!R(e)}function Je(e){return Ye(e)?Be(e):He(e)}var We=function(e,t){return function(r,n){if(null==r)return r;if(!Ye(r))return e(r,n);for(var o=r.length,i=t?o:-1,a=Object(r);(t?i--:++i<o)&&!1!==n(a[i],i,a););return r}}(function(e,t){return e&&me(e,t,Je)}),Ve=We;function Ke(e){return e}function Ge(e,t){var r;return(c(e)?he:Ve)(e,"function"==typeof(r=t)?r:Ke)}var Ze=Array.prototype.reverse;function Xe(e){return null==e?[]:function(e,t){return ie(t,function(t){return e[t]})}(e,Je(e))}function Qe(e){return!0===(t=e)||!1===t||w(t)&&"[object Boolean]"==b(t);var t}function et(e){return"[object String]"===Object.prototype.toString.call(e)}function tt(e){return!(!et(e)||""===e)}var rt=/\s/;var nt=/^\s+/;function ot(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&rt.test(e.charAt(t)););return t}(e)+1).replace(nt,""):e}var it=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,st=/^0o[0-7]+$/i,ct=parseInt;function ut(e){if("number"==typeof e)return e;if(S(e))return NaN;if(E(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=E(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ot(e);var r=at.test(e);return r||st.test(e)?ct(e.slice(2),r?2:8):it.test(e)?NaN:+e}var lt=1/0;function ft(e){return e?(e=ut(e))===lt||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function dt(e){var t=ft(e),r=t%1;return t==t?r?t-r:t:0}function pt(e){return e!=e}function ht(e){let t=!1;if(tt(e))t=!isNaN(Number(e));else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(pt(e))return!1;t=!0}return t}function yt(e){if(!ht(e))return 0;return ft(e)}function mt(e){return!!ht(e)&&(e=yt(e),"number"==typeof(t=e)&&t==dt(t));var t}var gt=f.isFinite,vt=Math.min;var bt=function(e){var t=Math[e];return function(e,r){if(e=ut(e),(r=null==r?0:vt(dt(r),292))&&gt(e)){var n=(ue(e)+"e").split("e");return+((n=(ue(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}("round"),wt=bt;function St(e){if(!ht(e))return 0;e=yt(e);let t=wt(e);return"0"===String(t)?0:t}function _t(e){if(!mt(e))return!1;return St(e)>=0}function Ot(e){let t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}function jt(e){let t,r=Object.prototype.toString.call(e);if(t="[object Promise]"===r,t)return!0;if("[object Function]"!==r)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}function Et(e){return"[object Object]"===Object.prototype.toString.call(e)}function Rt(e,t){return!!Et(e)&&(!(!tt(t)&&!ht(t))&&t in e)}function At(e,t,r){var n=null==e?0:e.length;return n?function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}(e,(t=r||void 0===t?1:dt(t))<0?0:t,n):[]}function Tt(){let e,t,r=new Promise(function(){e=arguments[0],t=arguments[1]});return r.resolve=e,r.reject=t,r}function kt(e){return"[object Array]"===Object.prototype.toString.call(e)}function xt(e,t){let r=Tt();if(!kt(e)&&!Et(e))return r.reject("rs is not an array or object"),r;let n=!1;if(Et(e)){n=!0;let t=[];Ge(e,(e,r)=>{t.push({k:r,v:e})}),e=t}Ot(t)||(t=function(e){return e});let o=-1,i=[];return e.reduce(function(e,r){return e.then(function(e){i.push(e),o+=1;let a=o,s=r;return n&&(a=r.k,s=r.v),Ot(t)?t(s,a):s})},Promise.resolve()).then(function(e){i.push(e),i=At(i),r.resolve(i)}).catch(function(e){r.reject(e)}),r}function Ct(e,t={}){let r=pe(t,"fs"),n=!1;try{r.statSync(e),n=!0}catch{n=!1}return n}function $t(e,t={}){let r=pe(t,"fs");if(!Ct(e,{fs:r}))return!1;let n=r.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function Nt(t){return $t(t,{fs:e})}function Dt(e,t={}){let r=pe(t,"fs");return!!Ct(e,{fs:r})&&(!r.lstatSync(e).isDirectory()&&!r.lstatSync(e).isSymbolicLink())}function Pt(e,t={}){let r=pe(t,"fs");if($t(e,{fs:r}))return{success:"input folder is already exists: "+e};if(Ct(e,{fs:r}))return{error:"input path already exists: "+e};try{r.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function Ft(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"useSync","");Qe(i)||(i=!0);let a="";return a=i?function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Dt(e,{fs:o}))return{error:`fpSrc[${e}] is not a file`};try{Pt(n.dirname(t),{fs:o}),o.copyFileSync(e,t)}catch(e){return{error:e}}return{success:"done: "+t}}(e,t,{path:n,fs:o}):async function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!Dt(e,{fs:o}))return{error:`fpSrc[${e}] is not a file`};let i=null;return await(async(e,t)=>{Pt(n.dirname(t),{fs:o}),await new Promise((r,n)=>{let i=o.createReadStream(e),a=o.createWriteStream(t);i.on("error",n),a.on("error",n),a.on("finish",r),i.pipe(a)})})(e,t).then(()=>{i={success:"done: "+t}}).catch(e=>{i={error:e}}),i}(e,t,{path:n,fs:o}),a}function Mt(r,n,o={}){return Ft(r,n,{path:t,fs:e,...o})}function Lt(r){return function(e,t={}){let r=pe(t,"path"),n=pe(t,"fs");if(!Ct(e,{fs:n})){let t=Pt(e,{fs:n});return t.error?t.error:{success:"done: "+e}}if(!$t(e,{fs:n}))return{error:"input path is not a folder"};try{let t=n.readdirSync(e);for(let o of t){let t=r.join(e,o);n.statSync(t).isDirectory()?n.rmSync(t,{recursive:!0,force:!0}):n.unlinkSync(t)}}catch(e){return{error:e}}return{success:"done: "+e}}(r,{path:t,fs:e})}function Bt(t){return Pt(t,{fs:e})}function Ut(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!$t(e,{fs:o}))return{error:`fpSrc[${e}] is not a folder`};try{o.readdirSync(e).forEach(function(r){let i=n.resolve(e,r),a=n.resolve(t,r),s=o.lstatSync(i);if(s.isDirectory())Pt(a,{fs:o}),Ut(i,a,{path:n,fs:o});else if(s.isSymbolicLink()){let e=o.readlinkSync(i);o.symlinkSync(e,a)}else Pt(n.dirname(a),{fs:o}),o.copyFileSync(i,a)})}catch(e){return{error:e}}return{success:"done: "+t}}function It(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"useSync","");Qe(i)||(i=!0);let a="";return a=i?Ut(e,t,{path:n,fs:o}):async function(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs");if(!$t(e,{fs:o}))return{error:`fpSrc[${e}] is not a folder`};let i=async(e,t)=>{let r=o.readdirSync(e);for(let a of r){let r=n.join(e,a),s=n.join(t,a),c=o.lstatSync(r);if(c.isDirectory())Pt(s,{fs:o}),await i(r,s);else if(c.isSymbolicLink()){let e=o.readlinkSync(r);o.symlinkSync(e,s)}else Pt(n.dirname(s),{fs:o}),await new Promise((e,t)=>{let n=o.createReadStream(r),i=o.createWriteStream(s);n.on("error",t),i.on("error",t),i.on("finish",e),n.pipe(i)})}},a=null;return await i(e,t).then(()=>{a={success:"done: "+t}}).catch(e=>{a={error:e}}),a}(e,t,{path:n,fs:o}),a}function qt(r,n,o={}){return It(r,n,{path:t,fs:e,...o})}function zt(e,t={}){let r=pe(t,"fs");if(!Ct(e,{fs:r}))return{success:"folder does not exist: "+e};if(!$t(e,{fs:r}))return{error:"input path is not a folder: "+e};try{r.rmSync(e,{recursive:!0,force:!0})}catch(e){return{error:e}}return{success:"done: "+e}}function Ht(e){if(!mt(e))return!1;return St(e)>0}function Yt(e,t=1,r={}){let n=1,o=pe(r,"path"),i=pe(r,"fs");if(!$t(e,{fs:i}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&Ht(t)&&(t=St(t))<1&&(t=1),function e(r){let a=[];return $t(r,{fs:i})?(Ge(i.readdirSync(r),function(s){let c=o.resolve(r,s),u=null;try{u=i.statSync(c)}catch(e){}u&&u.isDirectory()?(a.push({isFolder:!0,level:n,path:c,name:o.basename(c)}),n+=1,(n<=t||null===t)&&(a=a.concat(e(c))),n-=1):a.push({isFolder:!1,level:n,path:c,name:o.basename(c)})}),a):a}(e)}function Jt(r,n=1){return Yt(r,n,{path:t,fs:e})}function Wt(e,t={}){let r=pe(t,"fs"),n=pe(t,"crypto"),o=pe(t,"type","");tt(o)||(o="sha512");let i=Tt();if(!Dt(e,{fs:r}))return i.reject(`fp[${e}] is not a file`),i;try{let t=n.createHash(o),a=r.createReadStream(e);a.on("readable",()=>{let e=a.read();e?t.update(e):i.resolve(t.digest("hex"))}),a.on("error",e=>{i.reject(e.toString())})}catch(e){i.reject(e.toString())}return i}function Vt(e){var t=this.__data__=new W(e);this.size=t.size}Vt.prototype.clear=function(){this.__data__=new W,this.size=0},Vt.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vt.prototype.get=function(e){return this.__data__.get(e)},Vt.prototype.has=function(e){return this.__data__.has(e)},Vt.prototype.set=function(e,t){var r=this.__data__;if(r instanceof W){var n=r.__data__;if(!V||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new G(n)}return r.set(e,t),this.size=r.size,this};function Kt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new G;++t<r;)this.add(e[t])}function Gt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Zt(e,t){return e.has(t)}Kt.prototype.add=Kt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Kt.prototype.has=function(e){return this.__data__.has(e)};function Xt(e,t,r,n,o,i){var a=1&r,s=e.length,c=t.length;if(s!=c&&!(a&&c>s))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,d=!0,p=2&r?new Kt:void 0;for(i.set(e,t),i.set(t,e);++f<s;){var h=e[f],y=t[f];if(n)var m=a?n(y,h,f,t,e,i):n(h,y,f,e,t,i);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!Gt(t,function(e,t){if(!Zt(p,t)&&(h===e||o(h,e,r,n,i)))return p.push(t)})){d=!1;break}}else if(h!==y&&!o(h,y,r,n,i)){d=!1;break}}return i.delete(e),i.delete(t),d}var Qt=f.Uint8Array;function er(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function tr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var rr=d?d.prototype:void 0,nr=rr?rr.valueOf:void 0;function or(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var a=e[r];t(a,r,e)&&(i[o++]=a)}return i}var ir=Object.prototype.propertyIsEnumerable,ar=Object.getOwnPropertySymbols,sr=ar?function(e){return null==e?[]:(e=Object(e),or(ar(e),function(t){return ir.call(e,t)}))}:function(){return[]};function cr(e){return function(e,t,r){var n=t(e);return c(e)?n:function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}(n,r(e))}(e,Je,sr)}var ur=Object.prototype.hasOwnProperty;var lr=B(f,"DataView"),fr=B(f,"Promise"),dr=B(f,"Set"),pr=B(f,"WeakMap"),hr="[object Map]",yr="[object Promise]",mr="[object Set]",gr="[object WeakMap]",vr="[object DataView]",br=C(lr),wr=C(V),Sr=C(fr),_r=C(dr),Or=C(pr),jr=b;(lr&&jr(new lr(new ArrayBuffer(1)))!=vr||V&&jr(new V)!=hr||fr&&jr(fr.resolve())!=yr||dr&&jr(new dr)!=mr||pr&&jr(new pr)!=gr)&&(jr=function(e){var t=b(e),r="[object Object]"==t?e.constructor:void 0,n=r?C(r):"";if(n)switch(n){case br:return vr;case wr:return hr;case Sr:return yr;case _r:return mr;case Or:return gr}return t});var Er=jr,Rr="[object Arguments]",Ar="[object Array]",Tr="[object Object]",kr=Object.prototype.hasOwnProperty;function xr(e,t,r,n,o,i){var a=c(e),s=c(t),u=a?Ar:Er(e),l=s?Ar:Er(t),f=(u=u==Rr?Tr:u)==Tr,d=(l=l==Rr?Tr:l)==Tr,p=u==l;if(p&&Re(e)){if(!Re(t))return!1;a=!0,f=!1}if(p&&!f)return i||(i=new Vt),a||Me(e)?Xt(e,t,r,n,o,i):function(e,t,r,n,o,i,a){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Qt(e),new Qt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return H(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=er;case"[object Set]":var c=1&n;if(s||(s=tr),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var l=Xt(s(e),s(t),n,o,i,a);return a.delete(e),l;case"[object Symbol]":if(nr)return nr.call(e)==nr.call(t)}return!1}(e,t,u,r,n,o,i);if(!(1&r)){var h=f&&kr.call(e,"__wrapped__"),y=d&&kr.call(t,"__wrapped__");if(h||y){var m=h?e.value():e,g=y?t.value():t;return i||(i=new Vt),o(m,g,r,n,i)}}return!!p&&(i||(i=new Vt),function(e,t,r,n,o,i){var a=1&r,s=cr(e),c=s.length;if(c!=cr(t).length&&!a)return!1;for(var u=c;u--;){var l=s[u];if(!(a?l in t:ur.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++u<c;){var y=e[l=s[u]],m=t[l];if(n)var g=a?n(m,y,l,t,e,i):n(y,m,l,e,t,i);if(!(void 0===g?y===m||o(y,m,r,n,i):g)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,r,n,o,i))}function Cr(e,t,r,n,o){return e===t||(null==e||null==t||!w(e)&&!w(t)?e!=e&&t!=t:xr(e,t,r,n,Cr,o))}function $r(e){return e==e&&!E(e)}function Nr(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}function Dr(e){var t=function(e){for(var t=Je(e),r=t.length;r--;){var n=t[r],o=e[n];t[r]=[n,o,$r(o)]}return t}(e);return 1==t.length&&t[0][2]?Nr(t[0][0],t[0][1]):function(r){return r===e||function(e,t,r,n){var o=r.length,i=o,a=!n;if(null==e)return!i;for(e=Object(e);o--;){var s=r[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var c=(s=r[o])[0],u=e[c],l=s[1];if(a&&s[2]){if(void 0===u&&!(c in e))return!1}else{var f=new Vt;if(n)var d=n(u,l,c,e,t,f);if(!(void 0===d?Cr(l,u,3,n,f):d))return!1}}return!0}(r,e,t)}}function Pr(e,t){return null!=e&&t in Object(e)}function Fr(e,t){return null!=e&&function(e,t,r){for(var n=-1,o=(t=le(t,e)).length,i=!1;++n<o;){var a=fe(t[n]);if(!(i=null!=e&&r(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&ke(o)&&Te(a,o)&&(c(e)||_e(e))}(e,t,Pr)}function Mr(e){return function(t){return null==t?void 0:t[e]}}function Lr(e){return j(e)?Mr(fe(e)):function(e){return function(t){return de(t,e)}}(e)}function Br(e){return"function"==typeof e?e:null==e?Ke:"object"==typeof e?c(e)?function(e,t){return j(e)&&$r(t)?Nr(fe(e),t):function(r){var n=pe(r,e);return void 0===n&&n===t?Fr(r,e):Cr(t,n,3)}}(e[0],e[1]):Dr(e):Lr(e)}function Ur(e,t){var r=-1,n=Ye(e)?Array(e.length):[];return Ve(e,function(e,o,i){n[++r]=t(e,o,i)}),n}var Ir=Mr("length"),qr=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var zr="\\ud800-\\udfff",Hr="["+zr+"]",Yr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Jr="\\ud83c[\\udffb-\\udfff]",Wr="[^"+zr+"]",Vr="(?:\\ud83c[\\udde6-\\uddff]){2}",Kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Gr="(?:"+Yr+"|"+Jr+")"+"?",Zr="[\\ufe0e\\ufe0f]?",Xr=Zr+Gr+("(?:\\u200d(?:"+[Wr,Vr,Kr].join("|")+")"+Zr+Gr+")*"),Qr="(?:"+[Wr+Yr+"?",Yr,Vr,Kr,Hr].join("|")+")",en=RegExp(Jr+"(?="+Jr+")|"+Qr+Xr,"g");function tn(e){return function(e){return qr.test(e)}(e)?function(e){for(var t=en.lastIndex=0;en.test(e);)++t;return t}(e):Ir(e)}function rn(e){if(null==e)return 0;if(Ye(e))return"string"==typeof(t=e)||!c(t)&&w(t)&&"[object String]"==b(t)?tn(e):e.length;var t,r=Er(e);return"[object Map]"==r||"[object Set]"==r?e.size:He(e).length}function nn(e,t){return tt(e)&&_t(t)?0===(t=St(t))?e:function(e,t){if(!tt(e))return"";if(!_t(t))return"";if(0===(t=St(t)))return"";let r=e.length-t;return r<0&&(r=0),e.substring(r,r+t)}(e,e.length-t):""}function on(e,t){var r=[];return Ve(e,function(e,n,o){t(e,n,o)&&r.push(e)}),r}function an(e,t){return(c(e)?or:on)(e,Br(t))}function sn(e,t,r,n={}){let o=pe(n,"withInfor");Qe(o)||(o=!0);let i={del:[],add:[],same:[],diff:[]};if(!tt(r))return console.log("invalid key"),o&&(i.infor={}),i;kt(e)||(e=[e]),kt(t)||(t=[t]),e=an(e,e=>Rt(e,r)),t=an(t,e=>Rt(e,r));let a=new Map(t.map(e=>[e[r],e]));for(let t of e){let e=a.get(t[r]);if(e){JSON.stringify(t)===JSON.stringify(e)?i.same.push(e):i.diff.push(e),a.delete(t[r])}else i.del.push(t)}if(i.add=Array.from(a.values()),o){let e={};for(let t of i.del)e[t[r]]="del";for(let t of i.add)e[t[r]]="add";for(let t of i.diff)e[t[r]]="diff";for(let t of i.same)e[t[r]]="same";i.infor=e}return i}function cn(e,t={}){let r=pe(t,"fs");if(!Ct(e,{fs:r}))return{success:"file does not exist: "+e};if(!Dt(e,{fs:r}))return{error:"input path is not a file: "+e};try{r.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}var un=Array.prototype.join;async function ln(e,t={}){let r=pe(t,"path"),n=pe(t,"fs"),o=pe(t,"crypto"),i=pe(t,"type","");tt(i)||(i="md5");let a=[],s=Yt(e,null,{path:r,fs:n});var c,u;return await xt(s,async e=>{if(e.isFolder)return;let t=await Wt(e.path,{fs:n,crypto:o,type:i});a.push(t)}),u="|",null==(c=a)?"":un.call(c,u)}async function fn(e,t=1,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"crypto"),a=pe(r,"type","");tt(a)||(a="md5");let s=pe(r,"forFile",null);Qe(s)||(s=!0);let c=pe(r,"forFolder",null);if(Qe(c)||(c=!1),!$t(e,{fs:o}))throw new Error(`fd[${e}] is not a folder`);let u=Yt(e,t,{path:n,fs:o});return u=await xt(u,async e=>{let t="";return s&&!e.isFolder&&(t=await Wt(e.path,{fs:o,crypto:i,type:a})),c&&e.isFolder&&(t=await ln(e.path,{path:n,fs:o,crypto:i,type:a})),e.hash=t,e}),u}async function dn(e,t,r={}){let n=pe(r,"path"),o=pe(r,"fs"),i=pe(r,"crypto"),a=pe(r,"type","");if(tt(a)||(a="md5"),!$t(e,{fs:o}))throw new Error(`fdSrc[${e}] is not a folder`);let s=!1;if(!$t(t,{fs:o}))return await It(e,t,{path:n,fs:o,useSync:!1}),s=!0,s;let u=n.sep,l=n.sep.length,f=(e,t)=>{let r=e.isFolder?"folder":"file",n=e.path.replace(t,"");var o,i;return i=l,(tt(o=n)&&_t(i)?0===(i=St(i))?"":o.substring(0,i):"")===u&&(n=nn(n,l)),n=n.replaceAll("\\","/"),{id:`${r}|${n}`,isFolder:e.isFolder,name:e.name,rpath:n,hash:e.hash}},d=(e,t)=>{var r,n;return n=e=>f(e,t),e=(c(r=e)?ie:Ur)(r,Br(n))},p=await fn(e,null,{path:n,fs:o,crypto:i,type:a,forFile:!0,forFolder:!1});p=d(p,n.resolve(e));let h=await fn(t,null,{path:n,fs:o,crypto:i,type:a,forFile:!0,forFolder:!1});h=d(h,n.resolve(t));let y=sn(h,p,"id",{withInfor:!1});return s=rn(y.del)>0||rn(y.add)>0||rn(y.diff)>0,await xt(y.del,async e=>{if(e.isFolder){zt(n.resolve(t,e.rpath),{fs:o})}}),await xt(y.del,async e=>{if(!e.isFolder){cn(n.resolve(t,e.rpath),{fs:o})}}),await xt([...y.add,...y.diff],async r=>{if(!r.isFolder){let i=n.resolve(e,r.rpath),a=n.resolve(t,r.rpath);await Ft(i,a,{path:n,fs:o,useSync:!1})}}),s}function pn(e){if(Et(e)){for(let t in e)return!0;return!1}return!1}var hn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function yn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var gn={exports:{}};var vn,bn={exports:{}},wn=mn(Object.freeze({__proto__:null,default:{}}));function Sn(){return vn||(vn=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==hn&&hn.crypto&&(r=hn.crypto),!r)try{r=wn}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var a=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=a<<24-(n+i)%4*8}else for(var s=0;s<o;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),u=i.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,i);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(o,f);r=o.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}});var h=i.algo={};return i}(Math),t)}(bn)),bn.exports}!function(e){e.exports=Sn().enc.Utf8}(gn);var _n=yn(gn.exports),On={exports:{}};!function(e){var t;e.exports=(t=Sn(),function(){var e=t,r=e.lib.WordArray;function n(e,t,n){for(var o=[],i=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2|n[e.charCodeAt(a)]>>>6-a%4*2;o[i>>>2]|=s<<24-i%4*8,i++}return r.create(o,i)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],i=0;i<r;i+=3)for(var a=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,s=0;s<4&&i+.75*s<r;s++)o.push(n.charAt(a>>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e){var t=e.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return n(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(On);var jn=yn(On.exports);function En(e){if(!tt(e))return"";let t=_n.parse(e);return jn.stringify(t)}var Rn={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",s="day",c="week",u="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],r=e%100;return"["+e+(t[(r-20)%10]||t[r]||t[0])+"]"}},g=function(e,t,r){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(r)+e},v={s:g,z:function(e){var t=-e.utcOffset(),r=Math.abs(t),n=Math.floor(r/60),o=r%60;return(t<=0?"+":"-")+g(n,2,"0")+":"+g(o,2,"0")},m:function e(t,r){if(t.date()<r.date())return-e(r,t);var n=12*(r.year()-t.year())+(r.month()-t.month()),o=t.clone().add(n,u),i=r-o<0,a=t.clone().add(n+(i?-1:1),u);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:f,w:c,d:s,D:d,h:a,m:i,s:o,ms:n,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},b="en",w={};w[b]=m;var S="$isDayjsObject",_=function(e){return e instanceof R||!(!e||!e[S])},O=function e(t,r,n){var o;if(!t)return b;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var s=t.name;w[s]=t,o=s}return!n&&o&&(b=o),o||!n&&b},j=function(e,t){if(_(e))return e.clone();var r="object"==typeof t?t:{};return r.date=e,r.args=arguments,new R(r)},E=v;E.l=O,E.i=_,E.w=function(e,t){return j(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var R=function(){function m(e){this.$L=O(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[S]=!0}var g=m.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,r=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return E},g.isValid=function(){return!(this.$d.toString()===p)},g.isSame=function(e,t){var r=j(e);return this.startOf(t)<=r&&r<=this.endOf(t)},g.isAfter=function(e,t){return j(e)<this.startOf(t)},g.isBefore=function(e,t){return this.endOf(t)<j(e)},g.$g=function(e,t,r){return E.u(e)?this[t]:this.set(r,e)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(e,t){var r=this,n=!!E.u(t)||t,l=E.p(e),p=function(e,t){var o=E.w(r.$u?Date.UTC(r.$y,t,e):new Date(r.$y,t,e),r);return n?o:o.endOf(s)},h=function(e,t){return E.w(r.toDate()[e].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),r)},y=this.$W,m=this.$M,g=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case u:return n?p(1,m):p(0,m+1);case c:var b=this.$locale().weekStart||0,w=(y<b?y+7:y)-b;return p(n?g-w:g+(6-w),m);case s:case d:return h(v+"Hours",0);case a:return h(v+"Minutes",1);case i:return h(v+"Seconds",2);case o:return h(v+"Milliseconds",3);default:return this.clone()}},g.endOf=function(e){return this.startOf(e,!1)},g.$set=function(e,t){var r,c=E.p(e),l="set"+(this.$u?"UTC":""),p=(r={},r[s]=l+"Date",r[d]=l+"Date",r[u]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[i]=l+"Minutes",r[o]=l+"Seconds",r[n]=l+"Milliseconds",r)[c],h=c===s?this.$D+(t-this.$W):t;if(c===u||c===f){var y=this.clone().set(d,1);y.$d[p](h),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},g.set=function(e,t){return this.clone().$set(e,t)},g.get=function(e){return this[E.p(e)]()},g.add=function(n,l){var d,p=this;n=Number(n);var h=E.p(l),y=function(e){var t=j(p);return E.w(t.date(t.date()+Math.round(e*n)),p)};if(h===u)return this.set(u,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===s)return y(1);if(h===c)return y(7);var m=(d={},d[i]=t,d[a]=r,d[o]=e,d)[h]||1,g=this.$d.getTime()+n*m;return E.w(g,this)},g.subtract=function(e,t){return this.add(-1*e,t)},g.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,s=this.$M,c=r.weekdays,u=r.months,l=r.meridiem,f=function(e,r,o,i){return e&&(e[r]||e(t,n))||o[r].slice(0,i)},d=function(e){return E.s(i%12||12,e,"0")},h=l||function(e,t,r){var n=e<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(y,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return s+1;case"MM":return E.s(s+1,2,"0");case"MMM":return f(r.monthsShort,s,u,3);case"MMMM":return f(u,s);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return f(r.weekdaysMin,t.$W,c,2);case"ddd":return f(r.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(i);case"HH":return E.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return E.s(a,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return o}return null}(e)||o.replace(":","")})},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,p){var h,y=this,m=E.p(d),g=j(n),v=(g.utcOffset()-this.utcOffset())*t,b=this-g,w=function(){return E.m(y,g)};switch(m){case f:h=w()/12;break;case u:h=w();break;case l:h=w()/3;break;case c:h=(b-v)/6048e5;break;case s:h=(b-v)/864e5;break;case a:h=b/r;break;case i:h=b/t;break;case o:h=b/e;break;default:h=b}return p?h:E.a(h)},g.daysInMonth=function(){return this.endOf(u).$D},g.$locale=function(){return w[this.$L]},g.locale=function(e,t){if(!e)return this.$L;var r=this.clone(),n=O(e,t,!0);return n&&(r.$L=n),r},g.clone=function(){return E.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},m}(),A=R.prototype;return j.prototype=A,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",s],["$M",u],["$y",f],["$D",d]].forEach(function(e){A[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),j.extend=function(e,t){return e.$i||(e(t,R,j),e.$i=!0),j},j.locale=O,j.isDayjs=_,j.unix=function(e){return j(1e3*e)},j.en=w[b],j.Ls=w,j.p={},j}()}(Rn);var An=yn(Rn.exports);function Tn(){if(!Ot(An))throw new Error("invalid dayjs");return An().format("YYYY-MM-DDTHH:mm:ssZ")}var kn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}function o(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new o(n,i||e,a),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,o=[];if(0===this._eventsCount)return o;for(n in e=this._events)t.call(e,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o<i;o++)a[o]=n[o].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,o,i,a){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,l=this._events[s],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,o),!0;case 5:return l.fn.call(l.context,t,n,o,i),!0;case 6:return l.fn.call(l.context,t,n,o,i,a),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,o);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},s.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,o){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||o&&!s.once||n&&s.context!==n||a(this,i);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==t||o&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[i]=1===u.length?u[0]:u:a(this,i)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(kn);var xn=yn(kn.exports);function Cn(){return new xn}var $n=Ie(Object.getPrototypeOf,Object),Nn=Function.prototype,Dn=Object.prototype,Pn=Nn.toString,Fn=Dn.hasOwnProperty,Mn=Pn.call(Object);function Ln(e){if(!w(e))return!1;var t=b(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!function(e){if(!w(e)||"[object Object]"!=b(e))return!1;var t=$n(e);if(null===t)return!0;var r=Fn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Pn.call(r)==Mn}(e)}function Bn(e){if(!(tt(e)||ht(e)||S(e)||function(e){return"[object BigInt]"===Object.prototype.toString.call(e)}(e)))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}function Un(e){let t="";if(Ln(e))t=e.message;else{if(et(e))return e;if(Et(e))return Rt(e,"message")?e.message:JSON.stringify(e);if(kt(e))return JSON.stringify(e);t=Bn(e)}return t}function In(t){return Dt(t,{fs:e})}function qn(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function zn(e=300){return new function(e){let t=[],r=null,n=Date.now();return Ht(e)||(e=300),e=St(e),function(o,...i){Ot(o)?(n=Date.now(),t.push({func:o,input:i}),null===r&&(r=setInterval(()=>{if(0===rn(t))return clearInterval(r),void(r=null);if(Date.now()-n>e){let e=t.pop();t=[];try{e.func(...e.input)}catch(e){console.log("m.func catch",e)}}},10))):console.log("func is not a function")}}(e)}function Hn(e,r={}){let i=pe(r,"polling");Qe(i)||(i=!1);let a=pe(r,"timeInterval");Ht(a)||(a=100),a=St(a);let s=pe(r,"timeBinaryInterval");Ht(s)||(s=300),s=St(s);let c=new n.EventEmitter,u=e,l=null,f=setInterval(()=>{null===l&&In(u)&&(l=o.watch(u,{usePolling:i,interval:a,binaryInterval:s,awaitWriteFinish:!0}),l.on("all",(e,r,n)=>{r=t.resolve(r),c.emit("change",{type:e,fp:r,stats:n})}))},a);return c.clear=()=>{(()=>{if(null!==l){try{l.unwatch(u)}catch(e){console.log(e)}l.close().catch(e=>{console.log(e)}).finally(()=>{l=null})}})(),clearInterval(f)},c}function Yn(t,r,n={}){Nt(t)||Bt(t),Nt(r)||Bt(r);let o=`${t}/fpHash.json`,i=`${r}/fpHash.json`,a=t=>{let r={};try{r=function(e){if(!tt(e))return{};let t={};try{t=JSON.parse(e)}catch(e){t={}}return t}(e.readFileSync(t,"utf8"))}catch(e){}return r},s=(t,r)=>{try{let n=function(e,t=!1){if(qn(e))return"";let r="";try{r=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){r=""}return r}(r);e.writeFileSync(t,n,"utf8")}catch(e){}},c=(e,t)=>pe(a(e),t,""),u=(e,t,r)=>{let n=a(e);n[t]=r,s(e,n)},l=(e,t)=>{let r=a(e);Rt(r,t)&&delete r[t],s(e,r)},f=()=>a(o),d=e=>s(o,e),p=e=>c(o,e),h=()=>a(i),y=e=>s(i,e),m=e=>c(i,e),g=(e,t)=>u(i,e,t),v=e=>l(i,e),b=e=>{let t=[];return Ge(e,(e,r)=>{t.push({fp:r,hash:e})}),t};return{buildSrc:()=>{let e=Cn();return e.set=(t,r)=>{((e,t)=>{u(o,e,t)})(t,r),e.emit("set",{type:"set",fp:t,hash:r})},e.get=p,e.remove=t=>{(e=>{l(o,e)})(t),e.emit("remove",{type:"remove",fp:t})},e.readKp=f,e.writeKp=d,e},buildTar:()=>{let e=Cn(),t=zn(300),r=Hn(o);return r.on("change",r=>{t(()=>{(async()=>{let t=Tt(),r=f();if(!pn(r))return t.resolve("no src"),t;let n=h(),o=b(r),i=sn(b(n),o,"fp",{withInfor:!1}),a=Tt();return a.then(e=>{y(r)}).catch(()=>{}),e.emit("change",{kpSrc:r,kpTar:n,kpCmp:i,pm:a}),t})().catch(()=>{})})}),e.set=g,e.get=m,e.remove=v,e.readKp=h,e.writeKp=y,e.clear=r.clear,e}}}let Jn=i.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(Jn).href:"undefined"==typeof document?location.href:s&&"SCRIPT"===s.tagName.toUpperCase()&&s.src||new URL("w-dwdata-tweqod.umd.js",document.baseURI).href),Wn=t.dirname(Jn);let Vn=async(r={})=>{let n=pe(r,"keyId");tt(n)||(n="id");let o=pe(r,"fdTagRemove");tt(o)||(o="./_tagRemove");let i=pe(r,"fdTaskCpActualSrc");tt(i)||(i="./_taskCpActualSrc"),Nt(i)||Bt(i);let s=pe(r,"fdTaskCpSrc");tt(s)||(s="./_taskCpSrc"),Nt(s)||Bt(s);let c=pe(r,"fdLog");tt(c)||(c="./_logs"),Nt(c)||Bt(c);let u=pe(r,"funGetNew");if(!Ot(u))throw new Error("invalid funGetNew");let l=pe(r,"funGetCurrent");if(!Ot(l))throw new Error("invalid funGetCurrent");let f=pe(r,"funAdd"),d=pe(r,"funModify"),p=pe(r,"funRemove"),h=pe(r,"funAfterStart"),y=pe(r,"funBeforeEnd"),m=pe(r,"timeToleranceRemove");_t(m)||(m=0),m=yt(m),m>0&&!Nt(o)&&Bt(o);let g=pe(r,"eventNameProcCallfunGetNew");tt(g)||(g="proc-callfun-getNew");let v=pe(r,"eventNameProcCallfunGetCurrent");tt(v)||(v="proc-callfun-getCurrent");let b=pe(r,"eventNameProcAddCallfunAdd");tt(b)||(b="proc-add-callfun-add");let w=pe(r,"eventNameProcDiffCallfunModify");tt(w)||(w="proc-diff-callfun-modify");let S=pe(r,"eventNameProcRemoveCallfunRemove");tt(S)||(S="proc-remove-callfun-remove");let _=pe(r,"eventNameProcCallfunAfterStart");tt(_)||(_="proc-callfun-afterStart");let O=pe(r,"eventNameProcCallfunBeforeEnd");tt(O)||(O="proc-callfun-beforeEnd");let j=pe(r,"eventNameProcCoreDetect");tt(j)||(j="proc-coreDetect");let E=pe(r,"eventNameProcRetakeRemove");tt(E)||(E="proc-retake-remove");let R=pe(r,"eventNameProcCoreRetake");tt(R)||(R="proc-coreRetake");let A=Cn(),T=function(r={}){let n=Cn(),o=pe(r,"timeZone",null),i=pe(r,"fdLog");tt(i)||(i="./_logs");let s=pe(r,"interval");"day"!==s&&"hr"!==s&&(s="day");let c=pe(r,"numKeep");Ht(c)||(c="day"===s?365:8760),c=St(c);let u=a.transport({targets:[{level:"info",target:t.resolve(Wn,"./formatter.mjs"),options:{interval:s,fdLog:i,timeZone:o}}]}),l=a(u),f=()=>{try{if(!Nt(i))return;let r="hr"===s?/^\d{4}-\d{2}-\d{2}T\d{2}\.log$/:/^\d{4}-\d{2}-\d{2}\.log$/,o=e.readdirSync(i).filter(e=>r.test(e));o.sort();let a=o.length-c;if(a<=0)return;let u=o.slice(0,a);for(let r of u){let o=t.join(i,r);try{e.unlinkSync(o),n.emit("delete",{fp:o,fn:r})}catch(e){}}}catch(e){console.error("WSyslog cleanLogs error:",e)}};f();let d=setInterval(f,36e5);d.unref();let p=null,h=e=>{let t=l[e].bind(l);return(...r)=>{try{n.emit(e,{args:r})}catch(e){}t(...r)}};return n.fatal=h("fatal"),n.error=h("error"),n.warn=h("warn"),n.info=h("info"),n.debug=h("debug"),n.trace=h("trace"),n.cleanLogs=f,n.clear=(e={})=>{if(null!==p)return p;let t=pe(e,"timeLimit");Ht(t)||(t=6e4),p=Tt();let r=!1,n=()=>{r||(r=!0,clearInterval(d),p.resolve())},o=setTimeout(()=>{try{u.worker.terminate()}catch(e){}n()},t);try{l.flush(e=>{if(e||u.closed)return clearTimeout(o),void n();u.once("close",()=>{clearTimeout(o),n()}),u.end()})}catch(e){clearTimeout(o),n()}return p},n}({fdLog:c,interval:"hr"}),k={info:e=>{T.info(e),A.emit("change",{type:"info",...e})},warn:e=>{T.warn(e),A.emit("change",{type:"warn",...e})},error:e=>{T.error(e),A.emit("change",{type:"error",...e})}},x=async t=>{let r=await(async(t,r,n="")=>{let i="";if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);i=o;let a=`${i}/${r}`,s={time:Tn(),hash:n};e.writeFileSync(a,JSON.stringify(s),"utf8")})("remove",t);return r},C=async(t,r={})=>{let n=await(async(t,r,n={})=>{let i=pe(n,"checkTime");Qe(i)||(i=!0);let a=pe(n,"timeNow"),s="",c=0;if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);s=o,c=m;let u=`${s}/${r}`;if(!In(u))return{b:!1,msg:`fp[${u}] is not a file`};if(!i)return{b:!0,msg:`fp[${u}] exists`};if(!pn(a))throw new Error("invalid timeNow");let l=e.readFileSync(u,"utf8"),f=pe(JSON.parse(l),"time"),d=An(f),p=a.diff(d,"millisecond"),h=p>=c;return h?{b:h,msg:`time difference[${p}] >= time tolerance[${c}]`}:{b:h,msg:"allowable time difference"}})("remove",t,r);return n},$=async(t,r)=>{let n="";if("add"===t)throw new Error("does not support add");if("modify"===t)throw new Error("does not support modify");if("remove"!==t)throw new Error(`invalid mode[${t}]`);n=o;let i=`${n}/${r}`;if(!In(i))return;let a=e.readFileSync(i,"utf8"),s=JSON.parse(a),c=cn(i,{fs:e});if(c.error)throw new Error(c.error);return s},N=async e=>await $("remove",e),D=null,P=null,F=(async()=>{await function(e=10){ht(e)||(e=10);let t=Tt();return setTimeout(function(){t.resolve()},e),t}(1);let e=An();k.info({event:"start",timeRunStart:e.format("YYYY-MM-DDTHH:mm:ssZ"),msg:"running..."});let t=Yn(i,i);D=t.buildSrc();let r=Yn(s,s);P=r.buildSrc();let o="";tt(o)||await(async()=>{if(Ot(h))try{k.info({event:_,msg:"start..."});let e=h();jt(e)&&(e=await e),k.info({event:_,msg:"done"})}catch(e){console.log(e),k.error({event:_,msg:Un(e)}),o="error at proc-callfun-afterStart"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-afterStart",msg:o})):null})().catch(()=>{});tt(o)||await(async()=>{let e=[];try{k.info({event:g,msg:"start..."});let t=u();jt(t)&&(t=await t),e=t,k.info({event:g,num:rn(t),msg:"done"})}catch(e){console.log(e),k.error({event:g,msg:Un(e)}),o="error at proc-callfun-getNew"}if(tt(o))return console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o});let t=[];try{k.info({event:v,msg:"start..."});let e=l();jt(e)&&(e=await e),t=e,k.info({event:v,num:rn(e),msg:"done"})}catch(e){console.log(e),k.error({event:v,msg:Un(e)}),o="error at proc-callfun-getCurrent"}if(tt(o))return console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o});if(0===rn(e))return console.log("invalid data, task canceled"),void k.info({event:"cancel-stage-main",msg:"no data"});let r=null;try{k.info({event:"proc-compare",msg:"start..."}),r=sn(t,e,n,{withInfor:!1});let o=rn(r.del),i=rn(r.add),a=rn(r.diff),s=rn(r.same);k.info({event:"proc-compare",numRemove:o,numAdd:i,numModify:a,numSame:s,msg:"done"})}catch(e){console.log(e),k.error({event:"proc-compare",msg:Un(e)}),o="error at proc-compare"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):pn(r)?0!==rn(r.del)||0!==rn(r.add)||0!==rn(r.diff)?(await xt(r.del,async e=>{if(!tt(o)){try{if(k.info({event:S,[n]:e[n],msg:"start..."}),Ot(p)){let t=p(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:S,[n]:e[n],msg:Un(t)}),o="error at proc-remove-callfun-remove"}if(!tt(o))try{D.remove(e[n]),m<=0?(P.remove(e[n]),k.info({event:S,[n]:e[n],msg:"done"})):(await C(e[n],{checkTime:!1})).b||(await x(e[n]),k.info({event:S,[n]:e[n],msg:"add-tag"}))}catch(t){console.log(t),k.error({event:S,[n]:e[n],msg:Un(t)}),o="error at proc-remove-callfun-remove"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):(await xt(r.add,async e=>{if(!tt(o)){try{if(k.info({event:b,[n]:e[n],msg:"start..."}),Ot(f)){let t=f(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:b,[n]:e[n],msg:Un(t)}),o="error at proc-add-callfun-add"}if(!tt(o))try{let t=En(JSON.stringify(e));D.set(e[n],t),P.set(e[n],t),m>0&&(await C(e[n],{checkTime:!1})).b&&(await N(e[n]),k.info({event:b,[n]:e[n],msg:"release-tag"})),k.info({event:b,[n]:e[n],msg:"done"})}catch(t){console.log(t),k.error({event:b,[n]:e[n],msg:Un(t)}),o="error at proc-add-callfun-add"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):(await xt(r.diff,async e=>{if(!tt(o)){try{if(k.info({event:w,[n]:e[n],msg:"start..."}),Ot(d)){let t=d(e);jt(t)&&(t=await t)}}catch(t){console.log(t),k.error({event:w,[n]:e[n],msg:Un(t)}),o="error at proc-diff-callfun-modify"}if(!tt(o))try{let t=En(JSON.stringify(e));D.set(e[n],t),P.set(e[n],t),k.info({event:w,[n]:e[n],msg:"done"})}catch(t){console.log(t),k.error({event:w,[n]:e[n],msg:Un(t)}),o="error at proc-diff-callfun-modify"}}}),tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-main",msg:o})):null))):void k.info({event:"cancel-stage-main",msg:"no difference"}):(console.log("can not calculate the difference, task canceled"),void k.info({event:"cancel-stage-main",msg:"can not calculate the difference between the data before and after"}))})().catch(()=>{});await(async()=>{if(Ot(y))try{k.info({event:O,msg:"start..."});let e=y();jt(e)&&(e=await e),k.info({event:O,msg:"done"})}catch(e){console.log(e),k.error({event:O,msg:Un(e)}),o="error at proc-callfun-beforeEnd"}return tt(o)?(console.log("error occurred, task canceled"),void k.info({event:"cancel-stage-beforeEnd",msg:o})):null})().catch(()=>{}),k.info({event:"end",...(()=>{let t=An(),r=t.diff(e,"second");return{timeRunStart:e.format("YYYY-MM-DDTHH:mm:ssZ"),timeRunEnd:t.format("YYYY-MM-DDTHH:mm:ssZ"),timeRunSpent:`${r}s`}})(),msg:"done"})})().catch(e=>{console.log(e),k.error({event:j,msg:Un(e)})}),M=(async()=>{if(m<=0)return;await async function(e,t={}){let r=null,n=Tt();if(!Ot(e))return n.reject("waitfunction需輸入函數f"),n;let o=async()=>{let t=e();return jt(t)&&(t=await t),t};if(r=await o(),!0===r)return n.resolve(),n;let i=pe(t,"attemptNum",null);Ht(i)||(i=200);let a=pe(t,"timeInterval",null);Ht(a)||(a=1e3);let s=0,c=setInterval(async()=>{s+=1,r=await o(),!0===r&&(clearInterval(c),n.resolve()),s>i&&(clearInterval(c),n.reject(`exceeded attemptNum[${i}]`))},a);return n}(()=>null!==P);let e=An(),t=Jt(o,1);0!==rn(t)&&await xt(t,async t=>{let r=(await C(t.name,{timeNow:e,checkTime:!0})).b,o=!tt(D.get(t.name)),i=tt(P.get(t.name));r&&o&&i&&(await N(t.name),k.info({event:E,[n]:t.name,from:"debounce",msg:"release-tag"}),P.remove(t.name),k.info({event:E,[n]:t.name,from:"debounce",msg:"done"}))})})().catch(e=>{console.log(e),k.error({event:R,msg:Un(e)})});return A.srlog=k,Promise.all([F,M]).finally(()=>{A.emit("end")}),A},Kn=async(n={})=>{let o=pe(n,"keyId");tt(o)||(o="id");let i=pe(n,"fdTagRemove");tt(i)||(i="./_tagRemove");let a=pe(n,"fdDwAttime");tt(a)||(a="./_dwAttime"),Nt(a)||Bt(a);let s=pe(n,"fdDwCurrent");tt(s)||(s="./_dwCurrent"),Nt(s)||Bt(s);let c=pe(n,"fdTaskCpActualSrc");tt(c)||(c="./_taskCpActualSrc"),Nt(c)||Bt(c);let u=pe(n,"fdTaskCpSrc");tt(u)||(u="./_taskCpSrc"),Nt(u)||Bt(u);let l=pe(n,"fdLog");tt(l)||(l="./_logs"),Nt(l)||Bt(l);let f=pe(n,"funDownload");if(!Ot(f))throw new Error("invalid funDownload");let d=pe(n,"funGetCurrent");if(!Ot(d))throw new Error("invalid funGetCurrent");let p=pe(n,"funAdd");if(!Ot(p))throw new Error("invalid funAdd");let h=pe(n,"funModify");if(!Ot(h))throw new Error("invalid funModify");let y=pe(n,"funRemove");if(!Ot(y))throw new Error("invalid funRemove");let m=pe(n,"funAfterStart"),g=pe(n,"funBeforeEnd"),v=pe(n,"timeToleranceRemove");_t(v)||(v=0),v=yt(v);let b=async()=>{await function(n,o,i={}){return dn(n,o,{path:t,fs:e,crypto:r,...i})}(a,s)};return Vn({keyId:o,fdTagRemove:i,fdTaskCpActualSrc:c,fdTaskCpSrc:u,fdLog:l,funGetNew:f,funGetCurrent:d,funAdd:p,funModify:h,funRemove:y,funAfterStart:async()=>{if(Ot(m)){let e=m();jt(e)&&(e=await e)}},funBeforeEnd:async()=>{if(await b(),Ot(g)){let e=g();jt(e)&&(e=await e)}},timeToleranceRemove:v,eventNameProcCallfunGetNew:"proc-callfun-download"})};function Gn(e){return!!qn(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!function(e){if(Et(e)){for(let t in e)return!1;return!0}return!1}(e)||(!!function(e){return!(!et(e)||""!==e)}(e)||(!!function(e){return!!kt(e)&&0===e.length}(e)||!!pt(e)))))}function Zn(e,t){return function(){return e.apply(t,arguments)}}const{toString:Xn}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:eo,toStringTag:to}=Symbol,ro=(e=>t=>{const r=Xn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),no=e=>(e=e.toLowerCase(),t=>ro(t)===e),oo=e=>t=>typeof t===e,{isArray:io}=Array,ao=oo("undefined");function so(e){return null!==e&&!ao(e)&&null!==e.constructor&&!ao(e.constructor)&&lo(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const co=no("ArrayBuffer");const uo=oo("string"),lo=oo("function"),fo=oo("number"),po=e=>null!==e&&"object"==typeof e,ho=e=>{if("object"!==ro(e))return!1;const t=Qn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||to in e||eo in e)},yo=no("Date"),mo=no("File"),go=no("Blob"),vo=no("FileList"),bo=no("URLSearchParams"),[wo,So,_o,Oo]=["ReadableStream","Request","Response","Headers"].map(no);function jo(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),io(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(so(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function Eo(e,t){if(so(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Ro="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ao=e=>!ao(e)&&e!==Ro;const To=(ko="undefined"!=typeof Uint8Array&&Qn(Uint8Array),e=>ko&&e instanceof ko);var ko;const xo=no("HTMLFormElement"),Co=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$o=no("RegExp"),No=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};jo(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)};const Do=no("AsyncFunction"),Po=(Fo="function"==typeof setImmediate,Mo=lo(Ro.postMessage),Fo?setImmediate:Mo?(Lo=`axios@${Math.random()}`,Bo=[],Ro.addEventListener("message",({source:e,data:t})=>{e===Ro&&t===Lo&&Bo.length&&Bo.shift()()},!1),e=>{Bo.push(e),Ro.postMessage(Lo,"*")}):e=>setTimeout(e));var Fo,Mo,Lo,Bo;const Uo="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Ro):"undefined"!=typeof process&&process.nextTick||Po;var Io={isArray:io,isArrayBuffer:co,isBuffer:so,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||lo(e.append)&&("formdata"===(t=ro(e))||"object"===t&&lo(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&co(e.buffer),t},isString:uo,isNumber:fo,isBoolean:e=>!0===e||!1===e,isObject:po,isPlainObject:ho,isEmptyObject:e=>{if(!po(e)||so(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:wo,isRequest:So,isResponse:_o,isHeaders:Oo,isUndefined:ao,isDate:yo,isFile:mo,isBlob:go,isRegExp:$o,isFunction:lo,isStream:e=>po(e)&&lo(e.pipe),isURLSearchParams:bo,isTypedArray:To,isFileList:vo,forEach:jo,merge:function e(){const{caseless:t,skipUndefined:r}=Ao(this)&&this||{},n={},o=(o,i)=>{const a=t&&Eo(n,i)||i;ho(n[a])&&ho(o)?n[a]=e(n[a],o):ho(o)?n[a]=e({},o):io(o)?n[a]=o.slice():r&&ao(o)||(n[a]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&jo(arguments[e],o);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(jo(t,(t,n)=>{r&&lo(t)?e[n]=Zn(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&Qn(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:ro,kindOfTest:no,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(io(e))return e;let t=e.length;if(!fo(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[eo]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:xo,hasOwnProperty:Co,hasOwnProp:Co,reduceDescriptors:No,freezeMethods:e=>{No(e,(t,r)=>{if(lo(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];lo(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return io(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Eo,global:Ro,isContextDefined:Ao,isSpecCompliantForm:function(e){return!!(e&&lo(e.append)&&"FormData"===e[to]&&e[eo])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(po(e)){if(t.indexOf(e)>=0)return;if(so(e))return e;if(!("toJSON"in e)){t[n]=e;const o=io(e)?[]:{};return jo(e,(e,t)=>{const i=r(e,n+1);!ao(i)&&(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:Do,isThenable:e=>e&&(po(e)||lo(e))&&lo(e.then)&&lo(e.catch),setImmediate:Po,asap:Uo,isIterable:e=>null!=e&&lo(e[eo])};function qo(e,t,r,n,o){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),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Io.inherits(qo,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:Io.toJSONObject(this.config),code:this.code,status:this.status}}});const zo=qo.prototype,Ho={};["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=>{Ho[e]={value:e}}),Object.defineProperties(qo,Ho),Object.defineProperty(zo,"isAxiosError",{value:!0}),qo.from=(e,t,r,n,o,i)=>{const a=Object.create(zo);Io.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const s=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return qo.call(a,s,c,r,n,o),e&&null==a.cause&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",i&&Object.assign(a,i),a};function Yo(e){return Io.isPlainObject(e)||Io.isArray(e)}function Jo(e){return Io.endsWith(e,"[]")?e.slice(0,-2):e}function Wo(e,t,r){return e?e.concat(t).map(function(e,t){return e=Jo(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Vo=Io.toFlatObject(Io,{},null,function(e){return/^is[A-Z]/.test(e)});function Ko(e,t,r){if(!Io.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Io.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Io.isUndefined(t[e])})).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Io.isSpecCompliantForm(t);if(!Io.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(Io.isDate(e))return e.toISOString();if(Io.isBoolean(e))return e.toString();if(!s&&Io.isBlob(e))throw new qo("Blob is not supported. Use a Buffer instead.");return Io.isArrayBuffer(e)||Io.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,o){let s=e;if(e&&!o&&"object"==typeof e)if(Io.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Io.isArray(e)&&function(e){return Io.isArray(e)&&!e.some(Yo)}(e)||(Io.isFileList(e)||Io.endsWith(r,"[]"))&&(s=Io.toArray(e)))return r=Jo(r),s.forEach(function(e,n){!Io.isUndefined(e)&&null!==e&&t.append(!0===a?Wo([r],n,i):null===a?r:r+"[]",c(e))}),!1;return!!Yo(e)||(t.append(Wo(o,r,i),c(e)),!1)}const l=[],f=Object.assign(Vo,{defaultVisitor:u,convertValue:c,isVisitable:Yo});if(!Io.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Io.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Io.forEach(r,function(r,i){!0===(!(Io.isUndefined(r)||null===r)&&o.call(t,r,Io.isString(i)?i.trim():i,n,f))&&e(r,n?n.concat(i):[i])}),l.pop()}}(e),t}function Go(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Zo(e,t){this._pairs=[],e&&Ko(e,this,t)}const Xo=Zo.prototype;function Qo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ei(e,t,r){if(!t)return e;const n=r&&r.encode||Qo;Io.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(i=o?o(t,r):Io.isURLSearchParams(t)?t.toString():new Zo(t,r).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Xo.append=function(e,t){this._pairs.push([e,t])},Xo.toString=function(e){const t=e?function(t){return e.call(this,t,Go)}:Go;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};var ti=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Io.forEach(this.handlers,function(t){null!==t&&e(t)})}},ri={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ni={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Zo,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const oi="undefined"!=typeof window&&"undefined"!=typeof document,ii="object"==typeof navigator&&navigator||void 0,ai=oi&&(!ii||["ReactNative","NativeScript","NS"].indexOf(ii.product)<0),si="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ci=oi&&window.location.href||"http://localhost";var ui={...Object.freeze({__proto__:null,hasBrowserEnv:oi,hasStandardBrowserEnv:ai,hasStandardBrowserWebWorkerEnv:si,navigator:ii,origin:ci}),...ni};function li(e){function t(e,r,n,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&Io.isArray(n)?n.length:i,s)return Io.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a;n[i]&&Io.isObject(n[i])||(n[i]=[]);return t(e,r,n[i],o)&&Io.isArray(n[i])&&(n[i]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}(n[i])),!a}if(Io.isFormData(e)&&Io.isFunction(e.entries)){const r={};return Io.forEachEntry(e,(e,n)=>{t(function(e){return Io.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const fi={transitional:ri,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Io.isObject(e);o&&Io.isHTMLForm(e)&&(e=new FormData(e));if(Io.isFormData(e))return n?JSON.stringify(li(e)):e;if(Io.isArrayBuffer(e)||Io.isBuffer(e)||Io.isStream(e)||Io.isFile(e)||Io.isBlob(e)||Io.isReadableStream(e))return e;if(Io.isArrayBufferView(e))return e.buffer;if(Io.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ko(e,new ui.classes.URLSearchParams,{visitor:function(e,t,r,n){return ui.isNode&&Io.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=Io.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ko(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(Io.isString(e))try{return(t||JSON.parse)(e),Io.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||fi.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(Io.isResponse(e)||Io.isReadableStream(e))return e;if(e&&Io.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw qo.from(e,qo.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:ui.classes.FormData,Blob:ui.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Io.forEach(["delete","get","head","post","put","patch"],e=>{fi.headers[e]={}});var di=fi;const pi=Io.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"]);const hi=Symbol("internals");function yi(e){return e&&String(e).trim().toLowerCase()}function mi(e){return!1===e||null==e?e:Io.isArray(e)?e.map(mi):String(e)}function gi(e,t,r,n,o){return Io.isFunction(n)?n.call(this,t,r):(o&&(t=r),Io.isString(t)?Io.isString(n)?-1!==t.indexOf(n):Io.isRegExp(n)?n.test(t):void 0:void 0)}class vi{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=yi(t);if(!o)throw new Error("header name must be a non-empty string");const i=Io.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||t]=mi(e))}const i=(e,t)=>Io.forEach(e,(e,r)=>o(e,r,t));if(Io.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Io.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&pi[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(Io.isObject(e)&&Io.isIterable(e)){let r,n,o={};for(const t of e){if(!Io.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?Io.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=yi(e)){const r=Io.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Io.isFunction(t))return t.call(this,e,r);if(Io.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=yi(e)){const r=Io.findKey(this,e);return!(!r||void 0===this[r]||t&&!gi(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=yi(e)){const o=Io.findKey(r,e);!o||t&&!gi(0,r[o],o,t)||(delete r[o],n=!0)}}return Io.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!gi(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Io.forEach(this,(n,o)=>{const i=Io.findKey(r,o);if(i)return t[i]=mi(n),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();a!==o&&delete t[o],t[a]=mi(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Io.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Io.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[hi]=this[hi]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=yi(e);t[n]||(!function(e,t){const r=Io.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return Io.isArray(e)?e.forEach(n):n(e),this}}vi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Io.reduceDescriptors(vi.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),Io.freezeMethods(vi);var bi=vi;function wi(e,t){const r=this||di,n=t||r,o=bi.from(n.headers);let i=n.data;return Io.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Si(e){return!(!e||!e.__CANCEL__)}function _i(e,t,r){qo.call(this,null==e?"canceled":e,qo.ERR_CANCELED,t,r),this.name="CanceledError"}function Oi(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new qo("Request failed with status code "+r.status,[qo.ERR_BAD_REQUEST,qo.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}Io.inherits(_i,qo,{__CANCEL__:!0});const ji=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let r,n,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]}(r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},Ei=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ri=e=>(...t)=>Io.asap(()=>e(...t));var Ai=ui.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ui.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ui.origin),ui.navigator&&/(msie|trident)/i.test(ui.navigator.userAgent)):()=>!0,Ti=ui.hasStandardBrowserEnv?{write(e,t,r,n,o,i){const a=[e+"="+encodeURIComponent(t)];Io.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Io.isString(n)&&a.push("path="+n),Io.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.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 ki(e,t,r){let n=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const xi=e=>e instanceof bi?{...e}:e;function Ci(e,t){t=t||{};const r={};function n(e,t,r,n){return Io.isPlainObject(e)&&Io.isPlainObject(t)?Io.merge.call({caseless:n},e,t):Io.isPlainObject(t)?Io.merge({},t):Io.isArray(t)?t.slice():t}function o(e,t,r,o){return Io.isUndefined(t)?Io.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function i(e,t){if(!Io.isUndefined(t))return n(void 0,t)}function a(e,t){return Io.isUndefined(t)?Io.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,r)=>o(xi(e),xi(t),0,!0)};return Io.forEach(Object.keys({...e,...t}),function(n){const i=c[n]||o,a=i(e[n],t[n],n);Io.isUndefined(a)&&i!==s||(r[n]=a)}),r}var $i=e=>{const t=Ci({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:s}=t;if(t.headers=a=bi.from(a),t.url=ei(ki(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),Io.isFormData(r))if(ui.hasStandardBrowserEnv||ui.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(Io.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&a.set(e,r)})}if(ui.hasStandardBrowserEnv&&(n&&Io.isFunction(n)&&(n=n(t)),n||!1!==n&&Ai(t.url))){const e=o&&i&&Ti.read(i);e&&a.set(o,e)}return t};var Ni="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=$i(e);let o=n.data;const i=bi.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=bi.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Oi(function(e){t(e),h()},function(e){r(e),h()},{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new qo("Request aborted",qo.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const n=new qo(t&&t.message?t.message:"Network Error",qo.ERR_NETWORK,e,y);n.event=t||null,r(n),y=null},y.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ri;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new qo(t,o.clarifyTimeoutError?qo.ETIMEDOUT:qo.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Io.forEach(i.toJSON(),function(e,t){y.setRequestHeader(t,e)}),Io.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=ji(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=ji(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=t=>{y&&(r(!t||t.type?new _i(null,e,y):t),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);g&&-1===ui.protocols.indexOf(g)?r(new qo("Unsupported protocol "+g+":",qo.ERR_BAD_REQUEST,e)):y.send(o||null)})};var Di=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,a();const t=e instanceof Error?e:this.reason;n.abort(t instanceof qo?t:new _i(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new qo(`timeout ${t} of ms exceeded`,qo.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=n;return s.unsubscribe=()=>Io.asap(a),s}};const Pi=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},Fi=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Mi=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of Fi(e))yield*Pi(r,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return s(),void e.close();let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},{isFunction:Li}=Io,Bi=(({Request:e,Response:t})=>({Request:e,Response:t}))(Io.global),{ReadableStream:Ui,TextEncoder:Ii}=Io.global,qi=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},zi=e=>{e=Io.merge.call({skipUndefined:!0},Bi,e);const{fetch:t,Request:r,Response:n}=e,o=t?Li(t):"function"==typeof fetch,i=Li(r),a=Li(n);if(!o)return!1;const s=o&&Li(Ui),c=o&&("function"==typeof Ii?(u=new Ii,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const l=i&&s&&qi(()=>{let e=!1;const t=new r(ui.origin,{body:new Ui,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),f=a&&s&&qi(()=>Io.isReadableStream(new n("").body)),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new qo(`Response type '${e}' is not supported`,qo.ERR_NOT_SUPPORT,r)})});const p=async(e,t)=>{const n=Io.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Io.isBlob(e))return e.size;if(Io.isSpecCompliantForm(e)){const t=new r(ui.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Io.isArrayBufferView(e)||Io.isArrayBuffer(e)?e.byteLength:(Io.isURLSearchParams(e)&&(e+=""),Io.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:o,method:a,data:s,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:v,withCredentials:b="same-origin",fetchOptions:w}=$i(e),S=t||fetch;g=g?(g+"").toLowerCase():"text";let _=Di([c,u&&u.toAbortSignal()],h),O=null;const j=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let E;try{if(m&&l&&"get"!==a&&"head"!==a&&0!==(E=await p(v,s))){let e,t=new r(o,{method:"POST",body:s,duplex:"half"});if(Io.isFormData(s)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=Ei(E,ji(Ri(m)));s=Mi(t.body,65536,e,r)}}Io.isString(b)||(b=b?"include":"omit");const t=i&&"credentials"in r.prototype,c={...w,signal:_,method:a.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:"half",credentials:t?b:void 0};O=i&&new r(o,c);let u=await(i?S(O,w):S(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(y||h&&j)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=Io.toFiniteNumber(u.headers.get("content-length")),[r,o]=y&&Ei(t,ji(Ri(y),!0))||[];u=new n(Mi(u.body,65536,r,()=>{o&&o(),j&&j()}),e)}g=g||"text";let R=await d[Io.findKey(d,g)||"text"](u,e);return!h&&j&&j(),await new Promise((t,r)=>{Oi(t,r,{data:R,headers:bi.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(j&&j(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new qo("Network Error",qo.ERR_NETWORK,e,O),{cause:t.cause||t});throw qo.from(t,t&&t.code,e,O)}}},Hi=new Map,Yi=e=>{let t=e?e.env:{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let a,s,c=i.length,u=Hi;for(;c--;)a=i[c],s=u.get(a),void 0===s&&u.set(a,s=c?new Map:zi(t)),u=s;return s};Yi();const Ji={http:null,xhr:Ni,fetch:{get:Yi}};Io.forEach(Ji,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Wi=e=>`- ${e}`,Vi=e=>Io.isFunction(e)||null===e||!1===e;var Ki=(e,t)=>{e=Io.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let a=0;a<r;a++){let r;if(n=e[a],o=n,!Vi(n)&&(o=Ji[(r=String(n)).toLowerCase()],void 0===o))throw new qo(`Unknown adapter '${r}'`);if(o&&(Io.isFunction(o)||(o=o.get(t))))break;i[r||"#"+a]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new qo("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Wi).join("\n"):" "+Wi(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function Gi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _i(null,e)}function Zi(e){Gi(e),e.headers=bi.from(e.headers),e.data=wi.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ki(e.adapter||di.adapter,e)(e).then(function(t){return Gi(e),t.data=wi.call(e,e.transformResponse,t),t.headers=bi.from(t.headers),t},function(t){return Si(t)||(Gi(e),t&&t.response&&(t.response.data=wi.call(e,e.transformResponse,t.response),t.response.headers=bi.from(t.response.headers))),Promise.reject(t)})}const Xi="1.12.2",Qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ea={};Qi.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Xi+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new qo(n(o," has been removed"+(t?" in "+t:"")),qo.ERR_DEPRECATED);return t&&!ea[o]&&(ea[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}},Qi.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var ta={assertOptions:function(e,t,r){if("object"!=typeof e)throw new qo("options must be an object",qo.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],a=t[i];if(a){const t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new qo("option "+i+" must be "+r,qo.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new qo("Unknown option "+i,qo.ERR_BAD_OPTION)}},validators:Qi};const ra=ta.validators;class na{constructor(e){this.defaults=e||{},this.interceptors={request:new ti,response:new ti}}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 r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ci(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&ta.assertOptions(r,{silentJSONParsing:ra.transitional(ra.boolean),forcedJSONParsing:ra.transitional(ra.boolean),clarifyTimeoutError:ra.transitional(ra.boolean)},!1),null!=n&&(Io.isFunction(n)?t.paramsSerializer={serialize:n}:ta.assertOptions(n,{encode:ra.function,serialize:ra.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ta.assertOptions(t,{baseUrl:ra.spelling("baseURL"),withXsrfToken:ra.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&Io.merge(o.common,o[t.method]);o&&Io.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=bi.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,f=0;if(!s){const e=[Zi.bind(this),void 0];for(e.unshift(...a),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=a.length;let d=t;for(;f<l;){const e=a[f++],t=a[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Zi.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return ei(ki((e=Ci(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}Io.forEach(["delete","get","head","options"],function(e){na.prototype[e]=function(t,r){return this.request(Ci(r||{},{method:e,url:t,data:(r||{}).data}))}}),Io.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,o){return this.request(Ci(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}na.prototype[e]=t(),na.prototype[e+"Form"]=t(!0)});var oa=na;class ia{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new _i(e,n,o),t(r.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 ia(function(t){e=t}),cancel:e}}}var aa=ia;const sa={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(sa).forEach(([e,t])=>{sa[t]=e});var ca=sa;const ua=function e(t){const r=new oa(t),n=Zn(oa.prototype.request,r);return Io.extend(n,oa.prototype,r,{allOwnKeys:!0}),Io.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ci(t,r))},n}(di);ua.Axios=oa,ua.CanceledError=_i,ua.CancelToken=aa,ua.isCancel=Si,ua.VERSION=Xi,ua.toFormData=Ko,ua.AxiosError=qo,ua.Cancel=ua.CanceledError,ua.all=function(e){return Promise.all(e)},ua.spread=function(e){return function(t){return e.apply(null,t)}},ua.isAxiosError=function(e){return Io.isObject(e)&&!0===e.isAxiosError},ua.mergeConfig=Ci,ua.AxiosHeaders=bi,ua.formToJSON=e=>li(Io.isHTMLForm(e)?new FormData(e):e),ua.getAdapter=Ki,ua.HttpStatusCode=ca,ua.default=ua;var la=ua;let fa=async(e,t={})=>{let r=null,n=pe(t,"keepAllData");Qe(n)||(n=!0);let o=await la.get(`https://opendata.cwa.gov.tw/api/v1/rest/datastore/E-A0015-001?Authorization=${e}`).catch(e=>{r=e});if(null!==r)return;let i=[...pe(o,"data.records.earthquake",[]),...pe(o,"data.records.Earthquake",[])];if(!kt(a=i)||0===a.length||1===a.length&&Gn(a[0]))throw console.log("rEqsL",o),new Error("無法取得顯著有感地震之earthquake數據");var a;let s=[];return Ge(i,e=>{let t=pe(e,"earthquakeInfo.originTime",""),r=pe(e,"EarthquakeInfo.OriginTime",""),o=t||r;if(!tt(o))throw console.log("v",e),new Error(`無法取得originTime[${o}]`);let i=pe(e,"earthquakeInfo.magnitude.magnitudeType",""),a=pe(e,"EarthquakeInfo.EarthquakeMagnitude.MagnitudeType",""),c=i||a;if(!tt(c))throw console.log("v",e),new Error(`無法取得magnitudeType[${c}]`);let u=pe(e,"earthquakeInfo.magnitude.magnitudeValue",""),l=pe(e,"EarthquakeInfo.EarthquakeMagnitude.MagnitudeValue",""),f=u||l;if(!ht(f))throw console.log("v",e),new Error(`無法取得magnitudeValue[${f}]`);let d=pe(e,"ReportContent",""),p=f;p=Bn(p);let h=An(o),y=pe(e,"EarthquakeNo","");y=Bn(y);let m=nn(y,3),g=o,v=h.format("YYYY-MM-DDTHH:mm:ssZ"),b=h.format("YYYYMMDDHHmmss"),w=pe(e,"EarthquakeInfo.FocalDepth","");w=Bn(w);let S=pe(e,"EarthquakeInfo.Epicenter.Location",""),_=pe(e,"EarthquakeInfo.Epicenter.EpicenterLongitude","");_=Bn(_);let O=pe(e,"EarthquakeInfo.Epicenter.EpicenterLatitude","");O=Bn(O);let j={id:y,tag:"",number:m,time:v,timeRec:g,timeTag:b,ml:p,depth:w,description:d,location:S,intensity:"",longitude:_,latitude:O};n&&(j.data=e),s.push(j)}),s};return async(t,n={})=>{let o=pe(n,"keepAllData");Qe(o)||(o=!0);let i=pe(n,"fdTagRemove");tt(i)||(i="./_tagRemove");let a=pe(n,"fdDwStorage");tt(a)||(a="./_dwStorage"),Nt(a)||Bt(a);let s=pe(n,"fdDwAttime");tt(s)||(s="./_dwAttime"),Nt(s)||Bt(s);let c=pe(n,"fdDwCurrent");tt(c)||(c="./_dwCurrent"),Nt(c)||Bt(c);let u=pe(n,"fdResultTemp");tt(u)||(u="./_resultTemp"),Nt(u)||Bt(u);let l=pe(n,"fdResult");tt(l)||(l="./_result"),Nt(l)||Bt(l);let f=pe(n,"fdTaskCpActualSrc");tt(f)||(f="./_taskCpActualSrc"),Nt(f)||Bt(f);let d=pe(n,"fdTaskCpSrc");tt(d)||(d="./_taskCpSrc"),Nt(d)||Bt(d);let p=pe(n,"fdLog");tt(p)||(p="./_logs"),Nt(p)||Bt(p);let h=pe(n,"funDownloadEqs"),y=pe(n,"funDownload"),m=pe(n,"funGetCurrent"),g=pe(n,"funAdd"),v=pe(n,"funModify"),b=pe(n,"funRemove"),w=pe(n,"timeToleranceRemove");_t(w)||(w=0),w=yt(w);let S=async()=>{let n=[];var i;Ot(h)?(n=h(),jt(n)&&(n=await n)):n=await fa(t,{keepAllData:o}),n=null==(i=n)?i:Ze.call(i),Lt(s),qt(c,s);let u=(t=>{let r=Jt(t,1),n=[];return Ge(r,t=>{let r=e.readFileSync(t.path,"utf8"),o=JSON.parse(r);n.push(o)}),n})(s),l={};return Ge(u,e=>{l[e.id]=e}),await xt(n,async t=>{let n=`${a}/${t.id}.json`;e.writeFileSync(n,JSON.stringify(t),"utf8");let o=await function(t,n={}){return Wt(t,{fs:e,crypto:r,...n})}(n,{type:"md5"});if(Rt(l,t.id)){if(o!==l[t.id].hash){l[t.id].hash=o;let r=`${s}/${t.id}.json`;e.writeFileSync(r,JSON.stringify(l[t.id]),"utf8")}}else{l[t.id]={id:t.id,hash:o};let r=`${s}/${t.id}.json`;e.writeFileSync(r,JSON.stringify(l[t.id]),"utf8")}}),Xe(l)};Ot(y)||(y=S);let _=async()=>{let t=Jt(c,1),r=[];return Ge(t,t=>{let n=e.readFileSync(t.path,"utf8"),o=JSON.parse(n);r.push(o)}),r};Ot(m)||(m=_);let O=async t=>{let r=`${l}/${t.id}`;Nt(r)&&zt(r,{fs:e})};Ot(b)||(b=O);let j=async e=>{let t=`${l}/${e.id}`;Nt(t)||Bt(t),Lt(t),Mt(`${a}/${e.id}.json`,`${t}/${e.id}.json`)};Ot(g)||(g=j);let E=async e=>{qt(`${l}/${e.id}`,`${u}/${e.id}`);{let t=`${l}/${e.id}`;Nt(t)||Bt(t),Lt(t),Mt(`${a}/${e.id}.json`,`${t}/${e.id}.json`)}};Ot(v)||(v=E);let R={fdTagRemove:i,fdDwAttime:s,fdDwCurrent:c,fdResult:l,fdTaskCpActualSrc:f,fdTaskCpSrc:d,fdLog:p,funDownload:y,funGetCurrent:m,funRemove:b,funAdd:g,funModify:v,funAfterStart:async()=>{Lt(u)},funBeforeEnd:async()=>{Lt(u)},timeToleranceRemove:w};return await Kn(R)}});
7
7
  //# sourceMappingURL=w-dwdata-tweqod.umd.js.map