w-ftp 1.0.10 → 1.0.11

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
@@ -97,7 +97,7 @@ test_dw()
97
97
  // userPermissions: { read: true, write: true, exec: false },
98
98
  // groupPermissions: { read: true, write: true, exec: false },
99
99
  // otherPermissions: { read: true, write: true, exec: false },
100
- // ctime: '2023-08-18T08:32:00+08:00',
100
+ // mtime: '2023-08-18T08:32:00+08:00',
101
101
  // isFolder: false
102
102
  // } 5
103
103
  // ftp.isFile true
@@ -288,7 +288,7 @@ test_up()
288
288
  // userPermissions: { read: true, write: true, exec: false },
289
289
  // groupPermissions: { read: true, write: true, exec: false },
290
290
  // otherPermissions: { read: true, write: true, exec: false },
291
- // ctime: '2023-08-20T11:13:00+08:00',
291
+ // mtime: '2023-08-20T11:13:00+08:00',
292
292
  // isFolder: false
293
293
  // } 3
294
294
  // ftp.isFile false
@@ -410,7 +410,7 @@ test_dw()
410
410
  // owner: 0,
411
411
  // group: 0,
412
412
  // longname: '-rw-****** 1 - - 218690 Aug 18 16:32 DECL_202108.csv',
413
- // ctime: '2023-08-18T16:32:00+08:00',
413
+ // mtime: '2023-08-18T16:32:00+08:00',
414
414
  // atime: '2023-08-20T15:45:58+08:00',
415
415
  // isFolder: false
416
416
  // } 5
@@ -686,7 +686,7 @@ test_up()
686
686
  // owner: 0,
687
687
  // group: 0,
688
688
  // longname: '-rw-****** 1 - - 218690 Aug 18 16:32 DECL_202108.csv',
689
- // ctime: '2023-08-18T16:32:00+08:00',
689
+ // mtime: '2023-08-18T16:32:00+08:00',
690
690
  // atime: '2023-08-20T15:45:58+08:00',
691
691
  // isFolder: false
692
692
  // } 5
package/dist/w-ftp.umd.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * w-ftp v1.0.10
2
+ * w-ftp v1.0.11
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("path"),require("fs"),require("net"),require("events"),require("util"),require("stream"),require("stream-combiner"),require("ftp-response-parser"),require("parse-listing"),require("once"),require("unorm"),require("debug"),require("ssh2-sftp-client")):"function"==typeof define&&define.amd?define(["path","fs","net","events","util","stream","stream-combiner","ftp-response-parser","parse-listing","once","unorm","debug","ssh2-sftp-client"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-ftp"]=e(t.path,t.fs,t.net,t.events,t.util,t.stream,t["stream-combiner"],t["ftp-response-parser"],t["parse-listing"],t.once,t.unorm,t.debug,t["ssh2-sftp-client"])}(this,(function(t,e,r,n,i,o,u,a,s,c,f,l,p){"use strict";var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var v=Array.isArray,y="object"==typeof h&&h&&h.Object===Object&&h,m=y,g="object"==typeof self&&self&&self.Object===Object&&self,b=m||g||Function("return this")(),j=b.Symbol,w=j,_=Object.prototype,O=_.hasOwnProperty,$=_.toString,S=w?w.toStringTag:void 0;var k=function(t){var e=O.call(t,S),r=t[S];try{t[S]=void 0;var n=!0}catch(t){}var i=$.call(t);return n&&(e?t[S]=r:delete t[S]),i},P=Object.prototype.toString;var T=k,x=function(t){return P.call(t)},F=j?j.toStringTag:void 0;var D=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":F&&F in Object(t)?T(t):x(t)};var z=function(t){return null!=t&&"object"==typeof t},M=D,L=z;var E=function(t){return"symbol"==typeof t||L(t)&&"[object Symbol]"==M(t)},A=v,R=E,C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,I=/^\w*$/;var Y=function(t,e){if(A(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!R(t))||(I.test(t)||!C.test(t)||null!=e&&t in Object(e))};var U=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},N=D,q=U;var H,W=function(t){if(!q(t))return!1;var e=N(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},B=b["__core-js_shared__"],Q=(H=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var V=function(t){return!!Q&&Q in t},Z=Function.prototype.toString;var G=function(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=W,K=V,X=U,tt=G,et=/^\[object .+?Constructor\]$/,rt=Function.prototype,nt=Object.prototype,it=rt.toString,ot=nt.hasOwnProperty,ut=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=function(t){return!(!X(t)||K(t))&&(J(t)?ut:et).test(tt(t))},st=function(t,e){return null==t?void 0:t[e]};var ct=function(t,e){var r=st(t,e);return at(r)?r:void 0},ft=ct(Object,"create"),lt=ft;var pt=function(){this.__data__=lt?lt(null):{},this.size=0};var ht=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},dt=ft,vt=Object.prototype.hasOwnProperty;var yt=function(t){var e=this.__data__;if(dt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return vt.call(e,t)?e[t]:void 0},mt=ft,gt=Object.prototype.hasOwnProperty;var bt=ft;var jt=pt,wt=ht,_t=yt,Ot=function(t){var e=this.__data__;return mt?void 0!==e[t]:gt.call(e,t)},$t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=bt&&void 0===e?"__lodash_hash_undefined__":e,this};function St(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}St.prototype.clear=jt,St.prototype.delete=wt,St.prototype.get=_t,St.prototype.has=Ot,St.prototype.set=$t;var kt=St;var Pt=function(){this.__data__=[],this.size=0};var Tt=function(t,e){return t===e||t!=t&&e!=e},xt=Tt;var Ft=function(t,e){for(var r=t.length;r--;)if(xt(t[r][0],e))return r;return-1},Dt=Ft,zt=Array.prototype.splice;var Mt=Ft;var Lt=Ft;var Et=Ft;var At=Pt,Rt=function(t){var e=this.__data__,r=Dt(e,t);return!(r<0)&&(r==e.length-1?e.pop():zt.call(e,r,1),--this.size,!0)},Ct=function(t){var e=this.__data__,r=Mt(e,t);return r<0?void 0:e[r][1]},It=function(t){return Lt(this.__data__,t)>-1},Yt=function(t,e){var r=this.__data__,n=Et(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ut(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ut.prototype.clear=At,Ut.prototype.delete=Rt,Ut.prototype.get=Ct,Ut.prototype.has=It,Ut.prototype.set=Yt;var Nt=Ut,qt=ct(b,"Map"),Ht=kt,Wt=Nt,Bt=qt;var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Vt=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map},Zt=Vt;var Gt=Vt;var Jt=Vt;var Kt=Vt;var Xt=function(t,e){var r=Kt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},te=function(){this.size=0,this.__data__={hash:new Ht,map:new(Bt||Wt),string:new Ht}},ee=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e},re=function(t){return Gt(this,t).get(t)},ne=function(t){return Jt(this,t).has(t)},ie=Xt;function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=te,oe.prototype.delete=ee,oe.prototype.get=re,oe.prototype.has=ne,oe.prototype.set=ie;var ue=oe,ae=ue;function se(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var u=t.apply(this,n);return r.cache=o.set(i,u)||o,u};return r.cache=new(se.Cache||ae),r}se.Cache=ae;var ce=se;var fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,le=/\\(\\)?/g,pe=function(t){var e=ce(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(fe,(function(t,r,n,i){e.push(n?i.replace(le,"$1"):r||t)})),e}));var he=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i},de=he,ve=v,ye=E,me=j?j.prototype:void 0,ge=me?me.toString:void 0;var be=function t(e){if("string"==typeof e)return e;if(ve(e))return de(e,t)+"";if(ye(e))return ge?ge.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},je=be;var we=function(t){return null==t?"":je(t)},_e=v,Oe=Y,$e=pe,Se=we;var ke=function(t,e){return _e(t)?t:Oe(t,e)?[t]:$e(Se(t))},Pe=E;var Te=function(t){if("string"==typeof t||Pe(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},xe=ke,Fe=Te;var De=function(t,e){for(var r=0,n=(e=xe(e,t)).length;null!=t&&r<n;)t=t[Fe(e[r++])];return r&&r==n?t:void 0},ze=De;var Me=function(t,e,r){var n=null==t?void 0:ze(t,e);return void 0===n?r:n};function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Ee(t){var e=function(t,e){if("object"!==Le(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Le(e)?e:String(e)}function Ae(t,e,r){return(e=Ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Re=Nt;var Ce=Nt,Ie=qt,Ye=ue;var Ue=Nt,Ne=function(){this.__data__=new Re,this.size=0},qe=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},He=function(t){return this.__data__.get(t)},We=function(t){return this.__data__.has(t)},Be=function(t,e){var r=this.__data__;if(r instanceof Ce){var n=r.__data__;if(!Ie||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ye(n)}return r.set(t,e),this.size=r.size,this};function Qe(t){var e=this.__data__=new Ue(t);this.size=e.size}Qe.prototype.clear=Ne,Qe.prototype.delete=qe,Qe.prototype.get=He,Qe.prototype.has=We,Qe.prototype.set=Be;var Ve=Qe;var Ze=ue,Ge=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Je=function(t){return this.__data__.has(t)};function Ke(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Ze;++e<r;)this.add(t[e])}Ke.prototype.add=Ke.prototype.push=Ge,Ke.prototype.has=Je;var Xe=Ke,tr=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},er=function(t,e){return t.has(e)};var rr=function(t,e,r,n,i,o){var u=1&r,a=t.length,s=e.length;if(a!=s&&!(u&&s>a))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var l=-1,p=!0,h=2&r?new Xe:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var d=t[l],v=e[l];if(n)var y=u?n(v,d,l,e,t,o):n(d,v,l,t,e,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!tr(e,(function(t,e){if(!er(h,e)&&(d===t||i(d,t,r,n,o)))return h.push(e)}))){p=!1;break}}else if(d!==v&&!i(d,v,r,n,o)){p=!1;break}}return o.delete(t),o.delete(e),p};var nr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ir=b.Uint8Array,or=Tt,ur=rr,ar=nr,sr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},cr=j?j.prototype:void 0,fr=cr?cr.valueOf:void 0;var lr=function(t,e,r,n,i,o,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new ir(t),new ir(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return or(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ar;case"[object Set]":var s=1&n;if(a||(a=sr),t.size!=e.size&&!s)return!1;var c=u.get(t);if(c)return c==e;n|=2,u.set(t,e);var f=ur(a(t),a(e),n,i,o,u);return u.delete(t),f;case"[object Symbol]":if(fr)return fr.call(t)==fr.call(e)}return!1};var pr=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t},hr=v;var dr=function(t,e,r){var n=e(t);return hr(t)?n:pr(n,r(t))};var vr=function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var u=t[r];e(u,r,t)&&(o[i++]=u)}return o};var yr=vr,mr=function(){return[]},gr=Object.prototype.propertyIsEnumerable,br=Object.getOwnPropertySymbols,jr=br?function(t){return null==t?[]:(t=Object(t),yr(br(t),(function(e){return gr.call(t,e)})))}:mr;var wr=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},_r=D,Or=z;var $r=function(t){return Or(t)&&"[object Arguments]"==_r(t)},Sr=z,kr=Object.prototype,Pr=kr.hasOwnProperty,Tr=kr.propertyIsEnumerable,xr=$r(function(){return arguments}())?$r:function(t){return Sr(t)&&Pr.call(t,"callee")&&!Tr.call(t,"callee")},Fr=xr,Dr={};var zr=function(){return!1};!function(t,e){var r=b,n=zr,i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,u=o&&o.exports===i?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n;t.exports=a}({get exports(){return Dr},set exports(t){Dr=t}},Dr);var Mr=/^(?:0|[1-9]\d*)$/;var Lr=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&Mr.test(t))&&t>-1&&t%1==0&&t<e};var Er=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Ar=D,Rr=Er,Cr=z,Ir={};Ir["[object Float32Array]"]=Ir["[object Float64Array]"]=Ir["[object Int8Array]"]=Ir["[object Int16Array]"]=Ir["[object Int32Array]"]=Ir["[object Uint8Array]"]=Ir["[object Uint8ClampedArray]"]=Ir["[object Uint16Array]"]=Ir["[object Uint32Array]"]=!0,Ir["[object Arguments]"]=Ir["[object Array]"]=Ir["[object ArrayBuffer]"]=Ir["[object Boolean]"]=Ir["[object DataView]"]=Ir["[object Date]"]=Ir["[object Error]"]=Ir["[object Function]"]=Ir["[object Map]"]=Ir["[object Number]"]=Ir["[object Object]"]=Ir["[object RegExp]"]=Ir["[object Set]"]=Ir["[object String]"]=Ir["[object WeakMap]"]=!1;var Yr=function(t){return Cr(t)&&Rr(t.length)&&!!Ir[Ar(t)]};var Ur=function(t){return function(e){return t(e)}},Nr={};!function(t,e){var r=y,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=u}({get exports(){return Nr},set exports(t){Nr=t}},Nr);var qr=Yr,Hr=Ur,Wr=Nr&&Nr.isTypedArray,Br=Wr?Hr(Wr):qr,Qr=wr,Vr=Fr,Zr=v,Gr=Dr,Jr=Lr,Kr=Br,Xr=Object.prototype.hasOwnProperty;var tn=function(t,e){var r=Zr(t),n=!r&&Vr(t),i=!r&&!n&&Gr(t),o=!r&&!n&&!i&&Kr(t),u=r||n||i||o,a=u?Qr(t.length,String):[],s=a.length;for(var c in t)!e&&!Xr.call(t,c)||u&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Jr(c,s))||a.push(c);return a},en=Object.prototype;var rn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||en)};var nn=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),on=rn,un=nn,an=Object.prototype.hasOwnProperty;var sn=function(t){if(!on(t))return un(t);var e=[];for(var r in Object(t))an.call(t,r)&&"constructor"!=r&&e.push(r);return e},cn=W,fn=Er;var ln=function(t){return null!=t&&fn(t.length)&&!cn(t)},pn=tn,hn=sn,dn=ln;var vn=function(t){return dn(t)?pn(t):hn(t)},yn=dr,mn=jr,gn=vn;var bn=function(t){return yn(t,gn,mn)},jn=Object.prototype.hasOwnProperty;var wn=function(t,e,r,n,i,o){var u=1&r,a=bn(t),s=a.length;if(s!=bn(e).length&&!u)return!1;for(var c=s;c--;){var f=a[c];if(!(u?f in e:jn.call(e,f)))return!1}var l=o.get(t),p=o.get(e);if(l&&p)return l==e&&p==t;var h=!0;o.set(t,e),o.set(e,t);for(var d=u;++c<s;){var v=t[f=a[c]],y=e[f];if(n)var m=u?n(y,v,f,e,t,o):n(v,y,f,t,e,o);if(!(void 0===m?v===y||i(v,y,r,n,o):m)){h=!1;break}d||(d="constructor"==f)}if(h&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(t),o.delete(e),h},_n=ct(b,"DataView"),On=qt,$n=ct(b,"Promise"),Sn=ct(b,"Set"),kn=ct(b,"WeakMap"),Pn=D,Tn=G,xn="[object Map]",Fn="[object Promise]",Dn="[object Set]",zn="[object WeakMap]",Mn="[object DataView]",Ln=Tn(_n),En=Tn(On),An=Tn($n),Rn=Tn(Sn),Cn=Tn(kn),In=Pn;(_n&&In(new _n(new ArrayBuffer(1)))!=Mn||On&&In(new On)!=xn||$n&&In($n.resolve())!=Fn||Sn&&In(new Sn)!=Dn||kn&&In(new kn)!=zn)&&(In=function(t){var e=Pn(t),r="[object Object]"==e?t.constructor:void 0,n=r?Tn(r):"";if(n)switch(n){case Ln:return Mn;case En:return xn;case An:return Fn;case Rn:return Dn;case Cn:return zn}return e});var Yn=In,Un=Ve,Nn=rr,qn=lr,Hn=wn,Wn=Yn,Bn=v,Qn=Dr,Vn=Br,Zn="[object Arguments]",Gn="[object Array]",Jn="[object Object]",Kn=Object.prototype.hasOwnProperty;var Xn=function(t,e,r,n,i,o){var u=Bn(t),a=Bn(e),s=u?Gn:Wn(t),c=a?Gn:Wn(e),f=(s=s==Zn?Jn:s)==Jn,l=(c=c==Zn?Jn:c)==Jn,p=s==c;if(p&&Qn(t)){if(!Qn(e))return!1;u=!0,f=!1}if(p&&!f)return o||(o=new Un),u||Vn(t)?Nn(t,e,r,n,i,o):qn(t,e,s,r,n,i,o);if(!(1&r)){var h=f&&Kn.call(t,"__wrapped__"),d=l&&Kn.call(e,"__wrapped__");if(h||d){var v=h?t.value():t,y=d?e.value():e;return o||(o=new Un),i(v,y,r,n,o)}}return!!p&&(o||(o=new Un),Hn(t,e,r,n,i,o))},ti=z;var ei=function t(e,r,n,i,o){return e===r||(null==e||null==r||!ti(e)&&!ti(r)?e!=e&&r!=r:Xn(e,r,n,i,t,o))},ri=Ve,ni=ei;var ii=U;var oi=function(t){return t==t&&!ii(t)},ui=oi,ai=vn;var si=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},ci=function(t,e,r,n){var i=r.length,o=i,u=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var s=(a=r[i])[0],c=t[s],f=a[1];if(u&&a[2]){if(void 0===c&&!(s in t))return!1}else{var l=new ri;if(n)var p=n(c,f,s,t,e,l);if(!(void 0===p?ni(f,c,3,n,l):p))return!1}}return!0},fi=function(t){for(var e=ai(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,ui(i)]}return e},li=si;var pi=ke,hi=Fr,di=v,vi=Lr,yi=Er,mi=Te;var gi=function(t,e,r){for(var n=-1,i=(e=pi(e,t)).length,o=!1;++n<i;){var u=mi(e[n]);if(!(o=null!=t&&r(t,u)))break;t=t[u]}return o||++n!=i?o:!!(i=null==t?0:t.length)&&yi(i)&&vi(u,i)&&(di(t)||hi(t))},bi=function(t,e){return null!=t&&e in Object(t)},ji=gi;var wi=function(t,e){return null!=t&&ji(t,e,bi)},_i=ei,Oi=Me,$i=wi,Si=Y,ki=oi,Pi=si,Ti=Te;var xi=function(t,e){return Si(t)&&ki(e)?Pi(Ti(t),e):function(r){var n=Oi(r,t);return void 0===n&&n===e?$i(r,t):_i(e,n,3)}};var Fi=function(t){return t};var Di=function(t){return function(e){return null==e?void 0:e[t]}},zi=De;var Mi=function(t){return function(e){return zi(e,t)}},Li=Di,Ei=Mi,Ai=Y,Ri=Te;var Ci=function(t){return Ai(t)?Li(Ri(t)):Ei(t)},Ii=function(t){var e=fi(t);return 1==e.length&&e[0][2]?li(e[0][0],e[0][1]):function(r){return r===t||ci(r,t,e)}},Yi=xi,Ui=Fi,Ni=v,qi=Ci;var Hi=function(t){return"function"==typeof t?t:null==t?Ui:"object"==typeof t?Ni(t)?Yi(t[0],t[1]):Ii(t):qi(t)};var Wi=function(t){return function(e,r,n){for(var i=-1,o=Object(e),u=n(e),a=u.length;a--;){var s=u[t?a:++i];if(!1===r(o[s],s,o))break}return e}}(),Bi=vn;var Qi=ln;var Vi=function(t,e){return function(r,n){if(null==r)return r;if(!Qi(r))return t(r,n);for(var i=r.length,o=e?i:-1,u=Object(r);(e?o--:++o<i)&&!1!==n(u[o],o,u););return r}}((function(t,e){return t&&Wi(t,e,Bi)})),Zi=Vi,Gi=ln;var Ji=he,Ki=Hi,Xi=function(t,e){var r=-1,n=Gi(t)?Array(t.length):[];return Zi(t,(function(t,i,o){n[++r]=e(t,i,o)})),n},to=v;var eo=function(t,e){return(to(t)?Ji:Xi)(t,Ki(e))},ro=D,no=v,io=z;var oo=function(t){return"string"==typeof t||!no(t)&&io(t)&&"[object String]"==ro(t)},uo=Di("length"),ao=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var so=function(t){return ao.test(t)},co="\\ud800-\\udfff",fo="["+co+"]",lo="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",po="\\ud83c[\\udffb-\\udfff]",ho="[^"+co+"]",vo="(?:\\ud83c[\\udde6-\\uddff]){2}",yo="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="(?:"+lo+"|"+po+")"+"?",go="[\\ufe0e\\ufe0f]?",bo=go+mo+("(?:\\u200d(?:"+[ho,vo,yo].join("|")+")"+go+mo+")*"),jo="(?:"+[ho+lo+"?",lo,vo,yo,fo].join("|")+")",wo=RegExp(po+"(?="+po+")|"+jo+bo,"g");var _o=uo,Oo=so,$o=function(t){for(var e=wo.lastIndex=0;wo.test(t);)++e;return e};var So=sn,ko=Yn,Po=ln,To=oo,xo=function(t){return Oo(t)?$o(t):_o(t)};var Fo=function(t){if(null==t)return 0;if(Po(t))return To(t)?xo(t):t.length;var e=ko(t);return"[object Map]"==e||"[object Set]"==e?t.size:So(t).length};var Do=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};function zo(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}var Mo=/\s/;var Lo=function(t){for(var e=t.length;e--&&Mo.test(t.charAt(e)););return e},Eo=/^\s+/;var Ao=function(t){return t?t.slice(0,Lo(t)+1).replace(Eo,""):t},Ro=Ao,Co=U,Io=E,Yo=/^[-+]0x[0-9a-f]+$/i,Uo=/^0b[01]+$/i,No=/^0o[0-7]+$/i,qo=parseInt;var Ho=function(t){if("number"==typeof t)return t;if(Io(t))return NaN;if(Co(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Co(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ro(t);var r=Uo.test(t);return r||No.test(t)?qo(t.slice(2),r?2:8):Yo.test(t)?NaN:+t},Wo=Ho,Bo=1/0;var Qo=function(t){return t?(t=Wo(t))===Bo||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},Vo=Qo;var Zo=function(t){var e=Vo(t),r=e%1;return e==e?r?e-r:e:0},Go=Zo,Jo=Ho,Ko=we,Xo=b.isFinite,tu=Math.min;var eu=function(t){var e=Math[t];return function(t,r){if(t=Jo(t),(r=null==r?0:tu(Go(r),292))&&Xo(t)){var n=(Ko(t)+"e").split("e"),i=e(n[0]+"e"+(+n[1]+r));return+((n=(Ko(i)+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round");function ru(t){return!(!function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)||""===t)}function nu(t){let e=!1;return ru(t)?e=!isNaN(Number(t)):function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)&&(e=!0),e}function iu(t){if(!nu(t))return 0;return Qo(t)}function ou(t){if(!nu(t))return 0;t=iu(t);let e=eu(t);return"0"===String(e)?0:e}var uu=Zo;var au=function(t){return"number"==typeof t&&t==uu(t)};function su(t){return!!nu(t)&&(t=iu(t),au(t))}function cu(t){if(!su(t))return!1;return ou(t)>0}function fu(t){return"[object Object]"===Object.prototype.toString.call(t)}function lu(t){if(fu(t)){for(let e in t)return!0;return!1}return!1}function pu(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}var hu=function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o},du=hu,vu=Zo;var yu=function(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:vu(e),du(t,e<0?0:e,n)):[]},mu={};var gu=Fi;var bu=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},ju=Vi,wu=function(t){return"function"==typeof t?t:gu},_u=v;var Ou=function(t,e){return(_u(t)?bu:ju)(t,wu(e))};!function(t){t.exports=Ou}({get exports(){return mu},set exports(t){mu=t}});var $u=d(mu);function Su(t,e){let r=zo();if(n=t,"[object Array]"!==Object.prototype.toString.call(n)&&!fu(t))return r.reject("rs is not an array or object"),r;var n;let i=!1;if(fu(t)){i=!0;let e=[];$u(t,((t,r)=>{e.push({k:r,v:t})})),t=e}pu(e)||(e=function(t){return t});let o=-1,u=[];return t.reduce((function(t,r){return t.then((function(t){u.push(t),o+=1;let n=o,a=r;return i&&(n=r.k,a=r.v),pu(e)?e(a,n):a}))}),Promise.resolve()).then((function(t){u.push(t),u=yu(u),r.resolve(u)})).catch((function(t){r.reject(t)})),r}function ku(t){if(!su(t))return!1;return ou(t)>=0}function Pu(t,e){if(!ru(t))return"";if(!ku(e))return"";if(0===(e=ou(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substr(r,e)}function Tu(t,e){return ru(t)&&ku(e)?0===(e=ou(e))?"":t.substring(0,e):""}function xu(t,e){return ru(t)&&ku(e)?0===(e=ou(e))?t:Tu(t,t.length-e):""}function Fu(t){if(!ru(t))return"";let e=function(t){if(!ru(t))return{path:"",isRoot:!1};for(;t.indexOf("\\\\")>=0;)t=t.replace("\\\\","\\");for(;t.indexOf("//")>=0;)t=t.replace("//","/");if(":"===Pu(t,1))return{path:`${t}\\`,isRoot:!0};if("\\"===Pu(t,1)){let e=xu(t,1);return":"===Pu(e,1)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}if("/"===Pu(t,1)){let e=xu(t,1);return 0===Fo(e)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}return{path:t,isRoot:!1}}(t);if(e.isRoot)return e.path;let r=e.path;try{r=r.split("\\").pop().split("/").pop()}catch(t){}return r}function Du(t){return!!e.existsSync(t)&&(!e.lstatSync(t).isFile()&&!e.lstatSync(t).isSymbolicLink())}function zu(t){return!!e.existsSync(t)&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function Mu(t){if(Du(t))return{success:"input folder is already exists: "+t};if(e.existsSync(t))return{error:"input path already exists: "+t};try{e.mkdirSync(t,{recursive:!0})}catch(t){return{error:t}}return{success:"done: "+t}}var Lu={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",o="minute",u="hour",a="day",s="week",c="month",f="quarter",l="year",p="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,y={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(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},m=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},g={s:m,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+m(n,2,"0")+":"+m(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,c),o=r-i<0,u=e.clone().add(n+(o?-1:1),c);return+(-(n+(r-i)/(o?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:l,w:s,d:a,D:p,h:u,m:o,s:i,ms:n,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",j={};j[b]=y;var w=function(t){return t instanceof S},_=function t(e,r,n){var i;if(!e)return b;if("string"==typeof e){var o=e.toLowerCase();j[o]&&(i=o),r&&(j[o]=r,i=o);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;j[a]=e,i=a}return!n&&i&&(b=i),i||!n&&b},O=function(t,e){if(w(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},$=g;$.l=_,$.i=w,$.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function y(t){this.$L=_(t.locale,null,!0),this.parse(t)}var m=y.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if($.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(d);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return $},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,r){return $.u(t)?this[e]:this.set(r,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var r=this,n=!!$.u(e)||e,f=$.p(t),h=function(t,e){var i=$.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?i:i.endOf(a)},d=function(t,e){return $.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},v=this.$W,y=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(f){case l:return n?h(1,0):h(31,11);case c:return n?h(1,y):h(0,y+1);case s:var b=this.$locale().weekStart||0,j=(v<b?v+7:v)-b;return h(n?m-j:m+(6-j),y);case a:case p:return d(g+"Hours",0);case u:return d(g+"Minutes",1);case o:return d(g+"Seconds",2);case i:return d(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var r,s=$.p(t),f="set"+(this.$u?"UTC":""),h=(r={},r[a]=f+"Date",r[p]=f+"Date",r[c]=f+"Month",r[l]=f+"FullYear",r[u]=f+"Hours",r[o]=f+"Minutes",r[i]=f+"Seconds",r[n]=f+"Milliseconds",r)[s],d=s===a?this.$D+(e-this.$W):e;if(s===c||s===l){var v=this.clone().set(p,1);v.$d[h](d),v.init(),this.$d=v.set(p,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](d);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[$.p(t)]()},m.add=function(n,f){var p,h=this;n=Number(n);var d=$.p(f),v=function(t){var e=O(h);return $.w(e.date(e.date()+Math.round(t*n)),h)};if(d===c)return this.set(c,this.$M+n);if(d===l)return this.set(l,this.$y+n);if(d===a)return v(1);if(d===s)return v(7);var y=(p={},p[o]=e,p[u]=r,p[i]=t,p)[d]||1,m=this.$d.getTime()+n*y;return $.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=$.z(this),o=this.$H,u=this.$m,a=this.$M,s=r.weekdays,c=r.months,f=r.meridiem,l=function(t,r,i,o){return t&&(t[r]||t(e,n))||i[r].slice(0,o)},p=function(t){return $.s(o%12||12,t,"0")},d=f||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(v,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return $.s(e.$y,4,"0");case"M":return a+1;case"MM":return $.s(a+1,2,"0");case"MMM":return l(r.monthsShort,a,c,3);case"MMMM":return l(c,a);case"D":return e.$D;case"DD":return $.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(r.weekdaysMin,e.$W,s,2);case"ddd":return l(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(o);case"HH":return $.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return d(o,u,!0);case"A":return d(o,u,!1);case"m":return String(u);case"mm":return $.s(u,2,"0");case"s":return String(e.$s);case"ss":return $.s(e.$s,2,"0");case"SSS":return $.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,p,h){var d,v=this,y=$.p(p),m=O(n),g=(m.utcOffset()-this.utcOffset())*e,b=this-m,j=function(){return $.m(v,m)};switch(y){case l:d=j()/12;break;case c:d=j();break;case f:d=j()/3;break;case s:d=(b-g)/6048e5;break;case a:d=(b-g)/864e5;break;case u:d=b/r;break;case o:d=b/e;break;case i:d=b/t;break;default:d=b}return h?d:$.a(d)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return j[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=_(t,e,!0);return n&&(r.$L=n),r},m.clone=function(){return $.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},y}(),k=S.prototype;return O.prototype=k,[["$ms",n],["$s",i],["$m",o],["$H",u],["$W",a],["$M",c],["$y",l],["$D",p]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,S,O),t.$i=!0),O},O.locale=_,O.isDayjs=w,O.unix=function(t){return O(1e3*t)},O.en=j[b],O.Ls=j,O.p={},O}()}({get exports(){return Lu},set exports(t){Lu=t}});var Eu=Lu;const Au=r.createConnection,Ru=n.EventEmitter,Cu=i.inherits,Iu=o,Yu=e,Uu=u,Nu=a,qu=s,Hu=c,Wu=f.nfc,Bu=l("jsftp:general"),Qu=l("jsftp:command"),Vu=l("jsftp:response"),Zu=function(){},Gu={marks:[125,150],ignore:226},Ju=/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/,Ku=/\r\n|\n/;function Xu(t){let e=Zu,r=t+" ";for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];"function"==typeof i[i.length-1]&&(e=i.pop()),r+=i.join(" "),this.execute(r.trim(),e)}function ta(t){this.host=t.host||"localhost",this.port=t.port||21,this.user=t.user||"anonymous",this.pass=t.pass||"@anonymous",this.createSocket=t.createSocket,this.useList=t.useList||!1,this.commandQueue=[],Ru.call(this),this.on("data",Vu),this.on("error",Vu),this._createSocket(this.port,this.host)}Cu(ta,Ru),ta.prototype.raw=function(){Xu.apply(this,arguments)},ta.prototype.reemit=function(t){return e=>{this.emit(t,e),Bu(`event:${t}`,e||{})}},ta.prototype._createSocket=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zu;this.socket&&this.socket.destroy&&this.socket.destroy(),this.resParser&&this.resParser.end(),this.resParser=new Nu,this.authenticated=!1,this.socket=this.createSocket?this.createSocket({port:t,host:e},r):Au(t,e,r),this.socket.on("connect",this.reemit("connect")),this.socket.on("timeout",this.reemit("timeout")),this.pipeline=Uu(this.socket,this.resParser),this.pipeline.on("data",(t=>{this.emit("data",t),Vu(t.text),this.parseResponse(t)})),this.pipeline.on("error",this.reemit("error"))},ta.prototype.parseResponse=function(t){if(0===this.commandQueue.length)return;if([220].indexOf(t.code)>-1)return;const e=this.commandQueue[0].callback;if(t.isMark){if(!e.expectsMark||-1===e.expectsMark.marks.indexOf(t.code))return;e.expectsMark.ignore&&(this.ignoreCmdCode=e.expectsMark.ignore)}this.ignoreCmdCode!==t.code?this.parse(t,this.commandQueue.shift()):this.ignoreCmdCode=null},ta.prototype.send=function(t){t&&(Qu(t),this.pipeline.write(t+"\r\n"),Qu(t))},ta.prototype.nextCmd=function(){const t=this.commandQueue[0];!this.inProgress&&t&&(this.send(t.action),this.inProgress=!0)},ta.prototype.execute=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zu;if(this.socket&&this.socket.writable)return this.runCommand({action:t,callback:e});this.authenticated=!1,this._createSocket(this.port,this.host,(()=>{this.runCommand({action:t,callback:e})}))},ta.prototype.runCommand=function(t){if(this.authenticated||/^(feat|syst|user|pass)/.test(t.action))return this.commandQueue.push(t),void this.nextCmd();this.getFeatures((()=>{this.auth(this.user,this.pass,(()=>{this.commandQueue.push(t),this.nextCmd()}))}))},ta.prototype.parse=function(t,e){let r=null;t.isError&&(r=new Error(t.text||"Unknown FTP error."),r.code=t.code),this.inProgress=!1,e.callback(r,t),this.nextCmd()},ta.prototype.getPasvPort=function(t){const e=Ju.exec(t);if(!e)return null;let r=e[1].replace(/,/g,".");return"127.0.0.1"===r&&(r=this.host),{host:r,port:256*(255&parseInt(e[2],10))+(255&parseInt(e[3],10))}},ta.prototype.hasFeat=function(t){return!!t&&this.features.indexOf(t.toLowerCase())>-1},ta.prototype._parseFeats=function(t){return t.split(Ku).slice(1,-1).map((t=>t.trim().toLowerCase())).filter((t=>!!t))},ta.prototype.getFeatures=function(t){if(this.features)return t(null,this.features);this.raw("feat",((e,r)=>{this.features=e?[]:this._parseFeats(r.text),this.raw("syst",((e,r)=>{e||215!==r.code||(this.system=r.text.toLowerCase()),t(null,this.features)}))}))},ta.prototype.auth=function(t,e,r){if(!0===this.authenticating)return r(new Error("This client is already authenticating"));"string"!=typeof t&&(t=this.user),"string"!=typeof e&&(e=this.pass),this.authenticating=!0,this.raw("user",t,((n,i)=>{if(n||-1===[230,331,332].indexOf(i.code))return this.authenticating=!1,void r(n);this.raw("pass",e,((n,i)=>{this.authenticating=!1,n?r(n):[230,202].indexOf(i.code)>-1?(this.authenticated=!0,this.user=t,this.pass=e,this.raw("type","I",(()=>{r(void 0,i)}))):332===i.code&&this.raw("acct","")}))}))},ta.prototype.setType=function(t,e){if(t=t.toUpperCase(),this.type===t)return e();this.raw("type",t,((r,n)=>{r||(this.type=t),e(r,n)}))},ta.prototype.list=function(t,e){1===arguments.length&&(e=arguments[0],t="");let r="";e=Hu(e),this.getPasvSocket(((n,i)=>{if(n)return e(n);function o(t,r){if(t)return e(t);Gu.marks.some((t=>t===r.code))||e(new Error(`Expected marks ${Gu.toString()} instead of: ${r.text}`))}i.setEncoding("utf8"),i.on("data",(t=>{r+=t})),this.pasvTimeout(i,e),i.once("close",(n=>n?e(n):r?void e(null,r):e({code:451,text:`Could not retrieve a file listing for ${t}.`,isMark:!1,isError:!0}))),i.once("error",e),o.expectsMark=Gu,this.execute(`list ${t||""}`,o)}))},ta.prototype.emitProgress=function(t){this.emit("progress",{filename:t.filename,action:t.action,total:t.totalSize||0,transferred:t.socket["get"===t.action?"bytesRead":"bytesWritten"]})},ta.prototype.get=function(t,e){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zu;const i=typeof e;"function"===i?r=e:"string"===i&&(n=Hu(n),r=(r,i)=>{if(r)return n(r);const o=Yu.createWriteStream(e);o.on("error",n),i.on("readable",(()=>{this.emitProgress({filename:t,action:"get",socket:i})})),i.on("error",n),i.on("end",n),i.on("close",n),i.pipe(o)}),this.getGetSocket(t,Hu(r))},ta.prototype.getGetSocket=function(t,e){e=Hu(e),this.getPasvSocket(((r,n)=>{if(r)return i(r);function i(t,r){return t?(n&&n.destroy(),e(t)):n?125===r.code||150===r.code?e(null,n):(n.destroy(),e(new Error("Unexpected command "+r.text))):e(new Error("Error when retrieving PASV socket"))}n.on("error",(t=>{"ECONNREFUSED"===t.code&&(t.msg="Probably trying a PASV operation while one is in progress"),i(t)})),this.pasvTimeout(n,i),n.pause(),i.expectsMark=Gu,this.execute("retr "+t,i)}))},ta.prototype.put=function(t,e,r){const n=(t,e,n)=>{t.on("readable",(()=>{this.emitProgress({filename:e,action:"put",socket:t,totalSize:n})})),this.getPutSocket(t,e,r)};t instanceof Buffer?this.getPutSocket(t,e,((e,n)=>{if(e)return r(new Error(e));let i,o=0,u=1048576,a=!1;i=t.slice(o,o+u),o+=u,r(null,i),n.write(t.slice(0,u)),i.length===t.length&&(n.end(),r(null,[])),n.on("drain",(()=>{t.length>o+u?(i=t.slice(o,o+u),o+=u):(i=t.slice(o),a=!0),r(null,i),n.write(i),a&&(n.end(),r(null,[]))}))})):"string"==typeof t?Yu.stat(t,((i,o)=>{if(i&&"ENOENT"===i.code)return r(new Error("Local file doesn't exist."));if(o.isDirectory())return r(new Error("Local path cannot be a directory"));const u=i?0:o.size;n(Yu.createReadStream(t),e,u)})):t instanceof Iu.Readable?n(t,e,0):r(new Error("Expected `from` parameter to be a Buffer, Stream, or a String"))},ta.prototype.getPutSocket=function(t,e,r){r=Hu(r||Zu),this.getPasvSocket(((n,i)=>{if(n)return i&&i.destroy(),r(n);i.on("close",r),i.on("error",r);const o=Hu(((e,n)=>e?(i&&i.destroy(),r(e)):125!==n.code&&150!==n.code?(i&&i.destroy(),r(new Error("Unexpected command "+n.text))):(this.pasvTimeout(i,r),void(t instanceof Buffer?r(null,i):t instanceof Iu.Readable&&(r(null,i),t.pipe(i))))));o.expectsMark=Gu,this.execute(`stor ${e}`,o)}))},ta.prototype.pasvTimeout=function(t,e){t.once("timeout",(()=>{Bu("PASV socket timeout"),this.emit("timeout"),t.end(),e(new Error("Passive socket timeout"))}))},ta.prototype.getPasvSocket=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zu;t=Hu(t),this.execute("pasv",((e,r)=>{if(e)return t(e);const n=this.getPasvPort(r.text);if(!n)return t(new Error("Bad passive host/port combination"));const i=this._pasvSocket=this.createSocket?this.createSocket(n):Au(n);i.setTimeout(this.timeout||6e5),i.once("close",(()=>{this._pasvSocket=void 0})),t(null,i)}))},ta.prototype.ls=function(t,e){function r(t,r){if(t)return e(t);qu.parseFtpEntries(r.text||r,((t,r)=>{if(t)return e(t);r.forEach((t=>{t.name=Wu(t.name)})),e(null,r)}))}this.useList?this.list(t,r):this.raw("stat",t,((e,n)=>{const i=e&&(502===e.code||500===e.code),o=this.system&&this.system.indexOf("hummingbird")>-1;i||o?(this.useList=!0,this.list(t,r)):r(e,n)}))},ta.prototype.rename=function(t,e,r){this.raw("rnfr",t,(t=>{if(t)return r(t);this.raw("rnto",e,r)}))},ta.prototype.keepAlive=function(t){this._keepAliveInterval&&clearInterval(this._keepAliveInterval),this._keepAliveInterval=setInterval(this.raw.bind(this,"noop"),t||3e4)},ta.prototype.destroy=function(){this._keepAliveInterval&&clearInterval(this._keepAliveInterval),this.socket&&this.socket.writable&&this.socket.end(),this._pasvSocket&&this._pasvSocket.writable&&this._pasvSocket.end(),this.resParser.end(),this.socket=void 0,this._pasvSocket=void 0,this.features=null,this.authenticated=!1};var ea=ta,ra=hu,na=Zo;var ia=function(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:na(e),ra(t,0,(e=n-e)<0?0:e)):[]},oa=hu;var ua=function(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:oa(t,e,r)};var aa=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1};var sa=aa,ca=function(t){return t!=t},fa=function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1};var la=function(t,e,r){return e==e?fa(t,e,r):sa(t,ca,r)},pa=la;var ha=function(t,e){for(var r=t.length;r--&&pa(e,t[r],0)>-1;);return r},da=la;var va=function(t,e){for(var r=-1,n=t.length;++r<n&&da(e,t[r],0)>-1;);return r};var ya=function(t){return t.split("")},ma="\\ud800-\\udfff",ga="["+ma+"]",ba="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ja="\\ud83c[\\udffb-\\udfff]",wa="[^"+ma+"]",_a="(?:\\ud83c[\\udde6-\\uddff]){2}",Oa="[\\ud800-\\udbff][\\udc00-\\udfff]",$a="(?:"+ba+"|"+ja+")"+"?",Sa="[\\ufe0e\\ufe0f]?",ka=Sa+$a+("(?:\\u200d(?:"+[wa,_a,Oa].join("|")+")"+Sa+$a+")*"),Pa="(?:"+[wa+ba+"?",ba,_a,Oa,ga].join("|")+")",Ta=RegExp(ja+"(?="+ja+")|"+Pa+ka,"g");var xa=ya,Fa=so,Da=function(t){return t.match(Ta)||[]};var za=be,Ma=Ao,La=ua,Ea=ha,Aa=va,Ra=function(t){return Fa(t)?Da(t):xa(t)},Ca=we;var Ia=function(t,e,r){if((t=Ca(t))&&(r||void 0===e))return Ma(t);if(!t||!(e=za(e)))return t;var n=Ra(t),i=Ra(e),o=Aa(n,i),u=Ea(n,i)+1;return La(n,o,u).join("")};function Ya(t,e){if(!ru(t))return[];if(!ru(e))return[];let r=function(t,e){return ru(t)&&ru(e)?t.split(e):[]}(t,e);r=eo(r,Ia);let n=[];return $u(r,(function(t){ru(t)&&n.push(t)})),n}function Ua(t,e){return ru(t)&&ku(e)?0===(e=ou(e))?t:Pu(t,t.length-e):""}function Na(t){"."===Tu(t,1)&&(t=Ua(t,1));let e=Ya(t,"/");e=ia(e);let r=[],n=".";return $u(e,(t=>{n+="/"+t,r.push(n)})),r}var qa=Hi,Ha=ln,Wa=vn;var Ba=function(t){return function(e,r,n){var i=Object(e);if(!Ha(e)){var o=qa(r);e=Wa(e),r=function(t){return o(i[t],t,i)}}var u=t(e,r,n);return u>-1?i[o?e[u]:u]:void 0}},Qa=aa,Va=Hi,Za=Zo,Ga=Math.max;var Ja=Ba((function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:Za(r);return i<0&&(i=Ga(n+i,0)),Qa(t,Va(e),i)})),Ka=Vi;var Xa=vr,ts=function(t,e){var r=[];return Ka(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r},es=Hi,rs=v;var ns=function(t,e){return(rs(t)?Xa:ts)(t,es(e))},is=Array.prototype.join;var os=function(t,e){return null==t?"":is.call(t,e)};function us(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function as(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?us(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):us(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}async function ss(r,n){let i=Me(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},"ftpLs");if(!pu(i))return Promise.reject("opt.ftpLs is not a function");if(!Du(n))return Promise.reject(`fdLocal[${n}] is not a folder`);n=t.resolve(n);let o=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=1;return function r(o){let u=[],a=e.readdirSync(o);return $u(a,(function(a){let s=t.resolve(o,a),c=null;try{c=e.statSync(s)}catch(t){}c&&c.isDirectory()?(u.push({isFolder:!0,level:i,path:s,name:t.basename(s)}),i+=1,(i<=n||null===n)&&(u=u.concat(r(s))),i-=1):u.push({isFolder:!1,level:i,path:s,name:t.basename(s)})})),u}(r)}(n,null);o=ns(o,(t=>!t.isFolder)),o=eo(o,(i=>{let o=e.statSync(i.path);return i.size=Me(o,"size",0),i.rpath=(e=>{let i=(e=t.resolve(e)).replace(n,""),o=new RegExp("\\\\","g");i=String(i).replace(o,"/");let u=r;return"."===Tu(r,1)&&(u=Ua(r,1)),i=[...Ya(u,"/"),...Ya(i,"/")],i=os(i,"/"),i=`./${i}`,i})(i.path),i}));let u=await function(t,e){let r=1,n=Me(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},"levelLimit");cu(n)||(n=null);let i=async t=>{let o=[],u=await e(t);return await Su(u,(async e=>{let u=`${t}/${e.name}`;if(e.isFolder){if(o.push(as(as({},e),{},{isFolder:!0,level:r,rpath:u,name:Fu(u)})),r+=1,r<=n||null===n){let t=await i(u);o=o.concat(t)}r-=1}else o.push(as(as({},e),{},{isFolder:!1,level:r,rpath:u,name:Fu(u)}))})),o};return i(t)}(r,i);return u=ns(u,(t=>!t.isFolder)),u=eo(u,(e=>{var i;return e.lpath=(i=e.rpath,"."!==r&&(i=i.replace(r,"")),"."===Tu(i,1)&&(i=Ua(i,1)),"/"===Tu(i,1)&&(i=Ua(i,1)),t.resolve(n,i)),e})),{fsRemote:u,fsLocal:o}}async function cs(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Me(n,"ftpLs");if(!pu(i))return Promise.reject("opt.ftpLs is not a function");let o=Me(n,"ftpDownload");if(!pu(o))return Promise.reject("opt.ftpDownload is not a function");Du(e)||Mu(e);let u=await ss(t,e,{ftpLs:i}),a=u.fsRemote,s=u.fsLocal,c=0,f=[];return await Su(a,(async t=>{let e=Me(t,"lpath",""),n=Ja(s,{path:e}),i=Me(t,"rpath",""),u=Me(t,"lpath",""),a=t=>{pu(r)&&r(t)};lu(n)?t.size!==n.size&&(await o(i,u,a),c++,f.push({path:t.rpath,reason:`size[${n.size}] of local file != size[${t.size}] of remote file`})):(await o(i,u,a),c++,f.push({path:t.rpath,reason:"no local file"}))})),{num:c,files:f}}async function fs(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Me(n,"ftpLs");if(!pu(i))return Promise.reject("opt.ftpLs is not a function");let o=Me(n,"ftpUpload");if(!pu(o))return Promise.reject("opt.ftpUpload is not a function");let u=await ss(e,t,{ftpLs:i}),a=u.fsRemote,s=u.fsLocal,c=0,f=[];return await Su(s,(async t=>{let e=Me(t,"rpath",""),n=Ja(a,{rpath:e}),i=Me(t,"rpath",""),u=Me(t,"path",""),s=t=>{pu(r)&&r(t)};lu(n)?t.size!==n.size&&(await o(u,i,s),c++,f.push({name:t.rpath,reason:`size[${n.size}] of remote file != size[${t.size}] of local file`})):(await o(u,i,s),c++,f.push({name:t.rpath,reason:"no Remote file"}))})),{num:c,files:f}}function ls(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ps(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ls(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ls(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function hs(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,i=Me(r,"hostname");if(!ru(i))throw new Error(`hostname[${i}] is not an effective string`);let o=Me(r,"port");cu(o)||(o=21),o=ou(o);let u=Me(r,"username");if(!ru(u))throw new Error(`username[${u}] is not an effective string`);let a=Me(r,"password");if(!ru(a))throw new Error(`password[${a}] is not an effective string`);let s=Me(r,"timeLimit");async function c(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".",e=zo();if(null===n)return e.reject("FTP has not been initialized. please use 'conn' to construct FTP"),e;let r=setTimeout((()=>{e.reject(`ftpLs timeout[${s}]`)}),s);return n.ls(t,((t,n)=>{clearTimeout(r),t?e.reject(t):(n=eo(n,(t=>{let e=Eu(t.time);return t.ctime=e.format("YYYY-MM-DDTHH:mm:ssZ"),t.size=ou(t.size),t.isFolder=d(t),t})),e.resolve(n))})),e}async function f(t,e){let r=zo();if(null===n)return r.reject("FTP has not been initialized. please use 'conn' to construct FTP"),r;let i=setTimeout((()=>{r.reject(`ftpRaw[${t}] timeout[${s}]`)}),s);return n.raw(t,e,((t,e)=>{clearTimeout(i),t?r.reject(t):r.resolve(e)})),r}async function l(t){let e=Na(t);return Fo(e)>=1&&await Su(e,(async t=>{await v(t)||await async function(t){return f("mkd",t)}(t)})),"ok"}async function p(t){return f("cwd",t)}async function h(t){if(null===n)return Promise.reject("FTP has not been initialized. please use 'conn' to construct FTP");let e={},r=null;if(await async function(t){return f("mlst",t)}(t).then((t=>{r=t})).catch((t=>{r={err:t.toString()}})),!lu(r))return Promise.reject("invalid result from ftpMlst");{let t=Me(r,"text",""),n=t.indexOf("type=dir;")>=0,i=t.indexOf("type=file;")>=0;e=ps(ps({},e),{},{rmlst:r,isFolder:n,isFile:i})}let i=null;if(await async function(t){return f("size",t)}(t).then((t=>{i=t})).catch((t=>{i={err:t.toString()}})),!lu(i))return Promise.reject("invalid result from ftpSize");{let t=Me(i,"code",""),r=Me(i,"text","").replace(`${t} `,"");r=ou(r),e=ps(ps({},e),{},{rsize:i,size:r})}return e}function d(t){if(!lu(t))return!1;let e;return e=Me(t,"isFolder",!1),e||(e=1===Me(t,"type",-1),e||e)}async function v(t){return d(await h(t))}function y(t){if(!lu(t))return!1;let e;return e=Me(t,"isFile",!1),e||(e=0===Me(t,"type",-1),e||e)}async function m(r,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=zo();if(null===n)return u.reject("FTP has not been initialized. please use 'conn' to construct FTP"),u;if(!ru(r))return u.reject(`fpRemote[${r}] is not an effective string`),u;if(!ru(i))return u.reject(`fpLocal[${i}] is not an effective string`),u;let a=t.dirname(i);zu(i)&&e.unlinkSync(i),Du(a)||Mu(a);let c=await h(r);if(!y(c))return u.reject(`fpRemote[${r}] is not a file`),u;if(!lu(c)||(l="err",fu(f=c)&&(ru(l)||nu(l))&&l in f))return u.reject(`fpRemote[${r}] does not have information`),u;var f,l;let p=Me(c,"size");if(!nu(p))return u.reject(`can not get the size of file[${r}]`),u;p=ou(p);let d=setTimeout((()=>{u.reject(`ftpDownload timeout[${s}]`)}),s);return n.get(r,((t,n)=>{if(t)return clearTimeout(d),void u.reject(t);let a=e.createWriteStream(i),s=0;n.on("data",(t=>{if(pu(o)){let e=Fo(t);s+=e,o({progress:s/p*100,name:Fu(i),fpRemote:r,fpLocal:i})}a.write(t)})),n.on("close",(()=>{a.end()})),a.on("finish",(()=>{clearTimeout(d),t?u.reject(t):u.resolve("ok")})),a.on("error",(t=>{console.log("writer error",t)})),n.resume()})),u}async function g(t,r,i){let o=null;if(null===n)return Promise.reject("FTP has not been initialized. please use 'conn' to construct FTP");if(!ru(r))return Promise.reject(`fpRemote[${r}] is not an effective string`);let u=Na(r),a=r;if(Fo(u)>=1){await l(r);let t=Do(u);await p(t),a="."+r.replace(t,"")}let c=await async function(t,r,i){let o=zo();if(null===n)return o.reject("FTP has not been initialized. please use 'conn' to construct FTP"),o;if(!ru(r))return o.reject(`fpRemote[${r}] is not an effective string`),o;if(!ru(t))return o.reject(`fpLocal[${t}] is not an effective string`),o;if(!zu(t))return o.reject(`fpLocal[${t}] is not a file`),o;let u=e.statSync(t),a=Me(u,"size",0);if(!nu(a))return o.reject(`can not get the size of file[${t}]`),o;a=ou(a);let c=e.readFileSync(t),f=setTimeout((()=>{o.reject(`ftpUploadCore timeout[${s}]`)}),s),l=0;return n.put(c,r,((e,n)=>{if(e)return clearTimeout(f),void o.reject(e);if(0===Fo(n))return clearTimeout(f),void o.resolve("ok");if(pu(i)){let e=Fo(n);l+=e,i({progress:l/a*100,name:Fu(t),fpRemote:r,fpLocal:t})}})),o}(t,a,i).catch((t=>{o=t}));return Fo(u)>=1&&await p("/"),null!==o?Promise.reject(o):c}return nu(s)||(s=6e4),s=ou(s),{conn:async function(){let t=zo();try{n=new ea({host:i,port:o,user:u,pass:a}),t.resolve("ok")}catch(e){t.reject(e)}return t},quit:async function(){let t=zo();if(null===n)return t.reject("FTP has not been initialized. please use 'conn' to construct FTP"),t;let e=setTimeout((()=>{n.destroy(),n=null,t.reject(`ftpQuit timeout[${s}]`)}),s);return n.raw("quit",((r,i)=>{clearTimeout(e),n.destroy(),n=null,r?t.reject(r):t.resolve(i)})),t},ls:c,isFile:async function(t){return y(await h(t))},isFolder:v,download:m,upload:g,syncToLocal:async(t,e,r)=>cs(t,e,r,{ftpLs:c,ftpDownload:m}),syncToRemote:async(t,e,r)=>fs(t,e,r,{ftpLs:c,ftpUpload:g}),stat:h,mkdir:l,cwd:p,pwd:async function(){return f("pwd")}}}function ds(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ds(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ds(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ys(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,i=Me(r,"hostname");if(!ru(i))throw new Error(`hostname[${i}] is not an effective string`);let o=Me(r,"port");cu(o)||(o=22),o=ou(o);let u=Me(r,"username");if(!ru(u))throw new Error(`username[${u}] is not an effective string`);let a=Me(r,"password");if(!ru(a))throw new Error(`password[${a}] is not an effective string`);let s=Me(r,"timeLimit");async function c(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".",e=null,r=zo();if(null===n)return r.reject("FTP has not been initialized. please use 'conn' to construct FTP"),r;let i=setTimeout((()=>{r.reject(`ftpLs timeout[${s}]`)}),s),o=await n.list(t).catch((t=>{e=t}));return clearTimeout(i),null!==e?(r.reject(e),r):(o=eo(o,(t=>{let e;return e=Eu(t.modifyTime),t.ctime=e.format("YYYY-MM-DDTHH:mm:ssZ"),e=Eu(t.accessTime),t.atime=e.format("YYYY-MM-DDTHH:mm:ssZ"),t.isFolder=h(t),t})),r.resolve(o),r)}async function f(t){let e=Na(t);if(Fo(e)>=1){let t=Do(e);await async function(t){return n.mkdir(t,!0)}(t)}return"ok"}async function l(t){let e=null;return await n.stat(t).then((r=>{e=vs(vs({},r),{},{name:t})})).catch((()=>{e=null})),e}function h(t){if(!lu(t))return!1;let e;return e=!0===Me(t,"isDirectory",null),e||(e="d"===Me(t,"type",""),e||!1)}function d(t){if(!lu(t))return!1;let e;return e=!0===Me(t,"isFile",null),e||(e="-"===Me(t,"type",""),e||e)}async function v(r,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=zo();if(null===n)return u.reject("FTP has not been initialized. please use 'conn' to construct FTP"),u;if(!ru(r))return u.reject(`fpRemote[${r}] is not an effective string`),u;if(!ru(i))return u.reject(`fpLocal[${i}] is not an effective string`),u;let a=t.dirname(i);Du(a)||Mu(a);let c=await l(r);if(!d(c))return u.reject(`fpRemote[${r}] is not a file`),u;if(!lu(c))return u.reject(`fpRemote[${r}] does not have information`),u;let f=Me(c,"size");if(!nu(f))return u.reject(`can not get the size of file[${r}]`),u;f=ou(f),zu(i)&&e.unlinkSync(i);let p=setTimeout((()=>{u.reject(`ftpDownload timeout[${s}]`)}),s);return n.fastGet(r,i,{step:(t,e,n)=>{if(pu(o)){o({progress:t/n*100,name:Fu(i),fpRemote:r,fpLocal:i})}}}).then((()=>{u.resolve("ok")})).catch((t=>{u.reject(t)})).finally((()=>{clearTimeout(p)})),clearTimeout(p),u}async function y(t,r,i){let o=zo();if(null===n)return o.reject("FTP has not been initialized. please use 'conn' to construct FTP"),o;if(!ru(r))return o.reject(`fpRemote[${r}] is not an effective string`),o;if(!ru(t))return o.reject(`fpLocal[${t}] is not an effective string`),o;if(!zu(t))return o.reject(`fpLocal[${t}] is not a file`),o;await f(r);let u=e.statSync(t),a=Me(u,"size",0);if(!nu(a))return o.reject(`can not get the size of file[${t}]`),o;a=ou(a);let c=setTimeout((()=>{o.reject(`ftpUploadCore timeout[${s}]`)}),s);return n.fastPut(t,r,{step:(e,n,o)=>{if(pu(i)){i({progress:e/o*100,name:Fu(t),fpRemote:r,fpLocal:t})}}}).then((()=>{o.resolve("ok")})).catch((t=>{o.reject(t)})).finally((()=>{clearTimeout(c)})),clearTimeout(c),o}return nu(s)||(s=6e4),s=ou(s),{conn:async function(){return n=new p,await n.connect({host:i,port:o,username:u,password:a}),"ok"},quit:async function(){let t=zo();if(null===n)return t.reject("FTP has not been initialized. please use 'conn' to construct FTP"),t;let e=setTimeout((()=>{n.end(),n=null,t.reject(`ftpQuit timeout[${s}]`)}),s);try{n.end(),n=null,clearTimeout(e),t.resolve("ok")}catch(e){t.reject(e)}return t},ls:c,isFile:async function(t){return d(await l(t))},isFolder:async function(t){return h(await l(t))},download:v,upload:y,syncToLocal:async(t,e,r)=>cs(t,e,r,{ftpLs:c,ftpDownload:v}),syncToRemote:async(t,e,r)=>fs(t,e,r,{ftpLs:c,ftpUpload:y}),stat:l,mkdir:f,cwd:async function(t){return n.cwd(t)},pwd:async function(){return n.pwd()}}}async function ms(){return null}async function gs(){return null}async function bs(){return null}async function js(t){return null}async function ws(t){return null}async function _s(t,e){return null}async function Os(t,e,r){return null}async function $s(t,e,r){return null}async function Ss(t,e,r){return null}async function ks(t){return null}async function Ps(t){return null}async function Ts(t){return null}async function xs(t){return null}return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Me(t,"transportation","FTP");if("FTP"!==e&&"SFTP"!==e)throw new Error(`transportation[${e}] is not FTP or SFTP`);let r=null;"FTP"===e?r=new hs(t):"SFTP"===e&&(r=new ys(t));let n={doc_conn:ms,doc_quit:gs,doc_ls:bs,doc_isFile:js,doc_isFolder:ws,doc_download:_s,doc_upload:Os,doc_syncToLocal:$s,doc_syncToRemote:Ss,doc_stat:ks,doc_mkdir:Ps,doc_cwd:Ts,doc_pwd:xs};return r.__doc___=n,r}}));
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("path"),require("fs"),require("net"),require("events"),require("util"),require("stream"),require("stream-combiner"),require("ftp-response-parser"),require("parse-listing"),require("once"),require("unorm"),require("debug"),require("ssh2-sftp-client")):"function"==typeof define&&define.amd?define(["path","fs","net","events","util","stream","stream-combiner","ftp-response-parser","parse-listing","once","unorm","debug","ssh2-sftp-client"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-ftp"]=e(t.path,t.fs,t.net,t.events,t.util,t.stream,t["stream-combiner"],t["ftp-response-parser"],t["parse-listing"],t.once,t.unorm,t.debug,t["ssh2-sftp-client"])}(this,(function(t,e,r,n,i,o,u,a,s,c,f,l,p){"use strict";var h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var v=Array.isArray,y="object"==typeof h&&h&&h.Object===Object&&h,m=y,g="object"==typeof self&&self&&self.Object===Object&&self,b=m||g||Function("return this")(),j=b.Symbol,w=j,_=Object.prototype,O=_.hasOwnProperty,$=_.toString,S=w?w.toStringTag:void 0;var k=function(t){var e=O.call(t,S),r=t[S];try{t[S]=void 0;var n=!0}catch(t){}var i=$.call(t);return n&&(e?t[S]=r:delete t[S]),i},P=Object.prototype.toString;var T=k,x=function(t){return P.call(t)},D=j?j.toStringTag:void 0;var M=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":D&&D in Object(t)?T(t):x(t)};var F=function(t){return null!=t&&"object"==typeof t},z=M,L=F;var E=function(t){return"symbol"==typeof t||L(t)&&"[object Symbol]"==z(t)},A=v,R=E,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;var I=function(t,e){if(A(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!R(t))||(C.test(t)||!Y.test(t)||null!=e&&t in Object(e))};var H=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},U=M,N=H;var q,W=function(t){if(!N(t))return!1;var e=U(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},B=b["__core-js_shared__"],Q=(q=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var V=function(t){return!!Q&&Q in t},Z=Function.prototype.toString;var G=function(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=W,K=V,X=H,tt=G,et=/^\[object .+?Constructor\]$/,rt=Function.prototype,nt=Object.prototype,it=rt.toString,ot=nt.hasOwnProperty,ut=RegExp("^"+it.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var at=function(t){return!(!X(t)||K(t))&&(J(t)?ut:et).test(tt(t))},st=function(t,e){return null==t?void 0:t[e]};var ct=function(t,e){var r=st(t,e);return at(r)?r:void 0},ft=ct(Object,"create"),lt=ft;var pt=function(){this.__data__=lt?lt(null):{},this.size=0};var ht=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},dt=ft,vt=Object.prototype.hasOwnProperty;var yt=function(t){var e=this.__data__;if(dt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return vt.call(e,t)?e[t]:void 0},mt=ft,gt=Object.prototype.hasOwnProperty;var bt=ft;var jt=pt,wt=ht,_t=yt,Ot=function(t){var e=this.__data__;return mt?void 0!==e[t]:gt.call(e,t)},$t=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=bt&&void 0===e?"__lodash_hash_undefined__":e,this};function St(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}St.prototype.clear=jt,St.prototype.delete=wt,St.prototype.get=_t,St.prototype.has=Ot,St.prototype.set=$t;var kt=St;var Pt=function(){this.__data__=[],this.size=0};var Tt=function(t,e){return t===e||t!=t&&e!=e},xt=Tt;var Dt=function(t,e){for(var r=t.length;r--;)if(xt(t[r][0],e))return r;return-1},Mt=Dt,Ft=Array.prototype.splice;var zt=Dt;var Lt=Dt;var Et=Dt;var At=Pt,Rt=function(t){var e=this.__data__,r=Mt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Ft.call(e,r,1),--this.size,!0)},Yt=function(t){var e=this.__data__,r=zt(e,t);return r<0?void 0:e[r][1]},Ct=function(t){return Lt(this.__data__,t)>-1},It=function(t,e){var r=this.__data__,n=Et(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Ht(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ht.prototype.clear=At,Ht.prototype.delete=Rt,Ht.prototype.get=Yt,Ht.prototype.has=Ct,Ht.prototype.set=It;var Ut=Ht,Nt=ct(b,"Map"),qt=kt,Wt=Ut,Bt=Nt;var Qt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Vt=function(t,e){var r=t.__data__;return Qt(e)?r["string"==typeof e?"string":"hash"]:r.map},Zt=Vt;var Gt=Vt;var Jt=Vt;var Kt=Vt;var Xt=function(t,e){var r=Kt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},te=function(){this.size=0,this.__data__={hash:new qt,map:new(Bt||Wt),string:new qt}},ee=function(t){var e=Zt(this,t).delete(t);return this.size-=e?1:0,e},re=function(t){return Gt(this,t).get(t)},ne=function(t){return Jt(this,t).has(t)},ie=Xt;function oe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}oe.prototype.clear=te,oe.prototype.delete=ee,oe.prototype.get=re,oe.prototype.has=ne,oe.prototype.set=ie;var ue=oe,ae=ue;function se(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var u=t.apply(this,n);return r.cache=o.set(i,u)||o,u};return r.cache=new(se.Cache||ae),r}se.Cache=ae;var ce=se;var fe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,le=/\\(\\)?/g,pe=function(t){var e=ce(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(fe,(function(t,r,n,i){e.push(n?i.replace(le,"$1"):r||t)})),e}));var he=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i},de=he,ve=v,ye=E,me=j?j.prototype:void 0,ge=me?me.toString:void 0;var be=function t(e){if("string"==typeof e)return e;if(ve(e))return de(e,t)+"";if(ye(e))return ge?ge.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},je=be;var we=function(t){return null==t?"":je(t)},_e=v,Oe=I,$e=pe,Se=we;var ke=function(t,e){return _e(t)?t:Oe(t,e)?[t]:$e(Se(t))},Pe=E;var Te=function(t){if("string"==typeof t||Pe(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},xe=ke,De=Te;var Me=function(t,e){for(var r=0,n=(e=xe(e,t)).length;null!=t&&r<n;)t=t[De(e[r++])];return r&&r==n?t:void 0},Fe=Me;var ze=function(t,e,r){var n=null==t?void 0:Fe(t,e);return void 0===n?r:n};function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function Ee(t){var e=function(t,e){if("object"!==Le(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Le(e)?e:String(e)}function Ae(t,e,r){return(e=Ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Re=Ut;var Ye=Ut,Ce=Nt,Ie=ue;var He=Ut,Ue=function(){this.__data__=new Re,this.size=0},Ne=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},qe=function(t){return this.__data__.get(t)},We=function(t){return this.__data__.has(t)},Be=function(t,e){var r=this.__data__;if(r instanceof Ye){var n=r.__data__;if(!Ce||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Ie(n)}return r.set(t,e),this.size=r.size,this};function Qe(t){var e=this.__data__=new He(t);this.size=e.size}Qe.prototype.clear=Ue,Qe.prototype.delete=Ne,Qe.prototype.get=qe,Qe.prototype.has=We,Qe.prototype.set=Be;var Ve=Qe;var Ze=ue,Ge=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Je=function(t){return this.__data__.has(t)};function Ke(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Ze;++e<r;)this.add(t[e])}Ke.prototype.add=Ke.prototype.push=Ge,Ke.prototype.has=Je;var Xe=Ke,tr=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},er=function(t,e){return t.has(e)};var rr=function(t,e,r,n,i,o){var u=1&r,a=t.length,s=e.length;if(a!=s&&!(u&&s>a))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var l=-1,p=!0,h=2&r?new Xe:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var d=t[l],v=e[l];if(n)var y=u?n(v,d,l,e,t,o):n(d,v,l,t,e,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!tr(e,(function(t,e){if(!er(h,e)&&(d===t||i(d,t,r,n,o)))return h.push(e)}))){p=!1;break}}else if(d!==v&&!i(d,v,r,n,o)){p=!1;break}}return o.delete(t),o.delete(e),p};var nr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r};var ir=b.Uint8Array,or=Tt,ur=rr,ar=nr,sr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},cr=j?j.prototype:void 0,fr=cr?cr.valueOf:void 0;var lr=function(t,e,r,n,i,o,u){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!o(new ir(t),new ir(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return or(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ar;case"[object Set]":var s=1&n;if(a||(a=sr),t.size!=e.size&&!s)return!1;var c=u.get(t);if(c)return c==e;n|=2,u.set(t,e);var f=ur(a(t),a(e),n,i,o,u);return u.delete(t),f;case"[object Symbol]":if(fr)return fr.call(t)==fr.call(e)}return!1};var pr=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t},hr=v;var dr=function(t,e,r){var n=e(t);return hr(t)?n:pr(n,r(t))};var vr=function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var u=t[r];e(u,r,t)&&(o[i++]=u)}return o};var yr=vr,mr=function(){return[]},gr=Object.prototype.propertyIsEnumerable,br=Object.getOwnPropertySymbols,jr=br?function(t){return null==t?[]:(t=Object(t),yr(br(t),(function(e){return gr.call(t,e)})))}:mr;var wr=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n},_r=M,Or=F;var $r=function(t){return Or(t)&&"[object Arguments]"==_r(t)},Sr=F,kr=Object.prototype,Pr=kr.hasOwnProperty,Tr=kr.propertyIsEnumerable,xr=$r(function(){return arguments}())?$r:function(t){return Sr(t)&&Pr.call(t,"callee")&&!Tr.call(t,"callee")},Dr=xr,Mr={};var Fr=function(){return!1};!function(t,e){var r=b,n=Fr,i=e&&!e.nodeType&&e,o=i&&t&&!t.nodeType&&t,u=o&&o.exports===i?r.Buffer:void 0,a=(u?u.isBuffer:void 0)||n;t.exports=a}({get exports(){return Mr},set exports(t){Mr=t}},Mr);var zr=/^(?:0|[1-9]\d*)$/;var Lr=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&zr.test(t))&&t>-1&&t%1==0&&t<e};var Er=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Ar=M,Rr=Er,Yr=F,Cr={};Cr["[object Float32Array]"]=Cr["[object Float64Array]"]=Cr["[object Int8Array]"]=Cr["[object Int16Array]"]=Cr["[object Int32Array]"]=Cr["[object Uint8Array]"]=Cr["[object Uint8ClampedArray]"]=Cr["[object Uint16Array]"]=Cr["[object Uint32Array]"]=!0,Cr["[object Arguments]"]=Cr["[object Array]"]=Cr["[object ArrayBuffer]"]=Cr["[object Boolean]"]=Cr["[object DataView]"]=Cr["[object Date]"]=Cr["[object Error]"]=Cr["[object Function]"]=Cr["[object Map]"]=Cr["[object Number]"]=Cr["[object Object]"]=Cr["[object RegExp]"]=Cr["[object Set]"]=Cr["[object String]"]=Cr["[object WeakMap]"]=!1;var Ir=function(t){return Yr(t)&&Rr(t.length)&&!!Cr[Ar(t)]};var Hr=function(t){return function(e){return t(e)}},Ur={};!function(t,e){var r=y,n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,o=i&&i.exports===n&&r.process,u=function(){try{var t=i&&i.require&&i.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=u}({get exports(){return Ur},set exports(t){Ur=t}},Ur);var Nr=Ir,qr=Hr,Wr=Ur&&Ur.isTypedArray,Br=Wr?qr(Wr):Nr,Qr=wr,Vr=Dr,Zr=v,Gr=Mr,Jr=Lr,Kr=Br,Xr=Object.prototype.hasOwnProperty;var tn=function(t,e){var r=Zr(t),n=!r&&Vr(t),i=!r&&!n&&Gr(t),o=!r&&!n&&!i&&Kr(t),u=r||n||i||o,a=u?Qr(t.length,String):[],s=a.length;for(var c in t)!e&&!Xr.call(t,c)||u&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Jr(c,s))||a.push(c);return a},en=Object.prototype;var rn=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||en)};var nn=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),on=rn,un=nn,an=Object.prototype.hasOwnProperty;var sn=function(t){if(!on(t))return un(t);var e=[];for(var r in Object(t))an.call(t,r)&&"constructor"!=r&&e.push(r);return e},cn=W,fn=Er;var ln=function(t){return null!=t&&fn(t.length)&&!cn(t)},pn=tn,hn=sn,dn=ln;var vn=function(t){return dn(t)?pn(t):hn(t)},yn=dr,mn=jr,gn=vn;var bn=function(t){return yn(t,gn,mn)},jn=Object.prototype.hasOwnProperty;var wn=function(t,e,r,n,i,o){var u=1&r,a=bn(t),s=a.length;if(s!=bn(e).length&&!u)return!1;for(var c=s;c--;){var f=a[c];if(!(u?f in e:jn.call(e,f)))return!1}var l=o.get(t),p=o.get(e);if(l&&p)return l==e&&p==t;var h=!0;o.set(t,e),o.set(e,t);for(var d=u;++c<s;){var v=t[f=a[c]],y=e[f];if(n)var m=u?n(y,v,f,e,t,o):n(v,y,f,t,e,o);if(!(void 0===m?v===y||i(v,y,r,n,o):m)){h=!1;break}d||(d="constructor"==f)}if(h&&!d){var g=t.constructor,b=e.constructor;g==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b||(h=!1)}return o.delete(t),o.delete(e),h},_n=ct(b,"DataView"),On=Nt,$n=ct(b,"Promise"),Sn=ct(b,"Set"),kn=ct(b,"WeakMap"),Pn=M,Tn=G,xn="[object Map]",Dn="[object Promise]",Mn="[object Set]",Fn="[object WeakMap]",zn="[object DataView]",Ln=Tn(_n),En=Tn(On),An=Tn($n),Rn=Tn(Sn),Yn=Tn(kn),Cn=Pn;(_n&&Cn(new _n(new ArrayBuffer(1)))!=zn||On&&Cn(new On)!=xn||$n&&Cn($n.resolve())!=Dn||Sn&&Cn(new Sn)!=Mn||kn&&Cn(new kn)!=Fn)&&(Cn=function(t){var e=Pn(t),r="[object Object]"==e?t.constructor:void 0,n=r?Tn(r):"";if(n)switch(n){case Ln:return zn;case En:return xn;case An:return Dn;case Rn:return Mn;case Yn:return Fn}return e});var In=Cn,Hn=Ve,Un=rr,Nn=lr,qn=wn,Wn=In,Bn=v,Qn=Mr,Vn=Br,Zn="[object Arguments]",Gn="[object Array]",Jn="[object Object]",Kn=Object.prototype.hasOwnProperty;var Xn=function(t,e,r,n,i,o){var u=Bn(t),a=Bn(e),s=u?Gn:Wn(t),c=a?Gn:Wn(e),f=(s=s==Zn?Jn:s)==Jn,l=(c=c==Zn?Jn:c)==Jn,p=s==c;if(p&&Qn(t)){if(!Qn(e))return!1;u=!0,f=!1}if(p&&!f)return o||(o=new Hn),u||Vn(t)?Un(t,e,r,n,i,o):Nn(t,e,s,r,n,i,o);if(!(1&r)){var h=f&&Kn.call(t,"__wrapped__"),d=l&&Kn.call(e,"__wrapped__");if(h||d){var v=h?t.value():t,y=d?e.value():e;return o||(o=new Hn),i(v,y,r,n,o)}}return!!p&&(o||(o=new Hn),qn(t,e,r,n,i,o))},ti=F;var ei=function t(e,r,n,i,o){return e===r||(null==e||null==r||!ti(e)&&!ti(r)?e!=e&&r!=r:Xn(e,r,n,i,t,o))},ri=Ve,ni=ei;var ii=H;var oi=function(t){return t==t&&!ii(t)},ui=oi,ai=vn;var si=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},ci=function(t,e,r,n){var i=r.length,o=i,u=!n;if(null==t)return!o;for(t=Object(t);i--;){var a=r[i];if(u&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var s=(a=r[i])[0],c=t[s],f=a[1];if(u&&a[2]){if(void 0===c&&!(s in t))return!1}else{var l=new ri;if(n)var p=n(c,f,s,t,e,l);if(!(void 0===p?ni(f,c,3,n,l):p))return!1}}return!0},fi=function(t){for(var e=ai(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,ui(i)]}return e},li=si;var pi=ke,hi=Dr,di=v,vi=Lr,yi=Er,mi=Te;var gi=function(t,e,r){for(var n=-1,i=(e=pi(e,t)).length,o=!1;++n<i;){var u=mi(e[n]);if(!(o=null!=t&&r(t,u)))break;t=t[u]}return o||++n!=i?o:!!(i=null==t?0:t.length)&&yi(i)&&vi(u,i)&&(di(t)||hi(t))},bi=function(t,e){return null!=t&&e in Object(t)},ji=gi;var wi=function(t,e){return null!=t&&ji(t,e,bi)},_i=ei,Oi=ze,$i=wi,Si=I,ki=oi,Pi=si,Ti=Te;var xi=function(t,e){return Si(t)&&ki(e)?Pi(Ti(t),e):function(r){var n=Oi(r,t);return void 0===n&&n===e?$i(r,t):_i(e,n,3)}};var Di=function(t){return t};var Mi=function(t){return function(e){return null==e?void 0:e[t]}},Fi=Me;var zi=function(t){return function(e){return Fi(e,t)}},Li=Mi,Ei=zi,Ai=I,Ri=Te;var Yi=function(t){return Ai(t)?Li(Ri(t)):Ei(t)},Ci=function(t){var e=fi(t);return 1==e.length&&e[0][2]?li(e[0][0],e[0][1]):function(r){return r===t||ci(r,t,e)}},Ii=xi,Hi=Di,Ui=v,Ni=Yi;var qi=function(t){return"function"==typeof t?t:null==t?Hi:"object"==typeof t?Ui(t)?Ii(t[0],t[1]):Ci(t):Ni(t)};var Wi=function(t){return function(e,r,n){for(var i=-1,o=Object(e),u=n(e),a=u.length;a--;){var s=u[t?a:++i];if(!1===r(o[s],s,o))break}return e}}(),Bi=vn;var Qi=ln;var Vi=function(t,e){return function(r,n){if(null==r)return r;if(!Qi(r))return t(r,n);for(var i=r.length,o=e?i:-1,u=Object(r);(e?o--:++o<i)&&!1!==n(u[o],o,u););return r}}((function(t,e){return t&&Wi(t,e,Bi)})),Zi=Vi,Gi=ln;var Ji=he,Ki=qi,Xi=function(t,e){var r=-1,n=Gi(t)?Array(t.length):[];return Zi(t,(function(t,i,o){n[++r]=e(t,i,o)})),n},to=v;var eo=function(t,e){return(to(t)?Ji:Xi)(t,Ki(e))},ro={};var no=Di;var io=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},oo=Vi,uo=function(t){return"function"==typeof t?t:no},ao=v;var so=function(t,e){return(ao(t)?io:oo)(t,uo(e))};!function(t){t.exports=so}({get exports(){return ro},set exports(t){ro=t}});var co=d(ro),fo=M,lo=v,po=F;var ho=function(t){return"string"==typeof t||!lo(t)&&po(t)&&"[object String]"==fo(t)},vo=Mi("length"),yo=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var mo=function(t){return yo.test(t)},go="\\ud800-\\udfff",bo="["+go+"]",jo="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",wo="\\ud83c[\\udffb-\\udfff]",_o="[^"+go+"]",Oo="(?:\\ud83c[\\udde6-\\uddff]){2}",$o="[\\ud800-\\udbff][\\udc00-\\udfff]",So="(?:"+jo+"|"+wo+")"+"?",ko="[\\ufe0e\\ufe0f]?",Po=ko+So+("(?:\\u200d(?:"+[_o,Oo,$o].join("|")+")"+ko+So+")*"),To="(?:"+[_o+jo+"?",jo,Oo,$o,bo].join("|")+")",xo=RegExp(wo+"(?="+wo+")|"+To+Po,"g");var Do=vo,Mo=mo,Fo=function(t){for(var e=xo.lastIndex=0;xo.test(t);)++e;return e};var zo=sn,Lo=In,Eo=ln,Ao=ho,Ro=function(t){return Mo(t)?Fo(t):Do(t)};var Yo=function(t){if(null==t)return 0;if(Eo(t))return Ao(t)?Ro(t):t.length;var e=Lo(t);return"[object Map]"==e||"[object Set]"==e?t.size:zo(t).length};var Co=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};function Io(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}var Ho=/\s/;var Uo=function(t){for(var e=t.length;e--&&Ho.test(t.charAt(e)););return e},No=/^\s+/;var qo=function(t){return t?t.slice(0,Uo(t)+1).replace(No,""):t},Wo=qo,Bo=H,Qo=E,Vo=/^[-+]0x[0-9a-f]+$/i,Zo=/^0b[01]+$/i,Go=/^0o[0-7]+$/i,Jo=parseInt;var Ko=function(t){if("number"==typeof t)return t;if(Qo(t))return NaN;if(Bo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Bo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Wo(t);var r=Zo.test(t);return r||Go.test(t)?Jo(t.slice(2),r?2:8):Vo.test(t)?NaN:+t},Xo=Ko,tu=1/0;var eu=function(t){return t?(t=Xo(t))===tu||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0},ru=eu;var nu=function(t){var e=ru(t),r=e%1;return e==e?r?e-r:e:0},iu=nu,ou=Ko,uu=we,au=b.isFinite,su=Math.min;var cu=function(t){var e=Math[t];return function(t,r){if(t=ou(t),(r=null==r?0:su(iu(r),292))&&au(t)){var n=(uu(t)+"e").split("e"),i=e(n[0]+"e"+(+n[1]+r));return+((n=(uu(i)+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round");function fu(t){return!(!function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)||""===t)}function lu(t){let e=!1;return fu(t)?e=!isNaN(Number(t)):function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)&&(e=!0),e}function pu(t){if(!lu(t))return 0;return eu(t)}function hu(t){if(!lu(t))return 0;t=pu(t);let e=cu(t);return"0"===String(e)?0:e}var du=nu;var vu=function(t){return"number"==typeof t&&t==du(t)};function yu(t){return!!lu(t)&&(t=pu(t),vu(t))}function mu(t){if(!yu(t))return!1;return hu(t)>0}function gu(t){return"[object Object]"===Object.prototype.toString.call(t)}function bu(t){if(gu(t)){for(let e in t)return!0;return!1}return!1}function ju(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}var wu=function(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o},_u=wu;var Ou=function(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:_u(t,e,r)};var $u=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1};var Su=$u,ku=function(t){return t!=t},Pu=function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1};var Tu=function(t,e,r){return e==e?Pu(t,e,r):Su(t,ku,r)},xu=Tu;var Du=function(t,e){for(var r=t.length;r--&&xu(e,t[r],0)>-1;);return r},Mu=Tu;var Fu=function(t,e){for(var r=-1,n=t.length;++r<n&&Mu(e,t[r],0)>-1;);return r};var zu=function(t){return t.split("")},Lu="\\ud800-\\udfff",Eu="["+Lu+"]",Au="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ru="\\ud83c[\\udffb-\\udfff]",Yu="[^"+Lu+"]",Cu="(?:\\ud83c[\\udde6-\\uddff]){2}",Iu="[\\ud800-\\udbff][\\udc00-\\udfff]",Hu="(?:"+Au+"|"+Ru+")"+"?",Uu="[\\ufe0e\\ufe0f]?",Nu=Uu+Hu+("(?:\\u200d(?:"+[Yu,Cu,Iu].join("|")+")"+Uu+Hu+")*"),qu="(?:"+[Yu+Au+"?",Au,Cu,Iu,Eu].join("|")+")",Wu=RegExp(Ru+"(?="+Ru+")|"+qu+Nu,"g");var Bu=zu,Qu=mo,Vu=function(t){return t.match(Wu)||[]};var Zu=be,Gu=qo,Ju=Ou,Ku=Du,Xu=Fu,ta=function(t){return Qu(t)?Vu(t):Bu(t)},ea=we;var ra=function(t,e,r){if((t=ea(t))&&(r||void 0===e))return Gu(t);if(!t||!(e=Zu(e)))return t;var n=ta(t),i=ta(e),o=Xu(n,i),u=Ku(n,i)+1;return Ju(n,o,u).join("")};function na(t,e){if(!fu(t))return[];if(!fu(e))return[];let r=function(t,e){return fu(t)&&fu(e)?t.split(e):[]}(t,e);r=eo(r,ra);let n=[];return co(r,(function(t){fu(t)&&n.push(t)})),n}function ia(t){if(!yu(t))return!1;return hu(t)>=0}function oa(t,e){return fu(t)&&ia(e)?0===(e=hu(e))?"":t.substring(0,e):""}var ua=wu,aa=nu;var sa=function(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:aa(e),ua(t,e<0?0:e,n)):[]};function ca(t,e){let r=Io();if(n=t,"[object Array]"!==Object.prototype.toString.call(n)&&!gu(t))return r.reject("rs is not an array or object"),r;var n;let i=!1;if(gu(t)){i=!0;let e=[];co(t,((t,r)=>{e.push({k:r,v:t})})),t=e}ju(e)||(e=function(t){return t});let o=-1,u=[];return t.reduce((function(t,r){return t.then((function(t){u.push(t),o+=1;let n=o,a=r;return i&&(n=r.k,a=r.v),ju(e)?e(a,n):a}))}),Promise.resolve()).then((function(t){u.push(t),u=sa(u),r.resolve(u)})).catch((function(t){r.reject(t)})),r}function fa(t,e){if(!fu(t))return"";if(!ia(e))return"";if(0===(e=hu(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substr(r,e)}function la(t,e){return fu(t)&&ia(e)?0===(e=hu(e))?t:oa(t,t.length-e):""}function pa(t){if(!fu(t))return"";let e=function(t){if(!fu(t))return{path:"",isRoot:!1};for(;t.indexOf("\\\\")>=0;)t=t.replace("\\\\","\\");for(;t.indexOf("//")>=0;)t=t.replace("//","/");if(":"===fa(t,1))return{path:`${t}\\`,isRoot:!0};if("\\"===fa(t,1)){let e=la(t,1);return":"===fa(e,1)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}if("/"===fa(t,1)){let e=la(t,1);return 0===Yo(e)?{path:t,isRoot:!0}:{path:e,isRoot:!1}}return{path:t,isRoot:!1}}(t);if(e.isRoot)return e.path;let r=e.path;try{r=r.split("\\").pop().split("/").pop()}catch(t){}return r}function ha(t){return!!e.existsSync(t)&&(!e.lstatSync(t).isFile()&&!e.lstatSync(t).isSymbolicLink())}function da(t){return!!e.existsSync(t)&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function va(t){if(ha(t))return{success:"input folder is already exists: "+t};if(e.existsSync(t))return{error:"input path already exists: "+t};try{e.mkdirSync(t,{recursive:!0})}catch(t){return{error:t}}return{success:"done: "+t}}var ya={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",o="minute",u="hour",a="day",s="week",c="month",f="quarter",l="year",p="date",h="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|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,y={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(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},m=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},g={s:m,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),i=r%60;return(e<=0?"+":"-")+m(n,2,"0")+":"+m(i,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),i=e.clone().add(n,c),o=r-i<0,u=e.clone().add(n+(o?-1:1),c);return+(-(n+(r-i)/(o?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:l,w:s,d:a,D:p,h:u,m:o,s:i,ms:n,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},b="en",j={};j[b]=y;var w=function(t){return t instanceof S},_=function t(e,r,n){var i;if(!e)return b;if("string"==typeof e){var o=e.toLowerCase();j[o]&&(i=o),r&&(j[o]=r,i=o);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;j[a]=e,i=a}return!n&&i&&(b=i),i||!n&&b},O=function(t,e){if(w(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},$=g;$.l=_,$.i=w,$.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function y(t){this.$L=_(t.locale,null,!0),this.parse(t)}var m=y.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if($.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(d);if(n){var i=n[2]-1||0,o=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return $},m.isValid=function(){return!(this.$d.toString()===h)},m.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,r){return $.u(t)?this[e]:this.set(r,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var r=this,n=!!$.u(e)||e,f=$.p(t),h=function(t,e){var i=$.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?i:i.endOf(a)},d=function(t,e){return $.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},v=this.$W,y=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(f){case l:return n?h(1,0):h(31,11);case c:return n?h(1,y):h(0,y+1);case s:var b=this.$locale().weekStart||0,j=(v<b?v+7:v)-b;return h(n?m-j:m+(6-j),y);case a:case p:return d(g+"Hours",0);case u:return d(g+"Minutes",1);case o:return d(g+"Seconds",2);case i:return d(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var r,s=$.p(t),f="set"+(this.$u?"UTC":""),h=(r={},r[a]=f+"Date",r[p]=f+"Date",r[c]=f+"Month",r[l]=f+"FullYear",r[u]=f+"Hours",r[o]=f+"Minutes",r[i]=f+"Seconds",r[n]=f+"Milliseconds",r)[s],d=s===a?this.$D+(e-this.$W):e;if(s===c||s===l){var v=this.clone().set(p,1);v.$d[h](d),v.init(),this.$d=v.set(p,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](d);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[$.p(t)]()},m.add=function(n,f){var p,h=this;n=Number(n);var d=$.p(f),v=function(t){var e=O(h);return $.w(e.date(e.date()+Math.round(t*n)),h)};if(d===c)return this.set(c,this.$M+n);if(d===l)return this.set(l,this.$y+n);if(d===a)return v(1);if(d===s)return v(7);var y=(p={},p[o]=e,p[u]=r,p[i]=t,p)[d]||1,m=this.$d.getTime()+n*y;return $.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=$.z(this),o=this.$H,u=this.$m,a=this.$M,s=r.weekdays,c=r.months,f=r.meridiem,l=function(t,r,i,o){return t&&(t[r]||t(e,n))||i[r].slice(0,o)},p=function(t){return $.s(o%12||12,t,"0")},d=f||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(v,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return $.s(e.$y,4,"0");case"M":return a+1;case"MM":return $.s(a+1,2,"0");case"MMM":return l(r.monthsShort,a,c,3);case"MMMM":return l(c,a);case"D":return e.$D;case"DD":return $.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(r.weekdaysMin,e.$W,s,2);case"ddd":return l(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(o);case"HH":return $.s(o,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return d(o,u,!0);case"A":return d(o,u,!1);case"m":return String(u);case"mm":return $.s(u,2,"0");case"s":return String(e.$s);case"ss":return $.s(e.$s,2,"0");case"SSS":return $.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,p,h){var d,v=this,y=$.p(p),m=O(n),g=(m.utcOffset()-this.utcOffset())*e,b=this-m,j=function(){return $.m(v,m)};switch(y){case l:d=j()/12;break;case c:d=j();break;case f:d=j()/3;break;case s:d=(b-g)/6048e5;break;case a:d=(b-g)/864e5;break;case u:d=b/r;break;case o:d=b/e;break;case i:d=b/t;break;default:d=b}return h?d:$.a(d)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return j[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=_(t,e,!0);return n&&(r.$L=n),r},m.clone=function(){return $.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},y}(),k=S.prototype;return O.prototype=k,[["$ms",n],["$s",i],["$m",o],["$H",u],["$W",a],["$M",c],["$y",l],["$D",p]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,S,O),t.$i=!0),O},O.locale=_,O.isDayjs=w,O.unix=function(t){return O(1e3*t)},O.en=j[b],O.Ls=j,O.p={},O}()}({get exports(){return ya},set exports(t){ya=t}});var ma=ya;const ga=r.createConnection,ba=n.EventEmitter,ja=i.inherits,wa=o,_a=e,Oa=u,$a=a,Sa=s,ka=c,Pa=f.nfc,Ta=l("jsftp:general"),xa=l("jsftp:command"),Da=l("jsftp:response"),Ma=function(){},Fa={marks:[125,150],ignore:226},za=/([-\d]+,[-\d]+,[-\d]+,[-\d]+),([-\d]+),([-\d]+)/,La=/\r\n|\n/;function Ea(t){let e=Ma,r=t+" ";for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];"function"==typeof i[i.length-1]&&(e=i.pop()),r+=i.join(" "),this.execute(r.trim(),e)}function Aa(t){this.host=t.host||"localhost",this.port=t.port||21,this.user=t.user||"anonymous",this.pass=t.pass||"@anonymous",this.createSocket=t.createSocket,this.useList=t.useList||!1,this.commandQueue=[],ba.call(this),this.on("data",Da),this.on("error",Da),this._createSocket(this.port,this.host)}ja(Aa,ba),Aa.prototype.raw=function(){Ea.apply(this,arguments)},Aa.prototype.reemit=function(t){return e=>{this.emit(t,e),Ta(`event:${t}`,e||{})}},Aa.prototype._createSocket=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ma;this.socket&&this.socket.destroy&&this.socket.destroy(),this.resParser&&this.resParser.end(),this.resParser=new $a,this.authenticated=!1,this.socket=this.createSocket?this.createSocket({port:t,host:e},r):ga(t,e,r),this.socket.on("connect",this.reemit("connect")),this.socket.on("timeout",this.reemit("timeout")),this.pipeline=Oa(this.socket,this.resParser),this.pipeline.on("data",(t=>{this.emit("data",t),Da(t.text),this.parseResponse(t)})),this.pipeline.on("error",this.reemit("error"))},Aa.prototype.parseResponse=function(t){if(0===this.commandQueue.length)return;if([220].indexOf(t.code)>-1)return;const e=this.commandQueue[0].callback;if(t.isMark){if(!e.expectsMark||-1===e.expectsMark.marks.indexOf(t.code))return;e.expectsMark.ignore&&(this.ignoreCmdCode=e.expectsMark.ignore)}this.ignoreCmdCode!==t.code?this.parse(t,this.commandQueue.shift()):this.ignoreCmdCode=null},Aa.prototype.send=function(t){t&&(xa(t),this.pipeline.write(t+"\r\n"),xa(t))},Aa.prototype.nextCmd=function(){const t=this.commandQueue[0];!this.inProgress&&t&&(this.send(t.action),this.inProgress=!0)},Aa.prototype.execute=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ma;if(this.socket&&this.socket.writable)return this.runCommand({action:t,callback:e});this.authenticated=!1,this._createSocket(this.port,this.host,(()=>{this.runCommand({action:t,callback:e})}))},Aa.prototype.runCommand=function(t){if(this.authenticated||/^(feat|syst|user|pass)/.test(t.action))return this.commandQueue.push(t),void this.nextCmd();this.getFeatures((()=>{this.auth(this.user,this.pass,(()=>{this.commandQueue.push(t),this.nextCmd()}))}))},Aa.prototype.parse=function(t,e){let r=null;t.isError&&(r=new Error(t.text||"Unknown FTP error."),r.code=t.code),this.inProgress=!1,e.callback(r,t),this.nextCmd()},Aa.prototype.getPasvPort=function(t){const e=za.exec(t);if(!e)return null;let r=e[1].replace(/,/g,".");return"127.0.0.1"===r&&(r=this.host),{host:r,port:256*(255&parseInt(e[2],10))+(255&parseInt(e[3],10))}},Aa.prototype.hasFeat=function(t){return!!t&&this.features.indexOf(t.toLowerCase())>-1},Aa.prototype._parseFeats=function(t){return t.split(La).slice(1,-1).map((t=>t.trim().toLowerCase())).filter((t=>!!t))},Aa.prototype.getFeatures=function(t){if(this.features)return t(null,this.features);this.raw("feat",((e,r)=>{this.features=e?[]:this._parseFeats(r.text),this.raw("syst",((e,r)=>{e||215!==r.code||(this.system=r.text.toLowerCase()),t(null,this.features)}))}))},Aa.prototype.auth=function(t,e,r){if(!0===this.authenticating)return r(new Error("This client is already authenticating"));"string"!=typeof t&&(t=this.user),"string"!=typeof e&&(e=this.pass),this.authenticating=!0,this.raw("user",t,((n,i)=>{if(n||-1===[230,331,332].indexOf(i.code))return this.authenticating=!1,void r(n);this.raw("pass",e,((n,i)=>{this.authenticating=!1,n?r(n):[230,202].indexOf(i.code)>-1?(this.authenticated=!0,this.user=t,this.pass=e,this.raw("type","I",(()=>{r(void 0,i)}))):332===i.code&&this.raw("acct","")}))}))},Aa.prototype.setType=function(t,e){if(t=t.toUpperCase(),this.type===t)return e();this.raw("type",t,((r,n)=>{r||(this.type=t),e(r,n)}))},Aa.prototype.list=function(t,e){1===arguments.length&&(e=arguments[0],t="");let r="";e=ka(e),this.getPasvSocket(((n,i)=>{if(n)return e(n);function o(t,r){if(t)return e(t);Fa.marks.some((t=>t===r.code))||e(new Error(`Expected marks ${Fa.toString()} instead of: ${r.text}`))}i.setEncoding("utf8"),i.on("data",(t=>{r+=t})),this.pasvTimeout(i,e),i.once("close",(n=>n?e(n):r?void e(null,r):e({code:451,text:`Could not retrieve a file listing for ${t}.`,isMark:!1,isError:!0}))),i.once("error",e),o.expectsMark=Fa,this.execute(`list ${t||""}`,o)}))},Aa.prototype.emitProgress=function(t){this.emit("progress",{filename:t.filename,action:t.action,total:t.totalSize||0,transferred:t.socket["get"===t.action?"bytesRead":"bytesWritten"]})},Aa.prototype.get=function(t,e){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ma;const i=typeof e;"function"===i?r=e:"string"===i&&(n=ka(n),r=(r,i)=>{if(r)return n(r);const o=_a.createWriteStream(e);o.on("error",n),i.on("readable",(()=>{this.emitProgress({filename:t,action:"get",socket:i})})),i.on("error",n),i.on("end",n),i.on("close",n),i.pipe(o)}),this.getGetSocket(t,ka(r))},Aa.prototype.getGetSocket=function(t,e){e=ka(e),this.getPasvSocket(((r,n)=>{if(r)return i(r);function i(t,r){return t?(n&&n.destroy(),e(t)):n?125===r.code||150===r.code?e(null,n):(n.destroy(),e(new Error("Unexpected command "+r.text))):e(new Error("Error when retrieving PASV socket"))}n.on("error",(t=>{"ECONNREFUSED"===t.code&&(t.msg="Probably trying a PASV operation while one is in progress"),i(t)})),this.pasvTimeout(n,i),n.pause(),i.expectsMark=Fa,this.execute("retr "+t,i)}))},Aa.prototype.put=function(t,e,r){const n=(t,e,n)=>{t.on("readable",(()=>{this.emitProgress({filename:e,action:"put",socket:t,totalSize:n})})),this.getPutSocket(t,e,r)};t instanceof Buffer?this.getPutSocket(t,e,((e,n)=>{if(e)return r(new Error(e));let i,o=0,u=1048576,a=!1;i=t.slice(o,o+u),o+=u,r(null,i),n.write(t.slice(0,u)),i.length===t.length&&(n.end(),r(null,[])),n.on("drain",(()=>{t.length>o+u?(i=t.slice(o,o+u),o+=u):(i=t.slice(o),a=!0),r(null,i),n.write(i),a&&(n.end(),r(null,[]))}))})):"string"==typeof t?_a.stat(t,((i,o)=>{if(i&&"ENOENT"===i.code)return r(new Error("Local file doesn't exist."));if(o.isDirectory())return r(new Error("Local path cannot be a directory"));const u=i?0:o.size;n(_a.createReadStream(t),e,u)})):t instanceof wa.Readable?n(t,e,0):r(new Error("Expected `from` parameter to be a Buffer, Stream, or a String"))},Aa.prototype.getPutSocket=function(t,e,r){r=ka(r||Ma),this.getPasvSocket(((n,i)=>{if(n)return i&&i.destroy(),r(n);i.on("close",r),i.on("error",r);const o=ka(((e,n)=>e?(i&&i.destroy(),r(e)):125!==n.code&&150!==n.code?(i&&i.destroy(),r(new Error("Unexpected command "+n.text))):(this.pasvTimeout(i,r),void(t instanceof Buffer?r(null,i):t instanceof wa.Readable&&(r(null,i),t.pipe(i))))));o.expectsMark=Fa,this.execute(`stor ${e}`,o)}))},Aa.prototype.pasvTimeout=function(t,e){t.once("timeout",(()=>{Ta("PASV socket timeout"),this.emit("timeout"),t.end(),e(new Error("Passive socket timeout"))}))},Aa.prototype.getPasvSocket=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ma;t=ka(t),this.execute("pasv",((e,r)=>{if(e)return t(e);const n=this.getPasvPort(r.text);if(!n)return t(new Error("Bad passive host/port combination"));const i=this._pasvSocket=this.createSocket?this.createSocket(n):ga(n);i.setTimeout(this.timeout||6e5),i.once("close",(()=>{this._pasvSocket=void 0})),t(null,i)}))},Aa.prototype.ls=function(t,e){function r(t,r){if(t)return e(t);Sa.parseFtpEntries(r.text||r,((t,r)=>{if(t)return e(t);r.forEach((t=>{t.name=Pa(t.name)})),e(null,r)}))}this.useList?this.list(t,r):this.raw("stat",t,((e,n)=>{const i=e&&(502===e.code||500===e.code),o=this.system&&this.system.indexOf("hummingbird")>-1;i||o?(this.useList=!0,this.list(t,r)):r(e,n)}))},Aa.prototype.rename=function(t,e,r){this.raw("rnfr",t,(t=>{if(t)return r(t);this.raw("rnto",e,r)}))},Aa.prototype.keepAlive=function(t){this._keepAliveInterval&&clearInterval(this._keepAliveInterval),this._keepAliveInterval=setInterval(this.raw.bind(this,"noop"),t||3e4)},Aa.prototype.destroy=function(){this._keepAliveInterval&&clearInterval(this._keepAliveInterval),this.socket&&this.socket.writable&&this.socket.end(),this._pasvSocket&&this._pasvSocket.writable&&this._pasvSocket.end(),this.resParser.end(),this.socket=void 0,this._pasvSocket=void 0,this.features=null,this.authenticated=!1};var Ra=Aa,Ya=wu,Ca=nu;var Ia=function(t,e,r){var n=null==t?0:t.length;return n?(e=r||void 0===e?1:Ca(e),Ya(t,0,(e=n-e)<0?0:e)):[]};function Ha(t,e){return fu(t)&&ia(e)?0===(e=hu(e))?t:fa(t,t.length-e):""}function Ua(t){"."===oa(t,1)&&(t=Ha(t,1));let e=na(t,"/");e=Ia(e);let r=[],n=".";return co(e,(t=>{n+="/"+t,r.push(n)})),r}var Na=qi,qa=ln,Wa=vn;var Ba=function(t){return function(e,r,n){var i=Object(e);if(!qa(e)){var o=Na(r);e=Wa(e),r=function(t){return o(i[t],t,i)}}var u=t(e,r,n);return u>-1?i[o?e[u]:u]:void 0}},Qa=$u,Va=qi,Za=nu,Ga=Math.max;var Ja=Ba((function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:Za(r);return i<0&&(i=Ga(n+i,0)),Qa(t,Va(e),i)})),Ka=M,Xa=F;var ts=function(t){return!0===t||!1===t||Xa(t)&&"[object Boolean]"==Ka(t)};function es(t){return ts(t)}var rs=Vi;var ns=vr,is=function(t,e){var r=[];return rs(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r},os=qi,us=v;var as=function(t,e){return(us(t)?ns:is)(t,os(e))},ss=Array.prototype.join;var cs=function(t,e){return null==t?"":ss.call(t,e)};function fs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ls(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?fs(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}async function ps(r,n){let i=ze(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},"ftpLs");if(!ju(i))return Promise.reject("opt.ftpLs is not a function");if(!ha(n))return Promise.reject(`fdLocal[${n}] is not a folder`);n=t.resolve(n);let o=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=1;return function r(o){let u=[],a=e.readdirSync(o);return co(a,(function(a){let s=t.resolve(o,a),c=null;try{c=e.statSync(s)}catch(t){}c&&c.isDirectory()?(u.push({isFolder:!0,level:i,path:s,name:t.basename(s)}),i+=1,(i<=n||null===n)&&(u=u.concat(r(s))),i-=1):u.push({isFolder:!1,level:i,path:s,name:t.basename(s)})})),u}(r)}(n,null);o=as(o,(t=>!t.isFolder)),o=eo(o,(i=>{let o=e.statSync(i.path);return i.size=ze(o,"size",0),i.rpath=(e=>{let i=(e=t.resolve(e)).replace(n,""),o=new RegExp("\\\\","g");i=String(i).replace(o,"/");let u=r;return"."===oa(r,1)&&(u=Ha(r,1)),i=[...na(u,"/"),...na(i,"/")],i=cs(i,"/"),i=`./${i}`,i})(i.path),i}));let u=await function(t,e){let r=1,n=ze(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},"levelLimit");mu(n)||(n=null);let i=async t=>{let o=[],u=await e(t);return await ca(u,(async e=>{let u=`${t}/${e.name}`;if(e.isFolder){if(o.push(ls(ls({},e),{},{isFolder:!0,level:r,rpath:u,name:pa(u)})),r+=1,r<=n||null===n){let t=await i(u);o=o.concat(t)}r-=1}else o.push(ls(ls({},e),{},{isFolder:!1,level:r,rpath:u,name:pa(u)}))})),o};return i(t)}(r,i);return u=as(u,(t=>!t.isFolder)),u=eo(u,(e=>{var i;return e.lpath=(i=e.rpath,"."!==r&&(i=i.replace(r,"")),"."===oa(i,1)&&(i=Ha(i,1)),"/"===oa(i,1)&&(i=Ha(i,1)),t.resolve(n,i)),e})),{fsRemote:u,fsLocal:o}}async function hs(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=ze(n,"forceOverwriteWhenSync");es(i)||(i=!1);let o=ze(n,"ftpLs");if(!ju(o))return Promise.reject("opt.ftpLs is not a function");let u=ze(n,"ftpDownload");if(!ju(u))return Promise.reject("opt.ftpDownload is not a function");ha(e)||va(e);let a=await ps(t,e,{ftpLs:o}),s=a.fsRemote,c=a.fsLocal,f=0,l=[];return await ca(s,(async t=>{let e=ze(t,"lpath",""),n=Ja(c,{path:e}),o=ze(t,"rpath",""),a=ze(t,"lpath",""),s=t=>{ju(r)&&r(t)};bu(n)?(i||t.size!==n.size)&&(await u(o,a,s),f++,l.push({path:t.rpath,reason:`size[${n.size}] of local file != size[${t.size}] of remote file`})):(await u(o,a,s),f++,l.push({path:t.rpath,reason:"no local file"}))})),{num:f,files:l}}async function ds(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=ze(n,"forceOverwriteWhenSync");es(i)||(i=!1);let o=ze(n,"ftpLs");if(!ju(o))return Promise.reject("opt.ftpLs is not a function");let u=ze(n,"ftpUpload");if(!ju(u))return Promise.reject("opt.ftpUpload is not a function");let a=await ps(e,t,{ftpLs:o}),s=a.fsRemote,c=a.fsLocal,f=0,l=[];return await ca(c,(async t=>{let e=ze(t,"rpath",""),n=Ja(s,{rpath:e}),o=ze(t,"rpath",""),a=ze(t,"path",""),c=t=>{ju(r)&&r(t)};bu(n)?(i||t.size!==n.size)&&(await u(a,o,c),f++,l.push({name:t.rpath,reason:`size[${n.size}] of remote file != size[${t.size}] of local file`})):(await u(a,o,c),f++,l.push({name:t.rpath,reason:"no Remote file"}))})),{num:f,files:l}}function vs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ys(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vs(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ms(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,i=ze(r,"hostname");if(!fu(i))throw new Error(`hostname[${i}] is not an effective string`);let o=ze(r,"port");mu(o)||(o=21),o=hu(o);let u=ze(r,"username");if(!fu(u))throw new Error(`username[${u}] is not an effective string`);let a=ze(r,"password");if(!fu(a))throw new Error(`password[${a}] is not an effective string`);let s=ze(r,"timeLimit");function c(t){let e="";if(!lu(t)&&!fu(t))return e;try{let r=ma(t),n=r.format("YYYY-MM-DDTHH:mm:ss");n=`${n}+00:00`,r=ma(n),e=r.format("YYYY-MM-DDTHH:mm:ssZ")}catch(t){}return e}async function f(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".",e=Io();if(null===n)return e.reject("FTP has not been initialized. please use 'conn' to construct FTP"),e;let r=setTimeout((()=>{e.reject(`ftpLs timeout[${s}]`)}),s);return n.ls(t,((t,n)=>{clearTimeout(r),t?e.reject(t):(n=eo(n,(t=>(t.mtime=c(t.time),t.size=hu(t.size),t.isFolder=v(t),t))),e.resolve(n))})),e}async function l(t,e){let r=Io();if(null===n)return r.reject("FTP has not been initialized. please use 'conn' to construct FTP"),r;let i=setTimeout((()=>{r.reject(`ftpRaw[${t}] timeout[${s}]`)}),s);return n.raw(t,e,((t,e)=>{clearTimeout(i),t?r.reject(t):r.resolve(e)})),r}async function p(t){let e=Ua(t);return Yo(e)>=1&&await ca(e,(async t=>{await y(t)||await async function(t){return l("mkd",t)}(t)})),"ok"}async function h(t){return l("cwd",t)}async function d(t){if(null===n)return Promise.reject("FTP has not been initialized. please use 'conn' to construct FTP");let e={},r=null;if(await async function(t){return l("mlst",t)}(t).then((t=>{r=t})).catch((t=>{r={err:t.toString()}})),!bu(r))return Promise.reject("invalid result from ftpMlst");{let t=ze(r,"text",""),n=t.indexOf("type=dir;")>=0,i=t.indexOf("type=file;")>=0,o=(t=>{let e=na(t,";"),r="";return co(e,(t=>{if("modify="===oa(t,7)){let e=na(t,"=");r=ze(e,1,"")}})),r})(t),u=c(o);e=ys(ys({},e),{},{rmlst:r,mtime:u,isFolder:n,isFile:i})}let i=null;if(await async function(t){return l("size",t)}(t).then((t=>{i=t})).catch((t=>{i={err:t.toString()}})),!bu(i))return Promise.reject("invalid result from ftpSize");{let t=ze(i,"code",""),r=ze(i,"text","").replace(`${t} `,"");r=hu(r),e=ys(ys({},e),{},{rsize:i,size:r})}return e}function v(t){if(!bu(t))return!1;let e;return e=ze(t,"isFolder",!1),e||(e=1===ze(t,"type",-1),e||e)}async function y(t){return v(await d(t))}function m(t){if(!bu(t))return!1;let e;return e=ze(t,"isFile",!1),e||(e=0===ze(t,"type",-1),e||e)}async function g(r,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=Io();if(null===n)return u.reject("FTP has not been initialized. please use 'conn' to construct FTP"),u;if(!fu(r))return u.reject(`fpRemote[${r}] is not an effective string`),u;if(!fu(i))return u.reject(`fpLocal[${i}] is not an effective string`),u;let a=t.dirname(i);da(i)&&e.unlinkSync(i),ha(a)||va(a);let c=await d(r);if(!m(c))return u.reject(`fpRemote[${r}] is not a file`),u;if(!bu(c)||(l="err",gu(f=c)&&(fu(l)||lu(l))&&l in f))return u.reject(`fpRemote[${r}] does not have information`),u;var f,l;let p=ze(c,"size","");if(!lu(p))return u.reject(`can not get the size of file[${r}]`),u;p=hu(p);let h=setTimeout((()=>{u.reject(`ftpDownload timeout[${s}]`)}),s);return n.get(r,((t,n)=>{if(t)return clearTimeout(h),void u.reject(t);let a=e.createWriteStream(i),s=0;n.on("data",(t=>{if(ju(o)){let e=Yo(t);s+=e,o({progress:s/p*100,name:pa(i),fpRemote:r,fpLocal:i})}a.write(t)})),n.on("close",(()=>{a.end()})),a.on("finish",(()=>{clearTimeout(h),t?u.reject(t):u.resolve("ok")})),a.on("error",(t=>{console.log("writer error",t)})),n.resume()})),u}async function b(t,r,i){let o=null;if(null===n)return Promise.reject("FTP has not been initialized. please use 'conn' to construct FTP");if(!fu(r))return Promise.reject(`fpRemote[${r}] is not an effective string`);let u=Ua(r),a=r;if(Yo(u)>=1){await p(r);let t=Co(u);await h(t),a="."+r.replace(t,"")}let c=await async function(t,r,i){let o=Io();if(null===n)return o.reject("FTP has not been initialized. please use 'conn' to construct FTP"),o;if(!fu(r))return o.reject(`fpRemote[${r}] is not an effective string`),o;if(!fu(t))return o.reject(`fpLocal[${t}] is not an effective string`),o;if(!da(t))return o.reject(`fpLocal[${t}] is not a file`),o;let u=e.statSync(t),a=ze(u,"size",0);if(!lu(a))return o.reject(`can not get the size of file[${t}]`),o;a=hu(a);let c=e.readFileSync(t),f=setTimeout((()=>{o.reject(`ftpUploadCore timeout[${s}]`)}),s),l=0;return n.put(c,r,((e,n)=>{if(e)return clearTimeout(f),void o.reject(e);if(0===Yo(n))return clearTimeout(f),void o.resolve("ok");if(ju(i)){let e=Yo(n);l+=e,i({progress:l/a*100,name:pa(t),fpRemote:r,fpLocal:t})}})),o}(t,a,i).catch((t=>{o=t}));return Yo(u)>=1&&await h("/"),null!==o?Promise.reject(o):c}return lu(s)||(s=6e4),s=hu(s),{conn:async function(){let t=Io();try{n=new Ra({host:i,port:o,user:u,pass:a}),t.resolve("ok")}catch(e){t.reject(e)}return t},quit:async function(){let t=Io();if(null===n)return t.reject("FTP has not been initialized. please use 'conn' to construct FTP"),t;let e=setTimeout((()=>{n.destroy(),n=null,t.reject(`ftpQuit timeout[${s}]`)}),s);return n.raw("quit",((r,i)=>{clearTimeout(e),n.destroy(),n=null,r?t.reject(r):t.resolve(i)})),t},ls:f,isFile:async function(t){return m(await d(t))},isFolder:y,download:g,upload:b,syncToLocal:async function(t,e,r){return hs(t,e,r,ys(ys({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},{ftpLs:f,ftpDownload:g}))},syncToRemote:async function(t,e,r){return ds(t,e,r,ys(ys({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},{ftpLs:f,ftpUpload:b}))},stat:d,mkdir:p,cwd:h,pwd:async function(){return l("pwd")}}}function gs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function bs(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gs(Object(r),!0).forEach((function(e){Ae(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gs(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function js(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,i=ze(r,"hostname");if(!fu(i))throw new Error(`hostname[${i}] is not an effective string`);let o=ze(r,"port");mu(o)||(o=22),o=hu(o);let u=ze(r,"username");if(!fu(u))throw new Error(`username[${u}] is not an effective string`);let a=ze(r,"password");if(!fu(a))throw new Error(`password[${a}] is not an effective string`);let s=ze(r,"timeLimit");async function c(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".",e=null,r=Io();if(null===n)return r.reject("FTP has not been initialized. please use 'conn' to construct FTP"),r;let i=setTimeout((()=>{r.reject(`ftpLs timeout[${s}]`)}),s),o=await n.list(t).catch((t=>{e=t}));return clearTimeout(i),null!==e?(r.reject(e),r):(o=eo(o,(t=>{let e;return e=ma(t.accessTime),t.atime=e.format("YYYY-MM-DDTHH:mm:ssZ"),e=ma(t.modifyTime),t.mtime=e.format("YYYY-MM-DDTHH:mm:ssZ"),t.isFolder=h(t),t})),r.resolve(o),r)}async function f(t){let e=Ua(t);if(Yo(e)>=1){let t=Co(e);await async function(t){return n.mkdir(t,!0)}(t)}return"ok"}async function l(t){let e=null;return await n.stat(t).then((r=>{let n;n=ma(r.accessTime);let i=n.format("YYYY-MM-DDTHH:mm:ssZ");n=ma(r.modifyTime);let o=n.format("YYYY-MM-DDTHH:mm:ssZ");e=bs(bs({},r),{},{atime:i,mtime:o,name:t})})).catch((t=>{e={err:t.toString()}})),e}function h(t){if(!bu(t))return!1;let e;return e=!0===ze(t,"isDirectory",null),e||(e="d"===ze(t,"type",""),e||!1)}function d(t){if(!bu(t))return!1;let e;return e=!0===ze(t,"isFile",null),e||(e="-"===ze(t,"type",""),e||e)}async function v(r,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=Io();if(null===n)return u.reject("FTP has not been initialized. please use 'conn' to construct FTP"),u;if(!fu(r))return u.reject(`fpRemote[${r}] is not an effective string`),u;if(!fu(i))return u.reject(`fpLocal[${i}] is not an effective string`),u;let a=t.dirname(i);ha(a)||va(a);let c=await l(r);if(!d(c))return u.reject(`fpRemote[${r}] is not a file`),u;if(!bu(c))return u.reject(`fpRemote[${r}] does not have information`),u;let f=ze(c,"size","");if(!lu(f))return u.reject(`can not get the size of file[${r}]`),u;f=hu(f),da(i)&&e.unlinkSync(i);let p=setTimeout((()=>{u.reject(`ftpDownload timeout[${s}]`)}),s);return n.fastGet(r,i,{step:(t,e,n)=>{if(ju(o)){o({progress:t/n*100,name:pa(i),fpRemote:r,fpLocal:i})}}}).then((()=>{u.resolve("ok")})).catch((t=>{u.reject(t)})).finally((()=>{clearTimeout(p)})),clearTimeout(p),u}async function y(t,r,i){let o=Io();if(null===n)return o.reject("FTP has not been initialized. please use 'conn' to construct FTP"),o;if(!fu(r))return o.reject(`fpRemote[${r}] is not an effective string`),o;if(!fu(t))return o.reject(`fpLocal[${t}] is not an effective string`),o;if(!da(t))return o.reject(`fpLocal[${t}] is not a file`),o;await f(r);let u=e.statSync(t),a=ze(u,"size",0);if(!lu(a))return o.reject(`can not get the size of file[${t}]`),o;a=hu(a);let c=setTimeout((()=>{o.reject(`ftpUploadCore timeout[${s}]`)}),s);return n.fastPut(t,r,{step:(e,n,o)=>{if(ju(i)){i({progress:e/o*100,name:pa(t),fpRemote:r,fpLocal:t})}}}).then((()=>{o.resolve("ok")})).catch((t=>{o.reject(t)})).finally((()=>{clearTimeout(c)})),clearTimeout(c),o}return lu(s)||(s=6e4),s=hu(s),{conn:async function(){return n=new p,await n.connect({host:i,port:o,username:u,password:a}),"ok"},quit:async function(){let t=Io();if(null===n)return t.reject("FTP has not been initialized. please use 'conn' to construct FTP"),t;let e=setTimeout((()=>{n.end(),n=null,t.reject(`ftpQuit timeout[${s}]`)}),s);try{n.end(),n=null,clearTimeout(e),t.resolve("ok")}catch(e){t.reject(e)}return t},ls:c,isFile:async function(t){return d(await l(t))},isFolder:async function(t){return h(await l(t))},download:v,upload:y,syncToLocal:async(t,e,r)=>hs(t,e,r,{ftpLs:c,ftpDownload:v}),syncToRemote:async(t,e,r)=>ds(t,e,r,{ftpLs:c,ftpUpload:y}),stat:l,mkdir:f,cwd:async function(t){return n.cwd(t)},pwd:async function(){return n.pwd()}}}async function ws(){return null}async function _s(){return null}async function Os(){return null}async function $s(t){return null}async function Ss(t){return null}async function ks(t,e){return null}async function Ps(t,e,r){return null}async function Ts(t,e,r){return null}async function xs(t,e,r){return null}async function Ds(t){return null}async function Ms(t){return null}async function Fs(t){return null}async function zs(t){return null}return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=ze(t,"transportation","FTP");if("FTP"!==e&&"SFTP"!==e)throw new Error(`transportation[${e}] is not FTP or SFTP`);let r=null;"FTP"===e?r=new ms(t):"SFTP"===e&&(r=new js(t));let n={doc_conn:ws,doc_quit:_s,doc_ls:Os,doc_isFile:$s,doc_isFolder:Ss,doc_download:ks,doc_upload:Ps,doc_syncToLocal:Ts,doc_syncToRemote:xs,doc_stat:Ds,doc_mkdir:Ms,doc_cwd:Fs,doc_pwd:zs};return r.__doc___=n,r}}));
7
7
  //# sourceMappingURL=w-ftp.umd.js.map