w-web-sso 1.1.12 → 1.1.13
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 +16 -0
- package/dist/css/{app.b17b0ba0.css → app.f000459f.css} +1 -1
- package/dist/index.tmp +1 -1
- package/dist/js/{app-legacy.bee6840f.js → app-legacy.7c006893.js} +1 -1
- package/dist/js/{app.bee6840f.js → app.7c006893.js} +1 -1
- package/dist/js/{chunk-vendors.0492b6f5.js → chunk-vendors-legacy.97013ddc.js} +5 -5
- package/dist/js/{chunk-vendors-legacy.0492b6f5.js → chunk-vendors.97013ddc.js} +5 -5
- package/dist/w-web-sso.umd.js +4 -4
- package/dist/w-web-sso.umd.js.map +1 -1
- package/docs/WWebSso.html +1 -1
- package/docs/global.html +1 -1
- package/docs/index.html +1 -1
- package/docs/server_WWebSso.mjs.html +16 -10
- package/docs/server_getIgnoredOrmKeys.mjs.html +1 -1
- package/docs/server_lockSave.mjs.html +1 -1
- package/docs/server_ormWrite.mjs.html +1 -1
- package/docs/server_staLogs_resolveShellWorker.mjs.html +1 -1
- package/docs/server_wrapTimer.mjs.html +1 -1
- package/docs/src_components_Common_CheckYesNo.vue.html +1 -1
- package/docs/src_fetchSsoMsg.mjs.html +1 -1
- package/docs/src_httpGetJson.mjs.html +1 -1
- package/docs/src_maskUrl.mjs.html +1 -1
- package/docs/src_plugins_staUsage.mjs.html +1 -1
- package/docs/src_plugins_submitGuard.mjs.html +1 -1
- package/package.json +2 -2
- package/server/WWebSso.mjs +15 -9
- package/server/procCore.mjs +791 -379
- package/server/procLang.mjs +18 -0
- package/server/procProtect.mjs +150 -88
- package/src/baselineOf.mjs +76 -0
- package/src/components/LayoutContentIps.vue +24 -2
- package/src/components/LayoutContentTokens.vue +24 -2
- package/src/components/LayoutContentUsers.vue +9 -3
- package/src/schema/tables/ips.mjs +4 -0
- package/src/schema/tables/tokens.mjs +4 -0
- package/src/writeContracts/index.mjs +9 -0
- package/src/writeContracts/ips.mjs +9 -0
- package/src/writeContracts/tokens.mjs +12 -0
- package/src/writeContracts/tokensSession.mjs +10 -0
- package/src/writeContracts/users.mjs +15 -0
package/dist/w-web-sso.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* w-web-sso v1.1.
|
|
2
|
+
* w-web-sso v1.1.13
|
|
3
3
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("path"),require("fs"),require("@hapi/hapi"),require("@hapi/inert"),require("stream"),require("http"),require("worker_threads"),require("util"),require("url"),require("pino"),require("module"),require("node:events"),require("node:net"),require("node:url"),require("node:util"),require("node:fs"),require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:dns"),require("node:os"),require("node:path"),require("node:crypto"),require("node:tls"),require("node:child_process"),require("crypto"),require("net"),require("readline")):"function"==typeof define&&define.amd?define(["path","fs","@hapi/hapi","@hapi/inert","stream","http","worker_threads","util","url","pino","module","node:events","node:net","node:url","node:util","node:fs","node:http","node:https","node:zlib","node:stream","node:dns","node:os","node:path","node:crypto","node:tls","node:child_process","crypto","net","readline"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-web-sso"]=t(e.path,e.fs,e["@hapi/hapi"],e["@hapi/inert"],e.stream,e.http,e.require$$0$1,e.util$2,e.url,e.pino,e.module$1,e.require$$0$6,e.require$$0$2,e.require$$1,e.require$$1$2,e.require$$2,e.require$$0$3,e.require$$1$1,e.require$$3,e.require$$0$4,e.require$$6,e.require$$8,e.require$$0$5,e.require$$2$1,e.require$$1$3,e.require$$0$7,e.crypto$1,e.net,e.readline)}(this,function(e,t,i,n,r,s,o,a,c,l,u,p,d,m,h,f,g,w,y,M,D,x,I,C,b,v,L,E,A){"use strict";var N="undefined"!=typeof document?document.currentScript:null,S=Array.isArray,T="object"==typeof global&&global&&global.Object===Object&&global,k="object"==typeof self&&self&&self.Object===Object&&self,j=T||k||Function("return this")(),Z=j.Symbol,z=Object.prototype,Y=z.hasOwnProperty,X=z.toString,G=Z?Z.toStringTag:void 0;var F=Object.prototype.toString;var W=Z?Z.toStringTag:void 0;function O(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":W&&W in Object(e)?function(e){var t=Y.call(e,G),i=e[G];try{e[G]=void 0;var n=!0}catch(e){}var r=X.call(e);return n&&(t?e[G]=i:delete e[G]),r}(e):function(e){return F.call(e)}(e)}function P(e){return null!=e&&"object"==typeof e}function K(e){return"symbol"==typeof e||P(e)&&"[object Symbol]"==O(e)}var H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U=/^\w*$/;function B(e,t){if(S(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!K(e))||(U.test(e)||!H.test(e)||null!=t&&e in Object(t))}function V(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function _(e){if(!V(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var R,Q=j["__core-js_shared__"],J=(R=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";var q=Function.prototype.toString;function $(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ee=/^\[object .+?Constructor\]$/,te=Function.prototype,ie=Object.prototype,ne=te.toString,re=ie.hasOwnProperty,se=RegExp("^"+ne.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){return!(!V(e)||(t=e,J&&J in t))&&(_(e)?se:ee).test($(e));var t}function ae(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(i)?i:void 0}var ce=ae(Object,"create");var le=Object.prototype.hasOwnProperty;var ue=Object.prototype.hasOwnProperty;function pe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function de(e,t){return e===t||e!=e&&t!=t}function me(e,t){for(var i=e.length;i--;)if(de(e[i][0],t))return i;return-1}pe.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},pe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pe.prototype.get=function(e){var t=this.__data__;if(ce){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return le.call(t,e)?t[e]:void 0},pe.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:ue.call(t,e)},pe.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=ce&&void 0===t?"__lodash_hash_undefined__":t,this};var he=Array.prototype.splice;function fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.__data__=[],this.size=0},fe.prototype.delete=function(e){var t=this.__data__,i=me(t,e);return!(i<0)&&(i==t.length-1?t.pop():he.call(t,i,1),--this.size,!0)},fe.prototype.get=function(e){var t=this.__data__,i=me(t,e);return i<0?void 0:t[i][1]},fe.prototype.has=function(e){return me(this.__data__,e)>-1},fe.prototype.set=function(e,t){var i=this.__data__,n=me(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var ge=ae(j,"Map");function we(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function ye(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ye.prototype.clear=function(){this.size=0,this.__data__={hash:new pe,map:new(ge||fe),string:new pe}},ye.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return we(this,e).get(e)},ye.prototype.has=function(e){return we(this,e).has(e)},ye.prototype.set=function(e,t){var i=we(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function Me(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(Me.Cache||ye),i}Me.Cache=ye;var De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xe=/\\(\\)?/g,Ie=function(e){var t=Me(e,function(e){return 500===i.size&&i.clear(),e}),i=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(De,function(e,i,n,r){t.push(n?r.replace(xe,"$1"):i||e)}),t}),Ce=Ie;function be(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}var ve=Z?Z.prototype:void 0,Le=ve?ve.toString:void 0;function Ee(e){if("string"==typeof e)return e;if(S(e))return be(e,Ee)+"";if(K(e))return Le?Le.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ae(e){return null==e?"":Ee(e)}function Ne(e,t){return S(e)?e:B(e,t)?[e]:Ce(Ae(e))}function Se(e){if("string"==typeof e||K(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Te(e,t){for(var i=0,n=(t=Ne(t,e)).length;null!=e&&i<n;)e=e[Se(t[i++])];return i&&i==n?e:void 0}function ke(e,t,i){var n=null==e?void 0:Te(e,t);return void 0===n?i:n}var je=Object.prototype;function Ze(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||je)}function ze(e,t){return function(i){return e(t(i))}}var Ye=ze(Object.keys,Object),Xe=Object.prototype.hasOwnProperty;function Ge(e){if(!Ze(e))return Ye(e);var t=[];for(var i in Object(e))Xe.call(e,i)&&"constructor"!=i&&t.push(i);return t}var Fe=ae(j,"DataView"),We=ae(j,"Promise"),Oe=ae(j,"Set"),Pe=ae(j,"WeakMap"),Ke="[object Map]",He="[object Promise]",Ue="[object Set]",Be="[object WeakMap]",Ve="[object DataView]",_e=$(Fe),Re=$(ge),Qe=$(We),Je=$(Oe),qe=$(Pe),$e=O;(Fe&&$e(new Fe(new ArrayBuffer(1)))!=Ve||ge&&$e(new ge)!=Ke||We&&$e(We.resolve())!=He||Oe&&$e(new Oe)!=Ue||Pe&&$e(new Pe)!=Be)&&($e=function(e){var t=O(e),i="[object Object]"==t?e.constructor:void 0,n=i?$(i):"";if(n)switch(n){case _e:return Ve;case Re:return Ke;case Qe:return He;case Je:return Ue;case qe:return Be}return t});var et=$e;function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function it(e){return null!=e&&tt(e.length)&&!_(e)}function nt(e){return function(t){return null==t?void 0:t[e]}}var rt=nt("length"),st=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function ot(e){return st.test(e)}var at="\\ud800-\\udfff",ct="["+at+"]",lt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ut="\\ud83c[\\udffb-\\udfff]",pt="[^"+at+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",ht="(?:"+lt+"|"+ut+")"+"?",ft="[\\ufe0e\\ufe0f]?",gt=ft+ht+("(?:\\u200d(?:"+[pt,dt,mt].join("|")+")"+ft+ht+")*"),wt="(?:"+[pt+lt+"?",lt,dt,mt,ct].join("|")+")",yt=RegExp(ut+"(?="+ut+")|"+wt+gt,"g");function Mt(e){return ot(e)?function(e){for(var t=yt.lastIndex=0;yt.test(e);)++t;return t}(e):rt(e)}function Dt(e){if(null==e)return 0;if(it(e))return"string"==typeof(t=e)||!S(t)&&P(t)&&"[object String]"==O(t)?Mt(e):e.length;var t,i=et(e);return"[object Map]"==i||"[object Set]"==i?e.size:Ge(e).length}function xt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(!t(e[i],i,e))return!1;return!0}var It,Ct=function(e,t,i){for(var n=-1,r=Object(e),s=i(e),o=s.length;o--;){var a=s[It?o:++n];if(!1===t(r[a],a,r))break}return e};function bt(e){return P(e)&&"[object Arguments]"==O(e)}var vt=Object.prototype,Lt=vt.hasOwnProperty,Et=vt.propertyIsEnumerable,At=bt(function(){return arguments}())?bt:function(e){return P(e)&&Lt.call(e,"callee")&&!Et.call(e,"callee")},Nt=At;var St="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tt=St&&"object"==typeof module&&module&&!module.nodeType&&module,kt=Tt&&Tt.exports===St?j.Buffer:void 0,jt=(kt?kt.isBuffer:void 0)||function(){return!1},Zt=/^(?:0|[1-9]\d*)$/;function zt(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Zt.test(e))&&e>-1&&e%1==0&&e<t}var Yt={};function Xt(e){return function(t){return e(t)}}Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;var Gt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ft=Gt&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Ft&&Ft.exports===Gt&&T.process,Ot=function(){try{var e=Ft&&Ft.require&&Ft.require("util").types;return e||Wt&&Wt.binding&&Wt.binding("util")}catch(e){}}(),Pt=Ot&&Ot.isTypedArray,Kt=Pt?Xt(Pt):function(e){return P(e)&&tt(e.length)&&!!Yt[O(e)]},Ht=Object.prototype.hasOwnProperty;function Ut(e,t){var i=S(e),n=!i&&Nt(e),r=!i&&!n&&jt(e),s=!i&&!n&&!r&&Kt(e),o=i||n||r||s,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Ht.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||zt(l,c))||a.push(l);return a}function Bt(e){return it(e)?Ut(e):Ge(e)}function Vt(e,t){return e&&Ct(e,t,Bt)}var _t=function(e,t){return function(i,n){if(null==i)return i;if(!it(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s<r)&&!1!==n(o[s],s,o););return i}}(Vt),Rt=_t;function Qt(e,t){var i=!0;return Rt(e,function(e,n,r){return i=!!t(e,n,r)}),i}function Jt(e){var t=this.__data__=new fe(e);this.size=t.size}Jt.prototype.clear=function(){this.__data__=new fe,this.size=0},Jt.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Jt.prototype.get=function(e){return this.__data__.get(e)},Jt.prototype.has=function(e){return this.__data__.has(e)},Jt.prototype.set=function(e,t){var i=this.__data__;if(i instanceof fe){var n=i.__data__;if(!ge||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ye(n)}return i.set(e,t),this.size=i.size,this};function qt(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new ye;++t<i;)this.add(e[t])}function $t(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function ei(e,t){return e.has(t)}qt.prototype.add=qt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},qt.prototype.has=function(e){return this.__data__.has(e)};function ti(e,t,i,n,r,s){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var p=-1,d=!0,m=2&i?new qt:void 0;for(s.set(e,t),s.set(t,e);++p<a;){var h=e[p],f=t[p];if(n)var g=o?n(f,h,p,t,e,s):n(h,f,p,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(m){if(!$t(t,function(e,t){if(!ei(m,t)&&(h===e||r(h,e,i,n,s)))return m.push(t)})){d=!1;break}}else if(h!==f&&!r(h,f,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}var ii=j.Uint8Array;function ni(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function ri(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var si=Z?Z.prototype:void 0,oi=si?si.valueOf:void 0;function ai(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}function ci(e,t,i){var n=t(e);return S(e)?n:ai(n,i(e))}function li(e,t){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var o=e[i];t(o,i,e)&&(s[r++]=o)}return s}function ui(){return[]}var pi=Object.prototype.propertyIsEnumerable,di=Object.getOwnPropertySymbols,mi=di?function(e){return null==e?[]:(e=Object(e),li(di(e),function(t){return pi.call(e,t)}))}:ui;function hi(e){return ci(e,Bt,mi)}var fi=Object.prototype.hasOwnProperty;var gi="[object Arguments]",wi="[object Array]",yi="[object Object]",Mi=Object.prototype.hasOwnProperty;function Di(e,t,i,n,r,s){var o=S(e),a=S(t),c=o?wi:et(e),l=a?wi:et(t),u=(c=c==gi?yi:c)==yi,p=(l=l==gi?yi:l)==yi,d=c==l;if(d&&jt(e)){if(!jt(t))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new Jt),o||Kt(e)?ti(e,t,i,n,r,s):function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new ii(e),new ii(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ni;case"[object Set]":var c=1&n;if(a||(a=ri),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=ti(a(e),a(t),n,r,s,o);return o.delete(e),u;case"[object Symbol]":if(oi)return oi.call(e)==oi.call(t)}return!1}(e,t,c,i,n,r,s);if(!(1&i)){var m=u&&Mi.call(e,"__wrapped__"),h=p&&Mi.call(t,"__wrapped__");if(m||h){var f=m?e.value():e,g=h?t.value():t;return s||(s=new Jt),r(f,g,i,n,s)}}return!!d&&(s||(s=new Jt),function(e,t,i,n,r,s){var o=1&i,a=hi(e),c=a.length;if(c!=hi(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:fi.call(t,u)))return!1}var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var m=!0;s.set(e,t),s.set(t,e);for(var h=o;++l<c;){var f=e[u=a[l]],g=t[u];if(n)var w=o?n(g,f,u,t,e,s):n(f,g,u,e,t,s);if(!(void 0===w?f===g||r(f,g,i,n,s):w)){m=!1;break}h||(h="constructor"==u)}if(m&&!h){var y=e.constructor,M=t.constructor;y==M||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof M&&M instanceof M||(m=!1)}return s.delete(e),s.delete(t),m}(e,t,i,n,r,s))}function xi(e,t,i,n,r){return e===t||(null==e||null==t||!P(e)&&!P(t)?e!=e&&t!=t:Di(e,t,i,n,xi,r))}function Ii(e){return e==e&&!V(e)}function Ci(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function bi(e){var t=function(e){for(var t=Bt(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,Ii(r)]}return t}(e);return 1==t.length&&t[0][2]?Ci(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,s=r,o=!n;if(null==e)return!s;for(e=Object(e);r--;){var a=i[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<s;){var c=(a=i[r])[0],l=e[c],u=a[1];if(o&&a[2]){if(void 0===l&&!(c in e))return!1}else{var p=new Jt;if(n)var d=n(l,u,c,e,t,p);if(!(void 0===d?xi(u,l,3,n,p):d))return!1}}return!0}(i,e,t)}}function vi(e,t){return null!=e&&t in Object(e)}function Li(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Ne(t,e)).length,s=!1;++n<r;){var o=Se(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&tt(r)&&zt(o,r)&&(S(e)||Nt(e))}(e,t,vi)}function Ei(e){return e}function Ai(e){return B(e)?nt(Se(e)):function(e){return function(t){return Te(t,e)}}(e)}function Ni(e){return"function"==typeof e?e:null==e?Ei:"object"==typeof e?S(e)?function(e,t){return B(e)&&Ii(t)?Ci(Se(e),t):function(i){var n=ke(i,e);return void 0===n&&n===t?Li(i,e):xi(t,n,3)}}(e[0],e[1]):bi(e):Ai(e)}function Si(e,t,i){if(!V(i))return!1;var n=typeof t;return!!("number"==n?it(i)&&zt(t,i.length):"string"==n&&t in i)&&de(i[t],e)}function Ti(e){return"[object Object]"===Object.prototype.toString.call(e)}function ki(e){if(Ti(e)){for(let t in e)return!0;return!1}return!1}function ji(e){return"[object String]"===Object.prototype.toString.call(e)}function Zi(e){return!!(ji(e)&&e.length>0)}var zi=/\s/;var Yi=/^\s+/;function Xi(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&zi.test(e.charAt(t)););return t}(e)+1).replace(Yi,""):e}var Gi=/^[-+]0x[0-9a-f]+$/i,Fi=/^0b[01]+$/i,Wi=/^0o[0-7]+$/i,Oi=parseInt;function Pi(e){if("number"==typeof e)return e;if(K(e))return NaN;if(V(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=V(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xi(e);var i=Fi.test(e);return i||Wi.test(e)?Oi(e.slice(2),i?2:8):Gi.test(e)?NaN:+e}var Ki=1/0;function Hi(e){return e?(e=Pi(e))===Ki||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ui(e){var t=Hi(e),i=t%1;return t==t?i?t-i:t:0}function Bi(e){return!0===(t=e)||!1===t||P(t)&&"[object Boolean]"==O(t);var t}function Vi(e){if(e!=e)return!0;if(null!==e&&"object"==typeof e)try{let t=Number.prototype.valueOf.call(e);return Number.isNaN(t)}catch(e){return!1}return!1}function _i(e){let t=!1;if(Zi(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(Vi(e))return!1;t=!0}return t}function Ri(e){if(!_i(e))return 0;return Hi(e)}function Qi(e,t={}){let i=ke(t,"useLimitSafe",null);return Bi(i)||(i=!1),!!_i(e)&&(e=Ri(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==Ui(n));var n}var Ji=j.isFinite,qi=Math.min;var $i,en=($i=Math["round"],function(e,t){if(e=Pi(e),(t=null==t?0:qi(Ui(t),292))&&Ji(e)){var i=(Ae(e)+"e").split("e");return+((i=(Ae($i(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return $i(e)});function tn(e,t={}){let i=ke(t,"useClampSafe",null);Bi(i)||(i=!1);let n=ke(t,"useLimitSafe",null);Bi(n)||(n=!1);let r=ke(t,"returnWithStateAndMsg",null);Bi(r)||(r=!1);let s=e=>r?{state:"success",msg:e}:e,o=e=>{if(r)return{state:"error",msg:e};throw new Error(e)};if(!_i(e))return s(0);let a=null;try{e=Ri(e),a=en(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),s(a))}function nn(e,t={}){if(!Qi(e,t))return!1;return tn(e)>0}function rn(e){return"[object Array]"===Object.prototype.toString.call(e)}function sn(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function on(e){if(Ti(e)){for(let t in e)return!1;return!0}return!1}function an(e){return!!rn(e)&&0===e.length}function cn(e){return!!sn(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!on(e)||(!!function(e){return!(!ji(e)||0!==e.length)}(e)||(!!an(e)||!!Vi(e)))))}function ln(e){return!!rn(e)&&(0!==e.length&&(1!==e.length||!cn(e[0])))}function un(e){if(!_i(e))return!1;return Ri(e)>0}var pn=ze(Object.getPrototypeOf,Object),dn=Function.prototype,mn=Object.prototype,hn=dn.toString,fn=mn.hasOwnProperty,gn=hn.call(Object);function wn(e){if(!P(e)||"[object Object]"!=O(e))return!1;var t=pn(e);if(null===t)return!0;var i=fn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&hn.call(i)==gn}function yn(e){return function(e){if(!P(e))return!1;var t=O(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!wn(e)}(e)}function Mn(e){return _(e)}function Dn(e,t={}){if(!Qi(e,t))return!1;return tn(e)>=0}function xn(e,t){return Zi(e)&&Dn(t)?0===(t=tn(t))?"":e.substring(0,t):""}function In(e,t){if(!Zi(e))return"";if(!Dn(t))return"";if(0===(t=tn(t)))return"";let i=e.length-t;return i<0&&(i=0),e.substring(i,i+t)}function Cn(e,t){return Zi(e)&&Dn(t)?0===(t=tn(t))?e:xn(e,e.length-t):""}function bn(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}function vn(e){let t,i;try{i=Object.prototype.toString.call(e)}catch(e){return!1}if(t="[object Promise]"===i,t)return!0;if("[object Function]"!==i)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}let Ln=function(e){if(!Mn(e))throw new Error("fn is not a function");return function(){let t,i=bn();try{t=e.apply(this,arguments)}catch(e){return i.resolve({state:"error",msg:e}),i}let n=e=>{let t=!1;try{t="cancelled"===ke(e,"reason")}catch(e){}t?i.resolve({state:"cancelled",msg:""}):i.resolve({state:"error",msg:e})};try{vn(t)?t.then(e=>{i.resolve({state:"success",msg:e})},n):i.resolve({state:"success",msg:t})}catch(e){i.resolve({state:"error",msg:e})}return i}};function En(e,t={}){let i=ke(t,"fs"),n=!1;try{i.statSync(e),n=!0}catch{n=!1}return n}function An(e,t={}){let i=ke(t,"fs");if(!En(e,{fs:i}))return!1;let n=i.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function Nn(e){return An(e,{fs:t})}function Sn(e,t={}){let i=ke(t,"fs");return!!En(e,{fs:i})&&(!i.lstatSync(e).isDirectory()&&!i.lstatSync(e).isSymbolicLink())}function Tn(e){return Sn(e,{fs:t})}function kn(e,t,i){if(!Zi(e))return"";if(!Zi(t))return"";if(!ji(i))return"";return String(e).replaceAll(t,i)}var jn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(t,i))}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),i}var Yn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(Yn);var Xn=Zn(Yn.exports);function Gn(){return new Xn}function Fn(e,t,i=[],n={}){let r=n.funSettle,s=n.tag||"evem",o=(t,...i)=>e.emit(t,...i);Mn(n.funEmit)&&(o=n.funEmit);try{return o(t,...i)}catch(n){if(Mn(r))try{r(n)}catch(e){}try{"error"!==t&&e.listenerCount("error")>0?o("error",{fun:"listener",name:t,msg:n,args:i}):console.error(`[wsemi ${s}] listener of '${String(t)}' threw:`,n)}catch(e){try{console.error(`[wsemi ${s}] listener of '${String(t)}' threw, and reporting it also threw:`,e,n)}catch(e){}}return!1}}let Wn=2147483647;function On(e,t,i=[],n={}){let r=n.ms;return nn(r)||(r=1),r=tn(r),r=Math.min(r,Wn),setTimeout(()=>{Fn(e,t,i,n)},r)}function Pn(e){try{let t=e();return"string"==typeof t?t:""}catch(e){return""}}function Kn(e,t){try{let i=new WeakSet,n=[],r=JSON.stringify(e,function(e,r){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.length>=t)return"[Deep]";if("bigint"==typeof r)return String(r);if(null!==r&&"object"==typeof r){if(i.has(r))return"[Circular]";i.add(r),n.push(r)}return r});return"string"==typeof r?r:""}catch(e){return""}}function Hn(e){if(e.length>=2&&'"'===e[0]&&'"'===e[e.length-1]){let t=Pn(()=>JSON.parse(e));if(""!==t)return t}return e}function Un(e,t){if(void 0===e)return"";if(null===e)return"null";let i=function(e){let t=typeof e;return"string"===t?e:null==e?"":"number"===t||"boolean"===t||"bigint"===t||"symbol"===t?String(e):""}(e);if(""!==i)return i;let n=Kn(e,t);if(""!==n&&"{}"!==n)return Hn(n);let r=Pn(()=>String(e));return""!==r&&"[object Object]"!==r?r:n}function Bn(e,t){let i=new WeakSet;null===e||"object"!=typeof e&&"function"!=typeof e||i.add(e);let n=e,r=[];for(let e=0;e<t.levelCauseMax;e++){let e=null;try{e=n.cause}catch(e){break}if(null==e)break;if("object"==typeof e||"function"==typeof e){if(i.has(e))break;i.add(e)}let s=_n(e,{...t,useCause:!1,useAggregate:!1});""!==s&&r.push(s),n=e}return r.join(" <- ")}function Vn(e,t){let i=null;try{i=e.errors}catch(e){return""}if(!Array.isArray(i)||0===i.length)return"";let n=[];for(let r=0;r<i.length&&r<t.levelCauseMax;r++){if(i[r]===e)continue;let s=_n(i[r],{...t,useCause:!1,useAggregate:!1});""!==s&&n.push(s)}return n.join("; ")}function _n(e,t){if("string"==typeof e)return e;if(null==e)return"";if("number"==typeof e)return Number.isNaN(e)?"":String(e);if("boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);let i=null,n=!1;try{i=e.message,n=!0}catch(e){n=!1}if(n&&"string"==typeof i){if(""!==i){let n=i;if(t.useCause){let i=Bn(e,t);""!==i&&(n=`${n} <- ${i}`)}if(t.useAggregate){let i=Vn(e,t);""!==i&&(n=`${n} [${i}]`)}return n}let n=Bn(e,t);return""!==n?n:""}if(n){let e=Un(i,t.levelJsonMax);if(""!==e)return e}let r=Bn(e,t);if(""!==r)return r;if(t.useAggregate){let i=Vn(e,t);if(""!==i)return i}let s=Kn(e,t.levelJsonMax),o=Hn(s);if(""!==o&&"{}"!==o)return o;let a=Pn(()=>String(e));if(""!==a&&"[object Object]"!==a)return a;let c=Pn(()=>Object.prototype.toString.call(e));return""!==c&&"[object Object]"!==c?c:""!==s?s:""}function Rn(e,t={}){let i=ke(t,"useCause",null);Bi(i)||(i=!1);let n=ke(t,"useAggregate",null);Bi(n)||(n=!1);let r=ke(t,"levelCauseMax",null);nn(r,{useLimitSafe:!0})||(r=8),r=tn(r);let s=ke(t,"levelJsonMax",null);nn(s,{useLimitSafe:!0})||(s=6),s=tn(s);let o=ke(t,"lengthMessageMax",null);nn(o,{useLimitSafe:!0})||(o=0),o=tn(o);let a={useCause:i,useAggregate:n,levelCauseMax:r,levelJsonMax:s,lengthMessageMax:o},c="";try{c=_n(e,a)}catch(e){return c="",c}return Zi(c)?(a.lengthMessageMax>0&&c.length>a.lengthMessageMax&&(c=a.lengthMessageMax>3?c.slice(0,a.lengthMessageMax-3)+"...":c.slice(0,a.lengthMessageMax)),c):(c="",c)}function Qn(e){if(!(Zi(e)||_i(e)||K(e)||function(e){return"[object BigInt]"===Object.prototype.toString.call(e)}(e)))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}var Jn={exports:{}};var qn,$n={exports:{}},er=zn(Object.freeze({__proto__:null,default:{}}));function tr(){return qn||(qn=1,function(e){var t;e.exports=(t=t||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==jn&&jn.crypto&&(i=jn.crypto),!i)try{i=er}catch(e){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),s={},o=s.lib={},a=o.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=a.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<r;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new c.init(t,e)}}),l=s.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(i,t/2)}},p=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(i,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,r=n.words,s=n.sigBytes,o=this.blockSize,a=s/(4*o),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*l,s);if(l){for(var p=0;p<l;p+=o)this._doProcessBlock(r,p);i=r.splice(0,l),n.sigBytes-=u}return new c.init(i,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=s.algo={};return s}(Math),t)}($n)),$n.exports}!function(e){e.exports=tr().enc.Utf8}(Jn);var ir=Zn(Jn.exports),nr={exports:{}};!function(e){var t;e.exports=(t=tr(),function(){var e=t,i=e.lib.WordArray;function n(e,t,n){for(var r=[],s=0,o=0;o<t;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;r[s>>>2]|=a<<24-s%4*8,s++}return i.create(r,s)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var r=[],s=0;s<i;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<i;a++)r.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var s=0;s<i.length;s++)r[i.charCodeAt(s)]=s}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return n(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(nr);var rr=Zn(nr.exports);function sr(e,t){return!!Ti(e)&&(!(!Zi(t)&&!_i(t))&&t in e)}function or(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}function ar(e,t){var i;return(S(e)?or:Rt)(e,"function"==typeof(i=t)?i:Ei)}function cr(e){try{return String(e)}catch(e){}try{let t=e.message;if("string"==typeof t&&""!==t)return t}catch(e){}return"unknown error"}function lr(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function ur(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function pr(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function dr(e){if(!(lr(e)||function(e){let t=Object.prototype.toString.call(e);if("[object Blob]"===t||"[object File]"===t)return!0;try{if("undefined"!=typeof Blob&&e instanceof Blob)return!0}catch(e){}return!1}(e)||ur(e)||pr(e)))return null;try{if(_i(e.byteLength))return e.byteLength}catch(e){}try{if(_i(e.length))return e.length}catch(e){}try{if(_i(e.size))return e.size}catch(e){}return null}function mr(e){if(null===e||"object"!=typeof e)return!1;if(e instanceof Error)return!0;if("function"==typeof Error.isError)return Error.isError(e);if(Symbol.toStringTag in e)return!1;let t=Object.prototype.toString.call(e);return"[object Error]"===t||"[object DOMException]"===t}function hr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{results:"",binarys:[]};if(!Ti(e)&&!rn(e))return n("invalid data, data is not an object or array");if(on(e)||an(e))return n("invalid data, data is an empty object or empty array");let r=/^(?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,s="",o=[];try{let t=-1;s=JSON.stringify(e,function(e,i){if(ur(i)){t+=1;let e=`[BlazeForUint8Array]::${t}`;return o.push(i),e}if(pr(i)){t+=1;let e=`[BlazeForUint16Array]::${t}`;return o.push(i),e}if(lr(i)){t+=1;let e=`[BlazeForArrayBuffer]::${t}`;return o.push(i),e}return i=function(e){if(!mr(e))return e;let t=e.toString;return t===Object.prototype.toString||"function"!=typeof t?Error.prototype.toString.call(e):t.call(e)}(i),Zi(i)&&91===i.charCodeAt(0)&&r.test(i)?"[BlazeForPreventEscape]"+i:i})}catch(e){return n(cr(e))}return i?{state:"success",msg:{results:s,binarys:o}}:{results:s,binarys:o}}let fr=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function gr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:new Uint8Array;if(!Zi(e))return n("invalid str");if(!("function"==typeof e.isWellFormed?e.isWellFormed():!fr.test(e)))return n("invalid str, contains lone surrogates");let r=null;try{r=(new TextEncoder).encode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}function wr(e,t,i=0,n=!0,r=52,s=8){return function(e,t,i,n,r,s){if(!_i(e))return null;if(!ur(t))return null;if(!Qi(i))return null;if(!Bi(n))return null;if(!Qi(r))return null;if(!Qi(s))return null;let o,a,c;e=Ri(e);let l=8*s-r-1,u=(1<<l)-1,p=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?s-1:0,h=n?-1:1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(o++,c/=2),o+p>=u?(a=0,o=u):o+p>=1?(a=(e*c-1)*Math.pow(2,r),o+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,r),o=0));r>=8;t[i+m]=255&a,m+=h,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;t[i+m]=255&o,m+=h,o/=256,l-=8);return t[i+m-h]|=128*f,null}(e,t,i,n,r,s)}function yr(e){let t=0;ar(e,e=>{t+=dr(e)});let i=new Uint8Array(t),n=0;return ar(e,e=>{let t=function(e){return lr(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0)}(e);i.set(t,n),n+=t.length}),i}function Mr(e,t={}){let i=[],n=new Uint8Array,r=ke(t,"returnWithStateAndMsg",null);Bi(r)||(r=!1);let s=e=>r?{state:"error",msg:e}:new Uint8Array;if(!(o=e,rn(o)&&o.length>=1||ki(e)))return s("invalid data, data is not an effective object or a non-empty array");var o;let a=[],c=[];function l(e){a.push(dr(e)),c.push(e)}try{let t=hr(e,{returnWithStateAndMsg:!0});if("error"===t.state)return s(`obj2stru8arr: ${t.msg}`);let r=t.msg;l(gr(r.results)),ar(r.binarys,e=>{l(e)});let o=a,u=gr(JSON.stringify(o)),p=new Uint8Array(8);wr(dr(u),p),i.push(p),i.push(u),ar(c,e=>{i.push(e)}),n=yr(i)}catch(e){return s(cr(e))}return r?{state:"success",msg:n}:n}function Dr(e,t=0,i=!0,n=52,r=8){return function(e,t,i,n,r){if(!ur(e))return null;if(!Qi(t))return null;if(!Bi(i))return null;if(!Qi(n))return null;if(!Qi(r))return null;let s,o,a=8*r-n-1,c=(1<<a)-1,l=c>>1,u=-7,p=i?0:r-1,d=i?1:-1,m=e[t+p];for(p+=d,s=m&(1<<-u)-1,m>>=-u,u+=a;u>0;s=256*s+e[t+p],p+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=256*o+e[t+p],p+=d,u-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,n),s-=l}return(m?-1:1)*o*Math.pow(2,s-n)}(e,t,i,n,r)}function xr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!ur(e))return n("invalid u8a");let r="";try{r=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}function Ir(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!ki(e))return n("invalid data");let r=null,s=null;try{r=e.results,s=e.binarys}catch(e){return n(cr(e))}if(!Zi(r))return n("invalid results");if(!rn(s))return n("invalid binarys");let o=/^\[BlazeFor(Uint8Array|Uint16Array|ArrayBuffer)\]::(\d+)$/,a=/^\[BlazeForPreventEscape\](?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,c=new Set,l={};try{l=JSON.parse(r,function(e,t){if(!Zi(t)||91!==t.charCodeAt(0))return t;let i=o.exec(t);if(null===i)return a.test(t)?t.slice(23):t;let n=Number(i[2]);if(n>=s.length)throw new Error(`binary index out of range[${n}], binarys.length[${s.length}]`);if(c.has(n))throw new Error(`binary index referenced more than once[${n}]`);return c.add(n),((e,t,i)=>{if("Uint16Array"===e&&!pr(i)){if(!ur(i))throw new Error(`binarys[${t}] can not be restored to Uint16Array`);if(i.byteLength%2!=0)throw new Error(`binarys[${t}] byteLength[${i.byteLength}] is not even, can not be restored to Uint16Array`);let e=0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i);return new Uint16Array(e.buffer)}if("ArrayBuffer"===e&&!lr(i)){if(!ur(i))throw new Error(`binarys[${t}] can not be restored to ArrayBuffer`);return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}return i})(i[1],n,s[n])})}catch(e){return n(cr(e))}return i?{state:"success",msg:l}:l}function Cr(e,t={}){let i={},n=ke(t,"returnWithStateAndMsg",null);Bi(n)||(n=!1);let r=e=>n?{state:"error",msg:e}:{};if(!ur(e))return r("invalid u8a");try{let t=8,n=e.slice(0,t),s=e.slice(t,dr(e)),o=Dr(n),a=s.slice(0,o),c=s.slice(o,dr(s)),l=xr(a,{returnWithStateAndMsg:!0});if("error"===l.state)return r(`u8arr2str: ${l.msg}`);let u=l.msg,p=JSON.parse(u),d=function(e,t){if(!Array.isArray(e))return"not an array";for(let t=0;t<e.length;t++){let i=e[t];if(!Number.isInteger(i)||i<0)return"every item must be a non-negative finite integer"}let i=0;for(let n=0;n<e.length;n++)if(i+=e[n],i>t)return"total length exceeds the packet";return e.length>1&&25*(e.length-1)>e[0]?"too many chunks for the main block":""}(p,dr(c));if(""!==d)return r(`invalid pks, ${d}`);let m=function(e,t){let i=0,n=0,r=[];for(let s=0;s<t.length;s++){n=i+t[s];let o=e.slice(i,n);i=n,r.push(o)}return r}(c,p),h=xr(m.shift(),{returnWithStateAndMsg:!0});if("error"===h.state)return r(`u8arr2str: ${h.msg}`);let f=Ir({results:h.msg,binarys:m},{returnWithStateAndMsg:!0});if("error"===f.state)return r(`stru8arr2obj: ${f.msg}`);i=f.msg}catch(e){return r(cr(e))}return n?{state:"success",msg:i}:i}function br(e){let t=!1;try{t=mr(e)}catch(e){}if(t)return e;if("string"==typeof e&&""!==e)return e;let i=cr(e);return""!==i?i:"unknown error"}function vr(e){return function(e,t={}){try{let i=ke(t,"fs");if(An(e,{fs:i}))return{success:"input folder is already exists: "+e};if(En(e,{fs:i}))return{error:"input path already exists: "+e};i.mkdirSync(e,{recursive:!0})}catch(e){return{error:br(e)}}return{success:"done: "+e}}(e,{fs:t})}function Lr(e){return function(e,t={}){try{let i=ke(t,"fs");if(!En(e,{fs:i}))return{success:"file does not exist: "+e};if(!Sn(e,{fs:i}))return{error:"input path is not a file: "+e};i.unlinkSync(e)}catch(e){return{error:br(e)}}return{success:"done: "+e}}(e,{fs:t})}function Er(e){return Zi(e)&&e.length<=128&&/^[A-Za-z0-9]+$/.test(e)}let Ar={permission:200,param:200,app:200,output:200,packet:200,internal:200},Nr={main:{event:"execute",apiType:"main",api:"apiMain",authFrom:"header",statusOf:Ar},ulctr:{event:"upload",apiType:"upload-controller",api:"apiUploadCheck",authFrom:"header",statusOf:Ar},slc:{event:"upload",apiType:"upload-slice",api:"apiUploadSlice",authFrom:"header",statusOf:Ar},dwgfn:{event:"download",apiType:"download-get-filename",api:"apiDownloadGetFilename",authFrom:"header",statusOf:Ar,fields:[{name:"streamRead"},{name:"filename"}]},dwgf:{event:"download",apiType:"download-get-file",api:"apiDownloadGetFile",authFrom:"query",statusOf:{permission:403,param:400,app:404,output:500,packet:500,internal:500},fields:[{name:"streamRead"},{name:"fileSize"},{name:"fileType"},{name:"filename",optional:!0}]},dw:{event:"download",apiType:"download",api:"apiDownload",authFrom:"header",statusOf:Ar,fields:[{name:"streamRead"},{name:"filename"},{name:"fileSize"},{name:"fileType"}]}};var Sr={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",s="minute",o="hour",a="day",c="week",l="month",u="quarter",p="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},w=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},y={s:w,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+w(n,2,"0")+":"+w(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),s=i-r<0,o=t.clone().add(n+(s?-1:1),l);return+(-(n+(i-r)/(s?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:p,w:c,d:a,D:d,h:o,m:s,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},M="en",D={};D[M]=g;var x="$isDayjsObject",I=function(e){return e instanceof L||!(!e||!e[x])},C=function e(t,i,n){var r;if(!t)return M;if("string"==typeof t){var s=t.toLowerCase();D[s]&&(r=s),i&&(D[s]=i,r=s);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;D[a]=t,r=a}return!n&&r&&(M=r),r||!n&&M},b=function(e,t){if(I(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new L(i)},v=y;v.l=C,v.i=I,v.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var L=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var w=g.prototype;return w.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var r=n[2]-1||0,s=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.init()},w.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},w.$utils=function(){return v},w.isValid=function(){return!(this.$d.toString()===m)},w.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},w.isAfter=function(e,t){return b(e)<this.startOf(t)},w.isBefore=function(e,t){return this.endOf(t)<b(e)},w.$g=function(e,t,i){return v.u(e)?this[t]:this.set(i,e)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(e,t){var i=this,n=!!v.u(t)||t,u=v.p(e),m=function(e,t){var r=v.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},h=function(e,t){return v.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},f=this.$W,g=this.$M,w=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case p:return n?m(1,0):m(31,11);case l:return n?m(1,g):m(0,g+1);case c:var M=this.$locale().weekStart||0,D=(f<M?f+7:f)-M;return m(n?w-D:w+(6-D),g);case a:case d:return h(y+"Hours",0);case o:return h(y+"Minutes",1);case s:return h(y+"Seconds",2);case r:return h(y+"Milliseconds",3);default:return this.clone()}},w.endOf=function(e){return this.startOf(e,!1)},w.$set=function(e,t){var i,c=v.p(e),u="set"+(this.$u?"UTC":""),m=(i={},i[a]=u+"Date",i[d]=u+"Date",i[l]=u+"Month",i[p]=u+"FullYear",i[o]=u+"Hours",i[s]=u+"Minutes",i[r]=u+"Seconds",i[n]=u+"Milliseconds",i)[c],h=c===a?this.$D+(t-this.$W):t;if(c===l||c===p){var f=this.clone().set(d,1);f.$d[m](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},w.set=function(e,t){return this.clone().$set(e,t)},w.get=function(e){return this[v.p(e)]()},w.add=function(n,u){var d,m=this;n=Number(n);var h=v.p(u),f=function(e){var t=b(m);return v.w(t.date(t.date()+Math.round(e*n)),m)};if(h===l)return this.set(l,this.$M+n);if(h===p)return this.set(p,this.$y+n);if(h===a)return f(1);if(h===c)return f(7);var g=(d={},d[s]=t,d[o]=i,d[r]=e,d)[h]||1,w=this.$d.getTime()+n*g;return v.w(w,this)},w.subtract=function(e,t){return this.add(-1*e,t)},w.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=v.z(this),s=this.$H,o=this.$m,a=this.$M,c=i.weekdays,l=i.months,u=i.meridiem,p=function(e,i,r,s){return e&&(e[i]||e(t,n))||r[i].slice(0,s)},d=function(e){return v.s(s%12||12,e,"0")},h=u||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(f,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return v.s(t.$y,4,"0");case"M":return a+1;case"MM":return v.s(a+1,2,"0");case"MMM":return p(i.monthsShort,a,l,3);case"MMMM":return p(l,a);case"D":return t.$D;case"DD":return v.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(i.weekdaysMin,t.$W,c,2);case"ddd":return p(i.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return v.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(s,o,!0);case"A":return h(s,o,!1);case"m":return String(o);case"mm":return v.s(o,2,"0");case"s":return String(t.$s);case"ss":return v.s(t.$s,2,"0");case"SSS":return v.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(n,d,m){var h,f=this,g=v.p(d),w=b(n),y=(w.utcOffset()-this.utcOffset())*t,M=this-w,D=function(){return v.m(f,w)};switch(g){case p:h=D()/12;break;case l:h=D();break;case u:h=D()/3;break;case c:h=(M-y)/6048e5;break;case a:h=(M-y)/864e5;break;case o:h=M/i;break;case s:h=M/t;break;case r:h=M/e;break;default:h=M}return m?h:v.a(h)},w.daysInMonth=function(){return this.endOf(l).$D},w.$locale=function(){return D[this.$L]},w.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=C(e,t,!0);return n&&(i.$L=n),i},w.clone=function(){return v.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},g}(),E=L.prototype;return b.prototype=E,[["$ms",n],["$s",r],["$m",s],["$H",o],["$W",a],["$M",l],["$y",p],["$D",d]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,L,b),e.$i=!0),b},b.locale=C,b.isDayjs=I,b.unix=function(e){return b(1e3*e)},b.en=D[M],b.Ls=D,b.p={},b}()}(Sr);var Tr=Zn(Sr.exports);let kr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),jr=kr.length;function Zr(e=32){let t=[];e=nn(e)?tn(e):32;for(let i=0;i<e;i++)t[i]=kr[0|Math.random()*jr];return t.join("")}function zr(e,t){var i=-1,n=it(e)?Array(e.length):[];return Rt(e,function(e,r,s){n[++i]=t(e,r,s)}),n}function Yr(e,t){return(S(e)?be:zr)(e,Ni(t))}function Xr(e,t,i){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(r);++n<r;)s[n]=e[n+t];return s}function Gr(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:Xr(e,t,i)}function Fr(e){return e!=e}function Wr(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,s=i+(n?1:-1);n?s--:++s<r;)if(t(e[s],s,e))return s;return-1}(e,Fr,i)}var Or="\\ud800-\\udfff",Pr="["+Or+"]",Kr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Hr="\\ud83c[\\udffb-\\udfff]",Ur="[^"+Or+"]",Br="(?:\\ud83c[\\udde6-\\uddff]){2}",Vr="[\\ud800-\\udbff][\\udc00-\\udfff]",_r="(?:"+Kr+"|"+Hr+")"+"?",Rr="[\\ufe0e\\ufe0f]?",Qr=Rr+_r+("(?:\\u200d(?:"+[Ur,Br,Vr].join("|")+")"+Rr+_r+")*"),Jr="(?:"+[Ur+Kr+"?",Kr,Br,Vr,Pr].join("|")+")",qr=RegExp(Hr+"(?="+Hr+")|"+Jr+Qr,"g");function $r(e){return ot(e)?function(e){return e.match(qr)||[]}(e):function(e){return e.split("")}(e)}function es(e,t,i){if((e=Ae(e))&&(i||void 0===t))return Xi(e);if(!e||!(t=Ee(t)))return e;var n=$r(e),r=$r(t),s=function(e,t){for(var i=-1,n=e.length;++i<n&&Wr(t,e[i],0)>-1;);return i}(n,r),o=function(e,t){for(var i=e.length;i--&&Wr(t,e[i],0)>-1;);return i}(n,r)+1;return Gr(n,s,o).join("")}function ts(e,t){if(!Zi(e))return[];if(!Zi(t))return[];let i=function(e,t){return Zi(e)&&Zi(t)?e.split(t):[]}(e,t);i=Yr(i,es);let n=[];return ar(i,function(e){Zi(e)&&n.push(e)}),n}const is=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function ns(e,t={}){let i=bn();try{let n=ke(t,"fs"),r=ke(t,"chunkSize");if(nn(r)||(r=67108864),r=tn(r),r>2**30&&(r=67108864),!Sn(e,{fs:n}))return i.reject("fp is not a file"),i;let{create64:s}=await async function(){return function(e){const{exports:{mem:t,xxh32:i,xxh64:n,init32:r,update32:s,digest32:o,init64:a,update64:c,digest64:l}}=e;let u=new Uint8Array(t.buffer);function p(e,i){if(t.buffer.byteLength<e+i){const n=Math.ceil((e+i-t.buffer.byteLength)/65536);t.grow(n),u=new Uint8Array(t.buffer)}}function d(e,t,i,n,r,s){p(e);const o=new Uint8Array(e);return u.set(o),i(0,t),o.set(u.subarray(0,e)),{update(t){let i;return u.set(o),"string"==typeof t?(p(3*t.length,e),i=g.encodeInto(t,u.subarray(e)).written):(p(t.byteLength,e),u.set(t,e),i=t.byteLength),n(0,e,i),o.set(u.subarray(0,e)),this},digest:()=>(u.set(o),s(r(0)))}}function m(e){return e>>>0}const h=2n**64n-1n;function f(e){return e&h}const g=new TextEncoder;function w(e,t=0){return p(3*e.length,0),m(i(0,g.encodeInto(e,u).written,t))}function y(e,t=0n){return p(3*e.length,0),f(n(0,g.encodeInto(e,u).written,t))}return{h32:w,h32ToString:(e,t=0)=>w(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(p(e.byteLength,0),u.set(e),m(i(0,e.byteLength,t))),create32:(e=0)=>d(48,e,r,s,o,m),h64:y,h64ToString:(e,t=0n)=>y(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(p(e.byteLength,0),u.set(e),f(n(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,a,c,l,f)}}((await WebAssembly.instantiate(is)).instance)}(),o=s(),a=n.createReadStream(e,{highWaterMark:r}),c=e=>{i.reject(cr(e));try{a.destroy()}catch(e){}};a.on("data",e=>{try{o.update(e)}catch(e){c(e)}}),a.on("end",()=>{try{let e=o.digest().toString(16).padStart(16,"0");i.resolve(e)}catch(e){c(e)}}),a.on("error",e=>{i.reject(cr(e))})}catch(e){i.reject(cr(e))}return i}var rs={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsbApsZXQgaW5pdEZhaWwgPSBudWxsIC8v5Yid5aeL5YyW5aSx5pWXKOW3peW7oOWHveaVuOaLi+mMr+etiSnmmYLkuYt7IGVyciB9LCDku6Xnianku7bljIXoo53lm6DpjK/oqqTlgLzlj6/ngrrku7vmhI/lgLw7IOW+jOe6jOWRvOWPq+S7peWFtuWOn+Wni+mMr+iqpOWbnuaHiQpmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBtZERlZmF1bHQKICAgICAgICB9CiAgICAgICAgCgogICAgLy9vbgogICAgCgogICAgLy9zYXZlCiAgICBpbnN0YW5jZSA9IHIKCn0KCmZ1bmN0aW9uIHNlbmRNZXNzYWdlKGRhdGEsIGRlc2MpIHsKICAgIHRyeSB7CiAgICAgICAgcGFyZW50UG9ydC5wb3N0TWVzc2FnZShkYXRhKQogICAgfQogICAgY2F0Y2ggKGVycikgewogICAgICAgIC8vZGF0YeWQq+eEoeazlee1kOani+WMluikh+ijveS5i+WFp+WuuSjlh73mlbjjgIFTeW1ib2znrYkp5pmCcG9zdE1lc3NhZ2XlkIzmraXmi4tEYXRhQ2xvbmVFcnJvcjog5LiN6JmV55CG5YmH5ouL5pa85ZG85Y+r6Lev5b6R5aSWLCDmlrxub2RlanPmiJB3b3JrZXLmnKrmjZXmjYnpjK/oqqTogIzltKnmvbAo5oyB5LmF6IiH5bel5bug5a+m6auU5b6e5q2k5q275LqhKSwg5pa854CP6Ka95Zmo5oiQ5pyq6JmV55CGcmVqZWN0aW9u6ICM5ZG85Y+r5rC45LmF5oe4572uOwogICAgICAgIC8v5L6d6KiK5oGv6aGe5Z6L5pS56YCB5Y+v6KSH6KO95LmL5a2X5Liy6Kqq5piOKGRlc2PngrrlhaflrrnkuYvmj4/ov7ApLCDkvb/lkbzlj6vnq6/lvpfliLDlhbflkI3ljp/lm6DkuJR3b3JrZXLnuozlj6/mnI3li5k7IOWFnOW6leWGjeWkseaVl+WNs+aUvuajhCwg5LiN5Y+v6YGe6L+0CiAgICAgICAgbGV0IG1zZyA9ICcnCiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgbXNnID0gZGVzYyArICcgY291bGQgbm90IGJlIGNsb25lZDogJyArIFN0cmluZygoZXJyICYmIGVyci5tZXNzYWdlKSB8fCBlcnIpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgICAgIGxldCBkYXRhU2FmZSA9IG51bGwKICAgICAgICBpZiAoZGF0YS5tb2RlID09PSAncmV0dXJuJykgewogICAgICAgICAgICBkYXRhU2FmZSA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5YyW5aSx5pWX5pmCaW5zdGFuY2XngrpudWxsLCDku6XliJ3lp4vljJbkuYvljp/lp4vpjK/oqqTlm57mh4ko5ZCM5bu656uL5aSx5pWX5LmL6JmV572uKSwg5LiN5b6X5bCNbnVsbOWPluWAvOiAjOW+l+iqpOWwjuS5i1R5cGVFcnJvcgogICAgICAgICAgICBpZiAoaW5pdEZhaWwpIHsKICAgICAgICAgICAgICAgIHRocm93IGluaXRGYWlsLmVycgogICAgICAgICAgICB9CgogICAgICAgICAgICAvL2Z1biwg6aCI54K65Ye95pW4LCDlkKbliYfku6XlhbflkI3oqIrmga/mi5LntZUo5Li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yA9ICdyZXR1cm4gdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGluaXRGYWlsKSB7CiAgICAgICAgICAgIGRlc2MgPSAnaW5pdCBlcnJvcicKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRlc2MgPSAncmVqZWN0ZWQgdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMsIGRlc2MpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ2UoZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciByZWN2OicsIGRhdGEpCgogICAgLy9kYXRhUmVjdgogICAgbGV0IGRhdGFSZWN2ID0gZGF0YQoKICAgIC8vcnVuCiAgICBydW4oZGF0YVJlY3YpCgp9CgoKICAgICAgICBwYXJlbnRQb3J0Lm9uKCdtZXNzYWdlJywgcmVjdk1lc3NhZ2UpCiAgICAgICAgcGFyZW50UG9ydC5vbignbWVzc2FnZWVycm9yJywgKGVycikgPT4gewogICAgICAgICAgICBzZW5kTWVzc2FnZSh7IG1vZGU6ICdtZXNzYWdlZXJyb3InLCBtc2c6IGVyciB9LCAnbWVzc2FnZWVycm9yIG9mIHdvcmtlcicpCiAgICAgICAgfSkKICAgICAgICAKCnRyeXsKCiAgICAvL+WDheS7pXVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcuiomOmMhHdvcmtlcuWFp+acquaNleaNi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ZCN56m66ZaT54mp5Lu2KQogICAgcmV0dXJuIChtZFVzZXIuZXhwb3J0cyAmJiBtZFVzZXIuZXhwb3J0cy5fX2VzTW9kdWxlICYmICdkZWZhdWx0JyBpbiBtZFVzZXIuZXhwb3J0cykgPyBtZFVzZXIuZXhwb3J0cy5kZWZhdWx0IDogbWRVc2VyLmV4cG9ydHMKCn0pKCkpCgo=",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(rs);var ss=Zn(rs.exports);let os=new Set,as=new Map,cs=(t,i,n="")=>{let r=e.resolve(i,t);return{fp:r,fpm:`${r}.merging`,fpd:`${r}.done`,fpe:`${r}.error`,fpr:Zi(n)?`${r}.q${n}.ro`:""}},ls=e=>{let t=Lr(e);if(Tn(e))throw new Error(`can not remove ${e}: ${Rn(ke(t,"error"))}`)},us=async(e,i)=>{os.add(i.fp);try{let n=await function(e,i={}){try{return ns(e,{fs:t,...i})}catch(e){return Promise.reject(cr(e))}}(i.fp);if(n===e)return t.writeFileSync(i.fpd,"","utf8"),{state:"done"};let r=`merged file[${i.fp}] is incomplete: hash[${n}] != fileHash[${e}], merge was interrupted`;try{t.writeFileSync(i.fpe,r,"utf8")}catch(e){console.log(`can not write ${i.fpe}`,e)}return{state:"mismatch",reason:r}}catch(e){return{state:"error",reason:`verify merged file[${i.fp}] error: ${Rn(e)}`}}finally{os.delete(i.fp)}},ps=async(e,i,n)=>{let r=`${function(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYYMMDDHHmmss")}()}|${Zr(6)}|${e}`,s=cs(e,n);if(os.has(s.fp))return r;let o=Tn(s.fpe),a=Tn(s.fp);if(!o&&a){let t=await us(e,s);if("done"===t.state)return r;if("error"===t.state)throw new Error(t.reason)}return ls(s.fpd),ls(s.fpe),os.add(s.fp),setTimeout(()=>{ss(e,i,n,s.fpm).then(i=>{let n=ke(i,"hash","");if(n!==e)throw new Error(`merged file hash[${n}] != fileHash[${e}]`);t.renameSync(s.fpm,s.fp),t.writeFileSync(s.fpd,"","utf8")}).catch(e=>{console.log(e),Lr(s.fpm);let i=Rn(e);try{t.writeFileSync(s.fpe,i,"utf8")}catch(e){console.log(`can not write ${s.fpe}`,e)}}).finally(()=>{os.delete(s.fp)})},1),r},ds=async(e,i,n={})=>{let r=ke(n,"funConsume"),s=ke(n,"funLog");Mn(s)||(s=e=>{console.log(e)});let o=ts(e,"|"),a=ke(o,0,""),c=ke(o,1,""),l=ke(o,2,"");if(3!==Dt(o)||!Er(a)||!Er(c)||!Er(l)){let t=`invalid queueId[${Rn(e)}]`;return console.log(t),{state:"error",msg:"invalid queueId",reason:t,path:""}}let u=cs(l,i,`${a}${c}`);if(Tn(u.fpr)){let e=((e,i)=>{try{let n=Cr(new Uint8Array(t.readFileSync(e.fpr)),{returnWithStateAndMsg:!0});if("success"!==ke(n,"state"))return i(`stored result ${e.fpr} is corrupted, treat as not stored: ${ke(n,"msg","unknown error")}`),{ok:!1};let r=n.msg;return Ti(r)&&sr(r,"ro")?{ok:!0,ro:r.ro}:(i(`stored result ${e.fpr} has no own 'ro' key, treat as not stored`),{ok:!1})}catch(t){return i(`can not read stored result ${e.fpr}: ${Rn(t)}`),{ok:!1}}})(u,s);if(e.ok)return{state:"success",msg:e.ro,path:u.fp,from:"stored"}}if(Tn(u.fpe)){let e="";try{e=t.readFileSync(u.fpe,"utf8")}catch(e){}return{state:"error",msg:"merge slices failed",reason:e,path:u.fp}}if(os.has(u.fp))return{state:"merging",msg:"",path:u.fp};let p=Tn(u.fp),d=Tn(u.fpd);if(p&&!d){let e=await us(l,u);if("done"!==e.state)return{state:"error",msg:"merge slices failed",reason:e.reason,path:u.fp};d=!0}if(p&&d){if(!Mn(r))return{state:"success",msg:"",path:u.fp};let e=await((e,i,n)=>{let r=e.fpr,s=as.get(r);return s||(s=Promise.resolve().then(()=>i(e.fp)).then(i=>{i=void 0===i?null:i;try{let n=Mr({ro:i},{returnWithStateAndMsg:!0});if("success"!==ke(n,"state"))return i;t.writeFileSync(e.fpr,Buffer.from(n.msg));let r=Cr(n.msg,{returnWithStateAndMsg:!0});if("success"===ke(r,"state")&&Ti(r.msg)&&sr(r.msg,"ro"))return r.msg.ro}catch(t){n(`can not store consumed result to ${e.fpr}: ${Rn(t)}`)}return i}).finally(()=>{as.delete(r)}),as.set(r,s),s)})(u,r,s);return{state:"success",msg:e,path:u.fp,from:"consumed"}}return!p&&d?{state:"error",msg:"merged file already consumed",reason:`merged file[${u.fp}] no longer exists and no stored result for queueId[${e}]`,path:u.fp}:{state:"error",msg:"no merge task",reason:`no merge task for fileHash[${l}] (never pushed, or artifacts removed)`,path:u.fp}};var ms={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsbApsZXQgaW5pdEZhaWwgPSBudWxsIC8v5Yid5aeL5YyW5aSx5pWXKOW3peW7oOWHveaVuOaLi+mMr+etiSnmmYLkuYt7IGVyciB9LCDku6Xnianku7bljIXoo53lm6DpjK/oqqTlgLzlj6/ngrrku7vmhI/lgLw7IOW+jOe6jOWRvO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GVyci5tZXNzYWdlKSB8fCBlcnIpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgICAgIGxldCBkYXRhU2FmZSA9IG51bGwKICAgICAgICBpZiAoZGF0YS5tb2RlID09PSAncmV0dXJuJykgewogICAgICAgICAgICBkYXRhU2FmZSA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5Y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GlucHV0KQogICAgICAgICAgICBzdGF0ZSA9ICdzdWNjZXNzJwoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KCiAgICAgICAgLy9kZXNjLCDlm57mh4nlhaflrrnnhKHms5XntZDmp4vljJbopIfoo73mmYLlhZzlupXoqqrmmI7kuYvmj4/ov7AKICAgICAgICBsZXQgZGVzYyA9ICcnCiAgICAgICAgaWYgKHN0YXRlID09PSAnc3VjY2VzcycpIHsKICAgICAgICAgICAgZGVzYyA9ICdyZXR1cm4gdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGluaXRGYWlsKSB7CiAgICAgICAgICAgIGRlc2MgPSAnaW5pdCBlcnJvcicKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRlc2MgPSAncmVqZWN0ZWQgdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMsIGRlc2MpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ2UoZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciByZWN2OicsIGRhdGEpCgogICAgLy9kYXRhUmVjdgogICAgbGV0IGRhdGFSZWN2ID0gZGF0YQoKICAgIC8vcnVuCiAgICBydW4oZGF0YVJlY3YpCgp9CgoKICAgICAgICBwYXJlbnRQb3J0Lm9uKCdtZXNzYWdlJywgcmVjdk1lc3NhZ2UpCiAgICAgICAgcGFyZW50UG9ydC5vbignbWVzc2FnZWVycm9yJywgKGVycikgPT4gewogICAgICAgICAgICBzZW5kTWVzc2FnZSh7IG1vZGU6ICdtZXNzYWdlZXJyb3InLCBtc2c6IGVyciB9LCAnbWVzc2FnZWVycm9yIG9mIHdvcmtlcicpCiAgICAgICAgfSkKICAgICAgICAKCnRyeXsKCiAgICAvL+WDheS7pXVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcuiomOmMhHdvcmtlcuWFp+acquaNleaNiemMr+iqpCwg5LiN5Y+v6Ki75YaKdW5jYXVnaHRFeGNlcHRpb27oiId1bmhhbmRsZWRSZWplY3Rpb27nm6Pogb06CiAgICAvL+aWvHdvcmtlcuWFp+iou+WGiuipsuS6jOebo+iBveacg+mYu+atondvcmtlcuS+nemgkOioree1guatoiwg5aSW5bGk5pS25LiN5YiwZXJyb3IvZXhpdOiAjOS7pHBlbmRpbmfmsLjkuYXmh7jnva4sIOaureWxjXdvcmtlcuS4puS7pOWuv+S4u+eEoeazlemAgOWHujsKICAgIC8v6Yyv6Kqk6ZuW5bey57aTZXJyb3Lkuovku7blgrPoh7PlpJblsaRyZWplY3QgcGVuZGluZywg5L2G54ShcGVuZGluZ+S4lOWRvOWPq+err+acquebo+iBvWVycm9y5pmCKGV2ZW50ZW1pdHRlcjPnhKHnm6Pogb3ogIXmmYJlbWl05LiN5ouL6YyvKeatpOi8uOWHuueCuuWUr+S4gOeXlei3oSwg5pWF5L+d55WZOwogICAgLy/mnKznm6Pogb3mlrzooqvljIXoo53nqIvlvI/norzln7fooYzkuYvlvozmiY3lronoo50sIOi8ieWFpeacn+S5i+mMr+iqpOS4jee2k+atpOiomOmMhAogICAgcHJvY2Vzcy5vbigndW5jYXVnaHRFeGNlcHRpb25Nb25pdG9yJywgKGVycikgPT4gewogICAgICAgIGNvbnNvbGUuZXJyb3IoJ2lubm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IGksYX0pKX1sZXQgbD1lZShzKT4wO3JldHVybntwYXRoOmksYkFsbEV4aXN0OmEsYkFsbFNpemU6YyxiQWxsSGFzaDpmLGJTbHM6bCxzbGtzOnN9fTsKCiAgICB9KS5jYWxsKG1kVXNlci5leHBvcnRzLCBtZFVzZXIsIG1kVXNlci5leHBvcnRzKQoKICAgIC8v6aCQ6Kit5Yyv5Ye6OiByb2xsdXDku6VfX2VzTW9kdWxl5qiZ56S66aCQ6Kit6IiH5YW35ZCN5Lim5a2Y6ICFLCDlj5blhbZkZWZhdWx0OyDlkKbliYdtb2R1bGUuZXhwb3J0c+WNs+mgkOioreWMr+WHuijlj6rmnInlhbflkI3ljK/lh7rogIXngrrlkb3lkI3nqbrplpPnianku7YpCiAgICByZXR1cm4gKG1kVXNlci5leHBvcnRzICYmIG1kVXNlci5leHBvcnRzLl9fZXNNb2R1bGUgJiYgJ2RlZmF1bHQnIGluIG1kVXNlci5leHBvcnRzKSA/IG1kVXNlci5leHBvcnRzLmRlZmF1bHQgOiBtZFVzZXIuZXhwb3J0cwoKfSkoKSkKCg==",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(ms);var hs=Zn(ms.exports),fs={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsbApsZXQgaW5pdEZhaWwgPSBudWxsIC8v5Yid5aeL5YyW5aSx5pWXKOW3peW7oOWHveaVuOaLi+mMr+etiSnmmYLkuYt7IGVyciB9LCDku6Xnianku7bljIXoo53lm6DpjK/oqqTlgLzlj6/ngrrku7vmhI/lgLw7IOW+jOe6jOWRvOWPq+S7peWFtuWOn+Wni+mMr+iqpOWbnuaHiQpmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBtZERlZmF1bHQKICAgICAgICB9CiAgICAgICAgCgogICAgLy9vbgogICAgCgogICAgLy9zYXZlCiAgICBpbnN0YW5jZSA9IHIKCn0KCmZ1bmN0aW9uIHNlbmRNZXNzYWdlKGRhdGEsIGRlc2MpIHsKICAgIHRyeSB7CiAgICAgICAgcGFyZW50UG9ydC5wb3N0TWVzc2FnZShkYXRhKQogICAgfQogICAgY2F0Y2ggKGVycikgewogICAgICAgIC8vZGF0YeWQq+eEoeazlee1kOani+WMluikh+ijveS5i+WFp+WuuSjlh73mlbjjgIFTeW1ib2znrYkp5pmCcG9zdE1lc3NhZ2XlkIzmraXmi4tEYXRhQ2xvbmVFcnJvcjog5LiN6JmV55CG5YmH5ouL5pa85ZG85Y+r6Lev5b6R5aSWLCDmlrxub2RlanPmiJB3b3JrZXLmnKrmjZXmjYnpjK/oqqTogIzltKnmvbAo5oyB5LmF6IiH5bel5bug5a+m6auU5b6e5q2k5q275LqhKSwg5pa854CP6Ka95Zmo5oiQ5pyq6JmV55CGcmVqZWN0aW9u6ICM5ZG85Y+r5rC45LmF5oe4572uOwogICAgICAgIC8v5L6d6KiK5oGv6aGe5Z6L5pS56YCB5Y+v6KSH6KO95LmL5a2X5Liy6Kqq5piOKGRlc2PngrrlhaflrrnkuYvmj4/ov7ApLCDkvb/lkbzlj6vnq6/lvpfliLDlhbflkI3ljp/lm6DkuJR3b3JrZXLnuozlj6/mnI3li5k7IOWFnOW6leWGjeWkseaVl+WNs+aUvuajhCwg5LiN5Y+v6YGe6L+0CiAgICAgICAgbGV0IG1zZyA9ICcnCiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgbXNnID0gZGVzYyArICcgY291bGQgbm90IGJlIGNsb25lZDogJyArIFN0cmluZygoZXJyICYmIGVyci5tZXNzYWdlKSB8fCBlcnIpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgICAgIGxldCBkYXRhU2FmZSA9IG51bGwKICAgICAgICBpZiAoZGF0YS5tb2RlID09PSAncmV0dXJuJykgewogICAgICAgICAgICBkYXRhU2FmZSA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5YyW5aSx5pWX5pmCaW5zdGFuY2XngrpudWxsLCDku6XliJ3lp4vljJbkuYvljp/lp4vpjK/oqqTlm57mh4ko5ZCM5bu656uL5aSx5pWX5LmL6JmV572uKSwg5LiN5b6X5bCNbnVsbOWPluWAvOiAjOW+l+iqpOWwjuS5i1R5cGVFcnJvcgogICAgICAgICAgICBpZiAoaW5pdEZhaWwpIHsKICAgICAgICAgICAgICAgIHRocm93IGluaXRGYWlsLmVycgogICAgICAgICAgICB9CgogICAgICAgICAgICAvL2Z1biwg6aCI54K65Ye95pW4LCDlkKbliYfku6XlhbflkI3oqIrmga/mi5LntZUo5LiN5b6X54K65bCNdW5kZWZpbmVk5Y+W5YC85oiW5ZG85Y+r5LmL6Kqk5bCOVHlwZUVycm9yKQogICAgICAgICAgICBsZXQgZnVuID0gKGluc3RhbmNlICE9PSBudWxsICYmIGluc3RhbmNlICE9PSB1bmRlZmluZWQpID8gaW5zdGFuY2VbZGF0YS5mdW5dIDogdW5kZWZpbmVkCiAgICAgICAgICAgIGlmICh0eXBlb2YgZnVuICE9PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2Z1bmN0aW9uWycgKyBkYXRhLmZ1biArICddIGlzIG5vdCBhIGZ1bmN0aW9uIGluIHdvcmtlcicpCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAoKICAgICAgICAgICAgLy9leGVjLCDku6Vhd2FpdOWPluWAvDog6Z2eYXN5bmPlh73mlbjlm57lgrPpnZ5wcm9taXNl5pmC5Lqm5Y+v5Lqk5LuYLCDkuI3lvpflm6Dlkbzlj6sudGhlbuiAjOWkseaVlzsg5LulUmVmbGVjdC5hcHBseeaMh+WumnRoaXMo6KaLY3RoaXMpCiAgICAgICAgICAgIG1zZyA9IGF3YWl0IFJlZmxlY3QuYXBwbHkoZnVuLCB1bmRlZmluZWQsIGlucHV0KQogICAgICAgICAgICBzdGF0ZSA9ICdzdWNjZXNzJwoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KCiAgICAgICAgLy9kZXNjLCDlm57mh4nlhaflrrnnhKHms5XntZDmp4vljJbopIfoo73mmYLlhZzlupXoqqrmmI7kuYvmj4/ov7AKICAgICAgICBsZXQgZGVzYyA9ICcnCiAgICAgICAgaWYgKHN0YXRlID09PSAnc3VjY2VzcycpIHsKICAgICAgICAgICAgZGVzYyA9ICdyZXR1cm4gdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGluaXRGYWlsKSB7CiAgICAgICAgICAgIGRlc2MgPSAnaW5pdCBlcnJvcicKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRlc2MgPSAncmVqZWN0ZWQgdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZn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vbHZlKG8sYCR7bn1fJHthfWApLHA9IiI7dHJ5e3A9YXdhaXQgRWUobmV3IEJsb2IoW2UucmVhZEZpbGVTeW5jKGwpXSkpfWNhdGNoKHQpe2NvbnRpbnVlfWh0KHUsImgiKT09PXAmJmYucHVzaChhKX1yZXR1cm57c2xrczpmfX07CgogICAgfSkuY2FsbChtZFVzZXIuZXhwb3J0cywgbWRVc2VyLCBtZFVzZXIuZXhwb3J0cykKCiAgICAvL+mgkOioreWMr+WHujogcm9sbHVw5LulX19lc01vZHVsZeaomeekuumgkOioreiIh+WFt+WQjeS4puWtmOiAhSwg5Y+W5YW2ZGVmYXVsdDsg5ZCm5YmHbW9kdWxlLmV4cG9ydHPljbPpoJDoqK3ljK/lh7oo5Y+q5pyJ5YW35ZCN5Yyv5Ye66ICF54K65ZG95ZCN56m66ZaT54mp5Lu2KQogICAgcmV0dXJuIChtZFVzZXIuZXhwb3J0cyAmJiBtZFVzZXIuZXhwb3J0cy5fX2VzTW9kdWxlICYmICdkZWZhdWx0JyBpbiBtZFVzZXIuZXhwb3J0cykgPyBtZFVzZXIuZXhwb3J0cy5kZWZhdWx0IDogbWRVc2VyLmV4cG9ydHMKCn0pKCkpCgo=",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(fs);var gs=Zn(fs.exports);function ws(e,t){try{return{ok:!0,value:t()}}catch(t){let i=Rn(t);return{ok:!1,stage:e,cause:Zi(i)?i:"unknown error"}}}function ys(e,t){try{return s.validateHeaderValue(e,t),!0}catch(e){return!1}}function Ms(e,t,i,n={}){let s=!0===ke(n,"forHead",!1);if(null==e)return{error:"invalid streamRead",reason:"streamRead is null or undefined"};let o=ws("identify streamRead",()=>e instanceof r.Readable?{isReadable:!0,objectMode:!0===e.readableObjectMode,done:!0===e.destroyed||!0===e.readableEnded}:{isReadable:!1});if(!o.ok)return{error:"invalid streamRead",reason:`${o.stage} failed: ${o.cause}`};if(o.value.isReadable){if(o.value.objectMode)return{error:"invalid streamRead",reason:"streamRead is in object mode"};if(o.value.done)return{error:"invalid streamRead",reason:"streamRead is already destroyed or ended (each download event must provide a new stream)"};if(s)return{source:e};let n=ws("setup pipeline",()=>{let n=0,s=!1,o=new r.Transform({transform(e,i,r){if(n+=e.length,n>t)return s=!0,void r(new Error(`streamRead sent more than fileSize[${t}] bytes`));r(null,e)},flush(e){if(n!==t)return s=!0,void e(new Error(`streamRead ended at ${n} bytes but fileSize is ${t}`));e()}});return r.pipeline(e,o,e=>{e&&s&&i(Rn(e))}),o});return n.ok?{source:n.value}:{error:"invalid streamRead",reason:`${n.stage} failed: ${n.cause}`}}let a=ws("materialize streamRead",()=>{if(Buffer.isBuffer(e))return{buf:e};if(e instanceof Uint8Array)return{buf:Buffer.from(e)};if(ji(e))return{buf:Buffer.from(e,"utf8")};if("number"==typeof e||Bi(e)||"object"==typeof e&&!1===function(e){try{return Mn(e.pipe)}catch(e){return null}}(e)){let t=null;try{t=JSON.stringify(e)}catch(e){return{unserializable:Rn(e)}}return"string"!=typeof t?{unserializable:""}:{buf:Buffer.from(t,"utf8")}}return{unsupported:!0}});if(!a.ok)return{error:"invalid streamRead",reason:`${a.stage} failed: ${a.cause}`};if(sr(a.value,"unserializable")){let e=a.value.unserializable;return{error:"invalid streamRead",reason:Zi(e)?`streamRead can not be serialized: ${e}`:"streamRead can not be serialized"}}if(!0===a.value.unsupported)return{error:"invalid streamRead",reason:"streamRead must be a readable stream, buffer, string, number, boolean or plain object"};let c=a.value.buf;return c.length!==t?{error:"fileSize mismatch",reason:`streamRead has ${c.length} bytes but fileSize is ${t}`}:{source:c}}let Ds=e=>"function"==typeof e.toWellFormed?e.toWellFormed():e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�");function xs(e,t){let i=ws(`check field[${e}]`,()=>{if("fileSize"===e)return function(e){return Dn(e,{useLimitSafe:!0})}(t)?{ok:!0,value:tn(t)}:{ok:!1};if("filename"===e||"fileType"===e){if(!Zi(t))return{ok:!1};let i=Qn(t);return Zi(i)?"fileType"===e?ys("Content-Type",i)?{ok:!0,value:i}:{ok:!1}:{ok:!0,value:Ds(i)}:{ok:!1}}throw new Error(`unknown field[${e}]`)});return i.ok?{ok:i.value.ok,value:i.value.value,cause:""}:{ok:!1,value:void 0,cause:i.cause}}function Is(e){try{e&&Mn(e.pipe)&&Mn(e.destroy)&&e.destroy()}catch(e){}}function Cs(e){let t=typeof e;return void 0===e||"function"===t||"symbol"===t?null:e}function bs(e,t,i={}){let n=new r.Readable;n._read=()=>{},n.push(t),n.push(null);let s=ke(i,"returnType",""),o=ke(i,"returnMsg",""),a=e.response(n).header("Cache-Control","no-cache, no-store, must-revalidate").header("Content-Type","application/octet-stream").header("Content-Length",n.readableLength);return Zi(s)&&a.header("Return-Type",s),Zi(o)&&ys("Return-Msg",o)&&a.header("Return-Msg",o),a}function vs(e,t){return 0===e.listenerCount(t)?`no listener for event[${t}]`:""}function Ls(s={}){let o={useLimitSafe:!0},a=!!ke(s,"serverHapi"),c=[],l=ke(s,"port");(!nn(l,o)||tn(l)>65535)&&(l=8080),l=tn(l);let u=ke(s,"useInert");null==u?u=!0:Bi(u)||(a||c.push("invalid useInert: must be a boolean, static files are not served"),u=!1);let p=ke(s,"pathStaticFiles");null==p?p="dist":Zi(p)||(u&&!a&&c.push("invalid pathStaticFiles: must be a non-empty string, static files are not served"),u=!1,p="dist");let d=ke(s,"pathUploadTemp");Zi(d)||(d="./uploadTemp");let m="";if(!Nn(d)){let e=vr(d);sr(e,"error")&&(m=Rn(e.error))}let h=ke(s,"apiName");Zi(h)||(h="api");let f=ke(s,"tokenType");Zi(f)||(f="Bearer");let g=ke(s,"sizeSlice");nn(g,o)||(g=1048576),g=tn(g);let w=ke(s,"sizeMsg");nn(w,o)||(w=104857600),w=tn(w);let y=ke(s,"verifyConn");if(null==y)y=()=>!0;else{let e=!1;try{e=Mn(y)}catch(e){}e||(c.push("invalid verifyConn: must be a function (sync or async), all API requests will be denied"),y=()=>!1)}let M="invalid corsOrigins: must be an array of origin strings ('*' must be the only element if present), or false to disable; CORS is disabled",D=ke(s,"corsOrigins"),x=null!=D;x?a?c.push("corsOrigins has no effect with serverHapi: the cross-origin policy is decided by the external server"):!1===D||""===D?D=null:Zi(D)?D=[D]:rn(D)?(D=D.filter(e=>""!==e),0===D.length&&(D=null)):(c.push(M),D=null):D=["*"];let I=ke(s,"delayForSlice","");(!Dn(I,o)||tn(I)>2147483647)&&(I=100),I=tn(I);let C=null;if(a)C=s.serverHapi;else{let e=e=>{let t=!1;return null!==e&&(t={origin:e,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}),{port:l,routes:{timeout:{server:!1,socket:!1},cors:t}}};try{C=i.server(e(D))}catch(t){if(!x||null===D)throw t;console.log("invalid corsOrigins",t),c.push(M),D=null,C=i.server(e(D))}}let b=Gn(),v={tag:"w-converhp"},L=(e,...t)=>Fn(b,e,t,{...v,funSettle:()=>{let i=t[t.length-1];vn(i)&&i.reject(`listener of event[${e}] error`)},funEmit:A}),E=(e,...t)=>On(b,e,t,{...v,funEmit:A});function A(e,...t){if("error"===e&&ki(t[0])&&"listener"===t[0].fun){let e=ke(t[0],"name",""),i=ke(t[0],"msg");return console.log(`listener of event[${e}] error`,i),b.emit("error",`listener of event[${e}] error: ${Rn(i)}`)}return b.emit(e,...t)}Zi(m)&&E("error",`create pathUploadTemp[${d}] error: ${m}`);for(let e of c)E("error",e);let N=(e,t,i)=>{let n=bn(),r=bn();return r.then(t=>{void 0===t&&(t=null);let r=typeof t;if("function"===r||"symbol"===r)return n.reject("output can not be serialized"),void L("error",`event[${e}] output can not be serialized: output is a ${r}`);n.resolve(Mn(i)?i(t):t)}).catch(e=>{n.reject(e)}),function(e,t,i,n,r,s){let o=vs(e,i);Zi(o)?(r.reject(o),s(o)):t(i,...n,r)}(b,L,e,t,r,e=>{L("error",e)}),n};async function S(e){return N("upload",[e])}async function T(e){return N("download",[e])}let k=`${Qn(f)} `,j=(e,t)=>{let i=ke(e,"headers");i=ki(i)?i:"";let n=ke(e,"query");n=ki(n)?n:"";let r="",s="";return"query"===t.authFrom?(s=ke(n,"token",""),s=Zi(s)?s:"",Zi(s)&&(r=`${f} ${s}`)):(r=ke(i,"authorization",""),r=Zi(r)?r:"",s=r.startsWith(k)?r.slice(k.length):""),{headers:i,query:n,authorization:r,token:s}},Z=(e,t)=>{let i=(i,n,r)=>function(e,t,i={}){Zi(t)||(console.log("msg",t),console.log("msg is not an effective string, set msg=''"),t="");let n=ke(i,"retryable",!0),r={error:t};!1===n&&(r.retryable=!1);let s=bs(e,Mr(r),{returnType:"error",returnMsg:t});return!1===n&&s.header("Return-Retryable","false"),s}(e,n,r).code(t.statusOf[i]);return{permission:()=>i("permission","permission denied"),param:e=>i("param",e,{retryable:!1}),app:e=>i("app",e),output:e=>i("output",e),packet:e=>i("packet",e),internal:e=>i("internal",e)}},z=async(e,t,i,n)=>!0!==await async function(e){let t=!1;try{t=y(e),vn(t)&&(t=await t)}catch(i){t=!1,console.log(`verifyConn error for apiType[${ke(e,"apiType","")}]`,i),L("error",`verifyConn error for apiType[${ke(e,"apiType","")}]: ${Rn(i)}`)}return!0===t}({apiType:i.apiType,authorization:t.authorization,query:t.query,headers:t.headers,req:e})?n.permission():(L("handler",{api:i.api,headers:t.headers,query:t.query}),null),Y=(e,t)=>{let i=vs(b,e.event);if(!Zi(i))return null;let n=t.app(i);return L("error",i),n},X=(e,t,i,n)=>{let r=function(e,t){let i={};for(let n of t){let t=ws(`read field[${n}]`,()=>ke(e,n));if(!t.ok)return{ok:!1,field:n,cause:t.cause,fields:i};i[n]=t.value}return{ok:!0,fields:i}}(e,i.fields.map(e=>e.name));if(!r.ok)return Is(ke(r.fields,"streamRead")),L("error",`download fileId[${t}] output error: can not read field[${r.field}]: ${r.cause}`),{ok:!1,res:n.output("invalid streamRead")};let s={streamRead:r.fields.streamRead};for(let e of i.fields){if("streamRead"===e.name)continue;let i=xs(e.name,r.fields[e.name]);if(i.ok){s[e.name]=i.value;continue}if(!0===e.optional&&!Zi(i.cause)){s[e.name]="";continue}Is(s.streamRead);let o="fileSize"===e.name?`[${Rn(r.fields.fileSize)}]`:"";return L("error",`download fileId[${t}] output error: invalid ${e.name}${o}${Zi(i.cause)?`: ${i.cause}`:""}`),{ok:!1,res:n.output(`invalid ${e.name}`)}}return{ok:!0,v:s}},G=async(e,t,i,n)=>{let r={},s="";await i.then(e=>{r.success=e,s="success"}).catch(e=>{r.error=e,s="error"});let o=function(e,t){let i={};for(let t of Object.keys(e))i[t]=Cs(e[t]);let n=Mr(i,{returnWithStateAndMsg:!0});return"success"!==ke(n,"state")?(t(ke(n,"msg","unknown error")),null):n.msg}(r,e=>{L("error",`${n} output can not be serialized: ${e}`)});return null===o?t.internal("output can not be serialized"):bs(e,o,{returnType:s,returnMsg:"need to parse"})},F=e=>(t,i,n)=>{if(413===ke(n,"output.statusCode"))throw n;return L("error",`invalid request packet for ${e.api}: ${Rn(n)}`),Z(i,e).packet("invalid request packet").takeover()},W={path:`/${h}/main`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.main,n=Z(t,i),s=j(e,i),o=await z(e,s,i,n);if(o)return o;let a=null;try{a=await(()=>{let t=bn(),i=[],n=0,s=!1,o=new r.Writable({write(e,t,r){if(n+=e.length,n>w)return i=[],s=!0,void r();i.push(e),r()}});return o.on("finish",()=>{}),e.payload.pipe(o),e.payload.on("end",()=>{if(s)return void t.reject("payload too large");let e=Buffer.concat(i);i=[],t.resolve(e)}),e.payload.on("close",()=>{}),e.payload.on("error",e=>{console.log("apiMain req.payload err",e),L("error",`receive payload error: ${Rn(e)}`),t.reject(`receive payload error: ${Rn(e)}`)}),e.payload.destroyed&&(L("error","receive payload error: closed before receive"),t.reject("receive payload error: closed before receive")),t})()}catch(e){if("payload too large"===e)return t.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${w}`}).code(413);throw e}let c=Cr(new Uint8Array(a),{returnWithStateAndMsg:!0});if("success"!==ke(c,"state")||!ki(c.msg)){let e=Rn(ke(c,"msg",""));return L("error",`invalid request packet for apiMain: ${Zi(e)?e:"not an effective object"}`),n.packet("invalid request packet")}let l=c.msg;return G(t,n,async function(e){return N("execute",[ke(e,"func",""),ke(e,"input",null)],t=>(e.output=t,delete e.input,e))}(l),`execute func[${Rn(ke(l,"func",""))}]`)}},O={path:`/${h}/ulctr`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:F(Nr.ulctr)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.ulctr,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.mode","");if("check-total-hash"!==o&&"check-slices-hash"!==o&&"merge-slices-push"!==o&&"merge-slices-get"!==o)return n.param(`invalid mode[${Rn(o)}] in payload`);let a=ke(e,"payload.fileHash","");if(!Er(a))return n.param("invalid fileHash in payload");let c=ke(e,"payload.chunkTotal","");if("merge-slices-push"===o){if(!nn(c))return n.param("invalid chunkTotal in payload");c=tn(c)}if("merge-slices-get"!==o){let e=Y(i,n);if(e)return e}let l=ke(e,"payload.filename",""),u=function(e,t="unknown"){if(!Zi(e))return t;let i=e.replace(/\\/g,"/").split("/").filter(e=>""!==e&&"."!==e&&".."!==e).pop()||"";return i=i.replace(/[\x00-\x1f\x7f<>:"|?*]/g,"_"),i=i.replace(/[. ]+$/g,""),/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i.test(i)&&(i=`_${i}`),""===i?t:i}(l,""),p=e=>ki(e)&&sr(e,"error")?`${o}: ${Qn(e.error)}`:"",m=async(e,t)=>{try{return await t()}catch(t){return L("error",`upload-controller mode[${o}] ${e} error: ${Rn(t)}`),Promise.reject(`${o} failed`)}};return G(t,n,(async()=>{let t=null;if("check-total-hash"===o){let i=ke(e,"payload.fileSize","");t=await m("check total hash",()=>hs(i,g,a,d));let n=p(t);if(Zi(n))return Promise.reject(n);if(t.bAllHash){let e={from:"check-total-hash",filename:l,filenameSafe:u,path:t.path},i=await S(e);t={...t,msg:i}}delete t.path,t.sizeSlice=g}else if("check-slices-hash"===o){let i=ke(e,"payload.fileSliceHashs",[]);t=await m("check slices hash",()=>gs(i,a,d));let n=p(t);if(Zi(n))return Promise.reject(n)}else if("merge-slices-push"===o){t={queueId:await m("push merge task",()=>ps(a,c,d))}}else if("merge-slices-get"===o){let i=ke(e,"payload.queueId",""),n=await ds(i,d,{funConsume:async e=>await S({from:"merge-slices-get",filename:l,filenameSafe:u,path:e}),funLog:e=>{L("error",e)}});t={state:n.state,msg:n.msg,queueId:i,filename:l},"error"===n.state&&Zi(n.reason)&&L("error",`${n.msg} for fileHash[${a}]: ${n.reason}`)}return t})(),`upload-controller mode[${o}]`)}},P={path:`/${h}/slc`,method:"POST",options:{payload:{maxBytes:g,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(i,n){let r=Nr.slc,s=Z(n,r),o=j(i,r),a=await z(i,o,r,s);if(a)return a;let c=ke(o.headers,"chunk-index",""),l=ke(o.headers,"chunk-total",""),u=ke(o.headers,"package-id","");if(!Dn(c))return s.param("invalid chunkIndex in headers");if(c=tn(c),!Dn(l))return s.param("invalid chunkTotal in headers");if(l=tn(l),!Er(u))return s.param("invalid packageId in headers");let p=Y(r,s);if(p)return p;let m=e.resolve(d,`${u}_${c}`),h=t.createWriteStream(m),f=()=>{let e=bn(),t=0,n=!1,r=!1,s=!1,o=!1;h.on("error",t=>{r||n||s||(r=!0,i.payload.unpipe(h),i.payload.resume(),console.log(`apiUploadSlice streamWrite chunk[${c+1}/${l}] of packageId[${u}] err`,t),L("error",`write chunk[${c+1}/${l}] of packageId[${u}] error: ${Rn(t)}`),e.reject(`write chunk[${c+1}/${l}] of packageId[${u}] error`))}),h.on("close",()=>{n||r||s?Lr(m):o&&!0===h.writableFinished&&setTimeout(()=>{e.resolve(`chunk[${c+1}/${l}] of packageId[${u}] done`)},I)}),i.payload.on("data",e=>{n||(t+=e.length,t>g&&(n=!0,i.payload.unpipe(h),i.payload.resume(),h.destroy()))}),i.payload.pipe(h),i.payload.on("end",()=>{o=!0,r||n&&e.reject("payload too large")});let a=t=>{s||o||r||(s=!0,h.destroy(),L("error",`receive chunk[${c+1}/${l}] of packageId[${u}] error: ${t}`),e.reject(`receive chunk[${c+1}/${l}] of packageId[${u}] error: ${t}`))};return i.payload.on("error",e=>{console.log(`apiUploadSlice req.payload chunk[${c+1}/${l}] of packageId[${u}] err`,e),a(Rn(e))}),i.payload.on("close",()=>{a("closed before end")}),i.payload.destroyed&&a("closed before receive"),e},w={},y="",M="";try{let e=await f();w.success=e,y="success",M="need to parse"}catch(e){if("payload too large"===e)return n.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${g}`}).code(413);w.error=e,y="error",M="need to parse"}return bs(n,Mr(w),{returnType:y,returnMsg:M})}},K={path:`/${h}/dwgfn`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:F(Nr.dwgfn)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.dwgfn,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.fileId","");if(!Zi(o))return n.param("invalid fileId in payload");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);return l.ok?(Is(l.v.streamRead),G(t,n,Promise.resolve({filename:l.v.filename}),`download fileId[${o}]`)):l.res}},H={path:`/${h}/dwgf`,method:"GET",options:{timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Nr.dwgf,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(r.query,"fileId","");if(o=Zi(o)?o:"",!Zi(o))return n.param("invalid fileId in query");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=l.v.fileSize,d=l.v.fileType,m=l.v.filename,h=Ms(u,p,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===Qn(ke(e,"method","")).toLowerCase()});if(h.error)return Is(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error);let f=t.response(h.source).type(d).header("Content-Encoding","identity").header("Content-Length",p).header("Content-Disposition",Zi(m)?`attachment; filename*=UTF-8''${function(e){let t=Array.from(Qn(e)),i="";for(let e of t){let t="";try{t=encodeURIComponent(e)}catch(e){t="%EF%BF%BD"}i+=t}return i.replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}(m)}`:"attachment");return f}},U={path:`/${h}/dw`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:F(Nr.dw)},timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Nr.dw,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.fileId","");if(!Zi(o))return n.param("invalid fileId in payload");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=function(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!Zi(e))return n("invalid str");let r="";try{let t=ir.parse(e);r=rr.stringify(t)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}(l.v.filename),d=l.v.fileSize,m=l.v.fileType,h=Ms(u,d,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===Qn(ke(e,"method","")).toLowerCase()});return h.error?(Is(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error)):t.response(h.source).type(m).header("Content-Encoding","identity").header("Content-Disposition",`attachment; filename="${p}"`).header("Content-Length",d)}};let B=null;if(a)try{C.route([W,O,P,K,H,U])}catch(e){console.log("register routes error",e),E("error",`register routes error: ${Rn(e)}`)}else B=async function(){u&&await C.register(n);let e=[];if(u){let t={method:"GET",path:"/{file*}",handler:{directory:{path:`${p}/`}}};e=[...e,t]}e=[...e,W,O,P,K,H,U],C.route(e),await C.start(),console.log(`Server running at: ${C.info.uri}`)}().catch(e=>{console.log("start server error",e),E("error",`start server error: ${Rn(e)}`)});return b.stop=async()=>{try{vn(B)&&await B,await C.stop()}catch(e){console.log("stop server error",e),L("error",`stop server error: ${Rn(e)}`)}},b}function Es(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYY-MM-DDTHH:mm:ssZ")}var As=function(){return j.Date.now()},Ns=Math.max,Ss=Math.min;function Ts(e,t,i){var n,r,s,o,a,c,l=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=n,s=r;return n=r=void 0,l=t,o=e.apply(s,i)}function h(e){var i=e-c;return void 0===c||i>=t||i<0||p&&e-l>=s}function f(){var e=As();if(h(e))return g(e);a=setTimeout(f,function(e){var i=t-(e-c);return p?Ss(i,s-(e-l)):i}(e))}function g(e){return a=void 0,d&&n?m(e):(n=r=void 0,o)}function w(){var e=As(),i=h(e);if(n=arguments,r=this,c=e,i){if(void 0===a)return function(e){return l=e,a=setTimeout(f,t),u?m(e):o}(c);if(p)return clearTimeout(a),a=setTimeout(f,t),m(c)}return void 0===a&&(a=setTimeout(f,t)),o}return t=Pi(t)||0,V(i)&&(u=!!i.leading,s=(p="maxWait"in i)?Ns(Pi(i.maxWait)||0,t):s,d="trailing"in i?!!i.trailing:d),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=r=a=void 0},w.flush=function(){return void 0===a?o:g(As())},w}var ks=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),js=ks;function Zs(e,t,i){"__proto__"==t&&js?js(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function zs(e,t,i){(void 0!==i&&!de(e[t],i)||void 0===i&&!(t in e))&&Zs(e,t,i)}var Ys="object"==typeof exports&&exports&&!exports.nodeType&&exports,Xs=Ys&&"object"==typeof module&&module&&!module.nodeType&&module,Gs=Xs&&Xs.exports===Ys?j.Buffer:void 0,Fs=Gs?Gs.allocUnsafe:void 0;function Ws(e,t){if(t)return e.slice();var i=e.length,n=Fs?Fs(i):new e.constructor(i);return e.copy(n),n}function Os(e){var t=new e.constructor(e.byteLength);return new ii(t).set(new ii(e)),t}function Ps(e,t){var i=t?Os(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Ks(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}var Hs=Object.create,Us=function(){function e(){}return function(t){if(!V(t))return{};if(Hs)return Hs(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Bs(e){return"function"!=typeof e.constructor||Ze(e)?{}:Us(pn(e))}function Vs(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _s=Object.prototype.hasOwnProperty;function Rs(e,t,i){var n=e[t];_s.call(e,t)&&de(n,i)&&(void 0!==i||t in e)||Zs(e,t,i)}function Qs(e,t,i,n){var r=!i;i||(i={});for(var s=-1,o=t.length;++s<o;){var a=t[s],c=n?n(i[a],e[a],a,i,e):void 0;void 0===c&&(c=e[a]),r?Zs(i,a,c):Rs(i,a,c)}return i}var Js=Object.prototype.hasOwnProperty;function qs(e){if(!V(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Ze(e),i=[];for(var n in e)("constructor"!=n||!t&&Js.call(e,n))&&i.push(n);return i}function $s(e){return it(e)?Ut(e,!0):qs(e)}function eo(e,t,i,n,r,s,o){var a=Vs(e,i),c=Vs(t,i),l=o.get(c);if(l)zs(e,i,l);else{var u,p=s?s(a,c,i+"",e,t,o):void 0,d=void 0===p;if(d){var m=S(c),h=!m&&jt(c),f=!m&&!h&&Kt(c);p=c,m||h||f?S(a)?p=a:P(u=a)&&it(u)?p=Ks(a):h?(d=!1,p=Ws(c,!0)):f?(d=!1,p=Ps(c,!0)):p=[]:wn(c)||Nt(c)?(p=a,Nt(a)?p=function(e){return Qs(e,$s(e))}(a):V(a)&&!_(a)||(p=Bs(c))):d=!1}d&&(o.set(c,p),r(p,c,n,s,o),o.delete(c)),zs(e,i,p)}}function to(e,t,i,n,r){e!==t&&Ct(t,function(s,o){if(r||(r=new Jt),V(s))eo(e,t,o,i,to,n,r);else{var a=n?n(Vs(e,o),s,o+"",e,t,r):void 0;void 0===a&&(a=s),zs(e,o,a)}},$s)}var io=Math.max;var no=js?function(e,t){return js(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ei,ro=no,so=Date.now;var oo=function(e){var t=0,i=0;return function(){var n=so(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ro),ao=oo;function co(e,t){return ao(function(e,t,i){return t=io(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,s=io(n.length-t,0),o=Array(s);++r<s;)o[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i(o),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,a)}}(e,t,Ei),e+"")}var lo,uo=(lo=function(e,t,i){to(e,t,i)},co(function(e,t){var i=-1,n=t.length,r=n>1?t[n-1]:void 0,s=n>2?t[2]:void 0;for(r=lo.length>3&&"function"==typeof r?(n--,r):void 0,s&&Si(t[0],t[1],s)&&(r=n<3?void 0:r,n=1),e=Object(e);++i<n;){var o=t[i];o&&lo(e,o,i,r)}return e}));function po(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Zi(e))return n("invalid v");let r={};try{r=JSON.parse(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}let mo="w-sync-webdata";function ho(e,i={}){let n={},r=!1,s=!1,o=null;if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Gn()),!sr(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let a=ke(i,"fpTableTags","");Zi(a)||(a="./tableTags.json");let c=ke(i,"genTag");Mn(c)||(c=()=>Es()+"|"+Zr(6));let{emit:l,emitNow:u,clear:p}=function(e,t){let i=t=>Mn(e.listenerCount)?e.listenerCount(t):1,n={emit:(t,...i)=>e.emit(t,...i),listenerCount:i},r=(t,...n)=>{if("error"!==t)return e.emit(t,...n);let r=n[0];return Ti(r)&&"listener"===r.fun&&(r={msg:`listener of event[${r.name}] error`,err:r.msg}),0===i("error")?(console.error(`[${mo}]`,r),!1):e.emit("error",r)},s=new Set,o=(e,t,i)=>{let r=null,o=i.funEmit;r=On(n,e,t,{...i,tag:mo,funEmit:(e,...t)=>(s.delete(r),o(e,...t))}),s.add(r)};return{emit:(e,...i)=>{t()||o(e,i,{funEmit:(e,...i)=>!t()&&r(e,...i)})},emitPm:(n,s,a={})=>{let c=s.pm;if(t())return;let l=!1,u=!1,p=c.resolve,d=c.reject;c.resolve=e=>{l=!0,p(e)},c.reject=e=>{l=!0,d(e)},o(n,[s],{funSettle:e=>{l||(l=!0,u=!0,d(e))},funEmit:(s,...o)=>s!==n?!!u||!t()&&r(s,...o):!t()&&(!Mn(a.beforeDispatch)||!1!==a.beforeDispatch())&&(0===i(s)?(l=!0,u=!0,d(new Error(`no listener for event[${s}]`)),!1):e.emit(s,...o))})},emitNow:(e,...t)=>Fn(n,e,t,{tag:mo,funEmit:r}),clear:()=>{s.forEach(e=>{clearTimeout(e)}),s.clear()}}}(e,()=>r);function d(){let e={};try{if(t.existsSync(a)){let i=po(t.readFileSync(a,"utf8"));ki(i)&&(e=i)}}catch(e){l("error",{msg:"readTableTags catch",err:e})}return e}let m=()=>{let e=function(e,t=!1,i={}){let n=ke(i,"returnWithStateAndMsg",null);Bi(n)||(n=!1);let r=e=>n?{state:"error",msg:e}:"";if(sn(e))return r("invalid v");let s="";try{s=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){return r(cr(e))}return n?{state:"success",msg:s}:s}(n,!1,{returnWithStateAndMsg:!0});if("success"!==ke(e,"state"))return new Error(`can not serialize tableTags: ${ke(e,"msg")}`);try{t.writeFileSync(a,e.msg,"utf8")}catch(e){return e}return o=e.msg,s=!1,null};function h(){if(r)return;let e=m();e&&l("error",{msg:"writeTableTags catch",err:e})}let f=Ts(()=>{h(),l("changeTableTags",n)},200);return e.readTableTags=d,e.writeTableTags=h,e.initTableTags=function(e={},t="useInputFirst"){if(!r)if(null===e&&(e={}),Ti(e)){if("useInputOnly"===t)n=e;else if("useStorageOnly"===t)n=d();else if("useInputFirst"===t)n=uo(d(),e);else{if("useStorageFirst"!==t)throw new Error(`invalid mode[${t}]`);n=uo(e,d())}h()}else l("error",{msg:"invalid tableTags for initTableTags",err:e})},e.setTableTags=function(e={}){r||(null===e&&(e={}),Ti(e)?(n=uo(n,e),h()):l("error",{msg:"invalid tableTags for setTableTags",err:e}))},e.getTableTags=function(){return n},e.updateTableTag=function(e){r||(Zi(e)?(n[e]=c(),s=!0,f()):l("error",{msg:"invalid tableName",err:e}))},e.clearSync=function(){if(r)return;f.cancel();let e=null;if(s){let i=null;try{t.existsSync(a)&&(i=t.readFileSync(a,"utf8"))}catch(e){i=void 0}null!==i&&i!==o||(e=m())}r=!0,p(),e&&u("error",{msg:"writeTableTags catch",err:e})},e}var fo=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ai(t,mi(e)),e=pn(e);return t}:ui;function go(e){return ci(e,$s,fo)}var wo=Object.prototype.hasOwnProperty;var yo=/\w*$/;var Mo=Z?Z.prototype:void 0,Do=Mo?Mo.valueOf:void 0;function xo(e,t,i){var n,r,s,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Os(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var i=t?Os(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ps(e,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(s=new(r=e).constructor(r.source,yo.exec(r))).lastIndex=r.lastIndex,s;case"[object Symbol]":return n=e,Do?Object(Do.call(n)):{}}}var Io=Ot&&Ot.isMap,Co=Io?Xt(Io):function(e){return P(e)&&"[object Map]"==et(e)};var bo=Ot&&Ot.isSet,vo=bo?Xt(bo):function(e){return P(e)&&"[object Set]"==et(e)},Lo="[object Arguments]",Eo="[object Function]",Ao="[object Object]",No={};function So(e,t,i,n,r,s){var o,a=1&t,c=2&t,l=4&t;if(i&&(o=r?i(e,n,r,s):i(e)),void 0!==o)return o;if(!V(e))return e;var u=S(e);if(u){if(o=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&wo.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!a)return Ks(e,o)}else{var p=et(e),d=p==Eo||"[object GeneratorFunction]"==p;if(jt(e))return Ws(e,a);if(p==Ao||p==Lo||d&&!r){if(o=c||d?{}:Bs(e),!a)return c?function(e,t){return Qs(e,fo(e),t)}(e,function(e,t){return e&&Qs(t,$s(t),e)}(o,e)):function(e,t){return Qs(e,mi(e),t)}(e,function(e,t){return e&&Qs(t,Bt(t),e)}(o,e))}else{if(!No[p])return r?e:{};o=xo(e,p,a)}}s||(s=new Jt);var m=s.get(e);if(m)return m;s.set(e,o),vo(e)?e.forEach(function(n){o.add(So(n,t,i,n,e,s))}):Co(e)&&e.forEach(function(n,r){o.set(r,So(n,t,i,r,e,s))});var h=u?void 0:(l?c?go:hi:c?$s:Bt)(e);return or(h||e,function(n,r){h&&(n=e[r=n]),Rs(o,r,So(n,t,i,r,e,s))}),o}No[Lo]=No["[object Array]"]=No["[object ArrayBuffer]"]=No["[object DataView]"]=No["[object Boolean]"]=No["[object Date]"]=No["[object Float32Array]"]=No["[object Float64Array]"]=No["[object Int8Array]"]=No["[object Int16Array]"]=No["[object Int32Array]"]=No["[object Map]"]=No["[object Number]"]=No[Ao]=No["[object RegExp]"]=No["[object Set]"]=No["[object String]"]=No["[object Symbol]"]=No["[object Uint8Array]"]=No["[object Uint8ClampedArray]"]=No["[object Uint16Array]"]=No["[object Uint32Array]"]=!0,No["[object Error]"]=No[Eo]=No["[object WeakMap]"]=!1;function To(e){return So(e,5)}function ko(e={}){let t=Gn(),i=Object.create(null),n=null,r=new Set,s=new Set,o=!1,a=ke(e,"timeAlive");nn(a)||(a=1e4),a=tn(a),a=Math.min(a,Wn);let c=ke(e,"timeDetect");return nn(c)||(c=50),c=tn(c),c=Math.min(c,Wn),t.trigger=function(e,l){if(!o)if(Zi(e)){if(!sr(i,e)){let n=setTimeout(()=>{r.delete(n),sr(i,e)&&s.add(e),Fn(t,"message",[{eventName:"enter",key:e,data:l,now:Dt(i)}],{tag:"alive"})},1);r.add(n)}i[e]={data:l,time:Date.now()},o||null===n&&(n=setInterval(()=>{ar(i,(e,n)=>{if(Date.now()-e.time>a){let e=To(i[n]);if(delete i[n],s.delete(n),Fn(t,"message",[{eventName:"leave",key:n,data:e.data,now:Dt(i)}],{tag:"alive"}),o)return!1}}),o||ki(i)||(clearInterval(n),n=null)},c))}else console.log("trigger need key")},t.get=function(){let e=[];return ar(i,(t,i)=>{e.push({key:i,data:t.data})}),e=To(e),e},t.clear=function(){if(o)return[];o=!0,null!==n&&(clearInterval(n),n=null);for(let e of r)clearTimeout(e);r.clear();let e=[];return ar(i,(t,i)=>{s.has(i)&&e.push({key:i,data:t.data})}),e=To(e),i=Object.create(null),s.clear(),e},t}function jo(e,t={}){let i=t.isCleared;Mn(i)||(i=()=>!1);let n=t.onDeliver;Mn(n)||(n=null);let r=e=>{console.error(`[w-serv-broadcast] ${e.msg}`,e.err)},s=t=>(s,...o)=>{let a=o[0];if("error"===s&&ki(a)&&"listener"===a.fun){let t={msg:`listener of event[${a.name}] error`,err:a.msg};return i()?(r(t),!1):e.emit("error",t)}return(!t||!i())&&("error"===s&&0===(t=>Mn(e.listenerCount)?e.listenerCount(t):1)("error")?(r(a),!1):(null!==n&&n(s,o),e.emit(s,...o)))},o=s(!0),a=s(!1),c=(t,...n)=>{i()||On(e,t,n,{tag:"w-serv-broadcast",funEmit:o})};return c.final=(t,...i)=>{On(e,t,i,{tag:"w-serv-broadcast",funEmit:a})},c}function Zo(e,t={}){if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Gn()),!sr(e,"emit")||!Mn(e.on)||!Mn(e.off))throw new Error("instWConverServer is not an EventEmitter");let i=new Map,n=!1,r=new Map,s=jo(e,{isCleared:()=>n,onDeliver:(e,t)=>{"clientEnter"===e?r.set(t[0],t[1]):"clientLeave"===e&&r.delete(t[0])}}),o=ko();o.on("message",function({eventName:e,key:t,data:i,now:n}){"enter"===e?s("clientEnter",t,i):"leave"===e&&(r.has(t)&&r.set(t,i),s("clientLeave",t,i)),s("clientChange",n)});let a=function(e,t,r){if(!n&&"[sys:polling]"===e)try{let e=ke(t,"clientId");if(!Zi(e))return void r.reject("[sys:polling] invalid clientId");let n=i.get(e)||[];i.set(e,[]),o.trigger(e,t),r.resolve(n)}catch(e){s("error",{msg:"[sys:polling] error",err:e}),r.reject("[sys:polling] error")}},c=null;return e.getClients=o.get,e.getMessages=()=>Object.fromEntries(Array.from(i,([e,t])=>[e,To(t)])),e.broadcast=e=>{if(n)return;let t={mode:"broadcast",data:To(e)};i.forEach(e=>{e.push(t)})},e.clearBroadcast=()=>{if(n)return;n=!0,null!==c&&(clearInterval(c),c=null),e.off("execute",a);let t=new Map(Yr(o.get(),e=>[e.key,e.data]));o.clear();let l=r.size;for(let[e,i]of Array.from(r))l--,s.final("clientLeave",e,t.has(e)?t.get(e):i),s.final("clientChange",l);r.clear(),i=new Map},e.on("execute",a),c=setInterval(()=>{let e=new Set(Yr(o.get(),"key"));for(let t of Array.from(i.keys()))e.has(t)||i.delete(t)},1e3),e}let zo=(e,t)=>{let i={};return ar(e,e=>{let n=e,r=ke(t,e,"");Zi(r)&&(i[n]=r)}),i};function Yo(e){ar(e,({ev:e,name:t,h:i})=>{try{Mn(e.removeListener)?e.removeListener(t,i):Mn(e.off)&&e.off(t,i)}catch(e){}})}function Xo(e,t){return 0!==Dt(e)&&(!!ki(t)&&(ar(e,e=>{let i=t[e];if(!i)throw new Error(`invalid kpOrm[${e}]`);if(!Mn(i.on))throw new Error(`kpOrm[${e}] can not listen to change events`)}),!0))}function Go(e,t,i,n={}){if(!ki(e))throw new Error("invalid instWConverServer");if(!Xo(t,i))return e;let r=ke(n,"genTag");Mn(r)||(r=()=>Es()+"|"+Zr(6));let s={};ar(t,e=>{s[e]=r()}),ar(s,e=>{if(!Zi(e))throw new Error("invalid opt.genTag")});let o=[];try{ar(t,t=>{let n=i[t],r=()=>{e.updateTableTag(t)};try{n.on("change",r)}catch(e){throw new Error(`kpOrm[${t}] can not listen to change events`)}o.push({ev:n,name:"change",h:r})});let n=i=>{e.broadcast({mode:"syncKpTable",data:zo(t,i)})};e.on("changeTableTags",n),o.push({ev:e,name:"changeTableTags",h:n})}catch(e){throw Yo(o),e}let a=e.clearSync;return e.clearSync=()=>{Yo(o),o=[],a()},e.initTableTags(s,"useInputOnly"),e}function Fo(e,t){return!!(null==e?0:e.length)&&Wr(e,t,0)>-1}function Wo(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}var Oo=Oe&&1/ri(new Oe([,-0]))[1]==1/0?function(e){return new Oe(e)}:function(){};function Po(e){return e&&e.length?function(e,t,i){var n=-1,r=Fo,s=e.length,o=!0,a=[],c=a;if(i)o=!1,r=Wo;else if(s>=200){var l=t?null:Oo(e);if(l)return ri(l);o=!1,r=ei,c=new qt}else c=t?[]:a;e:for(;++n<s;){var u=e[n],p=t?t(u):u;if(u=i||0!==u?u:0,o&&p==p){for(var d=c.length;d--;)if(c[d]===p)continue e;t&&c.push(p),a.push(u)}else r(c,p,i)||(c!==a&&c.push(p),a.push(u))}return a}(e):[]}function Ko(e,t,i,n){for(var r=i-1,s=e.length;++r<s;)if(n(e[r],t))return r;return-1}var Ho=Array.prototype.splice;function Uo(e,t){return e&&e.length&&t&&t.length?function(e,t,i,n){var r=n?Ko:Wr,s=-1,o=t.length,a=e;for(e===t&&(t=Ks(t)),i&&(a=be(e,Xt(i)));++s<o;)for(var c=0,l=t[s],u=i?i(l):l;(c=r(a,u,c,n))>-1;)a!==e&&Ho.call(a,c,1),Ho.call(e,c,1);return e}(e,t):e}let Bo=["__proto__","constructor","prototype"];function Vo(e){return S(t=e)?be(t,Se):K(t)?[t]:Ks(Ce(Ae(t)));var t}function _o(e){let t=Vo(e);if(0===t.length)return!1;for(let e of t)if(""===e||Bo.includes(e))return!1;return!0}const Ro=/^[\p{L}_][\p{L}\p{M}\p{N}_]*$/u,Qo=["prototype","length"];function Jo(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return(t===Object.prototype||null===t)&&(0===Object.getOwnPropertySymbols(e).length&&Object.getOwnPropertyNames(e).length===Object.keys(e).length)}function qo(e){return"string"==typeof e?e.length<=1024&&e.indexOf("\0")<0:"boolean"==typeof e||"number"==typeof e&&Number.isFinite(e)}function $o(e,t={}){try{return function(e,t){let i=e=>({ok:!1,reason:e});if(void 0===e)return!0===t.requireKey?i("emptyFind"):{ok:!0,find:e};if(!Jo(e))return i("notObject");let n=Object.keys(e);if(n.length>64)return i("tooManyKeys");if(!0===t.requireKey&&0===n.length)return i("emptyFind");let r={},s=0;for(let t of n){if(t.length>128||Qo.includes(t)||t in Object.prototype||!Ro.test(t))return i("badKey");let n=e[t];if(qo(n))r[t]=n;else{if(!Jo(n))return i("badValue");{let e=Object.keys(n);if(1!==e.length||"$in"!==e[0])return i("badOperator");let o=n.$in;if(!Array.isArray(o)||Object.getOwnPropertySymbols(o).length>0)return i("badIn");let a=o.length;if(s+=a,s>1e3)return i("tooManyIn");if(Object.getOwnPropertyNames(o).length!==a+1)return i("badIn");let c=[];for(let e=0;e<a;e++){if(!Object.prototype.hasOwnProperty.call(o,e))return i("badIn");let t=o[e];if(!qo(t))return i("badIn");c.push(t)}r[t]=Object.freeze({$in:Object.freeze(c)})}}}return{ok:!0,find:Object.freeze(r)}}(e,t)}catch(e){return{ok:!1,reason:"notObject"}}}let ea=e=>null!=e,ta=["select","delAll"];function ia(e={}){let t=ke(e,"getUserIdByToken",null);if(ea(t)&&!Mn(t))throw new Error("invalid opt.getUserIdByToken");Mn(t)||(t=async()=>"");let i=ke(e,"useDbOrm",null);Bi(i)||(i=!1);let n=null;if(i&&(n=ke(e,"operOrm",null),!Mn(n)))throw new Error("invalid opt.operOrm when useDbOrm=true");let r=[];if(i){if(r=ke(e,"tableNames",null),!rn(r))throw new Error("invalid opt.tableNamesExec when useDbOrm=true");ar(r,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.tableNamesExec[${t}] when useDbOrm=true`)}),r=[...r]}let s=[];if(i){if(s=ke(e,"methods",null),null===s)s=["select","insert","save","del"];else if(!rn(s))throw new Error("invalid opt.methodsExec when useDbOrm=true");ar(s,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.methodsExec[${t}] when useDbOrm=true`)}),s=[...s]}let o=null;if(i&&(o=ke(e,"authorizeExec",null),!Mn(o)))throw new Error("invalid opt.authorizeExec when useDbOrm=true");let a=ke(e,"kpFunExt",null);if(ea(a)&&!Ti(a))throw new Error("invalid opt.kpFunExt");Ti(a)||(a={}),ar(a,(e,t)=>{if(!Mn(e))throw new Error(`invalid opt.kpFunExt[${t}]`)});let c=ke(e,"kpFunSys",null),l=[];i&&(ar(r,e=>{ar(s,t=>{l.push(`${e}.${t}`)})}),l=Po(l)),ar(l,e=>{if(!_o(e))throw new Error(`table operation[${e}] can not be bound by the client`)});let u=Po(Yr(l,e=>Vo(e)[0]));ar(a,(e,t)=>{if(t.startsWith("[sys:"))throw new Error(`kpFunExt[${t}] can not use the reserved prefix [sys:`);if(!_o(t))throw new Error(`kpFunExt[${t}] can not be bound by the client`);let i=Vo(t)[0];if(u.includes(i))throw new Error(`kpFunExt[${t}] conflicts with the table operations of table[${i}]`)});let p=function(e){let t=()=>({leaf:null,kids:new Map}),i=e=>{if(null!==e.leaf)return e.leaf;for(let t of e.kids.values()){let e=i(t);if(null!==e)return e}return null},n=t();for(let r of e){let e=n;for(let i of Vo(r)){if(null!==e.leaf)return[e.leaf,r];e.kids.has(i)||e.kids.set(i,t()),e=e.kids.get(i)}if(null===e.leaf){if(e.kids.size>0)return[i(e),r];e.leaf=r}else if(e.leaf!==r)return[e.leaf,r]}return null}([...l,...Bt(a)]);if(null!==p){let e=e=>l.includes(e)?"table operation":"kpFunExt";throw new Error(`${e(p[1])}[${p[1]}] conflicts with ${e(p[0])}[${p[0]}] on the client binding path`)}return{getUserIdByToken:t,useDbOrm:i,operOrm:n,tableNames:r,methods:s,authorizeExec:o,kpFunExt:a,kpFunSys:c,pathNames:l}}function na(e,t={}){if(!ki(e))throw new Error("invalid instWConverServer");let{getUserIdByToken:i,useDbOrm:n,operOrm:r,tableNames:s,methods:o,authorizeExec:a,kpFunExt:c,kpFunSys:l}=ia(t),u={};async function p(t,n,r){if(!Zi(t))return r.resolve({state:"error",msg:"invalid func"}),r;let s="";if(!sr(n,"__sysToken__"))return r.resolve({state:"error",msg:"invalid token"}),r;if(s=Qn(n.__sysToken__),!sr(n,"__sysInputArgs__"))return r.resolve({state:"error",msg:"invalid input"}),r;if(n=n.__sysInputArgs__,!Array.isArray(n))return r.resolve({state:"error",msg:"invalid input"}),r;let o="";try{o=await i(s)}catch(t){return r.resolve({state:"error",msg:t}),Fn(e,"error",[t]),r}if(Zi(o)||(o=""),"[sys:getFuncList]"===t){let e=Bt(u);e=function(e,t){if(!ln(e))return[];if((Ti(t)||_i(t)||ji(t)||Bi(t))&&(t=[t]),!ln(t))return e;let i=To(e);return Uo(i,t),i}(e,"[sys:getTableTags]");let t={state:"success",msg:e};return r.resolve(t),r}if(!Object.prototype.hasOwnProperty.call(u,t))return r.resolve({state:"error",msg:`invalid func[${t}]`}),r;let a=u[t];try{let e=await Ln(a)(o,...n);r.resolve(e)}catch(e){r.resolve({state:"error",msg:`call func[${t}] has an error: ${Rn(e)}`})}return r}return n&&(u=function(e,t,i,n){let r={};return ar(e,e=>{ar(t,t=>{r[`${e}.${t}`]=async function(r,s){if(ta.includes(t)){let e=$o(s);if(!e.ok)return Promise.reject(`invalid find[${e.reason}]`);s=e.find}return!0!==await n({userId:r,tableName:e,methodName:t,input:s})?Promise.reject("permission denied"):await i(r,e,t,s)}})}),r}(s,o,r,a)),ar(c,(e,t)=>{u[t]=e}),ki(l)&&ar(l,(e,t)=>{u[t]=e}),e.on("execute",function(t,i,n){p(t,i,n).catch(i=>{n.resolve({state:"error",msg:`execFun func[${t}] has an error: ${Rn(i)}`}),Fn(e,"error",[i])})}),e}let ra=e=>null!=e;function sa(e,t={}){if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Gn()),!sr(e,"emit")||!Mn(e.on)||!Mn(e.off))throw new Error("instWConverServer is not an EventEmitter");let{fpTableTags:i,genTag:n,useDbOrm:r,kpOrm:s,tableNamesSync:o,optExec:a}=function(e={}){let t=ke(e,"fpTableTags",null);if(ra(t)&&!Zi(t))throw new Error("invalid opt.fpTableTags");Zi(t)||(t="./tableTags.json");let i=ke(e,"genTag",null);if(ra(i)&&!Mn(i))throw new Error("invalid opt.genTag");Mn(i)||(i=()=>Es()+"|"+Zr(6));let n=ke(e,"useDbOrm",null),r=Bi(n);r||(n=!1);let s=ke(e,"kpOrm",null),o=ke(e,"operOrm",null),a=ke(e,"tableNamesExec",null),c=ke(e,"methodsExec",null),l=ke(e,"authorizeExec",null),u=ke(e,"tableNamesSync",null),p=ke(e,"getUserIdByToken",null),d=ke(e,"kpFunExt",null);r||ar({operOrm:o,tableNamesExec:a,methodsExec:c,authorizeExec:l,kpOrm:s,tableNamesSync:u},(e,t)=>{if(null!==e)throw new Error(`invalid opt.useDbOrm when opt.${t} is given`)});if(n&&!Ti(s))throw new Error("invalid opt.kpOrm when useDbOrm=true");if(n&&ra(u)){if(!rn(u))throw new Error("invalid opt.tableNamesSync when useDbOrm=true");ar(u,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.tableNamesSync[${t}] when useDbOrm=true`)}),u=[...u]}let m=ia({getUserIdByToken:p,useDbOrm:n,operOrm:o,tableNames:a,methods:c,authorizeExec:l,kpFunExt:d}),h=!1;return n&&(h=Xo(u,s)),h&&ar(u,e=>{if(!m.tableNames.includes(e)||!m.methods.includes("select"))throw new Error(`invalid opt.tableNamesSync when table operation[${e}.select] does not exist`)}),{fpTableTags:t,genTag:i,useDbOrm:n,kpOrm:s,tableNamesSync:u,optExec:{getUserIdByToken:m.getUserIdByToken,useDbOrm:m.useDbOrm,operOrm:m.operOrm,tableNames:m.tableNames,methods:m.methods,authorizeExec:m.authorizeExec,kpFunExt:m.kpFunExt}}}(t);e=new Zo(e=new ho(e,{fpTableTags:i,genTag:n}));let c={"[sys:getTableTags]":()=>{let t=e.getTableTags();return{mode:"syncKpTable",data:zo(o,t)}}};try{e=new na(e,{...a,kpFunSys:c}),r&&(e=new Go(e,o,s,{genTag:n}))}catch(t){throw e.clearBroadcast(),e.clearSync(),t}return e}function oa(e={}){let t=Gn(),r=ke(e,"port");(!nn(r,{useLimitSafe:!0})||tn(r)>65535)&&(r=8080),r=tn(r);let s=(t,i,n)=>{let r=ke(e,t);if(null==r)return i;if(!n(r))throw new Error(`invalid opt.${t}`);return r},o=s("corsOrigins",["http://localhost"],e=>!1===e||ji(e)||rn(e));!1===o&&(o=[]),ji(o)&&(o=[o]),o=o.filter(e=>""!==e);let a=s("useInert",!0,Bi),c=s("pathStaticFiles","dist",Zi),l=ke(e,"apis");ln(l)||(l=[]);let u=ke(e,"fpTableTags",null);null==u&&(u=ke(e,"fnTableTags",null));let p=ke(e,"useShowLog");Bi(p)||(p=!0);let d=!0,m=[],h=e=>{d?m.push(e):0!==t.listenerCount("error")?Fn(t,"error",[e],{tag:"w-serv-hapi"}):console.error("[w-serv-hapi]",e)},f=!1;o.length>0&&(f={origin:o,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]});let g=new i.Server({port:r,routes:{timeout:{server:!1,socket:!1},cors:f}}),w=new Ls({serverHapi:g,apiName:ke(e,"apiName"),pathUploadTemp:ke(e,"pathUploadTemp"),tokenType:ke(e,"tokenType"),sizeSlice:ke(e,"sizeSlice"),sizeMsg:ke(e,"sizeMsg"),verifyConn:ke(e,"verifyConn"),delayForSlice:ke(e,"delayForSlice")});w.on("error",h),w.on("clientChange",function(e){p&&console.log(`Server[port:${r}]: now clients: ${e}`)});let y=()=>{for(let e of["clearBroadcast","clearSync"])if(Mn(w[e]))try{w[e]()}catch(e){h(e)}};w=new sa(w,{...e,fpTableTags:u});let M=new Promise(e=>{setTimeout(()=>{d=!1,e();let t=m;m=[];for(let e of t)h(e)},1)}),D=!1,x=(async()=>{await M,a&&await g.register(n);let e=[];return a&&(e=[{method:"GET",path:"/{file*}",handler:{directory:{path:`${c}/`}}}]),e=[...e,...l],g.route(e),await g.start(),D=!0,p&&console.log(`Server running at: ${g.info.uri}`),g})();x.catch(e=>{y(),h(e)});let I=null;return t.ready=()=>x,t.stop=()=>(null!==I||(I=(async()=>{if(await x.catch(()=>{}),y(),D)try{await g.stop()}catch(e){h(e)}})()),I),t.getServer=async()=>g,t.getInstWConverServer=async()=>w,t}function aa(e){try{e instanceof Promise&&Promise.prototype.then.call(e,void 0,()=>{})}catch(e){}}function ca(e,t){let i=bn(),n=!1;try{let t=function(e,t=!1){let i=[],n=!1;try{if(Array.isArray(e)){let t=e.length;i.length=t;for(let n=0;n<t;n++)n in e&&(i[n]=e[n])}else{if(t||!Ti(e)&&!rn(e))return null;{n=!0;let t=Object.keys(e);for(let n=0;n<t.length;n++)i.push({k:t[n],v:e[t[n]]})}}}catch(e){throw i.forEach(e=>{aa(n?e.v:e)}),e}return{items:i,useObj:n}}(e);if(null===t)return i.reject("rs is not an array or object"),i;e=t.items,n=t.useObj}catch(e){return i.reject(e),i}Mn(t)||(ar(e,e=>{aa(n?e.v:e)}),t=function(e){return e});let r=Mn(t),s=-1,o=[];return e.reduce(function(e,i){return e.then(function(e){o.push(e),s+=1;let a=s,c=i;return n&&(a=i.k,c=i.v),r?t(c,a):c})},Promise.resolve()).then(function(e){var t,n,r,s;o.push(e),s=null==(t=o)?0:t.length,o=s?Xr(t,(n=r||void 0===n?1:Ui(n))<0?0:n,s):[],i.resolve(o)}).catch(function(e){i.reject(e)}),i}function la(e){let t="procOrm does not authorize users, authorize where procOrm is exposed to clients",i=[["useCheckUser",t],["getUserById",t],["useExcludeWhenNotAdmin","procOrm does not filter select results by user, use addFunPostProcessing if needed"]];for(let[t,n]of i){let i=ke(e,t);if(null!=i&&!1!==i)throw new Error(`opt.${t} has been removed, ${n}`)}}let ua={backup:async function(e){if(!ki(e))throw console.log("woItems",e),new Error("invalid woItems");return await ca(e,async(e,t)=>(console.log("backup...",t),{name:t,data:await e.select()}))},recover:async function(e,i,n,r=!1){if(!Tn(e))throw console.log("fp",e),new Error("fp is not exist");if(!ki(i))throw console.log("woItems",i),new Error("invalid woItems");Mn(n)||(n=null),Bi(r)||(r=!1);let s=t.readFileSync(e,"utf8");s=es(s);let o=po(s);if(!ln(o))throw new Error("invalid backup data, need a non-empty array");ar(o,(e,t)=>{let n=ke(e,"name");if(!Zi(n))throw new Error(`invalid backup data, rs[${t}].name is not a string`);if(!Object.prototype.hasOwnProperty.call(i,n))throw new Error(`invalid backup data, table[${n}] is not in woItems`)}),Mn(n)&&n(),await ca(o,async e=>{console.log("recover...",e.name),r&&(console.log("needCreateStorage"),await i[e.name].createStorage());let t=null;return Dt(e.data)>0&&(t=await i[e.name].insert(e.data)),t})}};var pa=Array.prototype.join;function da(e,t){return null==e?"":pa.call(e,t)}var ma=Ot&&Ot.isRegExp,ha=ma?Xt(ma):function(e){return P(e)&&"[object RegExp]"==O(e)},fa=/\w*$/;function ga(e,t){var i=30,n="...";if(V(t)){var r="separator"in t?t.separator:r;i="length"in t?Ui(t.length):i,n="omission"in t?Ee(t.omission):n}var s=(e=Ae(e)).length;if(ot(e)){var o=$r(e);s=o.length}if(i>=s)return e;var a=i-Mt(n);if(a<1)return n;var c=o?Gr(o,0,a).join(""):e.slice(0,a);if(void 0===r)return c+n;if(o&&(a+=c.length-a),ha(r)){if(e.slice(a).search(r)){var l,u=c;for(r.global||(r=RegExp(r.source,Ae(fa.exec(r))+"g")),r.lastIndex=0;l=r.exec(u);)var p=l.index;c=c.slice(0,void 0===p?a:p)}}else if(e.indexOf(Ee(r),a)!=a){var d=c.lastIndexOf(r);d>-1&&(c=c.slice(0,d))}return c+n}function wa(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}const ya=[];for(let e=0;e<256;++e)ya.push((e+256).toString(16).slice(1));const Ma=new Uint8Array(16);function Da(){return crypto.getRandomValues(Ma)}const xa={};function Ia(e,t,i){let n;if(e)n=Ca(e.random??e.rng?.()??Da(),e.msecs,e.seq,t,i);else{const e=Date.now(),r=Da();!function(e,t,i){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=ba(i),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(xa,e,r),n=Ca(r,xa.msecs,xa.seq,t,i)}return t??function(e,t=0){return(ya[e[t+0]]+ya[e[t+1]]+ya[e[t+2]]+ya[e[t+3]]+"-"+ya[e[t+4]]+ya[e[t+5]]+"-"+ya[e[t+6]]+ya[e[t+7]]+"-"+ya[e[t+8]]+ya[e[t+9]]+"-"+ya[e[t+10]]+ya[e[t+11]]+ya[e[t+12]]+ya[e[t+13]]+ya[e[t+14]]+ya[e[t+15]]).toLowerCase()}(n)}function Ca(e,t,i,n,r=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(r<0||r+16>n.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`)}else n=new Uint8Array(16),r=0;return t??=Date.now(),i??=ba(e),n[r++]=t/1099511627776&255,n[r++]=t/4294967296&255,n[r++]=t/16777216&255,n[r++]=t/65536&255,n[r++]=t/256&255,n[r++]=255&t,n[r++]=112|i>>>28&15,n[r++]=i>>>20&255,n[r++]=128|i>>>14&63,n[r++]=i>>>6&255,n[r++]=i<<2&255|3&e[10],n[r++]=e[11],n[r++]=e[12],n[r++]=e[13],n[r++]=e[14],n[r++]=e[15],n}function ba(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function va(){return Ia()}var La={exports:{}},Ea={},Aa={exports:{}},Na={};function Sa(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Ta=/javascript\s*\:/gim;Na.whiteList=Sa(),Na.getDefaultWhiteList=Sa,Na.onAttr=function(e,t,i){},Na.onIgnoreAttr=function(e,t,i){},Na.safeAttrValue=function(e,t){return Ta.test(t)?"":t};var ka={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,r;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ja=ka;var Za=function(e,t){";"!==(e=ja.trimRight(e))[e.length-1]&&(e+=";");var i=e.length,n=!1,r=0,s=0,o="";function a(){if(!n){var i=ja.trim(e.slice(r,s)),a=i.indexOf(":");if(-1!==a){var c=ja.trim(i.slice(0,a)),l=ja.trim(i.slice(a+1));if(c){var u=t(r,o.length,c,l,i);u&&(o+=u+"; ")}}}r=s+1}for(;s<i;s++){var c=e[s];if("/"===c&&"*"===e[s+1]){var l=e.indexOf("*/",s+2);if(-1===l)break;r=(s=l+1)+1,n=!1}else"("===c?n=!0:")"===c?n=!1:";"===c?n||a():"\n"===c&&a()}return ja.trim(o)},za=Na,Ya=Za;function Xa(e){return null==e}function Ga(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).whiteList=e.whiteList||za.whiteList,e.onAttr=e.onAttr||za.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||za.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||za.safeAttrValue,this.options=e}Ga.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,i=t.whiteList,n=t.onAttr,r=t.onIgnoreAttr,s=t.safeAttrValue;return Ya(e,function(e,t,o,a,c){var l=i[o],u=!1;if(!0===l?u=l:"function"==typeof l?u=l(a):l instanceof RegExp&&(u=l.test(a)),!0!==u&&(u=!1),a=s(o,a)){var p,d={position:t,sourcePosition:e,source:c,isWhite:u};return u?Xa(p=n(o,a,d))?o+":"+a:p:Xa(p=r(o,a,d))?void 0:p}})};var Fa=Ga;!function(e,t){var i=Na,n=Fa;for(var r in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,i)t[r]=i[r];"undefined"!=typeof window&&(window.filterCSS=e.exports)}(Aa,Aa.exports);var Wa=Aa.exports,Oa={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,r;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},Pa=Wa.FilterCSS,Ka=Wa.getDefaultWhiteList,Ha=Oa;function Ua(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Ba=new Pa;function Va(e){return e.replace(_a,"<").replace(Ra,">")}var _a=/</g,Ra=/>/g,Qa=/"/g,Ja=/"/g,qa=/&#([a-zA-Z0-9]*);?/gim,$a=/:?/gim,ec=/&newline;?/gim,tc=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ic=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,nc=/u\s*r\s*l\s*\(.*/gi;function rc(e){return e.replace(Qa,""")}function sc(e){return e.replace(Ja,'"')}function oc(e){return e.replace(qa,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function ac(e){return e.replace($a,":").replace(ec," ")}function cc(e){for(var t="",i=0,n=e.length;i<n;i++)t+=e.charCodeAt(i)<32?" ":e.charAt(i);return Ha.trim(t)}function lc(e){return e=cc(e=ac(e=oc(e=sc(e))))}function uc(e){return e=Va(e=rc(e))}Ea.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Ea.getDefaultWhiteList=Ua,Ea.onTag=function(e,t,i){},Ea.onIgnoreTag=function(e,t,i){},Ea.onTagAttr=function(e,t,i){},Ea.onIgnoreTagAttr=function(e,t,i){},Ea.safeAttrValue=function(e,t,i,n){if(i=lc(i),"href"===t||"src"===t){if("#"===(i=Ha.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(tc.lastIndex=0,tc.test(i))return""}else if("style"===t){if(ic.lastIndex=0,ic.test(i))return"";if(nc.lastIndex=0,nc.test(i)&&(tc.lastIndex=0,tc.test(i)))return"";!1!==n&&(i=(n=n||Ba).process(i))}return i=uc(i)},Ea.escapeHtml=Va,Ea.escapeQuote=rc,Ea.unescapeQuote=sc,Ea.escapeHtmlEntities=oc,Ea.escapeDangerHtml5Entities=ac,Ea.clearNonPrintableCharacter=cc,Ea.friendlyAttrValue=lc,Ea.escapeAttrValue=uc,Ea.onIgnoreTagStripAll=function(){return""},Ea.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var i=!Array.isArray(e),n=[],r=!1;return{onIgnoreTag:function(s,o,a){if(function(t){return!!i||-1!==Ha.indexOf(e,t)}(s)){if(a.isClosing){var c="[/removed]",l=a.position+10;return n.push([!1!==r?r:a.position,l]),r=!1,c}return r||(r=a.position),"[removed]"}return t(s,o,a)},remove:function(e){var t="",i=0;return Ha.forEach(n,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}},Ea.stripCommentTag=function(e){for(var t="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var r=e.indexOf("--\x3e",n);if(-1===r)break;i=r+3}return t},Ea.stripBlankChar=function(e){var t=e.split("");return(t=t.filter(function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})).join("")},Ea.attributeWrapSign='"',Ea.cssFilter=Ba,Ea.getDefaultCSSWhiteList=Ka;var pc={},dc=Oa;function mc(e){var t,i=dc.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=dc.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}function hc(e){return"</"===e.slice(0,2)}var fc=/[^a-zA-Z0-9\\_:.-]/gim;function gc(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}}function wc(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}}function yc(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Mc(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}pc.parseTag=function(e,t,i){var n="",r=0,s=!1,o=!1,a=0,c=e.length,l="",u="";e:for(a=0;a<c;a++){var p=e.charAt(a);if(!1===s){if("<"===p){s=a;continue}}else if(!1===o){if("<"===p){n+=i(e.slice(r,a)),s=a,r=a;continue}if(">"===p||a===c-1){n+=i(e.slice(r,s)),l=mc(u=e.slice(s,a+1)),n+=t(s,n.length,l,u,hc(u)),r=a+1,s=!1;continue}if('"'===p||"'"===p)for(var d=1,m=e.charAt(a-d);""===m.trim()||"="===m;){if("="===m){o=p;continue e}m=e.charAt(a-++d)}}else if(p===o){o=!1;continue}}return r<c&&(n+=i(e.substr(r))),n},pc.parseAttr=function(e,t){var i=0,n=0,r=[],s=!1,o=e.length;function a(e,i){if(!((e=(e=dc.trim(e)).replace(fc,"").toLowerCase()).length<1)){var n=t(e,i||"");n&&r.push(n)}}for(var c=0;c<o;c++){var l,u=e.charAt(c);if(!1!==s||"="!==u)if(!1===s||c!==n)if(/\s|\n|\t/.test(u)){if(e=e.replace(/\s|\n|\t/g," "),!1===s){if(-1===(l=gc(e,c))){a(dc.trim(e.slice(i,c))),s=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=yc(e,c-1))){a(s,Mc(dc.trim(e.slice(i,c)))),s=!1,i=c+1;continue}}else;else{if(-1===(l=e.indexOf(u,c+1)))break;a(s,dc.trim(e.slice(n+1,l))),s=!1,i=(c=l)+1}else s=e.slice(i,c),i=c+1,n='"'===e.charAt(i)||"'"===e.charAt(i)?i:wc(e,c+1)}return i<e.length&&(!1===s?a(e.slice(i)):a(s,Mc(dc.trim(e.slice(i))))),dc.trim(r.join(" "))};var Dc=Wa.FilterCSS,xc=Ea,Ic=pc,Cc=Ic.parseTag,bc=Ic.parseAttr,vc=Oa;function Lc(e){return null==e}function Ec(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=xc.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=function(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(e){return e.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}(e.whiteList||e.allowList):e.whiteList=xc.whiteList,this.attributeWrapSign=!0===e.singleQuotedAttributeValue?"'":xc.attributeWrapSign,e.onTag=e.onTag||xc.onTag,e.onTagAttr=e.onTagAttr||xc.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||xc.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||xc.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||xc.safeAttrValue,e.escapeHtml=e.escapeHtml||xc.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Dc(e.css))}Ec.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this,i=t.options,n=i.whiteList,r=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,c=i.safeAttrValue,l=i.escapeHtml,u=t.attributeWrapSign,p=t.cssFilter;i.stripBlankChar&&(e=xc.stripBlankChar(e)),i.allowCommentTag||(e=xc.stripCommentTag(e));var d=!1;i.stripIgnoreTagBody&&(d=xc.StripTagBody(i.stripIgnoreTagBody,s),s=d.onIgnoreTag);var m=Cc(e,function(e,t,i,d,m){var h={sourcePosition:e,position:t,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(n,i)},f=r(i,d,h);if(!Lc(f))return f;if(h.isWhite){if(h.isClosing)return"</"+i+">";var g=function(e){var t=vc.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=vc.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=vc.trim(e.slice(0,-1))),{html:e,closing:i}}(d),w=n[i],y=bc(g.html,function(e,t){var n=-1!==vc.indexOf(w,e),r=o(i,e,t,n);return Lc(r)?n?(t=c(i,e,t,p))?e+"="+u+t+u:e:Lc(r=a(i,e,t,n))?void 0:r:r});return d="<"+i,y&&(d+=" "+y),g.closing&&(d+=" /"),d+=">"}return Lc(f=s(i,d,h))?l(d):f},l);return d&&(m=d.remove(m)),m};var Ac=Ec;!function(e,t){var i=Ea,n=pc,r=Ac;function s(e,t){return new r(t).process(e)}(t=e.exports=s).filterXSS=s,t.FilterXSS=r,function(){for(var e in i)t[e]=i[e];for(var r in n)t[r]=n[r]}(),"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(La,La.exports);var Nc=Zn(La.exports);function Sc(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let Tc=/<(?=[A-Za-z!/?]|$)/g;function kc(e){return e.replace(Tc,"<")}let jc={getFilterXSS:function(e=Nc){if(Mn(e))return e;let t=Sc(),i=ke(t,"filterXSS",null);if(Mn(i))return i;let n=ke(t,"xss",null);if(Mn(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(e){return{escapeHtml:kc,onIgnoreTagAttr:function(t,i,n,r){if("style"===i)return i+'="'+e.escapeAttrValue(n)+'"'}}}};function Zc(e){let t=null,i=null;let n=function e(n){if(Array.isArray(n)){for(let t=0;t<n.length;t++)n[t]=e(n[t]);return n}if(Ti(n)||rn(n)){for(let t of Object.keys(n))n[t]=e(n[t]);return n}return Zi(n)?(r=n,null===t&&(t=jc.getFilterXSS(),i=jc.getOpt(t)),t(r,i)):n;var r}(To(e));return n}function zc(e,t){if(!rn(e))return[];rn(t)||(t=[t]);let i=[];return ar(e,(e,n)=>{0===ke(e,"ok")&&i.push({k:n,id:ke(t,[n,"id"]),err:ke(e,"err","")})}),i}function Yc(e,t){var i,n,r;let s=`${e}: ${da(Yr((n=10,(i=t)&&i.length?Xr(i,0,(n=r||void 0===n?1:Ui(n))<0?0:n):[]),e=>Zi(e.ref)?e.ref:Zi(e.id)||_i(e.id)?`id[${ga(String(e.id),{length:100,omission:"…"})}]`:`data[${e.k}]`),", ")}`;return Dt(t)>10&&(s+=`, ... (${Dt(t)} in total)`),s}function Xc(e,t){if(t.indexOf("id")<0)return!1;let i=ke(e,"settings",null);if(ki(i)&&!0!==ke(i,"id.pk"))return!1;let n=ke(i,"id.type","")||ke(e,"kpType.id","");return!(Zi(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.split("(")[0].trim().toUpperCase())<0)}function Gc(e,t){return null!==e&&"object"==typeof e&&"string"==typeof t&&Object.prototype.hasOwnProperty.call(e,t)?void 0===e[t]?null:e[t]:null}function Fc(e){return"number"==typeof e&&Number.isFinite(e)}function Wc(e){return Fc(e)?String(e):e}function Oc(e,t){return Object.fromEntries(Object.keys(e).map(i=>[i,t(e[i],i)]))}const Pc=Object.freeze({proto:"unsupported key[__proto__]",accessor:"unsupported accessor property",unreadable:"unreadable value",deep:"too deep",hidden:"unsupported symbol key or non-enumerable property",irregular:"unsupported irregular object or array"}),Kc="function"==typeof WeakRef?Function.prototype.call.bind(WeakRef.prototype.deref):null,Hc="function"==typeof FinalizationRegistry?Function.prototype.call.bind(FinalizationRegistry.prototype.unregister):null,Uc={};function Bc(e){for(let t=e;null!==t;t=Object.getPrototypeOf(t))if(a.types.isProxy(t)||Object.prototype.hasOwnProperty.call(t,Symbol.toStringTag))return!1;return!0}function Vc(e){return a.types.isMap(e)||a.types.isSet(e)||a.types.isWeakMap(e)||a.types.isWeakSet(e)||a.types.isPromise(e)||a.types.isAnyArrayBuffer(e)||a.types.isArrayBufferView(e)||a.types.isBoxedPrimitive(e)||a.types.isRegExp(e)||a.types.isNativeError(e)||a.types.isGeneratorObject(e)||a.types.isMapIterator(e)||a.types.isSetIterator(e)||a.types.isModuleNamespaceObject(e)}function _c(e){if("object"!=typeof e||null===e||!Bc(e)||!Ti(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype||function(e){if(null!==Object.getPrototypeOf(e))return!1;let t=Reflect.ownKeys(Object.prototype);if(Reflect.ownKeys(e).length!==t.length)return!1;for(let i of t)if(!Object.prototype.hasOwnProperty.call(e,i))return!1;let i=Object.getOwnPropertyDescriptor(e,"constructor");if(void 0===i||"function"!=typeof i.value||a.types.isProxy(i.value))return!1;if(Function.prototype.toString.call(i.value)!==Function.prototype.toString.call(Object))return!1;let n=Object.getOwnPropertyDescriptor(i.value,"prototype");return void 0!==n&&n.value===e}(t)}function Rc(e){return"object"!=typeof e||null===e||!Bc(e)||Vc(e)?null:Array.isArray(e)?"arr":Ti(e)?"obj":null}function Qc(e){if(null!==Kc)try{return Kc(e),!0}catch(e){}if(null!==Hc)try{return Hc(e,Uc),!0}catch(e){}return!1}function Jc(e,...t){try{console.log(e,...t)}catch(t){try{console.log(e,"(unprintable)")}catch(e){}}}function qc(e,t={n:0},i=0){if(t.n>=200)return"[...]";if(t.n++,"string"==typeof e)return ga(e,{length:200});if("function"==typeof e)return"[Function]";if("symbol"==typeof e)return"[Symbol]";if("object"!=typeof e||null===e)return e;if(a.types.isProxy(e))return"[Proxy]";if(a.types.isDate(e))return"[Date]";if(Vc(e))return"[Object]";if(i>=8)return"[...]";let n=e=>void 0===e?"[empty]":void 0!==e.get||void 0!==e.set?"[Getter/Setter]":qc(e.value,t,i+1);if(Array.isArray(e)){let t=Math.min(e.length,50),i=[];for(let r=0;r<t;r++)i.push(n(Object.getOwnPropertyDescriptor(e,r)));return e.length>t&&i.push(`[${e.length-t} more]`),i}let r=Reflect.ownKeys(e),s={};for(let t of r.slice(0,50)){let i=Object.getOwnPropertyDescriptor(e,t),r="symbol"==typeof t?String(t):t;Object.defineProperty(s,i.enumerable?r:`${r} (non-enumerable)`,{value:n(i),enumerable:!0,writable:!0,configurable:!0})}return r.length>50&&Object.defineProperty(s,"[more]",{value:r.length-50,enumerable:!0,writable:!0,configurable:!0}),s}function $c(e,t){let i;try{i=qc(t)}catch(e){i="(unprintable)"}Jc(e,i)}function el(e,t=1/0,i=!1){try{let n=new Set,r=[e,1],s=0,o=[];for(;r.length>0;){let e,c=r.pop(),l=r.pop();if(n.has(l))continue;if(i){if("object"==typeof l&&null!==l){if(!Bc(l)||Vc(l))return"irregular";if(a.types.isDate(l)){if(Reflect.ownKeys(l).length>0)return"irregular";continue}}e=Rc(l)}else e=Array.isArray(l)?"arr":Ti(l)?"obj":null;if(null===e)continue;let u="arr"===e;if(c>t)return"deep";if(n.add(l),Object.prototype.hasOwnProperty.call(l,"__proto__"))return"proto";let p=u?null:Object.keys(l);if(i&&!u){if(!_c(l))return"irregular";if(Reflect.ownKeys(l).length!==p.length)return"hidden";o.push(l)}let d=u?l.length:p.length;for(let e=0;e<d;e++){let t=Object.getOwnPropertyDescriptor(l,u?e:p[e]);if(void 0!==t){if(void 0!==t.get||void 0!==t.set)return"accessor";if(i&&u&&!t.enumerable)return"irregular";i&&(s+=u?0:p[e].length,"string"==typeof t.value&&(s+=t.value.length)),"object"==typeof t.value&&null!==t.value&&r.push(t.value,c+1)}else if(i)return"irregular"}if(i&&u&&Reflect.ownKeys(l).length!==d+1)return"irregular"}if(i&&"object"==typeof e&&null!==e)if(s<=4e6&&"function"==typeof structuredClone){if(function(e){if("function"!=typeof structuredClone)return!1;let t;try{t=structuredClone(e)}catch(e){return!0}let i=new Set,n=[t];for(;n.length>0;){let e=n.pop();if("object"!=typeof e||null===e||i.has(e))continue;i.add(e);let t=Object.getPrototypeOf(e);if(t!==Date.prototype){if(t!==Object.prototype&&t!==Array.prototype)return!0;for(let t of Object.keys(e))n.push(e[t])}}return!1}(e))return"irregular"}else for(let e=0;e<o.length;e++)if(Qc(o[e]))return"irregular";return null}catch(e){return"unreadable"}}function tl(e,t){try{if(void 0!==t&&"object"==typeof t&&null!==t&&a.types.isProxy(t))return`invalid find of ${e}, ${Pc.irregular}`;if(void 0!==t&&!_c(t))return`invalid find of ${e}, need an object`;let i=el(t,64,!0);return null!==i?`invalid find of ${e}, ${Pc[i]}`:null}catch(t){return`invalid find of ${e}, ${Pc.unreadable}`}}function il(e,t){let i=new Map,n=(e,t)=>{i.has(e)||i.set(e,[]),i.get(e).push({k:t})};if(Array.isArray(t))for(let e=0;e<t.length;e++)try{let i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i)continue;if(void 0!==i.get||void 0!==i.set){n("accessor",e);continue}let r=el(i.value);null!==r&&n(r,e)}catch(t){n("unreadable",e)}else{let e=el(t);null!==e&&n(e,0)}return Yr([...i],([t,i])=>Yc(`${e}, ${Pc[t]}`,i))}function nl(e){let t=!rn(e),i=Yr(t?[e]:e,e=>Ti(e)&&Fc(e.id)?{...e,id:Wc(e.id)}:e);return t?i[0]:i}function rl(e){return"obj"!==Rc(e)?e:Oc(e,(e,t)=>{return"id"===t?"obj"!==Rc(i=e)?Wc(i):Oc(i,(e,t)=>["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin"].indexOf(t)>=0?"arr"===Rc(e)?Yr(e,Wc):Wc(e):e):["$and","$or"].indexOf(t)>=0&&"arr"===Rc(e)?Yr(e,rl):e;var i})}function sl(e){let t=[];return ar(rn(e)?e:[e],(e,i)=>{Ti(e)||t.push({k:i})}),t}function ol(e){let t=Wc(ke(e,"id"));return Zi(t)?t:null}function al(e){let t=[];return ar(rn(e)?e:[e],(e,i)=>{let n=ke(e,"id");Zi(n)&&Zc(n)!==n&&t.push({k:i,id:n})}),t}function cl(e,t){return Yc(`${e}, id contains HTML markup`,Yr(t,e=>({k:e.k})))}function ll(e,t,i,n,r="save"){if(!ki(e))throw console.log("ds",e),new Error("invalid ds");let s=e[t].keys,o=!1;rn(n)||(o=!0,n=[n]);let a=wa();if(r.indexOf("insert")>=0&&(s.indexOf("userId")>=0&&ar(n,(e,t)=>{n[t].userId=i}),s.indexOf("timeCreate")>=0&&ar(n,(e,t)=>{n[t].timeCreate=a}),s.indexOf("userIdUpdate")>=0&&ar(n,(e,t)=>{n[t].userIdUpdate=i}),s.indexOf("timeUpdate")>=0&&ar(n,(e,t)=>{n[t].timeUpdate=a})),(r.indexOf("insert")>=0||r.indexOf("save")>=0)&&(s.indexOf("userIdUpdate")>=0&&ar(n,(e,t)=>{n[t].userIdUpdate=i}),s.indexOf("timeUpdate")>=0&&ar(n,(e,t)=>{n[t].timeUpdate=a})),n=Yr(n,e=>Oc(e,e=>Zc(e))),Xc(e[t],s)){(o?ki(n[0]):ln(n))&&ar(n,e=>{Zi(e.id)||(e.id=va())})}return n=o?n[0]:n}async function ul(e,t,i,n,r,s){try{return await async function(e,t,i,n,r,s){let o,a=null;if(!ki(t))return Promise.reject("invalid woItems");let c=Gc(t,n);if(null===c)return Promise.reject(`can not find table[${"string"==typeof n?n:""}] in ORM`);let l=function(e,t){let i=Gc(e,t),n=ke(i,"keys",null);return!!rn(n)&&Xc(i,n)}(e,n);if("select"===r){let e=tl("select",s);if(null!==e)return $c(`${n}.select invalid find`,s),Promise.reject(e);if(o=await c.select(l?rl(s):s).catch(e=>{console.log(`${n}.select catch`,e),a="failed to select data"}),Zi(a))return Promise.reject(a)}else if("insert"===r||"save"===r){let t=s,u="insert"===r?"failed to insert data":"failed to save data",p=sl(s);if(Dt(p)>0)return console.log(`${n}.${r} data is not an object`,p),Promise.reject(Yc(`${u}, not an object`,p));let d=il(u,s);if(Dt(d)>0)return console.log(`${n}.${r} data has unsupported key`,d),Promise.reject(da(d,"; "));l&&(s=nl(s));let m=al(s);if(Dt(m)>0)return console.log(`${n}.${r} id changed by clearXSS`,m),Promise.reject(cl(u,m));try{s=ll(e,n,i,s,r)}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),a="failed to adjust data",Promise.reject(a)}if("insert"===r?o=await c.insert(s).catch(e=>{console.log(`${n}.insert catch`,e),a="failed to insert data"}):"save"===r&&(o=await c.save(s).catch(e=>{console.log(`${n}.save catch`,e),a="failed to save data"})),Zi(a))return Promise.reject(a);if("save"===r){let e=zc(o,s);if(Dt(e)>0)return console.log(`${n}.save fail`,e),Promise.reject(Yc("failed to save data",zc(o,t)))}o=rn(s)?Yr(s,e=>({id:e.id})):{id:s.id}}else if("del"===r){if(l&&(s=nl(s)),o=await c.del(s).catch(e=>{console.log(`${n}.del catch`,e),a="failed to delete data"}),!Zi(a)){let e=zc(o,s);Dt(e)>0&&(console.log(`${n}.del fail`,e),a=Yc("failed to delete data",e))}}else if("delAll"===r){let e=tl("delAll",s);if(null!==e)return $c(`${n}.delAll invalid find`,s),Promise.reject(e);o=await c.delAll(l?rl(s):s).catch(e=>{console.log(`${n}.delAll catch`,e),a="failed to delete data"})}else if("mix"===r){if(!ki(s))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");for(let e of["add","del","diff"]){let t=Object.getOwnPropertyDescriptor(s,e);if(void 0!==t&&(void 0!==t.get||void 0!==t.set))return Promise.reject(`invalid input of mix, ${Pc.accessor}`)}s={add:s.add,del:s.del,diff:s.diff};for(let e of["add","del","diff"])if(void 0!==s[e]&&!rn(s[e]))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let t=[];for(let[e,i]of[["add","failed to insert data"],["diff","failed to update data"]]){let r=sl(ke(s,e,[]));Dt(r)>0&&(console.log(`${n}.mix ${e} data is not an object`,r),t.push(Yc(`${i}, not an object`,r)))}if(Dt(t)>0)return Promise.reject(da(t,"; "));let r=[];for(let[e,t]of[["add","failed to insert data"],["diff","failed to update data"]])r.push(...il(t,ke(s,e,[])));if(Dt(r)>0)return console.log(`${n}.mix data has unsupported key`,r),Promise.reject(da(r,"; "));if(l){s={...s};for(let e of["add","del","diff"])rn(s[e])&&(s[e]=nl(s[e]))}let u=[];for(let[e,t]of[["add","failed to insert data"],["diff","failed to update data"]]){let i=al(ke(s,e,[]));Dt(i)>0&&(console.log(`${n}.mix ${e} id changed by clearXSS`,i),u.push(cl(t,i)))}if(Dt(u)>0)return Promise.reject(da(u,"; "));let p,d=function(e){let t=[];for(let[i,n]of[["add","del"],["del","diff"]]){let r=new Map;ar(ke(e,i,[]),(e,t)=>{let i=ol(e);null!==i&&r.set(i,[...r.get(i)||[],t])});let s=[],o=[];if(ar(ke(e,n,[]),(e,t)=>{let i=ol(e);null!==i&&r.has(i)&&(s=[...s,...r.get(i)],o.push(t))}),Dt(o)>0){let e=[...Yr([...new Set(s)].sort((e,t)=>e-t),e=>({ref:`${i}[${e}]`})),...Yr(o,e=>({ref:`${n}[${e}]`}))];t.push(Yc(`invalid input of mix, same id in ${i} and ${n}`,e))}}return t}(s);if(Dt(d)>0)return console.log(`${n}.mix same id across steps`,d),Promise.reject(da(d,"; "));o=[];let m=[],h=ke(s,"add",[]);if(Dt(h)>0){try{h=ll(e,n,i,h,"insert+save")}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),a="failed to adjust data",Promise.reject(a)}if(await c.insert(h).catch(e=>{console.log(`${n}.insert catch`,e),a="failed to insert data"}),Zi(a))return Promise.reject(a);p=Yr(h,e=>({id:e.id})),o=[...o,...p]}let f=ke(s,"del",[]);if(Dt(f)>0){let e=await c.del(f).catch(e=>{console.log(`${n}.del catch`,e),a="failed to delete data"});if(Zi(a))return Promise.reject(a);let t=zc(e,f);Dt(t)>0&&(console.log(`${n}.del fail`,t),m.push(Yc("failed to delete data",t))),p=Yr(f,e=>({id:e.id})),o=[...o,...p]}let g=ke(s,"diff",[]);if(Dt(g)>0){let t=g;try{g=ll(e,n,i,g)}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),a="failed to adjust data",Promise.reject(a)}let r=await c.save(g).catch(e=>{console.log(`${n}.save catch`,e),a="failed to update data"});if(Zi(a))return Promise.reject(a);let s=zc(r,g);Dt(s)>0&&(console.log(`${n}.save fail`,s),m.push(Yc("failed to update data",zc(r,t)))),p=Yr(g,e=>({id:e.id})),o=[...o,...p]}if(Dt(m)>0)return Promise.reject(da(m,"; "))}else a=`invalid mode: ${r}`;if(Zi(a))return Promise.reject(a);return o}(e,t,i,n,r,s)}catch(e){return"string"==typeof e?Promise.reject(e):(Jc(`${"string"==typeof n?n:""}.${"string"==typeof r?r:""} mapOrm catch`,e),Promise.reject("failed to process input"))}}function pl(e,t){return async(i,n,r,s)=>ul(e,t,i,n,r,s)}function dl(e,t,i,n=!1){if(!Mn(t)){let r=`${i} needs a function, but got ${typeof t}`;throw n&&e.push(()=>Promise.reject(r)),new Error(r)}setTimeout(()=>{e.push(t)},1)}function ml(e,t={}){if(la(t),!Mn(e))throw new Error("invalid mapOrm");let i={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:e};return{addFunCheck:e=>{dl(i.funChecks,e,"addFunCheck",!0)},addFunPreProcessing:e=>{dl(i.funPreProcessing,e,"addFunPreProcessing")},addFunPostProcessing:e=>{dl(i.funPostProcessing,e,"addFunPostProcessing")},procOrm:async(e,t,n,r)=>async function(e,t,i,n,r){await ca(e.funChecks,e=>e({woName:i,userId:t,mode:n,input:r}));for(let s of[...e.funPreProcessing]){let e=await s({woName:i,userId:t,mode:n,input:r});if(!ki(e)||void 0===e.input)return Promise.reject("invalid return of pre-processing, need an object with input");r=e.input}let s=await e.mapOrm(t,i,n,r);for(let o of[...e.funPostProcessing])s=await o({woName:i,userId:t,mode:n,input:r,output:s});return s}(i,e,t,n,r)}}function hl(e,t,i,n,r={}){la(r);let s=function(e,t,i,n){if(!ki(e))throw console.log("ds",e),new Error("invalid ds");if(!Mn(t))throw console.log("WOrm",t),new Error("invalid WOrm");if(!Zi(i))throw console.log("url",i),new Error("invalid url");if(!Zi(n))throw console.log("db",n),new Error("invalid db");let r={};return ar(Bt(e),e=>{let s=new t({url:i,db:n,cl:e});Object.defineProperty(r,e,{value:s,enumerable:!0,writable:!0,configurable:!0})}),r}(e,t,i,n),o=ml(pl(e,s),r);return{...ua,woItems:s,closeAll:async()=>{await ca(s,async e=>{e&&Mn(e.close)&&await e.close()})},...o}}function fl(e,t,i=""){if(!ln(t))return{};let n={};return ar(t,function(t){n[t]=ke(e,t,i)}),n}let gl={id:{pk:!0,name:"主鍵",type:"STRING"},ip:{name:"IP",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"}},wl={id:{pk:!0,name:"主鍵",type:"STRING"},token:{name:"金鑰",type:"STRING"},userId:{name:"使用者主鍵",type:"STRING"},isApp:{name:"是否為應用系統",type:"STRING"},perms:{name:"應用系統權限",type:"TEXT"},timeCreate:{name:"創建時間",type:"STRING"},timeEnd:{name:"到期時間",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"}},yl={id:{pk:!0,name:"主鍵",type:"STRING"},order:{name:"順序",type:"INTEGER"},account:{name:"帳號",type:"STRING"},password:{name:"密碼",type:"STRING"},name:{name:"姓名",type:"STRING"},email:{name:"電子郵件",type:"STRING"},description:{name:"描述",type:"TEXT"},from:{name:"來源",type:"STRING"},redir:{name:"登入後轉址",type:"STRING"},isAdmin:{name:"是否為系統管理員",type:"STRING"},tokenVerify:{name:"註冊後驗證用token",type:"STRING"},timeVerified:{name:"驗證時間",type:"STRING"},timeExpired:{name:"過期時間",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"},isForceChangePw:{name:"是否須強制變更密碼",type:"STRING"},userId:{name:"創建使用者主鍵",type:"STRING"},timeCreate:{name:"創建時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"},isActive:{name:"是否有效",type:"STRING"}};function Ml(e,t={}){let i=ke(t,"useCreateStorage");Bi(i)||(i=!1);let{keyTable:n,tableNameCht:r,tableNameEng:s,settings:o,parser:a,funNew:c,funTest:l,ext:u}=e;if(!Zi(n))throw new Error(`invalid keyTable[${n}]`);if(Zi(r)||(r=n),Zi(s)||(s=n),!ki(o))throw new Error("invalid settings");ki(u)||(u=null),ki(a)||(a=null),Mn(c)||(c=null);let p=null;Mn(l)&&(p=async e=>{if(!ki(e))throw new Error("invalid wo");if(!sr(e,n))throw console.log(e),new Error(`keyTable[${n}] is not in wo`);let t=[];try{t=l(),vn(t)&&(t=await t)}catch(e){throw console.log(`keyTable[${n}] funTest catch`,e),new Error(e)}if(0===Dt(t))return;i&&await e[n].createStorage();let r=zc(await e[n].save(t),t);if(Dt(r)>0)throw new Error(`failed to write test data into table[${n}]: ${JSON.stringify(r)}`);return t});let d={},m={};return ar(Bt(o),e=>{let t=ke(o,`${e}.name`,"");Zi(t)&&(d[e]=t);let i=ke(o,`${e}.type`,"");Zi(i)&&(m[e]=i)}),{...e,keyTable:n,tableNameCht:r,tableNameEng:s,settings:o,keys:Bt(o),kpType:m,kpHead:d,parser:a,funNew:c,funTest:l,funTestAndSave:p,ext:u}}let Dl={ips:{keyTable:"ips",tableNameCht:"IP使用者",tableNameEng:"IPs",settings:gl,funNew:(e={})=>{let t=fl(e,Bt(gl));return t.id=`${va()}`,t},funTest:()=>[]},tokens:{keyTable:"tokens",tableNameCht:"金鑰",tableNameEng:"Tokens",settings:wl,funNew:(e={})=>{let t=fl(e,Bt(wl));return t.id=`${va()}`,t.token=`${va()}`,rn(t.perms)||(t.perms=[]),t.timeCreate=wa(),t.timeEnd=Tr().add(30,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),t.timeUpdate=t.timeCreate,t},funTest:()=>[]},users:{keyTable:"users",tableNameCht:"使用者",tableNameEng:"Users",settings:yl,funNew:(e={})=>{let t=fl(e,Bt(yl));return t.id=`${va()}`,t.timeCreate=wa(),t.userIdUpdate=t.userId,t.timeUpdate=t.timeCreate,t.isActive="y","y"!==t.isForceChangePw&&"n"!==t.isForceChangePw&&(t.isForceChangePw="n"),t},funTest:()=>[]}},xl={};for(let e in Dl)xl[e]=Ml(Dl[e],{useCreateStorage:!1});function Il(e){let t;return t=In(e,1),"Z"===t?`${e=Cn(e,1)}+00:00`:e}let Cl={checkTZ:function(e){let t;return t=In(e,1),"Z"===t||(t=In(e,6),!!/[+|-]\d\d:\d\d/.test(t))},delTZ:function(e){let t;return t=In(e,1),Cn(e,"Z"===t?1:6)},normTZ:Il,sepTZ:function(e){let t=Il(e);return{t:Cn(t,6),tz:In(t,6)}}};function bl(e){if(!Zi(e))return!1;if(!Cl.checkTZ(e))return!1;let t=Cl.delTZ(e),i="YYYY-MM-DDTHH:mm:ss.SSS";return t===Tr(t,i).format(i)}function vl(e){let t=ke(e,"timeExpired","");return!!bl(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=t}function Ll(e){let t=ke(e,"timeBlocked","");return!!bl(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}function El(e){return"y"===ke(e,"isActive","")}function Al(e){let t=bl(ke(e,"timeVerified",""));let i=!vl(e),n=!Ll(e),r=function(e){return"y"===ke(e,"isAdmin","")}(e),s=El(e);return t&&i&&n&&r&&s}let Nl="w-syslog/src/formatter.mjs";function Sl(i={}){let n=i.fpSelf,r=i.cwd,s=[],o=e.dirname(e.dirname(n)),a=e.join(o,"src","formatter.mjs");if((i=>{try{return"w-syslog"===JSON.parse(t.readFileSync(e.join(i,"package.json"),"utf8")).name}catch(e){return!1}})(o)&&t.existsSync(a))return{fp:a,by:"pkgRoot"};s.push(`package root of ${n}`);try{return{fp:u.createRequire(n).resolve(Nl),by:"resolveFromSelf"}}catch(e){s.push(`resolve from ${n}`)}try{return{fp:u.createRequire(e.join(r,"index.js")).resolve(Nl),by:"resolveFromCwd"}}catch(e){s.push(`resolve from ${r}`)}throw new Error(`w-syslog: can not resolve transport target ${Nl}, tried: ${s.join("; ")}. When bundling, keep w-syslog installed and list "pino" in external`)}let Tl="",kl="wsyslogFormatterError",jl=e=>{try{return t.statSync(e).isDirectory()}catch(e){return!1}};function Zl(i={}){let n=Gn(),r=ke(i,"timeZone",null),s=ke(i,"fdLog");Zi(s)||(s="./_logs");let o=ke(i,"interval");"day"!==o&&"hr"!==o&&(o="day");let a=ke(i,"numKeep");if(nn(a)||(a="day"===o?365:8760),a=tn(a),"function"!=typeof l.transport)throw new Error('w-syslog: pino.transport is not a function, pino seems to be bundled as its browser build; list "pino" in external when bundling');if(Zi(r))try{Intl.DateTimeFormat("en-US",{timeZone:r})}catch(e){throw new Error(`w-syslog: invalid timeZone[${r}]`)}let u=e.resolve(s);if(vr(u),!jl(u))throw new Error(`w-syslog: can not create fdLog[${s}]`);let p=(""===Tl&&(Tl=Sl({fpSelf:c.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:N&&"SCRIPT"===N.tagName.toUpperCase()&&N.src||new URL("w-web-sso.umd.js",document.baseURI).href),cwd:process.cwd()}).fp),Tl),d=l.transport({targets:[{level:"info",target:c.pathToFileURL(p).href,options:{interval:o,fdLog:u,timeZone:r}}]});d.unref();let m=!1,h=e=>{try{n.emit("writeError",e)}catch(e){}},f=e=>{m=!0,console.error("w-syslog transport error:",e),h(e)},g=e=>{let t=new Error(ke(e,"message","w-syslog formatter error"));t.code=ke(e,"code"),t.syscall=ke(e,"syscall"),t.path=ke(e,"path"),h(t)};d.on("error",f),d.on(kl,g);let w=()=>{d.off("error",f),d.off(kl,g)},y=l(d),M=()=>{try{if(!jl(u))return;let i="hr"===o?/^\d{4}-\d{2}-\d{2}T\d{2}\.log$/:/^\d{4}-\d{2}-\d{2}\.log$/,r=t.readdirSync(u).filter(e=>i.test(e));r.sort();let c=r.length-a;if(c<=0)return;let l=r.slice(0,c);for(let i of l){let r=e.join(s,i);try{t.unlinkSync(e.join(u,i)),n.emit("delete",{fp:r,fn:i})}catch(e){}}}catch(e){console.error("WSyslog cleanLogs error:",e)}},D=setImmediate(()=>{D=null,M()}),x=setInterval(M,36e5);x.unref();let I=null,C=e=>{let t=y[e].bind(y);return(...i)=>{try{n.emit(e,{args:i})}catch(e){}m||t(...i)}};return n.fatal=C("fatal"),n.error=C("error"),n.warn=C("warn"),n.info=C("info"),n.debug=C("debug"),n.trace=C("trace"),n.cleanLogs=M,n.clear=(e={})=>{if(null!==I)return I;null!==D&&(clearImmediate(D),D=null),clearInterval(x);let t=ke(e,"timeLimit");nn(t)||(t=6e4),I=bn();let i=!1,n=()=>{i||(i=!0,d.closed?setImmediate(w):d.once("close",()=>{setImmediate(w)}),I.resolve())},r=setTimeout(()=>{console.error("w-syslog clear: timeout, worker terminated, some logs may be lost");try{d.worker.terminate()}catch(e){}n()},t);try{if(d.closed||d.destroyed)return clearTimeout(r),n(),I;d.once("close",()=>{clearTimeout(r),n()}),d.end()}catch(e){clearTimeout(r),n()}return I},n}function zl(e){if(rn(e))return e.map(zl);if(null==e||""===e)return"";if(!Zi(e))return`(${typeof e})`;let t=null;try{t=new URL(e)}catch(e){return"(invalid-url)"}return"http:"!==t.protocol&&"https:"!==t.protocol?t.protocol:`${t.origin}${t.pathname}`}function Yl(e){return Array.from(e,e=>{let t=e.charCodeAt(0);return t<32||127===t?"?":e}).join("")}function Xl(e){if(rn(e))return e.map(Xl);if(null==e||""===e)return"";if(!Zi(e))return`(${typeof e})`;let t=e.length,i=Math.min(4,Math.floor(t/8));return 0===i?`(len=${t})`:`${Yl(e.slice(0,i))}...${Yl(e.slice(-i))}(len=${t})`}let Gl=["id","account","email","name"];function Fl(e){if(!Zi(e))return e;let t=Yl(e);return t.length>256?`${t.slice(0,256)}...(len=${t.length})`:t}function Wl(e,t){return Zi(e)&&Gl.includes(e)?Fl(t):Xl(t)}var Ol,Pl,Kl={exports:{}},Hl={},Ul={exports:{}},Bl={},Vl={},_l={};function Rl(){if(Ol)return _l;Ol=1,Object.defineProperty(_l,"__esModule",{value:!0}),_l.toUnicode=_l.toASCII=_l.encode=_l.decode=_l.ucs2=_l.version=void 0;const e=2147483647,t=36,i=/^xn--/,n=/[^\0-\x7F]/,r=/[\x2E\u3002\uFF0E\uFF61]/g,s={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=Math.floor,a=String.fromCharCode;function c(e){throw new RangeError(s[e])}function l(e,t){const i=e.split("@");let n="";i.length>1&&(n=i[0]+"@",e=i[1]);const s=function(e,t){const i=[];let n=e.length;for(;n--;)i[n]=t(e[n]);return i}((e=e.replace(r,".")).split("."),t).join(".");return n+s}function u(e){const t=[];let i=0;const n=e.length;for(;i<n;){const r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}const p=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},d=function(e,t){return e+22+75*Number(e<26)-(Number(0!=t)<<5)},m=function(e,i,n){let r=0;for(e=n?o(e/700):e>>1,e+=o(e/i);e>455;r+=t)e=o(e/35);return o(r+36*e/(e+38))},h=function(i){const n=[],r=i.length;let s=0,a=128,l=72,u=i.lastIndexOf("-");u<0&&(u=0);for(let e=0;e<u;++e)i.charCodeAt(e)>=128&&c("not-basic"),n.push(i.charCodeAt(e));for(let d=u>0?u+1:0;d<r;){const u=s;for(let n=1,a=t;;a+=t){d>=r&&c("invalid-input");const u=p(i.charCodeAt(d++));u>=t&&c("invalid-input"),u>o((e-s)/n)&&c("overflow"),s+=u*n;const m=a<=l?1:a>=l+26?26:a-l;if(u<m)break;const h=t-m;n>o(e/h)&&c("overflow"),n*=h}const h=n.length+1;l=m(s-u,h,0==u),o(s/h)>e-a&&c("overflow"),a+=o(s/h),s%=h,n.splice(s++,0,a)}return String.fromCodePoint(...n)};_l.decode=h;const f=function(i){const n=[],r=u(i),s=r.length;let l=128,p=0,h=72;for(const e of r)e<128&&n.push(a(e));const f=n.length;let g=f;for(f&&n.push("-");g<s;){let i=e;for(const e of r)e>=l&&e<i&&(i=e);const s=g+1;i-l>o((e-p)/s)&&c("overflow"),p+=(i-l)*s,l=i;for(const i of r)if(i<l&&++p>e&&c("overflow"),i===l){let e=p;for(let i=t;;i+=t){const r=i<=h?1:i>=h+26?26:i-h;if(e<r)break;const s=e-r,c=t-r;n.push(a(d(r+s%c,0))),e=o(s/c)}n.push(a(d(e,0))),h=m(p,s,g===f),p=0,++g}++p,++l}return n.join("")};_l.encode=f;_l.toUnicode=function(e){return l(e,function(e){return i.test(e)?h(e.slice(4).toLowerCase()):e})};return _l.toASCII=function(e){return l(e,function(e){return n.test(e)?"xn--"+f(e):e})},_l.version="2.3.1",_l.ucs2={decode:u,encode:e=>String.fromCodePoint(...e)},_l}function Ql(){if(Pl)return Vl;Pl=1;var e,t=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=jn&&jn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var s=e(n),o=0;o<s.length;o++)"default"!==s[o]&&t(r,n,s[o]);return i(r,n),r}),r=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.resolve=Vl.parse=void 0;const s=r(d),o=r(m),a=n(Rl()),c=/^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/,l=/^[\x00-\x20]+|[\x00-\x20]+$/g,u=/^[\x00-\x20\u00a0\ufeff]+/,p=/^([a-zA-Z0-9+.-]+:)?[\\/]{2}([^\\/?#]*)/,h=/[\x00-\x20#/:<>?@[\\\]^|\x7f]/,f=/[\x00-\x1f\x7f]/;function g(e,t,i,n){const r=o.default.parse(e,t,n),c=p.exec(e.replace(u,""));if(c&&(c[1]||null!==r.hostname)){const e=c[2].slice(c[2].lastIndexOf("@")+1);if(!e||f.test(e)||(r.host||"").toLowerCase()!==a.toASCII(e.toLowerCase()))throw i;if("["===e.charAt(0)&&!s.default.isIPv6(e.slice(1,e.indexOf("]"))))throw i}else if(null!==r.hostname)throw i;const l=null===r.auth||void 0===r.auth?null:r.auth.split(":"),d=r;return d.username=l?l.shift():null,d.password=l&&l.length?l.join(":"):null,d}function w(e){try{return decodeURIComponent(e)}catch(t){return e}}function y(e,t){const i=e||"";if(!i)return"";if("["===i.charAt(0)&&"]"===i.charAt(i.length-1))return i.slice(1,-1);const n=w(i),r=h.test(n)?"":o.default.domainToASCII(n);if(!r)throw function(e){const t=new TypeError("Invalid URL");return t.code="ERR_INVALID_URL",t.input=e,t}(t);return r}Vl.parse=(e,t)=>{e=(e||"").replace(l,"");const i=c.exec(e),n=i?i[1]+"//"+i[2]:e;let r;try{r=new URL(n)}catch(e){return g(n,t,e)}const s=y(r.hostname,r.href),o=r.port||null,a=r.pathname||null,u=r.search||null;let p,d=null,m=null,h=null;if((r.username||r.password)&&(m=w(r.username),h=r.password?w(r.password):null,d=m+(null!==h?":"+h:"")),t){const e=Object.create(null);r.searchParams.forEach((t,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];Array.isArray(n)?n.push(t):e[i]=[n,t]}else e[i]=t}),p=e}else p=u?u.slice(1):null;return{protocol:r.protocol||null,host:r.host||null,hostname:s,port:o,pathname:a,search:u,path:(a||"")+(u||"")||null,href:r.href,auth:d,username:m,password:h,query:p}};return Vl.resolve=(e,t)=>{try{return new URL(t,e).href}catch(i){return g(e,!1,i,!0),g(t,!1,i,!0),o.default.resolve(e,t)}},Vl}var Jl,ql={exports:{}},$l={exports:{}};var eu,tu={};function iu(){return eu||(eu=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.homepage=tu.version=tu.name=void 0,tu.name="nodemailer",tu.version="10.0.13",tu.homepage="https://nodemailer.com/"),tu}var nu,ru={};function su(){return nu||(nu=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.EFETCH=ru.EURLACCESS=ru.EFILEACCESS=ru.EPROXY=ru.ECONFIG=ru.ESES=ru.ESENDMAIL=ru.EMAXRECIPIENTS=ru.EMAXLIMIT=ru.EOAUTH2=ru.ENOAUTH=ru.EAUTH=ru.ESTREAM=ru.EMESSAGE=ru.EENVELOPE=ru.EPROTOCOL=ru.EREQUIRETLS=ru.ETLS=ru.EDNS=ru.ESOCKET=ru.ETIMEDOUT=ru.ECONNECTION=ru.ERROR_CODES=void 0,ru.ERROR_CODES={ECONNECTION:"Connection closed unexpectedly",ETIMEDOUT:"Connection or operation timed out",ESOCKET:"Socket-level error",EDNS:"DNS resolution failed",ETLS:"TLS handshake or STARTTLS failed",EREQUIRETLS:"REQUIRETLS not supported by server (RFC 8689)",EPROTOCOL:"Invalid SMTP server response",EENVELOPE:"Invalid mail envelope (sender or recipients)",EMESSAGE:"Message delivery error",ESTREAM:"Stream processing error",EAUTH:"Authentication failed",ENOAUTH:"Authentication credentials not provided",EOAUTH2:"OAuth2 token generation or refresh error",EMAXLIMIT:"Pool resource limit reached (max messages per connection)",EMAXRECIPIENTS:"Recipient count exceeds maxRecipients",ESENDMAIL:"Sendmail command error",ESES:"AWS SES transport error",ECONFIG:"Invalid configuration",EPROXY:"Proxy connection error",EFILEACCESS:"File access rejected (disableFileAccess is set)",EURLACCESS:"URL access rejected (disableUrlAccess is set)",EFETCH:"HTTP fetch error"},ru.ECONNECTION="ECONNECTION",ru.ETIMEDOUT="ETIMEDOUT",ru.ESOCKET="ESOCKET",ru.EDNS="EDNS",ru.ETLS="ETLS",ru.EREQUIRETLS="EREQUIRETLS",ru.EPROTOCOL="EPROTOCOL",ru.EENVELOPE="EENVELOPE",ru.EMESSAGE="EMESSAGE",ru.ESTREAM="ESTREAM",ru.EAUTH="EAUTH",ru.ENOAUTH="ENOAUTH",ru.EOAUTH2="EOAUTH2",ru.EMAXLIMIT="EMAXLIMIT",ru.EMAXRECIPIENTS="EMAXRECIPIENTS",ru.ESENDMAIL="ESENDMAIL",ru.ESES="ESES",ru.ECONFIG="ECONFIG",ru.EPROXY="EPROXY",ru.EFILEACCESS="EFILEACCESS",ru.EURLACCESS="EURLACCESS",ru.EFETCH="EFETCH"),ru}var ou,au,cu,lu={};function uu(){return ou||(ou=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.copyOwnKeys=e.isProtoKey=void 0;e.isProtoKey=e=>"__proto__"===e;e.copyOwnKeys=(t,i,n)=>(Object.keys(i||{}).forEach(r=>{(0,e.isProtoKey)(r)||n&&n(r)||(t[r]=i[r])}),t)}(lu)),lu}function pu(){return au||(au=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(g),c=o(w),l=s(Ql()),u=o(y),p=M,m=o((Jl||(Jl=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(d),c=s(Ql());t.default=class{constructor(e){this.options=e||{},this.cookies=[]}set(e,t){const i=c.parse(t||""),n=this.parse(e);let r;return n.domain?(r=n.domain.replace(/^\./,""),(i.hostname.length<r.length||r.indexOf(".")<0||r.endsWith(".")||a.default.isIP(i.hostname)||!("."+i.hostname).endsWith("."+r))&&(n.domain=i.hostname)):n.domain=i.hostname,n.path||(n.path=this.getPath(i.pathname)),n.expires||(n.expires=new Date(Date.now()+1e3*(Number(this.options.sessionTimeout||1800)||1800))),this.add(n)}get(e){return this.list(e).map(e=>e.name+"="+e.value).join("; ")}list(e){const t=[];for(let i=this.cookies.length-1;i>=0;i--){const n=this.cookies[i];this.isExpired(n)?this.cookies.splice(i,1):this.match(n,e)&&t.unshift(n)}return t}parse(e){const t={};return(e||"").toString().split(";").forEach(e=>{const i=e.split("="),n=i.shift().trim().toLowerCase();let r,s=i.join("=").trim();if(n)switch(n){case"expires":{const e=new Date(s);"Invalid Date"!==e.toString()&&(t.expires=e);break}case"path":t.path=s;break;case"domain":r=s.toLowerCase(),r.length&&"."!==r.charAt(0)&&(r="."+r),t.domain=r;break;case"max-age":t.expires=new Date(Date.now()+1e3*(Number(s)||0));break;case"secure":t.secure=!0;break;case"httponly":t.httponly=!0;break;default:t.name||(t.name=n,t.value=s)}}),t}match(e,t){const i=c.parse(t||"");if(i.hostname!==e.domain&&("."!==e.domain.charAt(0)||("."+i.hostname).substr(-e.domain.length)!==e.domain))return!1;const n=i.pathname||"/",r=e.path;return!(n!==r&&(!n.startsWith(r)||!r.endsWith("/")&&"/"!==n.charAt(r.length))||e.secure&&"https:"!==i.protocol)}add(e){if(!e||!e.name)return!1;for(let t=0,i=this.cookies.length;t<i;t++)if(this.compare(this.cookies[t],e))return this.isExpired(e)?(this.cookies.splice(t,1),!1):(this.cookies[t]=e,!0);return this.isExpired(e)||this.cookies.push(e),!0}compare(e,t){return e.name===t.name&&e.path===t.path&&e.domain===t.domain&&e.secure===t.secure&&e.httponly===t.httponly}isExpired(e){return e.expires&&e.expires<new Date||!e.value}getPath(e){const t=(e||"/").split("/");t.pop();const i=t.join("/").trim();return"/"!==i.charAt(0)?"/":i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}($l,$l.exports)),$l.exports)),h=s(iu()),f=o(d),D=s(su()),x=uu(),I=["ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","dhparam","ecdhCurve","honorCipherOrder","key","maxVersion","minVersion","passphrase","pfx","rejectUnauthorized","secureContext","secureOptions","secureProtocol","servername","sessionIdContext","sigalgs"];function C(e){let t;try{t=l.parse(e)}catch(e){return!1}return("http:"===t.protocol||"https:"===t.protocol)&&t}function b(e,t){(t=t||{}).fetchRes=t.fetchRes||new p.PassThrough,t.cookies=t.cookies||new m.default,t.redirects=t.redirects||0,t.maxRedirects=isNaN(t.maxRedirects)?5:t.maxRedirects;const i=t.fetchRes,n=C(e);if(!n)return t.body&&"function"==typeof t.body.destroy&&(t.body.on("error",()=>!1),t.body.destroy()),setImmediate(()=>{const t=new Error("Unsupported protocol for URL "+e);t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i;t.cookie&&([].concat(t.cookie||[]).forEach(i=>{t.cookies.set(i,e)}),t.cookie=!1);let r,s,o=(t.method||"").toString().trim().toUpperCase()||"GET",d=!1;const g="https:"===n.protocol?c.default:a.default,w={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+h.version};if(Object.keys(t.headers||{}).forEach(e=>{(0,x.isProtoKey)(e.toLowerCase().trim())||(w[e.toLowerCase().trim()]=t.headers[e])}),t.userAgent&&(w["user-agent"]=t.userAgent),n.auth&&(w.Authorization="Basic "+Buffer.from(n.auth).toString("base64")),(r=t.cookies.get(e))&&(w.cookie=r),t.body){if(!1!==t.contentType&&(w["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"),"function"==typeof t.body.pipe)w["Transfer-Encoding"]="chunked",s=t.body,s.on("error",t=>{d||(d=!0,t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t))});else{if(t.body instanceof Buffer)s=t.body;else if("object"==typeof t.body)try{s=Buffer.from(Object.keys(t.body).map(e=>{const i=t.body[e].toString().trim();return encodeURIComponent(e)+"="+encodeURIComponent(i)}).join("&"))}catch(t){return d=!0,t.code=D.EFETCH,t.sourceUrl=e,setImmediate(()=>i.emit("error",t)),i}else s=Buffer.from(t.body.toString().trim());w["Content-Type"]=t.contentType||"application/x-www-form-urlencoded",w["Content-Length"]=s.length}o=(t.method||"").toString().trim().toUpperCase()||"POST"}let y;const M={method:o,host:n.hostname,path:n.path,port:n.port?n.port:"https:"===n.protocol?443:80,headers:w,rejectUnauthorized:!0,agent:!1};t.tls&&Object.keys(t.tls).forEach(e=>{I.includes(e)&&(M[e]=t.tls[e])}),"https:"!==n.protocol||!n.hostname||n.hostname===M.host||f.default.isIP(n.hostname)||M.servername||(M.servername=n.hostname);try{y=g.request(M)}catch(t){return d=!0,setImmediate(()=>{t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i}const v=(t,n=e)=>{d||(d=!0,t.code=D.EFETCH,t.sourceUrl=n,i.emit("error",t),y.abort())},L="number"==typeof t.timeout&&t.timeout>=0?t.timeout:6e4;return L&&y.setTimeout(L,()=>v(new Error("Request Timeout"))),y.on("error",e=>v(e)),y.on("response",r=>{let s;if(d)return;switch(r.headers["content-encoding"]){case"gzip":case"deflate":s=u.default.createUnzip()}if(r.headers["set-cookie"]&&[].concat(r.headers["set-cookie"]||[]).forEach(i=>{t.cookies.set(i,e)}),[301,302,303,307,308].includes(r.statusCode)&&r.headers.location){if(t.redirects++,t.redirects>t.maxRedirects)return v(new Error("Maximum redirect count exceeded"));let i;t.method="GET",t.body=!1;try{i=l.resolve(e,r.headers.location)}catch(e){i=r.headers.location}const s=C(i);if(!s)return v(new Error("Unsupported protocol for URL "+i),i);const o=s.hostname!==n.hostname,a="https:"===n.protocol&&"http:"===s.protocol;if(t.headers&&(o||a)){const e=["authorization","cookie","proxy-authorization"];Object.keys(t.headers).forEach(i=>{e.includes(i.toLowerCase())&&delete t.headers[i]})}return d=!0,r.resume(),y.abort(),b(i,t)}if(i.statusCode=r.statusCode,i.headers=r.headers,r.statusCode>=300&&!t.allowErrorResponse)return v(new Error("Invalid status code "+r.statusCode));r.on("error",e=>v(e));const o="number"==typeof t.maxBytes&&t.maxBytes>0?t.maxBytes:67108864,a=s||r;let c=0;a.on("data",e=>{c+=e.length,c<=o||d||(a.unpipe(i),v(new Error("Response size exceeds the allowed "+o+" bytes")))}),s?(r.pipe(s).pipe(i),s.on("error",e=>v(e))):r.pipe(i)}),setImmediate(()=>{if(s)try{if("function"==typeof s.pipe)return s.pipe(y);y.write(s)}catch(e){return v(e)}y.end()}),i}b.Cookies=m.default,b.DEFAULT_TIMEOUT=6e4,t.default=b,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ql,ql.exports)),ql.exports}function du(){return cu||(cu=1,function(e){var t,i=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=jn&&jn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var s=t(e),o=0;o<s.length;o++)"default"!==s[o]&&i(r,e,s[o]);return n(r,e),r}),s=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeXText=e.assign=e.parseDataURI=e.callbackPromise=e.getLogger=e._logFunc=e.parseConnectionUrl=e.resolveHostname=e.dnsCache=e.networkInterfaces=e._resetCacheCleanup=e._lastCacheCleanup=e.copyOwnKeys=e.isProtoKey=void 0,e.resolveContent=function(t,i,n,r){r||"function"!=typeof n||(r=n,n=!1);let s;n=n||{},r||(s=new Promise((t,i)=>{r=(0,e.callbackPromise)(t,i)}));return function(t,i,n,r){let s=t&&t[i]&&t[i].content||t[i];const o=("object"==typeof t[i]&&t[i].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!s)return r(null,s);if("object"==typeof s){if("function"==typeof s.pipe)return v(s,(e,n)=>{if(e)return r(e);t[i].content?t[i].content=n:t[i]=n,r(null,n)});if(/^data:/i.test(s.path||s.href)){const t=(0,e.parseDataURI)(s.path||s.href);return r(null,t&&t.data?t.data:Buffer.alloc(0))}if(s.href||/^https?:\/\//i.test(s.path)){const e=s.href||s.path;return n.disableUrlAccess?void setImmediate(()=>{const t=new Error("Url access rejected for "+e);t.code=u.EURLACCESS,r(t)}):v((0,l.default)(e,{headers:s.httpHeaders,tls:s.tls}),r)}if(s.path)return n.disableFileAccess?void setImmediate(()=>{const e=new Error("File access rejected for "+s.path);e.code=u.EFILEACCESS,r(e)}):v(c.default.createReadStream(s.path),r)}"string"!=typeof t[i].content||["utf8","usascii","ascii"].includes(o)||(s=Buffer.from(t[i].content,o));setImmediate(()=>r(null,s))}(t,i,n,r),s};const o=r(Ql()),a=s(h),c=s(f),l=s(pu()),u=r(su()),p=uu();Object.defineProperty(e,"isProtoKey",{enumerable:!0,get:function(){return p.isProtoKey}}),Object.defineProperty(e,"copyOwnKeys",{enumerable:!0,get:function(){return p.copyOwnKeys}});const m=s(D),g=s(d),w=s(x),y=3e5;let M=0;e._lastCacheCleanup=()=>M;e._resetCacheCleanup=()=>{M=0};try{e.networkInterfaces=w.default.networkInterfaces()}catch(e){}const I=(t,i)=>{const n=Object.values(e.networkInterfaces||{}).flat();return!n.length||n.filter(e=>!e.internal||i).some(e=>e.family==="IPv"+t||e.family===t)},C=(e,t,i,n)=>{if(!I(e,(i=i||{}).allowInternalNetworkInterfaces))return n(null,[]);(m.default.Resolver?new m.default.Resolver(i):m.default)["resolve"+e](t,(e,t)=>{if(e){switch(e.code){case m.default.NODATA:case m.default.NOTFOUND:case m.default.NOTIMP:case m.default.SERVFAIL:case m.default.CONNREFUSED:case m.default.REFUSED:case"EAI_AGAIN":return n(null,[])}return n(e)}return n(null,Array.isArray(t)?t:[].concat(t||[]))})};e.dnsCache=new Map;const b=(e,t)=>{if(!e)return Object.assign({},t||{});const i=e.addresses||[],n=i.length>0?i[Math.floor(Math.random()*i.length)]:null;return Object.assign({host:n,_addresses:i},t||{})};e.resolveHostname=(t,i)=>{if(!(t=t||{}).host&&t.servername&&(t.host=t.servername),!t.host||g.default.isIP(t.host)){const e={addresses:[t.host]};return i(null,b(e,{servername:t.servername||!1,cached:!1}))}const n=t.host,r=t.servername||n;let s;if(e.dnsCache.has(t.host)){s=e.dnsCache.get(t.host);const n=Date.now();if(n-M>3e4){M=n;for(const[t,i]of e.dnsCache.entries())i.expires&&i.expires<n&&e.dnsCache.delete(t);if(e.dnsCache.size>1e3){const t=Math.floor(100);Array.from(e.dnsCache.keys()).slice(0,t).forEach(t=>e.dnsCache.delete(t))}}if(!s.expires||s.expires>=n)return i(null,b(s.value,{servername:r,cached:!0}))}let o=[],a=[],c=null,l=null;C(4,t.host,t,(u,p)=>{u?c=u:o=p||[],C(6,n,t,(u,p)=>{u?l=u:a=p||[];const d=o.concat(a);if(d.length){const s={addresses:d};return e.dnsCache.set(n,{value:s,expires:Date.now()+(t.dnsTtl||y)}),i(null,b(s,{servername:r,cached:!1}))}if(c&&l&&s)return e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,b(s.value,{servername:r,cached:!0,error:c}));try{m.default.lookup(n,{all:!0},(o,a)=>{if(o)return s?(e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,b(s.value,{servername:r,cached:!0,error:o}))):i(o);const c=a?a.filter(e=>I(e.family)).map(e=>e.address):[];if(a&&a.length&&!c.length&&console.warn(`Failed to resolve IPv${a[0].family} addresses with current network`),!c.length&&s)return i(null,b(s.value,{servername:r,cached:!0}));const l={addresses:c.length?c:[n]};return e.dnsCache.set(n,{value:l,expires:Date.now()+(t.dnsTtl||y)}),i(null,b(l,{servername:r,cached:!1}))})}catch(o){return s?(e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,b(s.value,{servername:r,cached:!0,error:o}))):i(c||l||o)}})})};e.parseConnectionUrl=e=>{e=e||"";const t={},i=o.parse(e,!0);switch(i.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0}return!isNaN(i.port)&&Number(i.port)&&(t.port=Number(i.port)),i.hostname&&(t.host=i.hostname),(i.username||i.password)&&(t.auth={user:i.username||"",pass:i.password||""}),Object.keys(i.query||{}).forEach(e=>{let n=t,r=e,s=i.query[e];switch(isNaN(s)||(s=Number(s)),s){case"true":s=!0;break;case"false":s=!1}if(0===e.indexOf("tls."))r=e.substr(4),t.tls||(t.tls={}),n=t.tls;else if(e.indexOf(".")>=0)return;(0,p.isProtoKey)(r)||r in n||(n[r]=s)}),t};e._logFunc=(e,t,i,n,r,...s)=>{const o=Object.assign({},i||{},n||{});delete o.level;let a=t;"function"!=typeof e[a]&&(a=["info","debug","log","trace","warn","error"].find(t=>"function"==typeof e[t])),a&&e[a](o,r,...s)};e.getLogger=(t,i)=>{const n={},r=["trace","debug","info","warn","error","fatal"];if(!(t=t||{}).logger)return r.forEach(e=>{n[e]=()=>!1}),n;const s=!0===t.logger?function(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0),i=new Map;e.forEach(e=>{let n=e.toUpperCase();n.length<t&&(n+=" ".repeat(t-n.length)),i.set(e,n)});const n=(e,t,n,...r)=>{let s="";t&&("server"===t.tnx?s="S: ":"client"===t.tnx&&(s="C: "),t.sid&&(s="["+t.sid+"] "+s),t.cid&&(s="[#"+t.cid+"] "+s)),(n=a.default.format(n,...r)).split(/\r?\n/).forEach(t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),i.get(e),s+t)})},r={};return e.forEach(e=>{r[e]=n.bind(null,e)}),r}(r):t.logger;return r.forEach(t=>{n[t]=(...n)=>{const r="string"==typeof n[0]?void 0:n.shift();(0,e._logFunc)(s,t,i,r,...n)}}),n};e.callbackPromise=(e,t)=>function(...i){const n=i.shift();n?t(n):e(...i)};e.parseDataURI=e=>{if("string"!=typeof e)return null;if(!e.startsWith("data:"))return null;const t=e.indexOf(",");if(-1===t)return null;const i=e.substring(t+1);let n;const r=e.substring(5,t).split(";");if(r.length>0){const e=r[r.length-1].toLowerCase().trim();["base64","utf8","utf-8"].includes(e)&&-1===e.indexOf("=")&&(n=e,r.pop())}const s=r.length>0?r.shift():"application/octet-stream",o={};for(let e=0;e<r.length;e++){const t=r[e],i=t.indexOf("=");if(i>0){const e=t.substring(0,i).trim(),n=t.substring(i+1).trim();e&&!(0,p.isProtoKey)(e)&&(o[e]=n)}}let a;try{if("base64"===n)a=Buffer.from(i,"base64");else try{a=Buffer.from(decodeURIComponent(i))}catch(e){a=Buffer.from(i)}}catch(e){a=Buffer.alloc(0)}return{data:a,encoding:n||null,contentType:s||"application/octet-stream",params:o}};e.assign=function(...e){const t=e.shift()||{};return e.forEach(e=>{Object.keys(e||{}).forEach(i=>{(0,p.isProtoKey)(i)||(["tls","auth"].includes(i)&&e[i]&&"object"==typeof e[i]?t[i]=(0,p.copyOwnKeys)(t[i]||{},e[i]):t[i]=e[i])})}),t};function v(e,t){let i=!1;const n=[];let r=0;e.on("error",e=>{i||(i=!0,t(e))}),e.on("readable",()=>{let t;for(;null!==(t=e.read());)n.push(t),r+=t.length}),e.on("end",()=>{if(i)return;let e;i=!0;try{e=Buffer.concat(n,r)}catch(e){return t(e)}t(null,e)})}e.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e))return e;const t=Buffer.from(e);let i="";for(let e=0,n=t.length;e<n;e++){const n=t[e];i+=n<33||n>126||43===n||61===n?"+"+(n<16?"0":"")+n.toString(16).toUpperCase():String.fromCharCode(n)}return i}}(Bl)),Bl}var mu,hu={};function fu(){if(mu)return hu;mu=1;var e=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hu,"__esModule",{value:!0}),hu.detectMimeType=function(e){if(!e)return i;const n=t.default.parse(e),r=(n.ext.substr(1)||n.name||"").split("?").shift().trim().toLowerCase(),o=s.has(r)?s.get(r):i;if(Array.isArray(o))return o[0];return o},hu.detectExtension=function(e){if(!e)return n;const t=e.toLowerCase().trim().split("/"),i=t.shift().trim(),s=t.join("/").trim();if(r.has(i+"/"+s)){const e=r.get(i+"/"+s);return Array.isArray(e)?e[0]:e}if("text"===i)return"txt";return"bin"};const t=e(I),i="application/octet-stream",n="bin",r=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/geo+json","geojson"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]),s=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);return hu}var gu,wu={exports:{}},yu={exports:{}},Mu={},Du={};function xu(){if(gu)return Du;gu=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.Encoder=void 0,Du.encode=t,Du.wrap=i;const e=M;function t(e){return"string"==typeof e&&(e=Buffer.from(e,"utf-8")),e.toString("base64")}function i(e,t){if(e=(e||"").toString(),t=Math.max(Number(t)||76,1),e.length<=t)return e;const i=[];let n=0;const r=1024*t,s=new RegExp(".{"+t+"}","g");for(;n<e.length;){const t=e.substr(n,r).replace(s,"$&\r\n").trim();i.push(t),n+=r}return i.join("\r\n").trim()}class n extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this._remainingBytes=!1,this.inputBytes=0,this.outputBytes=0}_transform(e,n,r){let s="buffer"!==n?Buffer.from(e,n):e;if(!s||!s.length)return void setImmediate(r);this.inputBytes+=s.length,this._remainingBytes&&this._remainingBytes.length&&(s=Buffer.concat([this._remainingBytes,s],this._remainingBytes.length+s.length),this._remainingBytes=!1),s.length%3?(this._remainingBytes=s.slice(s.length-s.length%3),s=s.slice(0,s.length-s.length%3)):this._remainingBytes=!1;let o=this._curLine+t(s);if(this.options.lineLength){o=i(o,this.options.lineLength);const e=o.lastIndexOf("\n");e<0?(this._curLine=o,o=""):e===o.length-1?this._curLine="":(this._curLine=o.substring(e+1),o=o.substring(0,e+1))}o&&(this.outputBytes+=o.length,this.push(Buffer.from(o,"ascii"))),setImmediate(r)}_flush(e){this._remainingBytes&&this._remainingBytes.length&&(this._curLine+=t(this._remainingBytes)),this._curLine&&(this._curLine=i(this._curLine,this.options.lineLength),this.outputBytes+=this._curLine.length,this.push(Buffer.from(this._curLine,"ascii")),this._curLine=""),e()}}return Du.Encoder=n,Du}var Iu,Cu,bu={};function vu(){if(Iu)return bu;Iu=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.Encoder=void 0,bu.encode=n,bu.wrap=r;const e=M,t=4,i=[[9],[10],[13],[32,60],[62,126]];function n(e){"string"==typeof e&&(e=Buffer.from(e,"utf-8"));let t,n="";for(let r=0,o=e.length;r<o;r++)t=e[r],s(t,i)&&(32!==t&&9!==t||r!==o-1&&10!==e[r+1]&&13!==e[r+1])?n+=String.fromCharCode(t):n+="="+(t<16?"0":"")+t.toString(16).toUpperCase();return n}function r(e,i){if(e=(e||"").toString(),i=Math.max(Number(i)||76,t),e.length<=i)return e;let n=0;const r=e.length;let s,o,a;const c=Math.floor(i/3);let l="";for(;n<r;)if(a=e.substr(n,i),s=a.match(/\r\n/))a=a.substr(0,s.index+s[0].length),l+=a,n+=a.length;else if("\n"!==a.substr(-1))if(s=a.substr(-c).match(/\n.*?$/))a=a.substr(0,a.length-(s[0].length-1)),l+=a,n+=a.length;else{if(a.length>i-c&&(s=a.substr(-c).match(/[ \t.,!?][^ \t.,!?]*$/)))a=a.substr(0,a.length-(s[0].length-1));else if(a.match(/[=][\da-f]{0,2}$/i))for((s=a.match(/[=][\da-f]{0,1}$/i))&&(a=a.substr(0,a.length-s[0].length));a.length>3&&a.length<r-n&&!a.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(s=a.match(/[=][\da-f]{2}$/gi))&&(o=parseInt(s[0].substr(1,2),16),!(o<128))&&(a=a.substr(0,a.length-3),!(o>=192)););a.length||(a=e.substr(n,i)),n+a.length<r&&"\n"!==a.substr(-1)?(a.length===i&&a.match(/[=][\da-f]{2}$/i)?a=a.substr(0,a.length-3):a.length===i&&(a=a.substr(0,a.length-1)),n+=a.length,a+="=\r\n"):n+=a.length,l+=a}else l+=a,n+=a.length;return l}function s(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.length){if(1===n.length&&e===n[0])return!0;if(2===n.length&&e>=n[0]&&e<=n[1])return!0}}return!1}class o extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(e,t,i){let s;if("buffer"!==t&&(e=Buffer.from(e,t)),!e||!e.length)return i();this.inputBytes+=e.length,this.options.lineLength?(s=this._curLine+n(e),s=r(s,this.options.lineLength),s=s.replace(/(^|\n)([^\n]*)$/,(e,t,i)=>(this._curLine=i,t)),s&&(this.outputBytes+=s.length,this.push(s))):(s=n(e),this.outputBytes+=s.length,this.push(s,"ascii")),i()}_flush(e){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),e()}}return bu.Encoder=o,bu}function Lu(){if(Cu)return Mu;Cu=1;var e,t=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=jn&&jn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var s=e(n),o=0;o<s.length;o++)"default"!==s[o]&&t(r,n,s[o]);return i(r,n),r});Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.isPlainText=c,Mu.quoteString=function(e){return'"'+(e||"").toString().replace(/["\\]/g,"\\$&")+'"'},Mu.hasLongerLines=function(e,t){if(e.length>131072)return!0;return new RegExp("^.{"+(t+1)+",}","m").test(e)},Mu.encodeWord=l,Mu.encodeWords=function(e,t,i,n){i=i||0;const r=e.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!r)return e;if(n)return l(e,t,i);const s=e.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!s)return e;const o=r.index+(r[0].match(/[^\s]/)||{index:0}).index,a=s.index+(s[1]||"").length;return(o?e.substr(0,o):"")+l(e.substring(o,a),t||"Q",i)+(a<e.length?e.substr(a):"")},Mu.buildHeaderValue=function(e){const t=[];Object.keys(e.params||{}).forEach(i=>{const n=e.params[i],r=i.replace(/[\x00-\x1f\x7f]/g,"");!c(n,!0)||n.length>=75?u(r,n,50).forEach(e=>{/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(e.value)&&"*"!==e.key.substr(-1)?t.push(e.key+"="+JSON.stringify(e.value)):t.push(e.key+"="+e.value)}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)?t.push(r+"="+JSON.stringify(n)):t.push(r+"="+n)});return("string"==typeof e.value?e.value.replace(/[\x00-\x1f\x7f]/g,""):e.value)+(t.length?"; "+t.join("; "):"")},Mu.buildHeaderParam=u,Mu.parseHeaderValue=function(e){const t={value:"",params:{}},i=(e,i)=>{(0,a.isProtoKey)(e)||(t.params[e]=i)};let n,r=!1,s="",o="value",c=!1,l=!1;for(let a=0,u=e.length;a<u;a++)if(n=e.charAt(a),"key"===o){if("="===n){r=s.trim().toLowerCase(),o="value",s="";continue}s+=n}else{if(l)s+=n;else{if("\\"===n){l=!0;continue}c&&n===c?c=!1:c||'"'!==n?c||";"!==n?s+=n:(!1===r?t.value=s.trim():i(r,s.trim()),o="key",s=""):c=n}l=!1}"value"===o?!1===r?t.value=s.trim():i(r,s.trim()):s.trim()&&i(s.trim().toLowerCase(),"");return Object.keys(t.params).forEach(e=>{let i,n,r,s;if(r=e.match(/(\*(\d+)|\*(\d+)\*|\*)$/)){if(i=e.substr(0,r.index),n=Number(r[2]||r[3])||0,(0,a.isProtoKey)(i))return void delete t.params[e];t.params[i]&&"object"==typeof t.params[i]||(t.params[i]={charset:!1,values:[]}),s=t.params[e],0===n&&"*"===r[0].substr(-1)&&(r=s.match(/^([^']*)'[^']*'(.*)$/))&&(t.params[i].charset=r[1]||"iso-8859-1",s=r[2]),t.params[i].values[n]=s,delete t.params[e]}}),Object.keys(t.params).forEach(e=>{let i;t.params[e]&&Array.isArray(t.params[e].values)&&(i=t.params[e].values.map(e=>e||"").join(""),t.params[e].charset?t.params[e]="=?"+t.params[e].charset+"?Q?"+i.replace(/[=?_\s]/g,e=>{const t=e.charCodeAt(0).toString(16);return" "===e?"_":"%"+(t.length<2?"0":"")+t}).replace(/%/g,"=")+"?=":t.params[e]=i)}),t},Mu.detectExtension=function(e){return o.detectExtension(e)},Mu.detectMimeType=function(e){return o.detectMimeType(e)},Mu.foldLines=function(e,t,i){e=(e||"").toString(),t=t||76;let n=0;const r=e.length;let s,o,a="";for(;n<r;){if(s=e.substr(n,t),s.length<t){a+=s;break}(o=s.match(/^[^\n\r]*(\r?\n|\r)/))?(s=o[0],a+=s,n+=s.length):((o=s.match(/(\s+)[^\s]*$/))&&o[0].length-(i?(o[1]||"").length:0)<s.length?s=s.substr(0,s.length-(o[0].length-(i?(o[1]||"").length:0))):(o=e.substr(n+s.length).match(/^[^\s]+(\s*)/))&&(s+=o[0].substr(0,o[0].length-(i?0:(o[1]||"").length))),a+=s,n+=s.length,n<r&&(a+="\r\n"))}return a},Mu.splitMimeEncodedString=p,Mu.encodeURICharComponent=d,Mu.safeEncodeURIComponent=m;const r=n(xu()),s=n(vu()),o=n(fu()),a=uu();function c(e,t){return"string"==typeof e&&!(t?/[\x00-\x1f\x7f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(e)}function l(e,t,i){let n;if((i=i||0)&&i>12&&(i-=12),"Q"===(t=(t||"Q").toString().toUpperCase().trim().charAt(0))?n=s.encode(e).replace(/[^a-z0-9!*+\-/=]/gi,e=>{const t=e.charCodeAt(0).toString(16).toUpperCase();return" "===e?"_":"="+(1===t.length?"0"+t:t)}):"B"===t&&(n="string"==typeof e?e:e.toString("utf-8"),i=i?Math.max(3,(i-i%4)/4*3):0),i&&("B"!==t?n:r.encode(e)).length>i)if("Q"===t)n=p(n,i).join("?= =?UTF-8?"+t+"?");else{const e=[];let s="";for(let t=0,o=n.length;t<o;t++){let o=n.charAt(t);/[\ud800-\udbff]/.test(o)&&/[\udc00-\udfff]/.test(n.charAt(t+1))&&(o+=n.charAt(++t)),Buffer.byteLength(s+o)<=i||0===t?s+=o:(e.push(r.encode(s)),s=o)}s&&e.push(r.encode(s)),n=e.length>1?e.join("?= =?UTF-8?"+t+"?"):e.join("")}else"B"===t&&(n=r.encode(e));return"=?UTF-8?"+t+"?"+n+("?="===n.substr(-2)?"":"?=")}function u(e,t,i){const n=[];let r,s,o,a,l="string"==typeof t?t:(t||"").toString(),u=0;if(i=i||50,c(t,!0)){if(l.length<=i)return[{key:e,value:l}];l=l.replace(new RegExp(".{"+i+"}","g"),e=>(n.push({line:e}),"")),l&&n.push({line:l})}else{if(/[\uD800-\uDBFF]/.test(l)){const e=[];for(o=0,a=l.length;o<a;o++)r=l.charAt(o),/[\ud800-\udbff]/.test(r)&&/[\udc00-\udfff]/.test(l.charAt(o+1))?(r+=l.charAt(o+1),e.push(r),o++):e.push(r);l=e}s="utf-8''";let e=!0;for(u=0,o=0,a=l.length;o<a;o++){if(r=l[o],e)r=m(r);else if(r=" "===r?r:m(r),r!==l[o]){if(!((m(s)+r).length>=i)){e=!0,o=u,s="";continue}n.push({line:s,encoded:e}),s="",e=!0}(s+r).length>=i?(n.push({line:s,encoded:e}),s=r=" "===l[o]?" ":m(l[o]),r===l[o]?(e=!1,u=o-1):e=!0):s+=r}s&&n.push({line:s,encoded:e})}return n.map((t,i)=>({key:e+"*"+i+(t.encoded?"*":""),value:t.line}))}function p(e,t){const i=[];let n,r,s,o,a;for(t=Math.max(t||0,12);e.length;){for(n=e.substr(0,t),(s=n.match(/[=][0-9A-F]?$/i))&&(n=n.substr(0,s.index)),r=n.length?n:e.substr(0,t),a=!1;!a&&n.length;)a=!0,(s=e.substr(n.length).match(/^[=]([0-9A-F]{2})/i))&&(o=parseInt(s[1],16),o<194&&o>127&&(n=n.substr(0,n.length-3),a=!1));n.length||(n=r),i.push(n),e=e.substr(n.length)}return i}function d(e){let t="",i=e.charCodeAt(0).toString(16).toUpperCase();if(i.length%2&&(i="0"+i),i.length>2)for(let e=0,n=i.length/2;e<n;e++)t+="%"+i.substr(e,2);else t+="%"+i;return t}function m(e){e=(e||"").toString();try{e=encodeURIComponent(e)}catch(t){e=encodeURIComponent(Buffer.from(e,"utf-8").toString("utf-8"))}return e.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,e=>d(e))}return Mu}var Eu,Au={exports:{}};function Nu(){return Eu||(Eu=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=/\s/,n=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,r=/^[^@\s]+@[^@\s]+$/,s=/^[^@\s]+@\S+$/,o=/\s*\b[^@\s]+@[^\s]+\b\s*/y;function a(e){return 32===e||e>=9&&e<=13||160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||95===e}function l(e,t){return c(e.charCodeAt(t-1))!==c(e.charCodeAt(t))}function u(e,t,i){for(let n=t;n<i;n++)if(64===e.charCodeAt(n))return n;return-1}function p(e){const t=e.length;let i=0;for(;i<t;){for(;i<t&&a(e.charCodeAt(i));)i++;if(i>=t)break;const n=i;let r=i;for(;r<t&&!a(e.charCodeAt(r));)r++;let s=u(e,n,r);if(s>=0){let t=-1;for(let i=r;i>n;i--)if(l(e,i)){t=i;break}let i=n;for(;t>=0&&s>=0;){if(s>i&&r>s+1&&t>s+1)for(let t=i;t<s;t++)if(l(e,t)){if(t>n)return t;let i=n;for(;i>0&&a(e.charCodeAt(i-1));)i--;return i}i=s+1,s=u(e,i,r)}}i=r}return-1}function d(e){const t=[];let i="",n="",r=0,s="",o="";for(let a=0,c=e.length;a<c;a++){const l=e.charAt(a);if(r)"\\"===l&&a<c-1?n+=e.charAt(++a):"("===l?(r++,n+=l):")"!==l||--r?n+=l:(t.push(n.trim()),n="","@"!==o&&"@"!==e.charAt(a+1)&&(i+=" ",o=" "));else{if(s){if("\\"===l&&'"'===s&&a<c-1){i+=l+e.charAt(++a),o=e.charAt(a);continue}l===s&&(s="")}else if('"'===l)s='"';else if("["===l)s="]";else if("("===l){r=1;continue}i+=l,o=l}}return r&&t.push(n.trim()),{address:i.trim(),comments:t.filter(e=>e)}}function m(e,t){let a=!1,c="text";const l=[],u={address:[],comment:[],group:[],text:[],textWasQuoted:[]};let m=!1;const h={address:"",comment:"",group:"",text:""};for(let t=0,i=e.length;t<i;t++){const i=e[t],n=t?e[t-1]:null;if("operator"===i.type)switch(i.value){case"<":c="address",m=!1;break;case"(":c="comment",m=!1;break;case":":c="group",a=!0,m=!1;break;case'"':m=!m,c="text";break;default:c="text",m=!1}else if(i.value){const r=t>1?e[t-2]:null,s="operator"===n?.type&&'"'===n.value&&!!n.noBreak&&"operator"===r?.type&&'"'===r.value;"address"===c&&(i.value=i.value.replace(/^[^<]*<\s*/,""));const o=u[c];n&&n.noBreak&&o.length&&(")"!==n.value||"@"===h[c]||"@"===i.value.charAt(0))?(u[c][u[c].length-1]+=i.value,i.value&&(h[c]=i.value.charAt(i.value.length-1)),"text"===c&&m&&(u.textWasQuoted[u.textWasQuoted.length-1]=!0)):(u[c].push(i.value),h[c]=i.value.charAt(i.value.length-1),"text"===c&&u.textWasQuoted.push(m||s))}}if(!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),a){u.text=u.text.join(" ");let e=[];if(u.group.length){g(u.group.join(","),{_depth:t+1}).forEach(t=>{t.group?e=e.concat(t.group):e.push(t)})}l.push({name:u.text||"",group:e})}else{const e=[],t=[];for(const i of u.address){if(i.indexOf("(")<0){t.push(i);continue}const n=d(i);for(const t of n.comments)e.push(t);n.address&&t.push(n.address)}if(u.address=t,!u.address.length&&u.text.length){for(let e=u.text.length-1;e>=0;e--)if(!u.textWasQuoted[e]&&r.test(u.text[e])){u.address=u.text.splice(e,1),u.textWasQuoted.splice(e,1);break}if(!u.address.length){let e=!1;for(let t=u.text.length-1;t>=0;t--)if(!u.textWasQuoted[t]){const i=u.text[t];let n=i;const r=p(i);if(r>=0){o.lastIndex=r;const t=o.exec(i);t&&(u.address=[t[0].trim()],e=!0,n=i.slice(0,r)+" "+i.slice(r+t[0].length))}if(u.text[t]=n.trim(),e)break}}}!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),u.address.length>1&&(u.text=u.text.concat(u.address.splice(1)));const a=!u.address.length&&u.textWasQuoted.some(e=>e);u.text=u.text.join(" "),u.address=u.address.join(" "),a&&u.text&&(u.address=function(e){const t=e.lastIndexOf("@");if(t<0)return e;const i=e.substr(0,t);return/^[^\s"(),:;<>@[\\\]]+$/.test(i)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(i)?e:'"'+i.replace(/["\\]/g,"\\$&")+'"@'+e.substr(t+1)}(u.text),u.text=""),function(e){if(!i.test(e.address))return;let t,o;const a=e.address.match(n);if(a){if(!a[2])return;t=a[1],o=[a[2]]}else{if(e.address.indexOf('"')>=0)return;const i=e.address.split(/\s+/);let n=i.findIndex(e=>r.test(e));if(n<0&&(n=i.findIndex(e=>s.test(e))),n<0)return;t=i.splice(n,1)[0],o=i}e.address=t,e.text=[e.text].concat(o).filter(e=>e).join(" ")}(u),!u.text&&e.length&&(u.text=e.join(" "));const c={address:u.address||u.text||"",name:u.text||u.address||""};c.address===c.name&&(/@/.test(c.address||"")?c.name="":c.address=""),l.push(c)}return l}class h{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.inDomainLiteral=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){const e=[];for(let e=0,t=this.str.length;e<t;e++){const i=this.str.charAt(e),n=e<t-1?this.str.charAt(e+1):null;this.checkChar(i,n)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(this.escaped||this.operatorExpecting||(this.inDomainLiteral||"["!==e?!this.inDomainLiteral||"]"!==e&&","!==e&&";"!==e||(this.inDomainLiteral=!1):this.inDomainLiteral=!0),this.escaped);else{if(e===this.operatorExpecting)return this.node={type:"operator",value:e},t&&![" ","\t","\r","\n",",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",void(this.escaped=!1);if(!this.operatorExpecting&&!this.inDomainLiteral&&e in this.operators)return this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],void(this.escaped=!1);if(['"',"'"].includes(this.operatorExpecting)&&"\\"===e)return void(this.escaped=!0)}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),"\n"===e&&(e=" "),(e.charCodeAt(0)>=33||[" ","\t"].includes(e))&&(this.node.value+=e),this.escaped=!1}}const f=50;function g(e,t){const i=(t=t||{})._depth||0;if(i>f)return[];const n=new h(e).tokenize(),r=[];let s=[],o=[];n.forEach(e=>{"operator"!==e.type||","!==e.value&&";"!==e.value?s.push(e):(s.length&&r.push(s),s=[])}),s.length&&r.push(s),r.forEach(e=>{const t=m(e,i);for(let e=0;e<t.length;e++)o.push(t[e])});const a=[];for(let e=o.length-1;e>=0;e--){const t=o[e],i=a.length?a[a.length-1]:null;i&&""===t.address&&t.name&&!t.group&&i.address&&i.name?i.name=t.name+", "+i.name:a.push(t)}if(a.reverse(),o=a,t.flatten){const e=[],t=i=>{i.forEach(i=>{if(i.group)return t(i.group);e.push(i)})};return t(o),e}return o}t.default=g,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Au,Au.exports)),Au.exports}var Su,Tu={exports:{}};var ku,ju={exports:{}};function Zu(){return ku||(ku=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e),this.lastByte=!1}_transform(e,t,i){let n,r=0;for(let t=0,i=e.length;t<i;t++)10===e[t]&&(t&&13!==e[t-1]||!t&&13!==this.lastByte)&&(t>r&&(n=e.slice(r,t),this.push(n)),this.push(Buffer.from("\r\n")),r=t+1);r&&r<e.length?(n=e.slice(r),this.push(n)):r||this.push(e),this.lastByte=e[e.length-1],i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ju,ju.exports)),ju.exports}var zu,Yu,Xu,Gu={exports:{}};function Fu(){return zu||(zu=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e)}_transform(e,t,i){let n,r=0;for(let t=0,i=e.length;t<i;t++)13===e[t]&&(n=e.slice(r,t),r=t+1,this.push(n));r&&r<e.length?(n=e.slice(r),this.push(n)):r||this.push(e),i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Gu,Gu.exports)),Gu.exports}function Wu(){return Yu||(Yu=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(C),c=o(f),l=s(Rl()),u=M,p=s(du()),d=o(m),h=s(Lu()),g=s(vu()),w=s(xu()),y=o(Nu()),D=o(pu()),x=s(su()),I=o((Su||(Su=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(){super(),this.lastByte=!1}_transform(e,t,i){e.length&&(this.lastByte=e[e.length-1]),this.push(e),i()}_flush(e){return 10===this.lastByte?e():13===this.lastByte?(this.push(Buffer.from("\n")),e()):(this.push(Buffer.from("\r\n")),e())}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Tu,Tu.exports)),Tu.exports)),b=o(Zu()),v=o(Fu()),L=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"],E="[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~\\x80-\\uFFFF]",A=new RegExp("^"+E+"+(?:\\."+E+"+)*$"),N=/^"(?:[^"\\]|\\[\s\S])*"$/,S=/^[^\s"(),:;<>@[\\\]]+@[^\s"(),:;<>@[\\\]]+$/,T=/[/\\?#%\x00-\x20\x7F]/;function k(e){return e.replace(/[\x00-\x1f\x7f]+/g,"")}class j{constructor(e,t){this.nodeCounter=0,t=t||{},this.baseBoundary=k(t.baseBoundary||a.default.randomBytes(8).toString("hex")),this.boundaryPrefix=k(t.boundaryPrefix||"--_NmP"),this.disableFileAccess=!!t.disableFileAccess,this.disableUrlAccess=!!t.disableUrlAccess,this.normalizeHeaderKey=t.normalizeHeaderKey,this.date=t.parentNode?null:new Date,this.rootNode=t.rootNode||this,this.keepBcc=!!t.keepBcc,t.filename&&(this.filename=t.filename,e||(e=h.detectMimeType(this.filename.split(".").pop()))),this.textEncoding=(t.textEncoding||"").toString().trim().charAt(0).toUpperCase(),this.parentNode=t.parentNode,this.hostname=t.hostname,this.newline=t.newline,this.childNodes=[],this._nodeId=++this.rootNode.nodeCounter,this._headers=[],this._isPlainText=!1,this._hasLongLines=!1,this._envelope=!1,this._raw=!1,this._transforms=[],this._processFuncs=[],e&&this.setHeader("Content-Type",e)}createChild(e,t){t||"object"!=typeof e||(t=e,e=void 0);const i=new j(e,t);return this.appendChild(i),i}appendChild(e){return e.parentNode&&e.parentNode!==this&&e.remove(),e.rootNode!==this.rootNode&&(e.rootNode=this.rootNode,e._nodeId=++this.rootNode.nodeCounter),e.parentNode=this,this.childNodes.push(e),e}replace(e){return e===this?this:(this.parentNode.childNodes.forEach((t,i)=>{t===this&&(e.rootNode=this.rootNode,e.parentNode=this.parentNode,e._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,e.parentNode.childNodes[i]=e)}),e)}remove(){if(!this.parentNode)return this;for(let e=this.parentNode.childNodes.length-1;e>=0;e--)if(this.parentNode.childNodes[e]===this)return this.parentNode.childNodes.splice(e,1),this.parentNode=void 0,this.rootNode=this,this}setHeader(e,t){let i=!1;if(!t&&e&&"object"==typeof e)return e.key&&"value"in e?this.setHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.setHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.setHeader(t,e[t])}),this;const n={key:e=this._normalizeHeaderKey(e),value:t};for(let t=0,r=this._headers.length;t<r;t++)this._headers[t].key===e&&(i?(this._headers.splice(t,1),t--,r--):(this._headers[t]=n,i=!0));return i||this._headers.push(n),this}addHeader(e,t){return!t&&e&&"object"==typeof e?(e.key&&e.value?this.addHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.addHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.addHeader(t,e[t])}),this):Array.isArray(t)?(t.forEach(t=>{this.addHeader(e,t)}),this):(this._headers.push({key:this._normalizeHeaderKey(e),value:t}),this)}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,i=this._headers.length;t<i;t++)if(this._headers[t].key===e)return this._headers[t].value}setContent(e){return this.content=e,"function"==typeof this.content.pipe?(this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler),this.content=e},this.content.once("error",this._contentErrorHandler)):"string"==typeof this.content&&(this._isPlainText=h.isPlainText(this.content),this._isPlainText&&h.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(e){let t;e||(t=new Promise((t,i)=>{e=p.callbackPromise(t,i)}));const i=e,n=this.createReadStream(),r=[];let s=0,o=!1;return n.on("readable",()=>{let e;for(;null!==(e=n.read());)r.push(e),s+=e.length}),n.once("error",e=>{if(!o)return o=!0,i(e)}),n.once("end",e=>{if(!o)return o=!0,e&&e.length&&(r.push(e),s+=e.length),i(null,Buffer.concat(r,s))}),t}getTransferEncoding(){let e=!1;const t=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();return this.content&&(e=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim(),e&&["base64","quoted-printable"].includes(e)||(/^text\//i.test(t)?e=this._isPlainText&&!this._hasLongLines?"7bit":"string"==typeof this.content||this.content instanceof Buffer?"Q"===this._getTextEncoding(this.content)?"quoted-printable":"base64":"B"===this.textEncoding?"base64":"quoted-printable":/^(multipart|message)\//i.test(t)||(e=e||"base64"))),e}buildHeaders(){const e=this.getTransferEncoding(),t=[];if(e&&this.setHeader("Content-Transfer-Encoding",e),this.filename&&!this.getHeader("Content-Disposition")&&this.setHeader("Content-Disposition","attachment"),this.rootNode===this){this.getHeader("Date")||this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000")),this.messageId(),this.getHeader("MIME-Version")||this.setHeader("MIME-Version","1.0");for(let e=this._headers.length-2;e>=0;e--){const t=this._headers[e];"Content-Type"===t.key&&(this._headers.splice(e,1),this._headers.push(t))}}return this._headers.forEach(e=>{let i,n,r=e.key,s=e.value;const o={};if(!s||"object"!=typeof s||L.includes(r)||(p.copyOwnKeys(o,s,e=>"value"===e),s=(s.value||"").toString(),s.trim()))if(o.prepared)o.foldLines?t.push(h.foldLines(r+": "+s)):t.push(r+": "+s);else{switch(e.key){case"Content-Disposition":i=h.parseHeaderValue(s),this.filename&&(i.params.filename=this.filename),s=h.buildHeaderValue(i);break;case"Content-Type":i=h.parseHeaderValue(s),i.value=(i.value||"").toString().replace(/[\x00-\x1f\x7f]/g,""),this._handleContentType(i),i.value.match(/^text\/plain\b/)&&"string"==typeof this.content&&/[\u0080-\uFFFF]/.test(this.content)&&(i.params.charset="utf-8"),s=h.buildHeaderValue(i),this.filename&&(n=/[\x00-\x1f\x7f]/.test(this.filename)?h.encodeWord(this.filename,this._getTextEncoding(this.filename),52):this._encodeWords(this.filename),(n!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n))&&(n=JSON.stringify(n)),s+="; name="+n);break;case"Bcc":if(!this.keepBcc)return}if(s=this._encodeHeaderValue(r,s),(s||"").toString().trim()){if("function"==typeof this.normalizeHeaderKey){const e=this.normalizeHeaderKey(r,s),t="string"==typeof e?e.replace(/[\x00-\x1f\x7f]/g,""):"";t&&(r=t)}t.push(h.foldLines(r+": "+s,76))}}}),t.join("\r\n")}createReadStream(e){e=e||{};const t=new u.PassThrough(e);let i,n=t;this.stream(t,e,e=>{e?n.emit("error",e):t.end()});for(let e=0,t=this._transforms.length;e<t;e++)i="function"==typeof this._transforms[e]?this._transforms[e]():this._transforms[e],n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);i=new I.default,n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);for(let e=0,t=this._processFuncs.length;e<t;e++)i=this._processFuncs[e],n=i(n);if(this.newline){const e=["win","windows","dos","\r\n"].includes(this.newline.toString().toLowerCase())?new b.default:new v.default,t=n.pipe(e);return n.on("error",e=>t.emit("error",e)),t}return n}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,i){const n=this.getTransferEncoding();let r,s,o=!1;const a=e=>{o||(o=!0,i(e))},c=()=>{let i=0;const n=()=>{if(i>=this.childNodes.length)return e.write("\r\n--"+this.boundary+"--\r\n"),a();const r=this.childNodes[i++];e.write((i>1?"\r\n":"")+"--"+this.boundary+"\r\n"),r.stream(e,t,e=>{if(e)return a(e);setImmediate(n)})};if(!this.multipart)return a();setImmediate(n)},l=()=>{if(this.content){if("[object Error]"===Object.prototype.toString.call(this.content))return a(this.content);"function"==typeof this.content.pipe&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=e=>a(e),this.content.once("error",this._contentErrorHandler));const i=()=>{["quoted-printable","base64"].includes(n)?(r=new("base64"===n?w:g).Encoder(t),r.pipe(e,{end:!1}),r.once("end",c),r.once("error",e=>a(e)),s=this._getStream(this.content),s.pipe(r)):(s=this._getStream(this.content),s.pipe(e,{end:!1}),s.once("end",c)),s.once("error",e=>a(e))};if(this.content._resolve){const e=[];let t=0,n=!1;const r=this._getStream(this.content);r.on("error",e=>{n||(n=!0,a(e))}),r.on("readable",()=>{let i;for(;null!==(i=r.read());)e.push(i),t+=i.length}),r.on("end",()=>{n||(n=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(e,t),setImmediate(i))})}else setImmediate(i);return}return setImmediate(c)};this._raw?setImmediate(()=>{if("[object Error]"===Object.prototype.toString.call(this._raw))return a(this._raw);"function"==typeof this._raw.pipe&&this._raw.removeListener("error",this._contentErrorHandler);const t=this._getStream(this._raw);t.pipe(e,{end:!1}),t.on("error",t=>e.emit("error",t)),t.on("end",c)}):(e.write(this.buildHeaders()+"\r\n\r\n"),setImmediate(l))}setEnvelope(e){let t;this._envelope={from:!1,to:[]},e.from&&(t=[],this._convertAddresses(this._parseEnvelopeAddresses(e.from),t),t=t.filter(e=>e&&e.address),t.length&&t[0]&&(this._envelope.from=t[0].address));const i=new Set,n=[];["to","cc","bcc"].forEach(t=>{e[t]&&this._convertAddresses(this._parseEnvelopeAddresses(e[t]),n,i)}),this._envelope.to=n.map(e=>e.address).filter(e=>e);const r=["to","cc","bcc","from"];return p.copyOwnKeys(this._envelope,e,e=>r.includes(e)),this}getAddresses(){const e={},t=new Map;return this._headers.forEach(i=>{const n=i.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(n)&&(Array.isArray(e[n])||(e[n]=[],t.set(n,new Set)),this._convertAddresses(this._parseAddresses(i.value),e[n],t.get(n)))}),e}getEnvelope(){if(this._envelope)return this._envelope;const e={from:!1,to:[]},t=new Set,i=[];return this._headers.forEach(n=>{const r=[];"From"===n.key||!e.from&&["Reply-To","Sender"].includes(n.key)?(this._convertAddresses(this._parseAddresses(n.value),r),r.length&&r[0]&&(e.from=r[0].address)):["To","Cc","Bcc"].includes(n.key)&&this._convertAddresses(this._parseAddresses(n.value),i,t)}),e.to=i.map(e=>e.address),e}messageId(){let e=this.getHeader("Message-ID");return e||(e=this._generateMessageId(),this.setHeader("Message-ID",e)),e}setRaw(e){return this._raw=e,this._raw&&"function"==typeof this._raw.pipe&&(this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=e},this._raw.once("error",this._contentErrorHandler)),this}_accessDisabled(e){let t=this;for(;t;){if(t[e])return!0;t=t.parentNode}return!1}_getStream(e){let t;return e._resolvedValue?(t=new u.PassThrough,setImmediate(()=>{try{t.end(e._resolvedValue)}catch(e){t.emit("error",e)}}),t):"function"==typeof e.pipe?e:e&&"string"==typeof e.path&&!e.href?this._accessDisabled("disableFileAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("File access rejected for "+e.path);i.code=x.EFILEACCESS,t.emit("error",i)}),t):c.default.createReadStream(e.path):e&&"string"==typeof e.href?this._accessDisabled("disableUrlAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("Url access rejected for "+e.href);i.code=x.EURLACCESS,t.emit("error",i)}),t):(0,D.default)(e.href,{headers:e.httpHeaders,tls:e.tls}):(t=new u.PassThrough,setImmediate(()=>{try{t.end(e||"")}catch(e){t.emit("error",e)}}),t)}_parseAddresses(e){const t=[],i=new WeakSet,n=[],r=e=>{i.has(e)||(i.add(e),n.push({list:e,pos:0}))};for(r(Array.isArray(e)?e:[e]);n.length;){const e=n[n.length-1];if(e.pos>=e.list.length){n.pop();continue}const i=e.list[e.pos++];if(Array.isArray(i)){r(i);continue}if(i&&i.address){const e=this._normalizeAddress(i.address);if(e===i.address&&"string"==typeof i.name){t.push(i);continue}const n=p.copyOwnKeys({},i);n.address=e,n.name=i.name||"",t.push(n);continue}const s=this._normalizeParsedAddresses((0,y.default)(i));for(let e=0;e<s.length;e++)t.push(s[e])}return t}_normalizeParsedAddresses(e){return e.forEach(e=>{e.address?e.address=this._normalizeAddress(e.address):e.group&&this._normalizeParsedAddresses(e.group)}),e}_parseEnvelopeAddresses(e){return this._parseAddresses(e).map(e=>e.address||e.group||!e.name||/[\s@]/.test(e.name)?e:{address:this._normalizeAddress(e.name),name:""})}_normalizeHeaderKey(e){return e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x1f\x7f]/g,"").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,e=>e.toUpperCase()).replace(/^Content-Features$/i,"Content-features")}_handleContentType(e){if(this.contentType=e.value.trim().toLowerCase(),this.multipart=!!/^multipart\//i.test(this.contentType)&&this.contentType.substr(this.contentType.indexOf("/")+1),this.multipart){const t=k(e.params.boundary||this.boundary||"");this.boundary=e.params.boundary=t||k(this._generateBoundary())}else this.boundary=!1}_generateBoundary(){return k(this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary)+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){switch(e=this._normalizeHeaderKey(e)){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(t));case"Message-ID":case"In-Reply-To":case"Content-Id":return"<"!==(t=(t||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")).charAt(0)&&(t="<"+t),">"!==t.charAt(t.length-1)&&(t+=">"),t;case"References":return(t=[].concat.apply([],[].concat(t||"").map(e=>(e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").trim()).replace(/<[^>]*>/g,e=>e.replace(/\s/g,"")).split(/\s+/))).map(e=>("<"!==e.charAt(0)&&(e="<"+e),">"!==e.charAt(e.length-1)&&(e+=">"),e))).join(" ").trim();case"Date":return"[object Date]"===Object.prototype.toString.call(t)?t.toUTCString().replace(/GMT/,"+0000"):(t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t));case"Content-Type":case"Content-Disposition":return(t||"").toString().replace(/\r?\n|\r/g," ");default:return t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t)}}_convertAddresses(e,t,i){const n=[];if(t=t||[],!i){i=new Set;for(let e=0;e<t.length;e++)i.add(t[e].address)}return[].concat(e||[]).forEach(e=>{if(e.address)e.address=this._normalizeAddress(e.address),e.name?n.push(`${this._encodeAddressName(e.name)} <${e.address}>`):n.push(S.test(e.address)?e.address:`<${e.address}>`),i.has(e.address)||(i.add(e.address),t.push(e));else if(e.group){const r=(e.group.length?this._convertAddresses(e.group,t,i):"").trim();n.push(`${this._encodeAddressName(e.name)}:${r};`)}}),n.join(", ")}_normalizeAddress(e){if(!(e=(e||"").toString().replace(/[\x00-\x1F\x7F<>]+/g," ").trim()))return e;const t=e.lastIndexOf("@");if(t<0)return this._normalizeLocalPart(e);const i=e.substr(0,t),n=e.substr(t+1);let r=n;const s=/[\x80-\uFFFF]/.test(i);try{r=function(e,t){const i=t?d.default.domainToUnicode:d.default.domainToASCII;if("function"==typeof i&&!T.test(e)){const t=i(e);if(t)return t}return t?l.toUnicode(e):l.toASCII(e)}(n.toLowerCase(),s)}catch(e){}return`${this._normalizeLocalPart(i)}@${r}`}_normalizeLocalPart(e){return A.test(e)||N.test(e)?e:h.quoteString(e)}_encodeAddressName(e){return/^[\w ]*$/.test(e)?e:/^[\x20-\x7e]*$/.test(e)?h.quoteString(e):h.encodeWord(e,this._getTextEncoding(e),52)}_encodeHeaderText(e){return/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(e)?h.encodeWord(e,this._getTextEncoding(e),52):this._encodeWords(e)}_encodeWords(e){return h.encodeWords(e,this._getTextEncoding(e),52,!0)}_getTextEncoding(e){if(e=(e||"").toString(),this.textEncoding)return this.textEncoding;let t=0,i=0;for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);r>=0&&r<=8||11===r||12===r||r>=14&&r<=31||r>=128?t++:(r>=65&&r<=90||r>=97&&r<=122)&&i++}return t<i?"Q":"B"}_generateMessageId(){return"<"+[2,2,2,6].reduce((e,t)=>e+"-"+a.default.randomBytes(t).toString("hex"),a.default.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}}t.default=j,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(yu,yu.exports)),yu.exports}var Ou,Pu={exports:{}},Ku={exports:{}};var Hu,Uu={exports:{}};var Bu,Vu,_u={exports:{}};function Ru(){return Bu||(Bu=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(Rl()),c=s(Lu()),l=o(C),u=s(su());function p(e){const t=new Error('Unsupported DKIM hash algorithm "'+e+'"');return t.code=u.ECONFIG,t}function d(e,t,i,n){const r=m(e,(n=n||{}).headerFieldNames||"From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive",n.skipFields),s=function(e,t,i,n,r){const s=e=>(e||"").toString().replace(/[\x00-\x1f\x7f;=]/g,""),o=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+a.toASCII(s(e)),"q=dns/txt","s="+s(t),"bh="+r,"h="+s(i)].join("; ");return c.foldLines("DKIM-Signature: "+o,76)+";\r\n b="}(n.domainName,n.keySelector,r.fieldNames,t,i);let o,u;r.headers+="dkim-signature:"+h(s);try{o=l.default.createSign(("rsa-"+t).toUpperCase())}catch(e){throw p(t)}o.update(r.headers,"latin1");try{u=o.sign(n.privateKey,"base64")}catch(e){return!1}return s+u.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,"$&\r\n ").trim()}function m(e,t,i){const n=new Set,r=new Set,s=new Map;(i||"").toLowerCase().split(":").forEach(e=>{r.add(e.trim())}),(t||"").toLowerCase().split(":").filter(e=>!r.has(e.trim())).forEach(e=>{n.add(e.trim())});for(let t=e.length-1;t>=0;t--){const i=e[t];n.has(i.key)&&!s.has(i.key)&&s.set(i.key,h(i.line))}const o=[],a=[];return n.forEach(e=>{s.has(e)&&(a.push(e),o.push(e+":"+s.get(e)))}),{headers:o.join("\r\n")+"\r\n",fieldNames:a.join(":")}}function h(e){return e.substr(e.indexOf(":")+1).replace(/\r?\n/g,"").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}d.relaxedHeaders=m,d.unsupportedHashAlgoError=p,t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(_u,_u.exports)),_u.exports}function Qu(){return Vu||(Vu=1,function(e,t){var i=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i((Ou||(Ou=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e),this.lastBytes=Buffer.alloc(4),this.headersParsed=!1,this.headerBytes=0,this.headerChunks=[],this.rawHeaders=!1,this.bodySize=0}updateLastBytes(e){const t=this.lastBytes.length,i=Math.min(e.length,t);for(let e=0,n=t-i;e<n;e++)this.lastBytes[e]=this.lastBytes[e+i];for(let n=1;n<=i;n++)this.lastBytes[t-n]=e[e.length-n]}checkHeaders(e){if(this.headersParsed)return!0;const t=this.lastBytes.length;let i=0;for(let n=0,r=this.lastBytes.length+e.length;n<r;n++){let r;if(r=n<t?this.lastBytes[n]:e[n-t],10===r&&n){const r=n-1<t?this.lastBytes[n-1]:e[n-1-t],s=n>1&&(n-2<t?this.lastBytes[n-2]:e[n-2-t]);if(10===r){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}if(13===r&&10===s){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}}}if(this.headersParsed){if(this.headerChunks.push(e.slice(0,i)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),e.length>i){const t=e.slice(i);this.bodySize+=t.length,setImmediate(()=>this.push(t))}return!1}return this.headerBytes+=e.length,this.headerChunks.push(e),this.updateLastBytes(e),!1}_transform(e,t,i){if(!e||!e.length)return i();let n;"string"==typeof e&&(e=Buffer.from(e,t));try{n=this.checkHeaders(e)}catch(e){return i(e)}n&&(this.bodySize+=e.length,this.push(e)),setImmediate(i)}_flush(e){this.headerChunks&&(this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders())),e()}parseHeaders(){const e=(this.rawHeaders||Buffer.alloc(0)).toString("binary").split(/\r?\n/),t=[];for(const i of e)t.length&&/^[ \t]/.test(i)?t[t.length-1]+="\n"+i:t.push(i);return t.filter(e=>/[^ \t\r]/.test(e)).map(e=>({key:e.substr(0,e.indexOf(":")).replace(/^[ \t]+|[ \t]+$/g,"").toLowerCase(),line:e}))}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ku,Ku.exports)),Ku.exports)),r=i((Hu||(Hu=1,function(e,t){var i=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=M,r=i(C),s=Buffer.from("\r\n"),o=Buffer.alloc(4096,s);class a extends n.Transform{constructor(e){super(),e=e||{},this.bodyHash=r.default.createHash(e.hashAlgo||"sha256"),this.byteLength=0,this.debug=e.debug,this._debugBody=!!e.debug&&[],this._lineHasContent=!1,this._pendingWsp=!1,this._pendingCr=!1,this._pendingEmptyLines=0}_hashCanonical(e){e.length&&(this.bodyHash.update(e),this._debugBody&&this._debugBody.push(Buffer.from(e)))}_hashEmptyLines(){for(;this._pendingEmptyLines>0;){const e=Math.min(this._pendingEmptyLines,o.length/2);this._hashCanonical(o.subarray(0,2*e)),this._pendingEmptyLines-=e}}_emitContent(e,t,i){return this._lineHasContent||(this._pendingEmptyLines&&(this._hashCanonical(e.subarray(0,t)),t=0,this._hashEmptyLines()),this._lineHasContent=!0),this._pendingWsp&&(e[t++]=32,this._pendingWsp=!1),e[t++]=i,t}updateHash(e,t){const i=Buffer.allocUnsafe(2*e.length+2);let n=0;for(let t=0;t<e.length;t++){const r=e[t];10!==r?(this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),13===r?this._pendingCr=!0:32===r||9===r?this._pendingWsp=!0:n=this._emitContent(i,n,r)):(this._lineHasContent?(i[n++]=13,i[n++]=10,this._lineHasContent=!1):this._pendingEmptyLines++,this._pendingWsp=!1,this._pendingCr=!1)}t&&this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),this._hashCanonical(i.subarray(0,n))}_transform(e,t,i){if(!e||!e.length)return i();"string"==typeof e&&(e=Buffer.from(e,t)),this.updateHash(e),this.byteLength+=e.length,this.push(e),i()}_flush(e){this.updateHash(Buffer.alloc(0),!0),this._lineHasContent&&this._hashCanonical(s),this.emit("hash",this.bodyHash.digest("base64"),!!this.debug&&Buffer.concat(this._debugBody)),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Uu,Uu.exports)),Uu.exports)),s=i(Ru()),o=M,a=i(f),c=i(I),l=i(C),u=uu();class p{constructor(e,t,i,n){this.options=e||{},this.keys=t,this.cacheTreshold=Number(this.options.cacheTreshold)||10485760,this.hashAlgo=this.options.hashAlgo||"sha256",this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=!!this.cacheDir&&c.default.join(this.cacheDir,"message."+Date.now()+"-"+l.default.randomBytes(14).toString("hex")),this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=i,this.output=n,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",e=>{this.hasErrored=!0,this.cleanup(),n.emit("error",e)})}cleanup(){this.cache&&this.cachePath&&a.default.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=a.default.createReadStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.output.emit("error",e)}),this.cache.once("close",()=>{this.cleanup()}),this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored)return;if(this.readPos>=this.chunks.length)return this.cache?this.createReadCache():void this.output.end();const e=this.chunks[this.readPos++];!1!==this.output.write(e)?setImmediate(()=>this.sendNextChunk()):this.output.once("drain",()=>{this.sendNextChunk()})}sendSignedOutput(){let e=0;const t=()=>{if(e>=this.keys.length)return this.output.write(this.parser.rawHeaders),void setImmediate(()=>this.sendNextChunk());const i=this.keys[e++];let n;try{n=(0,s.default)(this.headers,this.hashAlgo,this.bodyHash,{domainName:i.domainName,keySelector:i.keySelector,privateKey:i.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields})}catch(e){return this.hasErrored=!0,this.cleanup(),void this.output.emit("error",e)}n&&this.output.write(Buffer.from(n+"\r\n")),setImmediate(t)};if(this.bodyHash&&this.headers)return t();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=a.default.createWriteStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;null!==this.relaxedBody.read(););}),this.hasErrored=!0,this.output.emit("error",e)}),this.cache.once("close",()=>{this.sendSignedOutput()}),this.relaxedBody.removeAllListeners("readable"),this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new n.default,this.relaxedBody=new r.default({hashAlgo:this.hashAlgo}),this.parser.on("headers",e=>{this.headers=e}),this.relaxedBody.on("hash",e=>{this.bodyHash=e}),this.relaxedBody.on("readable",()=>{let e;if(!this.cache)for(;null!==(e=this.relaxedBody.read());)if(this.chunks.push(e),this.chunklen+=e.length,this.chunklen>=this.cacheTreshold&&this.cachePath)return this.createWriteCache()}),this.relaxedBody.on("end",()=>{this.cache||this.sendSignedOutput()}),this.parser.pipe(this.relaxedBody),setImmediate(()=>this.input.pipe(this.parser))}}t.default=class{constructor(e){this.options=e||{},this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){const i=new o.PassThrough;let n=e,r=!1;Buffer.isBuffer(e)?(r=e,n=new o.PassThrough):"string"==typeof e&&(r=Buffer.from(e),n=new o.PassThrough);let a=this.options;t&&Object.keys(t).length&&(a=(0,u.copyOwnKeys)({},t),(0,u.copyOwnKeys)(a,this.options));const c=new p(a,this.keys,n,i);return setImmediate(()=>{try{c.signStream()}catch(e){return void i.emit("error",s.default.unsupportedHashAlgoError(c.hashAlgo))}r&&setImmediate(()=>{n.end(r)})}),i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Pu,Pu.exports)),Pu.exports}var Ju,qu={exports:{}};var $u,ep,tp={exports:{}};function ip(){return ep||(ep=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=s(du()),l=s(fu()),u=o((Xu||(Xu=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(Wu()),c=s(Lu()),l=du();function u(e){const t=e;return"object"==typeof e&&!!(t.content||t.path||t.href||t.raw)}t.default=class{constructor(e){this.mail=e||{},this.message=!1}compile(){return this._alternatives=this.getAlternatives(),this._htmlNode=this._alternatives.filter(e=>/^text\/html\b/i.test(e.contentType)).pop(),this._attachments=this.getAttachments(!!this._htmlNode),this._useRelated=!(!this._htmlNode||!this._attachments.related.length),this._useAlternative=this._alternatives.length>1,this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&1===this._attachments.attached.length,this.mail.raw?this.message=new a.default("message/rfc822",{newline:this.mail.newline,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess}).setRaw(this.mail.raw):this._useMixed?this.message=this._createMixed():this._useAlternative?this.message=this._createAlternative():this._useRelated?this.message=this._createRelated():this.message=this._createContentNode(!1,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""}),this.mail.headers&&this.message.addHeader(this.mail.headers),["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach(e=>{const t=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase());this.mail[t]&&this.message.setHeader(e,this.mail[t])}),this.mail.envelope&&this.message.setEnvelope(this.mail.envelope),this.message.messageId(),this.message}getAttachments(e){let t;const i=[].concat(this.mail.attachments||[]).map((e,t)=>{/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e));const i=e.contentType||c.detectMimeType(e.filename||e.path||e.href||"bin"),n=/^image\//i.test(i),r=/^message\//i.test(i),s=e.contentDisposition||(r||n&&e.cid?"inline":"attachment");let o;o="contentTransferEncoding"in e?e.contentTransferEncoding:r?"8bit":"base64";const a={contentType:i,contentDisposition:s,contentTransferEncoding:o};return e.filename?a.filename=e.filename:r||!1===e.filename||(a.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(t+1),a.filename.indexOf(".")<0&&(a.filename+="."+c.detectExtension(a.contentType))),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.cid&&(a.cid=e.cid),e.raw?a.raw=e.raw:e.path?a.content={path:e.path}:e.href?a.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls}:a.content=e.content||"",e.encoding&&(a.encoding=e.encoding),e.headers&&(a.headers=e.headers),a});return this.mail.icalEvent&&(t=Object.assign({},this._getIcalEvent()),t.contentType="application/ics",t.headers||(t.headers={}),t.filename=t.filename||"invite.ics",t.headers["Content-Disposition"]="attachment",t.headers["Content-Transfer-Encoding"]="base64"),e?{attached:i.filter(e=>!e.cid).concat(t||[]),related:i.filter(e=>!!e.cid)}:{attached:i.concat(t||[]),related:[]}}_getIcalEvent(){if(!this._icalEvent){let e;e=u(this.mail.icalEvent)?(0,l.copyOwnKeys)({},this.mail.icalEvent):{content:this.mail.icalEvent},/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e)),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.raw||(e.path?(e.content={path:e.path},e.path=void 0):e.href&&(e.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls},e.href=void 0)),e.content&&"object"==typeof e.content&&(e.content._resolve=!0),this._icalEvent=e}return this._icalEvent}getAlternatives(){const e=[];let t,i,n,r,s;return this.mail.text&&(t=u(this.mail.text)?this.mail.text:{content:this.mail.text},t.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(n=u(this.mail.watchHtml)?this.mail.watchHtml:{content:this.mail.watchHtml},n.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(r=u(this.mail.amp)?this.mail.amp:{content:this.mail.amp},r.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(s=Object.assign({},this._getIcalEvent()),s.filename=!1,s.contentType="text/calendar; charset=utf-8; method="+(s.method||"PUBLISH").toString().trim().toUpperCase(),s.headers||(s.headers={})),this.mail.html&&(i=u(this.mail.html)?this.mail.html:{content:this.mail.html},i.contentType="text/html; charset=utf-8"),[].concat(t||[]).concat(n||[]).concat(r||[]).concat(i||[]).concat(s||[]).concat(this.mail.alternatives||[]).forEach(t=>{/^data:/i.test(t.path||t.href)&&(t=this._processDataUrl(t));const i={contentType:t.contentType||c.detectMimeType(t.filename||t.path||t.href||"txt"),contentTransferEncoding:t.contentTransferEncoding};t.filename&&(i.filename=t.filename),/^https?:\/\//i.test(t.path)&&(t.href=t.path,t.path=void 0),t.raw?i.raw=t.raw:t.path?i.content={path:t.path}:t.href?i.content={href:t.href,httpHeaders:t.httpHeaders,tls:t.tls}:i.content=t.content||"",t.encoding&&(i.encoding=t.encoding),t.headers&&(i.headers=t.headers),e.push(i)}),e}_createMixed(e){const t=e?e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._useAlternative?this._createAlternative(t):this._useRelated&&this._createRelated(t),[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach(e=>{this._useRelated&&e===this._htmlNode||this._createContentNode(t,e)}),t}_createAlternative(e){const t=e?e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._alternatives.forEach(e=>{this._useRelated&&this._htmlNode===e?this._createRelated(t):this._createContentNode(t,e)}),t}_createRelated(e){const t=e?e.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._createContentNode(t,this._htmlNode),this._attachments.related.forEach(e=>this._createContentNode(t,e)),t}_createContentNode(e,t){(t=t||{}).content=t.content||"";const i=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,""),n=e?e.createChild(t.contentType,{filename:t.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default(t.contentType,{filename:t.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return t.headers&&n.addHeader(t.headers),t.cid&&n.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">"),t.contentTransferEncoding?n.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(t.contentType)&&n.setHeader("Content-Transfer-Encoding",this.mail.encoding),/^text\//i.test(t.contentType)&&!t.contentDisposition||n.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment")),"string"!=typeof t.content||["utf8","usascii","ascii"].includes(i)||(t.content=Buffer.from(t.content,i)),t.raw?n.setRaw(t.raw):n.setContent(t.content),n}_processDataUrl(e){const t=e.path||e.href;if(!t||"string"!=typeof t)return e;if(!t.startsWith("data:"))return e;if(t.length>52428800){let i="application/octet-stream";const n=t.indexOf(",");if(n>0&&n<200){const e=t.substring(5,n).split(";");e[0]&&e[0].includes("/")&&(i=e[0].trim())}return Object.assign((0,l.copyOwnKeys)({},e),{path:!1,href:!1,content:Buffer.alloc(0),contentType:e.contentType||i})}let i;try{i=(0,l.parseDataURI)(t)}catch(t){return e}return i?(e.content=i.data,e.contentType=e.contentType||i.contentType,"path"in e&&(e.path=!1),"href"in e&&(e.href=!1),e):e}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(wu,wu.exports)),wu.exports)),m=o(Qu()),f=o((Ju||(Ju=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(d),c=o(b),l=s(Ql()),u=s(su());t.default=function e(t,i,n,r,s){"function"==typeof r&&(s=r,r={}),r=r||{};const o=s;if(!(i=Number(i)||0)||/[\r\n]/.test(n)){const e=new Error("Invalid proxy destination");return e.code=u.EPROXY,void setImmediate(()=>o(e))}const p=l.parse(t),d={host:p.hostname,port:Number(p.port)?Number(p.port):"https:"===p.protocol?443:80};let m,h;"https:"===p.protocol?(d.rejectUnauthorized=!1!==r.rejectUnauthorized,m=c.default.connect.bind(c.default)):m=a.default.connect.bind(a.default);let f=!1;const g=e=>{if(!f){f=!0;try{h.destroy()}catch(e){}o(e)}},w=()=>{const e=new Error("Proxy socket timed out");e.code="ETIMEDOUT",g(e)};h=m(d,()=>{if(f)return;const e={Host:n+":"+i,Connection:"close"};p.auth&&(e["Proxy-Authorization"]="Basic "+Buffer.from(p.auth).toString("base64")),h.write("CONNECT "+n+":"+i+" HTTP/1.1\r\n"+Object.keys(e).map(t=>t+": "+e[t]).join("\r\n")+"\r\n\r\n");let t="";const r=e=>{let i,n;if(!f){if(t+=e.toString("binary"),i=t.match(/\r\n\r\n/)){if(h.removeListener("data",r),n=t.substr(i.index+i[0].length),t=t.substr(0,i.index),n&&h.unshift(Buffer.from(n,"binary")),f=!0,i=t.match(/^HTTP\/\d+\.\d+ (\d+)/i),!i||"2"!==(i[1]||"").charAt(0)){try{h.destroy()}catch(e){}const e=new Error("Invalid response from proxy"+(i&&": "+i[1]||""));return e.code=u.EPROXY,o(e)}return h.removeListener("error",g),h.removeListener("timeout",w),h.setTimeout(0),o(null,h)}if(t.length>65536){h.removeListener("data",r);const e=new Error("Proxy response headers too large");return e.code=u.EPROXY,g(e)}}};h.on("data",r)}),h.setTimeout(e.timeout||3e4),h.on("timeout",w),h.once("error",g)},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(qu,qu.exports)),qu.exports)),g=s(su()),w=o(h),y=s(Ql()),M=s(iu()),x=o(($u||($u=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(du()),c=o(Wu()),l=s(Lu()),u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.default=class{constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};const i=e.options||{},n=e._defaults||{};a.copyOwnKeys(this.data,t),this.data.headers=this.data.headers||{},a.copyOwnKeys(this.data,n,e=>u(this.data,e)),a.copyOwnKeys(this.data.headers,n.headers,e=>u(this.data.headers,e)),["disableFileAccess","disableUrlAccess","normalizeHeaderKey","maxRecipients"].forEach(e=>{e in i&&(this.data[e]=i[e])}),["disableFileAccess","disableUrlAccess"].forEach(e=>{!(e in i)&&u(n,e)&&(this.data[e]=this.data[e]||n[e])})}resolveContent(e,t,i,n){n||"function"!=typeof i||(n=i,i=!1),i=i||{};const r={disableFileAccess:this.data.disableFileAccess||i.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess||i.disableUrlAccess};return a.resolveContent(e,t,r,n)}resolveAll(e){const t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach((e,i)=>{t.push([this.data.alternatives,i])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((e,i)=>{e.filename||(e.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(i+1),e.filename.indexOf(".")<0&&(e.filename+="."+l.detectExtension(e.contentType))),e.contentType||(e.contentType=l.detectMimeType(e.filename||e.path||e.href||"bin")),t.push([this.data.attachments,i])});const i=new c.default;["from","to","cc","bcc","sender","replyTo"].forEach(e=>{let t;this.message?t=[].concat(i._parseAddresses(this.message.getHeader("replyTo"===e?"reply-to":e))||[]):this.data[e]&&(t=[].concat(i._parseAddresses(this.data[e])||[])),t&&t.length?this.data[e]=t:e in this.data&&(this.data[e]=null)}),["from","sender"].forEach(e=>{this.data[e]&&(this.data[e]=this.data[e].shift())});let n=0;const r=()=>{if(n>=t.length)return e(null,this.data);const i=t[n++];if(!i[0]||!i[0][i[1]])return r();a.resolveContent(...i,{disableFileAccess:this.data.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess},(t,n)=>{if(t)return e(t);const s={content:n};i[0][i[1]]&&"object"==typeof i[0][i[1]]&&!Buffer.isBuffer(i[0][i[1]])&&a.copyOwnKeys(s,i[0][i[1]],e=>e in s||["content","path","href","raw"].includes(e)),i[0][i[1]]=s,r()})};setImmediate(()=>r())}normalize(e){const t=this.message.getEnvelope(),i=this.message.messageId();this.resolveAll((n,r)=>n?e(n):(r.envelope=t,r.messageId=i,["html","text","watchHtml","amp"].forEach(e=>{r[e]&&r[e].content&&("string"==typeof r[e].content?r[e]=r[e].content:Buffer.isBuffer(r[e].content)&&(r[e]=r[e].content.toString()))}),r.icalEvent&&Buffer.isBuffer(r.icalEvent.content)&&(r.icalEvent.content=r.icalEvent.content.toString("base64"),r.icalEvent.encoding="base64"),r.alternatives&&r.alternatives.length&&r.alternatives.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),r.attachments&&r.attachments.length&&r.attachments.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),r.normalizedHeaders={},Object.keys(r.headers||{}).forEach(e=>{if(a.isProtoKey(e))return;let t=[].concat(r.headers[e]||[]).shift();t=t&&t.value||t,t&&(["references","in-reply-to","message-id","content-id"].includes(e)&&(t=this.message._encodeHeaderValue(e,t)),r.normalizedHeaders[e]=t)}),r.list&&"object"==typeof r.list&&this._getListHeaders(r.list).forEach(e=>{r.normalizedHeaders[e.key]=e.value.map(e=>e&&e.value||e).join(", ")}),r.references&&(r.normalizedHeaders.references=this.message._encodeHeaderValue("references",r.references)),r.inReplyTo&&(r.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",r.inReplyTo)),e(null,r)))}setMailerHeader(){this.message&&this.data.xMailer&&this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(this.message&&this.data.priority)switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low")}}setListHeaders(){this.message&&this.data.list&&"object"==typeof this.data.list&&this._getListHeaders(this.data.list).forEach(e=>{e.value.forEach(t=>{this.message.addHeader(e.key,t)})})}_getListHeaders(e){return Object.keys(e).map(t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map(e=>({prepared:!0,foldLines:!0,value:[].concat(e||[]).map(e=>{if("string"==typeof e&&(e={url:e}),e&&e.url){let i=(e.comment||"").toString().replace(/\r?\n|\r/g," ");const n=!l.isPlainText(i)||/\x7f/.test(i);return"id"===t.toLowerCase().trim()?(i=n?l.encodeWord(i):l.quoteString(i),(e.comment?i+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+:\/{0,2}/,"<")):(i=n?l.encodeWord(i):i.replace(/[()\\]/g,"\\$&"),this._formatListUrl(e.url)+(e.comment?" ("+i+")":""))}return""}).filter(e=>e).join(", ")}))}))}_formatListUrl(e){return e=e.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(tp,tp.exports)),tp.exports)),I=o(d),v=o(D),L=o(C);class E extends a.EventEmitter{constructor(e,t,i){super(),this.options=t||{},this._defaults=i||{},this._defaultPlugins={compile:[(...e)=>this._convertDataImages(...e)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=!!this.options.dkim&&new m.default(this.options.dkim),this.transporter=e,this.transporter.mailer=this,this.logger=c.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),"function"==typeof this.transporter.on&&(this.transporter.on("log",e=>{this.logger.debug({tnx:"transport"},"%s: %s",e.type,e.message)}),this.transporter.on("error",e=>{this.logger.error({err:e,tnx:"transport"},"Transport Error: %s",e.message),this.emit("error",e)}),this.transporter.on("idle",(...e)=>{this.emit("idle",...e)}),this.transporter.on("clear",(...e)=>{this.emit("clear",...e)})),["close","isIdle","verify"].forEach(e=>{this[e]=(...t)=>"function"==typeof this.transporter[e]?("verify"===e&&"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[e](...t)):(this.logger.warn({tnx:"transport",methodName:e},"Non existing method %s called for transport",e),!1)}),this.options.proxy&&"string"==typeof this.options.proxy&&this.setupProxy(this.options.proxy)}use(e,t){return e=(e||"").toString(),this._userPlugins.hasOwnProperty(e)?this._userPlugins[e].push(t):this._userPlugins[e]=[t],this}sendMail(e,t=null){let i;t||(i=new Promise((e,i)=>{t=c.callbackPromise(e,i)}));const n=t;"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);const r=new x.default(this,e);return this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version),this._processPlugins("compile",r,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",e.message),n(e);let t;try{r.message=new u.default(r.data).compile(),r.setMailerHeader(),r.setPriorityHeaders(),r.setListHeaders(),t=r.message.getEnvelope().to.length}catch(e){return this.logger.error({err:e,tnx:"transport",action:"send"},"Compile Error: %s",e.message),n(e)}const i=void 0===r.data.maxRecipients?1e5:r.data.maxRecipients;if(i&&t>i){const e=new Error(`Message has ${t} recipients, which is over the ${i} allowed by maxRecipients`);return e.code=g.EMAXRECIPIENTS,this.logger.error({err:e,tnx:"transport",action:"send"},"Send Error: %s",e.message),n(e)}this._processPlugins("stream",r,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"stream"},"PluginStream Error: %s",e.message),n(e);(r.data.dkim||this.dkim)&&r.message.processFunc(e=>{const t=r.data.dkim?new m.default(r.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:r.message.messageId(),dkimDomains:t.keys.map(e=>e.keySelector+"."+e.domainName).join(", ")},"Signing outgoing message with %s keys",t.keys.length),t.sign(e,r.data._dkim)}),this.transporter.send(r,(...e)=>{e[0]&&this.logger.error({err:e[0],tnx:"transport",action:"send"},"Send Error: %s",e[0].message),n(...e)})})}),i}getVersionString(){return w.default.format("%s (%s; +%s; %s/%s)",M.name,M.version,M.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,i){if(e=(e||"").toString(),!this._userPlugins.hasOwnProperty(e))return i();const n=this._userPlugins[e]||[],r=this._defaultPlugins[e]||[];if(n.length&&this.logger.debug({tnx:"transaction",pluginCount:n.length,step:e},"Using %s plugins for %s",n.length,e),n.length+r.length===0)return i();let s=0,o="default";const a=()=>{let e="default"===o?r:n;if(s>=e.length){if("default"!==o||!n.length)return i();o="user",s=0,e=n}(0,e[s++])(t,e=>{if(e)return i(e);a()})};a()}setupProxy(e){const t=y.parse(e);this.getSocket=(e,i)=>{const n=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+n))return this.meta.get("proxy_handler_"+n)(t,e,i);switch(n){case"http":case"https":return void(0,f.default)(t.href,e.port,e.host,this.options.tls||{},(e,t)=>e?i(e):i(null,{connection:t}));case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){let e=new Error("Socks module not loaded");return e.code=g.EPROXY,i(e)}const n=n=>{const r=!!this.meta.get("proxy_socks_module").SocksClient,s=r?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),o=Number(t.protocol.replace(/\D/g,""))||5,a={proxy:{ipaddress:n,port:Number(t.port),type:o},[r?"destination":"target"]:{host:e.host,port:e.port},command:"connect"};if(t.username||t.password){const e=t.username||"",i=t.password||"";r?(a.proxy.userId=e,a.proxy.password=i):4===o?a.userid=e:a.authentication={username:e,password:i}}s.createConnection(a,(e,t)=>e?i(e):i(null,{connection:t.socket||t}))};return I.default.isIP(t.hostname)?n(t.hostname):v.default.resolve(t.hostname,(e,t)=>{if(e)return i(e);n(Array.isArray(t)?t[0]:t)})}}let r=new Error("Unknown proxy configuration");r.code=g.EPROXY,i(r)}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html)return t();e.resolveContent(e.data,"html",{disableFileAccess:e.data.disableFileAccess,disableUrlAccess:e.data.disableUrlAccess},(i,n)=>{if(i)return t(i);let r=0;n=(n||"").toString().replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi,(t,i,n,s)=>{const o=L.default.randomBytes(10).toString("hex")+"@localhost";return e.data.attachments||(e.data.attachments=[]),Array.isArray(e.data.attachments)||(e.data.attachments=[].concat(e.data.attachments||[])),e.data.attachments.push({path:n,cid:o,filename:"image-"+ ++r+"."+l.detectExtension(s)}),i+"cid:"+o}),e.data.html=n,t()})}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}}t.default=E,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ul,Ul.exports)),Ul.exports}var np,rp,sp={exports:{}},op={exports:{}},ap={exports:{}},cp={exports:{}};function lp(){return rp||(rp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(iu()),c=p,l=o(d),u=o(b),m=o(x),h=o(C),f=o((np||(np=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M,n=Buffer.from("\n"),r=Buffer.from("\n."),s=Buffer.from("\r"),o=Buffer.from(".");class a extends i.Transform{constructor(e){super(e),this.options=e||{},this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(e,t,i){const a=[];let c,l,u,p=0,d=0;if(!e||!e.length)return i();for("string"==typeof e&&(e=Buffer.from(e)),this.inByteCount+=e.length,c=0,l=e.length;c<l;c++){const t=e[c],i=c?e[c-1]:this.lastByte;let l=!1;13===i&&10!==t?l=46===t?r:n:10===t&&13!==i?l=s:46!==t||10!==i&&!1!==i||(l=o),l&&(c>d&&(u=e.slice(d,c),a.push(u),p+=u.length),a.push(l),p+=l.length,d=c)}a.length?(d<e.length&&(u=e.slice(d),a.push(u),p+=u.length),this.outByteCount+=p,this.push(Buffer.concat(a,p))):(this.outByteCount+=e.length,this.push(e)),this.lastByte=e[e.length-1],i()}_flush(e){let t;t=10===this.lastByte?Buffer.from(".\r\n"):13===this.lastByte?Buffer.from("\n.\r\n"):Buffer.from("\r\n.\r\n"),this.outByteCount+=t.length,this.push(t),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(cp,cp.exports)),cp.exports)),g=M,w=s(du()),y=6e5,D=()=>{};function I(e){if(!e)return e;const t=Buffer.from(e,"binary").toString("utf8");return t.includes("�")?e:t}function v(e){return/^\d+-/.test(e)}class L extends c.EventEmitter{constructor(e){super(e),this.id=h.default.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=e||{},this.options.requireTLS&&(this.options.ignoreTLS||this.options.opportunisticTLS)&&(this.options=Object.assign({},this.options,{ignoreTLS:!1,opportunisticTLS:!1})),this.secureConnection=!!this.options.secure,this.alreadySecured=!!this.options.secured,this.port=Number(this.options.port)||(this.secureConnection?465:587),this.host=this.options.host||"localhost",this.servername=this.options.servername?this.options.servername:!l.default.isIP(this.host)&&this.host,this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,void 0===this.options.secure&&465===this.port&&(this.secureConnection=!0),this.name=(this.options.name||this._getHostname()).toString().replace(/[\r\n]+/g,""),this.logger=w.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map;for(const e of Object.keys(this.options.customAuth||{})){const t=(e||"").toString().trim().toUpperCase();t&&this.customAuth.set(t,this.options.customAuth[e])}this.version=a.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],this._responsePartial=!1,this.lastServerResponse=!1,this._socket=!1,this._supportedAuth=[],this.allowsAuth=!1,this._envelope=!1,this._supportedExtensions=[],this._maxAllowedSize=0,this._responseActions=[],this._recipientQueue=[],this._greetingTimeout=!1,this._connectionTimeout=!1,this._destroyed=!1,this._closing=!1,this._currentDataStream=!1,this._pendingSend=!1,this._connectCallback=!1,this._onSocketData=e=>this._onData(e),this._onSocketError=e=>this._onError(e,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout(),this._onConnectionSocketError=e=>this._onConnectionError(e,"ESOCKET"),this._connectionAttemptId=0}connect(e){if("function"==typeof e){this._connectCallback=e,this.once("connect",()=>{this._connectCallback=!1,this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),e()});const t=this._isDestroyedMessage("connect");if(t)return e(this._formatError(t,"ECONNECTION",!1,"CONN"))}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||3e4};return this.options.localAddress&&(t.localAddress=this.options.localAddress),this.options.connection?(this._socket=this.options.connection,this._setupConnectionHandlers(),void(this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()})):setImmediate(()=>this._onConnect()))):this.options.socket?(this._socket=this.options.socket,this._resolveAndConnect(t,e=>{try{this._socket.connect(this.port,this.host,()=>{if(this._socket.setKeepAlive(!0),this.secureConnection&&!this.alreadySecured)return this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()});this._onConnect()}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}})):(this.secureConnection&&(Object.assign(t,this.options.tls||{}),this.servername&&!t.servername&&(t.servername=this.servername)),this._resolveAndConnect(t,e=>{this._fallbackAddresses=(e._addresses||[]).filter(e=>e!==t.host),this._connectOpts=Object.assign({},t),this._connectToHost(t,this.secureConnection)}))}_resolveAndConnect(e,t){return w.resolveHostname(e,(i,n)=>{if(i)return setImmediate(()=>this._onError(i,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:n.host,cached:!!n.cached},"Resolved %s as %s [cache %s]",e.host,n.host,n.cached?"hit":"miss");for(const t of Object.keys(n))"_"!==t.charAt(0)&&n[t]&&(e[t]=n[t]);t(n)})}_connectToHost(e,t){if(this._destroyed||this._closing)return;this._connectionAttemptId++;const i=this._connectionAttemptId,n=t?u.default.connect:l.default.connect;try{this._socket=n(e,()=>{this._connectionAttemptId===i&&(this._socket.setKeepAlive(!0),this._onConnect())}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}}_setupConnectionHandlers(){this._connectionTimeout=setTimeout(()=>{this._onConnectionError("Connection timeout","ETIMEDOUT")},this.options.connectionTimeout||12e4),this._socket.on("error",this._onConnectionSocketError)}_onConnectionError(e,t){clearTimeout(this._connectionTimeout);if(!(this._fallbackAddresses&&this._fallbackAddresses.length&&"init"===this.stage&&!this._destroyed))return void this._onError(e,t,!1,"CONN");const i=this._fallbackAddresses.shift();if(this.logger.info({tnx:"network",failedHost:this._connectOpts.host,nextHost:i,error:e.message||e},"Connection to %s failed, trying %s",this._connectOpts.host,i),this._socket){try{this._socket.removeListener("error",this._onConnectionSocketError),this._socket.on("error",D),this._socket.destroy()}catch(e){}this._socket=null}this._connectOpts.host=i,this._connectToHost(this._connectOpts,this.secureConnection)}quit(){this._sendCommand("QUIT"),this._responseActions.push(this.close)}close(){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._responseActions=[],this._closing)return;this._closing=!0;const e="init"===this.stage?"destroy":"end";this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);const t=this._socket&&this._socket.socket||this._socket;if(this._currentDataStream){try{this._currentDataStream.unpipe(this._socket)}catch(e){}this._currentDataStream=!1}if(this._pendingSend){const{stream:e,onStreamError:t}=this._pendingSend;e&&(e.removeListener("error",t),e.on("error",D)),this._pendingSend=!1}if(t&&!t.destroyed)try{t.setTimeout(0),t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout),t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError),t.on("error",D),t[e]()}catch(e){}this._destroy()}login(e,t){const i=this._isDestroyedMessage("login");if(i)return t(this._formatError(i,"ECONNECTION",!1,"API"));this._auth=e||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1;const n=!!this._auth.oauth2||this.customAuth.has("XOAUTH2");if(this._authMethod||!this._auth.oauth2||this._auth.credentials){if(!this._authMethod||"XOAUTH2"===this._authMethod&&!this._auth.oauth2){const e=this._supportedAuth.find(e=>"XOAUTH2"!==e||n);this._authMethod=(e||"PLAIN").toUpperCase().trim()}}else this._authMethod="XOAUTH2";if(("XOAUTH2"!==this._authMethod||this.customAuth.has("XOAUTH2"))&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass)){if(!(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod)))return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options}}if(this.customAuth.has(this._authMethod)){const e=this.customAuth.get(this._authMethod);let i,n=!1;const r=()=>{n||(n=!0,this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0))},s=e=>{n||(n=!0,t(this._formatError(e,"EAUTH",i,"AUTH "+this._authMethod)))},o=(e,t)=>{let n;return t||(n=new Promise((e,i)=>{t=w.callbackPromise(e,i)})),this._responseActions.push(n=>{i=n;let r=n.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),s={command:e,response:n};r?(s.status=Number(r[1])||0,r[2]&&(s.code=r[2]),s.text=n.substr(r[0].length)):(s.text=n,s.status=0),t(null,s)}),setImmediate(()=>this._sendCommand(e)),n},a=e({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:o,resolve:r,reject:s});return void(a&&"function"==typeof a.catch&&a.then(r).catch(s))}switch(this._authMethod){case"XOAUTH2":return void this._handleXOauth2Token(!1,t);case"LOGIN":return this._responseActions.push(e=>{this._actionAUTH_LOGIN_USER(e,t)}),void this._sendCommand("AUTH LOGIN");case"PLAIN":return this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),void this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0/* secret */","utf-8").toString("base64"));case"CRAM-MD5":return this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5(e,t)}),void this._sendCommand("AUTH CRAM-MD5")}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(e,t,i){let n=!1;const r=(e,t)=>{n||(n=!0,this._pendingSend&&this._pendingSend.callback===r&&(this._pendingSend=!1),i(e,t))};if(!t)return r(this._formatError("Empty message","EMESSAGE",!1,"API"));const s=this._isDestroyedMessage("send message");if(s)return r(this._formatError(s,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&e.size>this._maxAllowedSize)return void setImmediate(()=>{r(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});const o={callback:r,stream:!1,onStreamError:e=>r(this._formatError(e,"ESTREAM",!1,"API"))};"function"==typeof t.on&&(o.stream=t,o.stream.on("error",o.onStreamError)),this._pendingSend=o;const a=Date.now();this._setEnvelope(e,(e,i)=>{if(e){const i=new g.PassThrough;return"function"==typeof t.pipe?t.pipe(i):(i.write(t),i.end()),r(e)}const n=Date.now(),s=this._createSendStream((e,t)=>{if(e)return r(e);const o=i;return o.envelopeTime=n-a,o.messageTime=Date.now()-n,o.messageSize=s.outByteCount,o.response=t,r(null,o)});"function"==typeof t.pipe?t.pipe(s):(s.write(t),s.end())})}reset(e){const t=this._isDestroyedMessage("reset");if(t)return e(this._formatError(t,"ECONNECTION",!1,"API"));this._sendCommand("RSET"),this._responseActions.push(t=>"2"!==t.charAt(0)?e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET")):(this._envelope=!1,e(null,!0)))}_onConnect(){const e=this._socket;clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",e.remoteAddress,e.remotePort),this._destroyed?this.close():(this.stage="connected",e.removeListener("data",this._onSocketData),e.removeListener("timeout",this._onSocketTimeout),e.removeListener("close",this._onSocketClose),e.removeListener("end",this._onSocketEnd),e.removeListener("error",this._onConnectionSocketError),e.removeListener("error",this._onSocketError),e.on("error",this._onSocketError),e.on("data",this._onSocketData),e.once("close",this._onSocketClose),e.once("end",this._onSocketEnd),e.setTimeout(this.options.socketTimeout||y),e.on("timeout",this._onSocketTimeout),this._greetingTimeout=setTimeout(()=>{this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting&&this._onError("Greeting never received","ETIMEDOUT",!1,"CONN")},this.options.greetingTimeout||3e4),this._responseActions.push(this._actionGreeting),e.resume())}_onData(e){if(this._destroyed||!e||!e.length)return;const t=this.options.maxResponseSize||1048576,i=e.toString("binary");if(!i.includes("\n"))return this._remainder+=i,this._remainder.length>t?this._onResponseTooLarge():void 0;const n=(this._remainder+i).split(/\r?\n/);this._remainder=n.pop();for(let e=0,i=n.length;e<i;e++)if(this._responsePartial?this._responseQueue[this._responseQueue.length-1]+="\n"+n[e]:this._responseQueue.push(n[e]),this._responsePartial=v(n[e]),this._responsePartial&&this._responseQueue[this._responseQueue.length-1].length>t)return this._onResponseTooLarge();if(this._remainder.length>t)return this._onResponseTooLarge();this._responsePartial||this._processResponse()}_onResponseTooLarge(){this._remainder="",this._responseQueue=[],this._responsePartial=!1,this._onError(new Error("Server response exceeds maximum allowed size"),"EPROTOCOL",!1,"CONN")}_onError(e,t,i,n){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._destroyed)return;e=this._formatError(e,t,i,n);["ETIMEDOUT","ESOCKET","ECONNECTION"].includes(e.code)?this.logger.warn(i,e.message):this.logger.error(i,e.message);const r=this._pendingSend;this.emit("error",e),this.close(),r&&r.callback(e)}_formatError(e,t,i,n){let r;r=/Error\]$/i.test(Object.prototype.toString.call(e))?e:new Error(e),t&&"Error"!==t&&(r.code=t),i&&(r.response=i,r.message+=": "+i);const s="string"==typeof i&&Number((i.match(/^\d+/)||[])[0])||!1;return s&&(r.responseCode=s),n&&(r.command=n),r}_onClose(){let e=!1;this._remainder&&this._remainder.trim()&&(this.lastServerResponse=e=I(this._remainder.trim()),(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e)),this.logger.info({tnx:"network"},"Connection closed");const t=!("string"!=typeof e||!/^[45]\d{2}[ -]/.test(e))&&e;if(this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",t,"CONN");if(!t&&this._responseActions[0]===this._actionGreeting&&this._connectCallback&&!this._destroyed){const e=this._connectCallback;this._connectCallback=!1;const t=this._formatError(new Error("Connection closed unexpectedly"),"ECONNECTION",!1,"CONN");return this.logger.warn({tnx:"network"},t.message),e(t),void this.close()}if(t||this._responseActions[0]!==this.close&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.end()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.destroyed=!0,clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._connectionTimeout=!1,this._greetingTimeout=!1,this.emit("end"))}_upgradeConnection(e){this._remainder="",this._responseQueue=[],this._responsePartial=!1;const t=this._socket;t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout);const i=Object.assign({socket:t,host:this.host},this.options.tls||{});this.servername&&!i.servername&&(i.servername=this.servername);const n=()=>{t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError)};this.upgrading=!0;try{this._socket=u.default.connect(i,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),n(),e(null,!0)))}catch(t){return n(),e(t)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||y),this._socket.on("timeout",this._onSocketTimeout),t.resume()}_processResponse(){if(!this._responseQueue.length)return!1;const e=(this._responseQueue.shift()||"").toString();if(!e.trim())return void setImmediate(()=>this._processResponse());if(function(e){return v(e.slice(e.lastIndexOf("\n")+1))}(e))return void this._responseQueue.unshift(e);const t=this.lastServerResponse=I(e);(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},t.replace(/\r?\n$/,""));const i=this._responseActions.shift();if("function"!=typeof i)return this._onError(new Error("Unexpected Response"),"EPROTOCOL",t,"CONN");i.call(this,t),setImmediate(()=>this._processResponse())}_sendCommand(e,t){if(this._destroyed)return;const i=this._socket;if(i.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,"")),i.write(Buffer.from(e+"\r\n","utf-8"))}_setEnvelope(e,t){const i=[];let n=!1;if(this._envelope=e||{},this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim(),this._envelope.to=[].concat(this._envelope.to||[]).map(e=>(e&&e.address||e||"").toString().trim()),!this._envelope.to.length)return t(this._formatError("No recipients defined","EENVELOPE",!1,"API"));if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from))return t(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.from)&&(n=!0);for(let e=0,i=this._envelope.to.length;e<i;e++){if(!this._envelope.to[e]||/[\r\n<>]/.test(this._envelope.to[e]))return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[e]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[e])&&(n=!0)}if(this._envelope.rcptQueue=[].concat(this._envelope.to||[]),this._envelope.rejected=[],this._envelope.rejectedErrors=[],this._envelope.accepted=[],this._envelope.dsn)try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(e){return t(this._formatError("Invalid DSN "+e.message,"EENVELOPE",!1,"API"))}if(this._envelope.requireTLSExtensionEnabled){if(!this.secure)return t(this._formatError("REQUIRETLS can only be used over TLS connections (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"));if(!this._supportedExtensions.includes("REQUIRETLS"))return t(this._formatError("Server does not support REQUIRETLS extension (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"))}if(this._responseActions.push(e=>{this._actionMAIL(e,t)}),n&&this._supportedExtensions.includes("SMTPUTF8")&&(i.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(i.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")){const e=Number(this._envelope.size)||0;e>0&&i.push("SIZE="+e)}this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&i.push("RET="+w.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&i.push("ENVID="+w.encodeXText(this._envelope.dsn.envid))),this._envelope.requireTLSExtensionEnabled&&i.push("REQUIRETLS"),this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(e){let t=(e.ret||e.return||"").toString().toUpperCase()||null;if(t)switch(t){case"HDRS":case"HEADERS":t="HDRS";break;case"FULL":case"BODY":t="FULL"}if(t&&!["FULL","HDRS"].includes(t))throw new Error("ret: "+JSON.stringify(t));const i=(e.envid||e.id||"").toString()||null;let n=e.notify||null;if(n){"string"==typeof n&&(n=n.split(",")),n=n.map(e=>e.trim().toUpperCase());const e=["NEVER","SUCCESS","FAILURE","DELAY"];if(n.filter(t=>!e.includes(t)).length||n.length>1&&n.includes("NEVER"))throw new Error("notify: "+JSON.stringify(n.join(",")));n=n.join(",")}let r=(e.recipient||e.orcpt||"").toString()||null;return r&&r.indexOf(";")<0&&(r="rfc822;"+r),{ret:t,envid:i,notify:n,orcpt:r}}_getDsnRcptToArgs(){const e=this._envelope,t=[];return e.dsn&&this._supportedExtensions.includes("DSN")&&(e.dsn.notify&&t.push("NOTIFY="+w.encodeXText(e.dsn.notify)),e.dsn.orcpt&&t.push("ORCPT="+w.encodeXText(e.dsn.orcpt))),t.length?" "+t.join(" "):""}_createSendStream(e){const t=this._envelope,i=new f.default;if(this.options.lmtp?t.accepted.forEach((i,n)=>{const r=n===t.accepted.length-1;this._responseActions.push(t=>{this._actionLMTPStream(i,r,t,e)})}):this._responseActions.push(t=>{this._actionSMTPStream(t,e)}),this._currentDataStream=i,i.pipe(this._socket,{end:!1}),this.options.debug){const e=new g.PassThrough;e.on("readable",()=>{let t;for(;t=e.read();)this.logger.debug({tnx:"message"},t.toString("binary").replace(/\r?\n$/,""))}),i.pipe(e)}return i.once("end",()=>{this._currentDataStream===i&&(this._currentDataStream=!1),this.logger.info({tnx:"message",inByteCount:i.inByteCount,outByteCount:i.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",i.outByteCount,i.inByteCount)}),i}_actionGreeting(e){clearTimeout(this._greetingTimeout),"220"===e.substr(0,3)?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN")}_actionLHLO(e){"2"===e.charAt(0)?this._actionEHLO(e):this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO")}_actionEHLO(e){let t;if("421"===e.substr(0,3))return void this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");if("2"!==e.charAt(0))return this.options.requireTLS?void this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO"):(this._responseActions.push(this._actionHELO),void this._sendCommand("HELO "+this.name));if(this._ehloLines=e.split(/\r?\n/).map(e=>e.replace(/^\d+[ -]/,"").trim()).filter(e=>e).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS))return this._sendCommand("STARTTLS"),void this._responseActions.push(this._actionSTARTTLS);/[ -]SMTPUTF8\b/im.test(e)&&this._supportedExtensions.push("SMTPUTF8"),/[ -]DSN\b/im.test(e)&&this._supportedExtensions.push("DSN"),/[ -]8BITMIME\b/im.test(e)&&this._supportedExtensions.push("8BITMIME"),/[ -]REQUIRETLS\b/im.test(e)&&this._supportedExtensions.push("REQUIRETLS"),/[ -]PIPELINING\b/im.test(e)&&this._supportedExtensions.push("PIPELINING"),/[ -]AUTH\b/i.test(e)&&(this.allowsAuth=!0);const i=new Set;for(const e of this._ehloLines){const t=/^AUTH[\s=](.*)/i.exec(e);if(t)for(const e of t[1].split(/[\s=]+/))i.add(e.toUpperCase())}for(const e of["PLAIN","LOGIN","CRAM-MD5","XOAUTH2"])i.has(e)&&this._supportedAuth.push(e);(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(t[1])||0),this.emit("connect")}_actionHELO(e){"2"===e.charAt(0)?(this.allowsAuth=!0,this.emit("connect")):this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO")}_actionSTARTTLS(e){if("2"!==e.charAt(0))return this.options.opportunisticTLS?(this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),void this.emit("connect")):void this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");this._upgradeConnection((e,t)=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"STARTTLS"):(this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),t?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this.emit("connect"))})}_actionAUTH_LOGIN_USER(e,t){/^334[ -]/.test(e)?(this._responseActions.push(e=>{this._actionAUTH_LOGIN_PASS(e,t)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))):t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"))}_actionAUTH_CRAM_MD5(e,t){const i=e.match(/^334\s+(.+)$/);if(!i)return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"));const n=Buffer.from(i[1],"base64").toString("ascii"),r=h.default.createHmac("md5",this._auth.credentials.pass);r.update(n);const s=this._auth.credentials.user+" "+r.digest("hex");this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5_PASS(e,t)}),this._sendCommand(Buffer.from(s).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(e,t){if(!e.match(/^235\s+/))return t(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",e,"AUTH CRAM-MD5"));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0)}_actionAUTH_LOGIN_PASS(e,t){if(!/^334[ -]/.test(e))return t(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",e,"AUTH LOGIN"));this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,i){return i||"function"!=typeof t||(i=t,t=!1),"334"===e.substr(0,3)?(this._responseActions.push(e=>{t||"XOAUTH2"!==this._authMethod?this._actionAUTHComplete(e,!0,i):setImmediate(()=>this._handleXOauth2Token(!0,i))}),void this._sendCommand("")):"2"!==e.charAt(0)?(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),i(this._formatError("Invalid login","EAUTH",e,"AUTH "+this._authMethod))):(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,void i(null,!0))}_actionMAIL(e,t){const i=this._envelope;if(2!==Number(e.charAt(0))){const n=this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(i.from)?"Internationalized mailbox name not allowed":"Mail command failed";return t(this._formatError(n,"EENVELOPE",e,"MAIL FROM"))}if(!i.rcptQueue.length)return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"));this._recipientQueue=[];const n=this._supportedExtensions.includes("PIPELINING");do{const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}while(n&&i.rcptQueue.length)}_actionRCPT(e,t){const i=this._envelope;let n;const r=this._recipientQueue.shift();if(2!==Number(e.charAt(0))){const t=this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(r)?"Internationalized mailbox name not allowed":"Recipient command failed";i.rejected.push(r),n=this._formatError(t,"EENVELOPE",e,"RCPT TO"),n.recipient=r,i.rejectedErrors.push(n)}else i.accepted.push(r);if(i.rcptQueue.length||this._recipientQueue.length){if(i.rcptQueue.length){const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}}else{if(!(i.rejected.length<i.to.length)){const r=i.rejectedErrors.find(e=>e.responseCode&&e.responseCode<500),s=r?.response??e;return n=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",s,"RCPT TO"),n.rejected=i.rejected,n.rejectedErrors=i.rejectedErrors,t(n)}this._responseActions.push(e=>{this._actionDATA(e,t)}),this._sendCommand("DATA")}}_actionDATA(e,t){const i=this._envelope;if(!/^[23]/.test(e))return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"));const n={accepted:i.accepted,rejected:i.rejected};this._ehloLines&&this._ehloLines.length&&(n.ehlo=this._ehloLines),i.rejectedErrors.length&&(n.rejectedErrors=i.rejectedErrors),t(null,n)}_actionSMTPStream(e,t){return 2!==Number(e.charAt(0))?t(this._formatError("Message failed","EMESSAGE",e,"DATA")):t(null,e)}_actionLMTPStream(e,t,i,n){const r=this._envelope;let s;if(2!==Number(i.charAt(0))){s=this._formatError("Message failed for recipient "+e,"EMESSAGE",i,"DATA"),s.recipient=e,r.rejected.push(e),r.rejectedErrors.push(s);for(let t=0,i=r.accepted.length;t<i;t++)r.accepted[t]===e&&r.accepted.splice(t,1)}if(t)return n(null,i)}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,(i,n)=>{if(i)return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),t(this._formatError(i,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(i=>{this._actionAUTHComplete(i,e,t)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(n),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))})}_isDestroyedMessage(e){if(this._destroyed)return"Cannot "+e+" - smtp connection is already destroyed.";if(this._socket){if(this._socket.destroyed)return"Cannot "+e+" - smtp connection socket is already destroyed.";if(!this._socket.writable)return"Cannot "+e+" - smtp connection socket is already half-closed."}}_getHostname(){let e;try{e=m.default.hostname()||""}catch(t){e="localhost"}return(!e||e.indexOf(".")<0)&&(e="[127.0.0.1]"),e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(e="["+e+"]"),e}}t.default=L,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(ap,ap.exports)),ap.exports}var up,pp,dp={exports:{}};function mp(){return up||(up=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=M,c=o(pu()),l=o(C),u=s(du()),p=s(su());class d extends a.Stream{constructor(e,t){if(super(),this.options=e||{},this.configError=!1,e&&e.serviceClient){if(!e.privateKey||!e.user){const e=new Error('Options "privateKey" and "user" are required for service account!');e.code=p.EOAUTH2,this.configError=e}const t=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=t||300}if(this.logger=u.getLogger({logger:t},{component:this.options.component||"OAuth2"}),this.provisionCallback="function"==typeof this.options.provisionCallback&&this.options.provisionCallback,this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token",this.options.customHeaders=this.options.customHeaders||{},this.options.customParams=this.options.customParams||{},this.accessToken=this.options.accessToken||!1,this.options.expires&&Number(this.options.expires))this.expires=this.options.expires;else{const e=Math.max(Number(this.options.timeout)||0,0);this.expires=e&&Date.now()+1e3*e||0}this.renewing=!1,this.renewalQueue=[]}getToken(e,t){const i=t;if(this.configError)return i(this.configError);if(!e&&this.accessToken&&(!this.expires||this.expires>Date.now()))return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token for %s",this.options.user),t(null,this.accessToken);if(!this.provisionCallback&&!this.options.refreshToken&&!this.options.serviceClient){if(this.accessToken)return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token (no refresh capability) for %s",this.options.user),t(null,this.accessToken);this.logger.error({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Cannot renew access token for %s: No refresh mechanism available",this.options.user);const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,i(e)}if(this.renewing)return void this.renewalQueue.push({renew:e,callback:i});this.renewing=!0;const n=(e,t)=>{this.renewalQueue.forEach(i=>i.callback(e,t)),this.renewalQueue=[],this.renewing=!1,e?this.logger.error({err:e,tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user):this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user),i(e,t)};this.provisionCallback?this.provisionCallback(this.options.user,!!e,(e,t,i)=>{!e&&t&&(this.accessToken=t,this.expires=i||0),n(e,t)}):this.generateToken(n)}updateToken(e,t){this.accessToken=e,t=Math.max(Number(t)||0,0),this.expires=t&&Date.now()+1e3*t||0,this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){const t=e;let i,n;if(this.options.serviceClient){const e=Math.floor(Date.now()/1e3),r={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:e,exp:e+this.options.serviceRequestTimeout};let s;try{s=this.jwtSignRS256(r)}catch(e){const i=new Error("Can't generate token. Check your auth options");return i.code=p.EOAUTH2,t(i)}i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:s},n={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r}}else{if(!this.options.refreshToken){const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,t(e)}i={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"},n={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.assign(i,this.options.customParams),Object.assign(n,this.options.customParams),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(n)),this.postRequest(this.options.accessUrl,i,this.options,(i,n)=>{let r;if(i)return t(i);try{r=JSON.parse(n.toString())}catch(e){return t(e)}if(!r||"object"!=typeof r){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(n||"").toString());const e=new Error("Invalid authentication response");return e.code=p.EOAUTH2,t(e)}const s=Object.assign({},r);if(s.access_token&&(s.access_token=(s.access_token||"").toString().substr(0,6)+"..."),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(s)),r.error){let e=r.error;r.error_description&&(e+=": "+r.error_description),r.error_uri&&(e+=" ("+r.error_uri+")");const i=new Error(e);return i.code=p.EOAUTH2,t(i)}if(r.access_token)return this.updateToken(r.access_token,r.expires_in),e(null,this.accessToken);const o=new Error("No access token");return o.code=p.EOAUTH2,t(o)})}buildXOAuth2Token(e){const t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,i,n){let r=!1;const s=[];let o=0;const a={method:"post",headers:i.customHeaders,body:t,allowErrorResponse:!0,timeout:i.requestTimeout};/^https:/i.test(e)&&(a.tls=Object.assign({rejectUnauthorized:!0},i.tls||{}));const l=(0,c.default)(e,a);l.on("readable",()=>{let e;for(;null!==(e=l.read());)s.push(e),o+=e.length}),l.once("error",e=>{if(!r)return r=!0,n(e)}),l.once("end",()=>{if(!r)return r=!0,n(null,Buffer.concat(s,o))})}toBase64URL(e){return"string"==typeof e&&(e=Buffer.from(e)),e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){const t=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map(e=>this.toBase64URL(e)).join("."),i=l.default.createSign("RSA-SHA256").update(t).sign(this.options.privateKey);return t+"."+this.toBase64URL(i)}}t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(dp,dp.exports)),dp.exports}var hp,fp,gp,wp={exports:{}},yp={};function Mp(){return fp||(fp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e=r(e.split("@").pop()),n[e]||!1};const i=(hp||(hp=1,Object.defineProperty(yp,"__esModule",{value:!0}),yp.services=void 0,yp.services={126:{description:"126 Mail (NetEase)",host:"smtp.126.com",port:465,secure:!0},163:{description:"163 Mail (NetEase)",host:"smtp.163.com",port:465,secure:!0},"1und1":{description:"1&1 Mail (German hosting provider)",host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},Aliyun:{description:"Alibaba Cloud Mail",domains:["aliyun.com"],host:"smtp.aliyun.com",port:465,secure:!0},AliyunQiye:{description:"Alibaba Cloud Enterprise Mail",host:"smtp.qiye.aliyun.com",port:465,secure:!0},AOL:{description:"AOL Mail",domains:["aol.com"],host:"smtp.aol.com",port:587},Aruba:{description:"Aruba PEC (Italian email provider)",domains:["aruba.it","pec.aruba.it"],aliases:["Aruba PEC"],host:"smtps.aruba.it",port:465,secure:!0,authMethod:"LOGIN"},Bluewin:{description:"Bluewin (Swiss email provider)",host:"smtpauths.bluewin.ch",domains:["bluewin.ch"],port:465},BOL:{description:"BOL Mail (Brazilian provider)",domains:["bol.com.br"],host:"smtp.bol.com.br",port:587,requireTLS:!0},DebugMail:{description:"DebugMail (email testing service)",host:"debugmail.io",port:25},Disroot:{description:"Disroot (privacy-focused provider)",domains:["disroot.org"],host:"disroot.org",port:587,secure:!1,authMethod:"LOGIN"},DynectEmail:{description:"Dyn Email Delivery",aliases:["Dynect"],host:"smtp.dynect.net",port:25},ElasticEmail:{description:"Elastic Email",aliases:["Elastic Email"],host:"smtp.elasticemail.com",port:465,secure:!0},Ethereal:{description:"Ethereal Email (email testing service)",aliases:["ethereal.email"],host:"smtp.ethereal.email",port:587},FastMail:{description:"FastMail",domains:["fastmail.com","fastmail.fm"],host:"smtp.fastmail.com",port:465,secure:!0},"Feishu Mail":{description:"Feishu Mail (Lark)",aliases:["Feishu","FeishuMail"],domains:["www.feishu.cn"],host:"smtp.feishu.cn",port:465,secure:!0},"Forward Email":{description:"Forward Email (email forwarding service)",aliases:["FE","ForwardEmail"],domains:["forwardemail.net"],host:"smtp.forwardemail.net",port:465,secure:!0},GandiMail:{description:"Gandi Mail",aliases:["Gandi","Gandi Mail"],host:"mail.gandi.net",port:587},Gmail:{description:"Gmail",aliases:["Google Mail"],domains:["gmail.com","googlemail.com"],host:"smtp.gmail.com",port:465,secure:!0},GmailWorkspace:{description:"Gmail Workspace",aliases:["Google Workspace Mail"],host:"smtp-relay.gmail.com",port:465,secure:!0},GMX:{description:"GMX Mail",domains:["gmx.com","gmx.net","gmx.de"],host:"mail.gmx.com",port:587},Godaddy:{description:"GoDaddy Email (US)",host:"smtpout.secureserver.net",port:25},GodaddyAsia:{description:"GoDaddy Email (Asia)",host:"smtp.asia.secureserver.net",port:25},GodaddyEurope:{description:"GoDaddy Email (Europe)",host:"smtp.europe.secureserver.net",port:25},"hot.ee":{description:"Hot.ee (Estonian email provider)",host:"mail.hot.ee"},Hotmail:{description:"Outlook.com / Hotmail",aliases:["Outlook","Outlook.com","Hotmail.com"],domains:["hotmail.com","outlook.com"],host:"smtp-mail.outlook.com",port:587},iCloud:{description:"iCloud Mail",aliases:["Me","Mac"],domains:["icloud.com","me.com","mac.com"],host:"smtp.mail.me.com",port:587},Infomaniak:{description:"Infomaniak Mail (Swiss hosting provider)",host:"mail.infomaniak.com",domains:["ik.me","ikmail.com","etik.com"],port:587},KolabNow:{description:"KolabNow (secure email service)",domains:["kolabnow.com"],aliases:["Kolab"],host:"smtp.kolabnow.com",port:465,secure:!0,authMethod:"LOGIN"},Loopia:{description:"Loopia (Swedish hosting provider)",host:"mailcluster.loopia.se",port:465},Loops:{description:"Loops",host:"smtp.loops.so",port:587},"mail.ee":{description:"Mail.ee (Estonian email provider)",host:"smtp.mail.ee"},"Mail.ru":{description:"Mail.ru",host:"smtp.mail.ru",port:465,secure:!0},"Mailcatch.app":{description:"Mailcatch (email testing service)",host:"sandbox-smtp.mailcatch.app",port:2525},Maildev:{description:"MailDev (local email testing)",port:1025,ignoreTLS:!0},MailerSend:{description:"MailerSend",host:"smtp.mailersend.net",port:587},Mailgun:{description:"Mailgun",host:"smtp.mailgun.org",port:465,secure:!0},Mailjet:{description:"Mailjet",host:"in.mailjet.com",port:587},Mailosaur:{description:"Mailosaur (email testing service)",host:"mailosaur.io",port:25},Mailtrap:{description:"Mailtrap",host:"live.smtp.mailtrap.io",port:587},Mandrill:{description:"Mandrill (by Mailchimp)",host:"smtp.mandrillapp.com",port:587},Naver:{description:"Naver Mail (Korean email provider)",host:"smtp.naver.com",port:587},OhMySMTP:{description:"OhMySMTP (email delivery service)",host:"smtp.ohmysmtp.com",port:587,secure:!1},One:{description:"One.com Email",host:"send.one.com",port:465,secure:!0},OpenMailBox:{description:"OpenMailBox",aliases:["OMB","openmailbox.org"],host:"smtp.openmailbox.org",port:465,secure:!0},Outlook365:{description:"Microsoft 365 / Office 365",host:"smtp.office365.com",port:587,secure:!1},Postmark:{description:"Postmark",aliases:["PostmarkApp"],host:"smtp.postmarkapp.com",port:2525},Proton:{description:"Proton Mail",aliases:["ProtonMail","Proton.me","Protonmail.com","Protonmail.ch"],domains:["proton.me","protonmail.com","pm.me","protonmail.ch"],host:"smtp.protonmail.ch",port:587,requireTLS:!0},"qiye.aliyun":{description:"Alibaba Mail Enterprise Edition",host:"smtp.mxhichina.com",port:"465",secure:!0},QQ:{description:"QQ Mail",domains:["qq.com"],host:"smtp.qq.com",port:465,secure:!0},QQex:{description:"QQ Enterprise Mail",aliases:["QQ Enterprise"],domains:["exmail.qq.com"],host:"smtp.exmail.qq.com",port:465,secure:!0},Resend:{description:"Resend",host:"smtp.resend.com",port:465,secure:!0},Runbox:{description:"Runbox (Norwegian email provider)",domains:["runbox.com"],host:"smtp.runbox.com",port:465,secure:!0},SendCloud:{description:"SendCloud (Chinese email delivery)",host:"smtp.sendcloud.net",port:2525},SendGrid:{description:"SendGrid",host:"smtp.sendgrid.net",port:587},SendinBlue:{description:"Brevo (formerly Sendinblue)",aliases:["Brevo"],host:"smtp-relay.brevo.com",port:587},SendPulse:{description:"SendPulse",host:"smtp-pulse.com",port:465,secure:!0},SES:{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-1":{description:"AWS SES Asia Pacific (Tokyo)",host:"email-smtp.ap-northeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-2":{description:"AWS SES Asia Pacific (Seoul)",host:"email-smtp.ap-northeast-2.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-3":{description:"AWS SES Asia Pacific (Osaka)",host:"email-smtp.ap-northeast-3.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTH-1":{description:"AWS SES Asia Pacific (Mumbai)",host:"email-smtp.ap-south-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-1":{description:"AWS SES Asia Pacific (Singapore)",host:"email-smtp.ap-southeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-2":{description:"AWS SES Asia Pacific (Sydney)",host:"email-smtp.ap-southeast-2.amazonaws.com",port:465,secure:!0},"SES-CA-CENTRAL-1":{description:"AWS SES Canada (Central)",host:"email-smtp.ca-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-CENTRAL-1":{description:"AWS SES Europe (Frankfurt)",host:"email-smtp.eu-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-NORTH-1":{description:"AWS SES Europe (Stockholm)",host:"email-smtp.eu-north-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-1":{description:"AWS SES Europe (Ireland)",host:"email-smtp.eu-west-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-2":{description:"AWS SES Europe (London)",host:"email-smtp.eu-west-2.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-3":{description:"AWS SES Europe (Paris)",host:"email-smtp.eu-west-3.amazonaws.com",port:465,secure:!0},"SES-SA-EAST-1":{description:"AWS SES South America (São Paulo)",host:"email-smtp.sa-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-1":{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-2":{description:"AWS SES US East (Ohio)",host:"email-smtp.us-east-2.amazonaws.com",port:465,secure:!0},"SES-US-GOV-EAST-1":{description:"AWS SES GovCloud (US-East)",host:"email-smtp.us-gov-east-1.amazonaws.com",port:465,secure:!0},"SES-US-GOV-WEST-1":{description:"AWS SES GovCloud (US-West)",host:"email-smtp.us-gov-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-1":{description:"AWS SES US West (N. California)",host:"email-smtp.us-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-2":{description:"AWS SES US West (Oregon)",host:"email-smtp.us-west-2.amazonaws.com",port:465,secure:!0},Seznam:{description:"Seznam Email (Czech email provider)",aliases:["Seznam Email"],domains:["seznam.cz","email.cz","post.cz","spoluzaci.cz"],host:"smtp.seznam.cz",port:465,secure:!0},SMTP2GO:{description:"SMTP2GO",host:"mail.smtp2go.com",port:2525},Sparkpost:{description:"SparkPost",aliases:["SparkPost","SparkPost Mail"],domains:["sparkpost.com"],host:"smtp.sparkpostmail.com",port:587,secure:!1},Tipimail:{description:"Tipimail (email delivery service)",host:"smtp.tipimail.com",port:587},TurboSMTP:{description:"TurboSMTP",host:"pro.turbo-smtp.com",port:465,secure:!0},"TurboSMTP-EU":{description:"TurboSMTP (EU region)",host:"pro.eu.turbo-smtp.com",port:465,secure:!0},Tutanota:{description:"Tutanota (Tuta Mail)",domains:["tutanota.com","tuta.com","tutanota.de","tuta.io"],host:"smtp.tutanota.com",port:465,secure:!0},Yahoo:{description:"Yahoo Mail",domains:["yahoo.com"],host:"smtp.mail.yahoo.com",port:465,secure:!0},Yandex:{description:"Yandex Mail",domains:["yandex.ru"],host:"smtp.yandex.ru",port:465,secure:!0},Zimbra:{description:"Zimbra Mail Server",aliases:["Zimbra Collaboration"],host:"smtp.zimbra.com",port:587,requireTLS:!0},Zoho:{description:"Zoho Mail",host:"smtp.zoho.com",port:465,secure:!0,authMethod:"LOGIN"}}),yp),n={};function r(e){return e.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}Object.keys(i.services).forEach(e=>{const t=i.services[e],s=function(e){const t={};return Object.keys(e).forEach(i=>{["domains","aliases"].includes(i)||(t[i]=e[i])}),t}(t);n[r(e)]=s,[].concat(t.aliases||[]).forEach(e=>{n[r(e)]=s}),[].concat(t.domains||[]).forEach(e=>{n[r(e)]=s})}),e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(wp,wp.exports)),wp.exports}function Dp(){return gp||(gp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=o((pp||(pp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(lp()),c=du(),l=o(mp()),u=s(su()),d=p;class m extends d.EventEmitter{constructor(e){if(super(),this.pool=e,this.options=e.options,this.logger=this.pool.logger,this.options.auth)switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{const e=new l.default(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"},e.on("token",e=>this.pool.mailer.emit("token",e)),e.on("error",e=>this._fail(e));break}default:if(!this.options.auth.user&&!this.options.auth.pass)break;this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||!1}}this._connection=!1,this._connected=!1,this.messages=0,this.available=!0,this._failed=!1}_fail(e){this._failed||(this._failed=!0,this.emit("error",e))}connect(e){this.pool.getSocket(this.options,(t,i)=>{if(t)return this._fail(t),e(t);let n=!1,r=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,r.host||"",r.port||""),r=Object.assign((0,c.assign)(!1,r),i)),this.connection=new a.default(r),this.connection.on("error",t=>{if(this._fail(t),!n)return n=!0,e(t)}),this.connection.once("end",()=>{this.close(),n=!0}),this.connection.connect(t=>{if(!n){if(!t)return this.auth&&(this.connection.allowsAuth||r.forceAuth)?void this.connection.login(this.auth,t=>{if(!n){if(n=!0,t)return this.connection.close(),this._fail(t),e(t);this._connected=!0,e(null,!0)}}):(n=!0,this._connected=!0,e(null,!0));n=!0}})})}send(e,t){if(!this._connected)return this.connect(i=>i?t(i):this.send(e,t));const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n,cid:this.id},"Sending message %s using #%s to <%s>",n,this.id,r.join(", ")),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.connection.send(i,e.message.createReadStream(),(e,r)=>{if(this.messages++,e)return this.connection.close(),this._fail(e),t(e);r.envelope={from:i.from,to:i.to},r.messageId=n,setImmediate(()=>{if(this.messages>=this.options.maxMessages){const e=new Error("Resource exhausted");e.code=u.EMAXLIMIT,this.connection.close(),this._fail(e)}else this.pool._checkRateLimit(()=>{this.available=!0,this.emit("available")})}),t(null,r)})}close(){this._connected=!1,this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.connection&&this.connection.close(),this.emit("close")}}t.default=m,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(op,op.exports)),op.exports)),l=o(lp()),u=o(Mp()),d=s(du()),m=s(su()),h=s(iu());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=d.parseConnectionUrl(e.url),i=i||t.service),this.options=d.assign(!1,e,t,i&&(0,u.default)(i)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.options.maxRequeues="number"==typeof this.options.maxRequeues?this.options.maxRequeues:5,this.logger=d.getLogger(this.options,{component:this.options.component||"smtp-pool"}),this.name="SMTP (pool)",this.version=h.version+"[client:"+h.version+"]",this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:!1,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0},this._closed=!1,this._queue=[],this._connections=[],this._connectionCounter=0,this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}getSocket(e,t){setImmediate(()=>t(null,!1))}send(e,t){if(this._closed){const e=new Error("Connection pool was closed");return e.code=m.ECONNECTION,setImmediate(()=>t(e)),!1}return this._queue.push({mail:e,requeueAttempts:0,callback:t}),this.idling&&this._queue.length>=this.options.maxConnections&&(this.idling=!1),setImmediate(()=>this._processMessages()),!0}close(){let e;const t=this._connections.length;if(this._closed=!0,this._clearRateLimit(),!t&&!this._queue.length)return;for(let i=t-1;i>=0;i--)this._connections[i]&&this._connections[i].available&&(e=this._connections[i],e.close(),this.logger.info({tnx:"connection",cid:e.id,action:"removed"},"Connection #%s removed",e.id));if(t&&!this._connections.length&&this.logger.debug({tnx:"connection"},"All connections removed"),!this._queue.length)return;const i=()=>{if(!this._queue.length)return void this.logger.debug({tnx:"connection"},"Pending queue entries cleared");const e=this._queue.shift();if(e&&"function"==typeof e.callback)try{e.callback(new Error("Connection pool was closed"))}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error: %s",e.message)}setImmediate(i)};setImmediate(i)}_processMessages(){if(this._closed)return;if(!this._queue.length)return void(this.idling||(this.idling=!0,this.emit("idle")));let e=this._connections.find(e=>e.available);if(!e&&this._connections.length<this.options.maxConnections&&(e=this._createConnection()),!e)return void(this.idling=!1);!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));const t=e.queueEntry=this._queue.shift();t.messageId=(e.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,""),e.available=!1,this.logger.debug({tnx:"pool",cid:e.id,messageId:t.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",t.messageId,e.id,e.messages+1),this._rateLimit.limit&&(this._rateLimit.counter++,this._rateLimit.checkpoint||(this._rateLimit.checkpoint=Date.now())),e.send(t.mail,(i,n)=>{if(t===e.queueEntry){try{t.callback(i,n)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}})}_createConnection(){const e=new c.default(this);return e.id=++this._connectionCounter,this.logger.info({tnx:"pool",cid:e.id,action:"conection"},"Created new pool resource #%s",e.id),e.on("available",()=>{this.logger.debug({tnx:"connection",cid:e.id,action:"available"},"Connection #%s became available",e.id),this._closed?this.close():this._processMessages()}),e.once("error",t=>{if(t.code!==m.EMAXLIMIT?this.logger.warn({err:t,tnx:"pool",cid:e.id},"Pool Error for #%s: %s",e.id,t.message):this.logger.debug({tnx:"pool",cid:e.id,action:"maxlimit"},"Max messages limit exchausted for #%s",e.id),e.queueEntry){try{e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}this._removeConnection(e),this._continueProcessing()}),e.once("close",()=>{this.logger.info({tnx:"connection",cid:e.id,action:"closed"},"Connection #%s was closed",e.id),this._removeConnection(e),e.queueEntry?setTimeout(()=>{let t=0;e.queueEntry&&(this._shouldRequeuOnConnectionClose(e.queueEntry)?t=this._requeueEntryOnConnectionClose(e):this._failDeliveryOnConnectionClose(e)),t?setTimeout(()=>this._continueProcessing(),t):this._continueProcessing()},50):(this._closed||!this.idling||this._connections.length||this.emit("clear"),this._continueProcessing())}),this._connections.push(e),e}_shouldRequeuOnConnectionClose(e){return this.options.maxRequeues<0||e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{const t=new Error("Reached maximum number of retries after connection was closed");t.code=m.ECONNECTION,e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",messageId:e.queueEntry.messageId,cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}}_requeueEntryOnConnectionClose(e){const t=Math.min(50*2**e.queueEntry.requeueAttempts,2e3);return e.queueEntry.requeueAttempts+=1,this.logger.debug({tnx:"pool",cid:e.id,messageId:e.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",e.queueEntry.messageId,e.id,e.queueEntry.requeueAttempts),this._queue.unshift(e.queueEntry),e.queueEntry=!1,t}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(e){const t=this._connections.indexOf(e);-1!==t&&this._connections.splice(t,1)}_checkRateLimit(e){if(!this._rateLimit.limit)return e();const t=Date.now();return this._rateLimit.counter<this._rateLimit.limit?e():(this._rateLimit.waiting.push(e),this._rateLimit.checkpoint<=t-this._rateLimit.delta?this._clearRateLimit():void(this._rateLimit.timeout||(this._rateLimit.timeout=setTimeout(()=>this._clearRateLimit(),this._rateLimit.delta-(t-this._rateLimit.checkpoint)),this._rateLimit.checkpoint=t)))}_clearRateLimit(){for(clearTimeout(this._rateLimit.timeout),this._rateLimit.timeout=null,this._rateLimit.counter=0,this._rateLimit.checkpoint=!1;this._rateLimit.waiting.length;){const e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=new c.default(this).auth;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let r=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,r.host||"",r.port||""),r=Object.assign(d.assign(!1,r),t));const s=new l.default(r);let o=!1;s.once("error",e=>{if(!o)return o=!0,s.close(),i(e)}),s.once("end",()=>{if(!o)return o=!0,i(new Error("Connection closed"))});const a=()=>{if(!o)return o=!0,s.quit(),i(null,!0)};s.connect(e=>{if(!o){if(e)return o=!0,s.close(),i(e);if(n&&(s.allowsAuth||r.forceAuth))s.login(n,e=>{if(!o)return e?(o=!0,s.close(),i(e)):void a()});else{if(!n&&s.allowsAuth&&r.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,s.close(),i(e)}a()}}})}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(sp,sp.exports)),sp.exports}var xp,Ip={exports:{}};var Cp,bp={exports:{}};var vp,Lp={exports:{}};var Ep,Ap={exports:{}};var Np,Sp,Tp={exports:{}};function kp(){return Np||(Np=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(p),c=s(iu()),l=s(du()),u=s(su()),d=o(Zu()),m=o(Wu());function h(e){return e&&"object"==typeof e&&!e.code&&(e.code=u.ESES),e}class f extends a.default{constructor(e){if(super(),!e||!e.SES||!e.SES.sesClient){const e=new Error("Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=u.ECONFIG,e}this.options=e,this.ses=this.options.SES,this.name="SESTransport",this.version=c.version,this.logger=l.getLogger(this.options,{component:this.options.component||"ses-transport"})}getRegion(e){if(!this.ses.sesClient.config||"function"!=typeof this.ses.sesClient.config.region)return e(null,!1);this.ses.sesClient.config.region().then(t=>e(null,t),t=>e(t))}send(e,t){let i=e.message._headers.find(e=>/^from$/i.test(e.key));if(i){const e=new m.default("text/plain");i=e._convertAddresses(e._parseAddresses(i.value))}const n=e.message.getEnvelope(),r=e.message.messageId(),s=[].concat(n.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:r},"Sending message %s to <%s>",r,s.join(", "));setImmediate(()=>(t=>{e.data._dkim||(e.data._dkim={}),e.data._dkim.skipFields&&"string"==typeof e.data._dkim.skipFields?e.data._dkim.skipFields+=":date:message-id":e.data._dkim.skipFields="date:message-id";const i=e.message.createReadStream(),n=i.pipe(new d.default),r=[];let s=0;n.on("readable",()=>{let e;for(;null!==(e=n.read());)r.push(e),s+=e.length}),i.once("error",e=>n.emit("error",e)),n.once("error",e=>t(e)),n.once("end",()=>t(null,Buffer.concat(r,s)))})((s,o)=>{if(s)return this.logger.error({err:s,tnx:"send",messageId:r},"Failed creating message for %s. %s",r,s.message),t(s);const a=l.copyOwnKeys({Content:{Raw:{Data:o}},FromEmailAddress:i||n.from,Destination:{ToAddresses:n.to}},e.data.ses);this.getRegion((e,i)=>{let s;!e&&i||(i="us-east-1");try{const e=new this.ses.SendEmailCommand(a);s=this.ses.sesClient.send(e)}catch(e){return h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",r,e.message),void setImmediate(()=>t(e))}s.then(e=>{"us-east-1"===i&&(i="email");const r={envelope:{from:n.from,to:n.to},messageId:"<"+e.MessageId+(/@/.test(e.MessageId)?"":"@"+i+".amazonses.com")+">",response:e.MessageId,raw:o};setImmediate(()=>t(null,r))}).catch(e=>{h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",r,e.message),setImmediate(()=>t(e))})})}))}verify(e){let t;e||(t=new Promise((t,i)=>{e=l.callbackPromise(t,i)}));const i=e,n=e=>e&&!["InvalidParameterValue","MessageRejected"].includes(e.code||e.Code||e.name)?i(h(e)):i(null,!0),r={Content:{Raw:{Data:Buffer.from("From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid")}},FromEmailAddress:"invalid@invalid",Destination:{ToAddresses:["invalid@invalid"]}};return this.getRegion(()=>{let e;try{const t=new this.ses.SendEmailCommand(r);e=this.ses.sesClient.send(t)}catch(e){return void setImmediate(()=>n(e))}e.then(()=>setImmediate(()=>n(null))).catch(e=>setImmediate(()=>n(e)))}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Tp,Tp.exports)),Tp.exports}function jp(){return Sp||(Sp=1,function(e){var t,i=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=jn&&jn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var s=t(e),o=0;o<s.length;o++)"default"!==s[o]&&i(r,e,s[o]);return n(r,e),r}),s=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createTransport=C,e.createTestAccount=b,e.getTestMessageUrl=L;const o=s(ip()),a=r(du()),c=s(Dp()),l=s((xp||(xp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=o(lp()),l=o(Mp()),u=s(du()),d=o(mp()),m=s(su()),h=s(iu());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=u.parseConnectionUrl(e.url),i=i||t.service),this.options=u.assign(!1,e,t,i&&(0,l.default)(i)),this.logger=u.getLogger(this.options,{component:this.options.component||"smtp-transport"}),this.name="SMTP",this.version=h.version+"[client:"+h.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){setImmediate(()=>t(null,!1))}getAuth(e){if(!e)return this.auth&&this.auth.oauth2&&this.mailer&&(this.auth.oauth2.provisionCallback=this.mailer.get("oauth2_provision_cb")||this.auth.oauth2.provisionCallback),this.auth;const t=Object.assign({},this.options.auth&&"object"==typeof this.options.auth?this.options.auth:{},"object"==typeof e?e:{});if(0===Object.keys(t).length)return!1;if("OAUTH2"===(t.type||"").toString().toUpperCase()){if(!t.service&&!t.user)return!1;const e=new d.default(t,this.logger);return e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback,e.on("token",e=>this.mailer.emit("token",e)),e.on("error",e=>this.emit("error",e)),{type:"OAUTH2",user:t.user,oauth2:e,method:"XOAUTH2"}}return{type:(t.type||"").toString().toUpperCase()||"LOGIN",user:t.user,credentials:{user:t.user||"",pass:t.pass,options:t.options},method:(t.method||"").trim().toUpperCase()||this.options.authMethod||!1}}send(e,t){this.getSocket(this.options,(i,n)=>{if(i)return t(i);let r=!1,s=this.options;n&&n.connection&&(this.logger.info({tnx:"proxy",remoteAddress:n.connection.remoteAddress,remotePort:n.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",n.connection.remoteAddress,n.connection.remotePort,s.host||"",s.port||""),s=Object.assign(u.assign(!1,s),n));const o=new c.default(s);let a;const l=()=>{a&&a!==this.auth&&a.oauth2&&a.oauth2.removeAllListeners(),a=null};o.once("error",e=>{if(!r)return r=!0,l(),o.close(),t(e)});const p=()=>{const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,s.join(", ")),o.send(i,e.message.createReadStream(),(e,s)=>{if(!r){if(r=!0,l(),o.close(),e)return this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",n,e.message),t(e);s.envelope={from:i.from,to:i.to},s.messageId=n;try{return t(null,s)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",n,e.message)}}})};o.connect(i=>{if(!r){if(i)return r=!0,o.close(),t(i);a=this.getAuth(e.data.auth),a&&(o.allowsAuth||s.forceAuth)?o.login(a,e=>{if(l(),!r)return e?(r=!0,o.close(),t(e)):void p()}):p()}})})}verify(e){let t;e||(t=new Promise((t,i)=>{e=u.callbackPromise(t,i)}));const i=e;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let n=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:n.host||"",destPort:n.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,n.host||"",n.port||""),n=Object.assign(u.assign(!1,n),t));const r=new c.default(n);let s,o=!1;const a=()=>{s&&s!==this.auth&&s.oauth2&&s.oauth2.removeAllListeners(),s=null};r.once("error",e=>{if(!o)return o=!0,a(),r.close(),i(e)}),r.once("end",()=>{if(!o)return o=!0,a(),i(new Error("Connection closed"))});const l=()=>{if(!o)return o=!0,a(),r.quit(),i(null,!0)};r.connect(e=>{if(!o){if(e)return o=!0,r.close(),i(e);if(s=this.getAuth({}),s&&(r.allowsAuth||n.forceAuth))r.login(s,e=>{if(a(),!o)return e?(o=!0,r.close(),i(e)):void l()});else{if(!s&&r.allowsAuth&&n.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,a(),r.close(),i(e)}l()}}})}),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ip,Ip.exports)),Ip.exports)),u=s((Cp||(Cp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=v,c=s(iu()),l=s(du()),u=s(su()),p=o(Zu()),d=o(Fu());t.default=class{constructor(e){e=e||{},this._spawn=a.spawn,this.options=e,this.name="Sendmail",this.version=c.version,this.path="sendmail",this.args=!1,this.logger=l.getLogger(this.options,{component:this.options.component||"sendmail"}),"string"==typeof e?this.path=e:"object"==typeof e&&(e.path&&(this.path=e.path),Array.isArray(e.args)&&(this.args=e.args)),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId();let r;if([].concat(i.from||[]).concat(i.to||[]).some(e=>/^"?-/.test(e))){const e=new Error("Can not send mail. Invalid envelope addresses.");return e.code=u.ESENDMAIL,t(e)}const s=this.args?["-i"].concat(this.args).concat(i.to):["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to),o=e=>{if(!r)return r=!0,"function"==typeof t?e?t(e):t(null,{envelope:i,messageId:n,response:"Messages queued for delivery"}):void 0};let a;try{a=this._spawn(this.path,s)}catch(e){return this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred while spawning sendmail. %s",e.message),o(e)}if(!a){const e=new Error("sendmail was not found");return e.code=u.ESENDMAIL,o(e)}{a.on("error",e=>{this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred when sending message %s. %s",n,e.message),o(e)}),a.once("exit",e=>{if(!e)return o();const t=new Error(127===e?"Sendmail command not found, process exited with code "+e:"Sendmail exited with code "+e);t.code=u.ESENDMAIL,this.logger.error({err:t,tnx:"stdin",messageId:n},"Error sending message %s to sendmail. %s",n,t.message),o(t)}),a.once("close",o),a.stdin.on("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when piping message %s to sendmail. %s",n,e.message),o(e)});const t=[].concat(i.to||[]);t.length>3&&t.push("...and "+t.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,t.join(", "));const r=e.message.createReadStream();let s=r;this.options.newline&&(s=r.pipe(this.winbreak?new p.default:new d.default),r.once("error",e=>s.emit("error",e))),s.once("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when generating message %s. %s",n,e.message),a.kill("SIGINT"),o(e)}),s.pipe(a.stdin)}}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(bp,bp.exports)),bp.exports)),d=s((vp||(vp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(iu()),c=s(du()),l=o(Zu()),u=o(Fu());t.default=class{constructor(e){e=e||{},this.options=e,this.name="StreamTransport",this.version=a.version,this.logger=c.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s> using %s line breaks",n,r.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let r;try{if(r=e.message.createReadStream(),this.options.newline){const e=r;r=e.pipe(this.winbreak?new l.default:new u.default),e.once("error",e=>r.emit("error",e))}}catch(e){return this.logger.error({err:e,tnx:"send",messageId:n},"Creating send stream failed for %s. %s",n,e.message),t(e)}if(!this.options.buffer)return r.once("error",e=>{this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message)}),t(null,{envelope:i,messageId:n,message:r});const s=[];let o=0;r.on("readable",()=>{let e;for(;null!==(e=r.read());)s.push(e),o+=e.length}),r.once("error",e=>(this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message),t(e))),r.on("end",()=>t(null,{envelope:i,messageId:n,message:Buffer.concat(s,o)}))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Lp,Lp.exports)),Lp.exports)),m=s((Ep||(Ep=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=s(iu()),a=s(du());t.default=class{constructor(e){e=e||{},this.options=e,this.name="JSONTransport",this.version=o.version,this.logger=a.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Composing JSON structure of %s to <%s>",n,r.join(", ")),setImmediate(()=>{e.normalize((e,r)=>e?(this.logger.error({err:e,tnx:"send",messageId:n},"Failed building JSON structure for %s. %s",n,e.message),t(e)):(delete r.envelope,delete r.normalizedHeaders,t(null,{envelope:i,messageId:n,message:this.options.skipEncoding?r:JSON.stringify(r)})))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ap,Ap.exports)),Ap.exports)),h=s(kp()),f=r(su()),g=s(pu()),w=r(iu()),y=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),M=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),D=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,x=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let I=!1;function C(e,t){let i;if("object"==typeof e&&"function"!=typeof e.send||"string"==typeof e&&/^(smtps?|direct):/i.test(e)){const t="string"==typeof e?e:e.url;if(t){const n=a.parseConnectionUrl(t);i="object"==typeof e?a.assign(!1,a.copyOwnKeys({},e,e=>"url"===e),n):n}else i=e;if(i.pool)e=new c.default(i);else if(i.sendmail)e=new u.default(i);else if(i.streamTransport)e=new d.default(i);else if(i.jsonTransport)e=new m.default(i);else if(i.SES){const t=i.SES;if(t.ses&&t.aws){const e=new Error("Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=f.ECONFIG,e}e=new h.default(i)}else e=new l.default(i)}return new o.default(e,i,t)}function b(e,t){let i;t||"function"!=typeof e||(t=e,e=!1),t||(i=new Promise((e,i)=>{t=a.callbackPromise(e,i)}));const n=t;if(x&&I)return setImmediate(()=>n(null,I)),i;e=e||y;const r=[];let s=0;const o={},c={requestor:w.name,version:w.version};D&&(o.Authorization="Bearer "+D);const l={contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(c))};/^https:/i.test(e)&&(l.tls={rejectUnauthorized:!0});const u=(0,g.default)(e+"/user",l);return u.on("readable",()=>{let e;for(;null!==(e=u.read());)r.push(e),s+=e.length}),u.once("error",e=>n(e)),u.once("end",()=>{const e=Buffer.concat(r,s);let t;try{t=JSON.parse(e.toString())}catch(e){return n(e)}if("success"!==t.status||t.error)return n(new Error(t.error||"Request failed"));delete t.status,I=t,n(null,I)}),i}function L(e){if(!e||!e.response)return!1;const t=new Map,i=e.response.toString();if(i.length>2&&"]"===i.charAt(i.length-1)){const e=i.indexOf("[",i.lastIndexOf("]",i.length-2)+1);if(e>=0&&e<i.length-2){i.substring(e+1,i.length-1).replace(/\b([A-Z0-9]+)=([^\s]+)/g,(e,i,n)=>(t.set(i,n),e))}}return!(!t.has("STATUS")||!t.has("MSGID"))&&(I&&I.web||M)+"/message/"+t.get("MSGID")}const E={createTransport:C,createTestAccount:b,getTestMessageUrl:L};e.default=E,Object.defineProperty(e,"default",{value:e,enumerable:!1,writable:!0,configurable:!0})}(Hl)),Hl}
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("path"),require("fs"),require("@hapi/hapi"),require("@hapi/inert"),require("stream"),require("http"),require("worker_threads"),require("util"),require("url"),require("pino"),require("module"),require("node:events"),require("node:net"),require("node:url"),require("node:util"),require("node:fs"),require("node:http"),require("node:https"),require("node:zlib"),require("node:stream"),require("node:dns"),require("node:os"),require("node:path"),require("node:crypto"),require("node:tls"),require("node:child_process"),require("crypto"),require("net"),require("readline")):"function"==typeof define&&define.amd?define(["path","fs","@hapi/hapi","@hapi/inert","stream","http","worker_threads","util","url","pino","module","node:events","node:net","node:url","node:util","node:fs","node:http","node:https","node:zlib","node:stream","node:dns","node:os","node:path","node:crypto","node:tls","node:child_process","crypto","net","readline"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["w-web-sso"]=t(e.path,e.fs,e["@hapi/hapi"],e["@hapi/inert"],e.stream,e.http,e.require$$0$1,e.util$2,e.url,e.pino,e.module$1,e.require$$0$6,e.require$$0$2,e.require$$1,e.require$$1$2,e.require$$2,e.require$$0$3,e.require$$1$1,e.require$$3,e.require$$0$4,e.require$$6,e.require$$8,e.require$$0$5,e.require$$2$1,e.require$$1$3,e.require$$0$7,e.crypto$1,e.net,e.readline)}(this,function(e,t,i,n,r,s,o,a,c,l,u,p,d,m,h,f,g,w,y,M,D,x,I,b,C,v,L,E,A){"use strict";var N="undefined"!=typeof document?document.currentScript:null,S=Array.isArray,T="object"==typeof global&&global&&global.Object===Object&&global,k="object"==typeof self&&self&&self.Object===Object&&self,j=T||k||Function("return this")(),Z=j.Symbol,z=Object.prototype,Y=z.hasOwnProperty,X=z.toString,F=Z?Z.toStringTag:void 0;var G=Object.prototype.toString;var O=Z?Z.toStringTag:void 0;function W(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?function(e){var t=Y.call(e,F),i=e[F];try{e[F]=void 0;var n=!0}catch(e){}var r=X.call(e);return n&&(t?e[F]=i:delete e[F]),r}(e):function(e){return G.call(e)}(e)}function P(e){return null!=e&&"object"==typeof e}function K(e){return"symbol"==typeof e||P(e)&&"[object Symbol]"==W(e)}var H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,U=/^\w*$/;function B(e,t){if(S(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!K(e))||(U.test(e)||!H.test(e)||null!=t&&e in Object(t))}function V(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function _(e){if(!V(e))return!1;var t=W(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var R,Q=j["__core-js_shared__"],J=(R=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+R:"";var $=Function.prototype.toString;function q(e){if(null!=e){try{return $.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var ee=/^\[object .+?Constructor\]$/,te=Function.prototype,ie=Object.prototype,ne=te.toString,re=ie.hasOwnProperty,se=RegExp("^"+ne.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(e){return!(!V(e)||(t=e,J&&J in t))&&(_(e)?se:ee).test(q(e));var t}function ae(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(i)?i:void 0}var ce=ae(Object,"create");var le=Object.prototype.hasOwnProperty;var ue=Object.prototype.hasOwnProperty;function pe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function de(e,t){return e===t||e!=e&&t!=t}function me(e,t){for(var i=e.length;i--;)if(de(e[i][0],t))return i;return-1}pe.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},pe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pe.prototype.get=function(e){var t=this.__data__;if(ce){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return le.call(t,e)?t[e]:void 0},pe.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:ue.call(t,e)},pe.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=ce&&void 0===t?"__lodash_hash_undefined__":t,this};var he=Array.prototype.splice;function fe(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=function(){this.__data__=[],this.size=0},fe.prototype.delete=function(e){var t=this.__data__,i=me(t,e);return!(i<0)&&(i==t.length-1?t.pop():he.call(t,i,1),--this.size,!0)},fe.prototype.get=function(e){var t=this.__data__,i=me(t,e);return i<0?void 0:t[i][1]},fe.prototype.has=function(e){return me(this.__data__,e)>-1},fe.prototype.set=function(e,t){var i=this.__data__,n=me(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var ge=ae(j,"Map");function we(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function ye(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}ye.prototype.clear=function(){this.size=0,this.__data__={hash:new pe,map:new(ge||fe),string:new pe}},ye.prototype.delete=function(e){var t=we(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return we(this,e).get(e)},ye.prototype.has=function(e){return we(this,e).has(e)},ye.prototype.set=function(e,t){var i=we(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this};function Me(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(Me.Cache||ye),i}Me.Cache=ye;var De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xe=/\\(\\)?/g,Ie=function(e){var t=Me(e,function(e){return 500===i.size&&i.clear(),e}),i=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(De,function(e,i,n,r){t.push(n?r.replace(xe,"$1"):i||e)}),t}),be=Ie;function Ce(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}var ve=Z?Z.prototype:void 0,Le=ve?ve.toString:void 0;function Ee(e){if("string"==typeof e)return e;if(S(e))return Ce(e,Ee)+"";if(K(e))return Le?Le.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ae(e){return null==e?"":Ee(e)}function Ne(e,t){return S(e)?e:B(e,t)?[e]:be(Ae(e))}function Se(e){if("string"==typeof e||K(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Te(e,t){for(var i=0,n=(t=Ne(t,e)).length;null!=e&&i<n;)e=e[Se(t[i++])];return i&&i==n?e:void 0}function ke(e,t,i){var n=null==e?void 0:Te(e,t);return void 0===n?i:n}var je=Object.prototype;function Ze(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||je)}function ze(e,t){return function(i){return e(t(i))}}var Ye=ze(Object.keys,Object),Xe=Object.prototype.hasOwnProperty;function Fe(e){if(!Ze(e))return Ye(e);var t=[];for(var i in Object(e))Xe.call(e,i)&&"constructor"!=i&&t.push(i);return t}var Ge=ae(j,"DataView"),Oe=ae(j,"Promise"),We=ae(j,"Set"),Pe=ae(j,"WeakMap"),Ke="[object Map]",He="[object Promise]",Ue="[object Set]",Be="[object WeakMap]",Ve="[object DataView]",_e=q(Ge),Re=q(ge),Qe=q(Oe),Je=q(We),$e=q(Pe),qe=W;(Ge&&qe(new Ge(new ArrayBuffer(1)))!=Ve||ge&&qe(new ge)!=Ke||Oe&&qe(Oe.resolve())!=He||We&&qe(new We)!=Ue||Pe&&qe(new Pe)!=Be)&&(qe=function(e){var t=W(e),i="[object Object]"==t?e.constructor:void 0,n=i?q(i):"";if(n)switch(n){case _e:return Ve;case Re:return Ke;case Qe:return He;case Je:return Ue;case $e:return Be}return t});var et=qe;function tt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function it(e){return null!=e&&tt(e.length)&&!_(e)}function nt(e){return function(t){return null==t?void 0:t[e]}}var rt=nt("length"),st=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function ot(e){return st.test(e)}var at="\\ud800-\\udfff",ct="["+at+"]",lt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",ut="\\ud83c[\\udffb-\\udfff]",pt="[^"+at+"]",dt="(?:\\ud83c[\\udde6-\\uddff]){2}",mt="[\\ud800-\\udbff][\\udc00-\\udfff]",ht="(?:"+lt+"|"+ut+")"+"?",ft="[\\ufe0e\\ufe0f]?",gt=ft+ht+("(?:\\u200d(?:"+[pt,dt,mt].join("|")+")"+ft+ht+")*"),wt="(?:"+[pt+lt+"?",lt,dt,mt,ct].join("|")+")",yt=RegExp(ut+"(?="+ut+")|"+wt+gt,"g");function Mt(e){return ot(e)?function(e){for(var t=yt.lastIndex=0;yt.test(e);)++t;return t}(e):rt(e)}function Dt(e){if(null==e)return 0;if(it(e))return"string"==typeof(t=e)||!S(t)&&P(t)&&"[object String]"==W(t)?Mt(e):e.length;var t,i=et(e);return"[object Map]"==i||"[object Set]"==i?e.size:Fe(e).length}function xt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(!t(e[i],i,e))return!1;return!0}var It,bt=function(e,t,i){for(var n=-1,r=Object(e),s=i(e),o=s.length;o--;){var a=s[It?o:++n];if(!1===t(r[a],a,r))break}return e};function Ct(e){return P(e)&&"[object Arguments]"==W(e)}var vt=Object.prototype,Lt=vt.hasOwnProperty,Et=vt.propertyIsEnumerable,At=Ct(function(){return arguments}())?Ct:function(e){return P(e)&&Lt.call(e,"callee")&&!Et.call(e,"callee")},Nt=At;var St="object"==typeof exports&&exports&&!exports.nodeType&&exports,Tt=St&&"object"==typeof module&&module&&!module.nodeType&&module,kt=Tt&&Tt.exports===St?j.Buffer:void 0,jt=(kt?kt.isBuffer:void 0)||function(){return!1},Zt=/^(?:0|[1-9]\d*)$/;function zt(e,t){var i=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==i||"symbol"!=i&&Zt.test(e))&&e>-1&&e%1==0&&e<t}var Yt={};function Xt(e){return function(t){return e(t)}}Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,Gt=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,Ot=Gt&&Gt.exports===Ft&&T.process,Wt=function(){try{var e=Gt&&Gt.require&&Gt.require("util").types;return e||Ot&&Ot.binding&&Ot.binding("util")}catch(e){}}(),Pt=Wt&&Wt.isTypedArray,Kt=Pt?Xt(Pt):function(e){return P(e)&&tt(e.length)&&!!Yt[W(e)]},Ht=Object.prototype.hasOwnProperty;function Ut(e,t){var i=S(e),n=!i&&Nt(e),r=!i&&!n&&jt(e),s=!i&&!n&&!r&&Kt(e),o=i||n||r||s,a=o?function(e,t){for(var i=-1,n=Array(e);++i<e;)n[i]=t(i);return n}(e.length,String):[],c=a.length;for(var l in e)!t&&!Ht.call(e,l)||o&&("length"==l||r&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||zt(l,c))||a.push(l);return a}function Bt(e){return it(e)?Ut(e):Fe(e)}function Vt(e,t){return e&&bt(e,t,Bt)}var _t=function(e,t){return function(i,n){if(null==i)return i;if(!it(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s<r)&&!1!==n(o[s],s,o););return i}}(Vt),Rt=_t;function Qt(e,t){var i=!0;return Rt(e,function(e,n,r){return i=!!t(e,n,r)}),i}function Jt(e){var t=this.__data__=new fe(e);this.size=t.size}Jt.prototype.clear=function(){this.__data__=new fe,this.size=0},Jt.prototype.delete=function(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i},Jt.prototype.get=function(e){return this.__data__.get(e)},Jt.prototype.has=function(e){return this.__data__.has(e)},Jt.prototype.set=function(e,t){var i=this.__data__;if(i instanceof fe){var n=i.__data__;if(!ge||n.length<199)return n.push([e,t]),this.size=++i.size,this;i=this.__data__=new ye(n)}return i.set(e,t),this.size=i.size,this};function $t(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new ye;++t<i;)this.add(e[t])}function qt(e,t){for(var i=-1,n=null==e?0:e.length;++i<n;)if(t(e[i],i,e))return!0;return!1}function ei(e,t){return e.has(t)}$t.prototype.add=$t.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},$t.prototype.has=function(e){return this.__data__.has(e)};function ti(e,t,i,n,r,s){var o=1&i,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var p=-1,d=!0,m=2&i?new $t:void 0;for(s.set(e,t),s.set(t,e);++p<a;){var h=e[p],f=t[p];if(n)var g=o?n(f,h,p,t,e,s):n(h,f,p,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(m){if(!qt(t,function(e,t){if(!ei(m,t)&&(h===e||r(h,e,i,n,s)))return m.push(t)})){d=!1;break}}else if(h!==f&&!r(h,f,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}var ii=j.Uint8Array;function ni(e){var t=-1,i=Array(e.size);return e.forEach(function(e,n){i[++t]=[n,e]}),i}function ri(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=e}),i}var si=Z?Z.prototype:void 0,oi=si?si.valueOf:void 0;function ai(e,t){for(var i=-1,n=t.length,r=e.length;++i<n;)e[r+i]=t[i];return e}function ci(e,t,i){var n=t(e);return S(e)?n:ai(n,i(e))}function li(e,t){for(var i=-1,n=null==e?0:e.length,r=0,s=[];++i<n;){var o=e[i];t(o,i,e)&&(s[r++]=o)}return s}function ui(){return[]}var pi=Object.prototype.propertyIsEnumerable,di=Object.getOwnPropertySymbols,mi=di?function(e){return null==e?[]:(e=Object(e),li(di(e),function(t){return pi.call(e,t)}))}:ui;function hi(e){return ci(e,Bt,mi)}var fi=Object.prototype.hasOwnProperty;var gi="[object Arguments]",wi="[object Array]",yi="[object Object]",Mi=Object.prototype.hasOwnProperty;function Di(e,t,i,n,r,s){var o=S(e),a=S(t),c=o?wi:et(e),l=a?wi:et(t),u=(c=c==gi?yi:c)==yi,p=(l=l==gi?yi:l)==yi,d=c==l;if(d&&jt(e)){if(!jt(t))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new Jt),o||Kt(e)?ti(e,t,i,n,r,s):function(e,t,i,n,r,s,o){switch(i){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new ii(e),new ii(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return de(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=ni;case"[object Set]":var c=1&n;if(a||(a=ri),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=ti(a(e),a(t),n,r,s,o);return o.delete(e),u;case"[object Symbol]":if(oi)return oi.call(e)==oi.call(t)}return!1}(e,t,c,i,n,r,s);if(!(1&i)){var m=u&&Mi.call(e,"__wrapped__"),h=p&&Mi.call(t,"__wrapped__");if(m||h){var f=m?e.value():e,g=h?t.value():t;return s||(s=new Jt),r(f,g,i,n,s)}}return!!d&&(s||(s=new Jt),function(e,t,i,n,r,s){var o=1&i,a=hi(e),c=a.length;if(c!=hi(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:fi.call(t,u)))return!1}var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var m=!0;s.set(e,t),s.set(t,e);for(var h=o;++l<c;){var f=e[u=a[l]],g=t[u];if(n)var w=o?n(g,f,u,t,e,s):n(f,g,u,e,t,s);if(!(void 0===w?f===g||r(f,g,i,n,s):w)){m=!1;break}h||(h="constructor"==u)}if(m&&!h){var y=e.constructor,M=t.constructor;y==M||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof M&&M instanceof M||(m=!1)}return s.delete(e),s.delete(t),m}(e,t,i,n,r,s))}function xi(e,t,i,n,r){return e===t||(null==e||null==t||!P(e)&&!P(t)?e!=e&&t!=t:Di(e,t,i,n,xi,r))}function Ii(e){return e==e&&!V(e)}function bi(e,t){return function(i){return null!=i&&(i[e]===t&&(void 0!==t||e in Object(i)))}}function Ci(e){var t=function(e){for(var t=Bt(e),i=t.length;i--;){var n=t[i],r=e[n];t[i]=[n,r,Ii(r)]}return t}(e);return 1==t.length&&t[0][2]?bi(t[0][0],t[0][1]):function(i){return i===e||function(e,t,i,n){var r=i.length,s=r,o=!n;if(null==e)return!s;for(e=Object(e);r--;){var a=i[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r<s;){var c=(a=i[r])[0],l=e[c],u=a[1];if(o&&a[2]){if(void 0===l&&!(c in e))return!1}else{var p=new Jt;if(n)var d=n(l,u,c,e,t,p);if(!(void 0===d?xi(u,l,3,n,p):d))return!1}}return!0}(i,e,t)}}function vi(e,t){return null!=e&&t in Object(e)}function Li(e,t){return null!=e&&function(e,t,i){for(var n=-1,r=(t=Ne(t,e)).length,s=!1;++n<r;){var o=Se(t[n]);if(!(s=null!=e&&i(e,o)))break;e=e[o]}return s||++n!=r?s:!!(r=null==e?0:e.length)&&tt(r)&&zt(o,r)&&(S(e)||Nt(e))}(e,t,vi)}function Ei(e){return e}function Ai(e){return B(e)?nt(Se(e)):function(e){return function(t){return Te(t,e)}}(e)}function Ni(e){return"function"==typeof e?e:null==e?Ei:"object"==typeof e?S(e)?function(e,t){return B(e)&&Ii(t)?bi(Se(e),t):function(i){var n=ke(i,e);return void 0===n&&n===t?Li(i,e):xi(t,n,3)}}(e[0],e[1]):Ci(e):Ai(e)}function Si(e,t,i){if(!V(i))return!1;var n=typeof t;return!!("number"==n?it(i)&&zt(t,i.length):"string"==n&&t in i)&&de(i[t],e)}function Ti(e){return"[object Object]"===Object.prototype.toString.call(e)}function ki(e){if(Ti(e)){for(let t in e)return!0;return!1}return!1}function ji(e){return"[object String]"===Object.prototype.toString.call(e)}function Zi(e){return!!(ji(e)&&e.length>0)}var zi=/\s/;var Yi=/^\s+/;function Xi(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&zi.test(e.charAt(t)););return t}(e)+1).replace(Yi,""):e}var Fi=/^[-+]0x[0-9a-f]+$/i,Gi=/^0b[01]+$/i,Oi=/^0o[0-7]+$/i,Wi=parseInt;function Pi(e){if("number"==typeof e)return e;if(K(e))return NaN;if(V(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=V(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xi(e);var i=Gi.test(e);return i||Oi.test(e)?Wi(e.slice(2),i?2:8):Fi.test(e)?NaN:+e}var Ki=1/0;function Hi(e){return e?(e=Pi(e))===Ki||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ui(e){var t=Hi(e),i=t%1;return t==t?i?t-i:t:0}function Bi(e){return!0===(t=e)||!1===t||P(t)&&"[object Boolean]"==W(t);var t}function Vi(e){if(e!=e)return!0;if(null!==e&&"object"==typeof e)try{let t=Number.prototype.valueOf.call(e);return Number.isNaN(t)}catch(e){return!1}return!1}function _i(e){let t=!1;if(Zi(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(Vi(e))return!1;t=!0}return t}function Ri(e){if(!_i(e))return 0;return Hi(e)}function Qi(e,t={}){let i=ke(t,"useLimitSafe",null);return Bi(i)||(i=!1),!!_i(e)&&(e=Ri(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==Ui(n));var n}var Ji=j.isFinite,$i=Math.min;var qi,en=(qi=Math["round"],function(e,t){if(e=Pi(e),(t=null==t?0:$i(Ui(t),292))&&Ji(e)){var i=(Ae(e)+"e").split("e");return+((i=(Ae(qi(i[0]+"e"+(+i[1]+t)))+"e").split("e"))[0]+"e"+(+i[1]-t))}return qi(e)});function tn(e,t={}){let i=ke(t,"useClampSafe",null);Bi(i)||(i=!1);let n=ke(t,"useLimitSafe",null);Bi(n)||(n=!1);let r=ke(t,"returnWithStateAndMsg",null);Bi(r)||(r=!1);let s=e=>r?{state:"success",msg:e}:e,o=e=>{if(r)return{state:"error",msg:e};throw new Error(e)};if(!_i(e))return s(0);let a=null;try{e=Ri(e),a=en(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),s(a))}function nn(e,t={}){if(!Qi(e,t))return!1;return tn(e)>0}function rn(e){return"[object Array]"===Object.prototype.toString.call(e)}function sn(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function on(e){if(Ti(e)){for(let t in e)return!1;return!0}return!1}function an(e){return!!rn(e)&&0===e.length}function cn(e){return!!sn(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!on(e)||(!!function(e){return!(!ji(e)||0!==e.length)}(e)||(!!an(e)||!!Vi(e)))))}function ln(e){return!!rn(e)&&(0!==e.length&&(1!==e.length||!cn(e[0])))}function un(e){if(!_i(e))return!1;return Ri(e)>0}var pn=ze(Object.getPrototypeOf,Object),dn=Function.prototype,mn=Object.prototype,hn=dn.toString,fn=mn.hasOwnProperty,gn=hn.call(Object);function wn(e){if(!P(e)||"[object Object]"!=W(e))return!1;var t=pn(e);if(null===t)return!0;var i=fn.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&hn.call(i)==gn}function yn(e){return function(e){if(!P(e))return!1;var t=W(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!wn(e)}(e)}function Mn(e){return _(e)}function Dn(e,t={}){if(!Qi(e,t))return!1;return tn(e)>=0}function xn(e,t){return Zi(e)&&Dn(t)?0===(t=tn(t))?"":e.substring(0,t):""}function In(e,t){if(!Zi(e))return"";if(!Dn(t))return"";if(0===(t=tn(t)))return"";let i=e.length-t;return i<0&&(i=0),e.substring(i,i+t)}function bn(e,t){return Zi(e)&&Dn(t)?0===(t=tn(t))?e:xn(e,e.length-t):""}function Cn(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}function vn(e){let t,i;try{i=Object.prototype.toString.call(e)}catch(e){return!1}if(t="[object Promise]"===i,t)return!0;if("[object Function]"!==i)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}let Ln=function(e){if(!Mn(e))throw new Error("fn is not a function");return function(){let t,i=Cn();try{t=e.apply(this,arguments)}catch(e){return i.resolve({state:"error",msg:e}),i}let n=e=>{let t=!1;try{t="cancelled"===ke(e,"reason")}catch(e){}t?i.resolve({state:"cancelled",msg:""}):i.resolve({state:"error",msg:e})};try{vn(t)?t.then(e=>{i.resolve({state:"success",msg:e})},n):i.resolve({state:"success",msg:t})}catch(e){i.resolve({state:"error",msg:e})}return i}};function En(e,t={}){let i=ke(t,"fs"),n=!1;try{i.statSync(e),n=!0}catch{n=!1}return n}function An(e,t={}){let i=ke(t,"fs");if(!En(e,{fs:i}))return!1;let n=i.lstatSync(e);return!n.isFile()&&!n.isSymbolicLink()}function Nn(e){return An(e,{fs:t})}function Sn(e,t={}){let i=ke(t,"fs");return!!En(e,{fs:i})&&(!i.lstatSync(e).isDirectory()&&!i.lstatSync(e).isSymbolicLink())}function Tn(e){return Sn(e,{fs:t})}function kn(e,t,i){if(!Zi(e))return"";if(!Zi(t))return"";if(!ji(i))return"";return String(e).replaceAll(t,i)}var jn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){if(this instanceof e){var i=[null];return i.push.apply(i,arguments),new(Function.bind.apply(t,i))}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),i}var Yn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}(Yn);var Xn=Zn(Yn.exports);function Fn(){return new Xn}function Gn(e,t,i=[],n={}){let r=n.funSettle,s=n.tag||"evem",o=(t,...i)=>e.emit(t,...i);Mn(n.funEmit)&&(o=n.funEmit);try{return o(t,...i)}catch(n){if(Mn(r))try{r(n)}catch(e){}try{"error"!==t&&e.listenerCount("error")>0?o("error",{fun:"listener",name:t,msg:n,args:i}):console.error(`[wsemi ${s}] listener of '${String(t)}' threw:`,n)}catch(e){try{console.error(`[wsemi ${s}] listener of '${String(t)}' threw, and reporting it also threw:`,e,n)}catch(e){}}return!1}}let On=2147483647;function Wn(e,t,i=[],n={}){let r=n.ms;return nn(r)||(r=1),r=tn(r),r=Math.min(r,On),setTimeout(()=>{Gn(e,t,i,n)},r)}function Pn(e){try{let t=e();return"string"==typeof t?t:""}catch(e){return""}}function Kn(e,t){try{let i=new WeakSet,n=[],r=JSON.stringify(e,function(e,r){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.length>=t)return"[Deep]";if("bigint"==typeof r)return String(r);if(null!==r&&"object"==typeof r){if(i.has(r))return"[Circular]";i.add(r),n.push(r)}return r});return"string"==typeof r?r:""}catch(e){return""}}function Hn(e){if(e.length>=2&&'"'===e[0]&&'"'===e[e.length-1]){let t=Pn(()=>JSON.parse(e));if(""!==t)return t}return e}function Un(e,t){if(void 0===e)return"";if(null===e)return"null";let i=function(e){let t=typeof e;return"string"===t?e:null==e?"":"number"===t||"boolean"===t||"bigint"===t||"symbol"===t?String(e):""}(e);if(""!==i)return i;let n=Kn(e,t);if(""!==n&&"{}"!==n)return Hn(n);let r=Pn(()=>String(e));return""!==r&&"[object Object]"!==r?r:n}function Bn(e,t){let i=new WeakSet;null===e||"object"!=typeof e&&"function"!=typeof e||i.add(e);let n=e,r=[];for(let e=0;e<t.levelCauseMax;e++){let e=null;try{e=n.cause}catch(e){break}if(null==e)break;if("object"==typeof e||"function"==typeof e){if(i.has(e))break;i.add(e)}let s=_n(e,{...t,useCause:!1,useAggregate:!1});""!==s&&r.push(s),n=e}return r.join(" <- ")}function Vn(e,t){let i=null;try{i=e.errors}catch(e){return""}if(!Array.isArray(i)||0===i.length)return"";let n=[];for(let r=0;r<i.length&&r<t.levelCauseMax;r++){if(i[r]===e)continue;let s=_n(i[r],{...t,useCause:!1,useAggregate:!1});""!==s&&n.push(s)}return n.join("; ")}function _n(e,t){if("string"==typeof e)return e;if(null==e)return"";if("number"==typeof e)return Number.isNaN(e)?"":String(e);if("boolean"==typeof e||"bigint"==typeof e||"symbol"==typeof e)return String(e);let i=null,n=!1;try{i=e.message,n=!0}catch(e){n=!1}if(n&&"string"==typeof i){if(""!==i){let n=i;if(t.useCause){let i=Bn(e,t);""!==i&&(n=`${n} <- ${i}`)}if(t.useAggregate){let i=Vn(e,t);""!==i&&(n=`${n} [${i}]`)}return n}let n=Bn(e,t);return""!==n?n:""}if(n){let e=Un(i,t.levelJsonMax);if(""!==e)return e}let r=Bn(e,t);if(""!==r)return r;if(t.useAggregate){let i=Vn(e,t);if(""!==i)return i}let s=Kn(e,t.levelJsonMax),o=Hn(s);if(""!==o&&"{}"!==o)return o;let a=Pn(()=>String(e));if(""!==a&&"[object Object]"!==a)return a;let c=Pn(()=>Object.prototype.toString.call(e));return""!==c&&"[object Object]"!==c?c:""!==s?s:""}function Rn(e,t={}){let i=ke(t,"useCause",null);Bi(i)||(i=!1);let n=ke(t,"useAggregate",null);Bi(n)||(n=!1);let r=ke(t,"levelCauseMax",null);nn(r,{useLimitSafe:!0})||(r=8),r=tn(r);let s=ke(t,"levelJsonMax",null);nn(s,{useLimitSafe:!0})||(s=6),s=tn(s);let o=ke(t,"lengthMessageMax",null);nn(o,{useLimitSafe:!0})||(o=0),o=tn(o);let a={useCause:i,useAggregate:n,levelCauseMax:r,levelJsonMax:s,lengthMessageMax:o},c="";try{c=_n(e,a)}catch(e){return c="",c}return Zi(c)?(a.lengthMessageMax>0&&c.length>a.lengthMessageMax&&(c=a.lengthMessageMax>3?c.slice(0,a.lengthMessageMax-3)+"...":c.slice(0,a.lengthMessageMax)),c):(c="",c)}function Qn(e){if(!(Zi(e)||_i(e)||K(e)||function(e){return"[object BigInt]"===Object.prototype.toString.call(e)}(e)))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}var Jn={exports:{}};var $n,qn={exports:{}},er=zn(Object.freeze({__proto__:null,default:{}}));function tr(){return $n||($n=1,function(e){var t;e.exports=(t=t||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==jn&&jn.crypto&&(i=jn.crypto),!i)try{i=er}catch(e){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),s={},o=s.lib={},a=o.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=a.extend({init:function(e,i){e=this.words=e||[],this.sigBytes=i!=t?i:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<r;s++){var o=i[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<r;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new c.init(t,e)}}),l=s.enc={},u=l.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(i,t/2)}},p=l.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var s=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(i,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i,n=this._data,r=n.words,s=n.sigBytes,o=this.blockSize,a=s/(4*o),l=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*l,s);if(l){for(var p=0;p<l;p+=o)this._doProcessBlock(r,p);i=r.splice(0,l),n.sigBytes-=u}return new c.init(i,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new h.HMAC.init(e,i).finalize(t)}}});var h=s.algo={};return s}(Math),t)}(qn)),qn.exports}!function(e){e.exports=tr().enc.Utf8}(Jn);var ir=Zn(Jn.exports),nr={exports:{}};!function(e){var t;e.exports=(t=tr(),function(){var e=t,i=e.lib.WordArray;function n(e,t,n){for(var r=[],s=0,o=0;o<t;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;r[s>>>2]|=a<<24-s%4*8,s++}return i.create(r,s)}e.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var r=[],s=0;s<i;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<i;a++)r.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var s=0;s<i.length;s++)r[i.charCodeAt(s)]=s}var o=i.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return n(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(nr);var rr=Zn(nr.exports);function sr(e,t){return!!Ti(e)&&(!(!Zi(t)&&!_i(t))&&t in e)}function or(e,t){for(var i=-1,n=null==e?0:e.length;++i<n&&!1!==t(e[i],i,e););return e}function ar(e,t){var i;return(S(e)?or:Rt)(e,"function"==typeof(i=t)?i:Ei)}function cr(e){try{return String(e)}catch(e){}try{let t=e.message;if("string"==typeof t&&""!==t)return t}catch(e){}return"unknown error"}function lr(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function ur(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function pr(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function dr(e){if(!(lr(e)||function(e){let t=Object.prototype.toString.call(e);if("[object Blob]"===t||"[object File]"===t)return!0;try{if("undefined"!=typeof Blob&&e instanceof Blob)return!0}catch(e){}return!1}(e)||ur(e)||pr(e)))return null;try{if(_i(e.byteLength))return e.byteLength}catch(e){}try{if(_i(e.length))return e.length}catch(e){}try{if(_i(e.size))return e.size}catch(e){}return null}function mr(e){if(null===e||"object"!=typeof e)return!1;if(e instanceof Error)return!0;if("function"==typeof Error.isError)return Error.isError(e);if(Symbol.toStringTag in e)return!1;let t=Object.prototype.toString.call(e);return"[object Error]"===t||"[object DOMException]"===t}function hr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{results:"",binarys:[]};if(!Ti(e)&&!rn(e))return n("invalid data, data is not an object or array");if(on(e)||an(e))return n("invalid data, data is an empty object or empty array");let r=/^(?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,s="",o=[];try{let t=-1;s=JSON.stringify(e,function(e,i){if(ur(i)){t+=1;let e=`[BlazeForUint8Array]::${t}`;return o.push(i),e}if(pr(i)){t+=1;let e=`[BlazeForUint16Array]::${t}`;return o.push(i),e}if(lr(i)){t+=1;let e=`[BlazeForArrayBuffer]::${t}`;return o.push(i),e}return i=function(e){if(!mr(e))return e;let t=e.toString;return t===Object.prototype.toString||"function"!=typeof t?Error.prototype.toString.call(e):t.call(e)}(i),Zi(i)&&91===i.charCodeAt(0)&&r.test(i)?"[BlazeForPreventEscape]"+i:i})}catch(e){return n(cr(e))}return i?{state:"success",msg:{results:s,binarys:o}}:{results:s,binarys:o}}let fr=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function gr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:new Uint8Array;if(!Zi(e))return n("invalid str");if(!("function"==typeof e.isWellFormed?e.isWellFormed():!fr.test(e)))return n("invalid str, contains lone surrogates");let r=null;try{r=(new TextEncoder).encode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}function wr(e,t,i=0,n=!0,r=52,s=8){return function(e,t,i,n,r,s){if(!_i(e))return null;if(!ur(t))return null;if(!Qi(i))return null;if(!Bi(n))return null;if(!Qi(r))return null;if(!Qi(s))return null;let o,a,c;e=Ri(e);let l=8*s-r-1,u=(1<<l)-1,p=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?s-1:0,h=n?-1:1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),(e+=o+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(o++,c/=2),o+p>=u?(a=0,o=u):o+p>=1?(a=(e*c-1)*Math.pow(2,r),o+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,r),o=0));r>=8;t[i+m]=255&a,m+=h,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;t[i+m]=255&o,m+=h,o/=256,l-=8);return t[i+m-h]|=128*f,null}(e,t,i,n,r,s)}function yr(e){let t=0;ar(e,e=>{t+=dr(e)});let i=new Uint8Array(t),n=0;return ar(e,e=>{let t=function(e){return lr(e)?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0)}(e);i.set(t,n),n+=t.length}),i}function Mr(e,t={}){let i=[],n=new Uint8Array,r=ke(t,"returnWithStateAndMsg",null);Bi(r)||(r=!1);let s=e=>r?{state:"error",msg:e}:new Uint8Array;if(!(o=e,rn(o)&&o.length>=1||ki(e)))return s("invalid data, data is not an effective object or a non-empty array");var o;let a=[],c=[];function l(e){a.push(dr(e)),c.push(e)}try{let t=hr(e,{returnWithStateAndMsg:!0});if("error"===t.state)return s(`obj2stru8arr: ${t.msg}`);let r=t.msg;l(gr(r.results)),ar(r.binarys,e=>{l(e)});let o=a,u=gr(JSON.stringify(o)),p=new Uint8Array(8);wr(dr(u),p),i.push(p),i.push(u),ar(c,e=>{i.push(e)}),n=yr(i)}catch(e){return s(cr(e))}return r?{state:"success",msg:n}:n}function Dr(e,t=0,i=!0,n=52,r=8){return function(e,t,i,n,r){if(!ur(e))return null;if(!Qi(t))return null;if(!Bi(i))return null;if(!Qi(n))return null;if(!Qi(r))return null;let s,o,a=8*r-n-1,c=(1<<a)-1,l=c>>1,u=-7,p=i?0:r-1,d=i?1:-1,m=e[t+p];for(p+=d,s=m&(1<<-u)-1,m>>=-u,u+=a;u>0;s=256*s+e[t+p],p+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=256*o+e[t+p],p+=d,u-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,n),s-=l}return(m?-1:1)*o*Math.pow(2,s-n)}(e,t,i,n,r)}function xr(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!ur(e))return n("invalid u8a");let r="";try{r=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}function Ir(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!ki(e))return n("invalid data");let r=null,s=null;try{r=e.results,s=e.binarys}catch(e){return n(cr(e))}if(!Zi(r))return n("invalid results");if(!rn(s))return n("invalid binarys");let o=/^\[BlazeFor(Uint8Array|Uint16Array|ArrayBuffer)\]::(\d+)$/,a=/^\[BlazeForPreventEscape\](?:\[BlazeForPreventEscape\])*\[BlazeFor(?:Uint8Array|Uint16Array|ArrayBuffer)\]::\d+$/,c=new Set,l={};try{l=JSON.parse(r,function(e,t){if(!Zi(t)||91!==t.charCodeAt(0))return t;let i=o.exec(t);if(null===i)return a.test(t)?t.slice(23):t;let n=Number(i[2]);if(n>=s.length)throw new Error(`binary index out of range[${n}], binarys.length[${s.length}]`);if(c.has(n))throw new Error(`binary index referenced more than once[${n}]`);return c.add(n),((e,t,i)=>{if("Uint16Array"===e&&!pr(i)){if(!ur(i))throw new Error(`binarys[${t}] can not be restored to Uint16Array`);if(i.byteLength%2!=0)throw new Error(`binarys[${t}] byteLength[${i.byteLength}] is not even, can not be restored to Uint16Array`);let e=0===i.byteOffset&&i.byteLength===i.buffer.byteLength?i:new Uint8Array(i);return new Uint16Array(e.buffer)}if("ArrayBuffer"===e&&!lr(i)){if(!ur(i))throw new Error(`binarys[${t}] can not be restored to ArrayBuffer`);return i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}return i})(i[1],n,s[n])})}catch(e){return n(cr(e))}return i?{state:"success",msg:l}:l}function br(e,t={}){let i={},n=ke(t,"returnWithStateAndMsg",null);Bi(n)||(n=!1);let r=e=>n?{state:"error",msg:e}:{};if(!ur(e))return r("invalid u8a");try{let t=8,n=e.slice(0,t),s=e.slice(t,dr(e)),o=Dr(n),a=s.slice(0,o),c=s.slice(o,dr(s)),l=xr(a,{returnWithStateAndMsg:!0});if("error"===l.state)return r(`u8arr2str: ${l.msg}`);let u=l.msg,p=JSON.parse(u),d=function(e,t){if(!Array.isArray(e))return"not an array";for(let t=0;t<e.length;t++){let i=e[t];if(!Number.isInteger(i)||i<0)return"every item must be a non-negative finite integer"}let i=0;for(let n=0;n<e.length;n++)if(i+=e[n],i>t)return"total length exceeds the packet";return e.length>1&&25*(e.length-1)>e[0]?"too many chunks for the main block":""}(p,dr(c));if(""!==d)return r(`invalid pks, ${d}`);let m=function(e,t){let i=0,n=0,r=[];for(let s=0;s<t.length;s++){n=i+t[s];let o=e.slice(i,n);i=n,r.push(o)}return r}(c,p),h=xr(m.shift(),{returnWithStateAndMsg:!0});if("error"===h.state)return r(`u8arr2str: ${h.msg}`);let f=Ir({results:h.msg,binarys:m},{returnWithStateAndMsg:!0});if("error"===f.state)return r(`stru8arr2obj: ${f.msg}`);i=f.msg}catch(e){return r(cr(e))}return n?{state:"success",msg:i}:i}function Cr(e){let t=!1;try{t=mr(e)}catch(e){}if(t)return e;if("string"==typeof e&&""!==e)return e;let i=cr(e);return""!==i?i:"unknown error"}function vr(e){return function(e,t={}){try{let i=ke(t,"fs");if(An(e,{fs:i}))return{success:"input folder is already exists: "+e};if(En(e,{fs:i}))return{error:"input path already exists: "+e};i.mkdirSync(e,{recursive:!0})}catch(e){return{error:Cr(e)}}return{success:"done: "+e}}(e,{fs:t})}function Lr(e){return function(e,t={}){try{let i=ke(t,"fs");if(!En(e,{fs:i}))return{success:"file does not exist: "+e};if(!Sn(e,{fs:i}))return{error:"input path is not a file: "+e};i.unlinkSync(e)}catch(e){return{error:Cr(e)}}return{success:"done: "+e}}(e,{fs:t})}function Er(e){return Zi(e)&&e.length<=128&&/^[A-Za-z0-9]+$/.test(e)}let Ar={permission:200,param:200,app:200,output:200,packet:200,internal:200},Nr={main:{event:"execute",apiType:"main",api:"apiMain",authFrom:"header",statusOf:Ar},ulctr:{event:"upload",apiType:"upload-controller",api:"apiUploadCheck",authFrom:"header",statusOf:Ar},slc:{event:"upload",apiType:"upload-slice",api:"apiUploadSlice",authFrom:"header",statusOf:Ar},dwgfn:{event:"download",apiType:"download-get-filename",api:"apiDownloadGetFilename",authFrom:"header",statusOf:Ar,fields:[{name:"streamRead"},{name:"filename"}]},dwgf:{event:"download",apiType:"download-get-file",api:"apiDownloadGetFile",authFrom:"query",statusOf:{permission:403,param:400,app:404,output:500,packet:500,internal:500},fields:[{name:"streamRead"},{name:"fileSize"},{name:"fileType"},{name:"filename",optional:!0}]},dw:{event:"download",apiType:"download",api:"apiDownload",authFrom:"header",statusOf:Ar,fields:[{name:"streamRead"},{name:"filename"},{name:"fileSize"},{name:"fileType"}]}};var Sr={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,i=36e5,n="millisecond",r="second",s="minute",o="hour",a="day",c="week",l="month",u="quarter",p="year",d="date",m="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}},w=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},y={s:w,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+w(n,2,"0")+":"+w(r,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),r=t.clone().add(n,l),s=i-r<0,o=t.clone().add(n+(s?-1:1),l);return+(-(n+(i-r)/(s?r-o:o-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:p,w:c,d:a,D:d,h:o,m:s,s:r,ms:n,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},M="en",D={};D[M]=g;var x="$isDayjsObject",I=function(e){return e instanceof L||!(!e||!e[x])},b=function e(t,i,n){var r;if(!t)return M;if("string"==typeof t){var s=t.toLowerCase();D[s]&&(r=s),i&&(D[s]=i,r=s);var o=t.split("-");if(!r&&o.length>1)return e(o[0])}else{var a=t.name;D[a]=t,r=a}return!n&&r&&(M=r),r||!n&&M},C=function(e,t){if(I(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new L(i)},v=y;v.l=b,v.i=I,v.w=function(e,t){return C(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var L=function(){function g(e){this.$L=b(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var w=g.prototype;return w.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(v.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var r=n[2]-1||0,s=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.init()},w.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},w.$utils=function(){return v},w.isValid=function(){return!(this.$d.toString()===m)},w.isSame=function(e,t){var i=C(e);return this.startOf(t)<=i&&i<=this.endOf(t)},w.isAfter=function(e,t){return C(e)<this.startOf(t)},w.isBefore=function(e,t){return this.endOf(t)<C(e)},w.$g=function(e,t,i){return v.u(e)?this[t]:this.set(i,e)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(e,t){var i=this,n=!!v.u(t)||t,u=v.p(e),m=function(e,t){var r=v.w(i.$u?Date.UTC(i.$y,t,e):new Date(i.$y,t,e),i);return n?r:r.endOf(a)},h=function(e,t){return v.w(i.toDate()[e].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(t)),i)},f=this.$W,g=this.$M,w=this.$D,y="set"+(this.$u?"UTC":"");switch(u){case p:return n?m(1,0):m(31,11);case l:return n?m(1,g):m(0,g+1);case c:var M=this.$locale().weekStart||0,D=(f<M?f+7:f)-M;return m(n?w-D:w+(6-D),g);case a:case d:return h(y+"Hours",0);case o:return h(y+"Minutes",1);case s:return h(y+"Seconds",2);case r:return h(y+"Milliseconds",3);default:return this.clone()}},w.endOf=function(e){return this.startOf(e,!1)},w.$set=function(e,t){var i,c=v.p(e),u="set"+(this.$u?"UTC":""),m=(i={},i[a]=u+"Date",i[d]=u+"Date",i[l]=u+"Month",i[p]=u+"FullYear",i[o]=u+"Hours",i[s]=u+"Minutes",i[r]=u+"Seconds",i[n]=u+"Milliseconds",i)[c],h=c===a?this.$D+(t-this.$W):t;if(c===l||c===p){var f=this.clone().set(d,1);f.$d[m](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else m&&this.$d[m](h);return this.init(),this},w.set=function(e,t){return this.clone().$set(e,t)},w.get=function(e){return this[v.p(e)]()},w.add=function(n,u){var d,m=this;n=Number(n);var h=v.p(u),f=function(e){var t=C(m);return v.w(t.date(t.date()+Math.round(e*n)),m)};if(h===l)return this.set(l,this.$M+n);if(h===p)return this.set(p,this.$y+n);if(h===a)return f(1);if(h===c)return f(7);var g=(d={},d[s]=t,d[o]=i,d[r]=e,d)[h]||1,w=this.$d.getTime()+n*g;return v.w(w,this)},w.subtract=function(e,t){return this.add(-1*e,t)},w.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",r=v.z(this),s=this.$H,o=this.$m,a=this.$M,c=i.weekdays,l=i.months,u=i.meridiem,p=function(e,i,r,s){return e&&(e[i]||e(t,n))||r[i].slice(0,s)},d=function(e){return v.s(s%12||12,e,"0")},h=u||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n};return n.replace(f,function(e,n){return n||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return v.s(t.$y,4,"0");case"M":return a+1;case"MM":return v.s(a+1,2,"0");case"MMM":return p(i.monthsShort,a,l,3);case"MMMM":return p(l,a);case"D":return t.$D;case"DD":return v.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(i.weekdaysMin,t.$W,c,2);case"ddd":return p(i.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return v.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(s,o,!0);case"A":return h(s,o,!1);case"m":return String(o);case"mm":return v.s(o,2,"0");case"s":return String(t.$s);case"ss":return v.s(t.$s,2,"0");case"SSS":return v.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(n,d,m){var h,f=this,g=v.p(d),w=C(n),y=(w.utcOffset()-this.utcOffset())*t,M=this-w,D=function(){return v.m(f,w)};switch(g){case p:h=D()/12;break;case l:h=D();break;case u:h=D()/3;break;case c:h=(M-y)/6048e5;break;case a:h=(M-y)/864e5;break;case o:h=M/i;break;case s:h=M/t;break;case r:h=M/e;break;default:h=M}return m?h:v.a(h)},w.daysInMonth=function(){return this.endOf(l).$D},w.$locale=function(){return D[this.$L]},w.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=b(e,t,!0);return n&&(i.$L=n),i},w.clone=function(){return v.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},g}(),E=L.prototype;return C.prototype=E,[["$ms",n],["$s",r],["$m",s],["$H",o],["$W",a],["$M",l],["$y",p],["$D",d]].forEach(function(e){E[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),C.extend=function(e,t){return e.$i||(e(t,L,C),e.$i=!0),C},C.locale=b,C.isDayjs=I,C.unix=function(e){return C(1e3*e)},C.en=D[M],C.Ls=D,C.p={},C}()}(Sr);var Tr=Zn(Sr.exports);let kr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),jr=kr.length;function Zr(e=32){let t=[];e=nn(e)?tn(e):32;for(let i=0;i<e;i++)t[i]=kr[0|Math.random()*jr];return t.join("")}function zr(e,t){var i=-1,n=it(e)?Array(e.length):[];return Rt(e,function(e,r,s){n[++i]=t(e,r,s)}),n}function Yr(e,t){return(S(e)?Ce:zr)(e,Ni(t))}function Xr(e,t,i){var n=-1,r=e.length;t<0&&(t=-t>r?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(r);++n<r;)s[n]=e[n+t];return s}function Fr(e,t,i){var n=e.length;return i=void 0===i?n:i,!t&&i>=n?e:Xr(e,t,i)}function Gr(e){return e!=e}function Or(e,t,i){return t==t?function(e,t,i){for(var n=i-1,r=e.length;++n<r;)if(e[n]===t)return n;return-1}(e,t,i):function(e,t,i,n){for(var r=e.length,s=i+(n?1:-1);n?s--:++s<r;)if(t(e[s],s,e))return s;return-1}(e,Gr,i)}var Wr="\\ud800-\\udfff",Pr="["+Wr+"]",Kr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Hr="\\ud83c[\\udffb-\\udfff]",Ur="[^"+Wr+"]",Br="(?:\\ud83c[\\udde6-\\uddff]){2}",Vr="[\\ud800-\\udbff][\\udc00-\\udfff]",_r="(?:"+Kr+"|"+Hr+")"+"?",Rr="[\\ufe0e\\ufe0f]?",Qr=Rr+_r+("(?:\\u200d(?:"+[Ur,Br,Vr].join("|")+")"+Rr+_r+")*"),Jr="(?:"+[Ur+Kr+"?",Kr,Br,Vr,Pr].join("|")+")",$r=RegExp(Hr+"(?="+Hr+")|"+Jr+Qr,"g");function qr(e){return ot(e)?function(e){return e.match($r)||[]}(e):function(e){return e.split("")}(e)}function es(e,t,i){if((e=Ae(e))&&(i||void 0===t))return Xi(e);if(!e||!(t=Ee(t)))return e;var n=qr(e),r=qr(t),s=function(e,t){for(var i=-1,n=e.length;++i<n&&Or(t,e[i],0)>-1;);return i}(n,r),o=function(e,t){for(var i=e.length;i--&&Or(t,e[i],0)>-1;);return i}(n,r)+1;return Fr(n,s,o).join("")}function ts(e,t){if(!Zi(e))return[];if(!Zi(t))return[];let i=function(e,t){return Zi(e)&&Zi(t)?e.split(t):[]}(e,t);i=Yr(i,es);let n=[];return ar(i,function(e){Zi(e)&&n.push(e)}),n}const is=new Uint8Array([0,97,115,109,1,0,0,0,1,48,8,96,3,127,127,127,1,127,96,3,127,127,127,0,96,2,127,127,0,96,1,127,1,127,96,3,127,127,126,1,126,96,3,126,127,127,1,126,96,2,127,126,0,96,1,127,1,126,3,11,10,0,0,2,1,3,4,5,6,1,7,5,3,1,0,1,7,85,9,3,109,101,109,2,0,5,120,120,104,51,50,0,0,6,105,110,105,116,51,50,0,2,8,117,112,100,97,116,101,51,50,0,3,8,100,105,103,101,115,116,51,50,0,4,5,120,120,104,54,52,0,5,6,105,110,105,116,54,52,0,7,8,117,112,100,97,116,101,54,52,0,8,8,100,105,103,101,115,116,54,52,0,9,10,251,22,10,242,1,1,4,127,32,0,32,1,106,33,3,32,1,65,16,79,4,127,32,3,65,16,107,33,6,32,2,65,168,136,141,161,2,106,33,3,32,2,65,137,235,208,208,7,107,33,4,32,2,65,207,140,162,142,6,106,33,5,3,64,32,3,32,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,4,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,4,32,2,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,5,32,0,65,4,106,34,0,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,6,32,0,65,4,106,34,0,79,13,0,11,32,2,65,12,119,32,5,65,18,119,106,32,4,65,7,119,106,32,3,65,1,119,106,5,32,2,65,177,207,217,178,1,106,11,32,1,106,32,0,32,1,65,15,113,16,1,11,146,1,0,32,1,32,2,106,33,2,3,64,32,1,65,4,106,32,2,75,69,4,64,32,0,32,1,40,2,0,65,189,220,202,149,124,108,106,65,17,119,65,175,214,211,190,2,108,33,0,32,1,65,4,106,33,1,12,1,11,11,3,64,32,1,32,2,79,69,4,64,32,0,32,1,45,0,0,65,177,207,217,178,1,108,106,65,11,119,65,177,243,221,241,121,108,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,65,15,118,115,65,247,148,175,175,120,108,34,0,65,13,118,32,0,115,65,189,220,202,149,124,108,34,0,65,16,118,32,0,115,11,63,0,32,0,65,8,106,32,1,65,168,136,141,161,2,106,54,2,0,32,0,65,12,106,32,1,65,137,235,208,208,7,107,54,2,0,32,0,65,16,106,32,1,54,2,0,32,0,65,20,106,32,1,65,207,140,162,142,6,106,54,2,0,11,195,4,1,6,127,32,1,32,2,106,33,6,32,0,65,24,106,33,4,32,0,65,40,106,40,2,0,33,3,32,0,32,0,40,2,0,32,2,106,54,2,0,32,0,65,4,106,34,5,32,5,40,2,0,32,2,65,16,79,32,0,40,2,0,65,16,79,114,114,54,2,0,32,2,32,3,106,65,16,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,40,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,16,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,40,2,0,32,4,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,12,106,34,3,32,3,40,2,0,32,4,65,4,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,16,106,34,3,32,3,40,2,0,32,4,65,8,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,20,106,34,3,32,3,40,2,0,32,4,65,12,106,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,54,2,0,32,0,65,40,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,32,6,65,16,107,77,4,64,32,6,65,16,107,33,8,32,0,65,8,106,40,2,0,33,2,32,0,65,12,106,40,2,0,33,3,32,0,65,16,106,40,2,0,33,5,32,0,65,20,106,40,2,0,33,7,3,64,32,2,32,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,2,32,3,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,3,32,5,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,5,32,7,32,1,65,4,106,34,1,40,2,0,65,247,148,175,175,120,108,106,65,13,119,65,177,243,221,241,121,108,33,7,32,8,32,1,65,4,106,34,1,79,13,0,11,32,0,65,8,106,32,2,54,2,0,32,0,65,12,106,32,3,54,2,0,32,0,65,16,106,32,5,54,2,0,32,0,65,20,106,32,7,54,2,0,11,32,1,32,6,73,4,64,32,4,32,1,32,6,32,1,107,34,1,252,10,0,0,32,0,65,40,106,32,1,54,2,0,11,11,97,1,1,127,32,0,65,16,106,40,2,0,33,1,32,0,65,4,106,40,2,0,4,127,32,1,65,12,119,32,0,65,20,106,40,2,0,65,18,119,106,32,0,65,12,106,40,2,0,65,7,119,106,32,0,65,8,106,40,2,0,65,1,119,106,5,32,1,65,177,207,217,178,1,106,11,32,0,40,2,0,106,32,0,65,24,106,32,0,65,40,106,40,2,0,16,1,11,255,3,2,3,126,1,127,32,0,32,1,106,33,6,32,1,65,32,79,4,126,32,6,65,32,107,33,6,32,2,66,214,235,130,238,234,253,137,245,224,0,124,33,3,32,2,66,177,169,172,193,173,184,212,166,61,125,33,4,32,2,66,249,234,208,208,231,201,161,228,225,0,124,33,5,3,64,32,3,32,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,3,32,4,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,4,32,2,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,2,32,5,32,0,65,8,106,34,0,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,5,32,6,32,0,65,8,106,34,0,79,13,0,11,32,2,66,12,137,32,5,66,18,137,124,32,4,66,7,137,124,32,3,66,1,137,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,2,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,2,66,197,207,217,178,241,229,186,234,39,124,11,32,1,173,124,32,0,32,1,65,31,113,16,6,11,134,2,0,32,1,32,2,106,33,2,3,64,32,2,32,1,65,8,106,79,4,64,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,32,0,133,66,27,137,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,33,0,32,1,65,8,106,33,1,12,1,11,11,32,1,65,4,106,32,2,77,4,64,32,0,32,1,53,2,0,66,135,149,175,175,152,182,222,155,158,127,126,133,66,23,137,66,207,214,211,190,210,199,171,217,66,126,66,249,243,221,241,153,246,153,171,22,124,33,0,32,1,65,4,106,33,1,11,3,64,32,1,32,2,73,4,64,32,0,32,1,49,0,0,66,197,207,217,178,241,229,186,234,39,126,133,66,11,137,66,135,149,175,175,152,182,222,155,158,127,126,33,0,32,1,65,1,106,33,1,12,1,11,11,32,0,32,0,66,33,136,133,66,207,214,211,190,210,199,171,217,66,126,34,0,32,0,66,29,136,133,66,249,243,221,241,153,246,153,171,22,126,34,0,32,0,66,32,136,133,11,77,0,32,0,65,8,106,32,1,66,214,235,130,238,234,253,137,245,224,0,124,55,3,0,32,0,65,16,106,32,1,66,177,169,172,193,173,184,212,166,61,125,55,3,0,32,0,65,24,106,32,1,55,3,0,32,0,65,32,106,32,1,66,249,234,208,208,231,201,161,228,225,0,124,55,3,0,11,244,4,2,3,127,4,126,32,1,32,2,106,33,5,32,0,65,40,106,33,4,32,0,65,200,0,106,40,2,0,33,3,32,0,32,0,41,3,0,32,2,173,124,55,3,0,32,2,32,3,106,65,32,73,4,64,32,3,32,4,106,32,1,32,2,252,10,0,0,32,0,65,200,0,106,32,2,32,3,106,54,2,0,15,11,32,3,4,64,32,3,32,4,106,32,1,65,32,32,3,107,34,2,252,10,0,0,32,0,65,8,106,34,3,32,3,41,3,0,32,4,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,16,106,34,3,32,3,41,3,0,32,4,65,8,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,24,106,34,3,32,3,41,3,0,32,4,65,16,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,32,106,34,3,32,3,41,3,0,32,4,65,24,106,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,55,3,0,32,0,65,200,0,106,65,0,54,2,0,32,1,32,2,106,33,1,11,32,1,65,32,106,32,5,77,4,64,32,5,65,32,107,33,2,32,0,65,8,106,41,3,0,33,6,32,0,65,16,106,41,3,0,33,7,32,0,65,24,106,41,3,0,33,8,32,0,65,32,106,41,3,0,33,9,3,64,32,6,32,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,6,32,7,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,7,32,8,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,8,32,9,32,1,65,8,106,34,1,41,3,0,66,207,214,211,190,210,199,171,217,66,126,124,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,33,9,32,2,32,1,65,8,106,34,1,79,13,0,11,32,0,65,8,106,32,6,55,3,0,32,0,65,16,106,32,7,55,3,0,32,0,65,24,106,32,8,55,3,0,32,0,65,32,106,32,9,55,3,0,11,32,1,32,5,73,4,64,32,4,32,1,32,5,32,1,107,34,1,252,10,0,0,32,0,65,200,0,106,32,1,54,2,0,11,11,188,2,1,5,126,32,0,65,24,106,41,3,0,33,1,32,0,41,3,0,34,2,66,32,90,4,126,32,0,65,8,106,41,3,0,34,3,66,1,137,32,0,65,16,106,41,3,0,34,4,66,7,137,124,32,1,66,12,137,32,0,65,32,106,41,3,0,34,5,66,18,137,124,124,32,3,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,4,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,1,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,32,5,66,207,214,211,190,210,199,171,217,66,126,66,31,137,66,135,149,175,175,152,182,222,155,158,127,126,133,66,135,149,175,175,152,182,222,155,158,127,126,66,157,163,181,234,131,177,141,138,250,0,125,5,32,1,66,197,207,217,178,241,229,186,234,39,124,11,32,2,124,32,0,65,40,106,32,2,66,31,131,167,16,6,11]);async function ns(e,t={}){let i=Cn();try{let n=ke(t,"fs"),r=ke(t,"chunkSize");if(nn(r)||(r=67108864),r=tn(r),r>2**30&&(r=67108864),!Sn(e,{fs:n}))return i.reject("fp is not a file"),i;let{create64:s}=await async function(){return function(e){const{exports:{mem:t,xxh32:i,xxh64:n,init32:r,update32:s,digest32:o,init64:a,update64:c,digest64:l}}=e;let u=new Uint8Array(t.buffer);function p(e,i){if(t.buffer.byteLength<e+i){const n=Math.ceil((e+i-t.buffer.byteLength)/65536);t.grow(n),u=new Uint8Array(t.buffer)}}function d(e,t,i,n,r,s){p(e);const o=new Uint8Array(e);return u.set(o),i(0,t),o.set(u.subarray(0,e)),{update(t){let i;return u.set(o),"string"==typeof t?(p(3*t.length,e),i=g.encodeInto(t,u.subarray(e)).written):(p(t.byteLength,e),u.set(t,e),i=t.byteLength),n(0,e,i),o.set(u.subarray(0,e)),this},digest:()=>(u.set(o),s(r(0)))}}function m(e){return e>>>0}const h=2n**64n-1n;function f(e){return e&h}const g=new TextEncoder;function w(e,t=0){return p(3*e.length,0),m(i(0,g.encodeInto(e,u).written,t))}function y(e,t=0n){return p(3*e.length,0),f(n(0,g.encodeInto(e,u).written,t))}return{h32:w,h32ToString:(e,t=0)=>w(e,t).toString(16).padStart(8,"0"),h32Raw:(e,t=0)=>(p(e.byteLength,0),u.set(e),m(i(0,e.byteLength,t))),create32:(e=0)=>d(48,e,r,s,o,m),h64:y,h64ToString:(e,t=0n)=>y(e,t).toString(16).padStart(16,"0"),h64Raw:(e,t=0n)=>(p(e.byteLength,0),u.set(e),f(n(0,e.byteLength,t))),create64:(e=0n)=>d(88,e,a,c,l,f)}}((await WebAssembly.instantiate(is)).instance)}(),o=s(),a=n.createReadStream(e,{highWaterMark:r}),c=e=>{i.reject(cr(e));try{a.destroy()}catch(e){}};a.on("data",e=>{try{o.update(e)}catch(e){c(e)}}),a.on("end",()=>{try{let e=o.digest().toString(16).padStart(16,"0");i.resolve(e)}catch(e){c(e)}}),a.on("error",e=>{i.reject(cr(e))})}catch(e){i.reject(cr(e))}return i}var rs={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsbApsZXQgaW5pdEZhaWwgPSBudWxsIC8v5Yid5aeL5YyW5aSx5pWXKOW3peW7oOWHveaVuOaLi+mMr+etiSnmmYLkuYt7IGVyciB9LCDku6Xnianku7bljIXoo53lm6DpjK/oqqTlgLzlj6/ngrrku7vmhI/lgLw7IOW+jOe6jOWRvOWPq+S7peWFtuWOn+Wni+mMr+iqpOWbnuaHiQpmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBtZERlZmF1bHQKICAgICAgICB9CiAgICAgICAgCgogIC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SA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5YyW5aSx5pWX5pmCaW5zdGFuY2XngrpudWxsLCDku6XliJ3lp4vljJbkuYvljp/lp4vpjK/oqqTlm57mh4ko5ZCM5bu656uL5aSx5pWX5LmL6JmV572uKSwg5LiN5b6X5bCNbnVsbOWPluWAvOiAjOW+l+iqpOWwjuS5i1R5cGVFcnJvcgogICAgICAgICAgICBpZiAoaW5pdEZhaWwpIHsKICAgICAgICAgICAgICAgIHRocm93IGluaXRGYWlsLmVycgogICAgICAgICAgICB9CgogICAgICAgICAgICAvL2Z1biwg6aCI54K65Ye95pW4LCDlkKbliYfku6XlhbflkI3oqIrmga/mi5LntZUo5LiN5b6X54K65bCNdW5kZWZpbmVk5Y+W5YC85oiW5ZG85Y+r5LmL6Kqk5bCOVHlwZUVycm9yKQogICAgICAgICAgICBsZXQgZnVuID0gKGluc3RhbmNlICE9PSBudWxsICYmIGluc3RhbmNlICE9PSB1bmRlZmluZWQpID8gaW5zdGFuY2VbZGF0YS5mdW5dIDogdW5kZWZpbmVkCiAgICAgICAgICAgIGlmICh0eXBlb2YgZnVuICE9PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2Z1bmN0aW9uWycgKyBkYXRhLmZ1biArICddIGlzIG5vdCBhIGZ1bmN0aW9uIGluIHdvcmtlcicpCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAoKICAgICAgICAgICAgLy9leGVjLCDku6Vhd2FpdOWPluWAvDog6Z2eYXN5bmPlh73mlbjlm57lgrPpnZ5wcm9taXNl5pmC5Lqm5Y+v5Lqk5LuYLCDkuI3lvpflm6Dlkbzlj6sudGhlbuiAjOWkseaVlzsg5LulUmVmbGVjdC5hcHBseeaMh+WumnRoaXMo6KaLY3RoaXMpCiAgICAgICAgICAgIG1zZyA9IGF3YWl0IFJlZmxlY3QuYXBwbHkoZnVuLCB1bmRlZmluZWQsIGlucHV0KQogICAgICAgICAgICBzdGF0ZSA9ICdzdWNjZXNzJwoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KCiAgICAgICAgLy9kZXNjLCDlm57mh4nlhaflrrnnhKHms5XntZDmp4vljJbopIfoo73mmYLlhZzlupXoqqrmmI7kuYvmj4/ov7AKICAgICAgICBsZXQgZGVzYyA9ICcnCiAgICAgICAgaWYgKHN0YXRlID09PSAnc3VjY2VzcycpIHsKICAgICAgICAgICAgZGVzYyA9ICdyZXR1cm4gdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGluaXRGYWlsKSB7CiAgICAgICAgICAgIGRlc2MgPSAnaW5pdCBlcnJvcicKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRlc2MgPSAncmVqZWN0ZWQgdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMsIGRlc2MpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ2UoZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciByZWN2OicsIGRhdGEpCgogICAgLy9kYXRhUmVjdgogICAgbGV0IGRhdGFSZWN2ID0gZGF0YQoKICAgIC8vcnVuCiAgICBydW4oZGF0YVJlY3YpCgp9CgoKICAgICAgICBwYXJlbnRQb3J0Lm9uKCdtZXNzYWdlJywgcmVjdk1lc3NhZ2UpCiAgICAgICAgcGFyZW50UG9ydC5vbignbWVzc2FnZWVycm9yJywgKGVycikgPT4gewogICAgICAgICAgICBzZW5kTWVzc2FnZSh7IG1vZGU6ICdtZXNzYW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9sbHVw5LulX19lc01vZHVsZeaomeekuumgkOioreiIh+WFt+WQjeS4puWtmOiAhSwg5Y+W5YW2ZGVmYXVsdDsg5ZCm5YmHbW9kdWxlLmV4cG9ydHPljbPpoJDoqK3ljK/lh7oo5Y+q5pyJ5YW35ZCN5Yyv5Ye66ICF54K65ZG95ZCN56m66ZaT54mp5Lu2KQogICAgcmV0dXJuIChtZFVzZXIuZXhwb3J0cyAmJiBtZFVzZXIuZXhwb3J0cy5fX2VzTW9kdWxlICYmICdkZWZhdWx0JyBpbiBtZFVzZXIuZXhwb3J0cykgPyBtZFVzZXIuZXhwb3J0cy5kZWZhdWx0IDogbWRVc2VyLmV4cG9ydHMKCn0pKCkpCgo=",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(rs);var ss=Zn(rs.exports);let os=new Set,as=new Map,cs=(t,i,n="")=>{let r=e.resolve(i,t);return{fp:r,fpm:`${r}.merging`,fpd:`${r}.done`,fpe:`${r}.error`,fpr:Zi(n)?`${r}.q${n}.ro`:""}},ls=e=>{let t=Lr(e);if(Tn(e))throw new Error(`can not remove ${e}: ${Rn(ke(t,"error"))}`)},us=async(e,i)=>{os.add(i.fp);try{let n=await function(e,i={}){try{return ns(e,{fs:t,...i})}catch(e){return Promise.reject(cr(e))}}(i.fp);if(n===e)return t.writeFileSync(i.fpd,"","utf8"),{state:"done"};let r=`merged file[${i.fp}] is incomplete: hash[${n}] != fileHash[${e}], merge was interrupted`;try{t.writeFileSync(i.fpe,r,"utf8")}catch(e){console.log(`can not write ${i.fpe}`,e)}return{state:"mismatch",reason:r}}catch(e){return{state:"error",reason:`verify merged file[${i.fp}] error: ${Rn(e)}`}}finally{os.delete(i.fp)}},ps=async(e,i,n)=>{let r=`${function(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYYMMDDHHmmss")}()}|${Zr(6)}|${e}`,s=cs(e,n);if(os.has(s.fp))return r;let o=Tn(s.fpe),a=Tn(s.fp);if(!o&&a){let t=await us(e,s);if("done"===t.state)return r;if("error"===t.state)throw new Error(t.reason)}return ls(s.fpd),ls(s.fpe),os.add(s.fp),setTimeout(()=>{ss(e,i,n,s.fpm).then(i=>{let n=ke(i,"hash","");if(n!==e)throw new Error(`merged file hash[${n}] != fileHash[${e}]`);t.renameSync(s.fpm,s.fp),t.writeFileSync(s.fpd,"","utf8")}).catch(e=>{console.log(e),Lr(s.fpm);let i=Rn(e);try{t.writeFileSync(s.fpe,i,"utf8")}catch(e){console.log(`can not write ${s.fpe}`,e)}}).finally(()=>{os.delete(s.fp)})},1),r},ds=async(e,i,n={})=>{let r=ke(n,"funConsume"),s=ke(n,"funLog");Mn(s)||(s=e=>{console.log(e)});let o=ts(e,"|"),a=ke(o,0,""),c=ke(o,1,""),l=ke(o,2,"");if(3!==Dt(o)||!Er(a)||!Er(c)||!Er(l)){let t=`invalid queueId[${Rn(e)}]`;return console.log(t),{state:"error",msg:"invalid queueId",reason:t,path:""}}let u=cs(l,i,`${a}${c}`);if(Tn(u.fpr)){let e=((e,i)=>{try{let n=br(new Uint8Array(t.readFileSync(e.fpr)),{returnWithStateAndMsg:!0});if("success"!==ke(n,"state"))return i(`stored result ${e.fpr} is corrupted, treat as not stored: ${ke(n,"msg","unknown error")}`),{ok:!1};let r=n.msg;return Ti(r)&&sr(r,"ro")?{ok:!0,ro:r.ro}:(i(`stored result ${e.fpr} has no own 'ro' key, treat as not stored`),{ok:!1})}catch(t){return i(`can not read stored result ${e.fpr}: ${Rn(t)}`),{ok:!1}}})(u,s);if(e.ok)return{state:"success",msg:e.ro,path:u.fp,from:"stored"}}if(Tn(u.fpe)){let e="";try{e=t.readFileSync(u.fpe,"utf8")}catch(e){}return{state:"error",msg:"merge slices failed",reason:e,path:u.fp}}if(os.has(u.fp))return{state:"merging",msg:"",path:u.fp};let p=Tn(u.fp),d=Tn(u.fpd);if(p&&!d){let e=await us(l,u);if("done"!==e.state)return{state:"error",msg:"merge slices failed",reason:e.reason,path:u.fp};d=!0}if(p&&d){if(!Mn(r))return{state:"success",msg:"",path:u.fp};let e=await((e,i,n)=>{let r=e.fpr,s=as.get(r);return s||(s=Promise.resolve().then(()=>i(e.fp)).then(i=>{i=void 0===i?null:i;try{let n=Mr({ro:i},{returnWithStateAndMsg:!0});if("success"!==ke(n,"state"))return i;t.writeFileSync(e.fpr,Buffer.from(n.msg));let r=br(n.msg,{returnWithStateAndMsg:!0});if("success"===ke(r,"state")&&Ti(r.msg)&&sr(r.msg,"ro"))return r.msg.ro}catch(t){n(`can not store consumed result to ${e.fpr}: ${Rn(t)}`)}return i}).finally(()=>{as.delete(r)}),as.set(r,s),s)})(u,r,s);return{state:"success",msg:e,path:u.fp,from:"consumed"}}return!p&&d?{state:"error",msg:"merged file already consumed",reason:`merged file[${u.fp}] no longer exists and no stored result for queueId[${e}]`,path:u.fp}:{state:"error",msg:"no merge task",reason:`no merge task for fileHash[${l}] (never pushed, or artifacts removed)`,path:u.fp}};var ms={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsb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6leWGjeWkseaVl+WNs+aUvuajhCwg5LiN5Y+v6YGe6L+0CiAgICAgICAgbGV0IG1zZyA9ICcnCiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgbXNnID0gZGVzYyArICcgY291bGQgbm90IGJlIGNsb25lZDogJyArIFN0cmluZygoZXJyICYmIGVyci5tZXNzYWdlKSB8fCBlcnIpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgICAgIGxldCBkYXRhU2FmZSA9IG51bGwKICAgICAgICBpZiAoZGF0YS5tb2RlID09PSAncmV0dXJuJykgewogICAgICAgICAgICBkYXRhU2FmZSA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5YyW5aSx5pWX5pmCaW5zdGFuY2XngrpudWxsLCDku6XliJ3lp4vljJbkuYvljp/lp4vpjK/oqqTlm57mh4ko5ZCM5bu656uL5aSx5pWX5LmL6JmV572uKSwg5LiN5b6X5bCNbnVsbOWPluWAvOiAjOW+l+iqpOWwjuS5i1R5cGVFcnJvcgogICAgICAgICAgICBpZiAoaW5pdEZhaWwpIHsKICAgICAgICAgICAgICAgIHRocm93IGluaXRGYWlsLmVycgogICAgICAgICAgICB9CgogICAgICAgICAgICAvL2Z1biwg6aCI54K65Ye95pW4LCDlkKbliYfku6XlhbflkI3oqIrmga/mi5LntZUo5LiN5b6X54K65bCNdW5kZWZpbmVk5Y+W5YC85oiW5ZG85Y+r5LmL6Kqk5bCOVHlwZUVycm9yKQogICAgICAgICAgICBsZXQgZnVuID0gKGluc3RhbmNlICE9PSBudWxsICYmIGluc3RhbmNlICE9PSB1bmRlZmluZWQpID8gaW5zdGFuY2VbZGF0YS5mdW5dIDogdW5kZWZpbmVkCiAgICAgICAgICAgIGlmICh0eXBlb2YgZnVuICE9PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ2Z1bmN0aW9uWycgKyBkYXRhLmZ1biArICddIGlzIG5vdCBhIGZ1bmN0aW9uIGluIHdvcmtlcicpCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAoKICAgICAgICAgICAgLy9leGVjLCDku6Vhd2FpdOWPluWAvDog6Z2eYXN5bmPlh73mlbjlm57lgrPpnZ5wcm9taXNl5pmC5Lqm5Y+v5Lqk5LuYLCDkuI3lvpflm6Dlkbzlj6sudGhlbuiAjOWkseaVlzsg5LulUmVmbGVjdC5hcHBseeaMh+WumnRoaXMo6KaLY3RoaXMpCiAgICAgICAgICAgIG1zZyA9IGF3YWl0IFJlZmxlY3QuYXBwbHkoZnVuLCB1bmRlZmluZWQsIGlucHV0KQogICAgICAgICAgICBzdGF0ZSA9ICdzdWNjZXNzJwoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKICAgICAgICAgICAgc3RhdGUgPSAnZXJyb3InCiAgICAgICAgICAgIG1zZyA9IGVycgogICAgICAgIH0KCiAgICAgICAgLy9kZXNjLCDlm57mh4nlhaflrrnnhKHms5XntZDmp4vljJbopIfoo73mmYLlhZzlupXoqqrmmI7kuYvmj4/ov7AKICAgICAgICBsZXQgZGVzYyA9ICcnCiAgICAgICAgaWYgKHN0YXRlID09PSAnc3VjY2VzcycpIHsKICAgICAgICAgICAgZGVzYyA9ICdyZXR1cm4gdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGluaXRGYWlsKSB7CiAgICAgICAgICAgIGRlc2MgPSAnaW5pdCBlcnJvcicKICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRlc2MgPSAncmVqZWN0ZWQgdmFsdWUgb2YgZnVuY3Rpb25bJyArIGRhdGEuZnVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMsIGRlc2MpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ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ZSk/MDppLmxlbmd0aCk/aVthLTFdOnZvaWQgMDtpZigham4ocikpcmV0dXJuIHZvaWQgY29uc29sZS5sb2coYHNraXAgZmlsZVske3QubmFtZX1dOiBjYW4gbm90IHBhcnNlIGNodW5rIGluZGV4YCk7cj1fbihyKSxzLnB1c2gocil9dmFyIGksYX0pKX1sZXQgbD1lZShzKT4wO3JldHVybntwYXRoOmksYkFsbEV4aXN0OmEsYkFsbFNpemU6YyxiQWxsSGFzaDpmLGJTbHM6bCxzbGtzOnN9fTsKCiAgICB9KS5jYWxsKG1kVXNlci5leHBvcnRzLCBtZFVzZXIsIG1kVXNlci5leHBvcnRzKQoKICAgIC8v6aCQ6Kit5Yyv5Ye6OiByb2xsdXDku6VfX2VzTW9kdWxl5qiZ56S66aCQ6Kit6IiH5YW35ZCN5Lim5a2Y6ICFLCDlj5blhbZkZWZhdWx0OyDlkKbliYdtb2R1bGUuZXhwb3J0c+WNs+mgkOioreWMr+WHuijlj6rmnInlhbflkI3ljK/lh7rogIXngrrlkb3lkI3nqbrplpPnianku7YpCiAgICByZXR1cm4gKG1kVXNlci5leHBvcnRzICYmIG1kVXNlci5leHBvcnRzLl9fZXNNb2R1bGUgJiYgJ2RlZmF1bHQnIGluIG1kVXNlci5leHBvcnRzKSA/IG1kVXNlci5leHBvcnRzLmRlZmF1bHQgOiBtZFVzZXIuZXhwb3J0cwoKfSkoKSkKCg==",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(ms);var hs=Zn(ms.exports),fs={exports:{}};!function(e){var t,i;e.exports=(t=o,i={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,m=u.length;for(l=0;l<m;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,n);break;case 4:u[l].fn.call(u[l].context,t,n,r);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a}({get exports(){return t},set exports(e){t=e}});var i=t;let n;return function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(r="J3VzZSBzdHJpY3QnCgoKCjsoZnVuY3Rpb24gKHBhcmVudFBvcnQsIG1kRGVmYXVsdCkgewoKbGV0IGluc3RhbmNlID0gbnVsbApsZXQgaW5pdEZhaWwgPSBudWxsIC8v5Yid5aeL5YyW5aSx5pWXKOW3peW7oOWHveaVuOaLi+mMr+etiSnmmYLkuYt7IGVyciB9LCDku6Xnianku7bljIXoo53lm6DpjK/oqqTlgLzlj6/ngrrku7vmhI/lgLw7IOW+jOe6jOWRvOWPq+S7peWFtuWOn+Wni+mMr+iqpOWbnuaHiQpmdW5jdGlvbiBpbml0KGlucHV0KXsKCiAgICAvL2luaXQKICAgIGxldCByCiAgICAKICAgICAgICByID0gewogICAgICAgICAgICBtYWluOiBtZERlZmF1bHQKICAgICAgICB9CiAgICAgICAgCgogICAgLy9vbgogICAgCgogICAgLy9zYXZlCiAgICBpbnN0YW5jZSA9IHIKCn0KCmZ1bmN0aW9uIHNlbmRNZXNzYWdlKGRhdGEsIGRlc2MpIHsKICAgIHRyeSB7CiAgICAgICAgcGFyZW50UG9ydC5wb3N0TWVzc2FnZShkYXRhKQogICAgfQogICAgY2F0Y2ggKGVycikgewogICAgICAgIC8vZGF0YeWQq+eEoeazlee1kOani+WMluikh+ijveS5i+WFp+WuuSjlh73mlbjjgIFTeW1ib2znrYkp5pmCcG9zdE1lc3NhZ2XlkIzmraXmi4tEYXRhQ2xvbmVFcnJvcjog5LiN6JmV55CG5YmH5ouL5pa85ZG85Y+r6Lev5b6R5aSWLCDmlrxub2RlanPmiJB3b3JrZXLmnKrmjZXmjYnpjK/oqqTogIzltKnmvbAo5oyB5LmF6IiH5bel5bug5a+m6auU5b6e5q2k5q275LqhKSwg5pa854CP6Ka95Zmo5oiQ5pyq6JmV55CGcmVqZWN0aW9u6ICM5ZG85Y+r5rC45LmF5oe4572uOwogICAgICAgIC8v5L6d6KiK5oGv6aGe5Z6L5pS56YCB5Y+v6KSH6KO95LmL5a2X5Liy6Kqq5piOKGRlc2PngrrlhaflrrnkuYvmj4/ov7ApLCDkvb/lkbzlj6vnq6/lvpfliLDlhbflkI3ljp/lm6DkuJR3b3JrZXLnuozlj6/mnI3li5k7IOWFnOW6leWGjeWkseaVl+WNs+aUvuajhCwg5LiN5Y+v6YGe6L+0CiAgICAgICAgbGV0IG1zZyA9ICcnCiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgbXNnID0gZGVzYyArICcgY291bGQgbm90IGJlIGNsb25lZDogJyArIFN0cmluZygoZXJyICYmIGVyci5tZXNzYWdlKSB8fCBlcnIpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgICAgIGxldCBkYXRhU2FmZSA9IG51bGwKICAgICAgICBpZiAoZGF0YS5tb2RlID09PSAncmV0dXJuJykgewogICAgICAgICAgICBkYXRhU2FmZSA9IHsKICAgICAgICAgICAgICAgIG1vZGU6ICdyZXR1cm4nLAogICAgICAgICAgICAgICAgaWQ6IGRhdGEuaWQsCiAgICAgICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICAgICAgc3RhdGU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoZGF0YS5tb2RlID09PSAnZW1pdCcpIHsKICAgICAgICAgICAgZGF0YVNhZmUgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2csCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIGRhdGFTYWZlID0gewogICAgICAgICAgICAgICAgbW9kZTogZGF0YS5tb2RlLCAvL21lc3NhZ2VlcnJvcuS5i+mAmuefpeS4jeWPr+eVpemBjiwg5ZCm5YmH5aSW5bGk5ZG85Y+r5Lit5LmLcGVuZGluZ+aHuOe9rgogICAgICAgICAgICAgICAgbXNnLAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHBhcmVudFBvcnQucG9zdE1lc3NhZ2UoZGF0YVNhZmUpCiAgICAgICAgfQogICAgICAgIGNhdGNoIChlKSB7fQogICAgfQp9Cgphc3luYyBmdW5jdGlvbiBydW4oZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciBydW4nLGRhdGEpCgogICAgLy9tb2RlCiAgICBsZXQgbW9kZSA9IGRhdGEubW9kZQoKICAgIC8vY2hlY2sKICAgIGlmKG1vZGUgIT09ICdpbml0JyAmJiBtb2RlICE9PSAnY2FsbCcpewogICAgICAgIHJldHVybgogICAgfQoKICAgIC8vaW5pdAogICAgaWYobW9kZSA9PT0gJ2luaXQnKXsKICAgICAgICAKICAgICAgICB0cnl7CgogICAgICAgICAgICAvL3R5cGUKICAgICAgICAgICAgbGV0IHR5cGUgPSBkYXRhLnR5cGUKCiAgICAgICAgICAgIC8vaW5wdXQKICAgICAgICAgICAgbGV0IGlucHV0ID0gZGF0YS5pbnB1dAogICAgCiAgICAgICAgICAgIC8vaW5zdGFuY2UKICAgICAgICAgICAgaWYodHlwZSA9PT0gJ2Z1bmN0aW9uJyl7CiAgICAgICAgICAgICAgICBpbml0KC4uLmlucHV0KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpewogICAgICAgICAgICAgICAgaW5zdGFuY2UgPSBtZERlZmF1bHQKICAgICAgICAgICAgfQoKICAgICAgICB9CiAgICAgICAgY2F0Y2goZXJyKXsKCiAgICAgICAgICAgIC8vaW5pdEZhaWwKICAgICAgICAgICAgaW5pdEZhaWwgPSB7IGVyciB9CgogICAgICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgICAgIGxldCByZXMgPSB7CiAgICAgICAgICAgICAgICBtb2RlOiAnZW1pdCcsCiAgICAgICAgICAgICAgICBldk5hbWU6ICdlcnJvcicsCiAgICAgICAgICAgICAgICBtc2c6IGVyciwKICAgICAgICAgICAgfQogICAgICAgICAgICBzZW5kTWVzc2FnZShyZXMsICdpbml0IGVycm9yJykKCiAgICAgICAgfQoKICAgIH0KCiAgICAvL2NoZWNrCiAgICBpZihtb2RlID09PSAnY2FsbCcpewogICAgICAgIGxldCBzdGF0ZSA9ICcnCiAgICAgICAgbGV0IG1zZyA9IG51bGwKCiAgICAgICAgdHJ5ewoKICAgICAgICAgICAgLy9jaGVjaywg5Yid5aeL5YyW5aSx5pWX5pmCaW5zdGFuY2XngrpudWxsLCDku6XliJ3lp4vljJbkuYvljp/lp4vpjK/oqqTlm57mh4ko5ZCM5bu656uL5aSx5pWX5LmL6JmV572uKSwg5LiN5b6X5bCNbnVsbOWPluWAvOiAjOW+l+iqpOWwjuS5i1R5cGVFcnJvcgogICAgICAgICAgICBpZiAoaW5pdEZhaWwpIHsKICAgICAgICAgICAgICAgIHRocm93IGluaXRGYWlsLmVycgogICAgICAgICAgICB9CgogICAgICAgICAgICAvL2Z1biwg6aCI54K65Ye95pW4LCDlkKbliYfku6XlhbflkI3oqIrmga/mi5LntZUo5LiN5b6X54K65bCNdW5kZWZpbmVk5Y+W5YC85oiW5ZG85Y+r5LmL6Kqk5bCOVHlwZUVycm9yKQogICAgICAgICAgICBsZXQgZnVuID0gKGluc3RhbmNlICE9PSBudWxsICYmIGluc3RhbmNlICE9PSB1bmRlZmluZWQpID8gaW5zdGFuY2VbZGF0YS5mdW5dIDogdW5kZWZpbmVkCiAgICAgICAgICAgIGlmICh0eXBlb2YgZnVuICE9PSAnZnVuY3Rpb24nKSB7CiA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nVuICsgJ10nCiAgICAgICAgfQoKICAgICAgICAvL3NlbmRNZXNzYWdlCiAgICAgICAgbGV0IHJlcyA9IHsKICAgICAgICAgICAgbW9kZTogJ3JldHVybicsCiAgICAgICAgICAgIGlkOiBkYXRhLmlkLAogICAgICAgICAgICBmdW46IGRhdGEuZnVuLAogICAgICAgICAgICBzdGF0ZSwKICAgICAgICAgICAgbXNnLAogICAgICAgIH0KICAgICAgICBzZW5kTWVzc2FnZShyZXMsIGRlc2MpCgogICAgfQoKfQoKZnVuY3Rpb24gcmVjdk1lc3NhZ2UoZGF0YSkgewogICAgLy8gY29uc29sZS5sb2coJ2lubmVyIHdvcmtlciByZWN2OicsIGRhdGEpCgogICAgLy9kYXRhUmVjdgogICAgbGV0IGRhdGFSZWN2ID0gZGF0YQoKICAgIC8vcnVuCiAgICBydW4oZGF0YVJlY3YpCgp9CgoKICAgICAgICBwYXJlbnRQb3J0Lm9uKCdtZXNzYWdlJywgcmVjdk1lc3NhZ2UpCiAgICAgICAgcGFyZW50UG9ydC5vbignbWVzc2FnZWVycm9yJywgKGVycikgPT4gewogICAgICAgICAgICBzZW5kTWVzc2FnZSh7IG1vZGU6ICdtZXNzYWdlZXJyb3InLCBtc2c6IGVyciB9LCAnbWVzc2FnZWVycm9yIG9mIHdvcmtlcicpCiAgICAgICAgfSkKICAgICAgICAKCnRyeXsKCiAgICAvL+WDheS7pXVuY2F1Z2h0RXhjZXB0aW9uTW9uaXRvcuiomOmMhHdvcmtlcuWFp+acquaNleaNiemMr+iqpCwg5LiN5Y+v6Ki75YaKdW5jYXVnaHRFeGNlcHRpb27oiId1bmhhbmRsZWRSZWplY3Rpb27nm6Pogb06CiAgICAvL+aWvHdvcmtlcuWFp+iou+WGiuipsuS6jOebo+iBveacg+mYu+atondvcmtlcuS+nemgkOioree1guatoiwg5aSW5bGk5pS25LiN5YiwZXJyb3IvZXhpdOiAjOS7pHBlbmRpbmfmsLjkuYXmh7jnva4sIOaureWxjXdvcmtlcuS4puS7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vcihsZXQgaT0wO2k8ci5sZW5ndGg7aSsrKXtsZXQgdT1yW2ldLGE9aHQodSwiaSIpO2lmKCFBZShhKSljb250aW51ZTtpZihhPU9lKGEpLCFjLmhhcyhhKXx8cy5oYXMoYSkpY29udGludWU7cy5hZGQoYSk7bGV0IGw9dC5yZXNvbHZlKG8sYCR7bn1fJHthfWApLHA9IiI7dHJ5e3A9YXdhaXQgRWUobmV3IEJsb2IoW2UucmVhZEZpbGVTeW5jKGwpXSkpfWNhdGNoKHQpe2NvbnRpbnVlfWh0KHUsImgiKT09PXAmJmYucHVzaChhKX1yZXR1cm57c2xrczpmfX07CgogICAgfSkuY2FsbChtZFVzZXIuZXhwb3J0cywgbWRVc2VyLCBtZFVzZXIuZXhwb3J0cykKCiAgICAvL+mgkOioreWMr+WHujogcm9sbHVw5LulX19lc01vZHVsZeaomeekuumgkOioreiIh+WFt+WQjeS4puWtmOiAhSwg5Y+W5YW2ZGVmYXVsdDsg5ZCm5YmHbW9kdWxlLmV4cG9ydHPljbPpoJDoqK3ljK/lh7oo5Y+q5pyJ5YW35ZCN5Yyv5Ye66ICF54K65ZG95ZCN56m66ZaT54mp5Lu2KQogICAgcmV0dXJuIChtZFVzZXIuZXhwb3J0cyAmJiBtZFVzZXIuZXhwb3J0cy5fX2VzTW9kdWxlICYmICdkZWZhdWx0JyBpbiBtZFVzZXIuZXhwb3J0cykgPyBtZFVzZXIuZXhwb3J0cy5kZWZhdWx0IDogbWRVc2VyLmV4cG9ydHMKCn0pKCkpCgo=",Buffer.from(r,"base64").toString("utf8"));var r;function s(){let n=new i,r=n.emit.bind(n),s={},o=!1,a="worker is dead",c=!1;function l(e){for(let t in s){let i=s[t];delete s[t],i.reject(e)}}function u(e){l(e),r("error",e)}function p(e){o||(o=!0,u(e))}let d=function(t){try{return new e.Worker(t,{eval:!0})}catch(e){a=e,p(e)}}(t);function m(){d?(c=!0,o||(o=!0,a="worker has been terminated"),d.terminate(),d=void 0,l("worker has been terminated")):u("worker has been terminated")}function h(e){return function(){let t=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}();if(o)return t.reject(a),t;let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=[],i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=i.length;for(let r=0;r<e;r++)t[r]=i[0|Math.random()*n];return t.join("")}(),n={mode:"call",id:i,fun:e,input:[...arguments]};try{d.postMessage(n)}catch(e){return t.reject(e),t}return s[i]=t,t}}d||o||(a="invalid worker",p(a)),d&&(d.on("message",function(e){let t=e,i=t&&t.mode;if("emit"===i||"return"===i||"messageerror"===i){if("emit"===i&&r(t.evName,t.msg),"return"===i){let e=s[t.id];e&&(delete s[t.id],"success"===t.state?e.resolve(t.msg):e.reject(t.msg))}"messageerror"===i&&u(t.msg)}}),d.on("error",p),d.on("exit",e=>{c||p("worker exit, code["+e+"]")}),d.on("messageerror",e=>{u(e)}),function(){let e={mode:"init",type:"function",input:[...arguments]};try{d.postMessage(e)}catch(e){throw m(),e}}([...arguments]));for(let e of["main"])n[e]=h(e);return n.terminate=m,n}n=async function(){let e=[...arguments],t=s();return await t.main(...e).finally(()=>{t.terminate()})}}(),n}(t)}({get exports(){return i},set exports(e){i=e}}),i)}(fs);var gs=Zn(fs.exports);function ws(e,t){try{return{ok:!0,value:t()}}catch(t){let i=Rn(t);return{ok:!1,stage:e,cause:Zi(i)?i:"unknown error"}}}function ys(e,t){try{return s.validateHeaderValue(e,t),!0}catch(e){return!1}}function Ms(e,t,i,n={}){let s=!0===ke(n,"forHead",!1);if(null==e)return{error:"invalid streamRead",reason:"streamRead is null or undefined"};let o=ws("identify streamRead",()=>e instanceof r.Readable?{isReadable:!0,objectMode:!0===e.readableObjectMode,done:!0===e.destroyed||!0===e.readableEnded}:{isReadable:!1});if(!o.ok)return{error:"invalid streamRead",reason:`${o.stage} failed: ${o.cause}`};if(o.value.isReadable){if(o.value.objectMode)return{error:"invalid streamRead",reason:"streamRead is in object mode"};if(o.value.done)return{error:"invalid streamRead",reason:"streamRead is already destroyed or ended (each download event must provide a new stream)"};if(s)return{source:e};let n=ws("setup pipeline",()=>{let n=0,s=!1,o=new r.Transform({transform(e,i,r){if(n+=e.length,n>t)return s=!0,void r(new Error(`streamRead sent more than fileSize[${t}] bytes`));r(null,e)},flush(e){if(n!==t)return s=!0,void e(new Error(`streamRead ended at ${n} bytes but fileSize is ${t}`));e()}});return r.pipeline(e,o,e=>{e&&s&&i(Rn(e))}),o});return n.ok?{source:n.value}:{error:"invalid streamRead",reason:`${n.stage} failed: ${n.cause}`}}let a=ws("materialize streamRead",()=>{if(Buffer.isBuffer(e))return{buf:e};if(e instanceof Uint8Array)return{buf:Buffer.from(e)};if(ji(e))return{buf:Buffer.from(e,"utf8")};if("number"==typeof e||Bi(e)||"object"==typeof e&&!1===function(e){try{return Mn(e.pipe)}catch(e){return null}}(e)){let t=null;try{t=JSON.stringify(e)}catch(e){return{unserializable:Rn(e)}}return"string"!=typeof t?{unserializable:""}:{buf:Buffer.from(t,"utf8")}}return{unsupported:!0}});if(!a.ok)return{error:"invalid streamRead",reason:`${a.stage} failed: ${a.cause}`};if(sr(a.value,"unserializable")){let e=a.value.unserializable;return{error:"invalid streamRead",reason:Zi(e)?`streamRead can not be serialized: ${e}`:"streamRead can not be serialized"}}if(!0===a.value.unsupported)return{error:"invalid streamRead",reason:"streamRead must be a readable stream, buffer, string, number, boolean or plain object"};let c=a.value.buf;return c.length!==t?{error:"fileSize mismatch",reason:`streamRead has ${c.length} bytes but fileSize is ${t}`}:{source:c}}let Ds=e=>"function"==typeof e.toWellFormed?e.toWellFormed():e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"�");function xs(e,t){let i=ws(`check field[${e}]`,()=>{if("fileSize"===e)return function(e){return Dn(e,{useLimitSafe:!0})}(t)?{ok:!0,value:tn(t)}:{ok:!1};if("filename"===e||"fileType"===e){if(!Zi(t))return{ok:!1};let i=Qn(t);return Zi(i)?"fileType"===e?ys("Content-Type",i)?{ok:!0,value:i}:{ok:!1}:{ok:!0,value:Ds(i)}:{ok:!1}}throw new Error(`unknown field[${e}]`)});return i.ok?{ok:i.value.ok,value:i.value.value,cause:""}:{ok:!1,value:void 0,cause:i.cause}}function Is(e){try{e&&Mn(e.pipe)&&Mn(e.destroy)&&e.destroy()}catch(e){}}function bs(e){let t=typeof e;return void 0===e||"function"===t||"symbol"===t?null:e}function Cs(e,t,i={}){let n=new r.Readable;n._read=()=>{},n.push(t),n.push(null);let s=ke(i,"returnType",""),o=ke(i,"returnMsg",""),a=e.response(n).header("Cache-Control","no-cache, no-store, must-revalidate").header("Content-Type","application/octet-stream").header("Content-Length",n.readableLength);return Zi(s)&&a.header("Return-Type",s),Zi(o)&&ys("Return-Msg",o)&&a.header("Return-Msg",o),a}function vs(e,t){return 0===e.listenerCount(t)?`no listener for event[${t}]`:""}function Ls(s={}){let o={useLimitSafe:!0},a=!!ke(s,"serverHapi"),c=[],l=ke(s,"port");(!nn(l,o)||tn(l)>65535)&&(l=8080),l=tn(l);let u=ke(s,"useInert");null==u?u=!0:Bi(u)||(a||c.push("invalid useInert: must be a boolean, static files are not served"),u=!1);let p=ke(s,"pathStaticFiles");null==p?p="dist":Zi(p)||(u&&!a&&c.push("invalid pathStaticFiles: must be a non-empty string, static files are not served"),u=!1,p="dist");let d=ke(s,"pathUploadTemp");Zi(d)||(d="./uploadTemp");let m="";if(!Nn(d)){let e=vr(d);sr(e,"error")&&(m=Rn(e.error))}let h=ke(s,"apiName");Zi(h)||(h="api");let f=ke(s,"tokenType");Zi(f)||(f="Bearer");let g=ke(s,"sizeSlice");nn(g,o)||(g=1048576),g=tn(g);let w=ke(s,"sizeMsg");nn(w,o)||(w=104857600),w=tn(w);let y=ke(s,"verifyConn");if(null==y)y=()=>!0;else{let e=!1;try{e=Mn(y)}catch(e){}e||(c.push("invalid verifyConn: must be a function (sync or async), all API requests will be denied"),y=()=>!1)}let M="invalid corsOrigins: must be an array of origin strings ('*' must be the only element if present), or false to disable; CORS is disabled",D=ke(s,"corsOrigins"),x=null!=D;x?a?c.push("corsOrigins has no effect with serverHapi: the cross-origin policy is decided by the external server"):!1===D||""===D?D=null:Zi(D)?D=[D]:rn(D)?(D=D.filter(e=>""!==e),0===D.length&&(D=null)):(c.push(M),D=null):D=["*"];let I=ke(s,"delayForSlice","");(!Dn(I,o)||tn(I)>2147483647)&&(I=100),I=tn(I);let b=null;if(a)b=s.serverHapi;else{let e=e=>{let t=!1;return null!==e&&(t={origin:e,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]}),{port:l,routes:{timeout:{server:!1,socket:!1},cors:t}}};try{b=i.server(e(D))}catch(t){if(!x||null===D)throw t;console.log("invalid corsOrigins",t),c.push(M),D=null,b=i.server(e(D))}}let C=Fn(),v={tag:"w-converhp"},L=(e,...t)=>Gn(C,e,t,{...v,funSettle:()=>{let i=t[t.length-1];vn(i)&&i.reject(`listener of event[${e}] error`)},funEmit:A}),E=(e,...t)=>Wn(C,e,t,{...v,funEmit:A});function A(e,...t){if("error"===e&&ki(t[0])&&"listener"===t[0].fun){let e=ke(t[0],"name",""),i=ke(t[0],"msg");return console.log(`listener of event[${e}] error`,i),C.emit("error",`listener of event[${e}] error: ${Rn(i)}`)}return C.emit(e,...t)}Zi(m)&&E("error",`create pathUploadTemp[${d}] error: ${m}`);for(let e of c)E("error",e);let N=(e,t,i)=>{let n=Cn(),r=Cn();return r.then(t=>{void 0===t&&(t=null);let r=typeof t;if("function"===r||"symbol"===r)return n.reject("output can not be serialized"),void L("error",`event[${e}] output can not be serialized: output is a ${r}`);n.resolve(Mn(i)?i(t):t)}).catch(e=>{n.reject(e)}),function(e,t,i,n,r,s){let o=vs(e,i);Zi(o)?(r.reject(o),s(o)):t(i,...n,r)}(C,L,e,t,r,e=>{L("error",e)}),n};async function S(e){return N("upload",[e])}async function T(e){return N("download",[e])}let k=`${Qn(f)} `,j=(e,t)=>{let i=ke(e,"headers");i=ki(i)?i:"";let n=ke(e,"query");n=ki(n)?n:"";let r="",s="";return"query"===t.authFrom?(s=ke(n,"token",""),s=Zi(s)?s:"",Zi(s)&&(r=`${f} ${s}`)):(r=ke(i,"authorization",""),r=Zi(r)?r:"",s=r.startsWith(k)?r.slice(k.length):""),{headers:i,query:n,authorization:r,token:s}},Z=(e,t)=>{let i=(i,n,r)=>function(e,t,i={}){Zi(t)||(console.log("msg",t),console.log("msg is not an effective string, set msg=''"),t="");let n=ke(i,"retryable",!0),r={error:t};!1===n&&(r.retryable=!1);let s=Cs(e,Mr(r),{returnType:"error",returnMsg:t});return!1===n&&s.header("Return-Retryable","false"),s}(e,n,r).code(t.statusOf[i]);return{permission:()=>i("permission","permission denied"),param:e=>i("param",e,{retryable:!1}),app:e=>i("app",e),output:e=>i("output",e),packet:e=>i("packet",e),internal:e=>i("internal",e)}},z=async(e,t,i,n)=>!0!==await async function(e){let t=!1;try{t=y(e),vn(t)&&(t=await t)}catch(i){t=!1,console.log(`verifyConn error for apiType[${ke(e,"apiType","")}]`,i),L("error",`verifyConn error for apiType[${ke(e,"apiType","")}]: ${Rn(i)}`)}return!0===t}({apiType:i.apiType,authorization:t.authorization,query:t.query,headers:t.headers,req:e})?n.permission():(L("handler",{api:i.api,headers:t.headers,query:t.query}),null),Y=(e,t)=>{let i=vs(C,e.event);if(!Zi(i))return null;let n=t.app(i);return L("error",i),n},X=(e,t,i,n)=>{let r=function(e,t){let i={};for(let n of t){let t=ws(`read field[${n}]`,()=>ke(e,n));if(!t.ok)return{ok:!1,field:n,cause:t.cause,fields:i};i[n]=t.value}return{ok:!0,fields:i}}(e,i.fields.map(e=>e.name));if(!r.ok)return Is(ke(r.fields,"streamRead")),L("error",`download fileId[${t}] output error: can not read field[${r.field}]: ${r.cause}`),{ok:!1,res:n.output("invalid streamRead")};let s={streamRead:r.fields.streamRead};for(let e of i.fields){if("streamRead"===e.name)continue;let i=xs(e.name,r.fields[e.name]);if(i.ok){s[e.name]=i.value;continue}if(!0===e.optional&&!Zi(i.cause)){s[e.name]="";continue}Is(s.streamRead);let o="fileSize"===e.name?`[${Rn(r.fields.fileSize)}]`:"";return L("error",`download fileId[${t}] output error: invalid ${e.name}${o}${Zi(i.cause)?`: ${i.cause}`:""}`),{ok:!1,res:n.output(`invalid ${e.name}`)}}return{ok:!0,v:s}},F=async(e,t,i,n)=>{let r={},s="";await i.then(e=>{r.success=e,s="success"}).catch(e=>{r.error=e,s="error"});let o=function(e,t){let i={};for(let t of Object.keys(e))i[t]=bs(e[t]);let n=Mr(i,{returnWithStateAndMsg:!0});return"success"!==ke(n,"state")?(t(ke(n,"msg","unknown error")),null):n.msg}(r,e=>{L("error",`${n} output can not be serialized: ${e}`)});return null===o?t.internal("output can not be serialized"):Cs(e,o,{returnType:s,returnMsg:"need to parse"})},G=e=>(t,i,n)=>{if(413===ke(n,"output.statusCode"))throw n;return L("error",`invalid request packet for ${e.api}: ${Rn(n)}`),Z(i,e).packet("invalid request packet").takeover()},O={path:`/${h}/main`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.main,n=Z(t,i),s=j(e,i),o=await z(e,s,i,n);if(o)return o;let a=null;try{a=await(()=>{let t=Cn(),i=[],n=0,s=!1,o=new r.Writable({write(e,t,r){if(n+=e.length,n>w)return i=[],s=!0,void r();i.push(e),r()}});return o.on("finish",()=>{}),e.payload.pipe(o),e.payload.on("end",()=>{if(s)return void t.reject("payload too large");let e=Buffer.concat(i);i=[],t.resolve(e)}),e.payload.on("close",()=>{}),e.payload.on("error",e=>{console.log("apiMain req.payload err",e),L("error",`receive payload error: ${Rn(e)}`),t.reject(`receive payload error: ${Rn(e)}`)}),e.payload.destroyed&&(L("error","receive payload error: closed before receive"),t.reject("receive payload error: closed before receive")),t})()}catch(e){if("payload too large"===e)return t.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${w}`}).code(413);throw e}let c=br(new Uint8Array(a),{returnWithStateAndMsg:!0});if("success"!==ke(c,"state")||!ki(c.msg)){let e=Rn(ke(c,"msg",""));return L("error",`invalid request packet for apiMain: ${Zi(e)?e:"not an effective object"}`),n.packet("invalid request packet")}let l=c.msg;return F(t,n,async function(e){return N("execute",[ke(e,"func",""),ke(e,"input",null)],t=>(e.output=t,delete e.input,e))}(l),`execute func[${Rn(ke(l,"func",""))}]`)}},W={path:`/${h}/ulctr`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:G(Nr.ulctr)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.ulctr,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.mode","");if("check-total-hash"!==o&&"check-slices-hash"!==o&&"merge-slices-push"!==o&&"merge-slices-get"!==o)return n.param(`invalid mode[${Rn(o)}] in payload`);let a=ke(e,"payload.fileHash","");if(!Er(a))return n.param("invalid fileHash in payload");let c=ke(e,"payload.chunkTotal","");if("merge-slices-push"===o){if(!nn(c))return n.param("invalid chunkTotal in payload");c=tn(c)}if("merge-slices-get"!==o){let e=Y(i,n);if(e)return e}let l=ke(e,"payload.filename",""),u=function(e,t="unknown"){if(!Zi(e))return t;let i=e.replace(/\\/g,"/").split("/").filter(e=>""!==e&&"."!==e&&".."!==e).pop()||"";return i=i.replace(/[\x00-\x1f\x7f<>:"|?*]/g,"_"),i=i.replace(/[. ]+$/g,""),/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i.test(i)&&(i=`_${i}`),""===i?t:i}(l,""),p=e=>ki(e)&&sr(e,"error")?`${o}: ${Qn(e.error)}`:"",m=async(e,t)=>{try{return await t()}catch(t){return L("error",`upload-controller mode[${o}] ${e} error: ${Rn(t)}`),Promise.reject(`${o} failed`)}};return F(t,n,(async()=>{let t=null;if("check-total-hash"===o){let i=ke(e,"payload.fileSize","");t=await m("check total hash",()=>hs(i,g,a,d));let n=p(t);if(Zi(n))return Promise.reject(n);if(t.bAllHash){let e={from:"check-total-hash",filename:l,filenameSafe:u,path:t.path},i=await S(e);t={...t,msg:i}}delete t.path,t.sizeSlice=g}else if("check-slices-hash"===o){let i=ke(e,"payload.fileSliceHashs",[]);t=await m("check slices hash",()=>gs(i,a,d));let n=p(t);if(Zi(n))return Promise.reject(n)}else if("merge-slices-push"===o){t={queueId:await m("push merge task",()=>ps(a,c,d))}}else if("merge-slices-get"===o){let i=ke(e,"payload.queueId",""),n=await ds(i,d,{funConsume:async e=>await S({from:"merge-slices-get",filename:l,filenameSafe:u,path:e}),funLog:e=>{L("error",e)}});t={state:n.state,msg:n.msg,queueId:i,filename:l},"error"===n.state&&Zi(n.reason)&&L("error",`${n.msg} for fileHash[${a}]: ${n.reason}`)}return t})(),`upload-controller mode[${o}]`)}},P={path:`/${h}/slc`,method:"POST",options:{payload:{maxBytes:g,maxParts:1e9,timeout:!1,output:"stream",parse:!1},timeout:{server:!1,socket:!1}},handler:async function(i,n){let r=Nr.slc,s=Z(n,r),o=j(i,r),a=await z(i,o,r,s);if(a)return a;let c=ke(o.headers,"chunk-index",""),l=ke(o.headers,"chunk-total",""),u=ke(o.headers,"package-id","");if(!Dn(c))return s.param("invalid chunkIndex in headers");if(c=tn(c),!Dn(l))return s.param("invalid chunkTotal in headers");if(l=tn(l),!Er(u))return s.param("invalid packageId in headers");let p=Y(r,s);if(p)return p;let m=e.resolve(d,`${u}_${c}`),h=t.createWriteStream(m),f=()=>{let e=Cn(),t=0,n=!1,r=!1,s=!1,o=!1;h.on("error",t=>{r||n||s||(r=!0,i.payload.unpipe(h),i.payload.resume(),console.log(`apiUploadSlice streamWrite chunk[${c+1}/${l}] of packageId[${u}] err`,t),L("error",`write chunk[${c+1}/${l}] of packageId[${u}] error: ${Rn(t)}`),e.reject(`write chunk[${c+1}/${l}] of packageId[${u}] error`))}),h.on("close",()=>{n||r||s?Lr(m):o&&!0===h.writableFinished&&setTimeout(()=>{e.resolve(`chunk[${c+1}/${l}] of packageId[${u}] done`)},I)}),i.payload.on("data",e=>{n||(t+=e.length,t>g&&(n=!0,i.payload.unpipe(h),i.payload.resume(),h.destroy()))}),i.payload.pipe(h),i.payload.on("end",()=>{o=!0,r||n&&e.reject("payload too large")});let a=t=>{s||o||r||(s=!0,h.destroy(),L("error",`receive chunk[${c+1}/${l}] of packageId[${u}] error: ${t}`),e.reject(`receive chunk[${c+1}/${l}] of packageId[${u}] error: ${t}`))};return i.payload.on("error",e=>{console.log(`apiUploadSlice req.payload chunk[${c+1}/${l}] of packageId[${u}] err`,e),a(Rn(e))}),i.payload.on("close",()=>{a("closed before end")}),i.payload.destroyed&&a("closed before receive"),e},w={},y="",M="";try{let e=await f();w.success=e,y="success",M="need to parse"}catch(e){if("payload too large"===e)return n.response({statusCode:413,error:"Request Entity Too Large",message:`Payload content length greater than maximum allowed: ${g}`}).code(413);w.error=e,y="error",M="need to parse"}return Cs(n,Mr(w),{returnType:y,returnMsg:M})}},K={path:`/${h}/dwgfn`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:G(Nr.dwgfn)},timeout:{server:!1,socket:!1}},handler:async function(e,t){let i=Nr.dwgfn,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.fileId","");if(!Zi(o))return n.param("invalid fileId in payload");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);return l.ok?(Is(l.v.streamRead),F(t,n,Promise.resolve({filename:l.v.filename}),`download fileId[${o}]`)):l.res}},H={path:`/${h}/dwgf`,method:"GET",options:{timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Nr.dwgf,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(r.query,"fileId","");if(o=Zi(o)?o:"",!Zi(o))return n.param("invalid fileId in query");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=l.v.fileSize,d=l.v.fileType,m=l.v.filename,h=Ms(u,p,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===Qn(ke(e,"method","")).toLowerCase()});if(h.error)return Is(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error);let f=t.response(h.source).type(d).header("Content-Encoding","identity").header("Content-Length",p).header("Content-Disposition",Zi(m)?`attachment; filename*=UTF-8''${function(e){let t=Array.from(Qn(e)),i="";for(let e of t){let t="";try{t=encodeURIComponent(e)}catch(e){t="%EF%BF%BD"}i+=t}return i.replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}(m)}`:"attachment");return f}},U={path:`/${h}/dw`,method:"POST",options:{payload:{maxBytes:w,maxParts:1e9,timeout:!1,parse:!0,failAction:G(Nr.dw)},timeout:{server:!1,socket:!1},response:{emptyStatusCode:200}},handler:async function(e,t){let i=Nr.dw,n=Z(t,i),r=j(e,i),s=await z(e,r,i,n);if(s)return s;let o=ke(e,"payload.fileId","");if(!Zi(o))return n.param("invalid fileId in payload");let a={fileId:o,token:r.token},c={};if(await T(a).then(e=>{c.success=e}).catch(e=>{c.error=e}),sr(c,"error"))return n.app("can not get file from fileId");let l=X(ke(c,"success"),o,i,n);if(!l.ok)return l.res;let u=l.v.streamRead,p=function(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:"";if(!Zi(e))return n("invalid str");let r="";try{let t=ir.parse(e);r=rr.stringify(t)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}(l.v.filename),d=l.v.fileSize,m=l.v.fileType,h=Ms(u,d,e=>{L("error",`download fileId[${o}] stream error: ${e}`)},{forHead:"head"===Qn(ke(e,"method","")).toLowerCase()});return h.error?(Is(u),L("error",`download fileId[${o}] output error: ${h.reason}`),n.output(h.error)):t.response(h.source).type(m).header("Content-Encoding","identity").header("Content-Disposition",`attachment; filename="${p}"`).header("Content-Length",d)}};let B=null;if(a)try{b.route([O,W,P,K,H,U])}catch(e){console.log("register routes error",e),E("error",`register routes error: ${Rn(e)}`)}else B=async function(){u&&await b.register(n);let e=[];if(u){let t={method:"GET",path:"/{file*}",handler:{directory:{path:`${p}/`}}};e=[...e,t]}e=[...e,O,W,P,K,H,U],b.route(e),await b.start(),console.log(`Server running at: ${b.info.uri}`)}().catch(e=>{console.log("start server error",e),E("error",`start server error: ${Rn(e)}`)});return C.stop=async()=>{try{vn(B)&&await B,await b.stop()}catch(e){console.log("stop server error",e),L("error",`stop server error: ${Rn(e)}`)}},C}function Es(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYY-MM-DDTHH:mm:ssZ")}var As=function(){return j.Date.now()},Ns=Math.max,Ss=Math.min;function Ts(e,t,i){var n,r,s,o,a,c,l=0,u=!1,p=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var i=n,s=r;return n=r=void 0,l=t,o=e.apply(s,i)}function h(e){var i=e-c;return void 0===c||i>=t||i<0||p&&e-l>=s}function f(){var e=As();if(h(e))return g(e);a=setTimeout(f,function(e){var i=t-(e-c);return p?Ss(i,s-(e-l)):i}(e))}function g(e){return a=void 0,d&&n?m(e):(n=r=void 0,o)}function w(){var e=As(),i=h(e);if(n=arguments,r=this,c=e,i){if(void 0===a)return function(e){return l=e,a=setTimeout(f,t),u?m(e):o}(c);if(p)return clearTimeout(a),a=setTimeout(f,t),m(c)}return void 0===a&&(a=setTimeout(f,t)),o}return t=Pi(t)||0,V(i)&&(u=!!i.leading,s=(p="maxWait"in i)?Ns(Pi(i.maxWait)||0,t):s,d="trailing"in i?!!i.trailing:d),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=r=a=void 0},w.flush=function(){return void 0===a?o:g(As())},w}var ks=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),js=ks;function Zs(e,t,i){"__proto__"==t&&js?js(e,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[t]=i}function zs(e,t,i){(void 0!==i&&!de(e[t],i)||void 0===i&&!(t in e))&&Zs(e,t,i)}var Ys="object"==typeof exports&&exports&&!exports.nodeType&&exports,Xs=Ys&&"object"==typeof module&&module&&!module.nodeType&&module,Fs=Xs&&Xs.exports===Ys?j.Buffer:void 0,Gs=Fs?Fs.allocUnsafe:void 0;function Os(e,t){if(t)return e.slice();var i=e.length,n=Gs?Gs(i):new e.constructor(i);return e.copy(n),n}function Ws(e){var t=new e.constructor(e.byteLength);return new ii(t).set(new ii(e)),t}function Ps(e,t){var i=t?Ws(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Ks(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i<n;)t[i]=e[i];return t}var Hs=Object.create,Us=function(){function e(){}return function(t){if(!V(t))return{};if(Hs)return Hs(t);e.prototype=t;var i=new e;return e.prototype=void 0,i}}();function Bs(e){return"function"!=typeof e.constructor||Ze(e)?{}:Us(pn(e))}function Vs(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _s=Object.prototype.hasOwnProperty;function Rs(e,t,i){var n=e[t];_s.call(e,t)&&de(n,i)&&(void 0!==i||t in e)||Zs(e,t,i)}function Qs(e,t,i,n){var r=!i;i||(i={});for(var s=-1,o=t.length;++s<o;){var a=t[s],c=n?n(i[a],e[a],a,i,e):void 0;void 0===c&&(c=e[a]),r?Zs(i,a,c):Rs(i,a,c)}return i}var Js=Object.prototype.hasOwnProperty;function $s(e){if(!V(e))return function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t}(e);var t=Ze(e),i=[];for(var n in e)("constructor"!=n||!t&&Js.call(e,n))&&i.push(n);return i}function qs(e){return it(e)?Ut(e,!0):$s(e)}function eo(e,t,i,n,r,s,o){var a=Vs(e,i),c=Vs(t,i),l=o.get(c);if(l)zs(e,i,l);else{var u,p=s?s(a,c,i+"",e,t,o):void 0,d=void 0===p;if(d){var m=S(c),h=!m&&jt(c),f=!m&&!h&&Kt(c);p=c,m||h||f?S(a)?p=a:P(u=a)&&it(u)?p=Ks(a):h?(d=!1,p=Os(c,!0)):f?(d=!1,p=Ps(c,!0)):p=[]:wn(c)||Nt(c)?(p=a,Nt(a)?p=function(e){return Qs(e,qs(e))}(a):V(a)&&!_(a)||(p=Bs(c))):d=!1}d&&(o.set(c,p),r(p,c,n,s,o),o.delete(c)),zs(e,i,p)}}function to(e,t,i,n,r){e!==t&&bt(t,function(s,o){if(r||(r=new Jt),V(s))eo(e,t,o,i,to,n,r);else{var a=n?n(Vs(e,o),s,o+"",e,t,r):void 0;void 0===a&&(a=s),zs(e,o,a)}},qs)}var io=Math.max;var no=js?function(e,t){return js(e,"toString",{configurable:!0,enumerable:!1,value:(i=t,function(){return i}),writable:!0});var i}:Ei,ro=no,so=Date.now;var oo=function(e){var t=0,i=0;return function(){var n=so(),r=16-(n-i);if(i=n,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ro),ao=oo;function co(e,t){return ao(function(e,t,i){return t=io(void 0===t?e.length-1:t,0),function(){for(var n=arguments,r=-1,s=io(n.length-t,0),o=Array(s);++r<s;)o[r]=n[t+r];r=-1;for(var a=Array(t+1);++r<t;)a[r]=n[r];return a[t]=i(o),function(e,t,i){switch(i.length){case 0:return e.call(t);case 1:return e.call(t,i[0]);case 2:return e.call(t,i[0],i[1]);case 3:return e.call(t,i[0],i[1],i[2])}return e.apply(t,i)}(e,this,a)}}(e,t,Ei),e+"")}var lo,uo=(lo=function(e,t,i){to(e,t,i)},co(function(e,t){var i=-1,n=t.length,r=n>1?t[n-1]:void 0,s=n>2?t[2]:void 0;for(r=lo.length>3&&"function"==typeof r?(n--,r):void 0,s&&Si(t[0],t[1],s)&&(r=n<3?void 0:r,n=1),e=Object(e);++i<n;){var o=t[i];o&&lo(e,o,i,r)}return e}));function po(e,t={}){let i=ke(t,"returnWithStateAndMsg",null);Bi(i)||(i=!1);let n=e=>i?{state:"error",msg:e}:{};if(!Zi(e))return n("invalid v");let r={};try{r=JSON.parse(e)}catch(e){return n(e.toString())}return i?{state:"success",msg:r}:r}let mo="w-sync-webdata";function ho(e,i={}){let n={},r=!1,s=!1,o=null;if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Fn()),!sr(e,"emit"))throw new Error("instWConverServer is not an EventEmitter");let a=ke(i,"fpTableTags","");Zi(a)||(a="./tableTags.json");let c=ke(i,"genTag");Mn(c)||(c=()=>Es()+"|"+Zr(6));let{emit:l,emitNow:u,clear:p}=function(e,t){let i=t=>Mn(e.listenerCount)?e.listenerCount(t):1,n={emit:(t,...i)=>e.emit(t,...i),listenerCount:i},r=(t,...n)=>{if("error"!==t)return e.emit(t,...n);let r=n[0];return Ti(r)&&"listener"===r.fun&&(r={msg:`listener of event[${r.name}] error`,err:r.msg}),0===i("error")?(console.error(`[${mo}]`,r),!1):e.emit("error",r)},s=new Set,o=(e,t,i)=>{let r=null,o=i.funEmit;r=Wn(n,e,t,{...i,tag:mo,funEmit:(e,...t)=>(s.delete(r),o(e,...t))}),s.add(r)};return{emit:(e,...i)=>{t()||o(e,i,{funEmit:(e,...i)=>!t()&&r(e,...i)})},emitPm:(n,s,a={})=>{let c=s.pm;if(t())return;let l=!1,u=!1,p=c.resolve,d=c.reject;c.resolve=e=>{l=!0,p(e)},c.reject=e=>{l=!0,d(e)},o(n,[s],{funSettle:e=>{l||(l=!0,u=!0,d(e))},funEmit:(s,...o)=>s!==n?!!u||!t()&&r(s,...o):!t()&&(!Mn(a.beforeDispatch)||!1!==a.beforeDispatch())&&(0===i(s)?(l=!0,u=!0,d(new Error(`no listener for event[${s}]`)),!1):e.emit(s,...o))})},emitNow:(e,...t)=>Gn(n,e,t,{tag:mo,funEmit:r}),clear:()=>{s.forEach(e=>{clearTimeout(e)}),s.clear()}}}(e,()=>r);function d(){let e={};try{if(t.existsSync(a)){let i=po(t.readFileSync(a,"utf8"));ki(i)&&(e=i)}}catch(e){l("error",{msg:"readTableTags catch",err:e})}return e}let m=()=>{let e=function(e,t=!1,i={}){let n=ke(i,"returnWithStateAndMsg",null);Bi(n)||(n=!1);let r=e=>n?{state:"error",msg:e}:"";if(sn(e))return r("invalid v");let s="";try{s=t?JSON.stringify(e,null,2):JSON.stringify(e)}catch(e){return r(cr(e))}return n?{state:"success",msg:s}:s}(n,!1,{returnWithStateAndMsg:!0});if("success"!==ke(e,"state"))return new Error(`can not serialize tableTags: ${ke(e,"msg")}`);try{t.writeFileSync(a,e.msg,"utf8")}catch(e){return e}return o=e.msg,s=!1,null};function h(){if(r)return;let e=m();e&&l("error",{msg:"writeTableTags catch",err:e})}let f=Ts(()=>{h(),l("changeTableTags",n)},200);return e.readTableTags=d,e.writeTableTags=h,e.initTableTags=function(e={},t="useInputFirst"){if(!r)if(null===e&&(e={}),Ti(e)){if("useInputOnly"===t)n=e;else if("useStorageOnly"===t)n=d();else if("useInputFirst"===t)n=uo(d(),e);else{if("useStorageFirst"!==t)throw new Error(`invalid mode[${t}]`);n=uo(e,d())}h()}else l("error",{msg:"invalid tableTags for initTableTags",err:e})},e.setTableTags=function(e={}){r||(null===e&&(e={}),Ti(e)?(n=uo(n,e),h()):l("error",{msg:"invalid tableTags for setTableTags",err:e}))},e.getTableTags=function(){return n},e.updateTableTag=function(e){r||(Zi(e)?(n[e]=c(),s=!0,f()):l("error",{msg:"invalid tableName",err:e}))},e.clearSync=function(){if(r)return;f.cancel();let e=null;if(s){let i=null;try{t.existsSync(a)&&(i=t.readFileSync(a,"utf8"))}catch(e){i=void 0}null!==i&&i!==o||(e=m())}r=!0,p(),e&&u("error",{msg:"writeTableTags catch",err:e})},e}var fo=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ai(t,mi(e)),e=pn(e);return t}:ui;function go(e){return ci(e,qs,fo)}var wo=Object.prototype.hasOwnProperty;var yo=/\w*$/;var Mo=Z?Z.prototype:void 0,Do=Mo?Mo.valueOf:void 0;function xo(e,t,i){var n,r,s,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Ws(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var i=t?Ws(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}(e,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ps(e,i);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(s=new(r=e).constructor(r.source,yo.exec(r))).lastIndex=r.lastIndex,s;case"[object Symbol]":return n=e,Do?Object(Do.call(n)):{}}}var Io=Wt&&Wt.isMap,bo=Io?Xt(Io):function(e){return P(e)&&"[object Map]"==et(e)};var Co=Wt&&Wt.isSet,vo=Co?Xt(Co):function(e){return P(e)&&"[object Set]"==et(e)},Lo="[object Arguments]",Eo="[object Function]",Ao="[object Object]",No={};function So(e,t,i,n,r,s){var o,a=1&t,c=2&t,l=4&t;if(i&&(o=r?i(e,n,r,s):i(e)),void 0!==o)return o;if(!V(e))return e;var u=S(e);if(u){if(o=function(e){var t=e.length,i=new e.constructor(t);return t&&"string"==typeof e[0]&&wo.call(e,"index")&&(i.index=e.index,i.input=e.input),i}(e),!a)return Ks(e,o)}else{var p=et(e),d=p==Eo||"[object GeneratorFunction]"==p;if(jt(e))return Os(e,a);if(p==Ao||p==Lo||d&&!r){if(o=c||d?{}:Bs(e),!a)return c?function(e,t){return Qs(e,fo(e),t)}(e,function(e,t){return e&&Qs(t,qs(t),e)}(o,e)):function(e,t){return Qs(e,mi(e),t)}(e,function(e,t){return e&&Qs(t,Bt(t),e)}(o,e))}else{if(!No[p])return r?e:{};o=xo(e,p,a)}}s||(s=new Jt);var m=s.get(e);if(m)return m;s.set(e,o),vo(e)?e.forEach(function(n){o.add(So(n,t,i,n,e,s))}):bo(e)&&e.forEach(function(n,r){o.set(r,So(n,t,i,r,e,s))});var h=u?void 0:(l?c?go:hi:c?qs:Bt)(e);return or(h||e,function(n,r){h&&(n=e[r=n]),Rs(o,r,So(n,t,i,r,e,s))}),o}No[Lo]=No["[object Array]"]=No["[object ArrayBuffer]"]=No["[object DataView]"]=No["[object Boolean]"]=No["[object Date]"]=No["[object Float32Array]"]=No["[object Float64Array]"]=No["[object Int8Array]"]=No["[object Int16Array]"]=No["[object Int32Array]"]=No["[object Map]"]=No["[object Number]"]=No[Ao]=No["[object RegExp]"]=No["[object Set]"]=No["[object String]"]=No["[object Symbol]"]=No["[object Uint8Array]"]=No["[object Uint8ClampedArray]"]=No["[object Uint16Array]"]=No["[object Uint32Array]"]=!0,No["[object Error]"]=No[Eo]=No["[object WeakMap]"]=!1;function To(e){return So(e,5)}function ko(e={}){let t=Fn(),i=Object.create(null),n=null,r=new Set,s=new Set,o=!1,a=ke(e,"timeAlive");nn(a)||(a=1e4),a=tn(a),a=Math.min(a,On);let c=ke(e,"timeDetect");return nn(c)||(c=50),c=tn(c),c=Math.min(c,On),t.trigger=function(e,l){if(!o)if(Zi(e)){if(!sr(i,e)){let n=setTimeout(()=>{r.delete(n),sr(i,e)&&s.add(e),Gn(t,"message",[{eventName:"enter",key:e,data:l,now:Dt(i)}],{tag:"alive"})},1);r.add(n)}i[e]={data:l,time:Date.now()},o||null===n&&(n=setInterval(()=>{ar(i,(e,n)=>{if(Date.now()-e.time>a){let e=To(i[n]);if(delete i[n],s.delete(n),Gn(t,"message",[{eventName:"leave",key:n,data:e.data,now:Dt(i)}],{tag:"alive"}),o)return!1}}),o||ki(i)||(clearInterval(n),n=null)},c))}else console.log("trigger need key")},t.get=function(){let e=[];return ar(i,(t,i)=>{e.push({key:i,data:t.data})}),e=To(e),e},t.clear=function(){if(o)return[];o=!0,null!==n&&(clearInterval(n),n=null);for(let e of r)clearTimeout(e);r.clear();let e=[];return ar(i,(t,i)=>{s.has(i)&&e.push({key:i,data:t.data})}),e=To(e),i=Object.create(null),s.clear(),e},t}function jo(e,t={}){let i=t.isCleared;Mn(i)||(i=()=>!1);let n=t.onDeliver;Mn(n)||(n=null);let r=e=>{console.error(`[w-serv-broadcast] ${e.msg}`,e.err)},s=t=>(s,...o)=>{let a=o[0];if("error"===s&&ki(a)&&"listener"===a.fun){let t={msg:`listener of event[${a.name}] error`,err:a.msg};return i()?(r(t),!1):e.emit("error",t)}return(!t||!i())&&("error"===s&&0===(t=>Mn(e.listenerCount)?e.listenerCount(t):1)("error")?(r(a),!1):(null!==n&&n(s,o),e.emit(s,...o)))},o=s(!0),a=s(!1),c=(t,...n)=>{i()||Wn(e,t,n,{tag:"w-serv-broadcast",funEmit:o})};return c.final=(t,...i)=>{Wn(e,t,i,{tag:"w-serv-broadcast",funEmit:a})},c}function Zo(e,t={}){if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Fn()),!sr(e,"emit")||!Mn(e.on)||!Mn(e.off))throw new Error("instWConverServer is not an EventEmitter");let i=new Map,n=!1,r=new Map,s=jo(e,{isCleared:()=>n,onDeliver:(e,t)=>{"clientEnter"===e?r.set(t[0],t[1]):"clientLeave"===e&&r.delete(t[0])}}),o=ko();o.on("message",function({eventName:e,key:t,data:i,now:n}){"enter"===e?s("clientEnter",t,i):"leave"===e&&(r.has(t)&&r.set(t,i),s("clientLeave",t,i)),s("clientChange",n)});let a=function(e,t,r){if(!n&&"[sys:polling]"===e)try{let e=ke(t,"clientId");if(!Zi(e))return void r.reject("[sys:polling] invalid clientId");let n=i.get(e)||[];i.set(e,[]),o.trigger(e,t),r.resolve(n)}catch(e){s("error",{msg:"[sys:polling] error",err:e}),r.reject("[sys:polling] error")}},c=null;return e.getClients=o.get,e.getMessages=()=>Object.fromEntries(Array.from(i,([e,t])=>[e,To(t)])),e.broadcast=e=>{if(n)return;let t={mode:"broadcast",data:To(e)};i.forEach(e=>{e.push(t)})},e.clearBroadcast=()=>{if(n)return;n=!0,null!==c&&(clearInterval(c),c=null),e.off("execute",a);let t=new Map(Yr(o.get(),e=>[e.key,e.data]));o.clear();let l=r.size;for(let[e,i]of Array.from(r))l--,s.final("clientLeave",e,t.has(e)?t.get(e):i),s.final("clientChange",l);r.clear(),i=new Map},e.on("execute",a),c=setInterval(()=>{let e=new Set(Yr(o.get(),"key"));for(let t of Array.from(i.keys()))e.has(t)||i.delete(t)},1e3),e}let zo=(e,t)=>{let i={};return ar(e,e=>{let n=e,r=ke(t,e,"");Zi(r)&&(i[n]=r)}),i};function Yo(e){ar(e,({ev:e,name:t,h:i})=>{try{Mn(e.removeListener)?e.removeListener(t,i):Mn(e.off)&&e.off(t,i)}catch(e){}})}function Xo(e,t){return 0!==Dt(e)&&(!!ki(t)&&(ar(e,e=>{let i=t[e];if(!i)throw new Error(`invalid kpOrm[${e}]`);if(!Mn(i.on))throw new Error(`kpOrm[${e}] can not listen to change events`)}),!0))}function Fo(e,t,i,n={}){if(!ki(e))throw new Error("invalid instWConverServer");if(!Xo(t,i))return e;let r=ke(n,"genTag");Mn(r)||(r=()=>Es()+"|"+Zr(6));let s={};ar(t,e=>{s[e]=r()}),ar(s,e=>{if(!Zi(e))throw new Error("invalid opt.genTag")});let o=[];try{ar(t,t=>{let n=i[t],r=()=>{e.updateTableTag(t)};try{n.on("change",r)}catch(e){throw new Error(`kpOrm[${t}] can not listen to change events`)}o.push({ev:n,name:"change",h:r})});let n=i=>{e.broadcast({mode:"syncKpTable",data:zo(t,i)})};e.on("changeTableTags",n),o.push({ev:e,name:"changeTableTags",h:n})}catch(e){throw Yo(o),e}let a=e.clearSync;return e.clearSync=()=>{Yo(o),o=[],a()},e.initTableTags(s,"useInputOnly"),e}function Go(e,t){return!!(null==e?0:e.length)&&Or(e,t,0)>-1}function Oo(e,t,i){for(var n=-1,r=null==e?0:e.length;++n<r;)if(i(t,e[n]))return!0;return!1}var Wo=We&&1/ri(new We([,-0]))[1]==1/0?function(e){return new We(e)}:function(){};function Po(e){return e&&e.length?function(e,t,i){var n=-1,r=Go,s=e.length,o=!0,a=[],c=a;if(i)o=!1,r=Oo;else if(s>=200){var l=t?null:Wo(e);if(l)return ri(l);o=!1,r=ei,c=new $t}else c=t?[]:a;e:for(;++n<s;){var u=e[n],p=t?t(u):u;if(u=i||0!==u?u:0,o&&p==p){for(var d=c.length;d--;)if(c[d]===p)continue e;t&&c.push(p),a.push(u)}else r(c,p,i)||(c!==a&&c.push(p),a.push(u))}return a}(e):[]}function Ko(e,t,i,n){for(var r=i-1,s=e.length;++r<s;)if(n(e[r],t))return r;return-1}var Ho=Array.prototype.splice;function Uo(e,t){return e&&e.length&&t&&t.length?function(e,t,i,n){var r=n?Ko:Or,s=-1,o=t.length,a=e;for(e===t&&(t=Ks(t)),i&&(a=Ce(e,Xt(i)));++s<o;)for(var c=0,l=t[s],u=i?i(l):l;(c=r(a,u,c,n))>-1;)a!==e&&Ho.call(a,c,1),Ho.call(e,c,1);return e}(e,t):e}let Bo=["__proto__","constructor","prototype"];function Vo(e){return S(t=e)?Ce(t,Se):K(t)?[t]:Ks(be(Ae(t)));var t}function _o(e){let t=Vo(e);if(0===t.length)return!1;for(let e of t)if(""===e||Bo.includes(e))return!1;return!0}const Ro=/^[\p{L}_][\p{L}\p{M}\p{N}_]*$/u,Qo=["prototype","length"];function Jo(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return(t===Object.prototype||null===t)&&(0===Object.getOwnPropertySymbols(e).length&&Object.getOwnPropertyNames(e).length===Object.keys(e).length)}function $o(e){return"string"==typeof e?e.length<=1024&&e.indexOf("\0")<0:"boolean"==typeof e||"number"==typeof e&&Number.isFinite(e)}function qo(e,t={}){try{return function(e,t){let i=e=>({ok:!1,reason:e});if(void 0===e)return!0===t.requireKey?i("emptyFind"):{ok:!0,find:e};if(!Jo(e))return i("notObject");let n=Object.keys(e);if(n.length>64)return i("tooManyKeys");if(!0===t.requireKey&&0===n.length)return i("emptyFind");let r={},s=0;for(let t of n){if(t.length>128||Qo.includes(t)||t in Object.prototype||!Ro.test(t))return i("badKey");let n=e[t];if($o(n))r[t]=n;else{if(!Jo(n))return i("badValue");{let e=Object.keys(n);if(1!==e.length||"$in"!==e[0])return i("badOperator");let o=n.$in;if(!Array.isArray(o)||Object.getOwnPropertySymbols(o).length>0)return i("badIn");let a=o.length;if(s+=a,s>1e3)return i("tooManyIn");if(Object.getOwnPropertyNames(o).length!==a+1)return i("badIn");let c=[];for(let e=0;e<a;e++){if(!Object.prototype.hasOwnProperty.call(o,e))return i("badIn");let t=o[e];if(!$o(t))return i("badIn");c.push(t)}r[t]=Object.freeze({$in:Object.freeze(c)})}}}return{ok:!0,find:Object.freeze(r)}}(e,t)}catch(e){return{ok:!1,reason:"notObject"}}}let ea=e=>null!=e,ta=["select","delAll"];function ia(e={}){let t=ke(e,"getUserIdByToken",null);if(ea(t)&&!Mn(t))throw new Error("invalid opt.getUserIdByToken");Mn(t)||(t=async()=>"");let i=ke(e,"useDbOrm",null);Bi(i)||(i=!1);let n=null;if(i&&(n=ke(e,"operOrm",null),!Mn(n)))throw new Error("invalid opt.operOrm when useDbOrm=true");let r=[];if(i){if(r=ke(e,"tableNames",null),!rn(r))throw new Error("invalid opt.tableNamesExec when useDbOrm=true");ar(r,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.tableNamesExec[${t}] when useDbOrm=true`)}),r=[...r]}let s=[];if(i){if(s=ke(e,"methods",null),null===s)s=["select","insert","save","del"];else if(!rn(s))throw new Error("invalid opt.methodsExec when useDbOrm=true");ar(s,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.methodsExec[${t}] when useDbOrm=true`)}),s=[...s]}let o=null;if(i&&(o=ke(e,"authorizeExec",null),!Mn(o)))throw new Error("invalid opt.authorizeExec when useDbOrm=true");let a=ke(e,"kpFunExt",null);if(ea(a)&&!Ti(a))throw new Error("invalid opt.kpFunExt");Ti(a)||(a={}),ar(a,(e,t)=>{if(!Mn(e))throw new Error(`invalid opt.kpFunExt[${t}]`)});let c=ke(e,"kpFunSys",null),l=[];i&&(ar(r,e=>{ar(s,t=>{l.push(`${e}.${t}`)})}),l=Po(l)),ar(l,e=>{if(!_o(e))throw new Error(`table operation[${e}] can not be bound by the client`)});let u=Po(Yr(l,e=>Vo(e)[0]));ar(a,(e,t)=>{if(t.startsWith("[sys:"))throw new Error(`kpFunExt[${t}] can not use the reserved prefix [sys:`);if(!_o(t))throw new Error(`kpFunExt[${t}] can not be bound by the client`);let i=Vo(t)[0];if(u.includes(i))throw new Error(`kpFunExt[${t}] conflicts with the table operations of table[${i}]`)});let p=function(e){let t=()=>({leaf:null,kids:new Map}),i=e=>{if(null!==e.leaf)return e.leaf;for(let t of e.kids.values()){let e=i(t);if(null!==e)return e}return null},n=t();for(let r of e){let e=n;for(let i of Vo(r)){if(null!==e.leaf)return[e.leaf,r];e.kids.has(i)||e.kids.set(i,t()),e=e.kids.get(i)}if(null===e.leaf){if(e.kids.size>0)return[i(e),r];e.leaf=r}else if(e.leaf!==r)return[e.leaf,r]}return null}([...l,...Bt(a)]);if(null!==p){let e=e=>l.includes(e)?"table operation":"kpFunExt";throw new Error(`${e(p[1])}[${p[1]}] conflicts with ${e(p[0])}[${p[0]}] on the client binding path`)}return{getUserIdByToken:t,useDbOrm:i,operOrm:n,tableNames:r,methods:s,authorizeExec:o,kpFunExt:a,kpFunSys:c,pathNames:l}}function na(e,t={}){if(!ki(e))throw new Error("invalid instWConverServer");let{getUserIdByToken:i,useDbOrm:n,operOrm:r,tableNames:s,methods:o,authorizeExec:a,kpFunExt:c,kpFunSys:l}=ia(t),u={};async function p(t,n,r){if(!Zi(t))return r.resolve({state:"error",msg:"invalid func"}),r;let s="";if(!sr(n,"__sysToken__"))return r.resolve({state:"error",msg:"invalid token"}),r;if(s=Qn(n.__sysToken__),!sr(n,"__sysInputArgs__"))return r.resolve({state:"error",msg:"invalid input"}),r;if(n=n.__sysInputArgs__,!Array.isArray(n))return r.resolve({state:"error",msg:"invalid input"}),r;let o="";try{o=await i(s)}catch(t){return r.resolve({state:"error",msg:t}),Gn(e,"error",[t]),r}if(Zi(o)||(o=""),"[sys:getFuncList]"===t){let e=Bt(u);e=function(e,t){if(!ln(e))return[];if((Ti(t)||_i(t)||ji(t)||Bi(t))&&(t=[t]),!ln(t))return e;let i=To(e);return Uo(i,t),i}(e,"[sys:getTableTags]");let t={state:"success",msg:e};return r.resolve(t),r}if(!Object.prototype.hasOwnProperty.call(u,t))return r.resolve({state:"error",msg:`invalid func[${t}]`}),r;let a=u[t];try{let e=await Ln(a)(o,...n);r.resolve(e)}catch(e){r.resolve({state:"error",msg:`call func[${t}] has an error: ${Rn(e)}`})}return r}return n&&(u=function(e,t,i,n){let r={};return ar(e,e=>{ar(t,t=>{r[`${e}.${t}`]=async function(r,s){if(ta.includes(t)){let e=qo(s);if(!e.ok)return Promise.reject(`invalid find[${e.reason}]`);s=e.find}return!0!==await n({userId:r,tableName:e,methodName:t,input:s})?Promise.reject("permission denied"):await i(r,e,t,s)}})}),r}(s,o,r,a)),ar(c,(e,t)=>{u[t]=e}),ki(l)&&ar(l,(e,t)=>{u[t]=e}),e.on("execute",function(t,i,n){p(t,i,n).catch(i=>{n.resolve({state:"error",msg:`execFun func[${t}] has an error: ${Rn(i)}`}),Gn(e,"error",[i])})}),e}let ra=e=>null!=e;function sa(e,t={}){if(ki(e)||(console.log("instWConverServer is not an effective object, and set instWConverServer to an EventEmitter"),e=Fn()),!sr(e,"emit")||!Mn(e.on)||!Mn(e.off))throw new Error("instWConverServer is not an EventEmitter");let{fpTableTags:i,genTag:n,useDbOrm:r,kpOrm:s,tableNamesSync:o,optExec:a}=function(e={}){let t=ke(e,"fpTableTags",null);if(ra(t)&&!Zi(t))throw new Error("invalid opt.fpTableTags");Zi(t)||(t="./tableTags.json");let i=ke(e,"genTag",null);if(ra(i)&&!Mn(i))throw new Error("invalid opt.genTag");Mn(i)||(i=()=>Es()+"|"+Zr(6));let n=ke(e,"useDbOrm",null),r=Bi(n);r||(n=!1);let s=ke(e,"kpOrm",null),o=ke(e,"operOrm",null),a=ke(e,"tableNamesExec",null),c=ke(e,"methodsExec",null),l=ke(e,"authorizeExec",null),u=ke(e,"tableNamesSync",null),p=ke(e,"getUserIdByToken",null),d=ke(e,"kpFunExt",null);r||ar({operOrm:o,tableNamesExec:a,methodsExec:c,authorizeExec:l,kpOrm:s,tableNamesSync:u},(e,t)=>{if(null!==e)throw new Error(`invalid opt.useDbOrm when opt.${t} is given`)});if(n&&!Ti(s))throw new Error("invalid opt.kpOrm when useDbOrm=true");if(n&&ra(u)){if(!rn(u))throw new Error("invalid opt.tableNamesSync when useDbOrm=true");ar(u,(e,t)=>{if(!Zi(e))throw new Error(`invalid opt.tableNamesSync[${t}] when useDbOrm=true`)}),u=[...u]}let m=ia({getUserIdByToken:p,useDbOrm:n,operOrm:o,tableNames:a,methods:c,authorizeExec:l,kpFunExt:d}),h=!1;return n&&(h=Xo(u,s)),h&&ar(u,e=>{if(!m.tableNames.includes(e)||!m.methods.includes("select"))throw new Error(`invalid opt.tableNamesSync when table operation[${e}.select] does not exist`)}),{fpTableTags:t,genTag:i,useDbOrm:n,kpOrm:s,tableNamesSync:u,optExec:{getUserIdByToken:m.getUserIdByToken,useDbOrm:m.useDbOrm,operOrm:m.operOrm,tableNames:m.tableNames,methods:m.methods,authorizeExec:m.authorizeExec,kpFunExt:m.kpFunExt}}}(t);e=new Zo(e=new ho(e,{fpTableTags:i,genTag:n}));let c={"[sys:getTableTags]":()=>{let t=e.getTableTags();return{mode:"syncKpTable",data:zo(o,t)}}};try{e=new na(e,{...a,kpFunSys:c}),r&&(e=new Fo(e,o,s,{genTag:n}))}catch(t){throw e.clearBroadcast(),e.clearSync(),t}return e}function oa(e={}){let t=Fn(),r=ke(e,"port");(!nn(r,{useLimitSafe:!0})||tn(r)>65535)&&(r=8080),r=tn(r);let s=(t,i,n)=>{let r=ke(e,t);if(null==r)return i;if(!n(r))throw new Error(`invalid opt.${t}`);return r},o=s("corsOrigins",["http://localhost"],e=>!1===e||ji(e)||rn(e));!1===o&&(o=[]),ji(o)&&(o=[o]),o=o.filter(e=>""!==e);let a=s("useInert",!0,Bi),c=s("pathStaticFiles","dist",Zi),l=ke(e,"apis");ln(l)||(l=[]);let u=ke(e,"fpTableTags",null);null==u&&(u=ke(e,"fnTableTags",null));let p=ke(e,"useShowLog");Bi(p)||(p=!0);let d=!0,m=[],h=e=>{d?m.push(e):0!==t.listenerCount("error")?Gn(t,"error",[e],{tag:"w-serv-hapi"}):console.error("[w-serv-hapi]",e)},f=!1;o.length>0&&(f={origin:o,credentials:!1,additionalExposedHeaders:["Return-Type","Return-Msg","Return-Retryable","Content-Disposition"]});let g=new i.Server({port:r,routes:{timeout:{server:!1,socket:!1},cors:f}}),w=new Ls({serverHapi:g,apiName:ke(e,"apiName"),pathUploadTemp:ke(e,"pathUploadTemp"),tokenType:ke(e,"tokenType"),sizeSlice:ke(e,"sizeSlice"),sizeMsg:ke(e,"sizeMsg"),verifyConn:ke(e,"verifyConn"),delayForSlice:ke(e,"delayForSlice")});w.on("error",h),w.on("clientChange",function(e){p&&console.log(`Server[port:${r}]: now clients: ${e}`)});let y=()=>{for(let e of["clearBroadcast","clearSync"])if(Mn(w[e]))try{w[e]()}catch(e){h(e)}};w=new sa(w,{...e,fpTableTags:u});let M=new Promise(e=>{setTimeout(()=>{d=!1,e();let t=m;m=[];for(let e of t)h(e)},1)}),D=!1,x=(async()=>{await M,a&&await g.register(n);let e=[];return a&&(e=[{method:"GET",path:"/{file*}",handler:{directory:{path:`${c}/`}}}]),e=[...e,...l],g.route(e),await g.start(),D=!0,p&&console.log(`Server running at: ${g.info.uri}`),g})();x.catch(e=>{y(),h(e)});let I=null;return t.ready=()=>x,t.stop=()=>(null!==I||(I=(async()=>{if(await x.catch(()=>{}),y(),D)try{await g.stop()}catch(e){h(e)}})()),I),t.getServer=async()=>g,t.getInstWConverServer=async()=>w,t}function aa(e){try{e instanceof Promise&&Promise.prototype.then.call(e,void 0,()=>{})}catch(e){}}function ca(e,t){let i=Cn(),n=!1;try{let t=function(e,t=!1){let i=[],n=!1;try{if(Array.isArray(e)){let t=e.length;i.length=t;for(let n=0;n<t;n++)n in e&&(i[n]=e[n])}else{if(t||!Ti(e)&&!rn(e))return null;{n=!0;let t=Object.keys(e);for(let n=0;n<t.length;n++)i.push({k:t[n],v:e[t[n]]})}}}catch(e){throw i.forEach(e=>{aa(n?e.v:e)}),e}return{items:i,useObj:n}}(e);if(null===t)return i.reject("rs is not an array or object"),i;e=t.items,n=t.useObj}catch(e){return i.reject(e),i}Mn(t)||(ar(e,e=>{aa(n?e.v:e)}),t=function(e){return e});let r=Mn(t),s=-1,o=[];return e.reduce(function(e,i){return e.then(function(e){o.push(e),s+=1;let a=s,c=i;return n&&(a=i.k,c=i.v),r?t(c,a):c})},Promise.resolve()).then(function(e){var t,n,r,s;o.push(e),s=null==(t=o)?0:t.length,o=s?Xr(t,(n=r||void 0===n?1:Ui(n))<0?0:n,s):[],i.resolve(o)}).catch(function(e){i.reject(e)}),i}function la(){return new function(){let e=new Map,t=new Map;return async(i,n)=>{let r=(e.get(i)||Promise.resolve()).then(async()=>await n(),async()=>await n());e.set(i,r.catch(()=>{})),t.set(i,(t.get(i)||0)+1);try{return await r}finally{let n=t.get(i)-1;n<=0?(t.delete(i),e.delete(i)):t.set(i,n)}}}}function ua(e){let t="procOrm does not authorize users, authorize where procOrm is exposed to clients",i=[["useCheckUser",t],["getUserById",t],["useExcludeWhenNotAdmin","procOrm does not filter select results by user, use addFunPostProcessing if needed"]];for(let[t,n]of i){let i=ke(e,t);if(null!=i&&!1!==i)throw new Error(`opt.${t} has been removed, ${n}`)}}const pa=Object.freeze({mismatch:"baselineMismatch",rowNotFound:"rowNotFound",format:"baselineFormat"}),da=["table","pk","fields","serverOnly","orderKey","scope"];function ma(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ha(e){return Object.prototype.toString.call(e)}function fa(e){if(null===e||"object"!=typeof e||"[object Object]"!==ha(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}function ga(e){return"string"==typeof e&&""!==e}function wa(e,t){let i=new Error(t);return i.key=e,i}function ya(e,t,i){if(!Array.isArray(e)||!i&&0===e.length)throw new Error(`invalid contract: ${t} needs ${i?"an array":"a non-empty array"}`);let n=new Set;for(let i=0;i<e.length;i++){if(!ga(e[i]))throw new Error(`invalid contract: ${t}[${i}] needs a non-empty string`);if(n.has(e[i]))throw new Error(`invalid contract: ${t} has a duplicate name at [${i}]`);n.add(e[i])}}function Ma(e){if(!fa(e))throw new Error("invalid contract: need an object");for(let t of Reflect.ownKeys(e))if(da.indexOf(t)<0)throw new Error("invalid contract: unsupported key");if(!ga(e.pk))throw new Error("invalid contract: pk needs a non-empty string");if(ya(e.fields,"fields",!1),void 0!==e.serverOnly&&null!==e.serverOnly){ya(e.serverOnly,"serverOnly",!0);for(let t of e.serverOnly)if(e.fields.indexOf(t)>=0)throw new Error("invalid contract: serverOnly and fields must not overlap")}if(void 0!==e.orderKey&&null!==e.orderKey){if(!ga(e.orderKey))throw new Error("invalid contract: orderKey needs a non-empty string");if(e.fields.indexOf(e.orderKey)>=0)throw new Error("invalid contract: fields must not contain orderKey");if(e.orderKey===e.pk)throw new Error("invalid contract: orderKey must not be pk")}if(void 0!==e.scope&&null!==e.scope&&"function"!=typeof e.scope)throw new Error("invalid contract: scope needs a function");if(void 0!==e.table&&null!==e.table&&!ga(e.table))throw new Error("invalid contract: table needs a non-empty string");return!0}function Da(e,t,i,n){if(t.n+=1,t.n>1e5)throw new Error(`unsupported value of ${n}: too many nodes`);if(i>100)throw new Error(`unsupported value of ${n}: too deep or circular`);let r=typeof e;if(null==e)return"null";if("string"===r)return JSON.stringify(e);if("boolean"===r)return e?"true":"false";if("number"===r){if(!isFinite(e))throw new Error(`unsupported value of ${n}: non-finite number`);return JSON.stringify(e)}if("bigint"===r)return JSON.stringify(e.toString());if("object"===r){if(Array.isArray(e)){let r=Object.keys(e);for(let t=0;t<r.length;t++){let i=Number(r[t]);if(!(String(i)===r[t]&&i>=0&&i<e.length&&Math.floor(i)===i))throw new Error(`unsupported value of ${n}: array with extra properties`)}let s=[];for(let r=0;r<e.length;r++)s.push(Da(e[r],t,i+1,n));return"["+s.join(",")+"]"}let r=ha(e);if("[object Date]"===r){let t;try{t=Date.prototype.toISOString.call(e)}catch(e){throw new Error(`unsupported value of ${n}: invalid Date`)}return JSON.stringify(t)}if(fa(e)){let r=Object.keys(e).sort(),s=[];for(let o=0;o<r.length;o++){let a=e[r[o]];void 0!==a&&s.push(JSON.stringify(r[o])+":"+Da(a,t,i+1,n))}return"{"+s.join(",")+"}"}throw new Error(`unsupported value of ${n}: ${r}`)}throw new Error(`unsupported value of ${n}: ${r}`)}function xa(e,t,i){return null==e||""===e?"null":Da(e,t,0,i)}function Ia(e){return null!==e&&"object"==typeof e&&"[object Object]"===ha(e)}function ba(e,t){if(!Ia(e))throw new Error("invalid row: need an object");let i=[],n={n:0};for(let r=0;r<t.length;r++){let s=t[r];i.push(xa(ma(e,s)?e[s]:void 0,n,`field[${s}]`))}let r=function(e,t){let i="number"==typeof t?t:0,n=3735928559^i,r=1103547991^i;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)}("["+i.join(",")+"]").toString(16);for(;r.length<14;)r="0"+r;return"h1:"+r}function Ca(e,t){return Ma(t),ba(e,t.fields)}function va(e,t){let i=ma(e,t)?e[t]:void 0;return"string"==typeof i?""===i?null:i:"number"==typeof i&&isFinite(i)?String(i):"bigint"==typeof i?i.toString():null}function La(e,t){let i=ma(e,t)?e[t]:void 0;if("number"==typeof i)return isFinite(i)?i:1/0;if("bigint"==typeof i)return i;if("string"==typeof i){let e=i.trim();if(""===e)return 1/0;if("function"==typeof BigInt&&/^[+-]?\d+$/.test(e))return BigInt(e);let t=Number(e);return isFinite(t)?t:1/0}return 1/0}function Ea(e){if(!Array.isArray(e))return!1;let t=new RegExp("^h1:[0-9a-f]{14}$"),i=new Set;for(let n=0;n<e.length;n++){let r=e[n];if(!Array.isArray(r)||2!==r.length||!ga(r[0])||"string"!=typeof r[1]||!t.test(r[1]))return!1;if(i.has(r[0]))return!1;i.add(r[0])}return!0}function Aa(e,t,i){if(Ma(i),!Ea(t))return{ok:!1,reason:pa.format,added:[],removed:[],changed:[],reordered:!1};let n;try{n=function(e,t){if(Ma(t),!Array.isArray(e))throw new Error("invalid rows: need an array");let i=t.fields,n="function"==typeof t.scope,r=ga(t.orderKey),s=[],o=new Set;for(let a=0;a<e.length;a++){let c=e[a];if(!Ia(c))throw new Error(`invalid row: rows[${a}] needs an object`);if(n&&!t.scope(c))continue;let l=va(c,t.pk);if(null===l)throw wa(pa.format,`invalid row: rows[${a}] has no valid primary key`);if(o.has(l))throw wa(pa.format,`invalid row: rows[${a}] has a duplicate primary key`);o.add(l),s.push({id:l,o:r?La(c,t.orderKey):0,d:ba(c,i)})}return s.sort((e,t)=>e.o<t.o?-1:e.o>t.o?1:e.id!==t.id?e.id<t.id?-1:1:0),s.map(e=>[e.id,e.d])}(e,i)}catch(e){if(null!==e&&"object"==typeof e&&e.key===pa.format){let t=new Error(`invalid rowsNow: ${e.message}`);throw t.key="rowsInvalid",t}throw e}let r=new Map(t),s=new Map(n),o=[],a=[],c=[];for(let[e]of t)s.has(e)||a.push(e);for(let[e,t]of n)r.has(e)?r.get(e)!==t&&c.push(e):o.push(e);let l=t.map(e=>e[0]).filter(e=>s.has(e)),u=n.map(e=>e[0]).filter(e=>r.has(e)),p=!1;for(let e=0;e<l.length;e++)if(l[e]!==u[e]){p=!0;break}if(0===o.length&&0===a.length&&0===c.length&&!p)return{ok:!0};let d=pa.mismatch;return 1===t.length&&1===a.length&&0===o.length&&(d=pa.rowNotFound),{ok:!1,reason:d,added:o,removed:a,changed:c,reordered:p}}function Na(e){return"string"==typeof e?e:null!==e&&"object"==typeof e&&"string"==typeof e.key?e.key:null}let Sa={backup:async function(e){if(!ki(e))throw console.log("woItems",e),new Error("invalid woItems");return await ca(e,async(e,t)=>(console.log("backup...",t),{name:t,data:await e.select()}))},recover:async function(e,i,n,r=!1){if(!Tn(e))throw console.log("fp",e),new Error("fp is not exist");if(!ki(i))throw console.log("woItems",i),new Error("invalid woItems");Mn(n)||(n=null),Bi(r)||(r=!1);let s=t.readFileSync(e,"utf8");s=es(s);let o=po(s);if(!ln(o))throw new Error("invalid backup data, need a non-empty array");ar(o,(e,t)=>{let n=ke(e,"name");if(!Zi(n))throw new Error(`invalid backup data, rs[${t}].name is not a string`);if(!Object.prototype.hasOwnProperty.call(i,n))throw new Error(`invalid backup data, table[${n}] is not in woItems`)}),Mn(n)&&n(),await ca(o,async e=>{console.log("recover...",e.name),r&&(console.log("needCreateStorage"),await i[e.name].createStorage());let t=null;return Dt(e.data)>0&&(t=await i[e.name].insert(e.data)),t})}};var Ta=Array.prototype.join;function ka(e,t){return null==e?"":Ta.call(e,t)}var ja=Wt&&Wt.isRegExp,Za=ja?Xt(ja):function(e){return P(e)&&"[object RegExp]"==W(e)},za=/\w*$/;function Ya(e,t){var i=30,n="...";if(V(t)){var r="separator"in t?t.separator:r;i="length"in t?Ui(t.length):i,n="omission"in t?Ee(t.omission):n}var s=(e=Ae(e)).length;if(ot(e)){var o=qr(e);s=o.length}if(i>=s)return e;var a=i-Mt(n);if(a<1)return n;var c=o?Fr(o,0,a).join(""):e.slice(0,a);if(void 0===r)return c+n;if(o&&(a+=c.length-a),Za(r)){if(e.slice(a).search(r)){var l,u=c;for(r.global||(r=RegExp(r.source,Ae(za.exec(r))+"g")),r.lastIndex=0;l=r.exec(u);)var p=l.index;c=c.slice(0,void 0===p?a:p)}}else if(e.indexOf(Ee(r),a)!=a){var d=c.lastIndexOf(r);d>-1&&(c=c.slice(0,d))}return c+n}function Xa(){if(!Mn(Tr))throw new Error("invalid dayjs");return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}const Fa=[];for(let e=0;e<256;++e)Fa.push((e+256).toString(16).slice(1));const Ga=new Uint8Array(16);function Oa(){return crypto.getRandomValues(Ga)}const Wa={};function Pa(e,t,i){let n;if(e)n=Ka(e.random??e.rng?.()??Oa(),e.msecs,e.seq,t,i);else{const e=Date.now(),r=Oa();!function(e,t,i){e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=Ha(i),e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++)}(Wa,e,r),n=Ka(r,Wa.msecs,Wa.seq,t,i)}return t??function(e,t=0){return(Fa[e[t+0]]+Fa[e[t+1]]+Fa[e[t+2]]+Fa[e[t+3]]+"-"+Fa[e[t+4]]+Fa[e[t+5]]+"-"+Fa[e[t+6]]+Fa[e[t+7]]+"-"+Fa[e[t+8]]+Fa[e[t+9]]+"-"+Fa[e[t+10]]+Fa[e[t+11]]+Fa[e[t+12]]+Fa[e[t+13]]+Fa[e[t+14]]+Fa[e[t+15]]).toLowerCase()}(n)}function Ka(e,t,i,n,r=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(r<0||r+16>n.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`)}else n=new Uint8Array(16),r=0;return t??=Date.now(),i??=Ha(e),n[r++]=t/1099511627776&255,n[r++]=t/4294967296&255,n[r++]=t/16777216&255,n[r++]=t/65536&255,n[r++]=t/256&255,n[r++]=255&t,n[r++]=112|i>>>28&15,n[r++]=i>>>20&255,n[r++]=128|i>>>14&63,n[r++]=i>>>6&255,n[r++]=i<<2&255|3&e[10],n[r++]=e[11],n[r++]=e[12],n[r++]=e[13],n[r++]=e[14],n[r++]=e[15],n}function Ha(e){return(127&e[6])<<24|e[7]<<16|e[8]<<8|e[9]}function Ua(){return Pa()}var Ba={exports:{}},Va={},_a={exports:{}},Ra={};function Qa(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Ja=/javascript\s*\:/gim;Ra.whiteList=Qa(),Ra.getDefaultWhiteList=Qa,Ra.onAttr=function(e,t,i){},Ra.onIgnoreAttr=function(e,t,i){},Ra.safeAttrValue=function(e,t){return Ja.test(t)?"":t};var $a={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,r;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},qa=$a;var ec=function(e,t){";"!==(e=qa.trimRight(e))[e.length-1]&&(e+=";");var i=e.length,n=!1,r=0,s=0,o="";function a(){if(!n){var i=qa.trim(e.slice(r,s)),a=i.indexOf(":");if(-1!==a){var c=qa.trim(i.slice(0,a)),l=qa.trim(i.slice(a+1));if(c){var u=t(r,o.length,c,l,i);u&&(o+=u+"; ")}}}r=s+1}for(;s<i;s++){var c=e[s];if("/"===c&&"*"===e[s+1]){var l=e.indexOf("*/",s+2);if(-1===l)break;r=(s=l+1)+1,n=!1}else"("===c?n=!0:")"===c?n=!1:";"===c?n||a():"\n"===c&&a()}return qa.trim(o)},tc=Ra,ic=ec;function nc(e){return null==e}function rc(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).whiteList=e.whiteList||tc.whiteList,e.onAttr=e.onAttr||tc.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||tc.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||tc.safeAttrValue,this.options=e}rc.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,i=t.whiteList,n=t.onAttr,r=t.onIgnoreAttr,s=t.safeAttrValue;return ic(e,function(e,t,o,a,c){var l=i[o],u=!1;if(!0===l?u=l:"function"==typeof l?u=l(a):l instanceof RegExp&&(u=l.test(a)),!0!==u&&(u=!1),a=s(o,a)){var p,d={position:t,sourcePosition:e,source:c,isWhite:u};return u?nc(p=n(o,a,d))?o+":"+a:p:nc(p=r(o,a,d))?void 0:p}})};var sc=rc;!function(e,t){var i=Ra,n=sc;for(var r in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,i)t[r]=i[r];"undefined"!=typeof window&&(window.filterCSS=e.exports)}(_a,_a.exports);var oc=_a.exports,ac={indexOf:function(e,t){var i,n;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},forEach:function(e,t,i){var n,r;if(Array.prototype.forEach)return e.forEach(t,i);for(n=0,r=e.length;n<r;n++)t.call(i,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},cc=oc.FilterCSS,lc=oc.getDefaultWhiteList,uc=ac;function pc(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var dc=new cc;function mc(e){return e.replace(hc,"<").replace(fc,">")}var hc=/</g,fc=/>/g,gc=/"/g,wc=/"/g,yc=/&#([a-zA-Z0-9]*);?/gim,Mc=/:?/gim,Dc=/&newline;?/gim,xc=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Ic=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,bc=/u\s*r\s*l\s*\(.*/gi;function Cc(e){return e.replace(gc,""")}function vc(e){return e.replace(wc,'"')}function Lc(e){return e.replace(yc,function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))})}function Ec(e){return e.replace(Mc,":").replace(Dc," ")}function Ac(e){for(var t="",i=0,n=e.length;i<n;i++)t+=e.charCodeAt(i)<32?" ":e.charAt(i);return uc.trim(t)}function Nc(e){return e=Ac(e=Ec(e=Lc(e=vc(e))))}function Sc(e){return e=mc(e=Cc(e))}Va.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Va.getDefaultWhiteList=pc,Va.onTag=function(e,t,i){},Va.onIgnoreTag=function(e,t,i){},Va.onTagAttr=function(e,t,i){},Va.onIgnoreTagAttr=function(e,t,i){},Va.safeAttrValue=function(e,t,i,n){if(i=Nc(i),"href"===t||"src"===t){if("#"===(i=uc.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===t){if(xc.lastIndex=0,xc.test(i))return""}else if("style"===t){if(Ic.lastIndex=0,Ic.test(i))return"";if(bc.lastIndex=0,bc.test(i)&&(xc.lastIndex=0,xc.test(i)))return"";!1!==n&&(i=(n=n||dc).process(i))}return i=Sc(i)},Va.escapeHtml=mc,Va.escapeQuote=Cc,Va.unescapeQuote=vc,Va.escapeHtmlEntities=Lc,Va.escapeDangerHtml5Entities=Ec,Va.clearNonPrintableCharacter=Ac,Va.friendlyAttrValue=Nc,Va.escapeAttrValue=Sc,Va.onIgnoreTagStripAll=function(){return""},Va.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var i=!Array.isArray(e),n=[],r=!1;return{onIgnoreTag:function(s,o,a){if(function(t){return!!i||-1!==uc.indexOf(e,t)}(s)){if(a.isClosing){var c="[/removed]",l=a.position+10;return n.push([!1!==r?r:a.position,l]),r=!1,c}return r||(r=a.position),"[removed]"}return t(s,o,a)},remove:function(e){var t="",i=0;return uc.forEach(n,function(n){t+=e.slice(i,n[0]),i=n[1]}),t+=e.slice(i)}}},Va.stripCommentTag=function(e){for(var t="",i=0;i<e.length;){var n=e.indexOf("\x3c!--",i);if(-1===n){t+=e.slice(i);break}t+=e.slice(i,n);var r=e.indexOf("--\x3e",n);if(-1===r)break;i=r+3}return t},Va.stripBlankChar=function(e){var t=e.split("");return(t=t.filter(function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})).join("")},Va.attributeWrapSign='"',Va.cssFilter=dc,Va.getDefaultCSSWhiteList=lc;var Tc={},kc=ac;function jc(e){var t,i=kc.spaceIndex(e);return t=-1===i?e.slice(1,-1):e.slice(1,i+1),"/"===(t=kc.trim(t).toLowerCase()).slice(0,1)&&(t=t.slice(1)),"/"===t.slice(-1)&&(t=t.slice(0,-1)),t}function Zc(e){return"</"===e.slice(0,2)}var zc=/[^a-zA-Z0-9\\_:.-]/gim;function Yc(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Xc(e,t){for(;t<e.length;t++){var i=e[t];if(" "!==i)return"'"===i||'"'===i?t:-1}}function Fc(e,t){for(;t>0;t--){var i=e[t];if(" "!==i)return"="===i?t:-1}}function Gc(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}Tc.parseTag=function(e,t,i){var n="",r=0,s=!1,o=!1,a=0,c=e.length,l="",u="";e:for(a=0;a<c;a++){var p=e.charAt(a);if(!1===s){if("<"===p){s=a;continue}}else if(!1===o){if("<"===p){n+=i(e.slice(r,a)),s=a,r=a;continue}if(">"===p||a===c-1){n+=i(e.slice(r,s)),l=jc(u=e.slice(s,a+1)),n+=t(s,n.length,l,u,Zc(u)),r=a+1,s=!1;continue}if('"'===p||"'"===p)for(var d=1,m=e.charAt(a-d);""===m.trim()||"="===m;){if("="===m){o=p;continue e}m=e.charAt(a-++d)}}else if(p===o){o=!1;continue}}return r<c&&(n+=i(e.substr(r))),n},Tc.parseAttr=function(e,t){var i=0,n=0,r=[],s=!1,o=e.length;function a(e,i){if(!((e=(e=kc.trim(e)).replace(zc,"").toLowerCase()).length<1)){var n=t(e,i||"");n&&r.push(n)}}for(var c=0;c<o;c++){var l,u=e.charAt(c);if(!1!==s||"="!==u)if(!1===s||c!==n)if(/\s|\n|\t/.test(u)){if(e=e.replace(/\s|\n|\t/g," "),!1===s){if(-1===(l=Yc(e,c))){a(kc.trim(e.slice(i,c))),s=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=Fc(e,c-1))){a(s,Gc(kc.trim(e.slice(i,c)))),s=!1,i=c+1;continue}}else;else{if(-1===(l=e.indexOf(u,c+1)))break;a(s,kc.trim(e.slice(n+1,l))),s=!1,i=(c=l)+1}else s=e.slice(i,c),i=c+1,n='"'===e.charAt(i)||"'"===e.charAt(i)?i:Xc(e,c+1)}return i<e.length&&(!1===s?a(e.slice(i)):a(s,Gc(kc.trim(e.slice(i))))),kc.trim(r.join(" "))};var Oc=oc.FilterCSS,Wc=Va,Pc=Tc,Kc=Pc.parseTag,Hc=Pc.parseAttr,Uc=ac;function Bc(e){return null==e}function Vc(e){(e=function(e){var t={};for(var i in e)t[i]=e[i];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=Wc.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=function(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(e){return e.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}(e.whiteList||e.allowList):e.whiteList=Wc.whiteList,this.attributeWrapSign=!0===e.singleQuotedAttributeValue?"'":Wc.attributeWrapSign,e.onTag=e.onTag||Wc.onTag,e.onTagAttr=e.onTagAttr||Wc.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||Wc.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||Wc.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||Wc.safeAttrValue,e.escapeHtml=e.escapeHtml||Wc.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Oc(e.css))}Vc.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this,i=t.options,n=i.whiteList,r=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,a=i.onIgnoreTagAttr,c=i.safeAttrValue,l=i.escapeHtml,u=t.attributeWrapSign,p=t.cssFilter;i.stripBlankChar&&(e=Wc.stripBlankChar(e)),i.allowCommentTag||(e=Wc.stripCommentTag(e));var d=!1;i.stripIgnoreTagBody&&(d=Wc.StripTagBody(i.stripIgnoreTagBody,s),s=d.onIgnoreTag);var m=Kc(e,function(e,t,i,d,m){var h={sourcePosition:e,position:t,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(n,i)},f=r(i,d,h);if(!Bc(f))return f;if(h.isWhite){if(h.isClosing)return"</"+i+">";var g=function(e){var t=Uc.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var i="/"===(e=Uc.trim(e.slice(t+1,-1)))[e.length-1];return i&&(e=Uc.trim(e.slice(0,-1))),{html:e,closing:i}}(d),w=n[i],y=Hc(g.html,function(e,t){var n=-1!==Uc.indexOf(w,e),r=o(i,e,t,n);return Bc(r)?n?(t=c(i,e,t,p))?e+"="+u+t+u:e:Bc(r=a(i,e,t,n))?void 0:r:r});return d="<"+i,y&&(d+=" "+y),g.closing&&(d+=" /"),d+=">"}return Bc(f=s(i,d,h))?l(d):f},l);return d&&(m=d.remove(m)),m};var _c=Vc;!function(e,t){var i=Va,n=Tc,r=_c;function s(e,t){return new r(t).process(e)}(t=e.exports=s).filterXSS=s,t.FilterXSS=r,function(){for(var e in i)t[e]=i[e];for(var r in n)t[r]=n[r]}(),"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(Ba,Ba.exports);var Rc=Zn(Ba.exports);function Qc(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let Jc=/<(?=[A-Za-z!/?]|$)/g;function $c(e){return e.replace(Jc,"<")}let qc={getFilterXSS:function(e=Rc){if(Mn(e))return e;let t=Qc(),i=ke(t,"filterXSS",null);if(Mn(i))return i;let n=ke(t,"xss",null);if(Mn(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(e){return{escapeHtml:$c,onIgnoreTagAttr:function(t,i,n,r){if("style"===i)return i+'="'+e.escapeAttrValue(n)+'"'}}}};function el(e){let t=null,i=null;let n=function e(n){if(Array.isArray(n)){for(let t=0;t<n.length;t++)n[t]=e(n[t]);return n}if(Ti(n)||rn(n)){for(let t of Object.keys(n))n[t]=e(n[t]);return n}return Zi(n)?(r=n,null===t&&(t=qc.getFilterXSS(),i=qc.getOpt(t)),t(r,i)):n;var r}(To(e));return n}function tl(e,t){if(!rn(e))return[];rn(t)||(t=[t]);let i=[];return ar(e,(e,n)=>{0===ke(e,"ok")&&i.push({k:n,id:ke(t,[n,"id"]),err:ke(e,"err","")})}),i}function il(e,t){var i,n,r;let s=`${e}: ${ka(Yr((n=10,(i=t)&&i.length?Xr(i,0,(n=r||void 0===n?1:Ui(n))<0?0:n):[]),e=>Zi(e.ref)?e.ref:Zi(e.id)||_i(e.id)?`id[${Ya(String(e.id),{length:100,omission:"…"})}]`:`data[${e.k}]`),", ")}`;return Dt(t)>10&&(s+=`, ... (${Dt(t)} in total)`),s}function nl(e,t){if(t.indexOf("id")<0)return!1;let i=ke(e,"settings",null);if(ki(i)&&!0!==ke(i,"id.pk"))return!1;let n=ke(i,"id.type","")||ke(e,"kpType.id","");return!(Zi(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.split("(")[0].trim().toUpperCase())<0)}function rl(e,t){return null!==e&&"object"==typeof e&&"string"==typeof t&&Object.prototype.hasOwnProperty.call(e,t)?void 0===e[t]?null:e[t]:null}function sl(e){try{return Array.isArray(e)}catch(e){return!1}}function ol(e){return!Object.prototype.hasOwnProperty.call(e,"value")}function al(e){return"number"==typeof e&&Number.isFinite(e)}function cl(e){return al(e)?String(e):e}function ll(e,t){return Object.fromEntries(Object.keys(e).map(i=>[i,t(e[i],i)]))}const ul=Object.freeze({proto:"unsupported key[__proto__]",accessor:"unsupported accessor property",unreadable:"unreadable value",deep:"too deep",large:"too large",sparse:"unsupported sparse array",hidden:"unsupported symbol key or non-enumerable property",irregular:"unsupported irregular object or array"}),pl="function"==typeof WeakRef?Function.prototype.call.bind(WeakRef.prototype.deref):null,dl="function"==typeof FinalizationRegistry?Function.prototype.call.bind(FinalizationRegistry.prototype.unregister):null,ml={};function hl(e){let t=0;for(let i=e;null!==i;i=Object.getPrototypeOf(i))if(t++>64||a.types.isProxy(i)||Object.prototype.hasOwnProperty.call(i,Symbol.toStringTag))return!1;return!0}function fl(e){return a.types.isMap(e)||a.types.isSet(e)||a.types.isWeakMap(e)||a.types.isWeakSet(e)||a.types.isPromise(e)||a.types.isAnyArrayBuffer(e)||a.types.isArrayBufferView(e)||a.types.isBoxedPrimitive(e)||a.types.isRegExp(e)||a.types.isNativeError(e)||a.types.isGeneratorObject(e)||a.types.isMapIterator(e)||a.types.isSetIterator(e)||a.types.isModuleNamespaceObject(e)}function gl(e){if("object"!=typeof e||null===e||!hl(e)||!Ti(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype||function(e){if(null!==Object.getPrototypeOf(e))return!1;let t=Reflect.ownKeys(Object.prototype);if(Reflect.ownKeys(e).length!==t.length)return!1;for(let i of t)if(!Object.prototype.hasOwnProperty.call(e,i))return!1;let i=Object.getOwnPropertyDescriptor(e,"constructor");if(void 0===i||"function"!=typeof i.value||a.types.isProxy(i.value))return!1;if(Function.prototype.toString.call(i.value)!==Function.prototype.toString.call(Object))return!1;let n=Object.getOwnPropertyDescriptor(i.value,"prototype");return void 0!==n&&n.value===e}(t)}function wl(e){return"object"!=typeof e||null===e||!hl(e)||fl(e)?null:Array.isArray(e)?"arr":Ti(e)?"obj":null}function yl(e){if(null!==pl)try{return pl(e),!0}catch(e){}if(null!==dl)try{return dl(e,ml),!0}catch(e){}return!1}function Ml(e,...t){try{console.log(e,...t)}catch(t){try{console.log(e,"(unprintable)")}catch(e){}}}function Dl(e,t={n:0},i=0){if(t.n>=200)return"[...]";if(t.n++,"string"==typeof e)return Ya(e,{length:200});if("function"==typeof e)return"[Function]";if("symbol"==typeof e)return"[Symbol]";if("object"!=typeof e||null===e)return e;if(a.types.isProxy(e))return"[Proxy]";if(a.types.isDate(e))return"[Date]";if(fl(e))return"[Object]";if(i>=8)return"[...]";let n=e=>void 0===e?"[empty]":ol(e)?"[Getter/Setter]":Dl(e.value,t,i+1);if(Array.isArray(e)){let t=Math.min(e.length,50),i=[];for(let r=0;r<t;r++)i.push(n(Object.getOwnPropertyDescriptor(e,r)));return e.length>t&&i.push(`[${e.length-t} more]`),i}let r=Reflect.ownKeys(e),s={};for(let t of r.slice(0,50)){let i=Object.getOwnPropertyDescriptor(e,t),r="symbol"==typeof t?String(t):t;Object.defineProperty(s,i.enumerable?r:`${r} (non-enumerable)`,{value:n(i),enumerable:!0,writable:!0,configurable:!0})}return r.length>50&&Object.defineProperty(s,"[more]",{value:r.length-50,enumerable:!0,writable:!0,configurable:!0}),s}function xl(e,t){let i;try{i=Dl(t)}catch(e){i="(unprintable)"}Ml(e,i)}function Il(e){if("object"!=typeof e||null===e)return;let t=Object.getOwnPropertyDescriptor(e,"id");return void 0!==t&&t.enumerable&&!ol(t)?t.value:void 0}const bl=["mustExist","keepUserId"];function Cl(e,t){let i=e=>({err:e,mustExist:!1,keepUserId:!1});if(null==t)return{err:null,mustExist:!1,keepUserId:!1};if(!gl(t))return i("invalid opt of procOrm, need an object");for(let e of Reflect.ownKeys(t))if(bl.indexOf(e)<0)return i("invalid opt of procOrm, unsupported key");let n={mustExist:!1,keepUserId:!1};for(let e of bl){let r=Object.getOwnPropertyDescriptor(t,e);if(void 0!==r){if(ol(r)||"boolean"!=typeof r.value)return i(`invalid opt of procOrm, ${e} needs a boolean`);n[e]=r.value}}return n.mustExist&&"save"!==e&&"del"!==e?i("invalid opt of procOrm, mustExist supports only save and del"):n.keepUserId&&"insert"!==e?i("invalid opt of procOrm, keepUserId supports only insert"):{err:null,mustExist:n.mustExist,keepUserId:n.keepUserId}}async function vl(e,t){let i=[],n=new Set;for(let e of sl(t)?t:[t]){let t=Il(e);if(!("string"==typeof t&&""!==t||al(t)))return!0;n.has(String(t))||(n.add(String(t)),i.push(t))}for(let t=0;t<i.length;t+=1e3){let n=i.slice(t,t+1e3),r=await e.select({id:{$in:n}}),s=new Set(Yr(sl(r)?r:[],e=>String(ke(e,"id"))));if(n.some(e=>!s.has(String(e))))return!0}return!1}function Ll(e,t){return(sl(e)?e:[e]).some(e=>null!==e&&"object"==typeof e&&0!==e.ok&&(0===e.n||null!==t&&0===e[t]))}function El(e){let t=[],i=Array.isArray(e)?null:Object.keys(e),n=null===i?e.length:i.length;for(let r=0;r<n;r++){let n=Object.getOwnPropertyDescriptor(e,null===i?r:i[r]).value;null!==wl(n)&&t.push(n)}return t}function Al(e,t=1/0,i=!1){try{let n=new Set,r=[e,1],s=0,o=[];for(;r.length>0;){let e,c=r.pop(),l=r.pop();if(n.has(l))continue;if(i){if("object"==typeof l&&null!==l){if(!hl(l)||fl(l))return"irregular";if(a.types.isDate(l)){if(Reflect.ownKeys(l).length>0)return"irregular";continue}}e=wl(l)}else e=Array.isArray(l)?"arr":Ti(l)?"obj":null;if(null===e)continue;let u="arr"===e;if(c>t)return"deep";if(n.add(l),Object.prototype.hasOwnProperty.call(l,"__proto__"))return"proto";let p=u?null:Object.keys(l);if(i&&!u){if(!gl(l))return"irregular";if(Reflect.ownKeys(l).length!==p.length)return"hidden";o.push(l)}let d=u?l.length:p.length;for(let e=0;e<d;e++){let t=Object.getOwnPropertyDescriptor(l,u?e:p[e]);if(void 0===t)return i?"irregular":"sparse";if(ol(t))return"accessor";if(i&&u&&!t.enumerable)return"irregular";i&&(s+=u?0:p[e].length,"string"==typeof t.value&&(s+=t.value.length)),"object"==typeof t.value&&null!==t.value&&r.push(t.value,c+1)}if(i&&u&&Reflect.ownKeys(l).length!==d+1)return"irregular"}if(i&&"object"==typeof e&&null!==e){let i=function(e,t,i){let n=new Map,r=new Map,s=[{o:e,kids:El(e),i:0,d:0,n:Array.isArray(e)?0:1}];for(n.set(e,-1);s.length>0;){let e=s[s.length-1];if(s.length>t)return"deep";if(e.i<e.kids.length){let o=e.kids[e.i++],a=n.get(o);if(void 0===a)n.set(o,-1),s.push({o:o,kids:El(o),i:0,d:0,n:Array.isArray(o)?0:1});else{if(-1===a)return"deep";if(e.n+=a,e.d=Math.max(e.d,r.get(o)),e.n>i)return"large";if(s.length+r.get(o)>t)return"deep"}}else if(s.pop(),n.set(e.o,e.n),r.set(e.o,e.d+1),s.length>0){let n=s[s.length-1];if(n.n+=e.n,n.d=Math.max(n.d,e.d+1),n.n>i)return"large";if(s.length+r.get(e.o)>t)return"deep"}}return null}(e,t,1e5);if(null!==i)return i;if(s<=4e6&&"function"==typeof structuredClone){if(function(e){if("function"!=typeof structuredClone)return!1;let t;try{t=structuredClone(e)}catch(e){return!0}let i=new Set,n=[t];for(;n.length>0;){let e=n.pop();if("object"!=typeof e||null===e||i.has(e))continue;i.add(e);let t=Object.getPrototypeOf(e);if(t!==Date.prototype){if(t!==Object.prototype&&t!==Array.prototype)return!0;for(let t of Object.keys(e))n.push(e[t])}}return!1}(e))return"irregular"}else for(let e=0;e<o.length;e++)if(yl(o[e]))return"irregular"}return null}catch(e){return"unreadable"}}function Nl(e,t){try{if(void 0!==t&&"object"==typeof t&&null!==t&&a.types.isProxy(t))return`invalid find of ${e}, ${ul.irregular}`;if(void 0!==t&&!gl(t))return`invalid find of ${e}, need an object`;let i=Al(t,64,!0);return null!==i?`invalid find of ${e}, ${ul[i]}`:null}catch(t){return`invalid find of ${e}, ${ul.unreadable}`}}function Sl(e){return"function"==typeof e?!hl(e):"object"==typeof e&&null!==e&&(!hl(e)||fl(e))}function Tl(e,t){let i;try{i=Array.isArray(t)}catch(t){return`${e}, ${ul.irregular}`}if(!i)return null;if(!hl(t))return`${e}, ${ul.irregular}`;let n=function(e){for(let t=0;t<e.length;t++){let i=Object.getOwnPropertyDescriptor(e,t);if(void 0===i)return[t,"sparse"];if(ol(i))return[t,"accessor"]}return null}(t);return null!==n?il(`${e}, ${ul[n[1]]}`,[{k:n[0]}]):null}function kl(e,t){let i=new Map,n=(e,t)=>{i.has(e)||i.set(e,[]),i.get(e).push({k:t})};if(sl(t))for(let e=0;e<t.length;e++)try{let i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i)continue;if(ol(i)){n("accessor",e);continue}let r=Sl(i.value)?"irregular":Al(i.value);null!==r&&n(r,e)}catch(t){n("unreadable",e)}else{let e=Sl(t)?"irregular":Al(t);null!==e&&n(e,0)}return Yr([...i],([t,i])=>il(`${e}, ${ul[t]}`,i))}function jl(e){let t=!sl(e),i=Yr(t?[e]:e,e=>{let t=Il(e);return al(t)&&Ti(e)?function(e,t){let i={};for(let n of Reflect.ownKeys(e)){let r=Object.getOwnPropertyDescriptor(e,n);r.enumerable&&Object.defineProperty(i,n,"id"===n?{value:t,writable:!0,enumerable:!0,configurable:!0}:r)}return i}(e,cl(t)):e});return t?i[0]:i}function Zl(e){return"obj"!==wl(e)?e:ll(e,(e,t)=>{return"id"===t?"obj"!==wl(i=e)?cl(i):ll(i,(e,t)=>["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin"].indexOf(t)>=0?"arr"===wl(e)?Yr(e,cl):cl(e):e):["$and","$or"].indexOf(t)>=0&&"arr"===wl(e)?Yr(e,Zl):e;var i})}function zl(e){let t=[];return ar(sl(e)?e:[e],(e,i)=>{Sl(e)||Ti(e)||t.push({k:i})}),t}function Yl(e){let t=cl(Il(e));return Zi(t)?t:null}function Xl(e){let t=[];return ar(sl(e)?e:[e],(e,i)=>{let n=Il(e);Zi(n)&&el(n)!==n&&t.push({k:i,id:n})}),t}function Fl(e,t){return il(`${e}, id contains HTML markup`,Yr(t,e=>({k:e.k})))}function Gl(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ol(e,t,i,n,r="save",s=!1){if(!ki(e))throw console.log("ds",e),new Error("invalid ds");let o=e[t].keys,a=!1;rn(n)||(a=!0,n=[n]);let c=Xa();if(r.indexOf("insert")>=0&&(o.indexOf("userId")>=0&&ar(n,(e,t)=>{s&&function(e){if("object"!=typeof e||null===e)return!1;let t=Object.getOwnPropertyDescriptor(e,"userId");return void 0!==t&&t.enumerable&&!ol(t)&&"string"==typeof t.value&&""!==t.value}(n[t])||Gl(n[t],"userId",i)}),o.indexOf("timeCreate")>=0&&ar(n,(e,t)=>{Gl(n[t],"timeCreate",c)}),o.indexOf("userIdUpdate")>=0&&ar(n,(e,t)=>{Gl(n[t],"userIdUpdate",i)}),o.indexOf("timeUpdate")>=0&&ar(n,(e,t)=>{Gl(n[t],"timeUpdate",c)})),(r.indexOf("insert")>=0||r.indexOf("save")>=0)&&(o.indexOf("userIdUpdate")>=0&&ar(n,(e,t)=>{Gl(n[t],"userIdUpdate",i)}),o.indexOf("timeUpdate")>=0&&ar(n,(e,t)=>{Gl(n[t],"timeUpdate",c)})),n=Yr(n,e=>ll(e,e=>el(e))),nl(e[t],o)){(a?ki(n[0]):ln(n))&&ar(n,e=>{Zi(e.id)||(e.id=Ua())})}return n=a?n[0]:n}async function Wl(e,t,i,n,r,s,o){try{return await async function(e,t,i,n,r,s,o){let a,c=null;if(!ki(t))return Promise.reject("invalid woItems");let l=rl(t,n);if(null===l)return Promise.reject(`can not find table[${"string"==typeof n?n:""}] in ORM`);let u=function(e,t){let i=rl(e,t),n=ke(i,"keys",null);return!!rn(n)&&nl(i,n)}(e,n),p=Cl(r,o);if(null!==p.err)return Promise.reject(p.err);if("select"===r){let e=Nl("select",s);if(null!==e)return xl(`${n}.select invalid find`,s),Promise.reject(e);if(a=await l.select(u?Zl(s):s).catch(e=>{console.log(`${n}.select catch`,e),c="failed to select data"}),Zi(c))return Promise.reject(c)}else if("insert"===r||"save"===r){let t=s,o="insert"===r?"failed to insert data":"failed to save data",d=Tl(o,s);if(null!==d)return console.log(`${n}.${r} invalid batch container`),Promise.reject(d);let m=zl(s);if(Dt(m)>0)return console.log(`${n}.${r} data is not an object`,m),Promise.reject(il(`${o}, not an object`,m));let h=kl(o,s);if(Dt(h)>0)return console.log(`${n}.${r} data has unsupported key`,h),Promise.reject(ka(h,"; "));u&&(s=jl(s));let f=Xl(s);if(Dt(f)>0)return console.log(`${n}.${r} id changed by clearXSS`,f),Promise.reject(Fl(o,f));try{s=Ol(e,n,i,s,r,p.keepUserId)}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),c="failed to adjust data",Promise.reject(c)}if("save"===r&&p.mustExist){let e=await vl(l,s).catch(e=>{console.log(`${n}.save exist check catch`,e),c="failed to save data"});if(Zi(c))return Promise.reject(c);if(e)return console.log(`${n}.save row not found`),Promise.reject("rowNotFound")}if("insert"===r?a=await l.insert(s).catch(e=>{console.log(`${n}.insert catch`,e),c="failed to insert data"}):"save"===r&&(a=await(p.mustExist?l.save(s,{autoInsert:!1}):l.save(s)).catch(e=>{console.log(`${n}.save catch`,e),c="failed to save data"})),Zi(c))return Promise.reject(c);if("save"===r){let e=tl(a,s);if(Dt(e)>0)return console.log(`${n}.save fail`,e),Promise.reject(il("failed to save data",tl(a,t)));if(p.mustExist&&Ll(a,null))return console.log(`${n}.save row not found after check`),Promise.reject("rowNotFound")}a=rn(s)?Yr(s,e=>({id:e.id})):{id:s.id}}else if("del"===r){let e=Tl("failed to delete data",s);if(null!==e)return console.log(`${n}.del invalid batch container`),Promise.reject(e);if(u&&(s=jl(s)),p.mustExist){let e=function(e){let t=new Set,i=[],n=sl(e)?e:[e];for(let e=0;e<n.length;e++){let r=Il(n[e]);if(!("string"==typeof r&&""!==r||al(r)))continue;let s=String(r);t.has(s)?i.push({k:e}):t.add(s)}return i}(s);if(Dt(e)>0)return console.log(`${n}.del duplicate id`,e),Promise.reject(il("invalid input of del, duplicate id",e));let t=await vl(l,s).catch(e=>{console.log(`${n}.del exist check catch`,e),c="failed to delete data"});if(Zi(c))return Promise.reject(c);if(t)return console.log(`${n}.del row not found`),Promise.reject("rowNotFound")}if(a=await l.del(s).catch(e=>{console.log(`${n}.del catch`,e),c="failed to delete data"}),!Zi(c)){let e=tl(a,s);Dt(e)>0&&(console.log(`${n}.del fail`,e),c=il("failed to delete data",e))}!Zi(c)&&p.mustExist&&Ll(a,"nDeleted")&&(console.log(`${n}.del row not found after check`),c="rowNotFound")}else if("delAll"===r){let e=Nl("delAll",s);if(null!==e)return xl(`${n}.delAll invalid find`,s),Promise.reject(e);a=await l.delAll(u?Zl(s):s).catch(e=>{console.log(`${n}.delAll catch`,e),c="failed to delete data"})}else if("mix"===r){if("object"!=typeof s||null===s||!hl(s)||!ki(s))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let t={};for(let e of["add","del","diff"]){let i=Object.getOwnPropertyDescriptor(s,e);if(void 0!==i&&ol(i))return Promise.reject(`invalid input of mix, ${ul.accessor}`);t[e]=void 0===i?void 0:i.value}s=t;for(let e of["add","del","diff"])if(void 0!==s[e]&&!sl(s[e]))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let r=[];for(let[e,t]of[["add","failed to insert data"],["del","failed to delete data"],["diff","failed to update data"]]){let i=Tl(t,s[e]);null!==i&&r.push(i)}if(Dt(r)>0)return console.log(`${n}.mix invalid batch container`),Promise.reject(ka(r,"; "));let o=[];for(let[e,t]of[["add","failed to insert data"],["diff","failed to update data"]]){let i=zl(ke(s,e,[]));Dt(i)>0&&(console.log(`${n}.mix ${e} data is not an object`,i),o.push(il(`${t}, not an object`,i)))}if(Dt(o)>0)return Promise.reject(ka(o,"; "));let p=[];for(let[e,t]of[["add","failed to insert data"],["diff","failed to update data"]])p.push(...kl(t,ke(s,e,[])));if(Dt(p)>0)return console.log(`${n}.mix data has unsupported key`,p),Promise.reject(ka(p,"; "));let d=function(e){let t=[];return ar(e,(e,i)=>{if("object"==typeof e&&null!==e||"function"==typeof e)if(hl(e)){if("function"!=typeof e)for(let n=e;null!==n;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,"id");if(void 0!==r)return void(n===e&&!ol(r)&&r.enumerable||t.push({k:i}))}}else t.push({k:i})}),t}(ke(s,"del",[]));if(Dt(d)>0)return console.log(`${n}.mix del id is not an own data property`,d),Promise.reject(il(`failed to delete data, ${ul.irregular}`,d));if(u){s={...s};for(let e of["add","del","diff"])rn(s[e])&&(s[e]=jl(s[e]))}let m=[];for(let[e,t]of[["add","failed to insert data"],["diff","failed to update data"]]){let i=Xl(ke(s,e,[]));Dt(i)>0&&(console.log(`${n}.mix ${e} id changed by clearXSS`,i),m.push(Fl(t,i)))}if(Dt(m)>0)return Promise.reject(ka(m,"; "));let h,f=function(e){let t=[];for(let[i,n]of[["add","del"],["del","diff"]]){let r=new Map;ar(ke(e,i,[]),(e,t)=>{let i=Yl(e);null!==i&&r.set(i,[...r.get(i)||[],t])});let s=[],o=[];if(ar(ke(e,n,[]),(e,t)=>{let i=Yl(e);null!==i&&r.has(i)&&(s=[...s,...r.get(i)],o.push(t))}),Dt(o)>0){let e=[...Yr([...new Set(s)].sort((e,t)=>e-t),e=>({ref:`${i}[${e}]`})),...Yr(o,e=>({ref:`${n}[${e}]`}))];t.push(il(`invalid input of mix, same id in ${i} and ${n}`,e))}}return t}(s);if(Dt(f)>0)return console.log(`${n}.mix same id across steps`,f),Promise.reject(ka(f,"; "));a=[];let g=[],w=null;if(Dt(ke(s,"diff",[]))>0)try{w=Ol(e,n,i,ke(s,"diff",[]))}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),c="failed to adjust data",Promise.reject(c)}let y=ke(s,"add",[]);if(Dt(y)>0){try{y=Ol(e,n,i,y,"insert+save")}catch(e){return console.log(`${n}.adjustData catch`,e.toString()),c="failed to adjust data",Promise.reject(c)}if(await l.insert(y).catch(e=>{console.log(`${n}.insert catch`,e),c="failed to insert data"}),Zi(c))return Promise.reject(c);h=Yr(y,e=>({id:e.id})),a=[...a,...h]}let M=ke(s,"del",[]);if(Dt(M)>0){let e=await l.del(M).catch(e=>{console.log(`${n}.del catch`,e),c="failed to delete data"});if(Zi(c))return Promise.reject(c);let t=tl(e,M);Dt(t)>0&&(console.log(`${n}.del fail`,t),g.push(il("failed to delete data",t))),h=Yr(M,e=>({id:e.id})),a=[...a,...h]}let D=ke(s,"diff",[]);if(Dt(D)>0){let e=D;D=w;let t=await l.save(D).catch(e=>{console.log(`${n}.save catch`,e),c="failed to update data"});if(Zi(c))return Promise.reject(c);let i=tl(t,D);Dt(i)>0&&(console.log(`${n}.save fail`,i),g.push(il("failed to update data",tl(t,e)))),h=Yr(D,e=>({id:e.id})),a=[...a,...h]}if(Dt(g)>0)return Promise.reject(ka(g,"; "))}else c=`invalid mode: ${r}`;if(Zi(c))return Promise.reject(c);return a}(e,t,i,n,r,s,o)}catch(e){return"string"==typeof e?Promise.reject(e):(Ml(`${"string"==typeof n?n:""}.${"string"==typeof r?r:""} mapOrm catch`,e),Promise.reject("failed to process input"))}}function Pl(e,t){return async(i,n,r,s,o)=>Wl(e,t,i,n,r,s,o)}function Kl(e,t,i,n=!1){if(!Mn(t)){let r=`${i} needs a function, but got ${typeof t}`;throw n&&e.push(()=>Promise.reject(r)),new Error(r)}setTimeout(()=>{e.push(t)},1)}function Hl(e,t={}){if(ua(t),!Mn(e))throw new Error("invalid mapOrm");let i={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:e};return{addFunCheck:e=>{Kl(i.funChecks,e,"addFunCheck",!0)},addFunPreProcessing:e=>{Kl(i.funPreProcessing,e,"addFunPreProcessing")},addFunPostProcessing:e=>{Kl(i.funPostProcessing,e,"addFunPostProcessing")},procOrm:async(e,t,n,r,s)=>async function(e,t,i,n,r,s){let o=Cl(n,s);if(null!==o.err)return Promise.reject(o.err);await ca(e.funChecks,e=>e({woName:i,userId:t,mode:n,input:r}));for(let s of[...e.funPreProcessing]){let e=await s({woName:i,userId:t,mode:n,input:r});if(!ki(e)||void 0===e.input)return Promise.reject("invalid return of pre-processing, need an object with input");r=e.input}let a=await e.mapOrm(t,i,n,r,s);for(let s of[...e.funPostProcessing])a=await s({woName:i,userId:t,mode:n,input:r,output:a});return a}(i,e,t,n,r,s)}}function Ul(e,t,i,n,r={}){ua(r);let s=function(e,t,i,n){if(!ki(e))throw console.log("ds",e),new Error("invalid ds");if(!Mn(t))throw console.log("WOrm",t),new Error("invalid WOrm");if(!Zi(i))throw console.log("url",i),new Error("invalid url");if(!Zi(n))throw console.log("db",n),new Error("invalid db");let r={};return ar(Bt(e),e=>{let s=new t({url:i,db:n,cl:e});Object.defineProperty(r,e,{value:s,enumerable:!0,writable:!0,configurable:!0})}),r}(e,t,i,n),o=Hl(Pl(e,s),r),a=la(),c=async(e,t)=>{let i=function(e,t,i){if(!Array.isArray(t)||0===t.length)throw new Error("invalid tableNames of withTabLocks, need a non-empty array of table names");for(let i of t)if("string"!=typeof i||!Object.prototype.hasOwnProperty.call(e,i))throw new Error("invalid tableNames of withTabLocks, need own table names of this instance");if(!Mn(i))throw new Error("invalid fn of withTabLocks, need a function");return[...new Set(t)].sort()}(s,e,t),n=t;for(let e=i.length-1;e>=0;e--){let t=n,r=i[e];n=()=>a(r,t)}return n()};return{...Sa,woItems:s,closeAll:async()=>{await ca(s,async e=>{e&&Mn(e.close)&&await e.close()})},withTabLocks:c,guardWrite:async e=>{if(null===e||"object"!=typeof e)throw new Error("invalid input of guardWrite, need an object");let{tables:t,read:i,baseline:n,contract:r,write:s}=e;if(!Mn(i))throw new Error("invalid read of guardWrite, need a function");if(!Mn(s))throw new Error("invalid write of guardWrite, need a function");let o=void 0!==n;if((o||void 0!==r)&&(Ma(r),"string"==typeof r.table&&!(Array.isArray(t)&&t.indexOf(r.table)>=0)))throw new Error("invalid tables of guardWrite, need to contain contract.table");return c(t,async()=>{let e=await i();if(!Array.isArray(e))throw new Error("invalid rows of guardWrite, read needs to resolve an array");if(o){let t=Aa(e,n,r);if(!t.ok)throw function(e){let t=new Error(e.reason);return t.key=e.reason,t.added=e.added,t.removed=e.removed,t.changed=e.changed,t.reordered=e.reordered,t}(t)}return await s(e)})},...o}}function Bl(e,t,i=""){if(!ln(t))return{};let n={};return ar(t,function(t){n[t]=ke(e,t,i)}),n}let Vl={id:{pk:!0,name:"主鍵",type:"STRING"},ip:{name:"IP",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"}},_l={id:{pk:!0,name:"主鍵",type:"STRING"},token:{name:"金鑰",type:"STRING"},userId:{name:"使用者主鍵",type:"STRING"},isApp:{name:"是否為應用系統",type:"STRING"},perms:{name:"應用系統權限",type:"TEXT"},timeCreate:{name:"創建時間",type:"STRING"},timeEnd:{name:"到期時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"}},Rl={id:{pk:!0,name:"主鍵",type:"STRING"},order:{name:"順序",type:"INTEGER"},account:{name:"帳號",type:"STRING"},password:{name:"密碼",type:"STRING"},name:{name:"姓名",type:"STRING"},email:{name:"電子郵件",type:"STRING"},description:{name:"描述",type:"TEXT"},from:{name:"來源",type:"STRING"},redir:{name:"登入後轉址",type:"STRING"},isAdmin:{name:"是否為系統管理員",type:"STRING"},tokenVerify:{name:"註冊後驗證用token",type:"STRING"},timeVerified:{name:"驗證時間",type:"STRING"},timeExpired:{name:"過期時間",type:"STRING"},timeBlocked:{name:"封鎖時間",type:"STRING"},isForceChangePw:{name:"是否須強制變更密碼",type:"STRING"},userId:{name:"創建使用者主鍵",type:"STRING"},timeCreate:{name:"創建時間",type:"STRING"},userIdUpdate:{name:"最新變更使用者主鍵",type:"STRING"},timeUpdate:{name:"更新時間",type:"STRING"},isActive:{name:"是否有效",type:"STRING"}};function Ql(e,t={}){let i=ke(t,"useCreateStorage");Bi(i)||(i=!1);let{keyTable:n,tableNameCht:r,tableNameEng:s,settings:o,parser:a,funNew:c,funTest:l,ext:u}=e;if(!Zi(n))throw new Error(`invalid keyTable[${n}]`);if(Zi(r)||(r=n),Zi(s)||(s=n),!ki(o))throw new Error("invalid settings");ki(u)||(u=null),ki(a)||(a=null),Mn(c)||(c=null);let p=null;Mn(l)&&(p=async e=>{if(!ki(e))throw new Error("invalid wo");if(!sr(e,n))throw console.log(e),new Error(`keyTable[${n}] is not in wo`);let t=[];try{t=l(),vn(t)&&(t=await t)}catch(e){throw console.log(`keyTable[${n}] funTest catch`,e),new Error(e)}if(0===Dt(t))return;i&&await e[n].createStorage();let r=tl(await e[n].save(t),t);if(Dt(r)>0)throw new Error(`failed to write test data into table[${n}]: ${JSON.stringify(r)}`);return t});let d={},m={};return ar(Bt(o),e=>{let t=ke(o,`${e}.name`,"");Zi(t)&&(d[e]=t);let i=ke(o,`${e}.type`,"");Zi(i)&&(m[e]=i)}),{...e,keyTable:n,tableNameCht:r,tableNameEng:s,settings:o,keys:Bt(o),kpType:m,kpHead:d,parser:a,funNew:c,funTest:l,funTestAndSave:p,ext:u}}let Jl={ips:{keyTable:"ips",tableNameCht:"IP使用者",tableNameEng:"IPs",settings:Vl,funNew:(e={})=>{let t=Bl(e,Bt(Vl));return t.id=`${Ua()}`,t},funTest:()=>[]},tokens:{keyTable:"tokens",tableNameCht:"金鑰",tableNameEng:"Tokens",settings:_l,funNew:(e={})=>{let t=Bl(e,Bt(_l));return t.id=`${Ua()}`,t.token=`${Ua()}`,rn(t.perms)||(t.perms=[]),t.timeCreate=Xa(),t.timeEnd=Tr().add(30,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),t.timeUpdate=t.timeCreate,t},funTest:()=>[]},users:{keyTable:"users",tableNameCht:"使用者",tableNameEng:"Users",settings:Rl,funNew:(e={})=>{let t=Bl(e,Bt(Rl));return t.id=`${Ua()}`,t.timeCreate=Xa(),t.userIdUpdate=t.userId,t.timeUpdate=t.timeCreate,t.isActive="y","y"!==t.isForceChangePw&&"n"!==t.isForceChangePw&&(t.isForceChangePw="n"),t},funTest:()=>[]}},$l={};for(let e in Jl)$l[e]=Ql(Jl[e],{useCreateStorage:!1});function ql(e){let t;return t=In(e,1),"Z"===t?`${e=bn(e,1)}+00:00`:e}let eu={checkTZ:function(e){let t;return t=In(e,1),"Z"===t||(t=In(e,6),!!/[+|-]\d\d:\d\d/.test(t))},delTZ:function(e){let t;return t=In(e,1),bn(e,"Z"===t?1:6)},normTZ:ql,sepTZ:function(e){let t=ql(e);return{t:bn(t,6),tz:In(t,6)}}};function tu(e){if(!Zi(e))return!1;if(!eu.checkTZ(e))return!1;let t=eu.delTZ(e),i="YYYY-MM-DDTHH:mm:ss.SSS";return t===Tr(t,i).format(i)}function iu(e){let t=ke(e,"timeExpired","");return!!tu(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=t}function nu(e){let t=ke(e,"timeBlocked","");return!!tu(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}function ru(e){return"y"===ke(e,"isActive","")}function su(e){let t=tu(ke(e,"timeVerified",""));let i=!iu(e),n=!nu(e),r=function(e){return"y"===ke(e,"isAdmin","")}(e),s=ru(e);return t&&i&&n&&r&&s}let ou="w-syslog/src/formatter.mjs";function au(i={}){let n=i.fpSelf,r=i.cwd,s=[],o=e.dirname(e.dirname(n)),a=e.join(o,"src","formatter.mjs");if((i=>{try{return"w-syslog"===JSON.parse(t.readFileSync(e.join(i,"package.json"),"utf8")).name}catch(e){return!1}})(o)&&t.existsSync(a))return{fp:a,by:"pkgRoot"};s.push(`package root of ${n}`);try{return{fp:u.createRequire(n).resolve(ou),by:"resolveFromSelf"}}catch(e){s.push(`resolve from ${n}`)}try{return{fp:u.createRequire(e.join(r,"index.js")).resolve(ou),by:"resolveFromCwd"}}catch(e){s.push(`resolve from ${r}`)}throw new Error(`w-syslog: can not resolve transport target ${ou}, tried: ${s.join("; ")}. When bundling, keep w-syslog installed and list "pino" in external`)}let cu="",lu="wsyslogFormatterError",uu=e=>{try{return t.statSync(e).isDirectory()}catch(e){return!1}};function pu(i={}){let n=Fn(),r=ke(i,"timeZone",null),s=ke(i,"fdLog");Zi(s)||(s="./_logs");let o=ke(i,"interval");"day"!==o&&"hr"!==o&&(o="day");let a=ke(i,"numKeep");if(nn(a)||(a="day"===o?365:8760),a=tn(a),"function"!=typeof l.transport)throw new Error('w-syslog: pino.transport is not a function, pino seems to be bundled as its browser build; list "pino" in external when bundling');if(Zi(r))try{Intl.DateTimeFormat("en-US",{timeZone:r})}catch(e){throw new Error(`w-syslog: invalid timeZone[${r}]`)}let u=e.resolve(s);if(vr(u),!uu(u))throw new Error(`w-syslog: can not create fdLog[${s}]`);let p=(""===cu&&(cu=au({fpSelf:c.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:N&&"SCRIPT"===N.tagName.toUpperCase()&&N.src||new URL("w-web-sso.umd.js",document.baseURI).href),cwd:process.cwd()}).fp),cu),d=l.transport({targets:[{level:"info",target:c.pathToFileURL(p).href,options:{interval:o,fdLog:u,timeZone:r}}]});d.unref();let m=!1,h=e=>{try{n.emit("writeError",e)}catch(e){}},f=e=>{m=!0,console.error("w-syslog transport error:",e),h(e)},g=e=>{let t=new Error(ke(e,"message","w-syslog formatter error"));t.code=ke(e,"code"),t.syscall=ke(e,"syscall"),t.path=ke(e,"path"),h(t)};d.on("error",f),d.on(lu,g);let w=()=>{d.off("error",f),d.off(lu,g)},y=l(d),M=()=>{try{if(!uu(u))return;let i="hr"===o?/^\d{4}-\d{2}-\d{2}T\d{2}\.log$/:/^\d{4}-\d{2}-\d{2}\.log$/,r=t.readdirSync(u).filter(e=>i.test(e));r.sort();let c=r.length-a;if(c<=0)return;let l=r.slice(0,c);for(let i of l){let r=e.join(s,i);try{t.unlinkSync(e.join(u,i)),n.emit("delete",{fp:r,fn:i})}catch(e){}}}catch(e){console.error("WSyslog cleanLogs error:",e)}},D=setImmediate(()=>{D=null,M()}),x=setInterval(M,36e5);x.unref();let I=null,b=e=>{let t=y[e].bind(y);return(...i)=>{try{n.emit(e,{args:i})}catch(e){}m||t(...i)}};return n.fatal=b("fatal"),n.error=b("error"),n.warn=b("warn"),n.info=b("info"),n.debug=b("debug"),n.trace=b("trace"),n.cleanLogs=M,n.clear=(e={})=>{if(null!==I)return I;null!==D&&(clearImmediate(D),D=null),clearInterval(x);let t=ke(e,"timeLimit");nn(t)||(t=6e4),I=Cn();let i=!1,n=()=>{i||(i=!0,d.closed?setImmediate(w):d.once("close",()=>{setImmediate(w)}),I.resolve())},r=setTimeout(()=>{console.error("w-syslog clear: timeout, worker terminated, some logs may be lost");try{d.worker.terminate()}catch(e){}n()},t);try{if(d.closed||d.destroyed)return clearTimeout(r),n(),I;d.once("close",()=>{clearTimeout(r),n()}),d.end()}catch(e){clearTimeout(r),n()}return I},n}function du(e){if(rn(e))return e.map(du);if(null==e||""===e)return"";if(!Zi(e))return`(${typeof e})`;let t=null;try{t=new URL(e)}catch(e){return"(invalid-url)"}return"http:"!==t.protocol&&"https:"!==t.protocol?t.protocol:`${t.origin}${t.pathname}`}function mu(e){return Array.from(e,e=>{let t=e.charCodeAt(0);return t<32||127===t?"?":e}).join("")}function hu(e){if(rn(e))return e.map(hu);if(null==e||""===e)return"";if(!Zi(e))return`(${typeof e})`;let t=e.length,i=Math.min(4,Math.floor(t/8));return 0===i?`(len=${t})`:`${mu(e.slice(0,i))}...${mu(e.slice(-i))}(len=${t})`}let fu=["id","account","email","name"];function gu(e){if(!Zi(e))return e;let t=mu(e);return t.length>256?`${t.slice(0,256)}...(len=${t.length})`:t}function wu(e,t){return Zi(e)&&fu.includes(e)?gu(t):hu(t)}var yu,Mu,Du={exports:{}},xu={},Iu={exports:{}},bu={},Cu={},vu={};function Lu(){if(yu)return vu;yu=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.toUnicode=vu.toASCII=vu.encode=vu.decode=vu.ucs2=vu.version=void 0;const e=2147483647,t=36,i=/^xn--/,n=/[^\0-\x7F]/,r=/[\x2E\u3002\uFF0E\uFF61]/g,s={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},o=Math.floor,a=String.fromCharCode;function c(e){throw new RangeError(s[e])}function l(e,t){const i=e.split("@");let n="";i.length>1&&(n=i[0]+"@",e=i[1]);const s=function(e,t){const i=[];let n=e.length;for(;n--;)i[n]=t(e[n]);return i}((e=e.replace(r,".")).split("."),t).join(".");return n+s}function u(e){const t=[];let i=0;const n=e.length;for(;i<n;){const r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}const p=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},d=function(e,t){return e+22+75*Number(e<26)-(Number(0!=t)<<5)},m=function(e,i,n){let r=0;for(e=n?o(e/700):e>>1,e+=o(e/i);e>455;r+=t)e=o(e/35);return o(r+36*e/(e+38))},h=function(i){const n=[],r=i.length;let s=0,a=128,l=72,u=i.lastIndexOf("-");u<0&&(u=0);for(let e=0;e<u;++e)i.charCodeAt(e)>=128&&c("not-basic"),n.push(i.charCodeAt(e));for(let d=u>0?u+1:0;d<r;){const u=s;for(let n=1,a=t;;a+=t){d>=r&&c("invalid-input");const u=p(i.charCodeAt(d++));u>=t&&c("invalid-input"),u>o((e-s)/n)&&c("overflow"),s+=u*n;const m=a<=l?1:a>=l+26?26:a-l;if(u<m)break;const h=t-m;n>o(e/h)&&c("overflow"),n*=h}const h=n.length+1;l=m(s-u,h,0==u),o(s/h)>e-a&&c("overflow"),a+=o(s/h),s%=h,n.splice(s++,0,a)}return String.fromCodePoint(...n)};vu.decode=h;const f=function(i){const n=[],r=u(i),s=r.length;let l=128,p=0,h=72;for(const e of r)e<128&&n.push(a(e));const f=n.length;let g=f;for(f&&n.push("-");g<s;){let i=e;for(const e of r)e>=l&&e<i&&(i=e);const s=g+1;i-l>o((e-p)/s)&&c("overflow"),p+=(i-l)*s,l=i;for(const i of r)if(i<l&&++p>e&&c("overflow"),i===l){let e=p;for(let i=t;;i+=t){const r=i<=h?1:i>=h+26?26:i-h;if(e<r)break;const s=e-r,c=t-r;n.push(a(d(r+s%c,0))),e=o(s/c)}n.push(a(d(e,0))),h=m(p,s,g===f),p=0,++g}++p,++l}return n.join("")};vu.encode=f;vu.toUnicode=function(e){return l(e,function(e){return i.test(e)?h(e.slice(4).toLowerCase()):e})};return vu.toASCII=function(e){return l(e,function(e){return n.test(e)?"xn--"+f(e):e})},vu.version="2.3.1",vu.ucs2={decode:u,encode:e=>String.fromCodePoint(...e)},vu}function Eu(){if(Mu)return Cu;Mu=1;var e,t=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=jn&&jn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var s=e(n),o=0;o<s.length;o++)"default"!==s[o]&&t(r,n,s[o]);return i(r,n),r}),r=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.resolve=Cu.parse=void 0;const s=r(d),o=r(m),a=n(Lu()),c=/^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/,l=/^[\x00-\x20]+|[\x00-\x20]+$/g,u=/^[\x00-\x20\u00a0\ufeff]+/,p=/^([a-zA-Z0-9+.-]+:)?[\\/]{2}([^\\/?#]*)/,h=/[\x00-\x20#/:<>?@[\\\]^|\x7f]/,f=/[\x00-\x1f\x7f]/;function g(e,t,i,n){const r=o.default.parse(e,t,n),c=p.exec(e.replace(u,""));if(c&&(c[1]||null!==r.hostname)){const e=c[2].slice(c[2].lastIndexOf("@")+1);if(!e||f.test(e)||(r.host||"").toLowerCase()!==a.toASCII(e.toLowerCase()))throw i;if("["===e.charAt(0)&&!s.default.isIPv6(e.slice(1,e.indexOf("]"))))throw i}else if(null!==r.hostname)throw i;const l=null===r.auth||void 0===r.auth?null:r.auth.split(":"),d=r;return d.username=l?l.shift():null,d.password=l&&l.length?l.join(":"):null,d}function w(e){try{return decodeURIComponent(e)}catch(t){return e}}function y(e,t){const i=e||"";if(!i)return"";if("["===i.charAt(0)&&"]"===i.charAt(i.length-1))return i.slice(1,-1);const n=w(i),r=h.test(n)?"":o.default.domainToASCII(n);if(!r)throw function(e){const t=new TypeError("Invalid URL");return t.code="ERR_INVALID_URL",t.input=e,t}(t);return r}Cu.parse=(e,t)=>{e=(e||"").replace(l,"");const i=c.exec(e),n=i?i[1]+"//"+i[2]:e;let r;try{r=new URL(n)}catch(e){return g(n,t,e)}const s=y(r.hostname,r.href),o=r.port||null,a=r.pathname||null,u=r.search||null;let p,d=null,m=null,h=null;if((r.username||r.password)&&(m=w(r.username),h=r.password?w(r.password):null,d=m+(null!==h?":"+h:"")),t){const e=Object.create(null);r.searchParams.forEach((t,i)=>{if(Object.prototype.hasOwnProperty.call(e,i)){const n=e[i];Array.isArray(n)?n.push(t):e[i]=[n,t]}else e[i]=t}),p=e}else p=u?u.slice(1):null;return{protocol:r.protocol||null,host:r.host||null,hostname:s,port:o,pathname:a,search:u,path:(a||"")+(u||"")||null,href:r.href,auth:d,username:m,password:h,query:p}};return Cu.resolve=(e,t)=>{try{return new URL(t,e).href}catch(i){return g(e,!1,i,!0),g(t,!1,i,!0),o.default.resolve(e,t)}},Cu}var Au,Nu={exports:{}},Su={exports:{}};var Tu,ku={};function ju(){return Tu||(Tu=1,Object.defineProperty(ku,"__esModule",{value:!0}),ku.homepage=ku.version=ku.name=void 0,ku.name="nodemailer",ku.version="10.0.13",ku.homepage="https://nodemailer.com/"),ku}var Zu,zu={};function Yu(){return Zu||(Zu=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.EFETCH=zu.EURLACCESS=zu.EFILEACCESS=zu.EPROXY=zu.ECONFIG=zu.ESES=zu.ESENDMAIL=zu.EMAXRECIPIENTS=zu.EMAXLIMIT=zu.EOAUTH2=zu.ENOAUTH=zu.EAUTH=zu.ESTREAM=zu.EMESSAGE=zu.EENVELOPE=zu.EPROTOCOL=zu.EREQUIRETLS=zu.ETLS=zu.EDNS=zu.ESOCKET=zu.ETIMEDOUT=zu.ECONNECTION=zu.ERROR_CODES=void 0,zu.ERROR_CODES={ECONNECTION:"Connection closed unexpectedly",ETIMEDOUT:"Connection or operation timed out",ESOCKET:"Socket-level error",EDNS:"DNS resolution failed",ETLS:"TLS handshake or STARTTLS failed",EREQUIRETLS:"REQUIRETLS not supported by server (RFC 8689)",EPROTOCOL:"Invalid SMTP server response",EENVELOPE:"Invalid mail envelope (sender or recipients)",EMESSAGE:"Message delivery error",ESTREAM:"Stream processing error",EAUTH:"Authentication failed",ENOAUTH:"Authentication credentials not provided",EOAUTH2:"OAuth2 token generation or refresh error",EMAXLIMIT:"Pool resource limit reached (max messages per connection)",EMAXRECIPIENTS:"Recipient count exceeds maxRecipients",ESENDMAIL:"Sendmail command error",ESES:"AWS SES transport error",ECONFIG:"Invalid configuration",EPROXY:"Proxy connection error",EFILEACCESS:"File access rejected (disableFileAccess is set)",EURLACCESS:"URL access rejected (disableUrlAccess is set)",EFETCH:"HTTP fetch error"},zu.ECONNECTION="ECONNECTION",zu.ETIMEDOUT="ETIMEDOUT",zu.ESOCKET="ESOCKET",zu.EDNS="EDNS",zu.ETLS="ETLS",zu.EREQUIRETLS="EREQUIRETLS",zu.EPROTOCOL="EPROTOCOL",zu.EENVELOPE="EENVELOPE",zu.EMESSAGE="EMESSAGE",zu.ESTREAM="ESTREAM",zu.EAUTH="EAUTH",zu.ENOAUTH="ENOAUTH",zu.EOAUTH2="EOAUTH2",zu.EMAXLIMIT="EMAXLIMIT",zu.EMAXRECIPIENTS="EMAXRECIPIENTS",zu.ESENDMAIL="ESENDMAIL",zu.ESES="ESES",zu.ECONFIG="ECONFIG",zu.EPROXY="EPROXY",zu.EFILEACCESS="EFILEACCESS",zu.EURLACCESS="EURLACCESS",zu.EFETCH="EFETCH"),zu}var Xu,Fu,Gu,Ou={};function Wu(){return Xu||(Xu=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.copyOwnKeys=e.isProtoKey=void 0;e.isProtoKey=e=>"__proto__"===e;e.copyOwnKeys=(t,i,n)=>(Object.keys(i||{}).forEach(r=>{(0,e.isProtoKey)(r)||n&&n(r)||(t[r]=i[r])}),t)}(Ou)),Ou}function Pu(){return Fu||(Fu=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(g),c=o(w),l=s(Eu()),u=o(y),p=M,m=o((Au||(Au=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(d),c=s(Eu());t.default=class{constructor(e){this.options=e||{},this.cookies=[]}set(e,t){const i=c.parse(t||""),n=this.parse(e);let r;return n.domain?(r=n.domain.replace(/^\./,""),(i.hostname.length<r.length||r.indexOf(".")<0||r.endsWith(".")||a.default.isIP(i.hostname)||!("."+i.hostname).endsWith("."+r))&&(n.domain=i.hostname)):n.domain=i.hostname,n.path||(n.path=this.getPath(i.pathname)),n.expires||(n.expires=new Date(Date.now()+1e3*(Number(this.options.sessionTimeout||1800)||1800))),this.add(n)}get(e){return this.list(e).map(e=>e.name+"="+e.value).join("; ")}list(e){const t=[];for(let i=this.cookies.length-1;i>=0;i--){const n=this.cookies[i];this.isExpired(n)?this.cookies.splice(i,1):this.match(n,e)&&t.unshift(n)}return t}parse(e){const t={};return(e||"").toString().split(";").forEach(e=>{const i=e.split("="),n=i.shift().trim().toLowerCase();let r,s=i.join("=").trim();if(n)switch(n){case"expires":{const e=new Date(s);"Invalid Date"!==e.toString()&&(t.expires=e);break}case"path":t.path=s;break;case"domain":r=s.toLowerCase(),r.length&&"."!==r.charAt(0)&&(r="."+r),t.domain=r;break;case"max-age":t.expires=new Date(Date.now()+1e3*(Number(s)||0));break;case"secure":t.secure=!0;break;case"httponly":t.httponly=!0;break;default:t.name||(t.name=n,t.value=s)}}),t}match(e,t){const i=c.parse(t||"");if(i.hostname!==e.domain&&("."!==e.domain.charAt(0)||("."+i.hostname).substr(-e.domain.length)!==e.domain))return!1;const n=i.pathname||"/",r=e.path;return!(n!==r&&(!n.startsWith(r)||!r.endsWith("/")&&"/"!==n.charAt(r.length))||e.secure&&"https:"!==i.protocol)}add(e){if(!e||!e.name)return!1;for(let t=0,i=this.cookies.length;t<i;t++)if(this.compare(this.cookies[t],e))return this.isExpired(e)?(this.cookies.splice(t,1),!1):(this.cookies[t]=e,!0);return this.isExpired(e)||this.cookies.push(e),!0}compare(e,t){return e.name===t.name&&e.path===t.path&&e.domain===t.domain&&e.secure===t.secure&&e.httponly===t.httponly}isExpired(e){return e.expires&&e.expires<new Date||!e.value}getPath(e){const t=(e||"/").split("/");t.pop();const i=t.join("/").trim();return"/"!==i.charAt(0)?"/":i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Su,Su.exports)),Su.exports)),h=s(ju()),f=o(d),D=s(Yu()),x=Wu(),I=["ALPNProtocols","ca","cert","checkServerIdentity","ciphers","crl","dhparam","ecdhCurve","honorCipherOrder","key","maxVersion","minVersion","passphrase","pfx","rejectUnauthorized","secureContext","secureOptions","secureProtocol","servername","sessionIdContext","sigalgs"];function b(e){let t;try{t=l.parse(e)}catch(e){return!1}return("http:"===t.protocol||"https:"===t.protocol)&&t}function C(e,t){(t=t||{}).fetchRes=t.fetchRes||new p.PassThrough,t.cookies=t.cookies||new m.default,t.redirects=t.redirects||0,t.maxRedirects=isNaN(t.maxRedirects)?5:t.maxRedirects;const i=t.fetchRes,n=b(e);if(!n)return t.body&&"function"==typeof t.body.destroy&&(t.body.on("error",()=>!1),t.body.destroy()),setImmediate(()=>{const t=new Error("Unsupported protocol for URL "+e);t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i;t.cookie&&([].concat(t.cookie||[]).forEach(i=>{t.cookies.set(i,e)}),t.cookie=!1);let r,s,o=(t.method||"").toString().trim().toUpperCase()||"GET",d=!1;const g="https:"===n.protocol?c.default:a.default,w={"accept-encoding":"gzip,deflate","user-agent":"nodemailer/"+h.version};if(Object.keys(t.headers||{}).forEach(e=>{(0,x.isProtoKey)(e.toLowerCase().trim())||(w[e.toLowerCase().trim()]=t.headers[e])}),t.userAgent&&(w["user-agent"]=t.userAgent),n.auth&&(w.Authorization="Basic "+Buffer.from(n.auth).toString("base64")),(r=t.cookies.get(e))&&(w.cookie=r),t.body){if(!1!==t.contentType&&(w["Content-Type"]=t.contentType||"application/x-www-form-urlencoded"),"function"==typeof t.body.pipe)w["Transfer-Encoding"]="chunked",s=t.body,s.on("error",t=>{d||(d=!0,t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t))});else{if(t.body instanceof Buffer)s=t.body;else if("object"==typeof t.body)try{s=Buffer.from(Object.keys(t.body).map(e=>{const i=t.body[e].toString().trim();return encodeURIComponent(e)+"="+encodeURIComponent(i)}).join("&"))}catch(t){return d=!0,t.code=D.EFETCH,t.sourceUrl=e,setImmediate(()=>i.emit("error",t)),i}else s=Buffer.from(t.body.toString().trim());w["Content-Type"]=t.contentType||"application/x-www-form-urlencoded",w["Content-Length"]=s.length}o=(t.method||"").toString().trim().toUpperCase()||"POST"}let y;const M={method:o,host:n.hostname,path:n.path,port:n.port?n.port:"https:"===n.protocol?443:80,headers:w,rejectUnauthorized:!0,agent:!1};t.tls&&Object.keys(t.tls).forEach(e=>{I.includes(e)&&(M[e]=t.tls[e])}),"https:"!==n.protocol||!n.hostname||n.hostname===M.host||f.default.isIP(n.hostname)||M.servername||(M.servername=n.hostname);try{y=g.request(M)}catch(t){return d=!0,setImmediate(()=>{t.code=D.EFETCH,t.sourceUrl=e,i.emit("error",t)}),i}const v=(t,n=e)=>{d||(d=!0,t.code=D.EFETCH,t.sourceUrl=n,i.emit("error",t),y.abort())},L="number"==typeof t.timeout&&t.timeout>=0?t.timeout:6e4;return L&&y.setTimeout(L,()=>v(new Error("Request Timeout"))),y.on("error",e=>v(e)),y.on("response",r=>{let s;if(d)return;switch(r.headers["content-encoding"]){case"gzip":case"deflate":s=u.default.createUnzip()}if(r.headers["set-cookie"]&&[].concat(r.headers["set-cookie"]||[]).forEach(i=>{t.cookies.set(i,e)}),[301,302,303,307,308].includes(r.statusCode)&&r.headers.location){if(t.redirects++,t.redirects>t.maxRedirects)return v(new Error("Maximum redirect count exceeded"));let i;t.method="GET",t.body=!1;try{i=l.resolve(e,r.headers.location)}catch(e){i=r.headers.location}const s=b(i);if(!s)return v(new Error("Unsupported protocol for URL "+i),i);const o=s.hostname!==n.hostname,a="https:"===n.protocol&&"http:"===s.protocol;if(t.headers&&(o||a)){const e=["authorization","cookie","proxy-authorization"];Object.keys(t.headers).forEach(i=>{e.includes(i.toLowerCase())&&delete t.headers[i]})}return d=!0,r.resume(),y.abort(),C(i,t)}if(i.statusCode=r.statusCode,i.headers=r.headers,r.statusCode>=300&&!t.allowErrorResponse)return v(new Error("Invalid status code "+r.statusCode));r.on("error",e=>v(e));const o="number"==typeof t.maxBytes&&t.maxBytes>0?t.maxBytes:67108864,a=s||r;let c=0;a.on("data",e=>{c+=e.length,c<=o||d||(a.unpipe(i),v(new Error("Response size exceeds the allowed "+o+" bytes")))}),s?(r.pipe(s).pipe(i),s.on("error",e=>v(e))):r.pipe(i)}),setImmediate(()=>{if(s)try{if("function"==typeof s.pipe)return s.pipe(y);y.write(s)}catch(e){return v(e)}y.end()}),i}C.Cookies=m.default,C.DEFAULT_TIMEOUT=6e4,t.default=C,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Nu,Nu.exports)),Nu.exports}function Ku(){return Gu||(Gu=1,function(e){var t,i=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=jn&&jn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var s=t(e),o=0;o<s.length;o++)"default"!==s[o]&&i(r,e,s[o]);return n(r,e),r}),s=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.encodeXText=e.assign=e.parseDataURI=e.callbackPromise=e.getLogger=e._logFunc=e.parseConnectionUrl=e.resolveHostname=e.dnsCache=e.networkInterfaces=e._resetCacheCleanup=e._lastCacheCleanup=e.copyOwnKeys=e.isProtoKey=void 0,e.resolveContent=function(t,i,n,r){r||"function"!=typeof n||(r=n,n=!1);let s;n=n||{},r||(s=new Promise((t,i)=>{r=(0,e.callbackPromise)(t,i)}));return function(t,i,n,r){let s=t&&t[i]&&t[i].content||t[i];const o=("object"==typeof t[i]&&t[i].encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,"");if(!s)return r(null,s);if("object"==typeof s){if("function"==typeof s.pipe)return v(s,(e,n)=>{if(e)return r(e);t[i].content?t[i].content=n:t[i]=n,r(null,n)});if(/^data:/i.test(s.path||s.href)){const t=(0,e.parseDataURI)(s.path||s.href);return r(null,t&&t.data?t.data:Buffer.alloc(0))}if(s.href||/^https?:\/\//i.test(s.path)){const e=s.href||s.path;return n.disableUrlAccess?void setImmediate(()=>{const t=new Error("Url access rejected for "+e);t.code=u.EURLACCESS,r(t)}):v((0,l.default)(e,{headers:s.httpHeaders,tls:s.tls}),r)}if(s.path)return n.disableFileAccess?void setImmediate(()=>{const e=new Error("File access rejected for "+s.path);e.code=u.EFILEACCESS,r(e)}):v(c.default.createReadStream(s.path),r)}"string"!=typeof t[i].content||["utf8","usascii","ascii"].includes(o)||(s=Buffer.from(t[i].content,o));setImmediate(()=>r(null,s))}(t,i,n,r),s};const o=r(Eu()),a=s(h),c=s(f),l=s(Pu()),u=r(Yu()),p=Wu();Object.defineProperty(e,"isProtoKey",{enumerable:!0,get:function(){return p.isProtoKey}}),Object.defineProperty(e,"copyOwnKeys",{enumerable:!0,get:function(){return p.copyOwnKeys}});const m=s(D),g=s(d),w=s(x),y=3e5;let M=0;e._lastCacheCleanup=()=>M;e._resetCacheCleanup=()=>{M=0};try{e.networkInterfaces=w.default.networkInterfaces()}catch(e){}const I=(t,i)=>{const n=Object.values(e.networkInterfaces||{}).flat();return!n.length||n.filter(e=>!e.internal||i).some(e=>e.family==="IPv"+t||e.family===t)},b=(e,t,i,n)=>{if(!I(e,(i=i||{}).allowInternalNetworkInterfaces))return n(null,[]);(m.default.Resolver?new m.default.Resolver(i):m.default)["resolve"+e](t,(e,t)=>{if(e){switch(e.code){case m.default.NODATA:case m.default.NOTFOUND:case m.default.NOTIMP:case m.default.SERVFAIL:case m.default.CONNREFUSED:case m.default.REFUSED:case"EAI_AGAIN":return n(null,[])}return n(e)}return n(null,Array.isArray(t)?t:[].concat(t||[]))})};e.dnsCache=new Map;const C=(e,t)=>{if(!e)return Object.assign({},t||{});const i=e.addresses||[],n=i.length>0?i[Math.floor(Math.random()*i.length)]:null;return Object.assign({host:n,_addresses:i},t||{})};e.resolveHostname=(t,i)=>{if(!(t=t||{}).host&&t.servername&&(t.host=t.servername),!t.host||g.default.isIP(t.host)){const e={addresses:[t.host]};return i(null,C(e,{servername:t.servername||!1,cached:!1}))}const n=t.host,r=t.servername||n;let s;if(e.dnsCache.has(t.host)){s=e.dnsCache.get(t.host);const n=Date.now();if(n-M>3e4){M=n;for(const[t,i]of e.dnsCache.entries())i.expires&&i.expires<n&&e.dnsCache.delete(t);if(e.dnsCache.size>1e3){const t=Math.floor(100);Array.from(e.dnsCache.keys()).slice(0,t).forEach(t=>e.dnsCache.delete(t))}}if(!s.expires||s.expires>=n)return i(null,C(s.value,{servername:r,cached:!0}))}let o=[],a=[],c=null,l=null;b(4,t.host,t,(u,p)=>{u?c=u:o=p||[],b(6,n,t,(u,p)=>{u?l=u:a=p||[];const d=o.concat(a);if(d.length){const s={addresses:d};return e.dnsCache.set(n,{value:s,expires:Date.now()+(t.dnsTtl||y)}),i(null,C(s,{servername:r,cached:!1}))}if(c&&l&&s)return e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,C(s.value,{servername:r,cached:!0,error:c}));try{m.default.lookup(n,{all:!0},(o,a)=>{if(o)return s?(e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,C(s.value,{servername:r,cached:!0,error:o}))):i(o);const c=a?a.filter(e=>I(e.family)).map(e=>e.address):[];if(a&&a.length&&!c.length&&console.warn(`Failed to resolve IPv${a[0].family} addresses with current network`),!c.length&&s)return i(null,C(s.value,{servername:r,cached:!0}));const l={addresses:c.length?c:[n]};return e.dnsCache.set(n,{value:l,expires:Date.now()+(t.dnsTtl||y)}),i(null,C(l,{servername:r,cached:!1}))})}catch(o){return s?(e.dnsCache.set(n,{value:s.value,expires:Date.now()+(t.dnsTtl||y)}),i(null,C(s.value,{servername:r,cached:!0,error:o}))):i(c||l||o)}})})};e.parseConnectionUrl=e=>{e=e||"";const t={},i=o.parse(e,!0);switch(i.protocol){case"smtp:":t.secure=!1;break;case"smtps:":t.secure=!0;break;case"direct:":t.direct=!0}return!isNaN(i.port)&&Number(i.port)&&(t.port=Number(i.port)),i.hostname&&(t.host=i.hostname),(i.username||i.password)&&(t.auth={user:i.username||"",pass:i.password||""}),Object.keys(i.query||{}).forEach(e=>{let n=t,r=e,s=i.query[e];switch(isNaN(s)||(s=Number(s)),s){case"true":s=!0;break;case"false":s=!1}if(0===e.indexOf("tls."))r=e.substr(4),t.tls||(t.tls={}),n=t.tls;else if(e.indexOf(".")>=0)return;(0,p.isProtoKey)(r)||r in n||(n[r]=s)}),t};e._logFunc=(e,t,i,n,r,...s)=>{const o=Object.assign({},i||{},n||{});delete o.level;let a=t;"function"!=typeof e[a]&&(a=["info","debug","log","trace","warn","error"].find(t=>"function"==typeof e[t])),a&&e[a](o,r,...s)};e.getLogger=(t,i)=>{const n={},r=["trace","debug","info","warn","error","fatal"];if(!(t=t||{}).logger)return r.forEach(e=>{n[e]=()=>!1}),n;const s=!0===t.logger?function(e){const t=e.reduce((e,t)=>Math.max(e,t.length),0),i=new Map;e.forEach(e=>{let n=e.toUpperCase();n.length<t&&(n+=" ".repeat(t-n.length)),i.set(e,n)});const n=(e,t,n,...r)=>{let s="";t&&("server"===t.tnx?s="S: ":"client"===t.tnx&&(s="C: "),t.sid&&(s="["+t.sid+"] "+s),t.cid&&(s="[#"+t.cid+"] "+s)),(n=a.default.format(n,...r)).split(/\r?\n/).forEach(t=>{console.log("[%s] %s %s",(new Date).toISOString().substr(0,19).replace(/T/," "),i.get(e),s+t)})},r={};return e.forEach(e=>{r[e]=n.bind(null,e)}),r}(r):t.logger;return r.forEach(t=>{n[t]=(...n)=>{const r="string"==typeof n[0]?void 0:n.shift();(0,e._logFunc)(s,t,i,r,...n)}}),n};e.callbackPromise=(e,t)=>function(...i){const n=i.shift();n?t(n):e(...i)};e.parseDataURI=e=>{if("string"!=typeof e)return null;if(!e.startsWith("data:"))return null;const t=e.indexOf(",");if(-1===t)return null;const i=e.substring(t+1);let n;const r=e.substring(5,t).split(";");if(r.length>0){const e=r[r.length-1].toLowerCase().trim();["base64","utf8","utf-8"].includes(e)&&-1===e.indexOf("=")&&(n=e,r.pop())}const s=r.length>0?r.shift():"application/octet-stream",o={};for(let e=0;e<r.length;e++){const t=r[e],i=t.indexOf("=");if(i>0){const e=t.substring(0,i).trim(),n=t.substring(i+1).trim();e&&!(0,p.isProtoKey)(e)&&(o[e]=n)}}let a;try{if("base64"===n)a=Buffer.from(i,"base64");else try{a=Buffer.from(decodeURIComponent(i))}catch(e){a=Buffer.from(i)}}catch(e){a=Buffer.alloc(0)}return{data:a,encoding:n||null,contentType:s||"application/octet-stream",params:o}};e.assign=function(...e){const t=e.shift()||{};return e.forEach(e=>{Object.keys(e||{}).forEach(i=>{(0,p.isProtoKey)(i)||(["tls","auth"].includes(i)&&e[i]&&"object"==typeof e[i]?t[i]=(0,p.copyOwnKeys)(t[i]||{},e[i]):t[i]=e[i])})}),t};function v(e,t){let i=!1;const n=[];let r=0;e.on("error",e=>{i||(i=!0,t(e))}),e.on("readable",()=>{let t;for(;null!==(t=e.read());)n.push(t),r+=t.length}),e.on("end",()=>{if(i)return;let e;i=!0;try{e=Buffer.concat(n,r)}catch(e){return t(e)}t(null,e)})}e.encodeXText=e=>{if(!/[^\x21-\x2A\x2C-\x3C\x3E-\x7E]/.test(e))return e;const t=Buffer.from(e);let i="";for(let e=0,n=t.length;e<n;e++){const n=t[e];i+=n<33||n>126||43===n||61===n?"+"+(n<16?"0":"")+n.toString(16).toUpperCase():String.fromCharCode(n)}return i}}(bu)),bu}var Hu,Uu={};function Bu(){if(Hu)return Uu;Hu=1;var e=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.detectMimeType=function(e){if(!e)return i;const n=t.default.parse(e),r=(n.ext.substr(1)||n.name||"").split("?").shift().trim().toLowerCase(),o=s.has(r)?s.get(r):i;if(Array.isArray(o))return o[0];return o},Uu.detectExtension=function(e){if(!e)return n;const t=e.toLowerCase().trim().split("/"),i=t.shift().trim(),s=t.join("/").trim();if(r.has(i+"/"+s)){const e=r.get(i+"/"+s);return Array.isArray(e)?e[0]:e}if("text"===i)return"txt";return"bin"};const t=e(I),i="application/octet-stream",n="bin",r=new Map([["application/acad","dwg"],["application/applixware","aw"],["application/arj","arj"],["application/atom+xml","xml"],["application/atomcat+xml","atomcat"],["application/atomsvc+xml","atomsvc"],["application/base64",["mm","mme"]],["application/binhex","hqx"],["application/binhex4","hqx"],["application/book",["book","boo"]],["application/ccxml+xml,","ccxml"],["application/cdf","cdf"],["application/cdmi-capability","cdmia"],["application/cdmi-container","cdmic"],["application/cdmi-domain","cdmid"],["application/cdmi-object","cdmio"],["application/cdmi-queue","cdmiq"],["application/clariscad","ccad"],["application/commonground","dp"],["application/cu-seeme","cu"],["application/davmount+xml","davmount"],["application/drafting","drw"],["application/dsptype","tsp"],["application/dssc+der","dssc"],["application/dssc+xml","xdssc"],["application/dxf","dxf"],["application/ecmascript",["js","es"]],["application/emma+xml","emma"],["application/envoy","evy"],["application/epub+zip","epub"],["application/excel",["xls","xl","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/exi","exi"],["application/font-tdpfr","pfr"],["application/fractals","fif"],["application/freeloader","frl"],["application/futuresplash","spl"],["application/geo+json","geojson"],["application/gnutar","tgz"],["application/groupwise","vew"],["application/hlp","hlp"],["application/hta","hta"],["application/hyperstudio","stk"],["application/i-deas","unv"],["application/iges",["iges","igs"]],["application/inf","inf"],["application/internet-property-stream","acx"],["application/ipfix","ipfix"],["application/java","class"],["application/java-archive","jar"],["application/java-byte-code","class"],["application/java-serialized-object","ser"],["application/java-vm","class"],["application/javascript","js"],["application/json","json"],["application/lha","lha"],["application/lzx","lzx"],["application/mac-binary","bin"],["application/mac-binhex","hqx"],["application/mac-binhex40","hqx"],["application/mac-compactpro","cpt"],["application/macbinary","bin"],["application/mads+xml","mads"],["application/marc","mrc"],["application/marcxml+xml","mrcx"],["application/mathematica","ma"],["application/mathml+xml","mathml"],["application/mbedlet","mbd"],["application/mbox","mbox"],["application/mcad","mcd"],["application/mediaservercontrol+xml","mscml"],["application/metalink4+xml","meta4"],["application/mets+xml","mets"],["application/mime","aps"],["application/mods+xml","mods"],["application/mp21","m21"],["application/mp4","mp4"],["application/mspowerpoint",["ppt","pot","pps","ppz"]],["application/msword",["doc","dot","w6w","wiz","word"]],["application/mswrite","wri"],["application/mxf","mxf"],["application/netmc","mcp"],["application/octet-stream",["*"]],["application/oda","oda"],["application/oebps-package+xml","opf"],["application/ogg","ogx"],["application/olescript","axs"],["application/onenote","onetoc"],["application/patch-ops-error+xml","xer"],["application/pdf","pdf"],["application/pgp-encrypted","asc"],["application/pgp-signature","pgp"],["application/pics-rules","prf"],["application/pkcs-12","p12"],["application/pkcs-crl","crl"],["application/pkcs10","p10"],["application/pkcs7-mime",["p7c","p7m"]],["application/pkcs7-signature","p7s"],["application/pkcs8","p8"],["application/pkix-attr-cert","ac"],["application/pkix-cert",["cer","crt"]],["application/pkix-crl","crl"],["application/pkix-pkipath","pkipath"],["application/pkixcmp","pki"],["application/plain","text"],["application/pls+xml","pls"],["application/postscript",["ps","ai","eps"]],["application/powerpoint","ppt"],["application/pro_eng",["part","prt"]],["application/prs.cww","cww"],["application/pskc+xml","pskcxml"],["application/rdf+xml","rdf"],["application/reginfo+xml","rif"],["application/relax-ng-compact-syntax","rnc"],["application/resource-lists+xml","rl"],["application/resource-lists-diff+xml","rld"],["application/ringing-tones","rng"],["application/rls-services+xml","rs"],["application/rsd+xml","rsd"],["application/rss+xml","xml"],["application/rtf",["rtf","rtx"]],["application/sbml+xml","sbml"],["application/scvp-cv-request","scq"],["application/scvp-cv-response","scs"],["application/scvp-vp-request","spq"],["application/scvp-vp-response","spp"],["application/sdp","sdp"],["application/sea","sea"],["application/set","set"],["application/set-payment-initiation","setpay"],["application/set-registration-initiation","setreg"],["application/shf+xml","shf"],["application/sla","stl"],["application/smil",["smi","smil"]],["application/smil+xml","smi"],["application/solids","sol"],["application/sounder","sdr"],["application/sparql-query","rq"],["application/sparql-results+xml","srx"],["application/srgs","gram"],["application/srgs+xml","grxml"],["application/sru+xml","sru"],["application/ssml+xml","ssml"],["application/step",["step","stp"]],["application/streamingmedia","ssm"],["application/tei+xml","tei"],["application/thraud+xml","tfi"],["application/timestamped-data","tsd"],["application/toolbook","tbk"],["application/vda","vda"],["application/vnd.3gpp.pic-bw-large","plb"],["application/vnd.3gpp.pic-bw-small","psb"],["application/vnd.3gpp.pic-bw-var","pvb"],["application/vnd.3gpp2.tcap","tcap"],["application/vnd.3m.post-it-notes","pwn"],["application/vnd.accpac.simply.aso","aso"],["application/vnd.accpac.simply.imp","imp"],["application/vnd.acucobol","acu"],["application/vnd.acucorp","atc"],["application/vnd.adobe.air-application-installer-package+zip","air"],["application/vnd.adobe.fxp","fxp"],["application/vnd.adobe.xdp+xml","xdp"],["application/vnd.adobe.xfdf","xfdf"],["application/vnd.ahead.space","ahead"],["application/vnd.airzip.filesecure.azf","azf"],["application/vnd.airzip.filesecure.azs","azs"],["application/vnd.amazon.ebook","azw"],["application/vnd.americandynamics.acc","acc"],["application/vnd.amiga.ami","ami"],["application/vnd.android.package-archive","apk"],["application/vnd.anser-web-certificate-issue-initiation","cii"],["application/vnd.anser-web-funds-transfer-initiation","fti"],["application/vnd.antix.game-component","atx"],["application/vnd.apple.installer+xml","mpkg"],["application/vnd.apple.mpegurl","m3u8"],["application/vnd.aristanetworks.swi","swi"],["application/vnd.audiograph","aep"],["application/vnd.blueice.multipass","mpm"],["application/vnd.bmi","bmi"],["application/vnd.businessobjects","rep"],["application/vnd.chemdraw+xml","cdxml"],["application/vnd.chipnuts.karaoke-mmd","mmd"],["application/vnd.cinderella","cdy"],["application/vnd.claymore","cla"],["application/vnd.cloanto.rp9","rp9"],["application/vnd.clonk.c4group","c4g"],["application/vnd.cluetrust.cartomobile-config","c11amc"],["application/vnd.cluetrust.cartomobile-config-pkg","c11amz"],["application/vnd.commonspace","csp"],["application/vnd.contact.cmsg","cdbcmsg"],["application/vnd.cosmocaller","cmc"],["application/vnd.crick.clicker","clkx"],["application/vnd.crick.clicker.keyboard","clkk"],["application/vnd.crick.clicker.palette","clkp"],["application/vnd.crick.clicker.template","clkt"],["application/vnd.crick.clicker.wordbank","clkw"],["application/vnd.criticaltools.wbs+xml","wbs"],["application/vnd.ctc-posml","pml"],["application/vnd.cups-ppd","ppd"],["application/vnd.curl.car","car"],["application/vnd.curl.pcurl","pcurl"],["application/vnd.data-vision.rdz","rdz"],["application/vnd.denovo.fcselayout-link","fe_launch"],["application/vnd.dna","dna"],["application/vnd.dolby.mlp","mlp"],["application/vnd.dpgraph","dpg"],["application/vnd.dreamfactory","dfac"],["application/vnd.dvb.ait","ait"],["application/vnd.dvb.service","svc"],["application/vnd.dynageo","geo"],["application/vnd.ecowin.chart","mag"],["application/vnd.enliven","nml"],["application/vnd.epson.esf","esf"],["application/vnd.epson.msf","msf"],["application/vnd.epson.quickanime","qam"],["application/vnd.epson.salt","slt"],["application/vnd.epson.ssf","ssf"],["application/vnd.eszigno3+xml","es3"],["application/vnd.ezpix-album","ez2"],["application/vnd.ezpix-package","ez3"],["application/vnd.fdf","fdf"],["application/vnd.fdsn.seed","seed"],["application/vnd.flographit","gph"],["application/vnd.fluxtime.clip","ftc"],["application/vnd.framemaker","fm"],["application/vnd.frogans.fnc","fnc"],["application/vnd.frogans.ltf","ltf"],["application/vnd.fsc.weblaunch","fsc"],["application/vnd.fujitsu.oasys","oas"],["application/vnd.fujitsu.oasys2","oa2"],["application/vnd.fujitsu.oasys3","oa3"],["application/vnd.fujitsu.oasysgp","fg5"],["application/vnd.fujitsu.oasysprs","bh2"],["application/vnd.fujixerox.ddd","ddd"],["application/vnd.fujixerox.docuworks","xdw"],["application/vnd.fujixerox.docuworks.binder","xbd"],["application/vnd.fuzzysheet","fzs"],["application/vnd.genomatix.tuxedo","txd"],["application/vnd.geogebra.file","ggb"],["application/vnd.geogebra.tool","ggt"],["application/vnd.geometry-explorer","gex"],["application/vnd.geonext","gxt"],["application/vnd.geoplan","g2w"],["application/vnd.geospace","g3w"],["application/vnd.gmx","gmx"],["application/vnd.google-earth.kml+xml","kml"],["application/vnd.google-earth.kmz","kmz"],["application/vnd.grafeq","gqf"],["application/vnd.groove-account","gac"],["application/vnd.groove-help","ghf"],["application/vnd.groove-identity-message","gim"],["application/vnd.groove-injector","grv"],["application/vnd.groove-tool-message","gtm"],["application/vnd.groove-tool-template","tpl"],["application/vnd.groove-vcard","vcg"],["application/vnd.hal+xml","hal"],["application/vnd.handheld-entertainment+xml","zmm"],["application/vnd.hbci","hbci"],["application/vnd.hhe.lesson-player","les"],["application/vnd.hp-hpgl",["hgl","hpg","hpgl"]],["application/vnd.hp-hpid","hpid"],["application/vnd.hp-hps","hps"],["application/vnd.hp-jlyt","jlt"],["application/vnd.hp-pcl","pcl"],["application/vnd.hp-pclxl","pclxl"],["application/vnd.hydrostatix.sof-data","sfd-hdstx"],["application/vnd.hzn-3d-crossword","x3d"],["application/vnd.ibm.minipay","mpy"],["application/vnd.ibm.modcap","afp"],["application/vnd.ibm.rights-management","irm"],["application/vnd.ibm.secure-container","sc"],["application/vnd.iccprofile","icc"],["application/vnd.igloader","igl"],["application/vnd.immervision-ivp","ivp"],["application/vnd.immervision-ivu","ivu"],["application/vnd.insors.igm","igm"],["application/vnd.intercon.formnet","xpw"],["application/vnd.intergeo","i2g"],["application/vnd.intu.qbo","qbo"],["application/vnd.intu.qfx","qfx"],["application/vnd.ipunplugged.rcprofile","rcprofile"],["application/vnd.irepository.package+xml","irp"],["application/vnd.is-xpr","xpr"],["application/vnd.isac.fcs","fcs"],["application/vnd.jam","jam"],["application/vnd.jcp.javame.midlet-rms","rms"],["application/vnd.jisp","jisp"],["application/vnd.joost.joda-archive","joda"],["application/vnd.kahootz","ktz"],["application/vnd.kde.karbon","karbon"],["application/vnd.kde.kchart","chrt"],["application/vnd.kde.kformula","kfo"],["application/vnd.kde.kivio","flw"],["application/vnd.kde.kontour","kon"],["application/vnd.kde.kpresenter","kpr"],["application/vnd.kde.kspread","ksp"],["application/vnd.kde.kword","kwd"],["application/vnd.kenameaapp","htke"],["application/vnd.kidspiration","kia"],["application/vnd.kinar","kne"],["application/vnd.koan","skp"],["application/vnd.kodak-descriptor","sse"],["application/vnd.las.las+xml","lasxml"],["application/vnd.llamagraphics.life-balance.desktop","lbd"],["application/vnd.llamagraphics.life-balance.exchange+xml","lbe"],["application/vnd.lotus-1-2-3","123"],["application/vnd.lotus-approach","apr"],["application/vnd.lotus-freelance","pre"],["application/vnd.lotus-notes","nsf"],["application/vnd.lotus-organizer","org"],["application/vnd.lotus-screencam","scm"],["application/vnd.lotus-wordpro","lwp"],["application/vnd.macports.portpkg","portpkg"],["application/vnd.mcd","mcd"],["application/vnd.medcalcdata","mc1"],["application/vnd.mediastation.cdkey","cdkey"],["application/vnd.mfer","mwf"],["application/vnd.mfmp","mfm"],["application/vnd.micrografx.flo","flo"],["application/vnd.micrografx.igx","igx"],["application/vnd.mif","mif"],["application/vnd.mobius.daf","daf"],["application/vnd.mobius.dis","dis"],["application/vnd.mobius.mbk","mbk"],["application/vnd.mobius.mqy","mqy"],["application/vnd.mobius.msl","msl"],["application/vnd.mobius.plc","plc"],["application/vnd.mobius.txf","txf"],["application/vnd.mophun.application","mpn"],["application/vnd.mophun.certificate","mpc"],["application/vnd.mozilla.xul+xml","xul"],["application/vnd.ms-artgalry","cil"],["application/vnd.ms-cab-compressed","cab"],["application/vnd.ms-excel",["xls","xla","xlc","xlm","xlt","xlw","xlb","xll"]],["application/vnd.ms-excel.addin.macroenabled.12","xlam"],["application/vnd.ms-excel.sheet.binary.macroenabled.12","xlsb"],["application/vnd.ms-excel.sheet.macroenabled.12","xlsm"],["application/vnd.ms-excel.template.macroenabled.12","xltm"],["application/vnd.ms-fontobject","eot"],["application/vnd.ms-htmlhelp","chm"],["application/vnd.ms-ims","ims"],["application/vnd.ms-lrm","lrm"],["application/vnd.ms-officetheme","thmx"],["application/vnd.ms-outlook","msg"],["application/vnd.ms-pki.certstore","sst"],["application/vnd.ms-pki.pko","pko"],["application/vnd.ms-pki.seccat","cat"],["application/vnd.ms-pki.stl","stl"],["application/vnd.ms-pkicertstore","sst"],["application/vnd.ms-pkiseccat","cat"],["application/vnd.ms-pkistl","stl"],["application/vnd.ms-powerpoint",["ppt","pot","pps","ppa","pwz"]],["application/vnd.ms-powerpoint.addin.macroenabled.12","ppam"],["application/vnd.ms-powerpoint.presentation.macroenabled.12","pptm"],["application/vnd.ms-powerpoint.slide.macroenabled.12","sldm"],["application/vnd.ms-powerpoint.slideshow.macroenabled.12","ppsm"],["application/vnd.ms-powerpoint.template.macroenabled.12","potm"],["application/vnd.ms-project","mpp"],["application/vnd.ms-word.document.macroenabled.12","docm"],["application/vnd.ms-word.template.macroenabled.12","dotm"],["application/vnd.ms-works",["wks","wcm","wdb","wps"]],["application/vnd.ms-wpl","wpl"],["application/vnd.ms-xpsdocument","xps"],["application/vnd.mseq","mseq"],["application/vnd.musician","mus"],["application/vnd.muvee.style","msty"],["application/vnd.neurolanguage.nlu","nlu"],["application/vnd.noblenet-directory","nnd"],["application/vnd.noblenet-sealer","nns"],["application/vnd.noblenet-web","nnw"],["application/vnd.nokia.configuration-message","ncm"],["application/vnd.nokia.n-gage.data","ngdat"],["application/vnd.nokia.n-gage.symbian.install","n-gage"],["application/vnd.nokia.radio-preset","rpst"],["application/vnd.nokia.radio-presets","rpss"],["application/vnd.nokia.ringing-tone","rng"],["application/vnd.novadigm.edm","edm"],["application/vnd.novadigm.edx","edx"],["application/vnd.novadigm.ext","ext"],["application/vnd.oasis.opendocument.chart","odc"],["application/vnd.oasis.opendocument.chart-template","otc"],["application/vnd.oasis.opendocument.database","odb"],["application/vnd.oasis.opendocument.formula","odf"],["application/vnd.oasis.opendocument.formula-template","odft"],["application/vnd.oasis.opendocument.graphics","odg"],["application/vnd.oasis.opendocument.graphics-template","otg"],["application/vnd.oasis.opendocument.image","odi"],["application/vnd.oasis.opendocument.image-template","oti"],["application/vnd.oasis.opendocument.presentation","odp"],["application/vnd.oasis.opendocument.presentation-template","otp"],["application/vnd.oasis.opendocument.spreadsheet","ods"],["application/vnd.oasis.opendocument.spreadsheet-template","ots"],["application/vnd.oasis.opendocument.text","odt"],["application/vnd.oasis.opendocument.text-master","odm"],["application/vnd.oasis.opendocument.text-template","ott"],["application/vnd.oasis.opendocument.text-web","oth"],["application/vnd.olpc-sugar","xo"],["application/vnd.oma.dd2+xml","dd2"],["application/vnd.openofficeorg.extension","oxt"],["application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx"],["application/vnd.openxmlformats-officedocument.presentationml.slide","sldx"],["application/vnd.openxmlformats-officedocument.presentationml.slideshow","ppsx"],["application/vnd.openxmlformats-officedocument.presentationml.template","potx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx"],["application/vnd.openxmlformats-officedocument.spreadsheetml.template","xltx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx"],["application/vnd.openxmlformats-officedocument.wordprocessingml.template","dotx"],["application/vnd.osgeo.mapguide.package","mgp"],["application/vnd.osgi.dp","dp"],["application/vnd.palm","pdb"],["application/vnd.pawaafile","paw"],["application/vnd.pg.format","str"],["application/vnd.pg.osasli","ei6"],["application/vnd.picsel","efif"],["application/vnd.pmi.widget","wg"],["application/vnd.pocketlearn","plf"],["application/vnd.powerbuilder6","pbd"],["application/vnd.previewsystems.box","box"],["application/vnd.proteus.magazine","mgz"],["application/vnd.publishare-delta-tree","qps"],["application/vnd.pvi.ptid1","ptid"],["application/vnd.quark.quarkxpress","qxd"],["application/vnd.realvnc.bed","bed"],["application/vnd.recordare.musicxml","mxl"],["application/vnd.recordare.musicxml+xml","musicxml"],["application/vnd.rig.cryptonote","cryptonote"],["application/vnd.rim.cod","cod"],["application/vnd.rn-realmedia","rm"],["application/vnd.rn-realplayer","rnx"],["application/vnd.route66.link66+xml","link66"],["application/vnd.sailingtracker.track","st"],["application/vnd.seemail","see"],["application/vnd.sema","sema"],["application/vnd.semd","semd"],["application/vnd.semf","semf"],["application/vnd.shana.informed.formdata","ifm"],["application/vnd.shana.informed.formtemplate","itp"],["application/vnd.shana.informed.interchange","iif"],["application/vnd.shana.informed.package","ipk"],["application/vnd.simtech-mindmapper","twd"],["application/vnd.smaf","mmf"],["application/vnd.smart.teacher","teacher"],["application/vnd.solent.sdkm+xml","sdkm"],["application/vnd.spotfire.dxp","dxp"],["application/vnd.spotfire.sfs","sfs"],["application/vnd.stardivision.calc","sdc"],["application/vnd.stardivision.draw","sda"],["application/vnd.stardivision.impress","sdd"],["application/vnd.stardivision.math","smf"],["application/vnd.stardivision.writer","sdw"],["application/vnd.stardivision.writer-global","sgl"],["application/vnd.stepmania.stepchart","sm"],["application/vnd.sun.xml.calc","sxc"],["application/vnd.sun.xml.calc.template","stc"],["application/vnd.sun.xml.draw","sxd"],["application/vnd.sun.xml.draw.template","std"],["application/vnd.sun.xml.impress","sxi"],["application/vnd.sun.xml.impress.template","sti"],["application/vnd.sun.xml.math","sxm"],["application/vnd.sun.xml.writer","sxw"],["application/vnd.sun.xml.writer.global","sxg"],["application/vnd.sun.xml.writer.template","stw"],["application/vnd.sus-calendar","sus"],["application/vnd.svd","svd"],["application/vnd.symbian.install","sis"],["application/vnd.syncml+xml","xsm"],["application/vnd.syncml.dm+wbxml","bdm"],["application/vnd.syncml.dm+xml","xdm"],["application/vnd.tao.intent-module-archive","tao"],["application/vnd.tmobile-livetv","tmo"],["application/vnd.trid.tpt","tpt"],["application/vnd.triscape.mxs","mxs"],["application/vnd.trueapp","tra"],["application/vnd.ufdl","ufd"],["application/vnd.uiq.theme","utz"],["application/vnd.umajin","umj"],["application/vnd.unity","unityweb"],["application/vnd.uoml+xml","uoml"],["application/vnd.vcx","vcx"],["application/vnd.visio","vsd"],["application/vnd.visionary","vis"],["application/vnd.vsf","vsf"],["application/vnd.wap.wbxml","wbxml"],["application/vnd.wap.wmlc","wmlc"],["application/vnd.wap.wmlscriptc","wmlsc"],["application/vnd.webturbo","wtb"],["application/vnd.wolfram.player","nbp"],["application/vnd.wordperfect","wpd"],["application/vnd.wqd","wqd"],["application/vnd.wt.stf","stf"],["application/vnd.xara",["web","xar"]],["application/vnd.xfdl","xfdl"],["application/vnd.yamaha.hv-dic","hvd"],["application/vnd.yamaha.hv-script","hvs"],["application/vnd.yamaha.hv-voice","hvp"],["application/vnd.yamaha.openscoreformat","osf"],["application/vnd.yamaha.openscoreformat.osfpvg+xml","osfpvg"],["application/vnd.yamaha.smaf-audio","saf"],["application/vnd.yamaha.smaf-phrase","spf"],["application/vnd.yellowriver-custom-menu","cmp"],["application/vnd.zul","zir"],["application/vnd.zzazz.deck+xml","zaz"],["application/vocaltec-media-desc","vmd"],["application/vocaltec-media-file","vmf"],["application/voicexml+xml","vxml"],["application/widget","wgt"],["application/winhlp","hlp"],["application/wordperfect",["wp","wp5","wp6","wpd"]],["application/wordperfect6.0",["w60","wp5"]],["application/wordperfect6.1","w61"],["application/wsdl+xml","wsdl"],["application/wspolicy+xml","wspolicy"],["application/x-123","wk1"],["application/x-7z-compressed","7z"],["application/x-abiword","abw"],["application/x-ace-compressed","ace"],["application/x-aim","aim"],["application/x-authorware-bin","aab"],["application/x-authorware-map","aam"],["application/x-authorware-seg","aas"],["application/x-bcpio","bcpio"],["application/x-binary","bin"],["application/x-binhex40","hqx"],["application/x-bittorrent","torrent"],["application/x-bsh",["bsh","sh","shar"]],["application/x-bytecode.elisp","elc"],["application/x-bytecode.python","pyc"],["application/x-bzip","bz"],["application/x-bzip2",["boz","bz2"]],["application/x-cdf","cdf"],["application/x-cdlink","vcd"],["application/x-chat",["cha","chat"]],["application/x-chess-pgn","pgn"],["application/x-cmu-raster","ras"],["application/x-cocoa","cco"],["application/x-compactpro","cpt"],["application/x-compress","z"],["application/x-compressed",["tgz","gz","z","zip"]],["application/x-conference","nsc"],["application/x-cpio","cpio"],["application/x-cpt","cpt"],["application/x-csh","csh"],["application/x-debian-package","deb"],["application/x-deepv","deepv"],["application/x-director",["dir","dcr","dxr"]],["application/x-doom","wad"],["application/x-dtbncx+xml","ncx"],["application/x-dtbook+xml","dtb"],["application/x-dtbresource+xml","res"],["application/x-dvi","dvi"],["application/x-elc","elc"],["application/x-envoy",["env","evy"]],["application/x-esrehber","es"],["application/x-excel",["xls","xla","xlb","xlc","xld","xlk","xll","xlm","xlt","xlv","xlw"]],["application/x-font-bdf","bdf"],["application/x-font-ghostscript","gsf"],["application/x-font-linux-psf","psf"],["application/x-font-otf","otf"],["application/x-font-pcf","pcf"],["application/x-font-snf","snf"],["application/x-font-ttf","ttf"],["application/x-font-type1","pfa"],["application/x-font-woff","woff"],["application/x-frame","mif"],["application/x-freelance","pre"],["application/x-futuresplash","spl"],["application/x-gnumeric","gnumeric"],["application/x-gsp","gsp"],["application/x-gss","gss"],["application/x-gtar","gtar"],["application/x-gzip",["gz","gzip"]],["application/x-hdf","hdf"],["application/x-helpfile",["help","hlp"]],["application/x-httpd-imap","imap"],["application/x-ima","ima"],["application/x-internet-signup",["ins","isp"]],["application/x-internett-signup","ins"],["application/x-inventor","iv"],["application/x-ip2","ip"],["application/x-iphone","iii"],["application/x-java-class","class"],["application/x-java-commerce","jcm"],["application/x-java-jnlp-file","jnlp"],["application/x-javascript","js"],["application/x-koan",["skd","skm","skp","skt"]],["application/x-ksh","ksh"],["application/x-latex",["latex","ltx"]],["application/x-lha","lha"],["application/x-lisp","lsp"],["application/x-livescreen","ivy"],["application/x-lotus","wq1"],["application/x-lotusscreencam","scm"],["application/x-lzh","lzh"],["application/x-lzx","lzx"],["application/x-mac-binhex40","hqx"],["application/x-macbinary","bin"],["application/x-magic-cap-package-1.0","mc$"],["application/x-mathcad","mcd"],["application/x-meme","mm"],["application/x-midi",["mid","midi"]],["application/x-mif","mif"],["application/x-mix-transfer","nix"],["application/x-mobipocket-ebook","prc"],["application/x-mplayer2","asx"],["application/x-ms-application","application"],["application/x-ms-wmd","wmd"],["application/x-ms-wmz","wmz"],["application/x-ms-xbap","xbap"],["application/x-msaccess","mdb"],["application/x-msbinder","obd"],["application/x-mscardfile","crd"],["application/x-msclip","clp"],["application/x-msdownload",["exe","dll"]],["application/x-msexcel",["xls","xla","xlw"]],["application/x-msmediaview",["mvb","m13","m14"]],["application/x-msmetafile","wmf"],["application/x-msmoney","mny"],["application/x-mspowerpoint","ppt"],["application/x-mspublisher","pub"],["application/x-msschedule","scd"],["application/x-msterminal","trm"],["application/x-mswrite","wri"],["application/x-navi-animation","ani"],["application/x-navidoc","nvd"],["application/x-navimap","map"],["application/x-navistyle","stl"],["application/x-netcdf",["cdf","nc"]],["application/x-newton-compatible-pkg","pkg"],["application/x-nokia-9000-communicator-add-on-software","aos"],["application/x-omc","omc"],["application/x-omcdatamaker","omcd"],["application/x-omcregerator","omcr"],["application/x-pagemaker",["pm4","pm5"]],["application/x-pcl","pcl"],["application/x-perfmon",["pma","pmc","pml","pmr","pmw"]],["application/x-pixclscript","plx"],["application/x-pkcs10","p10"],["application/x-pkcs12",["p12","pfx"]],["application/x-pkcs7-certificates",["p7b","spc"]],["application/x-pkcs7-certreqresp","p7r"],["application/x-pkcs7-mime",["p7m","p7c"]],["application/x-pkcs7-signature",["p7s","p7a"]],["application/x-pointplus","css"],["application/x-portable-anymap","pnm"],["application/x-project",["mpc","mpt","mpv","mpx"]],["application/x-qpro","wb1"],["application/x-rar-compressed","rar"],["application/x-rtf","rtf"],["application/x-sdp","sdp"],["application/x-sea","sea"],["application/x-seelogo","sl"],["application/x-sh","sh"],["application/x-shar",["shar","sh"]],["application/x-shockwave-flash","swf"],["application/x-silverlight-app","xap"],["application/x-sit","sit"],["application/x-sprite",["spr","sprite"]],["application/x-stuffit","sit"],["application/x-stuffitx","sitx"],["application/x-sv4cpio","sv4cpio"],["application/x-sv4crc","sv4crc"],["application/x-tar","tar"],["application/x-tbook",["sbk","tbk"]],["application/x-tcl","tcl"],["application/x-tex","tex"],["application/x-tex-tfm","tfm"],["application/x-texinfo",["texi","texinfo"]],["application/x-troff",["roff","t","tr"]],["application/x-troff-man","man"],["application/x-troff-me","me"],["application/x-troff-ms","ms"],["application/x-troff-msvideo","avi"],["application/x-ustar","ustar"],["application/x-visio",["vsd","vst","vsw"]],["application/x-vnd.audioexplosion.mzz","mzz"],["application/x-vnd.ls-xpix","xpix"],["application/x-vrml","vrml"],["application/x-wais-source",["src","wsrc"]],["application/x-winhelp","hlp"],["application/x-wintalk","wtk"],["application/x-world",["wrl","svr"]],["application/x-wpwin","wpd"],["application/x-wri","wri"],["application/x-x509-ca-cert",["cer","crt","der"]],["application/x-x509-user-cert","crt"],["application/x-xfig","fig"],["application/x-xpinstall","xpi"],["application/x-zip-compressed","zip"],["application/xcap-diff+xml","xdf"],["application/xenc+xml","xenc"],["application/xhtml+xml","xhtml"],["application/xml","xml"],["application/xml-dtd","dtd"],["application/xop+xml","xop"],["application/xslt+xml","xslt"],["application/xspf+xml","xspf"],["application/xv+xml","mxml"],["application/yang","yang"],["application/yin+xml","yin"],["application/ynd.ms-pkipko","pko"],["application/zip","zip"],["audio/adpcm","adp"],["audio/aiff",["aiff","aif","aifc"]],["audio/basic",["snd","au"]],["audio/it","it"],["audio/make",["funk","my","pfunk"]],["audio/make.my.funk","pfunk"],["audio/mid",["mid","rmi"]],["audio/midi",["midi","kar","mid"]],["audio/mod","mod"],["audio/mp4","mp4a"],["audio/mpeg",["mpga","mp3","m2a","mp2","mpa","mpg"]],["audio/mpeg3","mp3"],["audio/nspaudio",["la","lma"]],["audio/ogg","oga"],["audio/s3m","s3m"],["audio/tsp-audio","tsi"],["audio/tsplayer","tsp"],["audio/vnd.dece.audio","uva"],["audio/vnd.digital-winds","eol"],["audio/vnd.dra","dra"],["audio/vnd.dts","dts"],["audio/vnd.dts.hd","dtshd"],["audio/vnd.lucent.voice","lvp"],["audio/vnd.ms-playready.media.pya","pya"],["audio/vnd.nuera.ecelp4800","ecelp4800"],["audio/vnd.nuera.ecelp7470","ecelp7470"],["audio/vnd.nuera.ecelp9600","ecelp9600"],["audio/vnd.qcelp","qcp"],["audio/vnd.rip","rip"],["audio/voc","voc"],["audio/voxware","vox"],["audio/wav","wav"],["audio/webm","weba"],["audio/x-aac","aac"],["audio/x-adpcm","snd"],["audio/x-aiff",["aiff","aif","aifc"]],["audio/x-au","au"],["audio/x-gsm",["gsd","gsm"]],["audio/x-jam","jam"],["audio/x-liveaudio","lam"],["audio/x-mid",["mid","midi"]],["audio/x-midi",["midi","mid"]],["audio/x-mod","mod"],["audio/x-mpeg","mp2"],["audio/x-mpeg-3","mp3"],["audio/x-mpegurl","m3u"],["audio/x-mpequrl","m3u"],["audio/x-ms-wax","wax"],["audio/x-ms-wma","wma"],["audio/x-nspaudio",["la","lma"]],["audio/x-pn-realaudio",["ra","ram","rm","rmm","rmp"]],["audio/x-pn-realaudio-plugin",["ra","rmp","rpm"]],["audio/x-psid","sid"],["audio/x-realaudio","ra"],["audio/x-twinvq","vqf"],["audio/x-twinvq-plugin",["vqe","vql"]],["audio/x-vnd.audioexplosion.mjuicemediafile","mjf"],["audio/x-voc","voc"],["audio/x-wav","wav"],["audio/xm","xm"],["chemical/x-cdx","cdx"],["chemical/x-cif","cif"],["chemical/x-cmdf","cmdf"],["chemical/x-cml","cml"],["chemical/x-csml","csml"],["chemical/x-pdb",["pdb","xyz"]],["chemical/x-xyz","xyz"],["drawing/x-dwf","dwf"],["i-world/i-vrml","ivr"],["image/bmp",["bmp","bm"]],["image/cgm","cgm"],["image/cis-cod","cod"],["image/cmu-raster",["ras","rast"]],["image/fif","fif"],["image/florian",["flo","turbot"]],["image/g3fax","g3"],["image/gif","gif"],["image/ief",["ief","iefs"]],["image/jpeg",["jpeg","jpe","jpg","jfif","jfif-tbnl"]],["image/jutvision","jut"],["image/ktx","ktx"],["image/naplps",["nap","naplps"]],["image/pict",["pic","pict"]],["image/pipeg","jfif"],["image/pjpeg",["jfif","jpe","jpeg","jpg"]],["image/png",["png","x-png"]],["image/prs.btif","btif"],["image/svg+xml","svg"],["image/tiff",["tif","tiff"]],["image/vasa","mcf"],["image/vnd.adobe.photoshop","psd"],["image/vnd.dece.graphic","uvi"],["image/vnd.djvu","djvu"],["image/vnd.dvb.subtitle","sub"],["image/vnd.dwg",["dwg","dxf","svf"]],["image/vnd.dxf","dxf"],["image/vnd.fastbidsheet","fbs"],["image/vnd.fpx","fpx"],["image/vnd.fst","fst"],["image/vnd.fujixerox.edmics-mmr","mmr"],["image/vnd.fujixerox.edmics-rlc","rlc"],["image/vnd.ms-modi","mdi"],["image/vnd.net-fpx",["fpx","npx"]],["image/vnd.rn-realflash","rf"],["image/vnd.rn-realpix","rp"],["image/vnd.wap.wbmp","wbmp"],["image/vnd.xiff","xif"],["image/webp","webp"],["image/x-cmu-raster","ras"],["image/x-cmx","cmx"],["image/x-dwg",["dwg","dxf","svf"]],["image/x-freehand","fh"],["image/x-icon","ico"],["image/x-jg","art"],["image/x-jps","jps"],["image/x-niff",["niff","nif"]],["image/x-pcx","pcx"],["image/x-pict",["pct","pic"]],["image/x-portable-anymap","pnm"],["image/x-portable-bitmap","pbm"],["image/x-portable-graymap","pgm"],["image/x-portable-greymap","pgm"],["image/x-portable-pixmap","ppm"],["image/x-quicktime",["qif","qti","qtif"]],["image/x-rgb","rgb"],["image/x-tiff",["tif","tiff"]],["image/x-windows-bmp","bmp"],["image/x-xbitmap","xbm"],["image/x-xbm","xbm"],["image/x-xpixmap",["xpm","pm"]],["image/x-xwd","xwd"],["image/x-xwindowdump","xwd"],["image/xbm","xbm"],["image/xpm","xpm"],["message/rfc822",["eml","mht","mhtml","nws","mime"]],["model/iges",["iges","igs"]],["model/mesh","msh"],["model/vnd.collada+xml","dae"],["model/vnd.dwf","dwf"],["model/vnd.gdl","gdl"],["model/vnd.gtw","gtw"],["model/vnd.mts","mts"],["model/vnd.vtu","vtu"],["model/vrml",["vrml","wrl","wrz"]],["model/x-pov","pov"],["multipart/x-gzip","gzip"],["multipart/x-ustar","ustar"],["multipart/x-zip","zip"],["music/crescendo",["mid","midi"]],["music/x-karaoke","kar"],["paleovu/x-pv","pvu"],["text/asp","asp"],["text/calendar","ics"],["text/css","css"],["text/csv","csv"],["text/ecmascript","js"],["text/h323","323"],["text/html",["html","htm","stm","acgi","htmls","htx","shtml"]],["text/iuls","uls"],["text/javascript","js"],["text/mcf","mcf"],["text/n3","n3"],["text/pascal","pas"],["text/plain",["txt","bas","c","h","c++","cc","com","conf","cxx","def","f","f90","for","g","hh","idc","jav","java","list","log","lst","m","mar","pl","sdml","text"]],["text/plain-bas","par"],["text/prs.lines.tag","dsc"],["text/richtext",["rtx","rt","rtf"]],["text/scriplet","wsc"],["text/scriptlet","sct"],["text/sgml",["sgm","sgml"]],["text/tab-separated-values","tsv"],["text/troff","t"],["text/turtle","ttl"],["text/uri-list",["uni","unis","uri","uris"]],["text/vnd.abc","abc"],["text/vnd.curl","curl"],["text/vnd.curl.dcurl","dcurl"],["text/vnd.curl.mcurl","mcurl"],["text/vnd.curl.scurl","scurl"],["text/vnd.fly","fly"],["text/vnd.fmi.flexstor","flx"],["text/vnd.graphviz","gv"],["text/vnd.in3d.3dml","3dml"],["text/vnd.in3d.spot","spot"],["text/vnd.rn-realtext","rt"],["text/vnd.sun.j2me.app-descriptor","jad"],["text/vnd.wap.wml","wml"],["text/vnd.wap.wmlscript","wmls"],["text/webviewhtml","htt"],["text/x-asm",["asm","s"]],["text/x-audiosoft-intra","aip"],["text/x-c",["c","cc","cpp"]],["text/x-component","htc"],["text/x-fortran",["for","f","f77","f90"]],["text/x-h",["h","hh"]],["text/x-java-source",["java","jav"]],["text/x-java-source,java","java"],["text/x-la-asf","lsx"],["text/x-m","m"],["text/x-pascal","p"],["text/x-script","hlb"],["text/x-script.csh","csh"],["text/x-script.elisp","el"],["text/x-script.guile","scm"],["text/x-script.ksh","ksh"],["text/x-script.lisp","lsp"],["text/x-script.perl","pl"],["text/x-script.perl-module","pm"],["text/x-script.phyton","py"],["text/x-script.rexx","rexx"],["text/x-script.scheme","scm"],["text/x-script.sh","sh"],["text/x-script.tcl","tcl"],["text/x-script.tcsh","tcsh"],["text/x-script.zsh","zsh"],["text/x-server-parsed-html",["shtml","ssi"]],["text/x-setext","etx"],["text/x-sgml",["sgm","sgml"]],["text/x-speech",["spc","talk"]],["text/x-uil","uil"],["text/x-uuencode",["uu","uue"]],["text/x-vcalendar","vcs"],["text/x-vcard","vcf"],["text/xml","xml"],["video/3gpp","3gp"],["video/3gpp2","3g2"],["video/animaflex","afl"],["video/avi","avi"],["video/avs-video","avs"],["video/dl","dl"],["video/fli","fli"],["video/gl","gl"],["video/h261","h261"],["video/h263","h263"],["video/h264","h264"],["video/jpeg","jpgv"],["video/jpm","jpm"],["video/mj2","mj2"],["video/mp4","mp4"],["video/mpeg",["mpeg","mp2","mpa","mpe","mpg","mpv2","m1v","m2v","mp3"]],["video/msvideo","avi"],["video/ogg","ogv"],["video/quicktime",["mov","qt","moov"]],["video/vdo","vdo"],["video/vivo",["viv","vivo"]],["video/vnd.dece.hd","uvh"],["video/vnd.dece.mobile","uvm"],["video/vnd.dece.pd","uvp"],["video/vnd.dece.sd","uvs"],["video/vnd.dece.video","uvv"],["video/vnd.fvt","fvt"],["video/vnd.mpegurl","mxu"],["video/vnd.ms-playready.media.pyv","pyv"],["video/vnd.rn-realvideo","rv"],["video/vnd.uvvu.mp4","uvu"],["video/vnd.vivo",["viv","vivo"]],["video/vosaic","vos"],["video/webm","webm"],["video/x-amt-demorun","xdr"],["video/x-amt-showrun","xsr"],["video/x-atomic3d-feature","fmf"],["video/x-dl","dl"],["video/x-dv",["dif","dv"]],["video/x-f4v","f4v"],["video/x-fli","fli"],["video/x-flv","flv"],["video/x-gl","gl"],["video/x-isvideo","isu"],["video/x-la-asf",["lsf","lsx"]],["video/x-m4v","m4v"],["video/x-motion-jpeg","mjpg"],["video/x-mpeg",["mp3","mp2"]],["video/x-mpeq2a","mp2"],["video/x-ms-asf",["asf","asr","asx"]],["video/x-ms-asf-plugin","asx"],["video/x-ms-wm","wm"],["video/x-ms-wmv","wmv"],["video/x-ms-wmx","wmx"],["video/x-ms-wvx","wvx"],["video/x-msvideo","avi"],["video/x-qtc","qtc"],["video/x-scm","scm"],["video/x-sgi-movie",["movie","mv"]],["windows/metafile","wmf"],["www/mime","mime"],["x-conference/x-cooltalk","ice"],["x-music/x-midi",["mid","midi"]],["x-world/x-3dmf",["3dm","3dmf","qd3","qd3d"]],["x-world/x-svr","svr"],["x-world/x-vrml",["flr","vrml","wrl","wrz","xaf","xof"]],["x-world/x-vrt","vrt"],["xgl/drawing","xgz"],["xgl/movie","xmz"]]),s=new Map([["123","application/vnd.lotus-1-2-3"],["323","text/h323"],["*","application/octet-stream"],["3dm","x-world/x-3dmf"],["3dmf","x-world/x-3dmf"],["3dml","text/vnd.in3d.3dml"],["3g2","video/3gpp2"],["3gp","video/3gpp"],["7z","application/x-7z-compressed"],["a","application/octet-stream"],["aab","application/x-authorware-bin"],["aac","audio/x-aac"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abc","text/vnd.abc"],["abw","application/x-abiword"],["ac","application/pkix-attr-cert"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acgi","text/html"],["acu","application/vnd.acucobol"],["acx","application/internet-property-stream"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afl","video/animaflex"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/postscript"],["aif",["audio/aiff","audio/x-aiff"]],["aifc",["audio/aiff","audio/x-aiff"]],["aiff",["audio/aiff","audio/x-aiff"]],["aim","application/x-aim"],["aip","text/x-audiosoft-intra"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["ani","application/x-navi-animation"],["aos","application/x-nokia-9000-communicator-add-on-software"],["apk","application/vnd.android.package-archive"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["aps","application/mime"],["arc","application/octet-stream"],["arj",["application/arj","application/octet-stream"]],["art","image/x-jg"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asp","text/asp"],["asr","video/x-ms-asf"],["asx",["video/x-ms-asf","application/x-mplayer2","video/x-ms-asf-plugin"]],["atc","application/vnd.acucorp"],["atomcat","application/atomcat+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au",["audio/basic","audio/x-au"]],["avi",["video/avi","video/msvideo","application/x-troff-msvideo","video/x-msvideo"]],["avs","video/avs-video"],["aw","application/applixware"],["axs","application/olescript"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azw","application/vnd.amazon.ebook"],["bas","text/plain"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin",["application/octet-stream","application/mac-binary","application/macbinary","application/x-macbinary","application/x-binary"]],["bm","image/bmp"],["bmi","application/vnd.bmi"],["bmp",["image/bmp","image/x-windows-bmp"]],["boo","application/book"],["book","application/book"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bsh","application/x-bsh"],["btif","image/prs.btif"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c",["text/plain","text/x-c"]],["c++","text/plain"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["c4g","application/vnd.clonk.c4group"],["cab","application/vnd.ms-cab-compressed"],["car","application/vnd.curl.car"],["cat",["application/vnd.ms-pkiseccat","application/vnd.ms-pki.seccat"]],["cc",["text/plain","text/x-c"]],["ccad","application/clariscad"],["cco","application/x-cocoa"],["ccxml","application/ccxml+xml,"],["cdbcmsg","application/vnd.contact.cmsg"],["cdf",["application/cdf","application/x-cdf","application/x-netcdf"]],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer",["application/pkix-cert","application/x-x509-ca-cert"]],["cgm","image/cgm"],["cha","application/x-chat"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cla","application/vnd.claymore"],["class",["application/octet-stream","application/java","application/java-byte-code","application/java-vm","application/x-java-class"]],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod",["image/cis-cod","application/vnd.rim.cod"]],["com",["application/octet-stream","text/plain"]],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt",["application/mac-compactpro","application/x-compactpro","application/x-cpt"]],["crd","application/x-mscardfile"],["crl",["application/pkix-crl","application/pkcs-crl"]],["crt",["application/pkix-cert","application/x-x509-user-cert","application/x-x509-ca-cert"]],["cryptonote","application/vnd.rig.cryptonote"],["csh",["text/x-script.csh","application/x-csh"]],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["css",["text/css","application/x-pointplus"]],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxx","text/plain"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["davmount","application/davmount+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["deb","application/x-debian-package"],["deepv","application/x-deepv"],["def","text/plain"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dif","video/x-dv"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["djvu","image/vnd.djvu"],["dl",["video/dl","video/x-dl"]],["dll","application/x-msdownload"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.document.macroenabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroenabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp",["application/commonground","application/vnd.osgi.dp"]],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drw","application/drafting"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dv","video/x-dv"],["dvi","application/x-dvi"],["dwf",["model/vnd.dwf","drawing/x-dwf"]],["dwg",["application/acad","image/vnd.dwg","image/x-dwg"]],["dxf",["application/dxf","image/vnd.dwg","image/vnd.dxf","image/x-dwg"]],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["el","text/x-script.elisp"],["elc",["application/x-elc","application/x-bytecode.elisp"]],["eml","message/rfc822"],["emma","application/emma+xml"],["env","application/x-envoy"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es",["application/ecmascript","application/x-esrehber"]],["es3","application/vnd.eszigno3+xml"],["esf","application/vnd.epson.esf"],["etx","text/x-setext"],["evy",["application/envoy","application/x-envoy"]],["exe",["application/octet-stream","application/x-msdownload"]],["exi","application/exi"],["ext","application/vnd.novadigm.ext"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f",["text/plain","text/x-fortran"]],["f4v","video/x-f4v"],["f77","text/x-fortran"],["f90",["text/plain","text/x-fortran"]],["fbs","image/vnd.fastbidsheet"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fh","image/x-freehand"],["fif",["application/fractals","image/fif"]],["fig","application/x-xfig"],["fli",["video/fli","video/x-fli"]],["flo",["image/florian","application/vnd.micrografx.flo"]],["flr","x-world/x-vrml"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fmf","video/x-atomic3d-feature"],["fnc","application/vnd.frogans.fnc"],["for",["text/plain","text/x-fortran"]],["fpx",["image/vnd.fpx","image/vnd.net-fpx"]],["frl","application/freeloader"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["funk","audio/make"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g","text/plain"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gdl","model/vnd.gdl"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["gl",["video/gl","video/x-gl"]],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gph","application/vnd.flographit"],["gqf","application/vnd.grafeq"],["gram","application/srgs"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsd","audio/x-gsm"],["gsf","application/x-font-ghostscript"],["gsm","audio/x-gsm"],["gsp","application/x-gsp"],["gss","application/x-gss"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxt","application/vnd.geonext"],["gz",["application/x-gzip","application/x-compressed"]],["gzip",["multipart/x-gzip","application/x-gzip"]],["h",["text/plain","text/x-h"]],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hdf","application/x-hdf"],["help","application/x-helpfile"],["hgl","application/vnd.hp-hpgl"],["hh",["text/plain","text/x-h"]],["hlb","text/x-script"],["hlp",["application/winhlp","application/hlp","application/x-helpfile","application/x-winhelp"]],["hpg","application/vnd.hp-hpgl"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx",["application/mac-binhex40","application/binhex","application/binhex4","application/mac-binhex","application/x-binhex40","application/x-mac-binhex40"]],["hta","application/hta"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["htmls","text/html"],["htt","text/webviewhtml"],["htx","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["ico","image/x-icon"],["ics","text/calendar"],["idc","text/plain"],["ief","image/ief"],["iefs","image/ief"],["ifm","application/vnd.shana.informed.formdata"],["iges",["application/iges","model/iges"]],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs",["application/iges","model/iges"]],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["iii","application/x-iphone"],["ima","application/x-ima"],["imap","application/x-httpd-imap"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["inf","application/inf"],["ins",["application/x-internet-signup","application/x-internett-signup"]],["ip","application/x-ip2"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["isp","application/x-internet-signup"],["isu","video/x-isvideo"],["it","audio/it"],["itp","application/vnd.shana.informed.formtemplate"],["iv","application/x-inventor"],["ivp","application/vnd.immervision-ivp"],["ivr","i-world/i-vrml"],["ivu","application/vnd.immervision-ivu"],["ivy","application/x-livescreen"],["jad","text/vnd.sun.j2me.app-descriptor"],["jam",["application/vnd.jam","audio/x-jam"]],["jar","application/java-archive"],["jav",["text/plain","text/x-java-source"]],["java",["text/plain","text/x-java-source,java","text/x-java-source"]],["jcm","application/x-java-commerce"],["jfif",["image/pipeg","image/jpeg","image/pjpeg"]],["jfif-tbnl","image/jpeg"],["jisp","application/vnd.jisp"],["jlt","application/vnd.hp-jlyt"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jpe",["image/jpeg","image/pjpeg"]],["jpeg",["image/jpeg","image/pjpeg"]],["jpg",["image/jpeg","image/pjpeg"]],["jpgv","video/jpeg"],["jpm","video/jpm"],["jps","image/x-jps"],["js",["application/javascript","application/ecmascript","text/javascript","text/ecmascript","application/x-javascript"]],["json","application/json"],["jut","image/jutvision"],["kar",["audio/midi","music/x-karaoke"]],["karbon","application/vnd.kde.karbon"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["ksh",["application/x-ksh","text/x-script.ksh"]],["ksp","application/vnd.kde.kspread"],["ktx","image/ktx"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["la",["audio/nspaudio","audio/x-nspaudio"]],["lam","audio/x-liveaudio"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["lha",["application/octet-stream","application/lha","application/x-lha"]],["lhx","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["lma",["audio/nspaudio","audio/x-nspaudio"]],["log","text/plain"],["lrm","application/vnd.ms-lrm"],["lsf","video/x-la-asf"],["lsp",["application/x-lisp","text/x-script.lisp"]],["lst","text/plain"],["lsx",["video/x-la-asf","text/x-la-asf"]],["ltf","application/vnd.frogans.ltf"],["ltx","application/x-latex"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh",["application/octet-stream","application/x-lzh"]],["lzx",["application/lzx","application/octet-stream","application/x-lzx"]],["m",["text/plain","text/x-m"]],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m1v","video/mpeg"],["m21","application/mp21"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3u",["audio/x-mpegurl","audio/x-mpequrl"]],["m3u8","application/vnd.apple.mpegurl"],["m4v","video/x-m4v"],["ma","application/mathematica"],["mads","application/mads+xml"],["mag","application/vnd.ecowin.chart"],["man","application/x-troff-man"],["map","application/x-navimap"],["mar","text/plain"],["mathml","application/mathml+xml"],["mbd","application/mbedlet"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc$","application/x-magic-cap-package-1.0"],["mc1","application/vnd.medcalcdata"],["mcd",["application/mcad","application/vnd.mcd","application/x-mathcad"]],["mcf",["image/vasa","text/mcf"]],["mcp","application/netmc"],["mcurl","text/vnd.curl.mcurl"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["me","application/x-troff-me"],["meta4","application/metalink4+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mht","message/rfc822"],["mhtml","message/rfc822"],["mid",["audio/mid","audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["midi",["audio/midi","music/crescendo","x-music/x-midi","audio/x-midi","application/x-midi","audio/x-mid"]],["mif",["application/vnd.mif","application/x-mif","application/x-frame"]],["mime",["message/rfc822","www/mime"]],["mj2","video/mj2"],["mjf","audio/x-vnd.audioexplosion.mjuicemediafile"],["mjpg","video/x-motion-jpeg"],["mlp","application/vnd.dolby.mlp"],["mm",["application/base64","application/x-meme"]],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mme","application/base64"],["mmf","application/vnd.smaf"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mny","application/x-msmoney"],["mod",["audio/mod","audio/x-mod"]],["mods","application/mods+xml"],["moov","video/quicktime"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2",["video/mpeg","audio/mpeg","video/x-mpeg","audio/x-mpeg","video/x-mpeq2a"]],["mp3",["audio/mpeg","audio/mpeg3","video/mpeg","audio/x-mpeg-3","video/x-mpeg"]],["mp4",["video/mp4","application/mp4"]],["mp4a","audio/mp4"],["mpa",["video/mpeg","audio/mpeg"]],["mpc",["application/vnd.mophun.certificate","application/x-project"]],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg",["video/mpeg","audio/mpeg"]],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/x-project"],["mpv","application/x-project"],["mpv2","video/mpeg"],["mpx","application/x-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","application/x-troff-ms"],["mscml","application/mediaservercontrol+xml"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msl","application/vnd.mobius.msl"],["msty","application/vnd.muvee.style"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musicxml","application/vnd.recordare.musicxml+xml"],["mv","video/x-sgi-movie"],["mvb","application/x-msmediaview"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["my","audio/make"],["mzz","application/x-vnd.audioexplosion.mzz"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nap","image/naplps"],["naplps","image/naplps"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncm","application/vnd.nokia.configuration-message"],["ncx","application/x-dtbncx+xml"],["ngdat","application/vnd.nokia.n-gage.data"],["nif","image/x-niff"],["niff","image/x-niff"],["nix","application/x-mix-transfer"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nvd","application/x-navidoc"],["nws","message/rfc822"],["o","application/octet-stream"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omc","application/x-omc"],["omcd","application/x-omcdatamaker"],["omcr","application/x-omcregerator"],["onetoc","application/onenote"],["opf","application/oebps-package+xml"],["org","application/vnd.lotus-organizer"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","application/x-font-otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p10",["application/pkcs10","application/x-pkcs10"]],["p12",["application/pkcs-12","application/x-pkcs12"]],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7m",["application/pkcs7-mime","application/x-pkcs7-mime"]],["p7r","application/x-pkcs7-certreqresp"],["p7s",["application/pkcs7-signature","application/x-pkcs7-signature"]],["p8","application/pkcs8"],["par","text/plain-bas"],["part","application/pro_eng"],["pas","text/pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcf","application/x-font-pcf"],["pcl",["application/vnd.hp-pcl","application/x-pcl"]],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb",["application/vnd.palm","chemical/x-pdb"]],["pdf","application/pdf"],["pfa","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfunk",["audio/make","audio/make.my.funk"]],["pfx","application/x-pkcs12"],["pgm",["image/x-portable-graymap","image/x-portable-greymap"]],["pgn","application/x-chess-pgn"],["pgp","application/pgp-signature"],["pic",["image/pict","image/x-pict"]],["pict","image/pict"],["pkg","application/x-newton-compatible-pkg"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pko",["application/ynd.ms-pkipko","application/vnd.ms-pki.pko"]],["pl",["text/plain","text/x-script.perl"]],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["plx","application/x-pixclscript"],["pm",["text/x-script.perl-module","image/x-xpixmap"]],["pm4","application/x-pagemaker"],["pm5","application/x-pagemaker"],["pma","application/x-perfmon"],["pmc","application/x-perfmon"],["pml",["application/vnd.ctc-posml","application/x-perfmon"]],["pmr","application/x-perfmon"],["pmw","application/x-perfmon"],["png","image/png"],["pnm",["application/x-portable-anymap","image/x-portable-anymap"]],["portpkg","application/vnd.macports.portpkg"],["pot",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["potm","application/vnd.ms-powerpoint.template.macroenabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["pov","model/x-pov"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroenabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps",["application/vnd.ms-powerpoint","application/mspowerpoint"]],["ppsm","application/vnd.ms-powerpoint.slideshow.macroenabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt",["application/vnd.ms-powerpoint","application/mspowerpoint","application/powerpoint","application/x-mspowerpoint"]],["pptm","application/vnd.ms-powerpoint.presentation.macroenabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["ppz","application/mspowerpoint"],["prc","application/x-mobipocket-ebook"],["pre",["application/vnd.lotus-freelance","application/x-freelance"]],["prf","application/pics-rules"],["prt","application/pro_eng"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd",["application/octet-stream","image/vnd.adobe.photoshop"]],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pvu","paleovu/x-pv"],["pwn","application/vnd.3m.post-it-notes"],["pwz","application/vnd.ms-powerpoint"],["py","text/x-script.phyton"],["pya","audio/vnd.ms-playready.media.pya"],["pyc","application/x-bytecode.python"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qcp","audio/vnd.qcelp"],["qd3","x-world/x-3dmf"],["qd3d","x-world/x-3dmf"],["qfx","application/vnd.intu.qfx"],["qif","image/x-quicktime"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qtc","video/x-qtc"],["qti","image/x-quicktime"],["qtif","image/x-quicktime"],["qxd","application/vnd.quark.quarkxpress"],["ra",["audio/x-realaudio","audio/x-pn-realaudio","audio/x-pn-realaudio-plugin"]],["ram","audio/x-pn-realaudio"],["rar","application/x-rar-compressed"],["ras",["image/cmu-raster","application/x-cmu-raster","image/x-cmu-raster"]],["rast","image/cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rexx","text/x-script.rexx"],["rf","image/vnd.rn-realflash"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm",["application/vnd.rn-realmedia","audio/x-pn-realaudio"]],["rmi","audio/mid"],["rmm","audio/x-pn-realaudio"],["rmp",["audio/x-pn-realaudio-plugin","audio/x-pn-realaudio"]],["rms","application/vnd.jcp.javame.midlet-rms"],["rnc","application/relax-ng-compact-syntax"],["rng",["application/ringing-tones","application/vnd.nokia.ringing-tone"]],["rnx","application/vnd.rn-realplayer"],["roff","application/x-troff"],["rp","image/vnd.rn-realpix"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsd","application/rsd+xml"],["rt",["text/richtext","text/vnd.rn-realtext"]],["rtf",["application/rtf","text/richtext","application/x-rtf"]],["rtx",["text/richtext","application/rtf"]],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["saveme","application/octet-stream"],["sbk","application/x-tbook"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm",["application/vnd.lotus-screencam","video/x-scm","text/x-script.guile","application/x-lotusscreencam","text/x-script.scheme"]],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["sct","text/scriptlet"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkm","application/vnd.solent.sdkm+xml"],["sdml","text/plain"],["sdp",["application/sdp","application/x-sdp"]],["sdr","application/sounder"],["sdw","application/vnd.stardivision.writer"],["sea",["application/sea","application/x-sea"]],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["ser","application/java-serialized-object"],["set","application/set"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sgl","application/vnd.stardivision.writer-global"],["sgm",["text/sgml","text/x-sgml"]],["sgml",["text/sgml","text/x-sgml"]],["sh",["application/x-shar","application/x-bsh","application/x-sh","text/x-script.sh"]],["shar",["application/x-bsh","application/x-shar"]],["shf","application/shf+xml"],["shtml",["text/html","text/x-server-parsed-html"]],["sid","audio/x-psid"],["sis","application/vnd.symbian.install"],["sit",["application/x-stuffit","application/x-sit"]],["sitx","application/x-stuffitx"],["skd","application/x-koan"],["skm","application/x-koan"],["skp",["application/vnd.koan","application/x-koan"]],["skt","application/x-koan"],["sl","application/x-seelogo"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi",["application/smil","application/smil+xml"]],["smil","application/smil"],["snd",["audio/basic","audio/x-adpcm"]],["snf","application/x-font-snf"],["sol","application/solids"],["spc",["text/x-speech","application/x-pkcs7-certificates"]],["spf","application/vnd.yamaha.smaf-phrase"],["spl",["application/futuresplash","application/x-futuresplash"]],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spr","application/x-sprite"],["sprite","application/x-sprite"],["src","application/x-wais-source"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssi","text/x-server-parsed-html"],["ssm","application/streamingmedia"],["ssml","application/ssml+xml"],["sst",["application/vnd.ms-pkicertstore","application/vnd.ms-pki.certstore"]],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["step","application/step"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl",["application/vnd.ms-pkistl","application/sla","application/vnd.ms-pki.stl","application/x-navistyle"]],["stm","text/html"],["stp","application/step"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["sub","image/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svf",["image/vnd.dwg","image/x-dwg"]],["svg","image/svg+xml"],["svr",["x-world/x-svr","application/x-world"]],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t",["text/troff","application/x-troff"]],["talk","text/x-speech"],["tao","application/vnd.tao.intent-module-archive"],["tar","application/x-tar"],["tbk",["application/toolbook","application/x-tbook"]],["tcap","application/vnd.3gpp2.tcap"],["tcl",["text/x-script.tcl","application/x-tcl"]],["tcsh","text/x-script.tcsh"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text",["application/plain","text/plain"]],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tgz",["application/gnutar","application/x-compressed"]],["thmx","application/vnd.ms-officetheme"],["tif",["image/tiff","image/x-tiff"]],["tiff",["image/tiff","image/x-tiff"]],["tmo","application/vnd.tmobile-livetv"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","application/x-troff"],["tra","application/vnd.trueapp"],["trm","application/x-msterminal"],["tsd","application/timestamped-data"],["tsi","audio/tsp-audio"],["tsp",["application/dsptype","audio/tsplayer"]],["tsv","text/tab-separated-values"],["ttf","application/x-font-ttf"],["ttl","text/turtle"],["turbot","image/florian"],["twd","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["ufd","application/vnd.ufdl"],["uil","text/x-uil"],["uls","text/iuls"],["umj","application/vnd.umajin"],["uni","text/uri-list"],["unis","text/uri-list"],["unityweb","application/vnd.unity"],["unv","application/i-deas"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["ustar",["application/x-ustar","multipart/x-ustar"]],["utz","application/vnd.uiq.theme"],["uu",["application/octet-stream","text/x-uuencode"]],["uue","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vda","application/vda"],["vdo","video/vdo"],["vew","application/groupwise"],["vis","application/vnd.visionary"],["viv",["video/vivo","video/vnd.vivo"]],["vivo",["video/vivo","video/vnd.vivo"]],["vmd","application/vocaltec-media-desc"],["vmf","application/vocaltec-media-file"],["voc",["audio/voc","audio/x-voc"]],["vos","video/vosaic"],["vox","audio/voxware"],["vqe","audio/x-twinvq-plugin"],["vqf","audio/x-twinvq"],["vql","audio/x-twinvq-plugin"],["vrml",["model/vrml","x-world/x-vrml","application/x-vrml"]],["vrt","x-world/x-vrt"],["vsd",["application/vnd.visio","application/x-visio"]],["vsf","application/vnd.vsf"],["vst","application/x-visio"],["vsw","application/x-visio"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w60","application/wordperfect6.0"],["w61","application/wordperfect6.1"],["w6w","application/msword"],["wad","application/x-doom"],["wav",["audio/wav","audio/x-wav"]],["wax","audio/x-ms-wax"],["wb1","application/x-qpro"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/vnd.wap.wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["web","application/vnd.xara"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wiz","application/msword"],["wk1","application/x-123"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf",["windows/metafile","application/x-msmetafile"]],["wml","text/vnd.wap.wml"],["wmlc","application/vnd.wap.wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-ms-wmz"],["woff","application/x-font-woff"],["word","application/msword"],["wp","application/wordperfect"],["wp5",["application/wordperfect","application/wordperfect6.0"]],["wp6","application/wordperfect"],["wpd",["application/wordperfect","application/vnd.wordperfect","application/x-wpwin"]],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wq1","application/x-lotus"],["wqd","application/vnd.wqd"],["wri",["application/mswrite","application/x-wri","application/x-mswrite"]],["wrl",["model/vrml","x-world/x-vrml","application/x-world"]],["wrz",["model/vrml","x-world/x-vrml"]],["wsc","text/scriplet"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wsrc","application/x-wais-source"],["wtb","application/vnd.webturbo"],["wtk","application/x-wintalk"],["wvx","video/x-ms-wvx"],["x-png","image/png"],["x3d","application/vnd.hzn-3d-crossword"],["xaf","x-world/x-vrml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm",["image/xbm","image/x-xbm","image/x-xbitmap"]],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdr","video/x-amt-demorun"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xgz","xgl/drawing"],["xhtml","application/xhtml+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlam","application/vnd.ms-excel.addin.macroenabled.12"],["xlb",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlc",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xld",["application/excel","application/x-excel"]],["xlk",["application/excel","application/x-excel"]],["xll",["application/excel","application/vnd.ms-excel","application/x-excel"]],["xlm",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xls",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xlsb","application/vnd.ms-excel.sheet.binary.macroenabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroenabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt",["application/vnd.ms-excel","application/excel","application/x-excel"]],["xltm","application/vnd.ms-excel.template.macroenabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlv",["application/excel","application/x-excel"]],["xlw",["application/vnd.ms-excel","application/excel","application/x-msexcel","application/x-excel"]],["xm","audio/xm"],["xml",["application/xml","text/xml","application/atom+xml","application/rss+xml"]],["xmz","xgl/movie"],["xo","application/vnd.olpc-sugar"],["xof","x-world/x-vrml"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpix","application/x-vnd.ls-xpix"],["xpm",["image/xpm","image/x-xpixmap"]],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xsr","video/x-amt-showrun"],["xul","application/vnd.mozilla.xul+xml"],["xwd",["image/x-xwd","image/x-xwindowdump"]],["xyz",["chemical/x-xyz","chemical/x-pdb"]],["yang","application/yang"],["yin","application/yin+xml"],["z",["application/x-compressed","application/x-compress"]],["zaz","application/vnd.zzazz.deck+xml"],["zip",["application/zip","multipart/x-zip","application/x-zip-compressed","application/x-compressed"]],["zir","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zoo","application/octet-stream"],["zsh","text/x-script.zsh"]]);return Uu}var Vu,_u={exports:{}},Ru={exports:{}},Qu={},Ju={};function $u(){if(Vu)return Ju;Vu=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.Encoder=void 0,Ju.encode=t,Ju.wrap=i;const e=M;function t(e){return"string"==typeof e&&(e=Buffer.from(e,"utf-8")),e.toString("base64")}function i(e,t){if(e=(e||"").toString(),t=Math.max(Number(t)||76,1),e.length<=t)return e;const i=[];let n=0;const r=1024*t,s=new RegExp(".{"+t+"}","g");for(;n<e.length;){const t=e.substr(n,r).replace(s,"$&\r\n").trim();i.push(t),n+=r}return i.join("\r\n").trim()}class n extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this._remainingBytes=!1,this.inputBytes=0,this.outputBytes=0}_transform(e,n,r){let s="buffer"!==n?Buffer.from(e,n):e;if(!s||!s.length)return void setImmediate(r);this.inputBytes+=s.length,this._remainingBytes&&this._remainingBytes.length&&(s=Buffer.concat([this._remainingBytes,s],this._remainingBytes.length+s.length),this._remainingBytes=!1),s.length%3?(this._remainingBytes=s.slice(s.length-s.length%3),s=s.slice(0,s.length-s.length%3)):this._remainingBytes=!1;let o=this._curLine+t(s);if(this.options.lineLength){o=i(o,this.options.lineLength);const e=o.lastIndexOf("\n");e<0?(this._curLine=o,o=""):e===o.length-1?this._curLine="":(this._curLine=o.substring(e+1),o=o.substring(0,e+1))}o&&(this.outputBytes+=o.length,this.push(Buffer.from(o,"ascii"))),setImmediate(r)}_flush(e){this._remainingBytes&&this._remainingBytes.length&&(this._curLine+=t(this._remainingBytes)),this._curLine&&(this._curLine=i(this._curLine,this.options.lineLength),this.outputBytes+=this._curLine.length,this.push(Buffer.from(this._curLine,"ascii")),this._curLine=""),e()}}return Ju.Encoder=n,Ju}var qu,ep,tp={};function ip(){if(qu)return tp;qu=1,Object.defineProperty(tp,"__esModule",{value:!0}),tp.Encoder=void 0,tp.encode=n,tp.wrap=r;const e=M,t=4,i=[[9],[10],[13],[32,60],[62,126]];function n(e){"string"==typeof e&&(e=Buffer.from(e,"utf-8"));let t,n="";for(let r=0,o=e.length;r<o;r++)t=e[r],s(t,i)&&(32!==t&&9!==t||r!==o-1&&10!==e[r+1]&&13!==e[r+1])?n+=String.fromCharCode(t):n+="="+(t<16?"0":"")+t.toString(16).toUpperCase();return n}function r(e,i){if(e=(e||"").toString(),i=Math.max(Number(i)||76,t),e.length<=i)return e;let n=0;const r=e.length;let s,o,a;const c=Math.floor(i/3);let l="";for(;n<r;)if(a=e.substr(n,i),s=a.match(/\r\n/))a=a.substr(0,s.index+s[0].length),l+=a,n+=a.length;else if("\n"!==a.substr(-1))if(s=a.substr(-c).match(/\n.*?$/))a=a.substr(0,a.length-(s[0].length-1)),l+=a,n+=a.length;else{if(a.length>i-c&&(s=a.substr(-c).match(/[ \t.,!?][^ \t.,!?]*$/)))a=a.substr(0,a.length-(s[0].length-1));else if(a.match(/[=][\da-f]{0,2}$/i))for((s=a.match(/[=][\da-f]{0,1}$/i))&&(a=a.substr(0,a.length-s[0].length));a.length>3&&a.length<r-n&&!a.match(/^(?:=[\da-f]{2}){1,4}$/i)&&(s=a.match(/[=][\da-f]{2}$/gi))&&(o=parseInt(s[0].substr(1,2),16),!(o<128))&&(a=a.substr(0,a.length-3),!(o>=192)););a.length||(a=e.substr(n,i)),n+a.length<r&&"\n"!==a.substr(-1)?(a.length===i&&a.match(/[=][\da-f]{2}$/i)?a=a.substr(0,a.length-3):a.length===i&&(a=a.substr(0,a.length-1)),n+=a.length,a+="=\r\n"):n+=a.length,l+=a}else l+=a,n+=a.length;return l}function s(e,t){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.length){if(1===n.length&&e===n[0])return!0;if(2===n.length&&e>=n[0]&&e<=n[1])return!0}}return!1}class o extends e.Transform{constructor(e){super(),this.options=e||{},!1!==this.options.lineLength&&(this.options.lineLength=this.options.lineLength||76),this._curLine="",this.inputBytes=0,this.outputBytes=0}_transform(e,t,i){let s;if("buffer"!==t&&(e=Buffer.from(e,t)),!e||!e.length)return i();this.inputBytes+=e.length,this.options.lineLength?(s=this._curLine+n(e),s=r(s,this.options.lineLength),s=s.replace(/(^|\n)([^\n]*)$/,(e,t,i)=>(this._curLine=i,t)),s&&(this.outputBytes+=s.length,this.push(s))):(s=n(e),this.outputBytes+=s.length,this.push(s,"ascii")),i()}_flush(e){this._curLine&&(this.outputBytes+=this._curLine.length,this.push(this._curLine,"ascii")),e()}}return tp.Encoder=o,tp}function np(){if(ep)return Qu;ep=1;var e,t=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),i=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=jn&&jn.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},e(t)},function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var s=e(n),o=0;o<s.length;o++)"default"!==s[o]&&t(r,n,s[o]);return i(r,n),r});Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.isPlainText=c,Qu.quoteString=function(e){return'"'+(e||"").toString().replace(/["\\]/g,"\\$&")+'"'},Qu.hasLongerLines=function(e,t){if(e.length>131072)return!0;return new RegExp("^.{"+(t+1)+",}","m").test(e)},Qu.encodeWord=l,Qu.encodeWords=function(e,t,i,n){i=i||0;const r=e.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);if(!r)return e;if(n)return l(e,t,i);const s=e.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);if(!s)return e;const o=r.index+(r[0].match(/[^\s]/)||{index:0}).index,a=s.index+(s[1]||"").length;return(o?e.substr(0,o):"")+l(e.substring(o,a),t||"Q",i)+(a<e.length?e.substr(a):"")},Qu.buildHeaderValue=function(e){const t=[];Object.keys(e.params||{}).forEach(i=>{const n=e.params[i],r=i.replace(/[\x00-\x1f\x7f]/g,"");!c(n,!0)||n.length>=75?u(r,n,50).forEach(e=>{/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(e.value)&&"*"!==e.key.substr(-1)?t.push(e.key+"="+JSON.stringify(e.value)):t.push(e.key+"="+e.value)}):/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n)?t.push(r+"="+JSON.stringify(n)):t.push(r+"="+n)});return("string"==typeof e.value?e.value.replace(/[\x00-\x1f\x7f]/g,""):e.value)+(t.length?"; "+t.join("; "):"")},Qu.buildHeaderParam=u,Qu.parseHeaderValue=function(e){const t={value:"",params:{}},i=(e,i)=>{(0,a.isProtoKey)(e)||(t.params[e]=i)};let n,r=!1,s="",o="value",c=!1,l=!1;for(let a=0,u=e.length;a<u;a++)if(n=e.charAt(a),"key"===o){if("="===n){r=s.trim().toLowerCase(),o="value",s="";continue}s+=n}else{if(l)s+=n;else{if("\\"===n){l=!0;continue}c&&n===c?c=!1:c||'"'!==n?c||";"!==n?s+=n:(!1===r?t.value=s.trim():i(r,s.trim()),o="key",s=""):c=n}l=!1}"value"===o?!1===r?t.value=s.trim():i(r,s.trim()):s.trim()&&i(s.trim().toLowerCase(),"");return Object.keys(t.params).forEach(e=>{let i,n,r,s;if(r=e.match(/(\*(\d+)|\*(\d+)\*|\*)$/)){if(i=e.substr(0,r.index),n=Number(r[2]||r[3])||0,(0,a.isProtoKey)(i))return void delete t.params[e];t.params[i]&&"object"==typeof t.params[i]||(t.params[i]={charset:!1,values:[]}),s=t.params[e],0===n&&"*"===r[0].substr(-1)&&(r=s.match(/^([^']*)'[^']*'(.*)$/))&&(t.params[i].charset=r[1]||"iso-8859-1",s=r[2]),t.params[i].values[n]=s,delete t.params[e]}}),Object.keys(t.params).forEach(e=>{let i;t.params[e]&&Array.isArray(t.params[e].values)&&(i=t.params[e].values.map(e=>e||"").join(""),t.params[e].charset?t.params[e]="=?"+t.params[e].charset+"?Q?"+i.replace(/[=?_\s]/g,e=>{const t=e.charCodeAt(0).toString(16);return" "===e?"_":"%"+(t.length<2?"0":"")+t}).replace(/%/g,"=")+"?=":t.params[e]=i)}),t},Qu.detectExtension=function(e){return o.detectExtension(e)},Qu.detectMimeType=function(e){return o.detectMimeType(e)},Qu.foldLines=function(e,t,i){e=(e||"").toString(),t=t||76;let n=0;const r=e.length;let s,o,a="";for(;n<r;){if(s=e.substr(n,t),s.length<t){a+=s;break}(o=s.match(/^[^\n\r]*(\r?\n|\r)/))?(s=o[0],a+=s,n+=s.length):((o=s.match(/(\s+)[^\s]*$/))&&o[0].length-(i?(o[1]||"").length:0)<s.length?s=s.substr(0,s.length-(o[0].length-(i?(o[1]||"").length:0))):(o=e.substr(n+s.length).match(/^[^\s]+(\s*)/))&&(s+=o[0].substr(0,o[0].length-(i?0:(o[1]||"").length))),a+=s,n+=s.length,n<r&&(a+="\r\n"))}return a},Qu.splitMimeEncodedString=p,Qu.encodeURICharComponent=d,Qu.safeEncodeURIComponent=m;const r=n($u()),s=n(ip()),o=n(Bu()),a=Wu();function c(e,t){return"string"==typeof e&&!(t?/[\x00-\x1f\x7f"\u0080-\uFFFF]/:/[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/).test(e)}function l(e,t,i){let n;if((i=i||0)&&i>12&&(i-=12),"Q"===(t=(t||"Q").toString().toUpperCase().trim().charAt(0))?n=s.encode(e).replace(/[^a-z0-9!*+\-/=]/gi,e=>{const t=e.charCodeAt(0).toString(16).toUpperCase();return" "===e?"_":"="+(1===t.length?"0"+t:t)}):"B"===t&&(n="string"==typeof e?e:e.toString("utf-8"),i=i?Math.max(3,(i-i%4)/4*3):0),i&&("B"!==t?n:r.encode(e)).length>i)if("Q"===t)n=p(n,i).join("?= =?UTF-8?"+t+"?");else{const e=[];let s="";for(let t=0,o=n.length;t<o;t++){let o=n.charAt(t);/[\ud800-\udbff]/.test(o)&&/[\udc00-\udfff]/.test(n.charAt(t+1))&&(o+=n.charAt(++t)),Buffer.byteLength(s+o)<=i||0===t?s+=o:(e.push(r.encode(s)),s=o)}s&&e.push(r.encode(s)),n=e.length>1?e.join("?= =?UTF-8?"+t+"?"):e.join("")}else"B"===t&&(n=r.encode(e));return"=?UTF-8?"+t+"?"+n+("?="===n.substr(-2)?"":"?=")}function u(e,t,i){const n=[];let r,s,o,a,l="string"==typeof t?t:(t||"").toString(),u=0;if(i=i||50,c(t,!0)){if(l.length<=i)return[{key:e,value:l}];l=l.replace(new RegExp(".{"+i+"}","g"),e=>(n.push({line:e}),"")),l&&n.push({line:l})}else{if(/[\uD800-\uDBFF]/.test(l)){const e=[];for(o=0,a=l.length;o<a;o++)r=l.charAt(o),/[\ud800-\udbff]/.test(r)&&/[\udc00-\udfff]/.test(l.charAt(o+1))?(r+=l.charAt(o+1),e.push(r),o++):e.push(r);l=e}s="utf-8''";let e=!0;for(u=0,o=0,a=l.length;o<a;o++){if(r=l[o],e)r=m(r);else if(r=" "===r?r:m(r),r!==l[o]){if(!((m(s)+r).length>=i)){e=!0,o=u,s="";continue}n.push({line:s,encoded:e}),s="",e=!0}(s+r).length>=i?(n.push({line:s,encoded:e}),s=r=" "===l[o]?" ":m(l[o]),r===l[o]?(e=!1,u=o-1):e=!0):s+=r}s&&n.push({line:s,encoded:e})}return n.map((t,i)=>({key:e+"*"+i+(t.encoded?"*":""),value:t.line}))}function p(e,t){const i=[];let n,r,s,o,a;for(t=Math.max(t||0,12);e.length;){for(n=e.substr(0,t),(s=n.match(/[=][0-9A-F]?$/i))&&(n=n.substr(0,s.index)),r=n.length?n:e.substr(0,t),a=!1;!a&&n.length;)a=!0,(s=e.substr(n.length).match(/^[=]([0-9A-F]{2})/i))&&(o=parseInt(s[1],16),o<194&&o>127&&(n=n.substr(0,n.length-3),a=!1));n.length||(n=r),i.push(n),e=e.substr(n.length)}return i}function d(e){let t="",i=e.charCodeAt(0).toString(16).toUpperCase();if(i.length%2&&(i="0"+i),i.length>2)for(let e=0,n=i.length/2;e<n;e++)t+="%"+i.substr(e,2);else t+="%"+i;return t}function m(e){e=(e||"").toString();try{e=encodeURIComponent(e)}catch(t){e=encodeURIComponent(Buffer.from(e,"utf-8").toString("utf-8"))}return e.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g,e=>d(e))}return Qu}var rp,sp={exports:{}};function op(){return rp||(rp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=/\s/,n=/^("(?:[^"\\]|\\[\s\S])*"@\S+)(?:\s+([\s\S]+))?$/,r=/^[^@\s]+@[^@\s]+$/,s=/^[^@\s]+@\S+$/,o=/\s*\b[^@\s]+@[^\s]+\b\s*/y;function a(e){return 32===e||e>=9&&e<=13||160===e||5760===e||e>=8192&&e<=8202||8232===e||8233===e||8239===e||8287===e||12288===e||65279===e}function c(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||95===e}function l(e,t){return c(e.charCodeAt(t-1))!==c(e.charCodeAt(t))}function u(e,t,i){for(let n=t;n<i;n++)if(64===e.charCodeAt(n))return n;return-1}function p(e){const t=e.length;let i=0;for(;i<t;){for(;i<t&&a(e.charCodeAt(i));)i++;if(i>=t)break;const n=i;let r=i;for(;r<t&&!a(e.charCodeAt(r));)r++;let s=u(e,n,r);if(s>=0){let t=-1;for(let i=r;i>n;i--)if(l(e,i)){t=i;break}let i=n;for(;t>=0&&s>=0;){if(s>i&&r>s+1&&t>s+1)for(let t=i;t<s;t++)if(l(e,t)){if(t>n)return t;let i=n;for(;i>0&&a(e.charCodeAt(i-1));)i--;return i}i=s+1,s=u(e,i,r)}}i=r}return-1}function d(e){const t=[];let i="",n="",r=0,s="",o="";for(let a=0,c=e.length;a<c;a++){const l=e.charAt(a);if(r)"\\"===l&&a<c-1?n+=e.charAt(++a):"("===l?(r++,n+=l):")"!==l||--r?n+=l:(t.push(n.trim()),n="","@"!==o&&"@"!==e.charAt(a+1)&&(i+=" ",o=" "));else{if(s){if("\\"===l&&'"'===s&&a<c-1){i+=l+e.charAt(++a),o=e.charAt(a);continue}l===s&&(s="")}else if('"'===l)s='"';else if("["===l)s="]";else if("("===l){r=1;continue}i+=l,o=l}}return r&&t.push(n.trim()),{address:i.trim(),comments:t.filter(e=>e)}}function m(e,t){let a=!1,c="text";const l=[],u={address:[],comment:[],group:[],text:[],textWasQuoted:[]};let m=!1;const h={address:"",comment:"",group:"",text:""};for(let t=0,i=e.length;t<i;t++){const i=e[t],n=t?e[t-1]:null;if("operator"===i.type)switch(i.value){case"<":c="address",m=!1;break;case"(":c="comment",m=!1;break;case":":c="group",a=!0,m=!1;break;case'"':m=!m,c="text";break;default:c="text",m=!1}else if(i.value){const r=t>1?e[t-2]:null,s="operator"===n?.type&&'"'===n.value&&!!n.noBreak&&"operator"===r?.type&&'"'===r.value;"address"===c&&(i.value=i.value.replace(/^[^<]*<\s*/,""));const o=u[c];n&&n.noBreak&&o.length&&(")"!==n.value||"@"===h[c]||"@"===i.value.charAt(0))?(u[c][u[c].length-1]+=i.value,i.value&&(h[c]=i.value.charAt(i.value.length-1)),"text"===c&&m&&(u.textWasQuoted[u.textWasQuoted.length-1]=!0)):(u[c].push(i.value),h[c]=i.value.charAt(i.value.length-1),"text"===c&&u.textWasQuoted.push(m||s))}}if(!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),a){u.text=u.text.join(" ");let e=[];if(u.group.length){g(u.group.join(","),{_depth:t+1}).forEach(t=>{t.group?e=e.concat(t.group):e.push(t)})}l.push({name:u.text||"",group:e})}else{const e=[],t=[];for(const i of u.address){if(i.indexOf("(")<0){t.push(i);continue}const n=d(i);for(const t of n.comments)e.push(t);n.address&&t.push(n.address)}if(u.address=t,!u.address.length&&u.text.length){for(let e=u.text.length-1;e>=0;e--)if(!u.textWasQuoted[e]&&r.test(u.text[e])){u.address=u.text.splice(e,1),u.textWasQuoted.splice(e,1);break}if(!u.address.length){let e=!1;for(let t=u.text.length-1;t>=0;t--)if(!u.textWasQuoted[t]){const i=u.text[t];let n=i;const r=p(i);if(r>=0){o.lastIndex=r;const t=o.exec(i);t&&(u.address=[t[0].trim()],e=!0,n=i.slice(0,r)+" "+i.slice(r+t[0].length))}if(u.text[t]=n.trim(),e)break}}}!u.text.length&&u.comment.length&&(u.text=u.comment,u.comment=[]),u.address.length>1&&(u.text=u.text.concat(u.address.splice(1)));const a=!u.address.length&&u.textWasQuoted.some(e=>e);u.text=u.text.join(" "),u.address=u.address.join(" "),a&&u.text&&(u.address=function(e){const t=e.lastIndexOf("@");if(t<0)return e;const i=e.substr(0,t);return/^[^\s"(),:;<>@[\\\]]+$/.test(i)||/^"(?:[^"\\]|\\[\s\S])*"$/.test(i)?e:'"'+i.replace(/["\\]/g,"\\$&")+'"@'+e.substr(t+1)}(u.text),u.text=""),function(e){if(!i.test(e.address))return;let t,o;const a=e.address.match(n);if(a){if(!a[2])return;t=a[1],o=[a[2]]}else{if(e.address.indexOf('"')>=0)return;const i=e.address.split(/\s+/);let n=i.findIndex(e=>r.test(e));if(n<0&&(n=i.findIndex(e=>s.test(e))),n<0)return;t=i.splice(n,1)[0],o=i}e.address=t,e.text=[e.text].concat(o).filter(e=>e).join(" ")}(u),!u.text&&e.length&&(u.text=e.join(" "));const c={address:u.address||u.text||"",name:u.text||u.address||""};c.address===c.name&&(/@/.test(c.address||"")?c.name="":c.address=""),l.push(c)}return l}class h{constructor(e){this.str=(e||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.inDomainLiteral=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){const e=[];for(let e=0,t=this.str.length;e<t;e++){const i=this.str.charAt(e),n=e<t-1?this.str.charAt(e+1):null;this.checkChar(i,n)}return this.list.forEach(t=>{t.value=(t.value||"").toString().trim(),t.value&&e.push(t)}),e}checkChar(e,t){if(this.escaped||this.operatorExpecting||(this.inDomainLiteral||"["!==e?!this.inDomainLiteral||"]"!==e&&","!==e&&";"!==e||(this.inDomainLiteral=!1):this.inDomainLiteral=!0),this.escaped);else{if(e===this.operatorExpecting)return this.node={type:"operator",value:e},t&&![" ","\t","\r","\n",",",";"].includes(t)&&(this.node.noBreak=!0),this.list.push(this.node),this.node=null,this.operatorExpecting="",void(this.escaped=!1);if(!this.operatorExpecting&&!this.inDomainLiteral&&e in this.operators)return this.node={type:"operator",value:e},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[e],void(this.escaped=!1);if(['"',"'"].includes(this.operatorExpecting)&&"\\"===e)return void(this.escaped=!0)}this.node||(this.node={type:"text",value:""},this.list.push(this.node)),"\n"===e&&(e=" "),(e.charCodeAt(0)>=33||[" ","\t"].includes(e))&&(this.node.value+=e),this.escaped=!1}}const f=50;function g(e,t){const i=(t=t||{})._depth||0;if(i>f)return[];const n=new h(e).tokenize(),r=[];let s=[],o=[];n.forEach(e=>{"operator"!==e.type||","!==e.value&&";"!==e.value?s.push(e):(s.length&&r.push(s),s=[])}),s.length&&r.push(s),r.forEach(e=>{const t=m(e,i);for(let e=0;e<t.length;e++)o.push(t[e])});const a=[];for(let e=o.length-1;e>=0;e--){const t=o[e],i=a.length?a[a.length-1]:null;i&&""===t.address&&t.name&&!t.group&&i.address&&i.name?i.name=t.name+", "+i.name:a.push(t)}if(a.reverse(),o=a,t.flatten){const e=[],t=i=>{i.forEach(i=>{if(i.group)return t(i.group);e.push(i)})};return t(o),e}return o}t.default=g,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(sp,sp.exports)),sp.exports}var ap,cp={exports:{}};var lp,up={exports:{}};function pp(){return lp||(lp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e),this.lastByte=!1}_transform(e,t,i){let n,r=0;for(let t=0,i=e.length;t<i;t++)10===e[t]&&(t&&13!==e[t-1]||!t&&13!==this.lastByte)&&(t>r&&(n=e.slice(r,t),this.push(n)),this.push(Buffer.from("\r\n")),r=t+1);r&&r<e.length?(n=e.slice(r),this.push(n)):r||this.push(e),this.lastByte=e[e.length-1],i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(up,up.exports)),up.exports}var dp,mp,hp,fp={exports:{}};function gp(){return dp||(dp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e)}_transform(e,t,i){let n,r=0;for(let t=0,i=e.length;t<i;t++)13===e[t]&&(n=e.slice(r,t),r=t+1,this.push(n));r&&r<e.length?(n=e.slice(r),this.push(n)):r||this.push(e),i()}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(fp,fp.exports)),fp.exports}function wp(){return mp||(mp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(b),c=o(f),l=s(Lu()),u=M,p=s(Ku()),d=o(m),h=s(np()),g=s(ip()),w=s($u()),y=o(op()),D=o(Pu()),x=s(Yu()),I=o((ap||(ap=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(){super(),this.lastByte=!1}_transform(e,t,i){e.length&&(this.lastByte=e[e.length-1]),this.push(e),i()}_flush(e){return 10===this.lastByte?e():13===this.lastByte?(this.push(Buffer.from("\n")),e()):(this.push(Buffer.from("\r\n")),e())}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(cp,cp.exports)),cp.exports)),C=o(pp()),v=o(gp()),L=["From","Sender","To","Cc","Bcc","Reply-To","Date","References"],E="[A-Za-z0-9!#$%&'*+\\-/=?^_`{|}~\\x80-\\uFFFF]",A=new RegExp("^"+E+"+(?:\\."+E+"+)*$"),N=/^"(?:[^"\\]|\\[\s\S])*"$/,S=/^[^\s"(),:;<>@[\\\]]+@[^\s"(),:;<>@[\\\]]+$/,T=/[/\\?#%\x00-\x20\x7F]/;function k(e){return e.replace(/[\x00-\x1f\x7f]+/g,"")}class j{constructor(e,t){this.nodeCounter=0,t=t||{},this.baseBoundary=k(t.baseBoundary||a.default.randomBytes(8).toString("hex")),this.boundaryPrefix=k(t.boundaryPrefix||"--_NmP"),this.disableFileAccess=!!t.disableFileAccess,this.disableUrlAccess=!!t.disableUrlAccess,this.normalizeHeaderKey=t.normalizeHeaderKey,this.date=t.parentNode?null:new Date,this.rootNode=t.rootNode||this,this.keepBcc=!!t.keepBcc,t.filename&&(this.filename=t.filename,e||(e=h.detectMimeType(this.filename.split(".").pop()))),this.textEncoding=(t.textEncoding||"").toString().trim().charAt(0).toUpperCase(),this.parentNode=t.parentNode,this.hostname=t.hostname,this.newline=t.newline,this.childNodes=[],this._nodeId=++this.rootNode.nodeCounter,this._headers=[],this._isPlainText=!1,this._hasLongLines=!1,this._envelope=!1,this._raw=!1,this._transforms=[],this._processFuncs=[],e&&this.setHeader("Content-Type",e)}createChild(e,t){t||"object"!=typeof e||(t=e,e=void 0);const i=new j(e,t);return this.appendChild(i),i}appendChild(e){return e.parentNode&&e.parentNode!==this&&e.remove(),e.rootNode!==this.rootNode&&(e.rootNode=this.rootNode,e._nodeId=++this.rootNode.nodeCounter),e.parentNode=this,this.childNodes.push(e),e}replace(e){return e===this?this:(this.parentNode.childNodes.forEach((t,i)=>{t===this&&(e.rootNode=this.rootNode,e.parentNode=this.parentNode,e._nodeId=this._nodeId,this.rootNode=this,this.parentNode=void 0,e.parentNode.childNodes[i]=e)}),e)}remove(){if(!this.parentNode)return this;for(let e=this.parentNode.childNodes.length-1;e>=0;e--)if(this.parentNode.childNodes[e]===this)return this.parentNode.childNodes.splice(e,1),this.parentNode=void 0,this.rootNode=this,this}setHeader(e,t){let i=!1;if(!t&&e&&"object"==typeof e)return e.key&&"value"in e?this.setHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.setHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.setHeader(t,e[t])}),this;const n={key:e=this._normalizeHeaderKey(e),value:t};for(let t=0,r=this._headers.length;t<r;t++)this._headers[t].key===e&&(i?(this._headers.splice(t,1),t--,r--):(this._headers[t]=n,i=!0));return i||this._headers.push(n),this}addHeader(e,t){return!t&&e&&"object"==typeof e?(e.key&&e.value?this.addHeader(e.key,e.value):Array.isArray(e)?e.forEach(e=>{this.addHeader(e.key,e.value)}):Object.keys(e).forEach(t=>{this.addHeader(t,e[t])}),this):Array.isArray(t)?(t.forEach(t=>{this.addHeader(e,t)}),this):(this._headers.push({key:this._normalizeHeaderKey(e),value:t}),this)}getHeader(e){e=this._normalizeHeaderKey(e);for(let t=0,i=this._headers.length;t<i;t++)if(this._headers[t].key===e)return this._headers[t].value}setContent(e){return this.content=e,"function"==typeof this.content.pipe?(this._contentErrorHandler=e=>{this.content.removeListener("error",this._contentErrorHandler),this.content=e},this.content.once("error",this._contentErrorHandler)):"string"==typeof this.content&&(this._isPlainText=h.isPlainText(this.content),this._isPlainText&&h.hasLongerLines(this.content,76)&&(this._hasLongLines=!0)),this}build(e){let t;e||(t=new Promise((t,i)=>{e=p.callbackPromise(t,i)}));const i=e,n=this.createReadStream(),r=[];let s=0,o=!1;return n.on("readable",()=>{let e;for(;null!==(e=n.read());)r.push(e),s+=e.length}),n.once("error",e=>{if(!o)return o=!0,i(e)}),n.once("end",e=>{if(!o)return o=!0,e&&e.length&&(r.push(e),s+=e.length),i(null,Buffer.concat(r,s))}),t}getTransferEncoding(){let e=!1;const t=(this.getHeader("Content-Type")||"").toString().toLowerCase().trim();return this.content&&(e=(this.getHeader("Content-Transfer-Encoding")||"").toString().toLowerCase().trim(),e&&["base64","quoted-printable"].includes(e)||(/^text\//i.test(t)?e=this._isPlainText&&!this._hasLongLines?"7bit":"string"==typeof this.content||this.content instanceof Buffer?"Q"===this._getTextEncoding(this.content)?"quoted-printable":"base64":"B"===this.textEncoding?"base64":"quoted-printable":/^(multipart|message)\//i.test(t)||(e=e||"base64"))),e}buildHeaders(){const e=this.getTransferEncoding(),t=[];if(e&&this.setHeader("Content-Transfer-Encoding",e),this.filename&&!this.getHeader("Content-Disposition")&&this.setHeader("Content-Disposition","attachment"),this.rootNode===this){this.getHeader("Date")||this.setHeader("Date",this.date.toUTCString().replace(/GMT/,"+0000")),this.messageId(),this.getHeader("MIME-Version")||this.setHeader("MIME-Version","1.0");for(let e=this._headers.length-2;e>=0;e--){const t=this._headers[e];"Content-Type"===t.key&&(this._headers.splice(e,1),this._headers.push(t))}}return this._headers.forEach(e=>{let i,n,r=e.key,s=e.value;const o={};if(!s||"object"!=typeof s||L.includes(r)||(p.copyOwnKeys(o,s,e=>"value"===e),s=(s.value||"").toString(),s.trim()))if(o.prepared)o.foldLines?t.push(h.foldLines(r+": "+s)):t.push(r+": "+s);else{switch(e.key){case"Content-Disposition":i=h.parseHeaderValue(s),this.filename&&(i.params.filename=this.filename),s=h.buildHeaderValue(i);break;case"Content-Type":i=h.parseHeaderValue(s),i.value=(i.value||"").toString().replace(/[\x00-\x1f\x7f]/g,""),this._handleContentType(i),i.value.match(/^text\/plain\b/)&&"string"==typeof this.content&&/[\u0080-\uFFFF]/.test(this.content)&&(i.params.charset="utf-8"),s=h.buildHeaderValue(i),this.filename&&(n=/[\x00-\x1f\x7f]/.test(this.filename)?h.encodeWord(this.filename,this._getTextEncoding(this.filename),52):this._encodeWords(this.filename),(n!==this.filename||/[\s'"\\;:/=(),<>@[\]?]|^-/.test(n))&&(n=JSON.stringify(n)),s+="; name="+n);break;case"Bcc":if(!this.keepBcc)return}if(s=this._encodeHeaderValue(r,s),(s||"").toString().trim()){if("function"==typeof this.normalizeHeaderKey){const e=this.normalizeHeaderKey(r,s),t="string"==typeof e?e.replace(/[\x00-\x1f\x7f]/g,""):"";t&&(r=t)}t.push(h.foldLines(r+": "+s,76))}}}),t.join("\r\n")}createReadStream(e){e=e||{};const t=new u.PassThrough(e);let i,n=t;this.stream(t,e,e=>{e?n.emit("error",e):t.end()});for(let e=0,t=this._transforms.length;e<t;e++)i="function"==typeof this._transforms[e]?this._transforms[e]():this._transforms[e],n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);i=new I.default,n.once("error",e=>{i.emit("error",e)}),n=n.pipe(i);for(let e=0,t=this._processFuncs.length;e<t;e++)i=this._processFuncs[e],n=i(n);if(this.newline){const e=["win","windows","dos","\r\n"].includes(this.newline.toString().toLowerCase())?new C.default:new v.default,t=n.pipe(e);return n.on("error",e=>t.emit("error",e)),t}return n}transform(e){this._transforms.push(e)}processFunc(e){this._processFuncs.push(e)}stream(e,t,i){const n=this.getTransferEncoding();let r,s,o=!1;const a=e=>{o||(o=!0,i(e))},c=()=>{let i=0;const n=()=>{if(i>=this.childNodes.length)return e.write("\r\n--"+this.boundary+"--\r\n"),a();const r=this.childNodes[i++];e.write((i>1?"\r\n":"")+"--"+this.boundary+"\r\n"),r.stream(e,t,e=>{if(e)return a(e);setImmediate(n)})};if(!this.multipart)return a();setImmediate(n)},l=()=>{if(this.content){if("[object Error]"===Object.prototype.toString.call(this.content))return a(this.content);"function"==typeof this.content.pipe&&(this.content.removeListener("error",this._contentErrorHandler),this._contentErrorHandler=e=>a(e),this.content.once("error",this._contentErrorHandler));const i=()=>{["quoted-printable","base64"].includes(n)?(r=new("base64"===n?w:g).Encoder(t),r.pipe(e,{end:!1}),r.once("end",c),r.once("error",e=>a(e)),s=this._getStream(this.content),s.pipe(r)):(s=this._getStream(this.content),s.pipe(e,{end:!1}),s.once("end",c)),s.once("error",e=>a(e))};if(this.content._resolve){const e=[];let t=0,n=!1;const r=this._getStream(this.content);r.on("error",e=>{n||(n=!0,a(e))}),r.on("readable",()=>{let i;for(;null!==(i=r.read());)e.push(i),t+=i.length}),r.on("end",()=>{n||(n=!0,this.content._resolve=!1,this.content._resolvedValue=Buffer.concat(e,t),setImmediate(i))})}else setImmediate(i);return}return setImmediate(c)};this._raw?setImmediate(()=>{if("[object Error]"===Object.prototype.toString.call(this._raw))return a(this._raw);"function"==typeof this._raw.pipe&&this._raw.removeListener("error",this._contentErrorHandler);const t=this._getStream(this._raw);t.pipe(e,{end:!1}),t.on("error",t=>e.emit("error",t)),t.on("end",c)}):(e.write(this.buildHeaders()+"\r\n\r\n"),setImmediate(l))}setEnvelope(e){let t;this._envelope={from:!1,to:[]},e.from&&(t=[],this._convertAddresses(this._parseEnvelopeAddresses(e.from),t),t=t.filter(e=>e&&e.address),t.length&&t[0]&&(this._envelope.from=t[0].address));const i=new Set,n=[];["to","cc","bcc"].forEach(t=>{e[t]&&this._convertAddresses(this._parseEnvelopeAddresses(e[t]),n,i)}),this._envelope.to=n.map(e=>e.address).filter(e=>e);const r=["to","cc","bcc","from"];return p.copyOwnKeys(this._envelope,e,e=>r.includes(e)),this}getAddresses(){const e={},t=new Map;return this._headers.forEach(i=>{const n=i.key.toLowerCase();["from","sender","reply-to","to","cc","bcc"].includes(n)&&(Array.isArray(e[n])||(e[n]=[],t.set(n,new Set)),this._convertAddresses(this._parseAddresses(i.value),e[n],t.get(n)))}),e}getEnvelope(){if(this._envelope)return this._envelope;const e={from:!1,to:[]},t=new Set,i=[];return this._headers.forEach(n=>{const r=[];"From"===n.key||!e.from&&["Reply-To","Sender"].includes(n.key)?(this._convertAddresses(this._parseAddresses(n.value),r),r.length&&r[0]&&(e.from=r[0].address)):["To","Cc","Bcc"].includes(n.key)&&this._convertAddresses(this._parseAddresses(n.value),i,t)}),e.to=i.map(e=>e.address),e}messageId(){let e=this.getHeader("Message-ID");return e||(e=this._generateMessageId(),this.setHeader("Message-ID",e)),e}setRaw(e){return this._raw=e,this._raw&&"function"==typeof this._raw.pipe&&(this._contentErrorHandler=e=>{this._raw.removeListener("error",this._contentErrorHandler),this._raw=e},this._raw.once("error",this._contentErrorHandler)),this}_accessDisabled(e){let t=this;for(;t;){if(t[e])return!0;t=t.parentNode}return!1}_getStream(e){let t;return e._resolvedValue?(t=new u.PassThrough,setImmediate(()=>{try{t.end(e._resolvedValue)}catch(e){t.emit("error",e)}}),t):"function"==typeof e.pipe?e:e&&"string"==typeof e.path&&!e.href?this._accessDisabled("disableFileAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("File access rejected for "+e.path);i.code=x.EFILEACCESS,t.emit("error",i)}),t):c.default.createReadStream(e.path):e&&"string"==typeof e.href?this._accessDisabled("disableUrlAccess")?(t=new u.PassThrough,setImmediate(()=>{const i=new Error("Url access rejected for "+e.href);i.code=x.EURLACCESS,t.emit("error",i)}),t):(0,D.default)(e.href,{headers:e.httpHeaders,tls:e.tls}):(t=new u.PassThrough,setImmediate(()=>{try{t.end(e||"")}catch(e){t.emit("error",e)}}),t)}_parseAddresses(e){const t=[],i=new WeakSet,n=[],r=e=>{i.has(e)||(i.add(e),n.push({list:e,pos:0}))};for(r(Array.isArray(e)?e:[e]);n.length;){const e=n[n.length-1];if(e.pos>=e.list.length){n.pop();continue}const i=e.list[e.pos++];if(Array.isArray(i)){r(i);continue}if(i&&i.address){const e=this._normalizeAddress(i.address);if(e===i.address&&"string"==typeof i.name){t.push(i);continue}const n=p.copyOwnKeys({},i);n.address=e,n.name=i.name||"",t.push(n);continue}const s=this._normalizeParsedAddresses((0,y.default)(i));for(let e=0;e<s.length;e++)t.push(s[e])}return t}_normalizeParsedAddresses(e){return e.forEach(e=>{e.address?e.address=this._normalizeAddress(e.address):e.group&&this._normalizeParsedAddresses(e.group)}),e}_parseEnvelopeAddresses(e){return this._parseAddresses(e).map(e=>e.address||e.group||!e.name||/[\s@]/.test(e.name)?e:{address:this._normalizeAddress(e.name),name:""})}_normalizeHeaderKey(e){return e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x1f\x7f]/g,"").trim().toLowerCase().replace(/^X-SMTPAPI$|^(MIME|DKIM|ARC|BIMI)\b|^[a-z]|-(SPF|FBL|ID|MD5)$|-[a-z]/gi,e=>e.toUpperCase()).replace(/^Content-Features$/i,"Content-features")}_handleContentType(e){if(this.contentType=e.value.trim().toLowerCase(),this.multipart=!!/^multipart\//i.test(this.contentType)&&this.contentType.substr(this.contentType.indexOf("/")+1),this.multipart){const t=k(e.params.boundary||this.boundary||"");this.boundary=e.params.boundary=t||k(this._generateBoundary())}else this.boundary=!1}_generateBoundary(){return k(this.rootNode.boundaryPrefix+"-"+this.rootNode.baseBoundary)+"-Part_"+this._nodeId}_encodeHeaderValue(e,t){switch(e=this._normalizeHeaderKey(e)){case"From":case"Sender":case"To":case"Cc":case"Bcc":case"Reply-To":return this._convertAddresses(this._parseAddresses(t));case"Message-ID":case"In-Reply-To":case"Content-Id":return"<"!==(t=(t||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")).charAt(0)&&(t="<"+t),">"!==t.charAt(t.length-1)&&(t+=">"),t;case"References":return(t=[].concat.apply([],[].concat(t||"").map(e=>(e=(e||"").toString().replace(/\r?\n|\r/g," ").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").trim()).replace(/<[^>]*>/g,e=>e.replace(/\s/g,"")).split(/\s+/))).map(e=>("<"!==e.charAt(0)&&(e="<"+e),">"!==e.charAt(e.length-1)&&(e+=">"),e))).join(" ").trim();case"Date":return"[object Date]"===Object.prototype.toString.call(t)?t.toUTCString().replace(/GMT/,"+0000"):(t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t));case"Content-Type":case"Content-Disposition":return(t||"").toString().replace(/\r?\n|\r/g," ");default:return t=(t||"").toString().replace(/\r?\n|\r/g," "),this._encodeHeaderText(t)}}_convertAddresses(e,t,i){const n=[];if(t=t||[],!i){i=new Set;for(let e=0;e<t.length;e++)i.add(t[e].address)}return[].concat(e||[]).forEach(e=>{if(e.address)e.address=this._normalizeAddress(e.address),e.name?n.push(`${this._encodeAddressName(e.name)} <${e.address}>`):n.push(S.test(e.address)?e.address:`<${e.address}>`),i.has(e.address)||(i.add(e.address),t.push(e));else if(e.group){const r=(e.group.length?this._convertAddresses(e.group,t,i):"").trim();n.push(`${this._encodeAddressName(e.name)}:${r};`)}}),n.join(", ")}_normalizeAddress(e){if(!(e=(e||"").toString().replace(/[\x00-\x1F\x7F<>]+/g," ").trim()))return e;const t=e.lastIndexOf("@");if(t<0)return this._normalizeLocalPart(e);const i=e.substr(0,t),n=e.substr(t+1);let r=n;const s=/[\x80-\uFFFF]/.test(i);try{r=function(e,t){const i=t?d.default.domainToUnicode:d.default.domainToASCII;if("function"==typeof i&&!T.test(e)){const t=i(e);if(t)return t}return t?l.toUnicode(e):l.toASCII(e)}(n.toLowerCase(),s)}catch(e){}return`${this._normalizeLocalPart(i)}@${r}`}_normalizeLocalPart(e){return A.test(e)||N.test(e)?e:h.quoteString(e)}_encodeAddressName(e){return/^[\w ]*$/.test(e)?e:/^[\x20-\x7e]*$/.test(e)?h.quoteString(e):h.encodeWord(e,this._getTextEncoding(e),52)}_encodeHeaderText(e){return/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(e)?h.encodeWord(e,this._getTextEncoding(e),52):this._encodeWords(e)}_encodeWords(e){return h.encodeWords(e,this._getTextEncoding(e),52,!0)}_getTextEncoding(e){if(e=(e||"").toString(),this.textEncoding)return this.textEncoding;let t=0,i=0;for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);r>=0&&r<=8||11===r||12===r||r>=14&&r<=31||r>=128?t++:(r>=65&&r<=90||r>=97&&r<=122)&&i++}return t<i?"Q":"B"}_generateMessageId(){return"<"+[2,2,2,6].reduce((e,t)=>e+"-"+a.default.randomBytes(t).toString("hex"),a.default.randomBytes(4).toString("hex"))+"@"+(this.getEnvelope().from||this.hostname||"localhost").split("@").pop()+">"}}t.default=j,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ru,Ru.exports)),Ru.exports}var yp,Mp={exports:{}},Dp={exports:{}};var xp,Ip={exports:{}};var bp,Cp,vp={exports:{}};function Lp(){return bp||(bp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(Lu()),c=s(np()),l=o(b),u=s(Yu());function p(e){const t=new Error('Unsupported DKIM hash algorithm "'+e+'"');return t.code=u.ECONFIG,t}function d(e,t,i,n){const r=m(e,(n=n||{}).headerFieldNames||"From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive",n.skipFields),s=function(e,t,i,n,r){const s=e=>(e||"").toString().replace(/[\x00-\x1f\x7f;=]/g,""),o=["v=1","a=rsa-"+n,"c=relaxed/relaxed","d="+a.toASCII(s(e)),"q=dns/txt","s="+s(t),"bh="+r,"h="+s(i)].join("; ");return c.foldLines("DKIM-Signature: "+o,76)+";\r\n b="}(n.domainName,n.keySelector,r.fieldNames,t,i);let o,u;r.headers+="dkim-signature:"+h(s);try{o=l.default.createSign(("rsa-"+t).toUpperCase())}catch(e){throw p(t)}o.update(r.headers,"latin1");try{u=o.sign(n.privateKey,"base64")}catch(e){return!1}return s+u.replace(/(^.{73}|.{75}(?!\r?\n|\r))/g,"$&\r\n ").trim()}function m(e,t,i){const n=new Set,r=new Set,s=new Map;(i||"").toLowerCase().split(":").forEach(e=>{r.add(e.trim())}),(t||"").toLowerCase().split(":").filter(e=>!r.has(e.trim())).forEach(e=>{n.add(e.trim())});for(let t=e.length-1;t>=0;t--){const i=e[t];n.has(i.key)&&!s.has(i.key)&&s.set(i.key,h(i.line))}const o=[],a=[];return n.forEach(e=>{s.has(e)&&(a.push(e),o.push(e+":"+s.get(e)))}),{headers:o.join("\r\n")+"\r\n",fieldNames:a.join(":")}}function h(e){return e.substr(e.indexOf(":")+1).replace(/\r?\n/g,"").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}d.relaxedHeaders=m,d.unsupportedHashAlgoError=p,t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(vp,vp.exports)),vp.exports}function Ep(){return Cp||(Cp=1,function(e,t){var i=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=i((yp||(yp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M;class n extends i.Transform{constructor(e){super(e),this.lastBytes=Buffer.alloc(4),this.headersParsed=!1,this.headerBytes=0,this.headerChunks=[],this.rawHeaders=!1,this.bodySize=0}updateLastBytes(e){const t=this.lastBytes.length,i=Math.min(e.length,t);for(let e=0,n=t-i;e<n;e++)this.lastBytes[e]=this.lastBytes[e+i];for(let n=1;n<=i;n++)this.lastBytes[t-n]=e[e.length-n]}checkHeaders(e){if(this.headersParsed)return!0;const t=this.lastBytes.length;let i=0;for(let n=0,r=this.lastBytes.length+e.length;n<r;n++){let r;if(r=n<t?this.lastBytes[n]:e[n-t],10===r&&n){const r=n-1<t?this.lastBytes[n-1]:e[n-1-t],s=n>1&&(n-2<t?this.lastBytes[n-2]:e[n-2-t]);if(10===r){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}if(13===r&&10===s){this.headersParsed=!0,i=n-t+1,this.headerBytes+=i;break}}}if(this.headersParsed){if(this.headerChunks.push(e.slice(0,i)),this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders()),e.length>i){const t=e.slice(i);this.bodySize+=t.length,setImmediate(()=>this.push(t))}return!1}return this.headerBytes+=e.length,this.headerChunks.push(e),this.updateLastBytes(e),!1}_transform(e,t,i){if(!e||!e.length)return i();let n;"string"==typeof e&&(e=Buffer.from(e,t));try{n=this.checkHeaders(e)}catch(e){return i(e)}n&&(this.bodySize+=e.length,this.push(e)),setImmediate(i)}_flush(e){this.headerChunks&&(this.rawHeaders=Buffer.concat(this.headerChunks,this.headerBytes),this.headerChunks=null,this.emit("headers",this.parseHeaders())),e()}parseHeaders(){const e=(this.rawHeaders||Buffer.alloc(0)).toString("binary").split(/\r?\n/),t=[];for(const i of e)t.length&&/^[ \t]/.test(i)?t[t.length-1]+="\n"+i:t.push(i);return t.filter(e=>/[^ \t\r]/.test(e)).map(e=>({key:e.substr(0,e.indexOf(":")).replace(/^[ \t]+|[ \t]+$/g,"").toLowerCase(),line:e}))}}t.default=n,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Dp,Dp.exports)),Dp.exports)),r=i((xp||(xp=1,function(e,t){var i=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=M,r=i(b),s=Buffer.from("\r\n"),o=Buffer.alloc(4096,s);class a extends n.Transform{constructor(e){super(),e=e||{},this.bodyHash=r.default.createHash(e.hashAlgo||"sha256"),this.byteLength=0,this.debug=e.debug,this._debugBody=!!e.debug&&[],this._lineHasContent=!1,this._pendingWsp=!1,this._pendingCr=!1,this._pendingEmptyLines=0}_hashCanonical(e){e.length&&(this.bodyHash.update(e),this._debugBody&&this._debugBody.push(Buffer.from(e)))}_hashEmptyLines(){for(;this._pendingEmptyLines>0;){const e=Math.min(this._pendingEmptyLines,o.length/2);this._hashCanonical(o.subarray(0,2*e)),this._pendingEmptyLines-=e}}_emitContent(e,t,i){return this._lineHasContent||(this._pendingEmptyLines&&(this._hashCanonical(e.subarray(0,t)),t=0,this._hashEmptyLines()),this._lineHasContent=!0),this._pendingWsp&&(e[t++]=32,this._pendingWsp=!1),e[t++]=i,t}updateHash(e,t){const i=Buffer.allocUnsafe(2*e.length+2);let n=0;for(let t=0;t<e.length;t++){const r=e[t];10!==r?(this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),13===r?this._pendingCr=!0:32===r||9===r?this._pendingWsp=!0:n=this._emitContent(i,n,r)):(this._lineHasContent?(i[n++]=13,i[n++]=10,this._lineHasContent=!1):this._pendingEmptyLines++,this._pendingWsp=!1,this._pendingCr=!1)}t&&this._pendingCr&&(n=this._emitContent(i,n,13),this._pendingCr=!1),this._hashCanonical(i.subarray(0,n))}_transform(e,t,i){if(!e||!e.length)return i();"string"==typeof e&&(e=Buffer.from(e,t)),this.updateHash(e),this.byteLength+=e.length,this.push(e),i()}_flush(e){this.updateHash(Buffer.alloc(0),!0),this._lineHasContent&&this._hashCanonical(s),this.emit("hash",this.bodyHash.digest("base64"),!!this.debug&&Buffer.concat(this._debugBody)),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Ip,Ip.exports)),Ip.exports)),s=i(Lp()),o=M,a=i(f),c=i(I),l=i(b),u=Wu();class p{constructor(e,t,i,n){this.options=e||{},this.keys=t,this.cacheTreshold=Number(this.options.cacheTreshold)||10485760,this.hashAlgo=this.options.hashAlgo||"sha256",this.cacheDir=this.options.cacheDir||!1,this.chunks=[],this.chunklen=0,this.readPos=0,this.cachePath=!!this.cacheDir&&c.default.join(this.cacheDir,"message."+Date.now()+"-"+l.default.randomBytes(14).toString("hex")),this.cache=!1,this.headers=!1,this.bodyHash=!1,this.parser=!1,this.relaxedBody=!1,this.input=i,this.output=n,this.output.usingCache=!1,this.hasErrored=!1,this.input.on("error",e=>{this.hasErrored=!0,this.cleanup(),n.emit("error",e)})}cleanup(){this.cache&&this.cachePath&&a.default.unlink(this.cachePath,()=>!1)}createReadCache(){this.cache=a.default.createReadStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.output.emit("error",e)}),this.cache.once("close",()=>{this.cleanup()}),this.cache.pipe(this.output)}sendNextChunk(){if(this.hasErrored)return;if(this.readPos>=this.chunks.length)return this.cache?this.createReadCache():void this.output.end();const e=this.chunks[this.readPos++];!1!==this.output.write(e)?setImmediate(()=>this.sendNextChunk()):this.output.once("drain",()=>{this.sendNextChunk()})}sendSignedOutput(){let e=0;const t=()=>{if(e>=this.keys.length)return this.output.write(this.parser.rawHeaders),void setImmediate(()=>this.sendNextChunk());const i=this.keys[e++];let n;try{n=(0,s.default)(this.headers,this.hashAlgo,this.bodyHash,{domainName:i.domainName,keySelector:i.keySelector,privateKey:i.privateKey,headerFieldNames:this.options.headerFieldNames,skipFields:this.options.skipFields})}catch(e){return this.hasErrored=!0,this.cleanup(),void this.output.emit("error",e)}n&&this.output.write(Buffer.from(n+"\r\n")),setImmediate(t)};if(this.bodyHash&&this.headers)return t();this.output.write(this.parser.rawHeaders),this.sendNextChunk()}createWriteCache(){this.output.usingCache=!0,this.cache=a.default.createWriteStream(this.cachePath),this.cache.once("error",e=>{this.cleanup(),this.relaxedBody.unpipe(this.cache),this.relaxedBody.on("readable",()=>{for(;null!==this.relaxedBody.read(););}),this.hasErrored=!0,this.output.emit("error",e)}),this.cache.once("close",()=>{this.sendSignedOutput()}),this.relaxedBody.removeAllListeners("readable"),this.relaxedBody.pipe(this.cache)}signStream(){this.parser=new n.default,this.relaxedBody=new r.default({hashAlgo:this.hashAlgo}),this.parser.on("headers",e=>{this.headers=e}),this.relaxedBody.on("hash",e=>{this.bodyHash=e}),this.relaxedBody.on("readable",()=>{let e;if(!this.cache)for(;null!==(e=this.relaxedBody.read());)if(this.chunks.push(e),this.chunklen+=e.length,this.chunklen>=this.cacheTreshold&&this.cachePath)return this.createWriteCache()}),this.relaxedBody.on("end",()=>{this.cache||this.sendSignedOutput()}),this.parser.pipe(this.relaxedBody),setImmediate(()=>this.input.pipe(this.parser))}}t.default=class{constructor(e){this.options=e||{},this.keys=[].concat(this.options.keys||{domainName:e.domainName,keySelector:e.keySelector,privateKey:e.privateKey})}sign(e,t){const i=new o.PassThrough;let n=e,r=!1;Buffer.isBuffer(e)?(r=e,n=new o.PassThrough):"string"==typeof e&&(r=Buffer.from(e),n=new o.PassThrough);let a=this.options;t&&Object.keys(t).length&&(a=(0,u.copyOwnKeys)({},t),(0,u.copyOwnKeys)(a,this.options));const c=new p(a,this.keys,n,i);return setImmediate(()=>{try{c.signStream()}catch(e){return void i.emit("error",s.default.unsupportedHashAlgoError(c.hashAlgo))}r&&setImmediate(()=>{n.end(r)})}),i}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Mp,Mp.exports)),Mp.exports}var Ap,Np={exports:{}};var Sp,Tp,kp={exports:{}};function jp(){return Tp||(Tp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=s(Ku()),l=s(Bu()),u=o((hp||(hp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(wp()),c=s(np()),l=Ku();function u(e){const t=e;return"object"==typeof e&&!!(t.content||t.path||t.href||t.raw)}t.default=class{constructor(e){this.mail=e||{},this.message=!1}compile(){return this._alternatives=this.getAlternatives(),this._htmlNode=this._alternatives.filter(e=>/^text\/html\b/i.test(e.contentType)).pop(),this._attachments=this.getAttachments(!!this._htmlNode),this._useRelated=!(!this._htmlNode||!this._attachments.related.length),this._useAlternative=this._alternatives.length>1,this._useMixed=this._attachments.attached.length>1||this._alternatives.length&&1===this._attachments.attached.length,this.mail.raw?this.message=new a.default("message/rfc822",{newline:this.mail.newline,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess}).setRaw(this.mail.raw):this._useMixed?this.message=this._createMixed():this._useAlternative?this.message=this._createAlternative():this._useRelated?this.message=this._createRelated():this.message=this._createContentNode(!1,[].concat(this._alternatives||[]).concat(this._attachments.attached||[]).shift()||{contentType:"text/plain",content:""}),this.mail.headers&&this.message.addHeader(this.mail.headers),["from","sender","to","cc","bcc","reply-to","in-reply-to","references","subject","message-id","date"].forEach(e=>{const t=e.replace(/-(\w)/g,(e,t)=>t.toUpperCase());this.mail[t]&&this.message.setHeader(e,this.mail[t])}),this.mail.envelope&&this.message.setEnvelope(this.mail.envelope),this.message.messageId(),this.message}getAttachments(e){let t;const i=[].concat(this.mail.attachments||[]).map((e,t)=>{/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e));const i=e.contentType||c.detectMimeType(e.filename||e.path||e.href||"bin"),n=/^image\//i.test(i),r=/^message\//i.test(i),s=e.contentDisposition||(r||n&&e.cid?"inline":"attachment");let o;o="contentTransferEncoding"in e?e.contentTransferEncoding:r?"8bit":"base64";const a={contentType:i,contentDisposition:s,contentTransferEncoding:o};return e.filename?a.filename=e.filename:r||!1===e.filename||(a.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(t+1),a.filename.indexOf(".")<0&&(a.filename+="."+c.detectExtension(a.contentType))),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.cid&&(a.cid=e.cid),e.raw?a.raw=e.raw:e.path?a.content={path:e.path}:e.href?a.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls}:a.content=e.content||"",e.encoding&&(a.encoding=e.encoding),e.headers&&(a.headers=e.headers),a});return this.mail.icalEvent&&(t=Object.assign({},this._getIcalEvent()),t.contentType="application/ics",t.headers||(t.headers={}),t.filename=t.filename||"invite.ics",t.headers["Content-Disposition"]="attachment",t.headers["Content-Transfer-Encoding"]="base64"),e?{attached:i.filter(e=>!e.cid).concat(t||[]),related:i.filter(e=>!!e.cid)}:{attached:i.concat(t||[]),related:[]}}_getIcalEvent(){if(!this._icalEvent){let e;e=u(this.mail.icalEvent)?(0,l.copyOwnKeys)({},this.mail.icalEvent):{content:this.mail.icalEvent},/^data:/i.test(e.path||e.href)&&(e=this._processDataUrl(e)),/^https?:\/\//i.test(e.path)&&(e.href=e.path,e.path=void 0),e.raw||(e.path?(e.content={path:e.path},e.path=void 0):e.href&&(e.content={href:e.href,httpHeaders:e.httpHeaders,tls:e.tls},e.href=void 0)),e.content&&"object"==typeof e.content&&(e.content._resolve=!0),this._icalEvent=e}return this._icalEvent}getAlternatives(){const e=[];let t,i,n,r,s;return this.mail.text&&(t=u(this.mail.text)?this.mail.text:{content:this.mail.text},t.contentType="text/plain; charset=utf-8"),this.mail.watchHtml&&(n=u(this.mail.watchHtml)?this.mail.watchHtml:{content:this.mail.watchHtml},n.contentType="text/watch-html; charset=utf-8"),this.mail.amp&&(r=u(this.mail.amp)?this.mail.amp:{content:this.mail.amp},r.contentType="text/x-amp-html; charset=utf-8"),this.mail.icalEvent&&(s=Object.assign({},this._getIcalEvent()),s.filename=!1,s.contentType="text/calendar; charset=utf-8; method="+(s.method||"PUBLISH").toString().trim().toUpperCase(),s.headers||(s.headers={})),this.mail.html&&(i=u(this.mail.html)?this.mail.html:{content:this.mail.html},i.contentType="text/html; charset=utf-8"),[].concat(t||[]).concat(n||[]).concat(r||[]).concat(i||[]).concat(s||[]).concat(this.mail.alternatives||[]).forEach(t=>{/^data:/i.test(t.path||t.href)&&(t=this._processDataUrl(t));const i={contentType:t.contentType||c.detectMimeType(t.filename||t.path||t.href||"txt"),contentTransferEncoding:t.contentTransferEncoding};t.filename&&(i.filename=t.filename),/^https?:\/\//i.test(t.path)&&(t.href=t.path,t.path=void 0),t.raw?i.raw=t.raw:t.path?i.content={path:t.path}:t.href?i.content={href:t.href,httpHeaders:t.httpHeaders,tls:t.tls}:i.content=t.content||"",t.encoding&&(i.encoding=t.encoding),t.headers&&(i.headers=t.headers),e.push(i)}),e}_createMixed(e){const t=e?e.createChild("multipart/mixed",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/mixed",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._useAlternative?this._createAlternative(t):this._useRelated&&this._createRelated(t),[].concat(!this._useAlternative&&this._alternatives||[]).concat(this._attachments.attached||[]).forEach(e=>{this._useRelated&&e===this._htmlNode||this._createContentNode(t,e)}),t}_createAlternative(e){const t=e?e.createChild("multipart/alternative",{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default("multipart/alternative",{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._alternatives.forEach(e=>{this._useRelated&&this._htmlNode===e?this._createRelated(t):this._createContentNode(t,e)}),t}_createRelated(e){const t=e?e.createChild('multipart/related; type="text/html"',{disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default('multipart/related; type="text/html"',{baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return this._createContentNode(t,this._htmlNode),this._attachments.related.forEach(e=>this._createContentNode(t,e)),t}_createContentNode(e,t){(t=t||{}).content=t.content||"";const i=(t.encoding||"utf8").toString().toLowerCase().replace(/[-_\s]/g,""),n=e?e.createChild(t.contentType,{filename:t.filename,textEncoding:this.mail.textEncoding,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline}):new a.default(t.contentType,{filename:t.filename,baseBoundary:this.mail.baseBoundary,textEncoding:this.mail.textEncoding,boundaryPrefix:this.mail.boundaryPrefix,disableUrlAccess:this.mail.disableUrlAccess,disableFileAccess:this.mail.disableFileAccess,normalizeHeaderKey:this.mail.normalizeHeaderKey,newline:this.mail.newline});return t.headers&&n.addHeader(t.headers),t.cid&&n.setHeader("Content-Id","<"+t.cid.replace(/[<>]/g,"")+">"),t.contentTransferEncoding?n.setHeader("Content-Transfer-Encoding",t.contentTransferEncoding):this.mail.encoding&&/^text\//i.test(t.contentType)&&n.setHeader("Content-Transfer-Encoding",this.mail.encoding),/^text\//i.test(t.contentType)&&!t.contentDisposition||n.setHeader("Content-Disposition",t.contentDisposition||(t.cid&&/^image\//i.test(t.contentType)?"inline":"attachment")),"string"!=typeof t.content||["utf8","usascii","ascii"].includes(i)||(t.content=Buffer.from(t.content,i)),t.raw?n.setRaw(t.raw):n.setContent(t.content),n}_processDataUrl(e){const t=e.path||e.href;if(!t||"string"!=typeof t)return e;if(!t.startsWith("data:"))return e;if(t.length>52428800){let i="application/octet-stream";const n=t.indexOf(",");if(n>0&&n<200){const e=t.substring(5,n).split(";");e[0]&&e[0].includes("/")&&(i=e[0].trim())}return Object.assign((0,l.copyOwnKeys)({},e),{path:!1,href:!1,content:Buffer.alloc(0),contentType:e.contentType||i})}let i;try{i=(0,l.parseDataURI)(t)}catch(t){return e}return i?(e.content=i.data,e.contentType=e.contentType||i.contentType,"path"in e&&(e.path=!1),"href"in e&&(e.href=!1),e):e}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(_u,_u.exports)),_u.exports)),m=o(Ep()),f=o((Ap||(Ap=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(d),c=o(C),l=s(Eu()),u=s(Yu());t.default=function e(t,i,n,r,s){"function"==typeof r&&(s=r,r={}),r=r||{};const o=s;if(!(i=Number(i)||0)||/[\r\n]/.test(n)){const e=new Error("Invalid proxy destination");return e.code=u.EPROXY,void setImmediate(()=>o(e))}const p=l.parse(t),d={host:p.hostname,port:Number(p.port)?Number(p.port):"https:"===p.protocol?443:80};let m,h;"https:"===p.protocol?(d.rejectUnauthorized=!1!==r.rejectUnauthorized,m=c.default.connect.bind(c.default)):m=a.default.connect.bind(a.default);let f=!1;const g=e=>{if(!f){f=!0;try{h.destroy()}catch(e){}o(e)}},w=()=>{const e=new Error("Proxy socket timed out");e.code="ETIMEDOUT",g(e)};h=m(d,()=>{if(f)return;const e={Host:n+":"+i,Connection:"close"};p.auth&&(e["Proxy-Authorization"]="Basic "+Buffer.from(p.auth).toString("base64")),h.write("CONNECT "+n+":"+i+" HTTP/1.1\r\n"+Object.keys(e).map(t=>t+": "+e[t]).join("\r\n")+"\r\n\r\n");let t="";const r=e=>{let i,n;if(!f){if(t+=e.toString("binary"),i=t.match(/\r\n\r\n/)){if(h.removeListener("data",r),n=t.substr(i.index+i[0].length),t=t.substr(0,i.index),n&&h.unshift(Buffer.from(n,"binary")),f=!0,i=t.match(/^HTTP\/\d+\.\d+ (\d+)/i),!i||"2"!==(i[1]||"").charAt(0)){try{h.destroy()}catch(e){}const e=new Error("Invalid response from proxy"+(i&&": "+i[1]||""));return e.code=u.EPROXY,o(e)}return h.removeListener("error",g),h.removeListener("timeout",w),h.setTimeout(0),o(null,h)}if(t.length>65536){h.removeListener("data",r);const e=new Error("Proxy response headers too large");return e.code=u.EPROXY,g(e)}}};h.on("data",r)}),h.setTimeout(e.timeout||3e4),h.on("timeout",w),h.once("error",g)},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Np,Np.exports)),Np.exports)),g=s(Yu()),w=o(h),y=s(Eu()),M=s(ju()),x=o((Sp||(Sp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(Ku()),c=o(wp()),l=s(np()),u=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);t.default=class{constructor(e,t){this.mailer=e,this.data={},this.message=null,t=t||{};const i=e.options||{},n=e._defaults||{};a.copyOwnKeys(this.data,t),this.data.headers=this.data.headers||{},a.copyOwnKeys(this.data,n,e=>u(this.data,e)),a.copyOwnKeys(this.data.headers,n.headers,e=>u(this.data.headers,e)),["disableFileAccess","disableUrlAccess","normalizeHeaderKey","maxRecipients"].forEach(e=>{e in i&&(this.data[e]=i[e])}),["disableFileAccess","disableUrlAccess"].forEach(e=>{!(e in i)&&u(n,e)&&(this.data[e]=this.data[e]||n[e])})}resolveContent(e,t,i,n){n||"function"!=typeof i||(n=i,i=!1),i=i||{};const r={disableFileAccess:this.data.disableFileAccess||i.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess||i.disableUrlAccess};return a.resolveContent(e,t,r,n)}resolveAll(e){const t=[[this.data,"html"],[this.data,"text"],[this.data,"watchHtml"],[this.data,"amp"],[this.data,"icalEvent"]];this.data.alternatives&&this.data.alternatives.length&&this.data.alternatives.forEach((e,i)=>{t.push([this.data.alternatives,i])}),this.data.attachments&&this.data.attachments.length&&this.data.attachments.forEach((e,i)=>{e.filename||(e.filename=(e.path||e.href||"").split(/[/\\]/).pop().split("?").shift()||"attachment-"+(i+1),e.filename.indexOf(".")<0&&(e.filename+="."+l.detectExtension(e.contentType))),e.contentType||(e.contentType=l.detectMimeType(e.filename||e.path||e.href||"bin")),t.push([this.data.attachments,i])});const i=new c.default;["from","to","cc","bcc","sender","replyTo"].forEach(e=>{let t;this.message?t=[].concat(i._parseAddresses(this.message.getHeader("replyTo"===e?"reply-to":e))||[]):this.data[e]&&(t=[].concat(i._parseAddresses(this.data[e])||[])),t&&t.length?this.data[e]=t:e in this.data&&(this.data[e]=null)}),["from","sender"].forEach(e=>{this.data[e]&&(this.data[e]=this.data[e].shift())});let n=0;const r=()=>{if(n>=t.length)return e(null,this.data);const i=t[n++];if(!i[0]||!i[0][i[1]])return r();a.resolveContent(...i,{disableFileAccess:this.data.disableFileAccess,disableUrlAccess:this.data.disableUrlAccess},(t,n)=>{if(t)return e(t);const s={content:n};i[0][i[1]]&&"object"==typeof i[0][i[1]]&&!Buffer.isBuffer(i[0][i[1]])&&a.copyOwnKeys(s,i[0][i[1]],e=>e in s||["content","path","href","raw"].includes(e)),i[0][i[1]]=s,r()})};setImmediate(()=>r())}normalize(e){const t=this.message.getEnvelope(),i=this.message.messageId();this.resolveAll((n,r)=>n?e(n):(r.envelope=t,r.messageId=i,["html","text","watchHtml","amp"].forEach(e=>{r[e]&&r[e].content&&("string"==typeof r[e].content?r[e]=r[e].content:Buffer.isBuffer(r[e].content)&&(r[e]=r[e].content.toString()))}),r.icalEvent&&Buffer.isBuffer(r.icalEvent.content)&&(r.icalEvent.content=r.icalEvent.content.toString("base64"),r.icalEvent.encoding="base64"),r.alternatives&&r.alternatives.length&&r.alternatives.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),r.attachments&&r.attachments.length&&r.attachments.forEach(e=>{e&&e.content&&Buffer.isBuffer(e.content)&&(e.content=e.content.toString("base64"),e.encoding="base64")}),r.normalizedHeaders={},Object.keys(r.headers||{}).forEach(e=>{if(a.isProtoKey(e))return;let t=[].concat(r.headers[e]||[]).shift();t=t&&t.value||t,t&&(["references","in-reply-to","message-id","content-id"].includes(e)&&(t=this.message._encodeHeaderValue(e,t)),r.normalizedHeaders[e]=t)}),r.list&&"object"==typeof r.list&&this._getListHeaders(r.list).forEach(e=>{r.normalizedHeaders[e.key]=e.value.map(e=>e&&e.value||e).join(", ")}),r.references&&(r.normalizedHeaders.references=this.message._encodeHeaderValue("references",r.references)),r.inReplyTo&&(r.normalizedHeaders["in-reply-to"]=this.message._encodeHeaderValue("in-reply-to",r.inReplyTo)),e(null,r)))}setMailerHeader(){this.message&&this.data.xMailer&&this.message.setHeader("X-Mailer",this.data.xMailer)}setPriorityHeaders(){if(this.message&&this.data.priority)switch((this.data.priority||"").toString().toLowerCase()){case"high":this.message.setHeader("X-Priority","1 (Highest)"),this.message.setHeader("X-MSMail-Priority","High"),this.message.setHeader("Importance","High");break;case"low":this.message.setHeader("X-Priority","5 (Lowest)"),this.message.setHeader("X-MSMail-Priority","Low"),this.message.setHeader("Importance","Low")}}setListHeaders(){this.message&&this.data.list&&"object"==typeof this.data.list&&this._getListHeaders(this.data.list).forEach(e=>{e.value.forEach(t=>{this.message.addHeader(e.key,t)})})}_getListHeaders(e){return Object.keys(e).map(t=>({key:"list-"+t.toLowerCase().trim(),value:[].concat(e[t]||[]).map(e=>({prepared:!0,foldLines:!0,value:[].concat(e||[]).map(e=>{if("string"==typeof e&&(e={url:e}),e&&e.url){let i=(e.comment||"").toString().replace(/\r?\n|\r/g," ");const n=!l.isPlainText(i)||/\x7f/.test(i);return"id"===t.toLowerCase().trim()?(i=n?l.encodeWord(i):l.quoteString(i),(e.comment?i+" ":"")+this._formatListUrl(e.url).replace(/^<[^:]+:\/{0,2}/,"<")):(i=n?l.encodeWord(i):i.replace(/[()\\]/g,"\\$&"),this._formatListUrl(e.url)+(e.comment?" ("+i+")":""))}return""}).filter(e=>e).join(", ")}))}))}_formatListUrl(e){return e=e.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"").replace(/[\s<]+|[\s>]+/g,""),/^(https?|mailto|ftp):/.test(e)?"<"+e+">":/^[^@]+@[^@]+$/.test(e)?"<mailto:"+e+">":"<http://"+e+">"}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(kp,kp.exports)),kp.exports)),I=o(d),v=o(D),L=o(b);class E extends a.EventEmitter{constructor(e,t,i){super(),this.options=t||{},this._defaults=i||{},this._defaultPlugins={compile:[(...e)=>this._convertDataImages(...e)],stream:[]},this._userPlugins={compile:[],stream:[]},this.meta=new Map,this.dkim=!!this.options.dkim&&new m.default(this.options.dkim),this.transporter=e,this.transporter.mailer=this,this.logger=c.getLogger(this.options,{component:this.options.component||"mail"}),this.logger.debug({tnx:"create"},"Creating transport: %s",this.getVersionString()),"function"==typeof this.transporter.on&&(this.transporter.on("log",e=>{this.logger.debug({tnx:"transport"},"%s: %s",e.type,e.message)}),this.transporter.on("error",e=>{this.logger.error({err:e,tnx:"transport"},"Transport Error: %s",e.message),this.emit("error",e)}),this.transporter.on("idle",(...e)=>{this.emit("idle",...e)}),this.transporter.on("clear",(...e)=>{this.emit("clear",...e)})),["close","isIdle","verify"].forEach(e=>{this[e]=(...t)=>"function"==typeof this.transporter[e]?("verify"===e&&"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1),this.transporter[e](...t)):(this.logger.warn({tnx:"transport",methodName:e},"Non existing method %s called for transport",e),!1)}),this.options.proxy&&"string"==typeof this.options.proxy&&this.setupProxy(this.options.proxy)}use(e,t){return e=(e||"").toString(),this._userPlugins.hasOwnProperty(e)?this._userPlugins[e].push(t):this._userPlugins[e]=[t],this}sendMail(e,t=null){let i;t||(i=new Promise((e,i)=>{t=c.callbackPromise(e,i)}));const n=t;"function"==typeof this.getSocket&&(this.transporter.getSocket=this.getSocket,this.getSocket=!1);const r=new x.default(this,e);return this.logger.debug({tnx:"transport",name:this.transporter.name,version:this.transporter.version,action:"send"},"Sending mail using %s/%s",this.transporter.name,this.transporter.version),this._processPlugins("compile",r,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"compile"},"PluginCompile Error: %s",e.message),n(e);let t;try{r.message=new u.default(r.data).compile(),r.setMailerHeader(),r.setPriorityHeaders(),r.setListHeaders(),t=r.message.getEnvelope().to.length}catch(e){return this.logger.error({err:e,tnx:"transport",action:"send"},"Compile Error: %s",e.message),n(e)}const i=void 0===r.data.maxRecipients?1e5:r.data.maxRecipients;if(i&&t>i){const e=new Error(`Message has ${t} recipients, which is over the ${i} allowed by maxRecipients`);return e.code=g.EMAXRECIPIENTS,this.logger.error({err:e,tnx:"transport",action:"send"},"Send Error: %s",e.message),n(e)}this._processPlugins("stream",r,e=>{if(e)return this.logger.error({err:e,tnx:"plugin",action:"stream"},"PluginStream Error: %s",e.message),n(e);(r.data.dkim||this.dkim)&&r.message.processFunc(e=>{const t=r.data.dkim?new m.default(r.data.dkim):this.dkim;return this.logger.debug({tnx:"DKIM",messageId:r.message.messageId(),dkimDomains:t.keys.map(e=>e.keySelector+"."+e.domainName).join(", ")},"Signing outgoing message with %s keys",t.keys.length),t.sign(e,r.data._dkim)}),this.transporter.send(r,(...e)=>{e[0]&&this.logger.error({err:e[0],tnx:"transport",action:"send"},"Send Error: %s",e[0].message),n(...e)})})}),i}getVersionString(){return w.default.format("%s (%s; +%s; %s/%s)",M.name,M.version,M.homepage,this.transporter.name,this.transporter.version)}_processPlugins(e,t,i){if(e=(e||"").toString(),!this._userPlugins.hasOwnProperty(e))return i();const n=this._userPlugins[e]||[],r=this._defaultPlugins[e]||[];if(n.length&&this.logger.debug({tnx:"transaction",pluginCount:n.length,step:e},"Using %s plugins for %s",n.length,e),n.length+r.length===0)return i();let s=0,o="default";const a=()=>{let e="default"===o?r:n;if(s>=e.length){if("default"!==o||!n.length)return i();o="user",s=0,e=n}(0,e[s++])(t,e=>{if(e)return i(e);a()})};a()}setupProxy(e){const t=y.parse(e);this.getSocket=(e,i)=>{const n=t.protocol.replace(/:$/,"").toLowerCase();if(this.meta.has("proxy_handler_"+n))return this.meta.get("proxy_handler_"+n)(t,e,i);switch(n){case"http":case"https":return void(0,f.default)(t.href,e.port,e.host,this.options.tls||{},(e,t)=>e?i(e):i(null,{connection:t}));case"socks":case"socks5":case"socks4":case"socks4a":{if(!this.meta.has("proxy_socks_module")){let e=new Error("Socks module not loaded");return e.code=g.EPROXY,i(e)}const n=n=>{const r=!!this.meta.get("proxy_socks_module").SocksClient,s=r?this.meta.get("proxy_socks_module").SocksClient:this.meta.get("proxy_socks_module"),o=Number(t.protocol.replace(/\D/g,""))||5,a={proxy:{ipaddress:n,port:Number(t.port),type:o},[r?"destination":"target"]:{host:e.host,port:e.port},command:"connect"};if(t.username||t.password){const e=t.username||"",i=t.password||"";r?(a.proxy.userId=e,a.proxy.password=i):4===o?a.userid=e:a.authentication={username:e,password:i}}s.createConnection(a,(e,t)=>e?i(e):i(null,{connection:t.socket||t}))};return I.default.isIP(t.hostname)?n(t.hostname):v.default.resolve(t.hostname,(e,t)=>{if(e)return i(e);n(Array.isArray(t)?t[0]:t)})}}let r=new Error("Unknown proxy configuration");r.code=g.EPROXY,i(r)}}_convertDataImages(e,t){if(!this.options.attachDataUrls&&!e.data.attachDataUrls||!e.data.html)return t();e.resolveContent(e.data,"html",{disableFileAccess:e.data.disableFileAccess,disableUrlAccess:e.data.disableUrlAccess},(i,n)=>{if(i)return t(i);let r=0;n=(n||"").toString().replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi,(t,i,n,s)=>{const o=L.default.randomBytes(10).toString("hex")+"@localhost";return e.data.attachments||(e.data.attachments=[]),Array.isArray(e.data.attachments)||(e.data.attachments=[].concat(e.data.attachments||[])),e.data.attachments.push({path:n,cid:o,filename:"image-"+ ++r+"."+l.detectExtension(s)}),i+"cid:"+o}),e.data.html=n,t()})}set(e,t){return this.meta.set(e,t)}get(e){return this.meta.get(e)}}t.default=E,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Iu,Iu.exports)),Iu.exports}var Zp,zp,Yp={exports:{}},Xp={exports:{}},Fp={exports:{}},Gp={exports:{}};function Op(){return zp||(zp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(ju()),c=p,l=o(d),u=o(C),m=o(x),h=o(b),f=o((Zp||(Zp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const i=M,n=Buffer.from("\n"),r=Buffer.from("\n."),s=Buffer.from("\r"),o=Buffer.from(".");class a extends i.Transform{constructor(e){super(e),this.options=e||{},this.inByteCount=0,this.outByteCount=0,this.lastByte=!1}_transform(e,t,i){const a=[];let c,l,u,p=0,d=0;if(!e||!e.length)return i();for("string"==typeof e&&(e=Buffer.from(e)),this.inByteCount+=e.length,c=0,l=e.length;c<l;c++){const t=e[c],i=c?e[c-1]:this.lastByte;let l=!1;13===i&&10!==t?l=46===t?r:n:10===t&&13!==i?l=s:46!==t||10!==i&&!1!==i||(l=o),l&&(c>d&&(u=e.slice(d,c),a.push(u),p+=u.length),a.push(l),p+=l.length,d=c)}a.length?(d<e.length&&(u=e.slice(d),a.push(u),p+=u.length),this.outByteCount+=p,this.push(Buffer.concat(a,p))):(this.outByteCount+=e.length,this.push(e)),this.lastByte=e[e.length-1],i()}_flush(e){let t;t=10===this.lastByte?Buffer.from(".\r\n"):13===this.lastByte?Buffer.from("\n.\r\n"):Buffer.from("\r\n.\r\n"),this.outByteCount+=t.length,this.push(t),e()}}t.default=a,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Gp,Gp.exports)),Gp.exports)),g=M,w=s(Ku()),y=6e5,D=()=>{};function I(e){if(!e)return e;const t=Buffer.from(e,"binary").toString("utf8");return t.includes("�")?e:t}function v(e){return/^\d+-/.test(e)}class L extends c.EventEmitter{constructor(e){super(e),this.id=h.default.randomBytes(8).toString("base64").replace(/\W/g,""),this.stage="init",this.options=e||{},this.options.requireTLS&&(this.options.ignoreTLS||this.options.opportunisticTLS)&&(this.options=Object.assign({},this.options,{ignoreTLS:!1,opportunisticTLS:!1})),this.secureConnection=!!this.options.secure,this.alreadySecured=!!this.options.secured,this.port=Number(this.options.port)||(this.secureConnection?465:587),this.host=this.options.host||"localhost",this.servername=this.options.servername?this.options.servername:!l.default.isIP(this.host)&&this.host,this.allowInternalNetworkInterfaces=this.options.allowInternalNetworkInterfaces||!1,void 0===this.options.secure&&465===this.port&&(this.secureConnection=!0),this.name=(this.options.name||this._getHostname()).toString().replace(/[\r\n]+/g,""),this.logger=w.getLogger(this.options,{component:this.options.component||"smtp-connection",sid:this.id}),this.customAuth=new Map;for(const e of Object.keys(this.options.customAuth||{})){const t=(e||"").toString().trim().toUpperCase();t&&this.customAuth.set(t,this.options.customAuth[e])}this.version=a.version,this.authenticated=!1,this.destroyed=!1,this.secure=!!this.secureConnection,this._remainder="",this._responseQueue=[],this._responsePartial=!1,this.lastServerResponse=!1,this._socket=!1,this._supportedAuth=[],this.allowsAuth=!1,this._envelope=!1,this._supportedExtensions=[],this._maxAllowedSize=0,this._responseActions=[],this._recipientQueue=[],this._greetingTimeout=!1,this._connectionTimeout=!1,this._destroyed=!1,this._closing=!1,this._currentDataStream=!1,this._pendingSend=!1,this._connectCallback=!1,this._onSocketData=e=>this._onData(e),this._onSocketError=e=>this._onError(e,"ESOCKET",!1,"CONN"),this._onSocketClose=()=>this._onClose(),this._onSocketEnd=()=>this._onEnd(),this._onSocketTimeout=()=>this._onTimeout(),this._onConnectionSocketError=e=>this._onConnectionError(e,"ESOCKET"),this._connectionAttemptId=0}connect(e){if("function"==typeof e){this._connectCallback=e,this.once("connect",()=>{this._connectCallback=!1,this.logger.debug({tnx:"smtp"},"SMTP handshake finished"),e()});const t=this._isDestroyedMessage("connect");if(t)return e(this._formatError(t,"ECONNECTION",!1,"CONN"))}let t={port:this.port,host:this.host,allowInternalNetworkInterfaces:this.allowInternalNetworkInterfaces,timeout:this.options.dnsTimeout||3e4};return this.options.localAddress&&(t.localAddress=this.options.localAddress),this.options.connection?(this._socket=this.options.connection,this._setupConnectionHandlers(),void(this.secureConnection&&!this.alreadySecured?setImmediate(()=>this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()})):setImmediate(()=>this._onConnect()))):this.options.socket?(this._socket=this.options.socket,this._resolveAndConnect(t,e=>{try{this._socket.connect(this.port,this.host,()=>{if(this._socket.setKeepAlive(!0),this.secureConnection&&!this.alreadySecured)return this._upgradeConnection(e=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"CONN"):this._onConnect()});this._onConnect()}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}})):(this.secureConnection&&(Object.assign(t,this.options.tls||{}),this.servername&&!t.servername&&(t.servername=this.servername)),this._resolveAndConnect(t,e=>{this._fallbackAddresses=(e._addresses||[]).filter(e=>e!==t.host),this._connectOpts=Object.assign({},t),this._connectToHost(t,this.secureConnection)}))}_resolveAndConnect(e,t){return w.resolveHostname(e,(i,n)=>{if(i)return setImmediate(()=>this._onError(i,"EDNS",!1,"CONN"));this.logger.debug({tnx:"dns",source:e.host,resolved:n.host,cached:!!n.cached},"Resolved %s as %s [cache %s]",e.host,n.host,n.cached?"hit":"miss");for(const t of Object.keys(n))"_"!==t.charAt(0)&&n[t]&&(e[t]=n[t]);t(n)})}_connectToHost(e,t){if(this._destroyed||this._closing)return;this._connectionAttemptId++;const i=this._connectionAttemptId,n=t?u.default.connect:l.default.connect;try{this._socket=n(e,()=>{this._connectionAttemptId===i&&(this._socket.setKeepAlive(!0),this._onConnect())}),this._setupConnectionHandlers()}catch(e){return void setImmediate(()=>this._onError(e,"ECONNECTION",!1,"CONN"))}}_setupConnectionHandlers(){this._connectionTimeout=setTimeout(()=>{this._onConnectionError("Connection timeout","ETIMEDOUT")},this.options.connectionTimeout||12e4),this._socket.on("error",this._onConnectionSocketError)}_onConnectionError(e,t){clearTimeout(this._connectionTimeout);if(!(this._fallbackAddresses&&this._fallbackAddresses.length&&"init"===this.stage&&!this._destroyed))return void this._onError(e,t,!1,"CONN");const i=this._fallbackAddresses.shift();if(this.logger.info({tnx:"network",failedHost:this._connectOpts.host,nextHost:i,error:e.message||e},"Connection to %s failed, trying %s",this._connectOpts.host,i),this._socket){try{this._socket.removeListener("error",this._onConnectionSocketError),this._socket.on("error",D),this._socket.destroy()}catch(e){}this._socket=null}this._connectOpts.host=i,this._connectToHost(this._connectOpts,this.secureConnection)}quit(){this._sendCommand("QUIT"),this._responseActions.push(this.close)}close(){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._responseActions=[],this._closing)return;this._closing=!0;const e="init"===this.stage?"destroy":"end";this.logger.debug({tnx:"smtp"},'Closing connection to the server using "%s"',e);const t=this._socket&&this._socket.socket||this._socket;if(this._currentDataStream){try{this._currentDataStream.unpipe(this._socket)}catch(e){}this._currentDataStream=!1}if(this._pendingSend){const{stream:e,onStreamError:t}=this._pendingSend;e&&(e.removeListener("error",t),e.on("error",D)),this._pendingSend=!1}if(t&&!t.destroyed)try{t.setTimeout(0),t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout),t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError),t.on("error",D),t[e]()}catch(e){}this._destroy()}login(e,t){const i=this._isDestroyedMessage("login");if(i)return t(this._formatError(i,"ECONNECTION",!1,"API"));this._auth=e||{},this._authMethod=(this._auth.method||"").toString().trim().toUpperCase()||!1;const n=!!this._auth.oauth2||this.customAuth.has("XOAUTH2");if(this._authMethod||!this._auth.oauth2||this._auth.credentials){if(!this._authMethod||"XOAUTH2"===this._authMethod&&!this._auth.oauth2){const e=this._supportedAuth.find(e=>"XOAUTH2"!==e||n);this._authMethod=(e||"PLAIN").toUpperCase().trim()}}else this._authMethod="XOAUTH2";if(("XOAUTH2"!==this._authMethod||this.customAuth.has("XOAUTH2"))&&(!this._auth.credentials||!this._auth.credentials.user||!this._auth.credentials.pass)){if(!(this._auth.user&&this._auth.pass||this.customAuth.has(this._authMethod)))return t(this._formatError('Missing credentials for "'+this._authMethod+'"',"EAUTH",!1,"API"));this._auth.credentials={user:this._auth.user,pass:this._auth.pass,options:this._auth.options}}if(this.customAuth.has(this._authMethod)){const e=this.customAuth.get(this._authMethod);let i,n=!1;const r=()=>{n||(n=!0,this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0))},s=e=>{n||(n=!0,t(this._formatError(e,"EAUTH",i,"AUTH "+this._authMethod)))},o=(e,t)=>{let n;return t||(n=new Promise((e,i)=>{t=w.callbackPromise(e,i)})),this._responseActions.push(n=>{i=n;let r=n.match(/^(\d+)(?:\s(\d+\.\d+\.\d+))?\s/),s={command:e,response:n};r?(s.status=Number(r[1])||0,r[2]&&(s.code=r[2]),s.text=n.substr(r[0].length)):(s.text=n,s.status=0),t(null,s)}),setImmediate(()=>this._sendCommand(e)),n},a=e({auth:this._auth,method:this._authMethod,extensions:[].concat(this._supportedExtensions),authMethods:[].concat(this._supportedAuth),maxAllowedSize:this._maxAllowedSize||!1,sendCommand:o,resolve:r,reject:s});return void(a&&"function"==typeof a.catch&&a.then(r).catch(s))}switch(this._authMethod){case"XOAUTH2":return void this._handleXOauth2Token(!1,t);case"LOGIN":return this._responseActions.push(e=>{this._actionAUTH_LOGIN_USER(e,t)}),void this._sendCommand("AUTH LOGIN");case"PLAIN":return this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),void this._sendCommand("AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0"+this._auth.credentials.pass,"utf-8").toString("base64"),"AUTH PLAIN "+Buffer.from("\0"+this._auth.credentials.user+"\0/* secret */","utf-8").toString("base64"));case"CRAM-MD5":return this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5(e,t)}),void this._sendCommand("AUTH CRAM-MD5")}return t(this._formatError('Unknown authentication method "'+this._authMethod+'"',"EAUTH",!1,"API"))}send(e,t,i){let n=!1;const r=(e,t)=>{n||(n=!0,this._pendingSend&&this._pendingSend.callback===r&&(this._pendingSend=!1),i(e,t))};if(!t)return r(this._formatError("Empty message","EMESSAGE",!1,"API"));const s=this._isDestroyedMessage("send message");if(s)return r(this._formatError(s,"ECONNECTION",!1,"API"));if(this._maxAllowedSize&&e.size>this._maxAllowedSize)return void setImmediate(()=>{r(this._formatError("Message size larger than allowed "+this._maxAllowedSize,"EMESSAGE",!1,"MAIL FROM"))});const o={callback:r,stream:!1,onStreamError:e=>r(this._formatError(e,"ESTREAM",!1,"API"))};"function"==typeof t.on&&(o.stream=t,o.stream.on("error",o.onStreamError)),this._pendingSend=o;const a=Date.now();this._setEnvelope(e,(e,i)=>{if(e){const i=new g.PassThrough;return"function"==typeof t.pipe?t.pipe(i):(i.write(t),i.end()),r(e)}const n=Date.now(),s=this._createSendStream((e,t)=>{if(e)return r(e);const o=i;return o.envelopeTime=n-a,o.messageTime=Date.now()-n,o.messageSize=s.outByteCount,o.response=t,r(null,o)});"function"==typeof t.pipe?t.pipe(s):(s.write(t),s.end())})}reset(e){const t=this._isDestroyedMessage("reset");if(t)return e(this._formatError(t,"ECONNECTION",!1,"API"));this._sendCommand("RSET"),this._responseActions.push(t=>"2"!==t.charAt(0)?e(this._formatError("Could not reset session state. response="+t,"EPROTOCOL",t,"RSET")):(this._envelope=!1,e(null,!0)))}_onConnect(){const e=this._socket;clearTimeout(this._connectionTimeout),this.logger.info({tnx:"network",localAddress:e.localAddress,localPort:e.localPort,remoteAddress:e.remoteAddress,remotePort:e.remotePort},"%s established to %s:%s",this.secure?"Secure connection":"Connection",e.remoteAddress,e.remotePort),this._destroyed?this.close():(this.stage="connected",e.removeListener("data",this._onSocketData),e.removeListener("timeout",this._onSocketTimeout),e.removeListener("close",this._onSocketClose),e.removeListener("end",this._onSocketEnd),e.removeListener("error",this._onConnectionSocketError),e.removeListener("error",this._onSocketError),e.on("error",this._onSocketError),e.on("data",this._onSocketData),e.once("close",this._onSocketClose),e.once("end",this._onSocketEnd),e.setTimeout(this.options.socketTimeout||y),e.on("timeout",this._onSocketTimeout),this._greetingTimeout=setTimeout(()=>{this._socket&&!this._destroyed&&this._responseActions[0]===this._actionGreeting&&this._onError("Greeting never received","ETIMEDOUT",!1,"CONN")},this.options.greetingTimeout||3e4),this._responseActions.push(this._actionGreeting),e.resume())}_onData(e){if(this._destroyed||!e||!e.length)return;const t=this.options.maxResponseSize||1048576,i=e.toString("binary");if(!i.includes("\n"))return this._remainder+=i,this._remainder.length>t?this._onResponseTooLarge():void 0;const n=(this._remainder+i).split(/\r?\n/);this._remainder=n.pop();for(let e=0,i=n.length;e<i;e++)if(this._responsePartial?this._responseQueue[this._responseQueue.length-1]+="\n"+n[e]:this._responseQueue.push(n[e]),this._responsePartial=v(n[e]),this._responsePartial&&this._responseQueue[this._responseQueue.length-1].length>t)return this._onResponseTooLarge();if(this._remainder.length>t)return this._onResponseTooLarge();this._responsePartial||this._processResponse()}_onResponseTooLarge(){this._remainder="",this._responseQueue=[],this._responsePartial=!1,this._onError(new Error("Server response exceeds maximum allowed size"),"EPROTOCOL",!1,"CONN")}_onError(e,t,i,n){if(clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._destroyed)return;e=this._formatError(e,t,i,n);["ETIMEDOUT","ESOCKET","ECONNECTION"].includes(e.code)?this.logger.warn(i,e.message):this.logger.error(i,e.message);const r=this._pendingSend;this.emit("error",e),this.close(),r&&r.callback(e)}_formatError(e,t,i,n){let r;r=/Error\]$/i.test(Object.prototype.toString.call(e))?e:new Error(e),t&&"Error"!==t&&(r.code=t),i&&(r.response=i,r.message+=": "+i);const s="string"==typeof i&&Number((i.match(/^\d+/)||[])[0])||!1;return s&&(r.responseCode=s),n&&(r.command=n),r}_onClose(){let e=!1;this._remainder&&this._remainder.trim()&&(this.lastServerResponse=e=I(this._remainder.trim()),(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},e)),this.logger.info({tnx:"network"},"Connection closed");const t=!("string"!=typeof e||!/^[45]\d{2}[ -]/.test(e))&&e;if(this.upgrading&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ETLS",t,"CONN");if(!t&&this._responseActions[0]===this._actionGreeting&&this._connectCallback&&!this._destroyed){const e=this._connectCallback;this._connectCallback=!1;const t=this._formatError(new Error("Connection closed unexpectedly"),"ECONNECTION",!1,"CONN");return this.logger.warn({tnx:"network"},t.message),e(t),void this.close()}if(t||this._responseActions[0]!==this.close&&!this._destroyed)return this._onError(new Error("Connection closed unexpectedly"),"ECONNECTION",t,"CONN");this._destroy()}_onEnd(){this._socket&&!this._socket.destroyed&&this._socket.end()}_onTimeout(){return this._onError(new Error("Timeout"),"ETIMEDOUT",!1,"CONN")}_destroy(){this._destroyed||(this._destroyed=!0,this.destroyed=!0,clearTimeout(this._connectionTimeout),clearTimeout(this._greetingTimeout),this._connectionTimeout=!1,this._greetingTimeout=!1,this.emit("end"))}_upgradeConnection(e){this._remainder="",this._responseQueue=[],this._responsePartial=!1;const t=this._socket;t.removeListener("data",this._onSocketData),t.removeListener("timeout",this._onSocketTimeout);const i=Object.assign({socket:t,host:this.host},this.options.tls||{});this.servername&&!i.servername&&(i.servername=this.servername);const n=()=>{t.removeListener("close",this._onSocketClose),t.removeListener("end",this._onSocketEnd),t.removeListener("error",this._onSocketError),t.removeListener("error",this._onConnectionSocketError)};this.upgrading=!0;try{this._socket=u.default.connect(i,()=>(this.secure=!0,this.upgrading=!1,this._socket.on("data",this._onSocketData),n(),e(null,!0)))}catch(t){return n(),e(t)}this._socket.on("error",this._onSocketError),this._socket.once("close",this._onSocketClose),this._socket.once("end",this._onSocketEnd),this._socket.setTimeout(this.options.socketTimeout||y),this._socket.on("timeout",this._onSocketTimeout),t.resume()}_processResponse(){if(!this._responseQueue.length)return!1;const e=(this._responseQueue.shift()||"").toString();if(!e.trim())return void setImmediate(()=>this._processResponse());if(function(e){return v(e.slice(e.lastIndexOf("\n")+1))}(e))return void this._responseQueue.unshift(e);const t=this.lastServerResponse=I(e);(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"server"},t.replace(/\r?\n$/,""));const i=this._responseActions.shift();if("function"!=typeof i)return this._onError(new Error("Unexpected Response"),"EPROTOCOL",t,"CONN");i.call(this,t),setImmediate(()=>this._processResponse())}_sendCommand(e,t){if(this._destroyed)return;const i=this._socket;if(i.destroyed)return this.close();(this.options.debug||this.options.transactionLog)&&this.logger.debug({tnx:"client"},(t||e||"").toString().replace(/\r?\n$/,"")),i.write(Buffer.from(e+"\r\n","utf-8"))}_setEnvelope(e,t){const i=[];let n=!1;if(this._envelope=e||{},this._envelope.from=(this._envelope.from&&this._envelope.from.address||this._envelope.from||"").toString().trim(),this._envelope.to=[].concat(this._envelope.to||[]).map(e=>(e&&e.address||e||"").toString().trim()),!this._envelope.to.length)return t(this._formatError("No recipients defined","EENVELOPE",!1,"API"));if(this._envelope.from&&/[\r\n<>]/.test(this._envelope.from))return t(this._formatError("Invalid sender "+JSON.stringify(this._envelope.from),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.from)&&(n=!0);for(let e=0,i=this._envelope.to.length;e<i;e++){if(!this._envelope.to[e]||/[\r\n<>]/.test(this._envelope.to[e]))return t(this._formatError("Invalid recipient "+JSON.stringify(this._envelope.to[e]),"EENVELOPE",!1,"API"));/[\x80-\uFFFF]/.test(this._envelope.to[e])&&(n=!0)}if(this._envelope.rcptQueue=[].concat(this._envelope.to||[]),this._envelope.rejected=[],this._envelope.rejectedErrors=[],this._envelope.accepted=[],this._envelope.dsn)try{this._envelope.dsn=this._setDsnEnvelope(this._envelope.dsn)}catch(e){return t(this._formatError("Invalid DSN "+e.message,"EENVELOPE",!1,"API"))}if(this._envelope.requireTLSExtensionEnabled){if(!this.secure)return t(this._formatError("REQUIRETLS can only be used over TLS connections (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"));if(!this._supportedExtensions.includes("REQUIRETLS"))return t(this._formatError("Server does not support REQUIRETLS extension (RFC 8689)","EREQUIRETLS",!1,"MAIL FROM"))}if(this._responseActions.push(e=>{this._actionMAIL(e,t)}),n&&this._supportedExtensions.includes("SMTPUTF8")&&(i.push("SMTPUTF8"),this._usingSmtpUtf8=!0),this._envelope.use8BitMime&&this._supportedExtensions.includes("8BITMIME")&&(i.push("BODY=8BITMIME"),this._using8BitMime=!0),this._envelope.size&&this._supportedExtensions.includes("SIZE")){const e=Number(this._envelope.size)||0;e>0&&i.push("SIZE="+e)}this._envelope.dsn&&this._supportedExtensions.includes("DSN")&&(this._envelope.dsn.ret&&i.push("RET="+w.encodeXText(this._envelope.dsn.ret)),this._envelope.dsn.envid&&i.push("ENVID="+w.encodeXText(this._envelope.dsn.envid))),this._envelope.requireTLSExtensionEnabled&&i.push("REQUIRETLS"),this._sendCommand("MAIL FROM:<"+this._envelope.from+">"+(i.length?" "+i.join(" "):""))}_setDsnEnvelope(e){let t=(e.ret||e.return||"").toString().toUpperCase()||null;if(t)switch(t){case"HDRS":case"HEADERS":t="HDRS";break;case"FULL":case"BODY":t="FULL"}if(t&&!["FULL","HDRS"].includes(t))throw new Error("ret: "+JSON.stringify(t));const i=(e.envid||e.id||"").toString()||null;let n=e.notify||null;if(n){"string"==typeof n&&(n=n.split(",")),n=n.map(e=>e.trim().toUpperCase());const e=["NEVER","SUCCESS","FAILURE","DELAY"];if(n.filter(t=>!e.includes(t)).length||n.length>1&&n.includes("NEVER"))throw new Error("notify: "+JSON.stringify(n.join(",")));n=n.join(",")}let r=(e.recipient||e.orcpt||"").toString()||null;return r&&r.indexOf(";")<0&&(r="rfc822;"+r),{ret:t,envid:i,notify:n,orcpt:r}}_getDsnRcptToArgs(){const e=this._envelope,t=[];return e.dsn&&this._supportedExtensions.includes("DSN")&&(e.dsn.notify&&t.push("NOTIFY="+w.encodeXText(e.dsn.notify)),e.dsn.orcpt&&t.push("ORCPT="+w.encodeXText(e.dsn.orcpt))),t.length?" "+t.join(" "):""}_createSendStream(e){const t=this._envelope,i=new f.default;if(this.options.lmtp?t.accepted.forEach((i,n)=>{const r=n===t.accepted.length-1;this._responseActions.push(t=>{this._actionLMTPStream(i,r,t,e)})}):this._responseActions.push(t=>{this._actionSMTPStream(t,e)}),this._currentDataStream=i,i.pipe(this._socket,{end:!1}),this.options.debug){const e=new g.PassThrough;e.on("readable",()=>{let t;for(;t=e.read();)this.logger.debug({tnx:"message"},t.toString("binary").replace(/\r?\n$/,""))}),i.pipe(e)}return i.once("end",()=>{this._currentDataStream===i&&(this._currentDataStream=!1),this.logger.info({tnx:"message",inByteCount:i.inByteCount,outByteCount:i.outByteCount},"<%s bytes encoded mime message (source size %s bytes)>",i.outByteCount,i.inByteCount)}),i}_actionGreeting(e){clearTimeout(this._greetingTimeout),"220"===e.substr(0,3)?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this._onError(new Error("Invalid greeting. response="+e),"EPROTOCOL",e,"CONN")}_actionLHLO(e){"2"===e.charAt(0)?this._actionEHLO(e):this._onError(new Error("Invalid LHLO. response="+e),"EPROTOCOL",e,"LHLO")}_actionEHLO(e){let t;if("421"===e.substr(0,3))return void this._onError(new Error("Server terminates connection. response="+e),"ECONNECTION",e,"EHLO");if("2"!==e.charAt(0))return this.options.requireTLS?void this._onError(new Error("EHLO failed but HELO does not support required STARTTLS. response="+e),"ECONNECTION",e,"EHLO"):(this._responseActions.push(this._actionHELO),void this._sendCommand("HELO "+this.name));if(this._ehloLines=e.split(/\r?\n/).map(e=>e.replace(/^\d+[ -]/,"").trim()).filter(e=>e).slice(1),!this.secure&&!this.options.ignoreTLS&&(/[ -]STARTTLS\b/im.test(e)||this.options.requireTLS))return this._sendCommand("STARTTLS"),void this._responseActions.push(this._actionSTARTTLS);/[ -]SMTPUTF8\b/im.test(e)&&this._supportedExtensions.push("SMTPUTF8"),/[ -]DSN\b/im.test(e)&&this._supportedExtensions.push("DSN"),/[ -]8BITMIME\b/im.test(e)&&this._supportedExtensions.push("8BITMIME"),/[ -]REQUIRETLS\b/im.test(e)&&this._supportedExtensions.push("REQUIRETLS"),/[ -]PIPELINING\b/im.test(e)&&this._supportedExtensions.push("PIPELINING"),/[ -]AUTH\b/i.test(e)&&(this.allowsAuth=!0);const i=new Set;for(const e of this._ehloLines){const t=/^AUTH[\s=](.*)/i.exec(e);if(t)for(const e of t[1].split(/[\s=]+/))i.add(e.toUpperCase())}for(const e of["PLAIN","LOGIN","CRAM-MD5","XOAUTH2"])i.has(e)&&this._supportedAuth.push(e);(t=e.match(/[ -]SIZE(?:[ \t]+(\d+))?/im))&&(this._supportedExtensions.push("SIZE"),this._maxAllowedSize=Number(t[1])||0),this.emit("connect")}_actionHELO(e){"2"===e.charAt(0)?(this.allowsAuth=!0,this.emit("connect")):this._onError(new Error("Invalid HELO. response="+e),"EPROTOCOL",e,"HELO")}_actionSTARTTLS(e){if("2"!==e.charAt(0))return this.options.opportunisticTLS?(this.logger.info({tnx:"smtp"},"Failed STARTTLS upgrade, continuing unencrypted"),void this.emit("connect")):void this._onError(new Error("Error upgrading connection with STARTTLS"),"ETLS",e,"STARTTLS");this._upgradeConnection((e,t)=>{e?this._onError(new Error("Error initiating TLS - "+(e.message||e)),"ETLS",!1,"STARTTLS"):(this.logger.info({tnx:"smtp"},"Connection upgraded with STARTTLS"),t?this.options.lmtp?(this._responseActions.push(this._actionLHLO),this._sendCommand("LHLO "+this.name)):(this._responseActions.push(this._actionEHLO),this._sendCommand("EHLO "+this.name)):this.emit("connect"))})}_actionAUTH_LOGIN_USER(e,t){/^334[ -]/.test(e)?(this._responseActions.push(e=>{this._actionAUTH_LOGIN_PASS(e,t)}),this._sendCommand(Buffer.from(this._auth.credentials.user+"","utf-8").toString("base64"))):t(this._formatError('Invalid login sequence while waiting for "334 VXNlcm5hbWU6"',"EAUTH",e,"AUTH LOGIN"))}_actionAUTH_CRAM_MD5(e,t){const i=e.match(/^334\s+(.+)$/);if(!i)return t(this._formatError("Invalid login sequence while waiting for server challenge string","EAUTH",e,"AUTH CRAM-MD5"));const n=Buffer.from(i[1],"base64").toString("ascii"),r=h.default.createHmac("md5",this._auth.credentials.pass);r.update(n);const s=this._auth.credentials.user+" "+r.digest("hex");this._responseActions.push(e=>{this._actionAUTH_CRAM_MD5_PASS(e,t)}),this._sendCommand(Buffer.from(s).toString("base64"),Buffer.from(this._auth.credentials.user+" /* secret */").toString("base64"))}_actionAUTH_CRAM_MD5_PASS(e,t){if(!e.match(/^235\s+/))return t(this._formatError('Invalid login sequence while waiting for "235"',"EAUTH",e,"AUTH CRAM-MD5"));this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,t(null,!0)}_actionAUTH_LOGIN_PASS(e,t){if(!/^334[ -]/.test(e))return t(this._formatError('Invalid login sequence while waiting for "334 UGFzc3dvcmQ6"',"EAUTH",e,"AUTH LOGIN"));this._responseActions.push(e=>{this._actionAUTHComplete(e,t)}),this._sendCommand(Buffer.from((this._auth.credentials.pass||"").toString(),"utf-8").toString("base64"),Buffer.from("/* secret */","utf-8").toString("base64"))}_actionAUTHComplete(e,t,i){return i||"function"!=typeof t||(i=t,t=!1),"334"===e.substr(0,3)?(this._responseActions.push(e=>{t||"XOAUTH2"!==this._authMethod?this._actionAUTHComplete(e,!0,i):setImmediate(()=>this._handleXOauth2Token(!0,i))}),void this._sendCommand("")):"2"!==e.charAt(0)?(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),i(this._formatError("Invalid login","EAUTH",e,"AUTH "+this._authMethod))):(this.logger.info({tnx:"smtp",username:this._auth.user,action:"authenticated",method:this._authMethod},"User %s authenticated",JSON.stringify(this._auth.user)),this.authenticated=!0,void i(null,!0))}_actionMAIL(e,t){const i=this._envelope;if(2!==Number(e.charAt(0))){const n=this._usingSmtpUtf8&&/^550 /.test(e)&&/[\x80-\uFFFF]/.test(i.from)?"Internationalized mailbox name not allowed":"Mail command failed";return t(this._formatError(n,"EENVELOPE",e,"MAIL FROM"))}if(!i.rcptQueue.length)return t(this._formatError("Can't send mail - no recipients defined","EENVELOPE",!1,"API"));this._recipientQueue=[];const n=this._supportedExtensions.includes("PIPELINING");do{const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}while(n&&i.rcptQueue.length)}_actionRCPT(e,t){const i=this._envelope;let n;const r=this._recipientQueue.shift();if(2!==Number(e.charAt(0))){const t=this._usingSmtpUtf8&&/^553 /.test(e)&&/[\x80-\uFFFF]/.test(r)?"Internationalized mailbox name not allowed":"Recipient command failed";i.rejected.push(r),n=this._formatError(t,"EENVELOPE",e,"RCPT TO"),n.recipient=r,i.rejectedErrors.push(n)}else i.accepted.push(r);if(i.rcptQueue.length||this._recipientQueue.length){if(i.rcptQueue.length){const e=i.rcptQueue.shift();this._recipientQueue.push(e),this._responseActions.push(e=>{this._actionRCPT(e,t)}),this._sendCommand("RCPT TO:<"+e+">"+this._getDsnRcptToArgs())}}else{if(!(i.rejected.length<i.to.length)){const r=i.rejectedErrors.find(e=>e.responseCode&&e.responseCode<500),s=r?.response??e;return n=this._formatError("Can't send mail - all recipients were rejected","EENVELOPE",s,"RCPT TO"),n.rejected=i.rejected,n.rejectedErrors=i.rejectedErrors,t(n)}this._responseActions.push(e=>{this._actionDATA(e,t)}),this._sendCommand("DATA")}}_actionDATA(e,t){const i=this._envelope;if(!/^[23]/.test(e))return t(this._formatError("Data command failed","EENVELOPE",e,"DATA"));const n={accepted:i.accepted,rejected:i.rejected};this._ehloLines&&this._ehloLines.length&&(n.ehlo=this._ehloLines),i.rejectedErrors.length&&(n.rejectedErrors=i.rejectedErrors),t(null,n)}_actionSMTPStream(e,t){return 2!==Number(e.charAt(0))?t(this._formatError("Message failed","EMESSAGE",e,"DATA")):t(null,e)}_actionLMTPStream(e,t,i,n){const r=this._envelope;let s;if(2!==Number(i.charAt(0))){s=this._formatError("Message failed for recipient "+e,"EMESSAGE",i,"DATA"),s.recipient=e,r.rejected.push(e),r.rejectedErrors.push(s);for(let t=0,i=r.accepted.length;t<i;t++)r.accepted[t]===e&&r.accepted.splice(t,1)}if(t)return n(null,i)}_handleXOauth2Token(e,t){this._auth.oauth2.getToken(e,(i,n)=>{if(i)return this.logger.info({tnx:"smtp",username:this._auth.user,action:"authfail",method:this._authMethod},"User %s failed to authenticate",JSON.stringify(this._auth.user)),t(this._formatError(i,"EAUTH",!1,"AUTH XOAUTH2"));this._responseActions.push(i=>{this._actionAUTHComplete(i,e,t)}),this._sendCommand("AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token(n),"AUTH XOAUTH2 "+this._auth.oauth2.buildXOAuth2Token("/* secret */"))})}_isDestroyedMessage(e){if(this._destroyed)return"Cannot "+e+" - smtp connection is already destroyed.";if(this._socket){if(this._socket.destroyed)return"Cannot "+e+" - smtp connection socket is already destroyed.";if(!this._socket.writable)return"Cannot "+e+" - smtp connection socket is already half-closed."}}_getHostname(){let e;try{e=m.default.hostname()||""}catch(t){e="localhost"}return(!e||e.indexOf(".")<0)&&(e="[127.0.0.1]"),e.match(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)&&(e="["+e+"]"),e}}t.default=L,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Fp,Fp.exports)),Fp.exports}var Wp,Pp,Kp={exports:{}};function Hp(){return Wp||(Wp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=M,c=o(Pu()),l=o(b),u=s(Ku()),p=s(Yu());class d extends a.Stream{constructor(e,t){if(super(),this.options=e||{},this.configError=!1,e&&e.serviceClient){if(!e.privateKey||!e.user){const e=new Error('Options "privateKey" and "user" are required for service account!');e.code=p.EOAUTH2,this.configError=e}const t=Math.min(Math.max(Number(this.options.serviceRequestTimeout)||0,0),3600);this.options.serviceRequestTimeout=t||300}if(this.logger=u.getLogger({logger:t},{component:this.options.component||"OAuth2"}),this.provisionCallback="function"==typeof this.options.provisionCallback&&this.options.provisionCallback,this.options.accessUrl=this.options.accessUrl||"https://accounts.google.com/o/oauth2/token",this.options.customHeaders=this.options.customHeaders||{},this.options.customParams=this.options.customParams||{},this.accessToken=this.options.accessToken||!1,this.options.expires&&Number(this.options.expires))this.expires=this.options.expires;else{const e=Math.max(Number(this.options.timeout)||0,0);this.expires=e&&Date.now()+1e3*e||0}this.renewing=!1,this.renewalQueue=[]}getToken(e,t){const i=t;if(this.configError)return i(this.configError);if(!e&&this.accessToken&&(!this.expires||this.expires>Date.now()))return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token for %s",this.options.user),t(null,this.accessToken);if(!this.provisionCallback&&!this.options.refreshToken&&!this.options.serviceClient){if(this.accessToken)return this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"reuse"},"Reusing existing access token (no refresh capability) for %s",this.options.user),t(null,this.accessToken);this.logger.error({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Cannot renew access token for %s: No refresh mechanism available",this.options.user);const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,i(e)}if(this.renewing)return void this.renewalQueue.push({renew:e,callback:i});this.renewing=!0;const n=(e,t)=>{this.renewalQueue.forEach(i=>i.callback(e,t)),this.renewalQueue=[],this.renewing=!1,e?this.logger.error({err:e,tnx:"OAUTH2",user:this.options.user,action:"renew"},"Failed generating new Access Token for %s",this.options.user):this.logger.info({tnx:"OAUTH2",user:this.options.user,action:"renew"},"Generated new Access Token for %s",this.options.user),i(e,t)};this.provisionCallback?this.provisionCallback(this.options.user,!!e,(e,t,i)=>{!e&&t&&(this.accessToken=t,this.expires=i||0),n(e,t)}):this.generateToken(n)}updateToken(e,t){this.accessToken=e,t=Math.max(Number(t)||0,0),this.expires=t&&Date.now()+1e3*t||0,this.emit("token",{user:this.options.user,accessToken:e||"",expires:this.expires})}generateToken(e){const t=e;let i,n;if(this.options.serviceClient){const e=Math.floor(Date.now()/1e3),r={iss:this.options.serviceClient,scope:this.options.scope||"https://mail.google.com/",sub:this.options.user,aud:this.options.accessUrl,iat:e,exp:e+this.options.serviceRequestTimeout};let s;try{s=this.jwtSignRS256(r)}catch(e){const i=new Error("Can't generate token. Check your auth options");return i.code=p.EOAUTH2,t(i)}i={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:s},n={grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r}}else{if(!this.options.refreshToken){const e=new Error("Can't create new access token for user");return e.code=p.EOAUTH2,t(e)}i={client_id:this.options.clientId||"",client_secret:this.options.clientSecret||"",refresh_token:this.options.refreshToken,grant_type:"refresh_token"},n={client_id:this.options.clientId||"",client_secret:(this.options.clientSecret||"").substr(0,6)+"...",refresh_token:(this.options.refreshToken||"").substr(0,6)+"...",grant_type:"refresh_token"}}Object.assign(i,this.options.customParams),Object.assign(n,this.options.customParams),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"generate"},"Requesting token using: %s",JSON.stringify(n)),this.postRequest(this.options.accessUrl,i,this.options,(i,n)=>{let r;if(i)return t(i);try{r=JSON.parse(n.toString())}catch(e){return t(e)}if(!r||"object"!=typeof r){this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",(n||"").toString());const e=new Error("Invalid authentication response");return e.code=p.EOAUTH2,t(e)}const s=Object.assign({},r);if(s.access_token&&(s.access_token=(s.access_token||"").toString().substr(0,6)+"..."),this.logger.debug({tnx:"OAUTH2",user:this.options.user,action:"post"},"Response: %s",JSON.stringify(s)),r.error){let e=r.error;r.error_description&&(e+=": "+r.error_description),r.error_uri&&(e+=" ("+r.error_uri+")");const i=new Error(e);return i.code=p.EOAUTH2,t(i)}if(r.access_token)return this.updateToken(r.access_token,r.expires_in),e(null,this.accessToken);const o=new Error("No access token");return o.code=p.EOAUTH2,t(o)})}buildXOAuth2Token(e){const t=["user="+(this.options.user||""),"auth=Bearer "+(e||this.accessToken),"",""];return Buffer.from(t.join(""),"utf-8").toString("base64")}postRequest(e,t,i,n){let r=!1;const s=[];let o=0;const a={method:"post",headers:i.customHeaders,body:t,allowErrorResponse:!0,timeout:i.requestTimeout};/^https:/i.test(e)&&(a.tls=Object.assign({rejectUnauthorized:!0},i.tls||{}));const l=(0,c.default)(e,a);l.on("readable",()=>{let e;for(;null!==(e=l.read());)s.push(e),o+=e.length}),l.once("error",e=>{if(!r)return r=!0,n(e)}),l.once("end",()=>{if(!r)return r=!0,n(null,Buffer.concat(s,o))})}toBase64URL(e){return"string"==typeof e&&(e=Buffer.from(e)),e.toString("base64").replace(/[=]+/g,"").replace(/\+/g,"-").replace(/\//g,"_")}jwtSignRS256(e){const t=['{"alg":"RS256","typ":"JWT"}',JSON.stringify(e)].map(e=>this.toBase64URL(e)).join("."),i=l.default.createSign("RSA-SHA256").update(t).sign(this.options.privateKey);return t+"."+this.toBase64URL(i)}}t.default=d,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Kp,Kp.exports)),Kp.exports}var Up,Bp,Vp,_p={exports:{}},Rp={};function Qp(){return Bp||(Bp=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e=r(e.split("@").pop()),n[e]||!1};const i=(Up||(Up=1,Object.defineProperty(Rp,"__esModule",{value:!0}),Rp.services=void 0,Rp.services={126:{description:"126 Mail (NetEase)",host:"smtp.126.com",port:465,secure:!0},163:{description:"163 Mail (NetEase)",host:"smtp.163.com",port:465,secure:!0},"1und1":{description:"1&1 Mail (German hosting provider)",host:"smtp.1und1.de",port:465,secure:!0,authMethod:"LOGIN"},Aliyun:{description:"Alibaba Cloud Mail",domains:["aliyun.com"],host:"smtp.aliyun.com",port:465,secure:!0},AliyunQiye:{description:"Alibaba Cloud Enterprise Mail",host:"smtp.qiye.aliyun.com",port:465,secure:!0},AOL:{description:"AOL Mail",domains:["aol.com"],host:"smtp.aol.com",port:587},Aruba:{description:"Aruba PEC (Italian email provider)",domains:["aruba.it","pec.aruba.it"],aliases:["Aruba PEC"],host:"smtps.aruba.it",port:465,secure:!0,authMethod:"LOGIN"},Bluewin:{description:"Bluewin (Swiss email provider)",host:"smtpauths.bluewin.ch",domains:["bluewin.ch"],port:465},BOL:{description:"BOL Mail (Brazilian provider)",domains:["bol.com.br"],host:"smtp.bol.com.br",port:587,requireTLS:!0},DebugMail:{description:"DebugMail (email testing service)",host:"debugmail.io",port:25},Disroot:{description:"Disroot (privacy-focused provider)",domains:["disroot.org"],host:"disroot.org",port:587,secure:!1,authMethod:"LOGIN"},DynectEmail:{description:"Dyn Email Delivery",aliases:["Dynect"],host:"smtp.dynect.net",port:25},ElasticEmail:{description:"Elastic Email",aliases:["Elastic Email"],host:"smtp.elasticemail.com",port:465,secure:!0},Ethereal:{description:"Ethereal Email (email testing service)",aliases:["ethereal.email"],host:"smtp.ethereal.email",port:587},FastMail:{description:"FastMail",domains:["fastmail.com","fastmail.fm"],host:"smtp.fastmail.com",port:465,secure:!0},"Feishu Mail":{description:"Feishu Mail (Lark)",aliases:["Feishu","FeishuMail"],domains:["www.feishu.cn"],host:"smtp.feishu.cn",port:465,secure:!0},"Forward Email":{description:"Forward Email (email forwarding service)",aliases:["FE","ForwardEmail"],domains:["forwardemail.net"],host:"smtp.forwardemail.net",port:465,secure:!0},GandiMail:{description:"Gandi Mail",aliases:["Gandi","Gandi Mail"],host:"mail.gandi.net",port:587},Gmail:{description:"Gmail",aliases:["Google Mail"],domains:["gmail.com","googlemail.com"],host:"smtp.gmail.com",port:465,secure:!0},GmailWorkspace:{description:"Gmail Workspace",aliases:["Google Workspace Mail"],host:"smtp-relay.gmail.com",port:465,secure:!0},GMX:{description:"GMX Mail",domains:["gmx.com","gmx.net","gmx.de"],host:"mail.gmx.com",port:587},Godaddy:{description:"GoDaddy Email (US)",host:"smtpout.secureserver.net",port:25},GodaddyAsia:{description:"GoDaddy Email (Asia)",host:"smtp.asia.secureserver.net",port:25},GodaddyEurope:{description:"GoDaddy Email (Europe)",host:"smtp.europe.secureserver.net",port:25},"hot.ee":{description:"Hot.ee (Estonian email provider)",host:"mail.hot.ee"},Hotmail:{description:"Outlook.com / Hotmail",aliases:["Outlook","Outlook.com","Hotmail.com"],domains:["hotmail.com","outlook.com"],host:"smtp-mail.outlook.com",port:587},iCloud:{description:"iCloud Mail",aliases:["Me","Mac"],domains:["icloud.com","me.com","mac.com"],host:"smtp.mail.me.com",port:587},Infomaniak:{description:"Infomaniak Mail (Swiss hosting provider)",host:"mail.infomaniak.com",domains:["ik.me","ikmail.com","etik.com"],port:587},KolabNow:{description:"KolabNow (secure email service)",domains:["kolabnow.com"],aliases:["Kolab"],host:"smtp.kolabnow.com",port:465,secure:!0,authMethod:"LOGIN"},Loopia:{description:"Loopia (Swedish hosting provider)",host:"mailcluster.loopia.se",port:465},Loops:{description:"Loops",host:"smtp.loops.so",port:587},"mail.ee":{description:"Mail.ee (Estonian email provider)",host:"smtp.mail.ee"},"Mail.ru":{description:"Mail.ru",host:"smtp.mail.ru",port:465,secure:!0},"Mailcatch.app":{description:"Mailcatch (email testing service)",host:"sandbox-smtp.mailcatch.app",port:2525},Maildev:{description:"MailDev (local email testing)",port:1025,ignoreTLS:!0},MailerSend:{description:"MailerSend",host:"smtp.mailersend.net",port:587},Mailgun:{description:"Mailgun",host:"smtp.mailgun.org",port:465,secure:!0},Mailjet:{description:"Mailjet",host:"in.mailjet.com",port:587},Mailosaur:{description:"Mailosaur (email testing service)",host:"mailosaur.io",port:25},Mailtrap:{description:"Mailtrap",host:"live.smtp.mailtrap.io",port:587},Mandrill:{description:"Mandrill (by Mailchimp)",host:"smtp.mandrillapp.com",port:587},Naver:{description:"Naver Mail (Korean email provider)",host:"smtp.naver.com",port:587},OhMySMTP:{description:"OhMySMTP (email delivery service)",host:"smtp.ohmysmtp.com",port:587,secure:!1},One:{description:"One.com Email",host:"send.one.com",port:465,secure:!0},OpenMailBox:{description:"OpenMailBox",aliases:["OMB","openmailbox.org"],host:"smtp.openmailbox.org",port:465,secure:!0},Outlook365:{description:"Microsoft 365 / Office 365",host:"smtp.office365.com",port:587,secure:!1},Postmark:{description:"Postmark",aliases:["PostmarkApp"],host:"smtp.postmarkapp.com",port:2525},Proton:{description:"Proton Mail",aliases:["ProtonMail","Proton.me","Protonmail.com","Protonmail.ch"],domains:["proton.me","protonmail.com","pm.me","protonmail.ch"],host:"smtp.protonmail.ch",port:587,requireTLS:!0},"qiye.aliyun":{description:"Alibaba Mail Enterprise Edition",host:"smtp.mxhichina.com",port:"465",secure:!0},QQ:{description:"QQ Mail",domains:["qq.com"],host:"smtp.qq.com",port:465,secure:!0},QQex:{description:"QQ Enterprise Mail",aliases:["QQ Enterprise"],domains:["exmail.qq.com"],host:"smtp.exmail.qq.com",port:465,secure:!0},Resend:{description:"Resend",host:"smtp.resend.com",port:465,secure:!0},Runbox:{description:"Runbox (Norwegian email provider)",domains:["runbox.com"],host:"smtp.runbox.com",port:465,secure:!0},SendCloud:{description:"SendCloud (Chinese email delivery)",host:"smtp.sendcloud.net",port:2525},SendGrid:{description:"SendGrid",host:"smtp.sendgrid.net",port:587},SendinBlue:{description:"Brevo (formerly Sendinblue)",aliases:["Brevo"],host:"smtp-relay.brevo.com",port:587},SendPulse:{description:"SendPulse",host:"smtp-pulse.com",port:465,secure:!0},SES:{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-1":{description:"AWS SES Asia Pacific (Tokyo)",host:"email-smtp.ap-northeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-2":{description:"AWS SES Asia Pacific (Seoul)",host:"email-smtp.ap-northeast-2.amazonaws.com",port:465,secure:!0},"SES-AP-NORTHEAST-3":{description:"AWS SES Asia Pacific (Osaka)",host:"email-smtp.ap-northeast-3.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTH-1":{description:"AWS SES Asia Pacific (Mumbai)",host:"email-smtp.ap-south-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-1":{description:"AWS SES Asia Pacific (Singapore)",host:"email-smtp.ap-southeast-1.amazonaws.com",port:465,secure:!0},"SES-AP-SOUTHEAST-2":{description:"AWS SES Asia Pacific (Sydney)",host:"email-smtp.ap-southeast-2.amazonaws.com",port:465,secure:!0},"SES-CA-CENTRAL-1":{description:"AWS SES Canada (Central)",host:"email-smtp.ca-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-CENTRAL-1":{description:"AWS SES Europe (Frankfurt)",host:"email-smtp.eu-central-1.amazonaws.com",port:465,secure:!0},"SES-EU-NORTH-1":{description:"AWS SES Europe (Stockholm)",host:"email-smtp.eu-north-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-1":{description:"AWS SES Europe (Ireland)",host:"email-smtp.eu-west-1.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-2":{description:"AWS SES Europe (London)",host:"email-smtp.eu-west-2.amazonaws.com",port:465,secure:!0},"SES-EU-WEST-3":{description:"AWS SES Europe (Paris)",host:"email-smtp.eu-west-3.amazonaws.com",port:465,secure:!0},"SES-SA-EAST-1":{description:"AWS SES South America (São Paulo)",host:"email-smtp.sa-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-1":{description:"AWS SES US East (N. Virginia)",host:"email-smtp.us-east-1.amazonaws.com",port:465,secure:!0},"SES-US-EAST-2":{description:"AWS SES US East (Ohio)",host:"email-smtp.us-east-2.amazonaws.com",port:465,secure:!0},"SES-US-GOV-EAST-1":{description:"AWS SES GovCloud (US-East)",host:"email-smtp.us-gov-east-1.amazonaws.com",port:465,secure:!0},"SES-US-GOV-WEST-1":{description:"AWS SES GovCloud (US-West)",host:"email-smtp.us-gov-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-1":{description:"AWS SES US West (N. California)",host:"email-smtp.us-west-1.amazonaws.com",port:465,secure:!0},"SES-US-WEST-2":{description:"AWS SES US West (Oregon)",host:"email-smtp.us-west-2.amazonaws.com",port:465,secure:!0},Seznam:{description:"Seznam Email (Czech email provider)",aliases:["Seznam Email"],domains:["seznam.cz","email.cz","post.cz","spoluzaci.cz"],host:"smtp.seznam.cz",port:465,secure:!0},SMTP2GO:{description:"SMTP2GO",host:"mail.smtp2go.com",port:2525},Sparkpost:{description:"SparkPost",aliases:["SparkPost","SparkPost Mail"],domains:["sparkpost.com"],host:"smtp.sparkpostmail.com",port:587,secure:!1},Tipimail:{description:"Tipimail (email delivery service)",host:"smtp.tipimail.com",port:587},TurboSMTP:{description:"TurboSMTP",host:"pro.turbo-smtp.com",port:465,secure:!0},"TurboSMTP-EU":{description:"TurboSMTP (EU region)",host:"pro.eu.turbo-smtp.com",port:465,secure:!0},Tutanota:{description:"Tutanota (Tuta Mail)",domains:["tutanota.com","tuta.com","tutanota.de","tuta.io"],host:"smtp.tutanota.com",port:465,secure:!0},Yahoo:{description:"Yahoo Mail",domains:["yahoo.com"],host:"smtp.mail.yahoo.com",port:465,secure:!0},Yandex:{description:"Yandex Mail",domains:["yandex.ru"],host:"smtp.yandex.ru",port:465,secure:!0},Zimbra:{description:"Zimbra Mail Server",aliases:["Zimbra Collaboration"],host:"smtp.zimbra.com",port:587,requireTLS:!0},Zoho:{description:"Zoho Mail",host:"smtp.zoho.com",port:465,secure:!0,authMethod:"LOGIN"}}),Rp),n={};function r(e){return e.replace(/[^a-zA-Z0-9.-]/g,"").toLowerCase()}Object.keys(i.services).forEach(e=>{const t=i.services[e],s=function(e){const t={};return Object.keys(e).forEach(i=>{["domains","aliases"].includes(i)||(t[i]=e[i])}),t}(t);n[r(e)]=s,[].concat(t.aliases||[]).forEach(e=>{n[r(e)]=s}),[].concat(t.domains||[]).forEach(e=>{n[r(e)]=s})}),e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(_p,_p.exports)),_p.exports}function Jp(){return Vp||(Vp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=o((Pp||(Pp=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(Op()),c=Ku(),l=o(Hp()),u=s(Yu()),d=p;class m extends d.EventEmitter{constructor(e){if(super(),this.pool=e,this.options=e.options,this.logger=this.pool.logger,this.options.auth)switch((this.options.auth.type||"").toString().toUpperCase()){case"OAUTH2":{const e=new l.default(this.options.auth,this.logger);e.provisionCallback=this.pool.mailer&&this.pool.mailer.get("oauth2_provision_cb")||e.provisionCallback,this.auth={type:"OAUTH2",user:this.options.auth.user,oauth2:e,method:"XOAUTH2"},e.on("token",e=>this.pool.mailer.emit("token",e)),e.on("error",e=>this._fail(e));break}default:if(!this.options.auth.user&&!this.options.auth.pass)break;this.auth={type:(this.options.auth.type||"").toString().toUpperCase()||"LOGIN",user:this.options.auth.user,credentials:{user:this.options.auth.user||"",pass:this.options.auth.pass,options:this.options.auth.options},method:(this.options.auth.method||"").trim().toUpperCase()||this.options.authMethod||!1}}this._connection=!1,this._connected=!1,this.messages=0,this.available=!0,this._failed=!1}_fail(e){this._failed||(this._failed=!0,this.emit("error",e))}connect(e){this.pool.getSocket(this.options,(t,i)=>{if(t)return this._fail(t),e(t);let n=!1,r=this.options;i&&i.connection&&(this.logger.info({tnx:"proxy",remoteAddress:i.connection.remoteAddress,remotePort:i.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",i.connection.remoteAddress,i.connection.remotePort,r.host||"",r.port||""),r=Object.assign((0,c.assign)(!1,r),i)),this.connection=new a.default(r),this.connection.on("error",t=>{if(this._fail(t),!n)return n=!0,e(t)}),this.connection.once("end",()=>{this.close(),n=!0}),this.connection.connect(t=>{if(!n){if(!t)return this.auth&&(this.connection.allowsAuth||r.forceAuth)?void this.connection.login(this.auth,t=>{if(!n){if(n=!0,t)return this.connection.close(),this._fail(t),e(t);this._connected=!0,e(null,!0)}}):(n=!0,this._connected=!0,e(null,!0));n=!0}})})}send(e,t){if(!this._connected)return this.connect(i=>i?t(i):this.send(e,t));const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n,cid:this.id},"Sending message %s using #%s to <%s>",n,this.id,r.join(", ")),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.connection.send(i,e.message.createReadStream(),(e,r)=>{if(this.messages++,e)return this.connection.close(),this._fail(e),t(e);r.envelope={from:i.from,to:i.to},r.messageId=n,setImmediate(()=>{if(this.messages>=this.options.maxMessages){const e=new Error("Resource exhausted");e.code=u.EMAXLIMIT,this.connection.close(),this._fail(e)}else this.pool._checkRateLimit(()=>{this.available=!0,this.emit("available")})}),t(null,r)})}close(){this._connected=!1,this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.connection&&this.connection.close(),this.emit("close")}}t.default=m,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Xp,Xp.exports)),Xp.exports)),l=o(Op()),u=o(Qp()),d=s(Ku()),m=s(Yu()),h=s(ju());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=d.parseConnectionUrl(e.url),i=i||t.service),this.options=d.assign(!1,e,t,i&&(0,u.default)(i)),this.options.maxConnections=this.options.maxConnections||5,this.options.maxMessages=this.options.maxMessages||100,this.options.maxRequeues="number"==typeof this.options.maxRequeues?this.options.maxRequeues:5,this.logger=d.getLogger(this.options,{component:this.options.component||"smtp-pool"}),this.name="SMTP (pool)",this.version=h.version+"[client:"+h.version+"]",this._rateLimit={counter:0,timeout:null,waiting:[],checkpoint:!1,delta:Number(this.options.rateDelta)||1e3,limit:Number(this.options.rateLimit)||0},this._closed=!1,this._queue=[],this._connections=[],this._connectionCounter=0,this.idling=!0,setImmediate(()=>{this.idling&&this.emit("idle")})}getSocket(e,t){setImmediate(()=>t(null,!1))}send(e,t){if(this._closed){const e=new Error("Connection pool was closed");return e.code=m.ECONNECTION,setImmediate(()=>t(e)),!1}return this._queue.push({mail:e,requeueAttempts:0,callback:t}),this.idling&&this._queue.length>=this.options.maxConnections&&(this.idling=!1),setImmediate(()=>this._processMessages()),!0}close(){let e;const t=this._connections.length;if(this._closed=!0,this._clearRateLimit(),!t&&!this._queue.length)return;for(let i=t-1;i>=0;i--)this._connections[i]&&this._connections[i].available&&(e=this._connections[i],e.close(),this.logger.info({tnx:"connection",cid:e.id,action:"removed"},"Connection #%s removed",e.id));if(t&&!this._connections.length&&this.logger.debug({tnx:"connection"},"All connections removed"),!this._queue.length)return;const i=()=>{if(!this._queue.length)return void this.logger.debug({tnx:"connection"},"Pending queue entries cleared");const e=this._queue.shift();if(e&&"function"==typeof e.callback)try{e.callback(new Error("Connection pool was closed"))}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error: %s",e.message)}setImmediate(i)};setImmediate(i)}_processMessages(){if(this._closed)return;if(!this._queue.length)return void(this.idling||(this.idling=!0,this.emit("idle")));let e=this._connections.find(e=>e.available);if(!e&&this._connections.length<this.options.maxConnections&&(e=this._createConnection()),!e)return void(this.idling=!1);!this.idling&&this._queue.length<this.options.maxConnections&&(this.idling=!0,this.emit("idle"));const t=e.queueEntry=this._queue.shift();t.messageId=(e.queueEntry.mail.message.getHeader("message-id")||"").replace(/[<>\s]/g,""),e.available=!1,this.logger.debug({tnx:"pool",cid:e.id,messageId:t.messageId,action:"assign"},"Assigned message <%s> to #%s (%s)",t.messageId,e.id,e.messages+1),this._rateLimit.limit&&(this._rateLimit.counter++,this._rateLimit.checkpoint||(this._rateLimit.checkpoint=Date.now())),e.send(t.mail,(i,n)=>{if(t===e.queueEntry){try{t.callback(i,n)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}})}_createConnection(){const e=new c.default(this);return e.id=++this._connectionCounter,this.logger.info({tnx:"pool",cid:e.id,action:"conection"},"Created new pool resource #%s",e.id),e.on("available",()=>{this.logger.debug({tnx:"connection",cid:e.id,action:"available"},"Connection #%s became available",e.id),this._closed?this.close():this._processMessages()}),e.once("error",t=>{if(t.code!==m.EMAXLIMIT?this.logger.warn({err:t,tnx:"pool",cid:e.id},"Pool Error for #%s: %s",e.id,t.message):this.logger.debug({tnx:"pool",cid:e.id,action:"maxlimit"},"Max messages limit exchausted for #%s",e.id),e.queueEntry){try{e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}this._removeConnection(e),this._continueProcessing()}),e.once("close",()=>{this.logger.info({tnx:"connection",cid:e.id,action:"closed"},"Connection #%s was closed",e.id),this._removeConnection(e),e.queueEntry?setTimeout(()=>{let t=0;e.queueEntry&&(this._shouldRequeuOnConnectionClose(e.queueEntry)?t=this._requeueEntryOnConnectionClose(e):this._failDeliveryOnConnectionClose(e)),t?setTimeout(()=>this._continueProcessing(),t):this._continueProcessing()},50):(this._closed||!this.idling||this._connections.length||this.emit("clear"),this._continueProcessing())}),this._connections.push(e),e}_shouldRequeuOnConnectionClose(e){return this.options.maxRequeues<0||e.requeueAttempts<this.options.maxRequeues}_failDeliveryOnConnectionClose(e){if(e.queueEntry&&e.queueEntry.callback){try{const t=new Error("Reached maximum number of retries after connection was closed");t.code=m.ECONNECTION,e.queueEntry.callback(t)}catch(t){this.logger.error({err:t,tnx:"callback",messageId:e.queueEntry.messageId,cid:e.id},"Callback error for #%s: %s",e.id,t.message)}e.queueEntry=!1}}_requeueEntryOnConnectionClose(e){const t=Math.min(50*2**e.queueEntry.requeueAttempts,2e3);return e.queueEntry.requeueAttempts+=1,this.logger.debug({tnx:"pool",cid:e.id,messageId:e.queueEntry.messageId,action:"requeue"},"Re-queued message <%s> for #%s. Attempt: #%s",e.queueEntry.messageId,e.id,e.queueEntry.requeueAttempts),this._queue.unshift(e.queueEntry),e.queueEntry=!1,t}_continueProcessing(){this._closed?this.close():setTimeout(()=>this._processMessages(),100)}_removeConnection(e){const t=this._connections.indexOf(e);-1!==t&&this._connections.splice(t,1)}_checkRateLimit(e){if(!this._rateLimit.limit)return e();const t=Date.now();return this._rateLimit.counter<this._rateLimit.limit?e():(this._rateLimit.waiting.push(e),this._rateLimit.checkpoint<=t-this._rateLimit.delta?this._clearRateLimit():void(this._rateLimit.timeout||(this._rateLimit.timeout=setTimeout(()=>this._clearRateLimit(),this._rateLimit.delta-(t-this._rateLimit.checkpoint)),this._rateLimit.checkpoint=t)))}_clearRateLimit(){for(clearTimeout(this._rateLimit.timeout),this._rateLimit.timeout=null,this._rateLimit.counter=0,this._rateLimit.checkpoint=!1;this._rateLimit.waiting.length;){const e=this._rateLimit.waiting.shift();setImmediate(e)}}isIdle(){return this.idling}verify(e){let t;e||(t=new Promise((t,i)=>{e=d.callbackPromise(t,i)}));const i=e,n=new c.default(this).auth;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let r=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:r.host||"",destPort:r.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,r.host||"",r.port||""),r=Object.assign(d.assign(!1,r),t));const s=new l.default(r);let o=!1;s.once("error",e=>{if(!o)return o=!0,s.close(),i(e)}),s.once("end",()=>{if(!o)return o=!0,i(new Error("Connection closed"))});const a=()=>{if(!o)return o=!0,s.quit(),i(null,!0)};s.connect(e=>{if(!o){if(e)return o=!0,s.close(),i(e);if(n&&(s.allowsAuth||r.forceAuth))s.login(n,e=>{if(!o)return e?(o=!0,s.close(),i(e)):void a()});else{if(!n&&s.allowsAuth&&r.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,s.close(),i(e)}a()}}})}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(Yp,Yp.exports)),Yp.exports}var $p,qp={exports:{}};var ed,td={exports:{}};var id,nd={exports:{}};var rd,sd={exports:{}};var od,ad,cd={exports:{}};function ld(){return od||(od=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=o(p),c=s(ju()),l=s(Ku()),u=s(Yu()),d=o(pp()),m=o(wp());function h(e){return e&&"object"==typeof e&&!e.code&&(e.code=u.ESES),e}class f extends a.default{constructor(e){if(super(),!e||!e.SES||!e.SES.sesClient){const e=new Error("Missing SES configuration, expecting { sesClient, SendEmailCommand } from @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=u.ECONFIG,e}this.options=e,this.ses=this.options.SES,this.name="SESTransport",this.version=c.version,this.logger=l.getLogger(this.options,{component:this.options.component||"ses-transport"})}getRegion(e){if(!this.ses.sesClient.config||"function"!=typeof this.ses.sesClient.config.region)return e(null,!1);this.ses.sesClient.config.region().then(t=>e(null,t),t=>e(t))}send(e,t){let i=e.message._headers.find(e=>/^from$/i.test(e.key));if(i){const e=new m.default("text/plain");i=e._convertAddresses(e._parseAddresses(i.value))}const n=e.message.getEnvelope(),r=e.message.messageId(),s=[].concat(n.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:r},"Sending message %s to <%s>",r,s.join(", "));setImmediate(()=>(t=>{e.data._dkim||(e.data._dkim={}),e.data._dkim.skipFields&&"string"==typeof e.data._dkim.skipFields?e.data._dkim.skipFields+=":date:message-id":e.data._dkim.skipFields="date:message-id";const i=e.message.createReadStream(),n=i.pipe(new d.default),r=[];let s=0;n.on("readable",()=>{let e;for(;null!==(e=n.read());)r.push(e),s+=e.length}),i.once("error",e=>n.emit("error",e)),n.once("error",e=>t(e)),n.once("end",()=>t(null,Buffer.concat(r,s)))})((s,o)=>{if(s)return this.logger.error({err:s,tnx:"send",messageId:r},"Failed creating message for %s. %s",r,s.message),t(s);const a=l.copyOwnKeys({Content:{Raw:{Data:o}},FromEmailAddress:i||n.from,Destination:{ToAddresses:n.to}},e.data.ses);this.getRegion((e,i)=>{let s;!e&&i||(i="us-east-1");try{const e=new this.ses.SendEmailCommand(a);s=this.ses.sesClient.send(e)}catch(e){return h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",r,e.message),void setImmediate(()=>t(e))}s.then(e=>{"us-east-1"===i&&(i="email");const r={envelope:{from:n.from,to:n.to},messageId:"<"+e.MessageId+(/@/.test(e.MessageId)?"":"@"+i+".amazonses.com")+">",response:e.MessageId,raw:o};setImmediate(()=>t(null,r))}).catch(e=>{h(e),this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",r,e.message),setImmediate(()=>t(e))})})}))}verify(e){let t;e||(t=new Promise((t,i)=>{e=l.callbackPromise(t,i)}));const i=e,n=e=>e&&!["InvalidParameterValue","MessageRejected"].includes(e.code||e.Code||e.name)?i(h(e)):i(null,!0),r={Content:{Raw:{Data:Buffer.from("From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid")}},FromEmailAddress:"invalid@invalid",Destination:{ToAddresses:["invalid@invalid"]}};return this.getRegion(()=>{let e;try{const t=new this.ses.SendEmailCommand(r);e=this.ses.sesClient.send(t)}catch(e){return void setImmediate(()=>n(e))}e.then(()=>setImmediate(()=>n(null))).catch(e=>setImmediate(()=>n(e)))}),t}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(cd,cd.exports)),cd.exports}function ud(){return ad||(ad=1,function(e){var t,i=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),n=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=jn&&jn.__importStar||(t=function(e){return t=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},t(e)},function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var s=t(e),o=0;o<s.length;o++)"default"!==s[o]&&i(r,e,s[o]);return n(r,e),r}),s=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.createTransport=b,e.createTestAccount=C,e.getTestMessageUrl=L;const o=s(jp()),a=r(Ku()),c=s(Jp()),l=s(($p||($p=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=p,c=o(Op()),l=o(Qp()),u=s(Ku()),d=o(Hp()),m=s(Yu()),h=s(ju());class f extends a.EventEmitter{constructor(e){let t;super(),"string"==typeof(e=e||{})&&(e={url:e});let i=e.service;"function"==typeof e.getSocket&&(this.getSocket=e.getSocket),e.url&&(t=u.parseConnectionUrl(e.url),i=i||t.service),this.options=u.assign(!1,e,t,i&&(0,l.default)(i)),this.logger=u.getLogger(this.options,{component:this.options.component||"smtp-transport"}),this.name="SMTP",this.version=h.version+"[client:"+h.version+"]",this.options.auth&&(this.auth=this.getAuth({}))}getSocket(e,t){setImmediate(()=>t(null,!1))}getAuth(e){if(!e)return this.auth&&this.auth.oauth2&&this.mailer&&(this.auth.oauth2.provisionCallback=this.mailer.get("oauth2_provision_cb")||this.auth.oauth2.provisionCallback),this.auth;const t=Object.assign({},this.options.auth&&"object"==typeof this.options.auth?this.options.auth:{},"object"==typeof e?e:{});if(0===Object.keys(t).length)return!1;if("OAUTH2"===(t.type||"").toString().toUpperCase()){if(!t.service&&!t.user)return!1;const e=new d.default(t,this.logger);return e.provisionCallback=this.mailer&&this.mailer.get("oauth2_provision_cb")||e.provisionCallback,e.on("token",e=>this.mailer.emit("token",e)),e.on("error",e=>this.emit("error",e)),{type:"OAUTH2",user:t.user,oauth2:e,method:"XOAUTH2"}}return{type:(t.type||"").toString().toUpperCase()||"LOGIN",user:t.user,credentials:{user:t.user||"",pass:t.pass,options:t.options},method:(t.method||"").trim().toUpperCase()||this.options.authMethod||!1}}send(e,t){this.getSocket(this.options,(i,n)=>{if(i)return t(i);let r=!1,s=this.options;n&&n.connection&&(this.logger.info({tnx:"proxy",remoteAddress:n.connection.remoteAddress,remotePort:n.connection.remotePort,destHost:s.host||"",destPort:s.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",n.connection.remoteAddress,n.connection.remotePort,s.host||"",s.port||""),s=Object.assign(u.assign(!1,s),n));const o=new c.default(s);let a;const l=()=>{a&&a!==this.auth&&a.oauth2&&a.oauth2.removeAllListeners(),a=null};o.once("error",e=>{if(!r)return r=!0,l(),o.close(),t(e)});const p=()=>{const i=e.message.getEnvelope(),n=e.message.messageId(),s=[].concat(i.to||[]);s.length>3&&s.push("...and "+s.splice(2).length+" more"),e.data.dsn&&(i.dsn=e.data.dsn),e.data.requireTLSExtensionEnabled&&(i.requireTLSExtensionEnabled=e.data.requireTLSExtensionEnabled),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,s.join(", ")),o.send(i,e.message.createReadStream(),(e,s)=>{if(!r){if(r=!0,l(),o.close(),e)return this.logger.error({err:e,tnx:"send"},"Send error for %s: %s",n,e.message),t(e);s.envelope={from:i.from,to:i.to},s.messageId=n;try{return t(null,s)}catch(e){this.logger.error({err:e,tnx:"callback"},"Callback error for %s: %s",n,e.message)}}})};o.connect(i=>{if(!r){if(i)return r=!0,o.close(),t(i);a=this.getAuth(e.data.auth),a&&(o.allowsAuth||s.forceAuth)?o.login(a,e=>{if(l(),!r)return e?(r=!0,o.close(),t(e)):void p()}):p()}})})}verify(e){let t;e||(t=new Promise((t,i)=>{e=u.callbackPromise(t,i)}));const i=e;return this.getSocket(this.options,(e,t)=>{if(e)return i(e);let n=this.options;t&&t.connection&&(this.logger.info({tnx:"proxy",remoteAddress:t.connection.remoteAddress,remotePort:t.connection.remotePort,destHost:n.host||"",destPort:n.port||"",action:"connected"},"Using proxied socket from %s:%s to %s:%s",t.connection.remoteAddress,t.connection.remotePort,n.host||"",n.port||""),n=Object.assign(u.assign(!1,n),t));const r=new c.default(n);let s,o=!1;const a=()=>{s&&s!==this.auth&&s.oauth2&&s.oauth2.removeAllListeners(),s=null};r.once("error",e=>{if(!o)return o=!0,a(),r.close(),i(e)}),r.once("end",()=>{if(!o)return o=!0,a(),i(new Error("Connection closed"))});const l=()=>{if(!o)return o=!0,a(),r.quit(),i(null,!0)};r.connect(e=>{if(!o){if(e)return o=!0,r.close(),i(e);if(s=this.getAuth({}),s&&(r.allowsAuth||n.forceAuth))r.login(s,e=>{if(a(),!o)return e?(o=!0,r.close(),i(e)):void l()});else{if(!s&&r.allowsAuth&&n.forceAuth){const e=new Error("Authentication info was not provided");return e.code=m.ENOAUTH,o=!0,a(),r.close(),i(e)}l()}}})}),t}close(){this.auth&&this.auth.oauth2&&this.auth.oauth2.removeAllListeners(),this.emit("close")}}t.default=f,e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(qp,qp.exports)),qp.exports)),u=s((ed||(ed=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=v,c=s(ju()),l=s(Ku()),u=s(Yu()),p=o(pp()),d=o(gp());t.default=class{constructor(e){e=e||{},this._spawn=a.spawn,this.options=e,this.name="Sendmail",this.version=c.version,this.path="sendmail",this.args=!1,this.logger=l.getLogger(this.options,{component:this.options.component||"sendmail"}),"string"==typeof e?this.path=e:"object"==typeof e&&(e.path&&(this.path=e.path),Array.isArray(e.args)&&(this.args=e.args)),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId();let r;if([].concat(i.from||[]).concat(i.to||[]).some(e=>/^"?-/.test(e))){const e=new Error("Can not send mail. Invalid envelope addresses.");return e.code=u.ESENDMAIL,t(e)}const s=this.args?["-i"].concat(this.args).concat(i.to):["-i"].concat(i.from?["-f",i.from]:[]).concat(i.to),o=e=>{if(!r)return r=!0,"function"==typeof t?e?t(e):t(null,{envelope:i,messageId:n,response:"Messages queued for delivery"}):void 0};let a;try{a=this._spawn(this.path,s)}catch(e){return this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred while spawning sendmail. %s",e.message),o(e)}if(!a){const e=new Error("sendmail was not found");return e.code=u.ESENDMAIL,o(e)}{a.on("error",e=>{this.logger.error({err:e,tnx:"spawn",messageId:n},"Error occurred when sending message %s. %s",n,e.message),o(e)}),a.once("exit",e=>{if(!e)return o();const t=new Error(127===e?"Sendmail command not found, process exited with code "+e:"Sendmail exited with code "+e);t.code=u.ESENDMAIL,this.logger.error({err:t,tnx:"stdin",messageId:n},"Error sending message %s to sendmail. %s",n,t.message),o(t)}),a.once("close",o),a.stdin.on("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when piping message %s to sendmail. %s",n,e.message),o(e)});const t=[].concat(i.to||[]);t.length>3&&t.push("...and "+t.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s>",n,t.join(", "));const r=e.message.createReadStream();let s=r;this.options.newline&&(s=r.pipe(this.winbreak?new p.default:new d.default),r.once("error",e=>s.emit("error",e))),s.once("error",e=>{this.logger.error({err:e,tnx:"stdin",messageId:n},"Error occurred when generating message %s. %s",n,e.message),a.kill("SIGINT"),o(e)}),s.pipe(a.stdin)}}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(td,td.exports)),td.exports)),d=s((id||(id=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t}),o=jn&&jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=s(ju()),c=s(Ku()),l=o(pp()),u=o(gp());t.default=class{constructor(e){e=e||{},this.options=e,this.name="StreamTransport",this.version=a.version,this.logger=c.getLogger(this.options,{component:this.options.component||"stream-transport"}),this.winbreak=["win","windows","dos","\r\n"].includes((e.newline||"").toString().toLowerCase())}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Sending message %s to <%s> using %s line breaks",n,r.join(", "),this.winbreak?"<CR><LF>":"<LF>"),setImmediate(()=>{let r;try{if(r=e.message.createReadStream(),this.options.newline){const e=r;r=e.pipe(this.winbreak?new l.default:new u.default),e.once("error",e=>r.emit("error",e))}}catch(e){return this.logger.error({err:e,tnx:"send",messageId:n},"Creating send stream failed for %s. %s",n,e.message),t(e)}if(!this.options.buffer)return r.once("error",e=>{this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message)}),t(null,{envelope:i,messageId:n,message:r});const s=[];let o=0;r.on("readable",()=>{let e;for(;null!==(e=r.read());)s.push(e),o+=e.length}),r.once("error",e=>(this.logger.error({err:e,tnx:"send",messageId:n},"Failed creating message for %s. %s",n,e.message),t(e))),r.on("end",()=>t(null,{envelope:i,messageId:n,message:Buffer.concat(s,o)}))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(nd,nd.exports)),nd.exports)),m=s((rd||(rd=1,function(e,t){var i,n=jn&&jn.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=jn&&jn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=jn&&jn.__importStar||(i=function(e){return i=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},i(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s=i(e),o=0;o<s.length;o++)"default"!==s[o]&&n(t,e,s[o]);return r(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const o=s(ju()),a=s(Ku());t.default=class{constructor(e){e=e||{},this.options=e,this.name="JSONTransport",this.version=o.version,this.logger=a.getLogger(this.options,{component:this.options.component||"json-transport"})}send(e,t){e.message.keepBcc=!0;const i=e.message.getEnvelope(),n=e.message.messageId(),r=[].concat(i.to||[]);r.length>3&&r.push("...and "+r.splice(2).length+" more"),this.logger.info({tnx:"send",messageId:n},"Composing JSON structure of %s to <%s>",n,r.join(", ")),setImmediate(()=>{e.normalize((e,r)=>e?(this.logger.error({err:e,tnx:"send",messageId:n},"Failed building JSON structure for %s. %s",n,e.message),t(e)):(delete r.envelope,delete r.normalizedHeaders,t(null,{envelope:i,messageId:n,message:this.options.skipEncoding?r:JSON.stringify(r)})))})}},e.exports=t.default,Object.defineProperty(e.exports,"default",{value:t.default,enumerable:!1,writable:!0,configurable:!0})}(sd,sd.exports)),sd.exports)),h=s(ld()),f=r(Yu()),g=s(Pu()),w=r(ju()),y=(process.env.ETHEREAL_API||"https://api.nodemailer.com").replace(/\/+$/,""),M=(process.env.ETHEREAL_WEB||"https://ethereal.email").replace(/\/+$/,""),D=(process.env.ETHEREAL_API_KEY||"").replace(/\s*/g,"")||null,x=["true","yes","y","1"].includes((process.env.ETHEREAL_CACHE||"yes").toString().trim().toLowerCase());let I=!1;function b(e,t){let i;if("object"==typeof e&&"function"!=typeof e.send||"string"==typeof e&&/^(smtps?|direct):/i.test(e)){const t="string"==typeof e?e:e.url;if(t){const n=a.parseConnectionUrl(t);i="object"==typeof e?a.assign(!1,a.copyOwnKeys({},e,e=>"url"===e),n):n}else i=e;if(i.pool)e=new c.default(i);else if(i.sendmail)e=new u.default(i);else if(i.streamTransport)e=new d.default(i);else if(i.jsonTransport)e=new m.default(i);else if(i.SES){const t=i.SES;if(t.ses&&t.aws){const e=new Error("Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/");throw e.code=f.ECONFIG,e}e=new h.default(i)}else e=new l.default(i)}return new o.default(e,i,t)}function C(e,t){let i;t||"function"!=typeof e||(t=e,e=!1),t||(i=new Promise((e,i)=>{t=a.callbackPromise(e,i)}));const n=t;if(x&&I)return setImmediate(()=>n(null,I)),i;e=e||y;const r=[];let s=0;const o={},c={requestor:w.name,version:w.version};D&&(o.Authorization="Bearer "+D);const l={contentType:"application/json",method:"POST",headers:o,body:Buffer.from(JSON.stringify(c))};/^https:/i.test(e)&&(l.tls={rejectUnauthorized:!0});const u=(0,g.default)(e+"/user",l);return u.on("readable",()=>{let e;for(;null!==(e=u.read());)r.push(e),s+=e.length}),u.once("error",e=>n(e)),u.once("end",()=>{const e=Buffer.concat(r,s);let t;try{t=JSON.parse(e.toString())}catch(e){return n(e)}if("success"!==t.status||t.error)return n(new Error(t.error||"Request failed"));delete t.status,I=t,n(null,I)}),i}function L(e){if(!e||!e.response)return!1;const t=new Map,i=e.response.toString();if(i.length>2&&"]"===i.charAt(i.length-1)){const e=i.indexOf("[",i.lastIndexOf("]",i.length-2)+1);if(e>=0&&e<i.length-2){i.substring(e+1,i.length-1).replace(/\b([A-Z0-9]+)=([^\s]+)/g,(e,i,n)=>(t.set(i,n),e))}}return!(!t.has("STATUS")||!t.has("MSGID"))&&(I&&I.web||M)+"/message/"+t.get("MSGID")}const E={createTransport:b,createTestAccount:C,getTestMessageUrl:L};e.default=E,Object.defineProperty(e,"default",{value:e,enumerable:!1,writable:!0,configurable:!0})}(xu)),xu}
|
|
7
7
|
/*!
|
|
8
8
|
* w-email v1.1.8
|
|
9
9
|
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
10
10
|
* Released under the MIT License.
|
|
11
|
-
*/!function(e){e.exports=function(e){var t=Array.isArray,i="object"==typeof jn&&jn&&jn.Object===Object&&jn,n="object"==typeof self&&self&&self.Object===Object&&self,r=i||n||Function("return this")(),s=r.Symbol,o=Object.prototype,a=o.hasOwnProperty,c=o.toString,l=s?s.toStringTag:void 0,u=Object.prototype.toString,p=s?s.toStringTag:void 0;function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":p&&p in Object(e)?function(e){var t=a.call(e,l),i=e[l];try{e[l]=void 0;var n=!0}catch(e){}var r=c.call(e);return n&&(t?e[l]=i:delete e[l]),r}(e):function(e){return u.call(e)}(e)}function m(e){return null!=e&&"object"==typeof e}function h(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==d(e)}var f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var y,M=r["__core-js_shared__"],D=(y=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",x=Function.prototype.toString,I=/^\[object .+?Constructor\]$/,C=Function.prototype,b=Object.prototype,v=C.toString,L=b.hasOwnProperty,E=RegExp("^"+v.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function A(e){if(!w(e)||D&&D in e)return!1;var t=function(e){if(!w(e))return!1;var t=d(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?E:I;return t.test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function N(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return A(i)?i:void 0}var S=N(Object,"create"),T=Object.prototype.hasOwnProperty,k=Object.prototype.hasOwnProperty;function j(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Z(e,t){return e===t||e!=e&&t!=t}function z(e,t){for(var i=e.length;i--;)if(Z(e[i][0],t))return i;return-1}j.prototype.clear=function(){this.__data__=S?S(null):{},this.size=0},j.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},j.prototype.get=function(e){var t=this.__data__;if(S){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return T.call(t,e)?t[e]:void 0},j.prototype.has=function(e){var t=this.__data__;return S?void 0!==t[e]:k.call(t,e)},j.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=S&&void 0===t?"__lodash_hash_undefined__":t,this};var Y=Array.prototype.splice;function X(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,i=z(t,e);return!(i<0||(i==t.length-1?t.pop():Y.call(t,i,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,i=z(t,e);return i<0?void 0:t[i][1]},X.prototype.has=function(e){return z(this.__data__,e)>-1},X.prototype.set=function(e,t){var i=this.__data__,n=z(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var G=N(r,"Map");function F(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function W(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function O(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(O.Cache||W),i}W.prototype.clear=function(){this.size=0,this.__data__={hash:new j,map:new(G||X),string:new j}},W.prototype.delete=function(e){var t=F(this,e).delete(e);return this.size-=t?1:0,t},W.prototype.get=function(e){return F(this,e).get(e)},W.prototype.has=function(e){return F(this,e).has(e)},W.prototype.set=function(e,t){var i=F(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},O.Cache=W;var P,K,H,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/\\(\\)?/g,V=(P=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(U,function(e,i,n,r){t.push(n?r.replace(B,"$1"):i||e)}),t},K=O(P,function(e){return 500===H.size&&H.clear(),e}),H=K.cache,K),_=V,R=s?s.prototype:void 0,Q=R?R.toString:void 0;function J(e){if("string"==typeof e)return e;if(t(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,J)+"";if(h(e))return Q?Q.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}function q(e){return null==e?"":J(e)}function $(e,i){return t(e)?e:function(e,i){if(t(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!h(e))||g.test(e)||!f.test(e)||null!=i&&e in Object(i)}(e,i)?[e]:_(q(e))}function ee(e){if("string"==typeof e||h(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function te(e,t,i){var n=null==e?void 0:function(e,t){for(var i=0,n=(t=$(t,e)).length;null!=e&&i<n;)e=e[ee(t[i++])];return i&&i==n?e:void 0}(e,t);return void 0===n?i:n}function ie(e){return"[object String]"===Object.prototype.toString.call(e)}function ne(e){return"[object Array]"===Object.prototype.toString.call(e)}function re(e){return"[object Object]"===Object.prototype.toString.call(e)}var se=/\s/,oe=/^\s+/;function ae(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}(e)+1).replace(oe,""):e}var ce=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ue=/^0o[0-7]+$/i,pe=parseInt;function de(e){if("number"==typeof e)return e;if(h(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ae(e);var i=le.test(e);return i||ue.test(e)?pe(e.slice(2),i?2:8):ce.test(e)?NaN:+e}var me=1/0;function he(e){return e?(e=de(e))===me||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fe(e){var t=he(e),i=t%1;return t==t?i?t-i:t:0}function ge(e){return!0===(t=e)||!1===t||m(t)&&"[object Boolean]"==d(t);var t}function we(e){return!!(ie(e)&&e.length>0)}function ye(e){let t=!1;if(we(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(function(e){if(e!=e)return!0;if(null!==e&&"object"==typeof e)try{let t=Number.prototype.valueOf.call(e);return Number.isNaN(t)}catch(e){return!1}return!1}(e))return!1;t=!0}return t}function Me(e){return ye(e)?he(e):0}function De(e,t={}){let i=te(t,"useLimitSafe",null);return ge(i)||(i=!1),!!ye(e)&&(e=Me(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==fe(n));var n}var xe=r.isFinite,Ie=Math.min,Ce=function(){var e=Math.round;return function(t,i){if(t=de(t),(i=null==i?0:Ie(fe(i),292))&&xe(t)){var n=(q(t)+"e").split("e");return+((n=(q(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}(),be=Ce;function ve(e,t={}){let i=te(t,"useClampSafe",null);ge(i)||(i=!1);let n=te(t,"useLimitSafe",null);ge(n)||(n=!1);let r=te(t,"returnWithStateAndMsg",null);ge(r)||(r=!1);let s=e=>r?{state:"success",msg:e}:e,o=e=>{if(r)return{state:"error",msg:e};throw new Error(e)};if(!ye(e))return s(0);let a=null;try{e=Me(e),a=be(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),s(a))}let Le=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function Ee(e,t,i){let n=te(e,t);return null==n?i:n}function Ae(e){return ie(e)?e:"number"==typeof e&&Number.isFinite(e)?String(e):null}function Ne(e){return!e||ie(e)&&""===e.trim()}function Se(e){if(!ie(e))return null;let t=e.trim(),i=t.lastIndexOf("@");if(i<0)return null;let n=t.slice(0,i),r=t.slice(i+1);if(s=r,[...s].some(e=>e.charCodeAt(0)>127)){if(function(e){return[...e].some(e=>{let t=e.charCodeAt(0);return t<=32||127===t||"/\\?#%:@[]".includes(e)})}(r))return null;try{r=new URL(`http://${r}`).hostname}catch(e){return null}}var s;return t=`${n}@${r}`,function(e){return!!we(e)&&!(e.length>254)&&!(e.indexOf("@")>64)&&Le.test(e)}(t)?t:null}function Te(e,t){let i=te(e,t);if(!i)return{emails:[]};let n=ne(i);if(ie(i)&&(i=[i]),!ne(i))return{err:`${t} is not string or array`};let r=[];for(let e=0;e<i.length;e++){if(Ne(i[e]))continue;let s=Se(i[e]);if(null===s)return{err:n?`${t}[${e}] is not email`:`${t} is not email`};r.push(s)}return{emails:r}}function ke(e){if(!re(e))return!1;let t=e.filename;if(null!=t&&!1!==t&&!ie(t))return!1;if(e.raw)return!0;if(ie(e.path)&&""!==e.path)return!0;if(ie(e.href)&&""!==e.href)return!0;let i=e.content;return ie(i)||Buffer.isBuffer(i)||!!i&&"function"==typeof i.pipe}return function(t={}){let i=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}(),n=e=>(i.reject(e),i);try{let r=Se(te(t,"srcEmail"));if(null===r)return n("srcEmail is not email");let s=Ae(Ee(t,"srcName","system by w-email"));if(null===s)return n("srcName is not string");s=s.replace(/[\r\n]+/g," ").trim();let o=Ae(Ee(t,"srcPW",""));if(null===o)return n("srcPW is not string");let a=Ee(t,"srcHost","smtp.gmail.com");if(!ie(a)||""===a.trim())return n("srcHost is not effective string");a=a.trim();let c=Ee(t,"srcPort",587);if(!function(e,t={}){return!!De(e,t)&&ve(e)>0}(c)||ve(c)>65535)return n("srcPort is not valid port");c=ve(c);let l=Ae(Ee(t,"emTitle",""));if(null===l)return n("emTitle is not string");let u=Ee(t,"emContent","");if(!Buffer.isBuffer(u)&&(u=Ae(u),null===u))return n("emContent is not string");let p=function(e){let t=te(e,"emAttachments");if(!t)return{atts:[]};let i=ne(t);if(re(t)&&(t=[t]),!ne(t))return{err:"emAttachments is not object or array"};let n=[];for(let e=0;e<t.length;e++)if(!Ne(t[e])){if(!ke(t[e]))return{err:i?`emAttachments[${e}] is not valid attachment`:"emAttachments is not valid attachment"};n.push(t[e])}return{atts:n}}(t);if(p.err)return n(p.err);let d=Te(t,"toEmails");if(d.err)return n(d.err);let m=Te(t,"toEmailsCC");if(m.err)return n(m.err);let h=Te(t,"toEmailsBCC");if(h.err)return n(h.err);if(d.emails.length+m.emails.length+h.emails.length===0)return n("no recipients");let f=e.createTransport({host:a,port:c,auth:{user:r,pass:o},secure:465===c}),g={from:{name:s,address:r},to:d.emails,cc:m.emails,bcc:h.emails,subject:l,html:u,attachments:p.atts};f.sendMail(g,function(e,t){e?i.reject(e):i.resolve(t.response)})}catch(e){i.reject(e)}return i}}(jp())}(Kl);var Zp=Zn(Kl.exports);function zp(e,t){var i=[];return Rt(e,function(e,n,r){t(e,n,r)&&i.push(e)}),i}function Yp(e,t){return(S(e)?li:zp)(e,Ni(t))}function Xp(e,t){return xi(e,t)}let Gp=["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"];function Fp(e,t={}){let i=[],n=ke(t,"useKeyForError",null);Bi(n)||(n=!1);let r=ke(t,"useOnlyOneError",null);if(Bi(r)||(r=!1),ji(e)||(n?i.push("keyInvalidPassword"):i.push("密碼非有效字串")),Dt(i)>0)throw new Error(i[0]);let s=ke(t,"numLenMin","");(!Qi(s)||tn(s)<0)&&(s=8),s=tn(s);let o=ke(t,"numLenMax","");if((!Qi(o)||tn(o)<0)&&(o=30),o=tn(o),s>o&&(n?i.push("keyLimNumLenMinOrMax"):i.push("設定密碼最小長度大於最大長度")),Dt(i)>0)throw new Error(i[0]);let a=ke(t,"noSpace",null);if(Bi(a)||(a=!0),a&&(Zi(c=e)&&null!==c.match(/^.*\s+.*$/)&&(n?i.push("keyLimHasSpace"):i.push("密碼不可包含空白字元")),r&&Dt(i)>0))throw new Error(i[0]);var c;let l=ke(t,"onlyAscii",null);if(Bi(l)||(l=!0),l&&(/[^\x20-\x7e]/.test(e)&&(n?i.push("keyLimNonAsciiChar"):i.push("密碼僅允許使用英文大小寫、數字及特殊符號")),r&&Dt(i)>0))throw new Error(i[0]);if(Dt(e)<s&&(n?i.push("keyLimNumLenMin"):i.push(`密碼長度須大於等於${s}個字元`)),r&&Dt(i)>0)throw new Error(i[0]);if(Dt(e)>o&&(n?i.push("keyLimNumLenMax"):i.push(`密碼長度須小於等於${o}個字元`)),r&&Dt(i)>0)throw new Error(i[0]);let u=ke(t,"requireLetter",null);Bi(u)||(u=!1);let p=ke(t,"requireUppercase",null);Bi(p)||(p=!0);let d=ke(t,"requireLowercase",null);Bi(d)||(d=!0);let m=ke(t,"requireDigit",null);Bi(m)||(m=!0);let h=ke(t,"requireSpecial",null);if(Bi(h)||(h=!0),u&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[a-zA-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireLetter"):i.push("密碼須包含至少一個英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(p&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[A-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireUppercase"):i.push("密碼須包含至少一個大寫英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(d&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[a-z]+.*$/))}(e)&&(n?i.push("keyLimRequireLowercase"):i.push("密碼須包含至少一個小寫英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(m&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[0-9]+.*$/))}(e)&&(n?i.push("keyLimRequireDigit"):i.push("密碼須包含至少一個數字")),r&&Dt(i)>0)throw new Error(i[0]);if(h&&!function(e){return!!Zi(e)&&/[!-/:-@[-`{-~]/.test(e);
|
|
11
|
+
*/!function(e){e.exports=function(e){var t=Array.isArray,i="object"==typeof jn&&jn&&jn.Object===Object&&jn,n="object"==typeof self&&self&&self.Object===Object&&self,r=i||n||Function("return this")(),s=r.Symbol,o=Object.prototype,a=o.hasOwnProperty,c=o.toString,l=s?s.toStringTag:void 0,u=Object.prototype.toString,p=s?s.toStringTag:void 0;function d(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":p&&p in Object(e)?function(e){var t=a.call(e,l),i=e[l];try{e[l]=void 0;var n=!0}catch(e){}var r=c.call(e);return n&&(t?e[l]=i:delete e[l]),r}(e):function(e){return u.call(e)}(e)}function m(e){return null!=e&&"object"==typeof e}function h(e){return"symbol"==typeof e||m(e)&&"[object Symbol]"==d(e)}var f=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,g=/^\w*$/;function w(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var y,M=r["__core-js_shared__"],D=(y=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",x=Function.prototype.toString,I=/^\[object .+?Constructor\]$/,b=Function.prototype,C=Object.prototype,v=b.toString,L=C.hasOwnProperty,E=RegExp("^"+v.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function A(e){if(!w(e)||D&&D in e)return!1;var t=function(e){if(!w(e))return!1;var t=d(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?E:I;return t.test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function N(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return A(i)?i:void 0}var S=N(Object,"create"),T=Object.prototype.hasOwnProperty,k=Object.prototype.hasOwnProperty;function j(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function Z(e,t){return e===t||e!=e&&t!=t}function z(e,t){for(var i=e.length;i--;)if(Z(e[i][0],t))return i;return-1}j.prototype.clear=function(){this.__data__=S?S(null):{},this.size=0},j.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},j.prototype.get=function(e){var t=this.__data__;if(S){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return T.call(t,e)?t[e]:void 0},j.prototype.has=function(e){var t=this.__data__;return S?void 0!==t[e]:k.call(t,e)},j.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=S&&void 0===t?"__lodash_hash_undefined__":t,this};var Y=Array.prototype.splice;function X(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,i=z(t,e);return!(i<0||(i==t.length-1?t.pop():Y.call(t,i,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,i=z(t,e);return i<0?void 0:t[i][1]},X.prototype.has=function(e){return z(this.__data__,e)>-1},X.prototype.set=function(e,t){var i=this.__data__,n=z(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};var F=N(r,"Map");function G(e,t){var i,n,r=e.__data__;return("string"==(n=typeof(i=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==i:null===i)?r["string"==typeof t?"string":"hash"]:r.map}function O(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t<i;){var n=e[t];this.set(n[0],n[1])}}function W(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(W.Cache||O),i}O.prototype.clear=function(){this.size=0,this.__data__={hash:new j,map:new(F||X),string:new j}},O.prototype.delete=function(e){var t=G(this,e).delete(e);return this.size-=t?1:0,t},O.prototype.get=function(e){return G(this,e).get(e)},O.prototype.has=function(e){return G(this,e).has(e)},O.prototype.set=function(e,t){var i=G(this,e),n=i.size;return i.set(e,t),this.size+=i.size==n?0:1,this},W.Cache=O;var P,K,H,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/\\(\\)?/g,V=(P=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(U,function(e,i,n,r){t.push(n?r.replace(B,"$1"):i||e)}),t},K=W(P,function(e){return 500===H.size&&H.clear(),e}),H=K.cache,K),_=V,R=s?s.prototype:void 0,Q=R?R.toString:void 0;function J(e){if("string"==typeof e)return e;if(t(e))return function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++i<n;)r[i]=t(e[i],i,e);return r}(e,J)+"";if(h(e))return Q?Q.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i}function $(e){return null==e?"":J(e)}function q(e,i){return t(e)?e:function(e,i){if(t(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!h(e))||g.test(e)||!f.test(e)||null!=i&&e in Object(i)}(e,i)?[e]:_($(e))}function ee(e){if("string"==typeof e||h(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function te(e,t,i){var n=null==e?void 0:function(e,t){for(var i=0,n=(t=q(t,e)).length;null!=e&&i<n;)e=e[ee(t[i++])];return i&&i==n?e:void 0}(e,t);return void 0===n?i:n}function ie(e){return"[object String]"===Object.prototype.toString.call(e)}function ne(e){return"[object Array]"===Object.prototype.toString.call(e)}function re(e){return"[object Object]"===Object.prototype.toString.call(e)}var se=/\s/,oe=/^\s+/;function ae(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}(e)+1).replace(oe,""):e}var ce=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ue=/^0o[0-7]+$/i,pe=parseInt;function de(e){if("number"==typeof e)return e;if(h(e))return NaN;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ae(e);var i=le.test(e);return i||ue.test(e)?pe(e.slice(2),i?2:8):ce.test(e)?NaN:+e}var me=1/0;function he(e){return e?(e=de(e))===me||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fe(e){var t=he(e),i=t%1;return t==t?i?t-i:t:0}function ge(e){return!0===(t=e)||!1===t||m(t)&&"[object Boolean]"==d(t);var t}function we(e){return!!(ie(e)&&e.length>0)}function ye(e){let t=!1;if(we(e)){if(""===e.trim())return!1;t=!isNaN(Number(e))}else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(function(e){if(e!=e)return!0;if(null!==e&&"object"==typeof e)try{let t=Number.prototype.valueOf.call(e);return Number.isNaN(t)}catch(e){return!1}return!1}(e))return!1;t=!0}return t}function Me(e){return ye(e)?he(e):0}function De(e,t={}){let i=te(t,"useLimitSafe",null);return ge(i)||(i=!1),!!ye(e)&&(e=Me(e),i?Number.isSafeInteger(e):"number"==typeof(n=e)&&n==fe(n));var n}var xe=r.isFinite,Ie=Math.min,be=function(){var e=Math.round;return function(t,i){if(t=de(t),(i=null==i?0:Ie(fe(i),292))&&xe(t)){var n=($(t)+"e").split("e");return+((n=($(e(n[0]+"e"+(+n[1]+i)))+"e").split("e"))[0]+"e"+(+n[1]-i))}return e(t)}}(),Ce=be;function ve(e,t={}){let i=te(t,"useClampSafe",null);ge(i)||(i=!1);let n=te(t,"useLimitSafe",null);ge(n)||(n=!1);let r=te(t,"returnWithStateAndMsg",null);ge(r)||(r=!1);let s=e=>r?{state:"success",msg:e}:e,o=e=>{if(r)return{state:"error",msg:e};throw new Error(e)};if(!ye(e))return s(0);let a=null;try{e=Me(e),a=Ce(e),i&&(a>Number.MAX_SAFE_INTEGER?a=Number.MAX_SAFE_INTEGER:a<Number.MIN_SAFE_INTEGER&&(a=Number.MIN_SAFE_INTEGER))}catch(e){return o(e.toString())}return n&&!Number.isSafeInteger(Number(a))?o(`v[${e}] is not a safe integer`):("0"===String(a)&&(a=0),s(a))}let Le=/^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+(?:[A-Za-z]{2,63}|[Xx][Nn]--[A-Za-z0-9-]{0,58}[A-Za-z0-9])$/;function Ee(e,t,i){let n=te(e,t);return null==n?i:n}function Ae(e){return ie(e)?e:"number"==typeof e&&Number.isFinite(e)?String(e):null}function Ne(e){return!e||ie(e)&&""===e.trim()}function Se(e){if(!ie(e))return null;let t=e.trim(),i=t.lastIndexOf("@");if(i<0)return null;let n=t.slice(0,i),r=t.slice(i+1);if(s=r,[...s].some(e=>e.charCodeAt(0)>127)){if(function(e){return[...e].some(e=>{let t=e.charCodeAt(0);return t<=32||127===t||"/\\?#%:@[]".includes(e)})}(r))return null;try{r=new URL(`http://${r}`).hostname}catch(e){return null}}var s;return t=`${n}@${r}`,function(e){return!!we(e)&&!(e.length>254)&&!(e.indexOf("@")>64)&&Le.test(e)}(t)?t:null}function Te(e,t){let i=te(e,t);if(!i)return{emails:[]};let n=ne(i);if(ie(i)&&(i=[i]),!ne(i))return{err:`${t} is not string or array`};let r=[];for(let e=0;e<i.length;e++){if(Ne(i[e]))continue;let s=Se(i[e]);if(null===s)return{err:n?`${t}[${e}] is not email`:`${t} is not email`};r.push(s)}return{emails:r}}function ke(e){if(!re(e))return!1;let t=e.filename;if(null!=t&&!1!==t&&!ie(t))return!1;if(e.raw)return!0;if(ie(e.path)&&""!==e.path)return!0;if(ie(e.href)&&""!==e.href)return!0;let i=e.content;return ie(i)||Buffer.isBuffer(i)||!!i&&"function"==typeof i.pipe}return function(t={}){let i=function(){let e,t,i=new Promise(function(){e=arguments[0],t=arguments[1]});return i.resolve=e,i.reject=t,i}(),n=e=>(i.reject(e),i);try{let r=Se(te(t,"srcEmail"));if(null===r)return n("srcEmail is not email");let s=Ae(Ee(t,"srcName","system by w-email"));if(null===s)return n("srcName is not string");s=s.replace(/[\r\n]+/g," ").trim();let o=Ae(Ee(t,"srcPW",""));if(null===o)return n("srcPW is not string");let a=Ee(t,"srcHost","smtp.gmail.com");if(!ie(a)||""===a.trim())return n("srcHost is not effective string");a=a.trim();let c=Ee(t,"srcPort",587);if(!function(e,t={}){return!!De(e,t)&&ve(e)>0}(c)||ve(c)>65535)return n("srcPort is not valid port");c=ve(c);let l=Ae(Ee(t,"emTitle",""));if(null===l)return n("emTitle is not string");let u=Ee(t,"emContent","");if(!Buffer.isBuffer(u)&&(u=Ae(u),null===u))return n("emContent is not string");let p=function(e){let t=te(e,"emAttachments");if(!t)return{atts:[]};let i=ne(t);if(re(t)&&(t=[t]),!ne(t))return{err:"emAttachments is not object or array"};let n=[];for(let e=0;e<t.length;e++)if(!Ne(t[e])){if(!ke(t[e]))return{err:i?`emAttachments[${e}] is not valid attachment`:"emAttachments is not valid attachment"};n.push(t[e])}return{atts:n}}(t);if(p.err)return n(p.err);let d=Te(t,"toEmails");if(d.err)return n(d.err);let m=Te(t,"toEmailsCC");if(m.err)return n(m.err);let h=Te(t,"toEmailsBCC");if(h.err)return n(h.err);if(d.emails.length+m.emails.length+h.emails.length===0)return n("no recipients");let f=e.createTransport({host:a,port:c,auth:{user:r,pass:o},secure:465===c}),g={from:{name:s,address:r},to:d.emails,cc:m.emails,bcc:h.emails,subject:l,html:u,attachments:p.atts};f.sendMail(g,function(e,t){e?i.reject(e):i.resolve(t.response)})}catch(e){i.reject(e)}return i}}(ud())}(Du);var pd=Zn(Du.exports);function dd(e,t){var i=[];return Rt(e,function(e,n,r){t(e,n,r)&&i.push(e)}),i}function md(e,t){return(S(e)?li:dd)(e,Ni(t))}function hd(e,t){return xi(e,t)}let fd=["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"];function gd(e,t={}){let i=[],n=ke(t,"useKeyForError",null);Bi(n)||(n=!1);let r=ke(t,"useOnlyOneError",null);if(Bi(r)||(r=!1),ji(e)||(n?i.push("keyInvalidPassword"):i.push("密碼非有效字串")),Dt(i)>0)throw new Error(i[0]);let s=ke(t,"numLenMin","");(!Qi(s)||tn(s)<0)&&(s=8),s=tn(s);let o=ke(t,"numLenMax","");if((!Qi(o)||tn(o)<0)&&(o=30),o=tn(o),s>o&&(n?i.push("keyLimNumLenMinOrMax"):i.push("設定密碼最小長度大於最大長度")),Dt(i)>0)throw new Error(i[0]);let a=ke(t,"noSpace",null);if(Bi(a)||(a=!0),a&&(Zi(c=e)&&null!==c.match(/^.*\s+.*$/)&&(n?i.push("keyLimHasSpace"):i.push("密碼不可包含空白字元")),r&&Dt(i)>0))throw new Error(i[0]);var c;let l=ke(t,"onlyAscii",null);if(Bi(l)||(l=!0),l&&(/[^\x20-\x7e]/.test(e)&&(n?i.push("keyLimNonAsciiChar"):i.push("密碼僅允許使用英文大小寫、數字及特殊符號")),r&&Dt(i)>0))throw new Error(i[0]);if(Dt(e)<s&&(n?i.push("keyLimNumLenMin"):i.push(`密碼長度須大於等於${s}個字元`)),r&&Dt(i)>0)throw new Error(i[0]);if(Dt(e)>o&&(n?i.push("keyLimNumLenMax"):i.push(`密碼長度須小於等於${o}個字元`)),r&&Dt(i)>0)throw new Error(i[0]);let u=ke(t,"requireLetter",null);Bi(u)||(u=!1);let p=ke(t,"requireUppercase",null);Bi(p)||(p=!0);let d=ke(t,"requireLowercase",null);Bi(d)||(d=!0);let m=ke(t,"requireDigit",null);Bi(m)||(m=!0);let h=ke(t,"requireSpecial",null);if(Bi(h)||(h=!0),u&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[a-zA-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireLetter"):i.push("密碼須包含至少一個英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(p&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[A-Z]+.*$/))}(e)&&(n?i.push("keyLimRequireUppercase"):i.push("密碼須包含至少一個大寫英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(d&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[a-z]+.*$/))}(e)&&(n?i.push("keyLimRequireLowercase"):i.push("密碼須包含至少一個小寫英文字母")),r&&Dt(i)>0)throw new Error(i[0]);if(m&&!function(e){return!!Zi(e)&&!(null===e.match(/^.*[0-9]+.*$/))}(e)&&(n?i.push("keyLimRequireDigit"):i.push("密碼須包含至少一個數字")),r&&Dt(i)>0)throw new Error(i[0]);if(h&&!function(e){return!!Zi(e)&&/[!-/:-@[-`{-~]/.test(e);
|
|
12
12
|
//!"#$%&'()*+,-./ :;<=>?@ [\]^_` {|}~
|
|
13
|
-
}(e)&&(n?i.push("keyLimRequireSpecial"):i.push("密碼須包含至少一個特殊符號")),r&&Dt(i)>0)throw new Error(i[0]);let f=ke(t,"forbiddenChars",null);if(rn(f)||(f=[]),Dt(f)>0){for(let t of f)if(e.includes(t)){if(n){i.push("keyLimForbiddenChar");break}i.push(`密碼不可包含字元:${t}`)}if(r&&Dt(i)>0)throw new Error(i[0])}let g=ke(t,"commonPasswordBlacklist",null);if(rn(g)||(g=Gp),Dt(g)>0){let t=e.toLowerCase();if(g.some(e=>ji(e)&&t===e.toLowerCase())&&(n?i.push("keyLimCommonPassword"):i.push("此密碼為常見弱密碼,不允許使用")),r&&Dt(i)>0)throw new Error(i[0])}let w=ke(t,"account",""),y=ke(t,"noConsecutiveCharsFromAccount",null);Bi(y)||(y=!1);let M=ke(t,"consecutiveCharsMinMatch","");if(nn(M)||(M=3),M=tn(M),y&&ji(w)&&Dt(w)>=M){let t=[...w.toLowerCase()],s=e.toLowerCase(),o=!1;for(let e=0;e<=t.length-M;e++){let i=t.slice(e,e+M).join("");if(s.includes(i)){o=!0;break}}if(o&&(n?i.push("keyLimConsecutiveCharsFromAccount"):i.push(`密碼不可包含與帳號相同之${M}個以上連續字元`)),r&&Dt(i)>0)throw new Error(i[0])}if(Dt(i)>0)throw new Error(i.join(" | "));return!0}function Wp(){let e=Gn(),t=Object.create(null);function i(t,i){On(e,t,[i],{tag:"cache"})}function n(e,n={}){if(sr(t,e))return;let r=ke(n,"fun");Mn(r)||(r=async()=>{});let s=ke(n,"inputs");rn(s)||(s=[]);let o=ke(n,"timeExpired");nn(o)||(o=5e3),o=tn(o);let a=ke(n,"timeFrom");"end"!==a&&(a="start");let c=ke(n,"useCacheWhenError");Bi(c)||(c=!1);let l=ke(n,"useCloneDeep");Bi(l)||(l=!0),t[e]={needExec:!0,fun:r,pm:null,gen:0,inputs:s,value:null,time:null,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l},i("message",{fun:"set",key:e,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l})}async function r(e,n={}){if(sr(t,e)){let r=t[e],s=ke(n,"useCloneDeep");if(Bi(s)||(s=r.useCloneDeep),r.pm)return i("message",{fun:"get",key:e,msg:"waiting"}),await r.pm,s?To(r.value):r.value;let o=Date.now(),a=r.needExec,c=o-r.time;if(a?i("message",{fun:"get",key:e,msg:"execute first"}):r.timeExpired>0&&c>r.timeExpired&&(i("message",{fun:"get",key:e,msg:"execute by timeExpired",timeDiff:c}),a=!0),a){i("message",{fun:"get",key:e,msg:"fun start"}),r.needExec=!1;let t,n,s=r.gen,a=async()=>{try{let t;try{t=await r.fun(...r.inputs)}catch(n){if(i("error",{fun:"get",key:e,msg:n}),!r.useCacheWhenError)throw r.gen===s&&(r.needExec=!0),n;t=void 0}r.gen===s&&(r.value=t,r.time="end"===r.timeFrom?Date.now():o)}finally{r.pm=null,i("message",{fun:"get",key:e,msg:"fun end"})}},c=new Promise((e,i)=>{t=e,n=i});r.pm=c,a().then(t,n),await c}else i("message",{fun:"get",key:e,msg:"use cache"});return s?To(r.value):r.value}return i("error",{fun:"get",key:e,msg:"invalid key"}),null}return e.set=n,e.getProxy=async function(e,t={}){return n(e,t),r(e,t)},e.get=r,e.update=function(e,n){sr(t,e)&&(i("message",{fun:"updateValue",key:e}),t[e].value=n,t[e].time=Date.now(),t[e].gen+=1)},e.clear=function(e){sr(t,e)&&(i("message",{fun:"clear",key:e}),t[e].needExec=!0)},e.remove=function(e){sr(t,e)&&(i("message",{fun:"remove",key:e}),delete t[e])},e}async function Op(e,t={}){let i=null,n=bn();if(!Mn(e))return n.reject("waitfunction需輸入函數f"),n;let r=async()=>{let t=e();return vn(t)&&(t=await t),t};if(i=await r(),!0===i)return n.resolve(),n;let s=ke(t,"attemptNum",null);nn(s)||(s=200);let o=ke(t,"timeInterval",null);nn(o)||(o=1e3),o=Math.min(o,Wn);let a=0,c=!1,l=setInterval(async()=>{if(a+=1,c)a>s&&clearInterval(l);else{c=!0;try{i=await r()}catch(e){return clearInterval(l),void n.reject(e)}finally{c=!1}if(!0===i)return clearInterval(l),void n.resolve();a>s&&(clearInterval(l),n.reject(`exceeded attemptNum[${s}]`))}},o);return n}function Pp(e={}){let t=ke(e,"timeExpire",null);nn(t)||(t=18e5),t=tn(t),t=Math.min(t,Wn);let i=ke(e,"timeDetect",null);nn(i)||(i=2e3),i=tn(i),i=Math.min(i,Wn);let n=Gn(),r=Object.create(null),s=e=>{if(sr(r,e)){return Fn(n,"checkWithSet",[{state:"error",msg:`checkWithSet: key in use: ${e}`}],{tag:"cacheSt"}),!1}return r[e]={time:Date.now(),value:!0},Fn(n,"checkWithSet",[{state:"success",msg:`checkWithSet: ${e}`}],{tag:"cacheSt"}),!0},o=setInterval(()=>{Fn(n,"detect",[{state:"start"}],{tag:"cacheSt"});let e=Date.now();for(let i of Object.keys(r)){let n=r[i];n&&e-n.time>t&&delete r[i]}Fn(n,"detect",[{state:"finish"}],{tag:"cacheSt"})},i);return n.checkWithSet=s,n.setWithFree=async(e,t)=>{Fn(n,"setWithFree",[{state:"start"}],{tag:"cacheSt"});let i=[];for(let t of e){if(!s(t)){for(let e of i)delete r[e];let e=`setWithFree: key in use: ${t}`;return Fn(n,"setWithFree",[{state:"error",msg:e}],{tag:"cacheSt"}),Promise.reject(e)}i.push(t)}try{let i=await t(),r=`setWithFree: ${e.join(", ")}`;return Fn(n,"setWithFree",[{state:"success",msg:r}],{tag:"cacheSt"}),i}catch(e){let t="";try{t=`${e&&e.message||e}`}catch(e){}throw Fn(n,"setWithFree",[{state:"error",msg:`setWithFree: fn threw: ${t}`}],{tag:"cacheSt"}),e}finally{for(let e of i)delete r[e]}},n.set=async(e,t=!0)=>{r[e]={time:Date.now(),value:t},Fn(n,"set",[{state:"success",msg:`set: ${e}`}],{tag:"cacheSt"})},n.get=async e=>{let t=r[e],i=void 0===t?null:t.value;return Fn(n,"get",[{state:"success",msg:`get: ${e}`}],{tag:"cacheSt"}),i},n.check=async e=>{let t=sr(r,e);return Fn(n,"check",[{state:"success",msg:`check: ${e} = ${t}`}],{tag:"cacheSt"}),t},n.del=async e=>{delete r[e],Fn(n,"del",[{state:"success",msg:`del: ${e}`}],{tag:"cacheSt"})},n.waitExist=async(e,t={})=>{let i=ke(t,"attemptNum",null);nn(i)||(i=30),i=tn(i);let s=ke(t,"timeInterval",null);nn(s)||(s=100),s=tn(s),Fn(n,"waitExist",[{state:"start"}],{tag:"cacheSt"});try{await Op(()=>sr(r,e),{attemptNum:i,timeInterval:s})}catch(t){let r=`waitExist timeout (${i*s}ms): ${e}`;return Fn(n,"waitExist",[{state:"error",msg:r}],{tag:"cacheSt"}),Promise.reject(r)}Fn(n,"waitExist",[{state:"success",msg:`waitExist resolved: ${e}`}],{tag:"cacheSt"})},n.waitNotExist=async(e,t={})=>{let i=ke(t,"attemptNum",null);nn(i)||(i=30),i=tn(i);let s=ke(t,"timeInterval",null);nn(s)||(s=100),s=tn(s),Fn(n,"waitNotExist",[{state:"start"}],{tag:"cacheSt"});try{await Op(()=>!sr(r,e),{attemptNum:i,timeInterval:s})}catch(t){let r=`waitNotExist timeout (${i*s}ms): ${e}`;return Fn(n,"waitNotExist",[{state:"error",msg:r}],{tag:"cacheSt"}),Promise.reject(r)}Fn(n,"waitNotExist",[{state:"success",msg:`waitNotExist resolved: ${e}`}],{tag:"cacheSt"})},n.clear=()=>{clearInterval(o)},n}function Kp(e,t,i={}){let n=ke(i,"mode","");if(Zi(n)||(n="scrypt"),"scrypt"!==n)throw new Error("暫時不支援scrypt以外方法");let r=L.randomBytes(16),s=`${e}:${t||""}`,o=L.scryptSync(s,r,64);return`scrypt:${r.toString("hex")}:${o.toString("hex")}`}function Hp(e,t,i){if(!Zi(t))return!1;let n=t.split(":");if(3!==n.length)return!1;let r,s,[o,a,c]=n;if("scrypt"!==o)return!1;if(!Zi(a)||!Zi(c))return!1;try{r=Buffer.from(a,"hex"),s=Buffer.from(c,"hex")}catch(e){return!1}if(16!==r.length||64!==s.length)return!1;let l=`${e}:${i||""}`,u=L.scryptSync(l,r,64);return u.length===s.length&&L.timingSafeEqual(u,s)}function Up(e){return e[C.randomInt(e.length)]}function Bp(e){for(let t=e.length-1;t>0;t--){let i=C.randomInt(t+1),n=e[t];e[t]=e[i],e[i]=n}return e}async function Vp(e,t,i){if("save"!==t&&"del"!==t)return Promise.reject(`invalid mode[${t}]`);if(!Mn(ke(e,t)))return Promise.reject(`invalid wo.${t}`);let n=await e[t](i),r=zc(n,i);if(Dt(r)>0){let e=Yr(r,e=>`id[${e.id}]: ${e.err}`);return Promise.reject(`${t} fail: ${da(e,"; ")}`)}return n}let _p=["readUsers","writeUsers","readTokens","writeTokens","readIps","writeIps","readStats"],Rp=["readUsers"];function Qp(e){return Zi(e)&&_p.includes(e)}function Jp(e){return null==e||""===e||!!rn(e)&&e.every(Qp)}function qp(e){return rn(e)?_p.filter(t=>e.includes(t)):[]}function $p(e,t){return!!Qp(t)&&function(e){let t=qp(ke(e,"perms"));return _p.filter(e=>Rp.includes(e)||t.includes(e))}(e).includes(t)}let ed=["password","tokenVerify"];function td(e){return"string"!=typeof e&&(e=null==e?"":String(e)),e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function id(e,t,{srLog:i,srEmail:n,salt:r,minExpired:s,kpLang:o,passwordPolicy:a,allowUserRegistration:c,siteUrl:l,verifyBaseUrl:u}){let p=new function(){let e=new Map,t=new Map;return async(i,n)=>{let r=(e.get(i)||Promise.resolve()).then(async()=>await n(),async()=>await n());e.set(i,r.catch(()=>{})),t.set(i,(t.get(i)||0)+1);try{return await r}finally{let n=t.get(i)-1;n<=0?(t.delete(i),e.delete(i)):t.set(i,n)}}},d=Pp(),m=function(e){return async(t,i,n,r={})=>{let s=ke(r,"errKey","");Zi(s)||(s="saveInProgress");let o=`${t}:${i}`;return await e.setWithFree([o],n).catch(e=>e===`setWithFree: key in use: ${o}`?Promise.reject(s):Promise.reject(e))}}(d),h=new Map,f=new Map,g=(e,t)=>ke(o,`${t}.${e}`,""),w=(e,t,i={})=>{"eng"!==t&&"cht"!==t&&(t="eng");let n=ke(o,`${t}.${e}`,"");for(let e in i)n=n.replaceAll(`{${e}}`,td(i[e]));return n},y=async(t,n,r={})=>{let s=null,o=ke(r,"deletePassword");Bi(o)||(o=!0);let a=await e.users.select({[t]:n,isActive:"y"}).catch(e=>{s=e});if(s)return console.log(s),console.log("keyUser",t),console.log("valueUser",Wl(t,n)),console.log("failed to find user"),Promise.reject("failed to find user");o&&(a=Yr(a,e=>(delete e.password,e)));let c=Dt(a);return 0===c?(i&&Mn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userNotFound",keyUser:Fl(t),valueUser:Wl(t,n)}),Promise.reject(`can not find the user by ${t}`)):c>=2?(i&&Mn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userDuplicate",keyUser:Fl(t),valueUser:Wl(t,n)}),Promise.reject(`duplicate ${t}`)):a[0]},M=async(e,t)=>await y(e,t),D=async(e,t={})=>await M("id",e),x=async t=>{let i=null;if(!un(s))return console.log("minExpired",s),console.log("invalid minExpired"),Promise.reject("invalid minExpired");let n=xl.tokens.funNew({userId:t});n.timeEnd=Tr().add(s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");let r=ke(n,"token","");return await e.tokens.insert(n).catch(e=>{i=e}),i?(console.log(i),console.log("can not create a token from userId"),Promise.reject("can not create a token from userId")):r},I=async(t,n={})=>{let r=await e.tokens.select({token:t}),s=Dt(r);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=ke(r,0,""),a=ke(o,"userId",""),c=await(async(e,t={})=>{let n=ke(e,"timeEnd","");if(!bl(n))return console.log("timeEnd",n),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let r=ke(e,"isApp",""),s=ke(t,"fun",null),o=ke(t,"perm",""),a=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<n,c=!0;if("y"!==r){if(Mn(s)){let t=ke(e,"userId","");c=s(e,await D(t)),vn(c)&&(c=await c)}}else Zi(o)?c=$p(e,o):Mn(s)&&(c=!1),c||i.warn({event:"fun-checkToken",key:"appTokenPermDenied",token:Xl(ke(e,"token","")),userId:ke(e,"userId",""),perm:o});return a&&c})(o,n);return i.info({event:"fun-checkToken",token:Xl(t),userId:a,res:c}),c},C=async(e,t={})=>{if(!Zi(e))return Promise.reject("tokenExpired");let i=null;return await I(e,t).then(e=>{!1===e&&(i="tokenExpired")}).catch(e=>{console.log("checkToken inner reject",e),i="tokenExpired"}),null===i||Promise.reject(i)},b=(e,t,i={})=>{Zi(e)||(e="eng");let n=ke(i,"account",""),r="";try{Fp(t,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:a.minLength,numLenMax:a.maxLength,requireLetter:a.requireLetter,requireUppercase:a.requireUppercase,requireLowercase:a.requireLowercase,requireDigit:a.requireDigit,requireSpecial:a.requireSpecial,noSpace:a.noSpace,onlyAscii:a.onlyAscii,forbiddenChars:a.forbiddenChars,commonPasswordBlacklist:a.commonPasswordBlacklist,account:n,noConsecutiveCharsFromAccount:a.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:a.consecutiveCharsMinMatch})}catch(e){r=e.message}let s=null;return Zi(r)?(s={state:"error",key:`userPassword_${r}`},s):(s={state:"success",msg:"ok"},s)},v=async t=>{if(!Zi(t))return Promise.reject("invalid userId");let i=await e.tokens.select({userId:t});return 0===Dt(i)?0:(await Vp(e.tokens,"del",Yr(i,e=>({id:e.id}))),Dt(i))},L=async(n,s,o,a={})=>{let c=ke(a,"resetOrder");Bi(c)||(c=!1);let l=ke(a,"operatorId",""),u=ke(a,"lang","eng");Zi(u)||(u="eng");let p=ke(a,"ocList",null);if(!rn(s))return Promise.reject("invalidRows");let d=[];ar(s,e=>{!0===ke(e,"_isNew")&&d.push(ke(e,"id",""))}),s=function(e,t,i=""){return ln(e)&&ln(t)?Yr(e,e=>fl(e,t,i)):[]}(s,xl[n].keys),c&&(s=Yr(s,(e,t)=>(e.order=t+1,e)));let m=(e,t)=>{let i=null,n=Object.create(null);return ar(e,e=>{let r=ke(e,t,"");return Zi(r)?sr(n,r)?(i="duplicate",!1):void(n[r]=!0):(i="empty",!1)}),i};if(null!==m(s,"id")||s.some(e=>Buffer.byteLength(e.id,"utf8")>1978))return Promise.reject("invalidRows");if(function(e,t){function i(e){return rn(e)?e:[e]}if(cn(e))return!1;if(0===(e=i(e)).length)return!1;if(cn(e))return!1;if(0===(t=i(t)).length)return!1;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)if(Xp(e[i],t[n]))return!0;return!1}(n,["users"])){let e=m(s,"email");if("empty"===e)return Promise.reject("userEmailEmpty");if("duplicate"===e)return Promise.reject("userEmailDuplicate")}let h=await e[n].select();if(Dt(d)>0){let e=Object.create(null);if(ar(h,t=>{e[ke(t,"id","")]=!0}),d.some(t=>!0===e[t]))return Promise.reject("saveNewRowExists")}if("users"===n){let e=Object.create(null);ar(h,t=>{let i=ke(t,"account","");Zi(i)&&(e[i]=ke(t,"id",""))});let t=Object.create(null),i=null;if(ar(s,n=>{let r=ke(n,"account",""),s=ke(n,"id","");return Zi(r)?sr(t,r)||sr(e,r)&&e[r]!==s?(i="accountDuplicate",!1):void(t[r]=!0):(i="accountRequired",!1)}),null!==i)return Promise.reject(i)}if("users"===n){let e=Object.create(null);ar(h,t=>{e[t.id]=t}),ar(s,t=>{let i=e[t.id];i&&(t.password=i.password)})}let f=s,g=function(e,t,i,n={}){let r=ke(n,"withInfor");Bi(r)||(r=!0);let s={del:[],add:[],same:[],diff:[]};if(!Zi(i))return console.log("invalid key"),r&&(s.infor={}),s;rn(e)||(e=[e]),rn(t)||(t=[t]),e=Yp(e,e=>sr(e,i)),t=Yp(t,e=>sr(e,i));let o=new Map(t.map(e=>[e[i],e]));for(let t of e){let e=o.get(t[i]);e?(JSON.stringify(t)===JSON.stringify(e)?s.same.push(e):s.diff.push(e),o.delete(t[i])):s.del.push(t)}if(s.add=Array.from(o.values()),r){let e={};for(let t of s.del)e[t[i]]="del";for(let t of s.add)e[t[i]]="add";for(let t of s.diff)e[t[i]]="diff";for(let t of s.same)e[t[i]]="same";s.infor=e}return s}(h,f,o);if(Dt(Yp([...g.add,...g.diff],e=>Bt(e).some(t=>"password"!==t&&!Xp(Zc(e[t]),e[t]))))>0)return Promise.reject("htmlMarkupNotAllowed");if("users"===n&&Dt(g.add)>0){for(let e of g.add){let t=ke(e,"password",""),i=ke(e,"account",""),n=b(u,t,{account:i});if("error"===n.state)return Promise.reject(n.key);e.password=Kp(t,r)}ar(g.add,e=>{Zi(ke(e,"timeVerified",""))||(e.timeVerified=wa())})}let w=[];if(Dt(g.diff)>0){let e=Object.create(null);ar(h,t=>{e[ke(t,o,"")]=t}),ar(g.diff,t=>{let i=ke(t,o,""),n=null;ar(t,(t,r)=>{let s=ke(e,[i,r]);rn(t)&&rn(s)&&t.length<s.length&&(null===n&&(n={[o]:i}),n[r]=null)}),null!==n&&w.push(n)})}let y=null;try{if(Dt(g.del)>0&&await t(l,n,"del",g.del),Dt(g.add)>0)if("tokens"===n){let e=new Map;ar(g.add,t=>{let i=ke(t,"userId","");e.has(i)||e.set(i,[]),e.get(i).push(t)});for(let[i,r]of e)await t(i,n,"insert",r)}else await t(l,n,"insert",g.add);Dt(w)>0&&await t(l,n,"save",w),Dt(g.diff)>0&&await t(l,n,"save",g.diff)}catch(e){y=e}if("users"===n){for(let e of g.del){let t=ke(e,"id","");await v(t).catch(e=>{i.error({event:"fun-updateTabItems-revokeTokenOnDelete",userId:t,err:Rn(e)})})}for(let e of f){if("n"!==ke(e,"isActive",""))continue;let t=ke(e,"id","");await v(t).catch(e=>{i.error({event:"fun-updateTabItems-revokeTokenOnDisable",userId:t,err:Rn(e)})})}}return null!==p&&p.clear("fun"),null!==y?(i.error({event:"fun-updateTabItems-write",key:"saveWriteFail",woName:n,err:Rn(y)}),Promise.reject("saveWriteFail")):("users"===n&&(f=Yr(f,e=>{let t={...e};return delete t.password,t})),f)},E=async t=>{let i=await e.tokens.select({token:t}),n=Dt(i);if(0===n)return console.log("invalid token"),Promise.reject("invalid token");if(n>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let r=ke(i,0,null),s=ke(r,"isApp",""),o=null;if("y"!==s){let e=ke(r,"userId","");o=await D(e)}else{let e=ke(r,"userId","");if(!Zi(e))return console.log("invalid userId from token"),Promise.reject("invalid userId from token");o={id:e,account:"no account",name:"no name",email:"no email",description:"no description",from:"no from",redir:"no redir",isAdmin:"y",timeVerified:"2000-01-01T00:00:00.000+08:00",timeExpired:"",timeBlocked:"",isActive:"y"}}return{id:o.id,account:o.account,name:o.name,email:o.email,description:o.description,from:o.from,redir:o.redir,isApp:"y"===s?"y":"n",isAdmin:o.isAdmin,timeVerified:o.timeVerified,timeExpired:o.timeExpired,timeBlocked:o.timeBlocked,isActive:o.isActive,isForceChangePw:o.isForceChangePw}},A=async(e,t,i={})=>{if(!Zi(e)||!Gl.includes(e))return Promise.reject("invalidUserQueryKey");let n=await M(e,t).catch(()=>null);return ki(n)?{id:n.id,account:n.account,name:n.name,email:n.email,description:n.description,from:n.from,redir:n.redir,isAdmin:n.isAdmin,timeVerified:n.timeVerified,timeExpired:n.timeExpired,timeBlocked:n.timeBlocked,isActive:n.isActive}:null},N=async(t={})=>{let i=ke(t,"needActive");Bi(i)||(i=!1);let n=ke(t,"deletePassword");Bi(n)||(n=!0);let r={};i&&(r={isActive:"y"});let s=await e.users.select(r);return n&&(s=Yr(s,e=>(delete e.password,e))),s},S=Wp(),T=async(e,t={})=>(await C(e,t),await N(t)),k=async(e,t={})=>e=await L("users",e,"id",{resetOrder:!0,...t,ocList:S}),j=async()=>await e.tokens.select(),Z=Wp(),z=async()=>await e.ips.select(),Y=Wp(),X={getTokenByKV:async(t,i)=>{let n=null,r=await e.tokens.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("failed to find token"),Promise.reject("failed to find token");let s=Dt(r);return 0===s?Promise.reject(`can not find the token by keyToken[${t}]`):s>=2?(console.log(`duplicate token by keyToken[${t}]`),Promise.reject(`duplicate token by keyToken[${t}]`)):r[0]},createUser:async(s,a)=>{if(Zi(s)||(s="eng"),!c)return Promise.reject("userRegistrationNotAllowed");let l=ke(a,"account","");if(!Zi(l))return Promise.reject("userRegistrationAccountInvalid");let p=ke(a,"email","");if(!Zi(p)||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p))return Promise.reject("userRegistrationEmailFormatInvalid");let m=ke(a,"password",""),h=ke(a,"confirmPassword","");if(m!==h)return Promise.reject("userChangePasswordNotSame");let f=b(s,m,{account:l});if("error"===f.state)return Promise.reject(f.key);let y=ke(a,"name","");if(!Zi(y))return Promise.reject("userRegistrationNameInvalid");if([l,y,p].some(e=>Zc(e)!==e))return Promise.reject("htmlMarkupNotAllowed");let M,D=`createUser:account:${l}`,x=`createUser:email:${p}`;await d.setWithFree([D,x],async()=>{let n=await e.users.select(),s=n.some(e=>ke(e,"account","")===l);if(s)return Promise.reject("userRegistrationAccountExists");let o=n.some(e=>ke(e,"email","")===p);if(o)return Promise.reject("userRegistrationEmailExists");let a=Kp(m,r);M=`${va()}`;let c=xl.users.funNew({account:l,password:a,name:y,email:p,tokenVerify:M,isAdmin:"n",isActive:"y"});await t(c.id,"users","insert",[c]).catch(e=>(i.error({event:"fun-createUser-insert",key:"userRegistrationFailed",account:l,err:Rn(e)}),Promise.reject("userRegistrationFailed")))}).catch(e=>{let t=e&&"string"==typeof e?e:e&&e.message||String(e);return t.includes(D)?Promise.reject("userRegistrationAccountExists"):t.includes(x)?Promise.reject("userRegistrationEmailExists"):Promise.reject(e)});try{let e=ke(o,`${s}.webName`,""),t=g("regVerifyEmTitle",s),i=w("regVerifyEmContent",s,{sender:e,name:y,verifyUrl:`${u}/api/verifyEmail?token=${M}&lang=${s}`});await n.send(e,t,i,p)}catch(e){console.log("send verify email error",e)}return{state:"success",msg:"ok"}},verifyEmail:async t=>{if(!Zi(t))return Promise.reject("verifyEmailInvalidToken");let n=await e.users.select({tokenVerify:t});if(0===Dt(n))return Promise.reject("verifyEmailInvalidToken");let r=n[0];if(Zi(ke(r,"timeVerified","")))return Promise.reject("verifyEmailAlreadyVerified");let s=null;return await Vp(e.users,"save",{id:r.id,timeVerified:wa()}).catch(e=>{s=e}),null!==s?(i.error({event:"fun-verifyEmail-save",key:"verifyEmailFailed",userId:r.id,err:Rn(s)}),Promise.reject("verifyEmailFailed")):{state:"success",msg:"ok"}},resendVerifyEmail:async(t,r,s)=>(Zi(t)||(t="eng"),Zi(r)&&Zi(s)?await p(`resendVerifyEmail:${r}`,async()=>{let a=Date.now(),c=h.get(r);if(c&&a-c<3e4)return Promise.reject("userRegistrationResendThrottled");let l=null;try{l=await y("account",r)}catch(e){}if(!l)return Promise.reject("userRegistrationResendInvalidEmail");if(ke(l,"email","")!==s)return Promise.reject("userRegistrationResendInvalidEmail");if(Zi(ke(l,"timeVerified","")))return Promise.reject("userRegistrationAlreadyVerified");let p=ke(l,"id",""),d=ke(l,"name",""),m=`${va()}`,f=null;if(await Vp(e.users,"save",{id:p,tokenVerify:m}).catch(e=>{f=e}),null!==f)return i.error({event:"fun-resendVerifyEmail-save",key:"userRegistrationResendFailed",userId:p,err:Rn(f)}),Promise.reject("userRegistrationResendFailed");h.set(r,a);try{let e=ke(o,`${t}.webName`,""),i=g("regVerifyEmTitle",t),r=w("regVerifyEmContent",t,{sender:e,name:d,verifyUrl:`${u}/api/verifyEmail?token=${m}&lang=${t}`});await n.send(e,i,r,s)}catch(e){return console.log("resend verify email error",e),Promise.reject("userRegistrationResendFailed")}return{state:"success",msg:"ok"}}):Promise.reject("userRegistrationResendInvalidEmail")),checkUserPassword:b,checkTokenAndChangePassword:async(t,s,a,c)=>{if(await C(t),Zi(s)||(s="eng"),!Zi(a))return Promise.reject("userChangePasswordFail");let l=ke(await E(t),"id","");return await p(`changeUserPassword:${l}`,async()=>{let u=await y("id",l,{deletePassword:!1}),p=ke(u,"account",""),d=b(s,c,{account:p});if("error"===d.state)return Promise.reject(d.key);let m=ke(u,"password","");if(!Hp(a,m,r))return Promise.reject("userChangePasswordIncorrectOld");let h=ke(u,"email","");if(!Zi(h))return Promise.reject("anUnexpectedErrorOccurred");let f=Kp(c,r),M=null;if(await Vp(e.users,"save",{id:l,password:f,isForceChangePw:"n"}).catch(e=>{M=e}),null!==M)return i.error({event:"fun-changePassword-save",key:"userChangePasswordFail",userId:l,err:Rn(M)}),Promise.reject("userChangePasswordFail");try{let e=ke(o,`${s}.webName`,"");if(!Zi(e))throw console.log("get(kpLang, lang)",ke(o,s)),console.log("lang",s),new Error("invalid sender");let t=ke(u,"name","unknow"),i=g("chpwEmTitle",s);if(!Zi(i))throw console.log("chpwEmTitle 取不到, lang",s),new Error("invalid title");let r=w("chpwEmContent",s,{sender:e,name:t});await n.send(e,i,r,h)}catch(e){console.log(e),i.error({event:"fun-changePassword-sendEmail",token:Xl(t),lang:s,err:Rn(e)})}})},adminResetUserPassword:async(t,s,c)=>{if(await C(t,{perm:"writeUsers"}),Zi(s)||(s="eng"),!Zi(c))return Promise.reject("anUnexpectedErrorOccurred");let l=await E(t),u=ke(l,"id","");return"y"!==ke(l,"isAdmin","")?Promise.reject("adminResetPasswordForbidden"):u===c?Promise.reject("adminResetPasswordCannotResetSelf"):await p(`adminResetUserPassword:${c}`,async()=>{let l=Date.now(),u=f.get(c);if(u&&l-u<3e4)return Promise.reject("adminResetPasswordAlreadyTriggered");let p=null;try{p=await y("id",c,{deletePassword:!0})}catch(e){return Promise.reject("adminResetPasswordUserNotFound")}if(!ki(p))return Promise.reject("adminResetPasswordUserNotFound");let d=ke(p,"account",""),m=ke(p,"name","unknow"),h=ke(p,"email",""),M=function(e,t=""){let i=e.minLength||8,n=e.maxLength||16,r=Math.min(Math.max(i,12),n),s="abcdefghijklmnopqrstuvwxyz".split(""),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),a="0123456789".split(""),c="!@#$%^&*()_+-=[]{}|;:,.<>?".split(""),l=e.forbiddenChars||[];c=c.filter(e=>!l.includes(e));let u=[];(e.requireLowercase||e.requireLetter)&&(u=u.concat(s)),e.requireUppercase&&(u=u.concat(o)),!e.requireLetter||e.requireUppercase||e.requireLowercase||(u=u.concat(o)),e.requireDigit&&(u=u.concat(a)),e.requireSpecial&&(u=u.concat(c)),0===u.length&&(u=s.concat(o).concat(a));for(let i=0;i<20;i++){let i=[];for(e.requireLetter&&i.push(Up(s.concat(o))),e.requireUppercase&&i.push(Up(o)),e.requireLowercase&&i.push(Up(s)),e.requireDigit&&i.push(Up(a)),e.requireSpecial&&i.push(Up(c));i.length<r;)i.push(Up(u));Bp(i);let n=i.join("");try{return Fp(n,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:e.minLength,numLenMax:e.maxLength,requireLetter:e.requireLetter,requireUppercase:e.requireUppercase,requireLowercase:e.requireLowercase,requireDigit:e.requireDigit,requireSpecial:e.requireSpecial,noSpace:e.noSpace,onlyAscii:e.onlyAscii,forbiddenChars:e.forbiddenChars,commonPasswordBlacklist:e.commonPasswordBlacklist,account:t,noConsecutiveCharsFromAccount:e.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:e.consecutiveCharsMinMatch}),n}catch(e){}}throw new Error("cannot generate random password matching policy")}(a,d),D=Kp(M,r),x=null;if(await Vp(e.users,"save",{id:c,password:D,isForceChangePw:"y"}).catch(e=>{x=e}),null!==x)return i.error({event:"fun-adminResetUserPassword-save",key:"adminResetPasswordFailed",token:Xl(t),targetUserId:c,err:Rn(x)}),Promise.reject("adminResetPasswordFailed");f.set(c,l);try{if(Zi(h)){let e=ke(o,`${s}.webName`,"");if(!Zi(e))throw new Error("invalid sender");let t=g("resetPwEmTitle",s);if(!Zi(t))throw new Error("invalid title");let i=w("resetPwEmContent",s,{sender:e,name:m,account:d,newPassword:M});await n.send(e,t,i,h)}else i.error({event:"fun-adminResetUserPassword-noEmail",token:Xl(t),targetUserId:c})}catch(e){console.log(e),i.error({event:"fun-adminResetUserPassword-sendEmail",token:Xl(t),targetUserId:c,err:Rn(e)})}return{state:"success"}})},getIpByKV:async(t,i)=>{let n=null,r=await e.ips.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("keyIp",t),console.log("valueIp",i),console.log("failed to find ip"),Promise.reject("failed to find ip");let s=Dt(r);return 0===s?Promise.reject(`can not find the ip by keyIp[${t}]`):s>=2?(console.log("keyIp",t),console.log("valueIp",i),console.log(`duplicate ip by keyIp[${t}]`),Promise.reject(`duplicate ip by keyIp[${t}]`)):r[0]},revokeTokensByUserId:v,getGenUserByKV:M,getGenUserByUserId:D,getGenUserByAccount:async(e,t={})=>await M("account",e),loginByAccountAndPassword:async(t,i)=>{if(!Zi(t)||!Zi(i))return Promise.reject("failedLoginForCatch");let n=await e.users.select({account:t});if(0===Dt(n))return Promise.reject("failedLoginForCatch");let s=n[0];if(!Hp(i,ke(s,"password",""),r))return Promise.reject("failedLoginForCatch");if(!Zi(ke(s,"timeVerified","")))return Promise.reject("userRegistrationNotVerified");let o=ke(s,"timeExpired","");if(Zi(o)&&bl(o)){if(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>o)return Promise.reject("loginAccountExpired")}let a=ke(s,"id",""),c=await x(a);return{id:s.id,account:s.account,name:s.name,email:s.email,description:s.description,from:s.from,redir:s.redir,isAdmin:s.isAdmin,isActive:s.isActive,isForceChangePw:s.isForceChangePw,token:c}},logoutByToken:async t=>{if(!Zi(t))return Promise.reject("tokenExpired");let n=null,r=await e.tokens.select({token:t}),s=Dt(r);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=ke(r,0,""),a=ke(o,"userId",""),c=await e.tokens.del({id:o.id}).catch(e=>{n=e});return n?(console.log(n),console.log("failed to delete token"),Promise.reject("failed to delete token")):(c=ke(c,"0.nDeleted",0),1!==c?(console.log("can not delete the token"),Promise.reject("can not delete the token")):(i.info({event:"fun-logout",token:Xl(t),userId:a}),!0))},checkToken:C,refreshToken:async t=>{if(!Zi(t))return Promise.reject("tokenExpired");let n=null,r=await e.tokens.select({token:t}),o=Dt(r);if(0===o)return console.log("invalid token"),Promise.reject("invalid token");if(o>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let a=ke(r,0,""),c=ke(a,"timeEnd","");if(!bl(c))return console.log("timeEnd",c),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let l=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ");if(l>=c)return console.log("tn",l),console.log("timeEnd",c),console.log("token expired"),Promise.reject("tokenExpired");let u=Tr().add(s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),p=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ");return await Vp(e.tokens,"save",{id:a.id,timeEnd:u,timeUpdate:p}).catch(e=>{n=e}),n?(console.log(n),console.log("can not update timeEnd for token"),i.error({event:"fun-refreshToken-save",token:Xl(t),err:Rn(n)}),Promise.reject("can not update timeEnd for token")):u},getUserByToken:E,checkTokenAndGetUserByToken:async(e,t,i={})=>(await C(e,i),await E(t).catch(()=>null)),getUserInfor:A,checkTokenAndGetUserInfor:async(e,t,i,n={})=>(await C(e,n),await A(t,i)),getUsersList:N,getUsersListCache:async()=>await S.getProxy("fun",{fun:N,inputs:null,timeExpired:3e4}),checkTokenAndGetUsersList:T,checkTokenAndGetActiveUsersList:async(e,t={})=>await T(e,{...t,needActive:!0}),omitUserCredential:e=>{let t={...e};for(let e of ed)delete t[e];return t},updateUsersList:k,checkTokenAndUpdateUsersList:async(e,t,i,n={})=>{await C(e,n),Zi(t)||(t="eng");let r=await E(e),s=ke(r,"id","");if(!rn(i))return Promise.reject("invalidRows");if(!("y"===ke(r,"isApp",""))){let e=null;for(let t of i)if(ke(t,"id","")===s){e=t;break}if(Zi(s)&&!ki(e))return Promise.reject("cannotDeleteSelf");if(ki(e)){if("y"!==ke(e,"isAdmin",""))return Promise.reject("cannotDemoteSelf");if("y"!==ke(e,"isActive",""))return Promise.reject("cannotDisableSelf")}}return await m("updateUsersList",s,async()=>i=await k(i,{lang:t,operatorId:s}))},getTokensList:j,getTokensListCache:async()=>await Z.getProxy("fun",{fun:j,inputs:null,timeExpired:3e4}),checkTokenAndGetTokensList:async(e,t={})=>(await C(e,t),await j()),checkTokenAndUpdateTokensList:async(t,i,n={})=>{await C(t,n);let r=ke(await E(t),"id","");return await m("updateTokensList",r,async()=>(i=await(async t=>{if(!rn(t))return Promise.reject("invalidRows");let i=Object.create(null);ar(await e.tokens.select(),e=>{i[e.id]=JSON.stringify(ke(e,"perms"))});for(let e of t){let t=ke(e,"perms"),n=ke(e,"id","");if(!(sr(i,n)&&i[n]===JSON.stringify(t)||Jp(t)))return Promise.reject("tokenPermsInvalid")}return t=Yr(t,e=>({...e,perms:qp(ke(e,"perms"))})),await L("tokens",t,"id",{resetOrder:!1,ocList:Z})})(i),i))},getIpsList:z,getIpsListCache:async()=>await Y.getProxy("fun",{fun:z,inputs:null,timeExpired:3e4}),checkTokenAndGetIpsList:async(e,t={})=>(await C(e,t),await z()),checkTokenAndUpdateIpsList:async(e,t,i={})=>{await C(e,i);let n=ke(await E(e),"id","");return await m("updateIpsList",n,async()=>t=await(async e=>await L("ips",e,"id",{resetOrder:!1,ocList:Y}))(t))}};return X}let nd={csIng:{eng:"Connecting...",cht:"連線中..."},csLogin:{eng:"Logged in",cht:"已登入"},csLogout:{eng:"Logged out",cht:"已登出"},csErrConn:{eng:"Unable to connect",cht:"無法連線"},csErrLogin:{eng:"Login denied",cht:"拒絕登入"},aggridLanguage:{eng:"en",cht:"zh-tw"},id:{eng:"ID",cht:"主鍵"},systemMessage:{eng:"System message",cht:"系統確認訊息"},ok:{eng:"OK",cht:"確認"},no:{eng:"No",cht:"取消"},yes:{eng:"Yes",cht:"確定"},y:{eng:"Yes",cht:"是"},n:{eng:"No",cht:"否"},empty:{eng:"Empty",cht:"無"},to:{eng:"To",cht:"至"},at:{eng:"At",cht:"於"},unknow:{eng:"Unknown",cht:"未知"},waitingData:{eng:"Waiting data...",cht:"等待數據中..."},saveChanges:{eng:"Save changes",cht:"儲存變更"},from:{eng:"From",cht:"來源"},save:{eng:"Save",cht:"儲存"},close:{eng:"Close",cht:"關閉"},send:{eng:"Send",cht:"送出"},cancel:{eng:"Cancel",cht:"取消"},processing:{eng:"Processing...",cht:"處理中請稍後..."},anUnexpectedErrorOccurred:{eng:"An unexpected error occurred, please contact the administrator",cht:"發生非預期錯誤,請洽管理員"},getDataError:{eng:"Failed to get data, please try again later",cht:"取得數據失敗,請稍後再試"},timeCreate:{eng:"Created time",cht:"創建時間"},userIdUpdate:{eng:"ID of the updated user",cht:"最新變更使用者主鍵"},timeUpdate:{eng:"Updated time",cht:"最新變更時間"},userId:{eng:"ID of the user",cht:"使用者主鍵"},account:{eng:"Account",cht:"帳號"},password:{eng:"Password",cht:"密碼"},toggleToShowPassword:{eng:"To show password",cht:"變更為顯示密碼模式"},toggleToHidePassword:{eng:"To hide password",cht:"變更為隱藏密碼模式"},username:{eng:"Username",cht:"使用者姓名"},email:{eng:"Email",cht:"電子郵件"},name:{eng:"Name",cht:"名稱"},description:{eng:"Description",cht:"說明"},redir:{eng:"Redirect",cht:"登入後轉至網址"},login:{eng:"Log in",cht:"登入"},logout:{eng:"Log out",cht:"登出"},menuTreeShow:{eng:"Show menu",cht:"顯示選單"},menuTreeHide:{eng:"Hide menu",cht:"隱藏選單"},menuUser:{eng:"User menu",cht:"使用者選單"},language:{eng:"Language",cht:"語系"},mmStaInfor:{eng:"Statistics information",cht:"統計資訊"},mmUserInfor:{eng:"User information",cht:"使用者資訊"},mmUsersList:{eng:"Users list",cht:"使用者清單"},mmUsersListMsg:{eng:"Provide a list of users, which can be added, edited, deleted, etc.",cht:"提供目前使用者資料清單,可進行新增、編輯、刪除等作業。"},mmTokensList:{eng:"Tokens list",cht:"金鑰清單"},mmTokensListMsg:{eng:"Provide a list of tokens, which can be deleted, etc.",cht:"提供目前金鑰資料清單,可進行強制登出等作業。"},mmIpsList:{eng:"Ips list",cht:"IP清單"},mmIpsListMsg:{eng:"Provide a list of IPs, which can be blocked, etc.",cht:"提供目前存取IP清單,可進行封鎖等作業。"},failedLoginForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLoginForNoToken:{eng:"Can not get the token",cht:"無有效金鑰"},failedLoginForNoRedir:{eng:"Can not get the url for redirection",cht:"無有效轉址"},failedLoginForCatch:{eng:"User account or password is incorrect",cht:"使用者帳密錯誤無法登入"},failedLogoutForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLogoutForCatch:{eng:"Can not logout",cht:"使用者登出失敗"},userStatus:{eng:"Status",cht:"帳號狀態"},isVerified:{eng:"Verified",cht:"帳號是否驗證"},isVerifiedY:{eng:"Verified",cht:"帳號已驗證"},isVerifiedN:{eng:"Not verified",cht:"帳號未驗證"},userTimeVerified:{eng:"Verified time",cht:"帳號驗證狀態與時間"},isVerifiedWaiting:{eng:"Waiting for verification",cht:"等待驗證中"},isExpired:{eng:"Expired",cht:"帳號是否過期"},isExpiredY:{eng:"Expired",cht:"帳號已過期"},isExpiredN:{eng:"Not expired",cht:"帳號未過期"},userTimeExpired:{eng:"Expired time",cht:"帳號過期狀態與時間"},isExpiredDeny:{eng:"Account login prohibited",cht:"禁止帳號登入"},isExpiredNever:{eng:"Never expires",cht:"永不過期"},isBlocked:{eng:"Blocked",cht:"帳號是否被封鎖"},isBlockedY:{eng:"Blocked",cht:"帳號已封鎖"},isBlockedN:{eng:"Not blocked",cht:"帳號未封鎖"},userTimeBlocked:{eng:"Blocked time",cht:"帳號封鎖狀態與時間"},isBlockedNormalStatus:{eng:"Normal status",cht:"狀態正常"},isAdmin:{eng:"Administrator",cht:"是否為系統管理者"},userRole:{eng:"Role",cht:"角色"},userRoleAdmin:{eng:"Administrator",cht:"系統管理者"},userRoleGeneral:{eng:"General",cht:"一般使用者"},isActive:{eng:"Active",cht:"帳號是否有效"},isActiveY:{eng:"Active",cht:"帳號有效"},isActiveMsgY:{eng:"Enabling",cht:"啟用中"},isActiveN:{eng:"Inactive",cht:"帳號無效"},isActiveMsgN:{eng:"Deactivated",cht:"已停用"},errInAccounts:{eng:"Account errors",cht:"帳號出現錯誤待修復"},errItemsByRedir:{eng:"Redirect errors",cht:"登入後轉址出現錯誤待修復"},modeEdit:{eng:"Edit mode",cht:"編輯模式"},showTabCols:{eng:"Show columns",cht:"顯示欄位"},selectDate:{eng:"Select date",cht:"請選擇日期"},dtPickerYear:{eng:"y",cht:"年"},dtPickerMonth:{eng:"m",cht:"月"},dtPickerWeekdays:{eng:"Su,Mo,Tu,We,Th,Fr,Sa",cht:"日,一,二,三,四,五,六"},userName:{eng:"Name of user",cht:"使用者名稱"},userAccountEmpty:{eng:"Invalid account of user",cht:"尚未給予有效使用者帳號"},userAccountDuplicate:{eng:"Duplicate account of user",cht:"使用者帳號出現重複"},userEmailEmpty:{eng:"Empty email of user",cht:"尚未給予使用者Email"},userEmailError:{eng:"Invalid email of user",cht:"使用者Email格式錯誤"},userEmailDuplicate:{eng:"Duplicate email of user",cht:"使用者Email出現重複"},userRedirEmpty:{eng:"Invalid redirect of user",cht:"尚未給予有效登入後轉址"},userPasswordEmpty:{eng:"Empty password of user",cht:"尚未給予使用者密碼"},userAddEmpty:{eng:"No user",cht:"尚未新增使用者資料"},userAdd:{eng:"Add user",cht:"新增使用者"},userAddNameNew:{eng:"New user",cht:"新使用者"},userAddIdNew:{eng:"Waiting generation",cht:"待自動給予"},userCopy:{eng:"Copy user",cht:"複製使用者"},userCopyNameNew:{eng:"copy",cht:"複製"},userDeleteCheckUsers:{eng:"Delete user(s)",cht:"刪除勾選使用者"},userResetPassword:{eng:"Reset password",cht:"重設密碼"},userSaveUsersFail:{eng:"Failed to save users",cht:"儲存使用者數據失敗"},userSaveUsersSuccess:{eng:"Save users successfully",cht:"儲存使用者數據成功"},userEditNoUserId:{eng:"Can not find the id of user",cht:"無法找到使用者Id"},userEditNoUserData:{eng:"Can not find the data of user",cht:"無法找到使用者數據"},userPassword_keyInvalidPassword:{eng:"Invalid password",cht:"密碼非有效字串"},userPassword_keyLimNumLenMinOrMax:{eng:"The minimum password length is greater than the maximum length",cht:"設定密碼最小長度大於最大長度"},userPassword_keyLimHasSpace:{eng:"Password must not contain whitespace characters",cht:"密碼不可包含空白字元"},userPassword_keyLimNonAsciiChar:{eng:"Password may only contain ASCII printable characters (letters, digits, symbols)",cht:"密碼僅允許使用英文大小寫、數字及特殊符號"},userPassword_keyLimNumLenMin:{eng:"Password length must be at least {minLength} characters",cht:"密碼長度須大於等於{minLength}個字元"},userPassword_keyLimNumLenMax:{eng:"Password length must not exceed {maxLength} characters",cht:"密碼長度須小於等於{maxLength}個字元"},userPassword_keyLimRequireLetter:{eng:"Password must contain at least one letter",cht:"密碼須包含至少一個英文字母"},userPassword_keyLimRequireUppercase:{eng:"Password must contain at least one uppercase letter",cht:"密碼須包含至少一個大寫英文字母"},userPassword_keyLimRequireLowercase:{eng:"Password must contain at least one lowercase letter",cht:"密碼須包含至少一個小寫英文字母"},userPassword_keyLimRequireDigit:{eng:"Password must contain at least one digit",cht:"密碼須包含至少一個數字"},userPassword_keyLimRequireSpecial:{eng:"Password must contain at least one special character",cht:"密碼須包含至少一個特殊符號"},userPassword_keyLimForbiddenChar:{eng:"Password must not contain forbidden characters",cht:"密碼不可包含禁止字元"},userPassword_keyLimCommonPassword:{eng:"This password is too common and not allowed",cht:"此密碼為常見弱密碼,不允許使用"},userPassword_keyLimConsecutiveCharsFromAccount:{eng:"Password must not contain {consecutiveCharsMinMatch} or more consecutive characters from your account name",cht:"密碼不可包含與帳號相同之{consecutiveCharsMinMatch}個以上連續字元"},userChangePassword:{eng:"Change Password",cht:"變更密碼"},userChangePasswordOldPassword:{eng:"Old password",cht:"舊密碼"},userChangePasswordNewPassword:{eng:"New password",cht:"新密碼"},userChangePasswordConfirmPassword:{eng:"Confirm password",cht:"確認新密碼"},userChangePasswordForNoOldPassword:{eng:"Please enter old password",cht:"尚未給予舊密碼"},userChangePasswordForNoNewPassword:{eng:"Please enter new password",cht:"尚未給予新密碼"},userChangePasswordForNoConfirmPassword:{eng:"Please enter confirm password",cht:"尚未給予確認密碼"},userChangePasswordNotSame:{eng:"New password and confirm password do not match",cht:"新密碼與確認密碼不一致"},userChangePasswordSuccess:{eng:"Password change successful, please log in again.",cht:"密碼變更成功,請使用新密碼重新登入。"},userChangePasswordFail:{eng:"Password change failed.",cht:"密碼變更失敗,請確認輸入密碼是否正確"},userChangePasswordIncorrectOld:{eng:"The old password is incorrect.",cht:"舊密碼不正確。"},userChangePasswordForNetError:{eng:"Password validation failed. Please try again later.",cht:"密碼檢測失敗,請稍後再試"},userRegistration:{eng:"Register",cht:"申請帳號"},userRegistrationName:{eng:"Name",cht:"姓名"},userRegistrationEmail:{eng:"Email",cht:"電子郵件"},userRegistrationConfirmPassword:{eng:"Confirm password",cht:"確認密碼"},userRegistrationSubmit:{eng:"Submit",cht:"送出申請"},userRegistrationSuccess:{eng:"Registration successful. Please check your email to verify your account.",cht:"帳號申請成功,請至信箱收取驗證信以啟用帳號。"},userRegistrationNotAllowed:{eng:"User registration is not available.",cht:"目前不開放使用者自行申請帳號。"},userRegistrationFailed:{eng:"Registration failed. Please try again later.",cht:"帳號申請失敗,請稍後再試。"},userRegistrationAccountInvalid:{eng:"Please enter a valid account.",cht:"請輸入有效的帳號。"},userRegistrationEmailFormatInvalid:{eng:"Please enter a valid email address.",cht:"請輸入有效的電子郵件格式。"},userRegistrationNameInvalid:{eng:"Please enter a valid name.",cht:"請輸入有效的姓名。"},userRegistrationAccountExists:{eng:"This account already exists.",cht:"此帳號已存在。"},userRegistrationEmailExists:{eng:"This email already exists.",cht:"此電子郵件已存在。"},userRegistrationBackToLogin:{eng:"Back to login",cht:"返回登入"},userRegistrationNotVerified:{eng:"Your account has not been verified. Please check your email and click the verification link.",cht:"您的帳號尚未完成 email 驗證,請至信箱點擊驗證連結。"},userRegistrationResendVerify:{eng:"Resend verification email",cht:"重寄驗證信"},userRegistrationResendSuccess:{eng:"Verification email has been resent. Please check your inbox.",cht:"驗證信已重新寄出,請至信箱收取。"},userRegistrationAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationResendSubmit:{eng:"Send verification email",cht:"寄送驗證信"},userRegistrationResendInvalidEmail:{eng:"The email address does not match the account. Please check and try again.",cht:"電子郵件與帳號不符,請確認後再試。"},userRegistrationResendFailed:{eng:"Failed to send verification email. Please try again later.",cht:"驗證信寄送失敗,請稍後再試。"},userRegistrationResendThrottled:{eng:"A verification email was just sent. Please wait a moment before trying again.",cht:"剛才已寄出驗證信,請稍候片刻再試。"},verifyEmailInvalidToken:{eng:"Invalid or expired verification link.",cht:"驗證連結無效或已失效。"},verifyEmailAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},verifyEmailFailed:{eng:"Email verification failed. Please click the verification link again later.",cht:"電子郵件驗證失敗,請稍後再點一次驗證連結。"},userRegistrationVerifySuccess:{eng:"Email verified successfully. Please log in.",cht:"電子郵件驗證成功,請登入。"},loginAccountBlocked:{eng:"Your account has been temporarily locked due to multiple failed login attempts. Please try again later.",cht:"您的帳號因多次登入失敗已被暫時鎖定,請稍後再試。"},loginAccountExpired:{eng:"Your account has expired. Please contact the administrator.",cht:"您的帳號已過期,請聯繫管理員。"},loginUnknownError:{eng:"An unexpected error occurred during login. Please try again later.",cht:"登入時發生未預期的錯誤,請稍後再試。"},tokenExpired:{eng:"Your session has expired. Please log in again.",cht:"登入逾時,請重新登入。"},tokenNoPermission:{eng:"Token does not have permission.",cht:"權杖無存取權限。"},invalidUserQueryKey:{eng:"Invalid query field. Please use id, account, email or name.",cht:"查詢欄位無效,請使用 id、account、email 或 name。"},invalidUrl:{eng:"Invalid url.",cht:"網址無效。"},invalidTokenSelf:{eng:"Invalid self token.",cht:"自身權杖無效。"},invalidTokenTar:{eng:"Invalid target token.",cht:"目標權杖無效。"},invalidUserIdTar:{eng:"Invalid target user id.",cht:"目標使用者 Id 無效。"},noTokenKeyValueInUrl:{eng:"Missing token={sysToken}, key=token or value={token} in url.",cht:"網址缺少 token={sysToken}、key=token 或 value={token}。"},noTokenKeyUserIdInUrl:{eng:"Missing token={sysToken}, key=id or value={userId} in url.",cht:"網址缺少 token={sysToken}、key=id 或 value={userId}。"},noTokenInUrl:{eng:"Missing token={sysToken} in url.",cht:"網址缺少 token={sysToken}。"},cannotGetUserByUrl:{eng:"Cannot get user by url.",cht:"無法由網址取得使用者。"},cannotGetUsersByUrl:{eng:"Cannot get users by url.",cht:"無法由網址取得使用者清單。"},cannotGetUserDataByUrl:{eng:"Cannot get user data by url.",cht:"無法由網址取得使用者資料。"},cannotGetUsersDataByUrl:{eng:"Cannot get users data by url.",cht:"無法由網址取得使用者清單資料。"},noUserDataByUrl:{eng:"No user data by url.",cht:"該網址無使用者資料。"},noUsersDataByUrl:{eng:"No users data by url.",cht:"該網址無使用者清單資料。"},noUserDataAfterConvert:{eng:"No user data after conversion.",cht:"轉換後無使用者資料。"},invalidRows:{eng:"Invalid data format.",cht:"資料格式錯誤。"},htmlMarkupNotAllowed:{eng:'The input contains HTML markup that is not allowed (such as "<" followed by a letter). Please remove it and try again.',cht:"輸入內容含有不允許的 HTML 標記(如「<」後接英文字母),請移除後再試一次。"},accountRequired:{eng:"Account is required.",cht:"帳號為必填。"},accountDuplicate:{eng:"Account already exists.",cht:"帳號已存在。"},getStaDataFailed:{eng:"Failed to retrieve statistics data.",cht:"統計資料取得失敗。"},token:{eng:"Token",cht:"金鑰"},isApp:{eng:"For app",cht:"是否為應用系統金鑰"},tokenTimeCreate:{eng:"Created time",cht:"金鑰創建時間"},tokenTimeEnd:{eng:"End time",cht:"金鑰到期時間"},tokenTimeUpdate:{eng:"Updated time",cht:"金鑰更新時間"},tokenDeleteCheckTokens:{eng:"Delete checked token(s)",cht:"刪除勾選金鑰"},tokenSaveTokensFail:{eng:"Failed to save tokens",cht:"儲存金鑰數據失敗"},tokenSaveTokensSuccess:{eng:"Save tokens successfully",cht:"儲存金鑰數據成功"},tokenPerms:{eng:"App permissions",cht:"應用系統權限"},tokenPermsBase:{eng:"Basic permission, always granted",cht:"基本權限,恆具備"},tokenPermsHigh:{eng:"Equivalent to administrator",cht:"等同管理者權限"},tokenPermsInvalid:{eng:"Invalid app token permissions.",cht:"應用系統金鑰權限設定無效。"},appPerm_readUsers:{eng:"Read users",cht:"讀使用者"},appPerm_writeUsers:{eng:"Write users",cht:"寫使用者"},appPerm_readTokens:{eng:"Read tokens",cht:"讀金鑰"},appPerm_writeTokens:{eng:"Write tokens",cht:"寫金鑰"},appPerm_readIps:{eng:"Read IPs",cht:"讀IP"},appPerm_writeIps:{eng:"Write IPs",cht:"寫IP"},appPerm_readStats:{eng:"Read statistics",cht:"讀統計"},ip:{eng:"IP",cht:"IP"},ipTimeBlocked:{eng:"Blocked time",cht:"IP封鎖時間"},ipDeleteCheckIps:{eng:"Delete checked IP(s)",cht:"刪除勾選IP"},ipSaveIpsFail:{eng:"Failed to save IPs",cht:"儲存IP數據失敗"},ipSaveIpsSuccess:{eng:"Save IPs successfully",cht:"儲存IP數據成功"},statisticsInformation:{eng:"Statistics Information",cht:"統計資訊"},statisticsInformationDescription:{eng:"Provides an overview of system usage and security metrics.",cht:"提供系統使用情況和安全指標的總覽。"},userGroupInfor:{eng:"User Information",cht:"使用者資訊區"},totalUsers:{eng:"Total Users",cht:"總使用者"},activeUsers:{eng:"Active Users",cht:"活躍使用者"},blockedUsers:{eng:"Blocked Users",cht:"已封鎖使用者"},expiredUsers:{eng:"Expired Users",cht:"已過期使用者"},accessActivityMonitoring:{eng:"Access Activity Monitoring",cht:"存取活動監測"},userLoginFrequency:{eng:"User Login Frequency",cht:"使用者登入頻率"},last7Days:{eng:"Last 7 days",cht:"最近7天"},tokenUsageFrequency:{eng:"Token Usage Frequency",cht:"金鑰使用頻率"},ipConnectionFrequency:{eng:"IP Connection Frequency",cht:"IP 連線頻率"},controlStatus:{eng:"Control Status",cht:"管控狀態"},tokenCharacteristic:{eng:"Token Characteristic",cht:"金鑰狀態"},activeTokens:{eng:"Active Tokens",cht:"有效金鑰數量"},createdLast24h:{eng:"Created in last 24h",cht:"最近24小時內創建"},endingNext24h:{eng:"Ending in next 24h",cht:"未來24小時內到期"},endedTokens:{eng:"Ended Tokens",cht:"已到期金鑰數量"},ipCharacteristic:{eng:"IP Characteristic",cht:"IP狀態"},conn24h:{eng:"Connections in last 24h",cht:"最近24小時內連線數量"},blockedIps:{eng:"Blocked IPs",cht:"當前已封鎖IP數量"},selectItem1hr:{eng:"1 hour",cht:"1小時"},selectItem4hr:{eng:"4 hour",cht:"4小時"},selectItem8hr:{eng:"8 hour",cht:"8小時"},selectItem1day:{eng:"1 day",cht:"1日"},countAttempt:{eng:"Attempt",cht:"嘗試登入"},countSuccess:{eng:"Success",cht:"登入成功"},countError:{eng:"Error",cht:"登入失敗"},count:{eng:"Count",cht:"總次數"},showIndividually:{eng:"Show individually",cht:"個別顯示"},numberOrder:{eng:"No.",cht:"排序"},total:{eng:"Total",cht:"總計"},last1Day:{eng:"Last 1 day",cht:"最近1天"},last8Hour:{eng:"Last 8 hour",cht:"最近8小時"},last4Hour:{eng:"Last 4 hour",cht:"最近4小時"},last1Hour:{eng:"Last 1 hour",cht:"最近1小時"},showMax5:{eng:"Show max 5 rows",cht:"顯示前5筆"},showAll:{eng:"Show all",cht:"顯示全部"},regVerifyEmTitle:{eng:"Please verify your email",cht:"請驗證您的電子郵件"},regVerifyEmContent:{eng:'Dear {name},<br><br>Thank you for registering at {sender}.<br><br>Please click the link below to verify your email and activate your account:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>If you did not register, please ignore this email.<br><br>This is an automated notification. Please do not reply.',cht:'{name} 您好:<br><br>感謝您註冊「{sender}」。<br><br>請點擊以下連結以驗證您的電子郵件並啟用帳號:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>若您未曾進行此操作,請忽略此信。<br><br>此為系統自動通知信件,請勿直接回覆。'},chpwEmTitle:{eng:"Password has been changed",cht:"密碼已進行變更"},chpwEmContent:{eng:"Dear User {name},<br><br>This is to inform you that the password for your {sender} account has been successfully changed.<br><br>If you did not perform this action or have any concerns regarding your account security, please contact the system administrator as soon as possible to ensure the safety of your account.<br><br>This is an automated system notification. Please do not reply to this email.",cht:"使用者 {name} 您好:<br><br>您於「{sender}」的密碼已成功變更。<br><br>若您未曾進行此操作,或對帳號安全有任何疑慮,請您儘速聯絡系統管理單位,以確保帳號安全。<br><br>此為系統自動通知信件,請勿直接回覆。"},resetPwEmTitle:{eng:"Your password has been reset",cht:"您的密碼已被重設"},resetPwEmContent:{eng:"Dear {name},<br><br>The administrator has reset the password for your {sender} account.<br><br>Account: {account}<br>New password: <strong>{newPassword}</strong><br><br>Please log in with this password and immediately set your own new password upon login.<br><br>If you did not expect this change, please contact the administrator.<br><br>This is an automated notification.",cht:"使用者 {name} 您好:<br><br>管理員已重設您於「{sender}」的密碼。<br><br>帳號:{account}<br>新密碼:<strong>{newPassword}</strong><br><br>請以此密碼登入後,立即變更為您自己的新密碼。<br><br>若非您預期之操作,請聯繫管理員。<br><br>此為系統自動通知信件。"},adminResetPasswordConfirm:{eng:"Confirm to reset password for {account}?",cht:"確定對 {account} 重設密碼?"},adminResetPasswordSuccess:{eng:"Password reset and new password sent to {email}",cht:"已重設並寄送新密碼至 {email}"},adminResetPasswordCannotResetSelf:{eng:"Cannot reset your own password via this action",cht:"不可對自己重設密碼"},adminResetPasswordForbidden:{eng:"Forbidden: admin permission required",cht:"權限不足:須具管理員身分"},adminResetPasswordUserNotFound:{eng:"User not found",cht:"查無使用者"},adminResetPasswordFailed:{eng:"Failed to reset password",cht:"重設密碼失敗"},adminResetPasswordAlreadyTriggered:{eng:"A password reset was just triggered. Please wait a moment before trying again.",cht:"剛才已觸發重設密碼,請稍候片刻再試。"},userForceChangePwPrompt:{eng:"Your password has been reset by the administrator. Please change it to your own new password.",cht:"您的密碼已由管理員重設,請按確認後變更為您自己的新密碼。"},cannotDemoteSelf:{eng:"Cannot demote yourself from admin",cht:"不可解除自己的管理員權限"},cannotDisableSelf:{eng:"Cannot disable yourself",cht:"不可停用自己的帳號"},cannotDeleteSelf:{eng:"Admin cannot delete yourself",cht:"管理員不得刪除自己"},saveInProgress:{eng:"The previous save is still in progress. Please do not submit again.",cht:"上一次儲存仍在處理中,請勿重複送出"},saveNewRowExists:{eng:"The newly added data has already been saved. Please reload the page before making changes.",cht:"新增之資料已儲存過,請重新整理頁面後再操作"},saveWriteFail:{eng:"Not all changes were written, and some may have taken effect. Please reload the page and check before making changes.",cht:"資料寫入未全部完成,部分變更可能已生效,請重新整理頁面確認後再操作"}},rd=(e={})=>{let t=ke(e,"kpLangExtEmail");ki(t)||(t={});let i=ke(e,"kpLangExt");ki(i)||(i={});let n=ke(e,"webName");ki(n)||(n={});let r=ke(e,"webDescription");ki(r)||(r={});let s={};s={...s,...nd},ki(t)&&ar(t,(e,t)=>{s[t]={...ke(s,t,{}),...e}}),ki(i)&&(s={...s,...i}),ki(n)&&(s={...s,webName:{...n}}),ki(r)&&(s={...s,webDescription:{...r}});let o={};return ar(["eng","cht"],e=>{let t={};ar(s,(i,n)=>{t[n]=i[e]}),o[e]=t}),o},sd=Symbol("wrapTimer");function od(e,t,i=null){if(!Mn(t))throw new Error(`invalid fn of timer[${e}]`);let n=!1,r=async()=>{if(!n){n=!0;try{await t()}catch(t){if(Mn(i))try{await i({timer:e,err:t})}catch(e){}}finally{n=!1}}};return r[sd]=e,r}let ad=/^(\d{1,3}(?:\.\d{1,3}){3}):(\d{1,5})$/,cd=/^\[([^[\]]+)\]:(\d{1,5})$/;function ld(e,t,i={}){let{srLog:n,minForAccountLoginFailed:r,numForAccountLoginFailed:s,minBlockForAccountLoginFailed:o,minForTokenCallApi:a,numForTokenCallApi:c,minBlockForTokenCallApi:l,minForIpCallApi:u,numForIpCallApi:p,minBlockForIpCallApi:d}=i,m=e=>{n&&Mn(n.error)&&n.error(e)},h=({timer:e,err:t})=>{m({event:"timer-error",timer:e,err:Rn(t)})},f=()=>Object.create(null),g=(e,t,i,n)=>{if(e[t]!==i)return null;let r=i.filter(e=>e>=n);return 0===Dt(r)?delete e[t]:e[t]=r,r},w=f(),y=async e=>{if(!ki(e))return Promise.reject("invalid u");let t=ke(e,"timeBlocked","");if(bl(t)){return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},M=async e=>{let i=await t.getGenUserByAccount(e);return await y(i)};setInterval(od("accountLoginFailedPrune",async()=>{let e=Tr().add(-r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(w,async(t,i)=>{g(w,i,t,e)})},h),2e3);let D=f(),x=async e=>{let t=D[e];return void 0===t&&(t=[]),t};setInterval(od("tokenCallApi",async()=>{let i=Tr().add(-a,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(D,async(r,s)=>{let o=g(D,s,r,i);null!==o&&Dt(o)>c&&await(async i=>{let r=await t.getTokenByKV("token",i);if("y"===ke(r,"isApp",""))return void(n&&Mn(n.debug)&&n.debug({event:"fun-blockAccountByToken",key:"appTokenSkipRateLimit",token:Xl(i)}));let s=ke(r,"userId","");if(!Zi(s))return Promise.reject("invalid userId");let o=await t.getGenUserByUserId(s);if(await y(o))return;let a=Tr().add(l,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),c=null;await Vp(e.users,"save",{id:o.id,timeBlocked:a}).catch(e=>{c=e});let u=null;return await t.revokeTokensByUserId(o.id).catch(e=>{u=e}),null!==c||null!==u?(m({event:"fun-blockAccountByToken",userId:o.id,token:Xl(i),errBlock:null!==c?Rn(c):"",errRevoke:null!==u?Rn(u):""}),Promise.reject("failed to block account by token")):void 0})(s).catch(e=>{console.log(e)})})},h),2e3);let I=f(),C=null,b=0,v=async e=>{if(!ki(e))return Promise.reject("invalid oip");let t=ke(e,"timeBlocked","");if(bl(t)){return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},L=async e=>{let t=I[e];return void 0===t&&(t=[]),t};setInterval(od("ipDetectNew",async()=>{let i=await t.getIpsList(),n=Object.keys(I),r=f();ar(i,e=>{let t=e.ip;r[t]=!0});let s=f();ar(n,e=>{s[e]=!0});let o=[];for(let e of Object.keys(s))sr(r,e)||o.push(e);let a=Yr(o,e=>xl.ips.funNew({ip:e}));await e.ips.insert(a)},h),2e3),setInterval(od("ipCallApi",async()=>{let i=Tr().add(-u,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(I,async(n,r)=>{let s=g(I,r,n,i);null!==s&&Dt(s)>p&&await(async i=>{let n=null,r=()=>Tr().add(d,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),s=null;if(await t.getIpByKV("ip",i).then(e=>{s=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?s=null:n=t}),null!==n)return Promise.reject(n);if(null===s){let t=r();return s=xl.ips.funNew({ip:i,timeBlocked:t}),await e.ips.insert(s).catch(e=>{n=e}),null!==n?(m({event:"fun-blockIpByIp",ip:i,err:Rn(n)}),Promise.reject(n)):void 0}if(await v(s))return;let o=r(),a=null;return await Vp(e.ips,"save",{id:s.id,timeBlocked:o}).catch(e=>{a=e}),null!==a?(m({event:"fun-blockIpByIp",ip:i,err:Rn(a)}),Promise.reject(a)):void 0})(r).catch(e=>{console.log(e)})})},h),2e3);let A={loginByAccountAndPassword:async(i,n)=>{let a=!1;try{a=await M(i)}catch(e){return Promise.reject("failedLoginForCatch")}if(a)return Promise.reject("failedLoginForCatch");let c=null;return await t.loginByAccountAndPassword(i,n).then(e=>{c={state:"success",msg:e},delete w[i]}).catch(async n=>{w[i]||(w[i]=[]),w[i].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"));let a=Tr().add(-r,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),l=w[i].filter(e=>e>=a);w[i]=l,Dt(l)>s&&await(async i=>{let n=await t.getGenUserByAccount(i);if(await y(n))return;let r=Tr().add(o,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),s=null;await Vp(e.users,"save",{id:n.id,timeBlocked:r}).catch(e=>{s=e});let a=null;return await t.revokeTokensByUserId(n.id).catch(e=>{a=e}),null!==s||null!==a?(m({event:"fun-blockAccount",userId:n.id,errBlock:null!==s?Rn(s):"",errRevoke:null!==a?Rn(a):""}),Promise.reject("failed to block account")):void 0})(i).catch(e=>{console.log(e)}),c={state:"error",msg:n}}),"success"===c.state?c.msg:Promise.reject(c.msg)},cleanKpAccountLoginFailed:async()=>{w=f()},cleanKpIpCallApi:async()=>{I=f()},getKpKeyCounts:async()=>({accountLoginFailed:Object.keys(w).length,tokenCallApi:Object.keys(D).length,ipCallApi:Object.keys(I).length}),getBlockedByAccount:M,getBlockedByIp:async e=>{let i=null;if(!Zi(e))return Promise.reject("invalid ip");let n=null;return await t.getIpByKV("ip",e).then(e=>{n=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?n=null:i=t}),null!==i?Promise.reject(i):null!==n&&await v(n)},callApiByToken:async e=>{D[e]||(D[e]=[]),D[e].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByTokenCallApi:x,getCountsByTokenCallApi:async e=>Dt(await x(e)),getIpByHeaders:e=>{let t=ke(e,"headers"),i="",r="";if(!Zi(i)){let e=ke(t,"x-forwarded-for","");if(i=ke(ts(e,","),0,""),i=es(i),Zi(i)){let e=(e=>{let t=e;if(0===E.isIP(e)){t="";let i=ad.exec(e),n=cd.exec(e),r=i||n;r&&Number(r[2])<=65535&&E.isIP(r[1])===(i?4:6)&&(t=r[1])}return t.length>64?"":t})(i);Zi(e)||(r=i),i=e}}return Zi(i)||e&&e.info&&e.info.remoteAddress&&(i=e.info.remoteAddress,i=es(i)),Zi(i)||e&&e.socket&&e.socket.remoteAddress&&(i=e.socket.remoteAddress,i=es(i)),Zi(i)||e&&e.connection&&e.connection.remoteAddress&&(i=e.connection.remoteAddress,i=es(i)),""!==r&&((e,t)=>{if(!n||!Mn(n.warn))return;let i=Date.now();if(null!==C){if(i<C)return C=i,void b++;if(i-C<1e4)return void b++}let r=b;C=i,b=0;try{let i=n.warn({event:"fun-getIpByHeaders",key:"invalidForwardedFor",len:e.length,preview:Yl(e.slice(0,64)),ip:t,suppressed:r});i&&Mn(i.catch)&&i.catch(()=>{})}catch(e){}})(r,i),Zi(i)||(console.log("headers(keys)",Object.keys(t||{})),console.log("can not get ip of user")),i},callApiByIp:async e=>{I[e]||(I[e]=[]),I[e].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByIpCallApi:L,getCountsByIpCallApi:async e=>Dt(await L(e))};return A}function ud(i,n=1){return function(e,t=1,i={}){let n=1,r=ke(i,"path"),s=ke(i,"fs");if(!An(e,{fs:s}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&nn(t)&&(t=tn(t))<1&&(t=1),function e(i){let o=[];return An(i,{fs:s})?(ar(s.readdirSync(i),function(a){let c=r.resolve(i,a),l=null;try{l=s.statSync(c)}catch(e){}l&&l.isDirectory()?(o.push({isFolder:!0,level:n,path:c,name:r.basename(c)}),n+=1,(n<=t||null===t)&&(o=o.concat(e(c))),n-=1):o.push({isFolder:!1,level:n,path:c,name:r.basename(c)})}),o):o}(e)}(i,n,{path:e,fs:t})}let pd=new Map,dd=new Map;function md(e,i,n){let r=ud(e);r=r.filter(e=>!ke(e,"isFolder",!1)),r=function(e,t,i){let n=t.format(i);return Yp(e,e=>{let t=ke(e,"name","").replace(/\.log$/,"");return!/^\d{4}-\d{2}-\d{2}/.test(t)||t>=n.slice(0,t.length)})}(r,i,n);let s=[];for(let e of r)try{let i=t.statSync(e.path);if(!i.isFile())continue;s.push({path:e.path,name:e.name,size:i.size,mtimeMs:i.mtimeMs})}catch(e){}return s}function hd(e){let t=new Map;return i=>{let n=Math.floor(i/6e4),r=t.get(n);return void 0===r&&(r=Tr(6e4*n).format(e),t.set(n,r)),r}}async function fd(e,i,n,r=null){Mn(r)||(r=hd(n));let s={minTimeMs:null,token:{},ip:{},login:{}};return await function(e,i){return new Promise((n,r)=>{let s=null,o=t.createReadStream(e,{encoding:"utf8"}),a=A.createInterface({input:o,crlfDelay:1/0});a.on("line",i);let c=e=>{s=e,a.close()};o.on("error",c),a.on("error",c),o.on("close",()=>{s?r(s):n()})})}(e,e=>{let t=null;try{t=JSON.parse(e)}catch(e){return}if(null===t||"object"!=typeof t)return;let n=t.event,o=0;if("fun-checkToken"===n?o=1:"verifyConn"===n?o=2:"kpfun-loginByAccountAndPassword-before"===n?o=3:"kpfun-loginByAccountAndPassword-success"===n?o=4:"kpfun-loginByAccountAndPassword-error"===n&&(o=5),0===o)return;let a=function(e){return"number"==typeof e?e:Zi(e)?Tr(e).valueOf():NaN}(t.time);if(Number.isNaN(a))return;if((null===s.minTimeMs||a<s.minTimeMs)&&(s.minTimeMs=a),!(a>i))return;let c=r(a);if(1===o){let e=s.token[c];void 0===e&&(e={count:0,kp:Object.create(null)},s.token[c]=e),e.count+=1;let i=t.userId;e.kp[i]=(e.kp[i]||0)+1}else if(2===o){let e=s.ip[c];void 0===e&&(e={count:0,kp:Object.create(null)},s.ip[c]=e),e.count+=1;let i=t.ip;e.kp[i]=(e.kp[i]||0)+1}else{let e=s.login[c];void 0===e&&(e={attempt:0,success:0,error:0},s.login[c]=e),3===o?e.attempt+=1:4===o?e.success+=1:e.error+=1}}),s}async function gd(e,t,i){let n=hd(i),r=[];for(let s of e)try{let e=await fd(s.path,t,i,n);r.push({name:s.name,ok:!0,agg:e})}catch(e){r.push({name:s.name,ok:!1,err:String(ke(e,"message",e))})}return r}function wd(e,t){for(let i in t.token){let n=t.token[i],r=e.token[i];void 0===r&&(r={count:0,kp:Object.create(null)},e.token[i]=r),r.count+=n.count;for(let e in n.kp)r.kp[e]=(r.kp[e]||0)+n.kp[e]}for(let i in t.ip){let n=t.ip[i],r=e.ip[i];void 0===r&&(r={count:0,kp:Object.create(null)},e.ip[i]=r),r.count+=n.count;for(let e in n.kp)r.kp[e]=(r.kp[e]||0)+n.kp[e]}for(let i in t.login){let n=t.login[i],r=e.login[i];void 0===r&&(r={attempt:0,success:0,error:0},e.login[i]=r),r.attempt+=n.attempt,r.success+=n.success,r.error+=n.error}return e}async function yd(t,i={}){let n=!1!==ke(i,"useCache"),r=ke(i,"scanFiles");Mn(r)||(r=gd);let s=ke(i,"srLog",null),o=md(t.fdLog,t.tStart,t.fmt),a=function(e){let t=pd.get(e);return t||(t=new Map,pd.set(e,t)),t}((c=t.fdLog,l=t.fmt,`${e.resolve(c)}|${l}`));var c,l;let u=[],p={};for(let e of o){let i=n?a.get(e.name):void 0;void 0!==i&&i.size===e.size&&i.mtimeMs===e.mtimeMs&&(null===i.minTimeMs||i.minTimeMs>i.scanTStartMs&&i.minTimeMs>t.tStartMs)?p[e.name]=i.agg:u.push(e)}if(n){let e=new Set(o.map(e=>e.name));for(let t of a.keys())e.has(t)||a.delete(t)}let d=[];if(u.length>0){let e=await r(u.map(e=>({path:e.path,name:e.name})),t.tStartMs,t.fmt),i={};for(let t of e)i[t.name]=t;for(let e of u){let r=i[e.name];if(r&&r.ok)p[e.name]=r.agg,n&&a.set(e.name,{size:e.size,mtimeMs:e.mtimeMs,minTimeMs:r.agg.minTimeMs,scanTStartMs:t.tStartMs,agg:r.agg});else{let t=ke(r,"err","no result");d.push({name:e.name,err:t}),n&&a.delete(e.name),s&&Mn(s.warn)&&s.warn({event:"fun-staLogs",key:"staLogsFileSkipped",name:e.name,err:t})}}}let m={token:{},ip:{},login:{}};for(let e of o){let t=p[e.name];t&&wd(m,t)}let h=function(e,t){let i=(e,i,n)=>{let r={};for(let i of t)r[i]=e();for(let e in i)r[e]=n(i[e]);return Object.keys(r).sort().map(e=>({time:e,data:r[e]}))},n=e=>{let t={count:e.count,...e.kp};return t.count=e.count,t};return{token:i(()=>({count:0}),e.token,n),ip:i(()=>({count:0}),e.ip,n),login:i(()=>({attempt:0,success:0,error:0}),e.login,e=>({attempt:e.attempt,success:e.success,error:e.error}))}}(m,t.kpTime);return h.stat={nFiles:o.length,nScanned:u.length,nCached:o.length-u.length,errors:d},h}function Md(t=7,i="hr",n={}){let r=function(e=7,t="hr",i={}){let n=ke(i,"fdLog");Zi(n)||(n="./logs");let r=function(e){return"day"===e?"day":"hr"}(t),s="day"===r?"YYYY-MM-DD":"YYYY-MM-DDTHH",o="day"===r?"day":"hour",a=ke(i,"timeNow"),c="number"==typeof a?Tr(a):Tr(),l=c.subtract(e,"day"),u=l.valueOf(),p=l.startOf(o),d=c.startOf(o),m=[];for(;!p.isAfter(d);)m.push(p.format(s)),p=p.add(1,o);return{fdLog:n,timeInterval:r,fmt:s,unit:o,tStart:l,tStartMs:u,kpTime:m,timeNow:c.valueOf()}}(t,i,n),s=JSON.stringify([e.resolve(r.fdLog),t,r.timeInterval,ke(n,"timeNow",null)]);if(dd.has(s))return dd.get(s);let o=yd(r,n).finally(()=>{dd.delete(s)});return dd.set(s,o),o}function Dd(i={}){let n=i.fpSelf,r=i.cwd||process.cwd(),s=i.pkgName||"w-web-sso",o=i.rel||"server/staLogs/staLogsCore.shellWorker.mjs",a=i.existsSync||t.existsSync,c=i.readFileSync||t.readFileSync,l=i.createRequire||u.createRequire;if("string"!=typeof n||""===n)throw new Error("invalid fpSelf");let p=[],d=function(t,i){let n=t;for(;;){if(i(e.join(n,"package.json")))return n;let t=e.dirname(n);if(t===n)return"";n=t}}(e.dirname(n),a);if(""===d)p.push(`(a) no package.json above ${e.dirname(n)}`);else{let t="";try{t=JSON.parse(c(e.join(d,"package.json"),"utf8")).name}catch(e){}let i=e.join(d,o);if(t!==s)p.push(`(a) ${e.join(d,"package.json")} name[${t}]`);else{if(a(i))return i;p.push(`(a) ${i}`)}}let m=`${s}/${o}`,h=[["b",n],["c",e.join(r,"noop.js")]];for(let[e,t]of h)try{let i=l(t).resolve(m);if(a(i))return i;p.push(`(${e}) ${i}`)}catch(i){p.push(`(${e}) resolve ${m} from ${t}`)}throw new Error(`cannot resolve ${o} of ${s} (the package must be installed with its server folder), tried: ${p.join("; ")}`)}let xd="";function Id(e,t=""){let i=bn();if("string"!=typeof t||""===t)try{""===xd&&(xd=Dd({fpSelf:c.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:N&&"SCRIPT"===N.tagName.toUpperCase()&&N.src||new URL("w-web-sso.umd.js",document.baseURI).href)})),t=xd}catch(e){return i.reject(e),i}let n=new o.Worker(t),r=!1,s=(e,t)=>{r||(r=!0,e(t));try{n.terminate().catch(()=>{})}catch(e){}};return n.on("message",e=>{"done"===e.mode?s(i.resolve,e.payload):"error"===e.mode&&s(i.reject,e.payload)}),n.on("error",e=>{s(i.reject,e)}),n.on("exit",e=>{s(i.reject,new Error(`staLogs worker exited without result, code=${e}`))}),n.postMessage(e),i}async function Cd(e,t,i){return 0===e.length?[]:Id({files:e,tStartMs:t,fmt:i})}function bd(e=7,t="hr",i={}){return Md(e,t,{...i,scanFiles:Cd})}function vd(e,t,i={}){let{srLog:n,logFd:r}=i,s=async()=>{let e=await t.getUsersListCache(),i=Dt(e),n=0;n=Dt(Yp(e,e=>El(e)));let r=0;r=Dt(Yp(e,e=>Ll(e)));let s=0;s=Dt(Yp(e,e=>vl(e)));return{total:i,active:n,blocked:r,expired:s}},o=async()=>{let e=Tr().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),n=Tr().add(24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),r=await t.getTokensListCache(),s=Dt(r),o=0;{let t=Yp(r,t=>t.timeCreate>=e);o=Dt(t)}let a=0;{let e=Yp(r,e=>e.timeEnd>=i&&e.timeEnd<=n);a=Dt(e)}let c=0;{let e=Yp(r,e=>function(e){let t=ke(e,"timeEnd","");return!!bl(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>t}(e));c=Dt(e)}return{active:s-c,created24h:o,ending24h:a,ended:c}},a=async()=>{let e=Tr().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=await t.getIpsListCache(),n=0;{let t=Yp(await g(),t=>Tr(t.time,"YYYY-MM-DDTHH").format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=e);s="data.count",n=(r=t)&&r.length?function(e,t){for(var i,n=-1,r=e.length;++n<r;){var s=t(e[n]);void 0!==s&&(i=void 0===i?s:i+s)}return i}(r,Ni(s)):0}var r,s;let o=0;o=Dt(Yp(i,e=>Ll(e)));return{conn24h:n,blocked:o}},c=async()=>{let e=await async function(e=7,t="hr",i={}){return(await bd(e,t,i)).login}(7,"hr",{fdLog:r,srLog:n});return e},l=Wp(),u=async()=>await l.getProxy("fun",{fun:c,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaUserAccountLogin",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),p=async()=>{let e=await async function(e=7,t="hr",i={}){return(await bd(e,t,i)).token}(7,"hr",{fdLog:r,srLog:n}),i=Object.create(null);ar(e,e=>{for(let t of Object.keys(e.data))"count"!==t&&(i[t]=0)});let s=await t.getUsersListCache(),o=Object.create(null);return o.count=0,ar(s,e=>{o[e.id]=e.name}),e=Yr(e,e=>{let t=Object.assign(Object.create(null),i);for(let i of Object.keys(e.data))"count"!==i&&(t[i]=e.data[i]);var n,r,s;n=t,s={},r=Ni(r=(e,t)=>{let i=o[t];return void 0===i&&(i=t),i}),Vt(n,function(e,t,i){Zs(s,r(e,t,i),e)}),t=s;let a={time:e.time,data:{count:e.data.count,...t}};return a.data.count=e.data.count,a}),e},d=Wp(),m=async()=>await d.getProxy("fun",{fun:p,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaToken",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),h=async()=>{let e=await async function(e=7,t="hr",i={}){return(await bd(e,t,i)).ip}(7,"hr",{fdLog:r,srLog:n}),t=Object.create(null);return ar(e,e=>{for(let i of Object.keys(e.data))"count"!==i&&(t[i]=0)}),e=Yr(e,e=>{let i=Object.assign(Object.create(null),t);for(let t of Object.keys(e.data))"count"!==t&&(i[t]=e.data[t]);let n={time:e.time,data:{count:e.data.count,...i}};return n.data.count=e.data.count,n}),e},f=Wp(),g=async()=>await f.getProxy("fun",{fun:h,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaIp",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),w={getStaUserSummary:s,checkTokenAndGetStaUserSummary:async(e,i={})=>(await t.checkToken(e,i),await s()),getStaTokenSummary:o,checkTokenAndGetStaTokenSummary:async(e,i={})=>(await t.checkToken(e,i),await o()),getStaIpSummary:a,checkTokenAndGetStaIpSummary:async(e,i={})=>(await t.checkToken(e,i),await a()),getStaUserAccountLogin:u,checkTokenAndGetStaUserAccountLogin:async(e,i={})=>(await t.checkToken(e,i),await u()),getStaToken:m,checkTokenAndGetStaToken:async(e,i={})=>(await t.checkToken(e,i),await m()),getStaIp:g,checkTokenAndGetStaIp:async(e,i={})=>(await t.checkToken(e,i),await g())};return w}var Ld={exports:{}};!function(e){e.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),i=e(function(e){var t=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)});i.version;var n=function(e){return"object"==typeof e?null!==e:"function"==typeof e},r=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e},s=function(e){try{return!!e()}catch(e){return!0}},o=!s(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a=t.document,c=n(a)&&n(a.createElement),l=function(e){return c?a.createElement(e):{}},u=!o&&!s(function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")},d=Object.defineProperty,m={f:o?Object.defineProperty:function(e,t,i){if(r(e),t=p(t,!0),r(i),u)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},h=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f=o?function(e,t,i){return m.f(e,t,h(1,i))}:function(e,t,i){return e[t]=i,e},g={}.hasOwnProperty,w=function(e,t){return g.call(e,t)},y=0,M=Math.random(),D=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++y+M).toString(36))},x=e(function(e){var n="__core-js_shared__",r=t[n]||(t[n]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),I=x("native-function-to-string",Function.toString),C=e(function(e){var n=D("src"),r="toString",s=(""+I).split(r);i.inspectSource=function(e){return I.call(e)},(e.exports=function(e,i,r,o){var a="function"==typeof r;a&&(w(r,"name")||f(r,"name",i)),e[i]!==r&&(a&&(w(r,n)||f(r,n,e[i]?""+e[i]:s.join(String(i)))),e===t?e[i]=r:o?e[i]?e[i]=r:f(e,i,r):(delete e[i],f(e,i,r)))})(Function.prototype,r,function(){return"function"==typeof this&&this[n]||I.call(this)})}),b=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},v=function(e,t,i){if(b(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}},L="prototype",E=function(e,n,r){var s,o,a,c,l=e&E.F,u=e&E.G,p=e&E.S,d=e&E.P,m=e&E.B,h=u?t:p?t[n]||(t[n]={}):(t[n]||{})[L],g=u?i:i[n]||(i[n]={}),w=g[L]||(g[L]={});for(s in u&&(r=n),r)a=((o=!l&&h&&void 0!==h[s])?h:r)[s],c=m&&o?v(a,t):d&&"function"==typeof a?v(Function.call,a):a,h&&C(h,s,a,e&E.U),g[s]!=a&&f(g,s,c),d&&w[s]!=a&&(w[s]=a)};t.core=i,E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128;var A,N=E,S=Math.ceil,T=Math.floor,k=function(e){return isNaN(e=+e)?0:(e>0?T:S)(e)},j=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Z=(A=!1,function(e,t){var i,n,r=String(j(e)),s=k(t),o=r.length;return s<0||s>=o?A?"":void 0:(i=r.charCodeAt(s))<55296||i>56319||s+1===o||(n=r.charCodeAt(s+1))<56320||n>57343?A?r.charAt(s):i:A?r.slice(s,s+2):n-56320+(i-55296<<10)+65536});N(N.P,"String",{codePointAt:function(e){return Z(this,e)}}),i.String.codePointAt;var z=Math.max,Y=Math.min,X=function(e,t){return(e=k(e))<0?z(e+t,0):Y(e,t)},G=String.fromCharCode,F=String.fromCodePoint;N(N.S+N.F*(!!F&&1!=F.length),"String",{fromCodePoint:function(e){for(var t,i=arguments,n=[],r=arguments.length,s=0;r>s;){if(t=+i[s++],X(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?G(t):G(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}}),i.String.fromCodePoint;var W,O,P,K,H,U,B,V,_,R,Q,J,q,$,ee={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\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DC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\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-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uD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DC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},te={isSpaceSeparator:function(e){return"string"==typeof e&&ee.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||ee.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||ee.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}},ie=function(e,t){W=String(e),O="start",P=[],K=0,H=1,U=0,B=void 0,V=void 0,_=void 0;do{B=re(),me[O]()}while("eof"!==B.type);return"function"==typeof t?ne({"":_},"",t):_};function ne(e,t,i){var n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(var r=0;r<n.length;r++){var s=String(r),o=ne(n,s,i);void 0===o?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var a in n){var c=ne(n,a,i);void 0===c?delete n[a]:Object.defineProperty(n,a,{value:c,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}function re(){for(R="default",Q="",J=!1,q=1;;){$=se();var e=ae[R]();if(e)return e}}function se(){if(W[K])return String.fromCodePoint(W.codePointAt(K))}function oe(){var e=se();return"\n"===e?(H++,U=0):e?U+=e.length:U++,e&&(K+=e.length),e}var ae={default:function(){switch($){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void oe();case"/":return oe(),void(R="comment");case void 0:return oe(),ce("eof")}if(!te.isSpaceSeparator($))return ae[O]();oe()},comment:function(){switch($){case"*":return oe(),void(R="multiLineComment");case"/":return oe(),void(R="singleLineComment")}throw ge(oe())},multiLineComment:function(){switch($){case"*":return oe(),void(R="multiLineCommentAsterisk");case void 0:throw ge(oe())}oe()},multiLineCommentAsterisk:function(){switch($){case"*":return void oe();case"/":return oe(),void(R="default");case void 0:throw ge(oe())}oe(),R="multiLineComment"},singleLineComment:function(){switch($){case"\n":case"\r":case"\u2028":case"\u2029":return oe(),void(R="default");case void 0:return oe(),ce("eof")}oe()},value:function(){switch($){case"{":case"[":return ce("punctuator",oe());case"n":return oe(),le("ull"),ce("null",null);case"t":return oe(),le("rue"),ce("boolean",!0);case"f":return oe(),le("alse"),ce("boolean",!1);case"-":case"+":return"-"===oe()&&(q=-1),void(R="sign");case".":return Q=oe(),void(R="decimalPointLeading");case"0":return Q=oe(),void(R="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Q=oe(),void(R="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",1/0);case"N":return oe(),le("aN"),ce("numeric",NaN);case'"':case"'":return J='"'===oe(),Q="",void(R="string")}throw ge(oe())},identifierNameStartEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":break;default:if(!te.isIdStartChar(e))throw ye()}Q+=e,R="identifierName"},identifierName:function(){switch($){case"$":case"_":case"":case"":return void(Q+=oe());case"\\":return oe(),void(R="identifierNameEscape")}if(!te.isIdContinueChar($))return ce("identifier",Q);Q+=oe()},identifierNameEscape:function(){if("u"!==$)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":case"":case"":break;default:if(!te.isIdContinueChar(e))throw ye()}Q+=e,R="identifierName"},sign:function(){switch($){case".":return Q=oe(),void(R="decimalPointLeading");case"0":return Q=oe(),void(R="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Q=oe(),void(R="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",q*(1/0));case"N":return oe(),le("aN"),ce("numeric",NaN)}throw ge(oe())},zero:function(){switch($){case".":return Q+=oe(),void(R="decimalPoint");case"e":case"E":return Q+=oe(),void(R="decimalExponent");case"x":case"X":return Q+=oe(),void(R="hexadecimal")}return ce("numeric",0*q)},decimalInteger:function(){switch($){case".":return Q+=oe(),void(R="decimalPoint");case"e":case"E":return Q+=oe(),void(R="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(Q));Q+=oe()},decimalPointLeading:function(){if(te.isDigit($))return Q+=oe(),void(R="decimalFraction");throw ge(oe())},decimalPoint:function(){switch($){case"e":case"E":return Q+=oe(),void(R="decimalExponent")}return te.isDigit($)?(Q+=oe(),void(R="decimalFraction")):ce("numeric",q*Number(Q))},decimalFraction:function(){switch($){case"e":case"E":return Q+=oe(),void(R="decimalExponent")}if(!te.isDigit($))return ce("numeric",q*Number(Q));Q+=oe()},decimalExponent:function(){switch($){case"+":case"-":return Q+=oe(),void(R="decimalExponentSign")}if(te.isDigit($))return Q+=oe(),void(R="decimalExponentInteger");throw ge(oe())},decimalExponentSign:function(){if(te.isDigit($))return Q+=oe(),void(R="decimalExponentInteger");throw ge(oe())},decimalExponentInteger:function(){if(!te.isDigit($))return ce("numeric",q*Number(Q));Q+=oe()},hexadecimal:function(){if(te.isHexDigit($))return Q+=oe(),void(R="hexadecimalInteger");throw ge(oe())},hexadecimalInteger:function(){if(!te.isHexDigit($))return ce("numeric",q*Number(Q));Q+=oe()},string:function(){switch($){case"\\":return oe(),void(Q+=ue());case'"':return J?(oe(),ce("string",Q)):void(Q+=oe());case"'":return J?void(Q+=oe()):(oe(),ce("string",Q));case"\n":case"\r":throw ge(oe());case"\u2028":case"\u2029":Me($);break;case void 0:throw ge(oe())}Q+=oe()},start:function(){switch($){case"{":case"[":return ce("punctuator",oe())}R="value"},beforePropertyName:function(){switch($){case"$":case"_":return Q=oe(),void(R="identifierName");case"\\":return oe(),void(R="identifierNameStartEscape");case"}":return ce("punctuator",oe());case'"':case"'":return J='"'===oe(),void(R="string")}if(te.isIdStartChar($))return Q+=oe(),void(R="identifierName");throw ge(oe())},afterPropertyName:function(){if(":"===$)return ce("punctuator",oe());throw ge(oe())},beforePropertyValue:function(){R="value"},afterPropertyValue:function(){switch($){case",":case"}":return ce("punctuator",oe())}throw ge(oe())},beforeArrayValue:function(){if("]"===$)return ce("punctuator",oe());R="value"},afterArrayValue:function(){switch($){case",":case"]":return ce("punctuator",oe())}throw ge(oe())},end:function(){throw ge(oe())}};function ce(e,t){return{type:e,value:t,line:H,column:U}}function le(e){for(var t=0,i=e;t<i.length;t+=1){var n=i[t];if(se()!==n)throw ge(oe());oe()}}function ue(){switch(se()){case"b":return oe(),"\b";case"f":return oe(),"\f";case"n":return oe(),"\n";case"r":return oe(),"\r";case"t":return oe(),"\t";case"v":return oe(),"\v";case"0":if(oe(),te.isDigit(se()))throw ge(oe());return"\0";case"x":return oe(),pe();case"u":return oe(),de();case"\n":case"\u2028":case"\u2029":return oe(),"";case"\r":return oe(),"\n"===se()&&oe(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw ge(oe())}return oe()}function pe(){var e="",t=se();if(!te.isHexDigit(t))throw ge(oe());if(e+=oe(),t=se(),!te.isHexDigit(t))throw ge(oe());return e+=oe(),String.fromCodePoint(parseInt(e,16))}function de(){for(var e="",t=4;t-- >0;){var i=se();if(!te.isHexDigit(i))throw ge(oe());e+=oe()}return String.fromCodePoint(parseInt(e,16))}var me={start:function(){if("eof"===B.type)throw we();he()},beforePropertyName:function(){switch(B.type){case"identifier":case"string":return V=B.value,void(O="afterPropertyName");case"punctuator":return void fe();case"eof":throw we()}},afterPropertyName:function(){if("eof"===B.type)throw we();O="beforePropertyValue"},beforePropertyValue:function(){if("eof"===B.type)throw we();he()},beforeArrayValue:function(){if("eof"===B.type)throw we();"punctuator"!==B.type||"]"!==B.value?he():fe()},afterPropertyValue:function(){if("eof"===B.type)throw we();switch(B.value){case",":return void(O="beforePropertyName");case"}":fe()}},afterArrayValue:function(){if("eof"===B.type)throw we();switch(B.value){case",":return void(O="beforeArrayValue");case"]":fe()}},end:function(){}};function he(){var e;switch(B.type){case"punctuator":switch(B.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=B.value}if(void 0===_)_=e;else{var t=P[P.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,V,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)P.push(e),O=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var i=P[P.length-1];O=null==i?"end":Array.isArray(i)?"afterArrayValue":"afterPropertyValue"}}function fe(){P.pop();var e=P[P.length-1];O=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function ge(e){return xe(void 0===e?"JSON5: invalid end of input at "+H+":"+U:"JSON5: invalid character '"+De(e)+"' at "+H+":"+U)}function we(){return xe("JSON5: invalid end of input at "+H+":"+U)}function ye(){return xe("JSON5: invalid identifier character at "+H+":"+(U-=5))}function Me(e){console.warn("JSON5: '"+De(e)+"' in strings is not valid ECMAScript; consider escaping")}function De(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var i=e.charCodeAt(0).toString(16);return"\\x"+("00"+i).substring(i.length)}return e}function xe(e){var t=new SyntaxError(e);return t.lineNumber=H,t.columnNumber=U,t}var Ie=function(e,t,i){var n,r,s,o=[],a="",c="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,s=t.quote,t=t.replacer),"function"==typeof t)r=t;else if(Array.isArray(t)){n=[];for(var l=0,u=t;l<u.length;l+=1){var p=u[l],d=void 0;"string"==typeof p?d=p:("number"==typeof p||p instanceof String||p instanceof Number)&&(d=String(p)),void 0!==d&&n.indexOf(d)<0&&n.push(d)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):"string"==typeof i&&(c=i.substr(0,10)),m("",{"":e});function m(e,t){var i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),r&&(i=r.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?h(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?w(i):f(i):void 0}function h(e){for(var t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},n="",r=0;r<e.length;r++){var o=e[r];switch(o){case"'":case'"':t[o]++,n+=o;continue;case"\0":if(te.isDigit(e[r+1])){n+="\\x00";continue}}if(i[o])n+=i[o];else if(o<" "){var a=o.charCodeAt(0).toString(16);n+="\\x"+("00"+a).substring(a.length)}else n+=o}var c=s||Object.keys(t).reduce(function(e,i){return t[e]<t[i]?e:i});return c+(n=n.replace(new RegExp(c,"g"),i[c]))+c}function f(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,r,s=[],l=0,u=n||Object.keys(e);l<u.length;l+=1){var p=u[l],d=m(p,e);if(void 0!==d){var h=g(p)+":";""!==c&&(h+=" "),h+=d,s.push(h)}}if(0===s.length)i="{}";else if(""===c)i="{"+(r=s.join(","))+"}";else{var f=",\n"+a;r=s.join(f),i="{\n"+a+r+",\n"+t+"}"}return o.pop(),a=t,i}function g(e){if(0===e.length)return h(e);var t=String.fromCodePoint(e.codePointAt(0));if(!te.isIdStartChar(t))return h(e);for(var i=t.length;i<e.length;i++)if(!te.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return h(e);return e}function w(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,n=[],r=0;r<e.length;r++){var s=m(String(r),e);n.push(void 0!==s?s:"null")}if(0===n.length)i="[]";else if(""===c)i="["+n.join(",")+"]";else{var l=",\n"+a,u=n.join(l);i="[\n"+a+u+",\n"+t+"]"}return o.pop(),a=t,i}},Ce={parse:ie,stringify:Ie},be=Ce,ve=be;return ve}()}(Ld);var Ed=Zn(Ld.exports);let Ad=e.resolve(),Nd=e.resolve(Ad,"settings.json"),Sd=e=>{Nd=e},Td=()=>{let e=t.readFileSync(Nd,"utf8");return Ed.parse(e)},kd=["useCheckUser","getUserById","useExcludeWhenNotAdmin"];let jd={minLength:8,maxLength:16,requireLetter:!0,requireUppercase:!1,requireLowercase:!1,requireDigit:!0,requireSpecial:!0,noSpace:!0,onlyAscii:!0,forbiddenChars:["\\"],noConsecutiveCharsFromAccount:!0,consecutiveCharsMinMatch:2,commonPasswordBlacklist:["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"]};return function(i,n,r,s,o={}){let a=null;if(!Mn(i))throw console.log("invalid WOrm",i),new Error("invalid WOrm");if(!Zi(n))throw console.log("invalid url",n),new Error("invalid url");if(!Zi(r))throw console.log("invalid db",r),new Error("invalid db");Tn(s)||(s="./settings.json"),Sd(s);let c=Td();ki(o)&&(c={...c,...o});let l=ke(c,"serverPort");nn(l)||(l=11007),l=tn(l);let u=((e={})=>{let t=ke(e,"logFd","");Zi(t)||(t="./logs");let i=ke(e,"logInterval","");Zi(i)||(i="hr");let n=ke(e,"logNumKeep",null),r={fdLog:t,interval:i};if(null!=n&&""!==n){if(!nn(n))throw new Error(`invalid logNumKeep[${n}], must be positive integer`);r.numKeep=tn(n)}return Zl(r)})(c),p=(e,t)=>{console.log(`[${e.toUpperCase()}] ${t}`),u[e]({event:"boot",msg:t})},d=function(e={}){let t=[];for(let i of kd)try{la({[i]:ke(e,i)})}catch(e){t.push(i)}return t}(c);Dt(d)>0&&p("warn",`settings / optExt 之 ${d.join("、")} 已忽略: w-serv-orm 1.1.9 起已移除此類使用者檢查設定, 本套件之寫入皆於各功能內以權杖授權(使用者須為管理者、應用系統金鑰須具對應權限), 自助註冊為公開流程, 請自設定移除`);let m=ke(c,"webName",{}),h=ke(c,"webDescription",{}),f=ke(c,"webLogo",""),g=ke(c,"webBackgoundGradientColors",[]);ln(g)||(g=["#FFE0B2","#FFCC80","#FFF59D","#F2D6A2","#F0CC88"]);let w=ke(c,"webKey",""),y=ke(c,"salt","");Zi(process.env.SALT)&&(y=process.env.SALT);let M=ke(c,"minExpired","");un(M)||(M=30);let D=ke(c,"minForAccountLoginFailed","");un(D)||(D=10);let x=ke(c,"numForAccountLoginFailed","");un(x)||(x=3);let I=ke(c,"minBlockForAccountLoginFailed","");un(I)||(I=30);let C=ke(c,"minForTokenCallApi","");un(C)||(C=10);let b=ke(c,"numForTokenCallApi","");un(b)||(b=1e3);let v=ke(c,"minBlockForTokenCallApi","");un(v)||(v=30);let L=ke(c,"minForIpCallApi","");un(L)||(L=10);let E=ke(c,"numForIpCallApi","");un(E)||(E=1e4);let A=ke(c,"minBlockForIpCallApi","");un(A)||(A=30);let N=ke(c,"cleanKpIpCallApiForIps",[]);ln(N)||(N=["127.0.0.1","::1","::ffff:127.0.0.1"]);let T=ke(c,"cleanKpIpCallApiForToken",""),k=ke(c,"cleanKpAccountLoginFailedForIps",[]);ln(k)||(k=["127.0.0.1","::1","::ffff:127.0.0.1"]);let j=ke(c,"cleanKpAccountLoginFailedForToken",""),Z=!0===ke(c,"allowUserRegistration",!1),z=ke(c,"siteUrl","");Zi(z)||(z="");let Y=ke(c,"passwordPolicy");ki(Y)?Y={...jd,...Y}:(Y=jd,p("info","settings 未提供 passwordPolicy, 採用程式內建預設密碼政策"));let X=ke(Y,"minLength");if(!nn(X)||tn(X)<1)throw new Error("invalid passwordPolicy.minLength: must be a positive integer >= 1");let G=ke(Y,"maxLength");if(!nn(G)||tn(G)<tn(X))throw new Error("invalid passwordPolicy.maxLength: must be a positive integer >= minLength");if(!Bi(ke(Y,"requireLetter")))throw new Error("invalid passwordPolicy.requireLetter: must be a boolean");if(!Bi(ke(Y,"requireUppercase")))throw new Error("invalid passwordPolicy.requireUppercase: must be a boolean");if(!Bi(ke(Y,"requireLowercase")))throw new Error("invalid passwordPolicy.requireLowercase: must be a boolean");if(!Bi(ke(Y,"requireDigit")))throw new Error("invalid passwordPolicy.requireDigit: must be a boolean");if(!Bi(ke(Y,"requireSpecial")))throw new Error("invalid passwordPolicy.requireSpecial: must be a boolean");if(!Bi(ke(Y,"noSpace")))throw new Error("invalid passwordPolicy.noSpace: must be a boolean");if(!Bi(ke(Y,"onlyAscii")))throw new Error("invalid passwordPolicy.onlyAscii: must be a boolean");let F=ke(Y,"forbiddenChars");if(!rn(F))throw new Error("invalid passwordPolicy.forbiddenChars: must be an array");for(let e=0;e<Dt(F);e++)if(!ji(F[e])||1!==Dt(F[e]))throw new Error(`invalid passwordPolicy.forbiddenChars[${e}]: each element must be a single character string`);let W=ke(Y,"noConsecutiveCharsFromAccount");if(!Bi(W))throw new Error("invalid passwordPolicy.noConsecutiveCharsFromAccount: must be a boolean");if(W){let e=ke(Y,"consecutiveCharsMinMatch");if(!nn(e)||tn(e)<2)throw new Error("invalid passwordPolicy.consecutiveCharsMinMatch: must be a positive integer >= 2")}let O=ke(Y,"commonPasswordBlacklist");if(!rn(O))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: must be an array");if(!function(e,t,i){var n=S(e)?xt:Qt;return i&&Si(e,t,i)&&(t=void 0),n(e,Ni(t))}(O,e=>ji(e)))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: each element must be a string");let P=ke(c,"userLogo",""),K=ke(c,"subfolder","");Zi(K)&&("/"===In(K,1)&&(K=Cn(K,1)),"/"!==xn(K,1)&&(K=`/${K}`));let H=ke(c,"showLanguage","n"),U=ke(c,"language","eng"),B=ke(c,"showModeEditUsers","n"),V=ke(c,"modeEditUsers","n"),_=ke(c,"showModeEditTokens","n"),R=ke(c,"modeEditTokens","n"),Q=ke(c,"showModeEditIps","n"),J=ke(c,"modeEditIps","n");ke(c,"mappingBy","");let q=ke(c,"kpLangExt",{}),$=(e=>{let t=ke(e,"emSrcEmail","");if(!Zi(t))throw new Error(`invalid srcEmail[${t}]`);let i=ke(e,"emSrcPW","");if(!Zi(i))throw new Error(`invalid srcPW[${i}]`);let n=ke(e,"emSrcHost","");if(!Zi(n))throw new Error(`invalid srcHost[${n}]`);let r=ke(e,"emSrcPort","");if(!nn(r))throw new Error(`invalid srcPort[${r}]`);return{send:async(e,s,o,a)=>{if(!Zi(e))return Promise.reject(`invalid srcName[${e}]`);if(!Zi(s))return Promise.reject(`invalid emTitle[${s}]`);if(!Zi(o))return Promise.reject(`invalid emContent[${o}]`);if(Zi(a)&&(a=[a]),!ln(a))return Promise.reject(`invalid toEmails[${a}]`);let c={srcName:e,srcEmail:t,srcPW:i,srcHost:n,srcPort:r,emTitle:s,emContent:o,toEmails:a};return await new Zp(c)}}})(c),ee=(i,n="")=>{if(!Zi(i))return i;let r=e.resolve(i);return Tn(r)?t.readFileSync(r,"utf8"):((/^(\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/])/.test(i)||/\.(html|txt)$/i.test(i))&&p("warn",`settings.${n} 疑似檔案路徑但檔案不存在(${r}), 將原樣視為文字`),i)},te={},ie=["chpwEmTitle","chpwEmContent","regVerifyEmTitle","regVerifyEmContent","resetPwEmTitle","resetPwEmContent","userRegistrationVerifySuccess","verifyEmailAlreadyVerified","verifyEmailInvalidToken","verifyEmailFailed"];ie.forEach(e=>{let t=(e=>{let t=ke(c,e);if(!ki(t))return{};let i={};return Object.keys(t).forEach(n=>{i[n]=ee(t[n],`${e}.${n}`)}),i})(e);Dt(t)>0&&(te[e]=t)});let ne=rd({kpLangExtEmail:te,kpLangExt:q,webName:m,webDescription:h}),re={};Object.keys(ne).forEach(e=>{let t={...ne[e]};ie.forEach(e=>{delete t[e]}),re[e]=t});let se={};try{se=hl(xl,i,n,r)}catch(e){throw console.log("WServOrm init failed",e),e}let{woItems:oe,procOrm:ae}=se,ce=ke(c,"verifyBaseUrl","");Zi(ce)||(ce=`http://localhost:${l}`,Z&&p("warn",`settings 未提供 verifyBaseUrl, 註冊驗證信連結將採 ${ce}, 非本機部署時收信人將無法完成驗證, 請於 settings 提供對外可連之後端 base URL`));let le="./server/template",ue="./node_modules/w-web-sso/server/template";Nn(ue)&&(le=ue);let pe=ke(c,"pathTemplate","");Zi(pe)&&Nn(pe)||(Zi(pe)&&p("warn",`settings.pathTemplate 指定之資料夾不存在(${pe}), 改採套件內建模板`),pe=le);let de=ee(ke(c,"verifyEmailResultContent",""),"verifyEmailResultContent");if(!Zi(de)){let i=e.resolve(pe,"verifyEmailResult.html");Tn(i)||(i=e.resolve(le,"verifyEmailResult.html")),de=t.readFileSync(i,"utf8")}let me=id(oe,ae,{srLog:u,srEmail:$,salt:y,minExpired:M,kpLang:ne,passwordPolicy:Y,allowUserRegistration:Z,siteUrl:z,verifyBaseUrl:ce}),he=ld(oe,me,{srLog:u,minForAccountLoginFailed:D,numForAccountLoginFailed:x,minBlockForAccountLoginFailed:I,minForTokenCallApi:C,numForTokenCallApi:b,minBlockForTokenCallApi:v,minForIpCallApi:L,numForIpCallApi:E,minBlockForIpCallApi:A}),fe=ke(c,"logFd",""),ge=vd(0,me,{srLog:u,logFd:fe}),we=(...e)=>e.every(e=>Zi(e)),ye=(e,t)=>Al(t),Me="dist",De="./node_modules/w-web-sso/dist";Nn(De)&&(Me=De);let xe="index.html";try{let i=e.resolve(Me,"index.tmp");if(Tn(i)||(i=e.resolve(Me,xe)),!Tn(i))throw console.log("fpEntryIn",i),new Error("invalid fpEntryIn");let n=e.resolve(Me,xe),r=t.readFileSync(i,"utf8");r=kn(r,"/msso/","{sfd}/"),r=kn(r,"{sfd}",K),r=kn(r,"{language}",U),t.writeFileSync(n,r,"utf8")}catch(e){console.log(e),console.log(`can not generate ${xe}`)}let Ie=[{method:"GET",path:"/api/cleanKpIpCallApi",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");if(!Zi(T))return Promise.reject("invalid cleanKpIpCallApiForToken");if(t!==T)return Promise.reject("cleanKpIpCallApi invalid token");let i=ke(e,"info.remoteAddress","");return Zi(i)||(i=ke(e,"socket.remoteAddress","")),Zi(i)||(i=ke(e,"connection.remoteAddress","")),N.includes(i)?(u.info({event:"api/cleanKpIpCallApi",realIp:i}),await he.cleanKpIpCallApi(),!0):Promise.reject(`cleanKpIpCallApi only allowed from cleanKpIpCallApiForIps, got realIp[${i}]`)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/cleanKpAccountLoginFailed",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");if(!Zi(j))return Promise.reject("invalid cleanKpAccountLoginFailedForToken");if(t!==j)return Promise.reject("cleanKpAccountLoginFailed invalid token");let i=ke(e,"info.remoteAddress","");return Zi(i)||(i=ke(e,"socket.remoteAddress","")),Zi(i)||(i=ke(e,"connection.remoteAddress","")),k.includes(i)?(u.info({event:"api/cleanKpAccountLoginFailed",realIp:i}),await he.cleanKpAccountLoginFailed(),!0):Promise.reject(`cleanKpAccountLoginFailed only allowed from cleanKpAccountLoginFailedForIps, got realIp[${i}]`)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutSsoUser",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/logoutSsoUser",token:Xl(t)}),await me.logoutByToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/checkToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/checkToken",token:Xl(t)}),he.callApiByToken(t),await me.checkToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/refreshToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/refreshToken",token:Xl(t)}),he.callApiByToken(t),await me.refreshToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutByToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/logoutByToken",token:Xl(t)}),he.callApiByToken(t),await me.logoutByToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUsersList",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");u.info({event:"api/getSsoUsersList",token:Xl(t)}),he.callApiByToken(t);let i=await me.checkTokenAndGetUsersList(t,{fun:ye,perm:"readUsers"});return i=i.map(me.omitUserCredential),i})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUserInfor",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token",""),i=ke(e,"query.key",""),n=ke(e,"query.value","");if(!we(t,i,n))return Promise.reject("tokenExpired");let r=Wl(i,n);u.info({event:"api/getSsoUserInfor",token:Xl(t),key:Fl(i),value:r}),he.callApiByToken(t);let s=null;return s="token"===i?await me.checkTokenAndGetUserByToken(t,n,{fun:ye,perm:"readUsers"}):await me.checkTokenAndGetUserInfor(t,i,n,{fun:ye,perm:"readUsers"}),ki(s)?s:(console.log("token does not have permission"),Promise.reject("tokenNoPermission"))})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/verifyEmail",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/verifyEmail",token:Xl(t)}),await me.verifyEmail(t)})();yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg});let n,r=ke(e,"query.lang","");"eng"!==r&&"cht"!==r&&(r="eng"),n="success"===i.state?"userRegistrationVerifySuccess":i.msg&&"string"==typeof i.msg?i.msg:"verifyEmailInvalidToken";let s=ke(ne,`${r}.webName`,""),o=ke(ne,`${r}.${n}`,n),a=de;return a=kn(a,"{title}",s),a=kn(a,"{message}",o),t.response(a).type("text/html; charset=utf-8")}}],Ce={port:l,pathStaticFiles:Me,apiName:"api",apis:Ie,tokenType:"Bearer",verifyConn:async({apiType:e,authorization:t,query:i,headers:n,req:r})=>{let s=he.getIpByHeaders(r),o=ke(n,"origin",""),a=zl(ke(n,"referer",""));u.info({event:"verifyConn",ip:s,origin:o,referer:a}),he.callApiByIp(s);let c=!0;return await he.getBlockedByIp(s).then(e=>{c=e}).catch(()=>{c=!0}),c=!c,c||console.log(`block ip[${s}]`),c},getUserIdByToken:async e=>"",corsOrigins:["*"],useDbOrm:!1,tableNamesExec:[],methodsExec:[],tableNamesSync:[],kpFunExt:{getWebInfor:async e=>({webLogo:f,webBackgoundGradientColors:g,webKey:w,userLogo:P,showLanguage:H,language:U,kpLang:re,showModeEditUsers:B,modeEditUsers:V,showModeEditTokens:_,modeEditTokens:R,showModeEditIps:Q,modeEditIps:J,allowUserRegistration:Z,passwordPolicyInfo:{minLength:Y.minLength,maxLength:Y.maxLength,requireLetter:Y.requireLetter,requireUppercase:Y.requireUppercase,requireLowercase:Y.requireLowercase,requireDigit:Y.requireDigit,requireSpecial:Y.requireSpecial,consecutiveCharsMinMatch:Y.consecutiveCharsMinMatch}}),checkToken:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-checkToken",token:Xl(t)}),await me.checkToken(t)},refreshToken:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-refreshToken",token:Xl(t)}),await me.refreshToken(t)},loginByAccountAndPassword:async(e,t,i,n)=>{if(!we(i,n))return Promise.reject("failedLoginForCatch");u.info({event:"kpfun-loginByAccountAndPassword-before",account:i});let r=null,s="";return await he.loginByAccountAndPassword(i,n).then(e=>{r=e}).catch(e=>{s=e}),ki(r)?u.info({event:"kpfun-loginByAccountAndPassword-success",account:i}):u.info({event:"kpfun-loginByAccountAndPassword-error",account:i,msg:s}),ki(r)?r:Promise.reject(s)},logoutByToken:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-logoutByToken",token:Xl(t)}),await me.logoutByToken(t)},createUser:async(e,t,i,n,r,s,o)=>{u.info({event:"kpfun-createUser",lang:t,account:i});let a={lang:t,account:i,password:n,confirmPassword:r,name:s,email:o};return await me.createUser(t,a)},verifyEmail:async(e,t)=>(u.info({event:"kpfun-verifyEmail",token:Xl(t)}),await me.verifyEmail(t)),resendVerifyEmail:async(e,t,i,n)=>(u.info({event:"kpfun-resendVerifyEmail",lang:t,account:i}),await me.resendVerifyEmail(t,i,n)),getUserByToken:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUserByToken",token:Xl(t)}),await me.checkTokenAndGetUserByToken(t,t)},getUserInfor:async(e,t,i,n)=>{if(!we(t,i,n))return Promise.reject("tokenExpired");let r=Wl(i,n);return u.info({event:"kpfun-getUserInfor",token:Xl(t),key:Fl(i),value:r}),await me.checkTokenAndGetUserInfor(t,i,n,{fun:ye,perm:"readUsers"})},checkUserPassword:async(e,t,i)=>(u.info({event:"kpfun-checkUserPassword",lang:t}),await me.checkUserPassword(t,i)),changeUserPassword:async(e,t,i,n,r)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-changeUserPassword",token:Xl(t),lang:i}),await me.checkTokenAndChangePassword(t,i,n,r)},adminResetUserPassword:async(e,t,i,n)=>{if(!we(t,n))return Promise.reject("tokenExpired");return u.info({event:"kpfun-adminResetUserPassword",token:Xl(t),lang:i,targetUserId:n}),await me.adminResetUserPassword(t,i,n)},getUsersList:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUsersList",token:Xl(t)}),await me.checkTokenAndGetUsersList(t,{fun:ye,perm:"readUsers"})},updateUsersList:async(e,t,i,n)=>{if(!we(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateUsersList",token:Xl(t),lang:i}),await me.checkTokenAndUpdateUsersList(t,i,n,{fun:ye,perm:"writeUsers"})},getTokensList:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getTokensList",token:Xl(t)}),await me.checkTokenAndGetTokensList(t,{fun:ye,perm:"readTokens"})},updateTokensList:async(e,t,i,n)=>{if(!we(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateTokensList",token:Xl(t),lang:i}),await me.checkTokenAndUpdateTokensList(t,n,{fun:ye,perm:"writeTokens"})},getIpsList:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getIpsList",token:Xl(t)}),await me.checkTokenAndGetIpsList(t,{fun:ye,perm:"readIps"})},updateIpsList:async(e,t,i,n)=>{if(!we(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateIpsList",token:Xl(t),lang:i}),await me.checkTokenAndUpdateIpsList(t,n,{fun:ye,perm:"writeIps"})},getStaUserSummary:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserSummary",token:Xl(t)}),await ge.checkTokenAndGetStaUserSummary(t,{fun:ye,perm:"readStats"})},getStaTokenSummary:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaTokenSummary",token:Xl(t)}),await ge.checkTokenAndGetStaTokenSummary(t,{fun:ye,perm:"readStats"})},getStaIpSummary:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIpSummary",token:Xl(t)}),await ge.checkTokenAndGetStaIpSummary(t,{fun:ye,perm:"readStats"})},getStaUserAccountLogin:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserAccountLogin",token:Xl(t)}),await ge.checkTokenAndGetStaUserAccountLogin(t,{fun:ye,perm:"readStats"})},getStaToken:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaToken",token:Xl(t)}),await ge.checkTokenAndGetStaToken(t,{fun:ye,perm:"readStats"})},getStaIp:async(e,t)=>{if(!we(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIp",token:Xl(t)}),await ge.checkTokenAndGetStaIp(t,{fun:ye,perm:"readStats"})}},fpTableTags:"tableTags-web-sso.json"};return Ce.kpFunExt=Object.fromEntries(Object.entries(Ce.kpFunExt).map(([e,t])=>[e,async(...i)=>{try{return await t(...i)}catch(t){throw u.error({event:"kpfun-error",fun:e,key:Zi(t)?t:yn(t)?t.message:String(t)}),t}}])),a=new oa(Ce),a}});
|
|
13
|
+
}(e)&&(n?i.push("keyLimRequireSpecial"):i.push("密碼須包含至少一個特殊符號")),r&&Dt(i)>0)throw new Error(i[0]);let f=ke(t,"forbiddenChars",null);if(rn(f)||(f=[]),Dt(f)>0){for(let t of f)if(e.includes(t)){if(n){i.push("keyLimForbiddenChar");break}i.push(`密碼不可包含字元:${t}`)}if(r&&Dt(i)>0)throw new Error(i[0])}let g=ke(t,"commonPasswordBlacklist",null);if(rn(g)||(g=fd),Dt(g)>0){let t=e.toLowerCase();if(g.some(e=>ji(e)&&t===e.toLowerCase())&&(n?i.push("keyLimCommonPassword"):i.push("此密碼為常見弱密碼,不允許使用")),r&&Dt(i)>0)throw new Error(i[0])}let w=ke(t,"account",""),y=ke(t,"noConsecutiveCharsFromAccount",null);Bi(y)||(y=!1);let M=ke(t,"consecutiveCharsMinMatch","");if(nn(M)||(M=3),M=tn(M),y&&ji(w)&&Dt(w)>=M){let t=[...w.toLowerCase()],s=e.toLowerCase(),o=!1;for(let e=0;e<=t.length-M;e++){let i=t.slice(e,e+M).join("");if(s.includes(i)){o=!0;break}}if(o&&(n?i.push("keyLimConsecutiveCharsFromAccount"):i.push(`密碼不可包含與帳號相同之${M}個以上連續字元`)),r&&Dt(i)>0)throw new Error(i[0])}if(Dt(i)>0)throw new Error(i.join(" | "));return!0}function wd(){let e=Fn(),t=Object.create(null);function i(t,i){Wn(e,t,[i],{tag:"cache"})}function n(e,n={}){if(sr(t,e))return;let r=ke(n,"fun");Mn(r)||(r=async()=>{});let s=ke(n,"inputs");rn(s)||(s=[]);let o=ke(n,"timeExpired");nn(o)||(o=5e3),o=tn(o);let a=ke(n,"timeFrom");"end"!==a&&(a="start");let c=ke(n,"useCacheWhenError");Bi(c)||(c=!1);let l=ke(n,"useCloneDeep");Bi(l)||(l=!0),t[e]={needExec:!0,fun:r,pm:null,gen:0,inputs:s,value:null,time:null,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l},i("message",{fun:"set",key:e,timeExpired:o,timeFrom:a,useCacheWhenError:c,useCloneDeep:l})}async function r(e,n={}){if(sr(t,e)){let r=t[e],s=ke(n,"useCloneDeep");if(Bi(s)||(s=r.useCloneDeep),r.pm)return i("message",{fun:"get",key:e,msg:"waiting"}),await r.pm,s?To(r.value):r.value;let o=Date.now(),a=r.needExec,c=o-r.time;if(a?i("message",{fun:"get",key:e,msg:"execute first"}):r.timeExpired>0&&c>r.timeExpired&&(i("message",{fun:"get",key:e,msg:"execute by timeExpired",timeDiff:c}),a=!0),a){i("message",{fun:"get",key:e,msg:"fun start"}),r.needExec=!1;let t,n,s=r.gen,a=async()=>{try{let t;try{t=await r.fun(...r.inputs)}catch(n){if(i("error",{fun:"get",key:e,msg:n}),!r.useCacheWhenError)throw r.gen===s&&(r.needExec=!0),n;t=void 0}r.gen===s&&(r.value=t,r.time="end"===r.timeFrom?Date.now():o)}finally{r.pm=null,i("message",{fun:"get",key:e,msg:"fun end"})}},c=new Promise((e,i)=>{t=e,n=i});r.pm=c,a().then(t,n),await c}else i("message",{fun:"get",key:e,msg:"use cache"});return s?To(r.value):r.value}return i("error",{fun:"get",key:e,msg:"invalid key"}),null}return e.set=n,e.getProxy=async function(e,t={}){return n(e,t),r(e,t)},e.get=r,e.update=function(e,n){sr(t,e)&&(i("message",{fun:"updateValue",key:e}),t[e].value=n,t[e].time=Date.now(),t[e].gen+=1)},e.clear=function(e){sr(t,e)&&(i("message",{fun:"clear",key:e}),t[e].needExec=!0)},e.remove=function(e){sr(t,e)&&(i("message",{fun:"remove",key:e}),delete t[e])},e}async function yd(e,t={}){let i=null,n=Cn();if(!Mn(e))return n.reject("waitfunction需輸入函數f"),n;let r=async()=>{let t=e();return vn(t)&&(t=await t),t};if(i=await r(),!0===i)return n.resolve(),n;let s=ke(t,"attemptNum",null);nn(s)||(s=200);let o=ke(t,"timeInterval",null);nn(o)||(o=1e3),o=Math.min(o,On);let a=0,c=!1,l=setInterval(async()=>{if(a+=1,c)a>s&&clearInterval(l);else{c=!0;try{i=await r()}catch(e){return clearInterval(l),void n.reject(e)}finally{c=!1}if(!0===i)return clearInterval(l),void n.resolve();a>s&&(clearInterval(l),n.reject(`exceeded attemptNum[${s}]`))}},o);return n}function Md(e={}){let t=ke(e,"timeExpire",null);nn(t)||(t=18e5),t=tn(t),t=Math.min(t,On);let i=ke(e,"timeDetect",null);nn(i)||(i=2e3),i=tn(i),i=Math.min(i,On);let n=Fn(),r=Object.create(null),s=e=>{if(sr(r,e)){return Gn(n,"checkWithSet",[{state:"error",msg:`checkWithSet: key in use: ${e}`}],{tag:"cacheSt"}),!1}return r[e]={time:Date.now(),value:!0},Gn(n,"checkWithSet",[{state:"success",msg:`checkWithSet: ${e}`}],{tag:"cacheSt"}),!0},o=setInterval(()=>{Gn(n,"detect",[{state:"start"}],{tag:"cacheSt"});let e=Date.now();for(let i of Object.keys(r)){let n=r[i];n&&e-n.time>t&&delete r[i]}Gn(n,"detect",[{state:"finish"}],{tag:"cacheSt"})},i);return n.checkWithSet=s,n.setWithFree=async(e,t)=>{Gn(n,"setWithFree",[{state:"start"}],{tag:"cacheSt"});let i=[];for(let t of e){if(!s(t)){for(let e of i)delete r[e];let e=`setWithFree: key in use: ${t}`;return Gn(n,"setWithFree",[{state:"error",msg:e}],{tag:"cacheSt"}),Promise.reject(e)}i.push(t)}try{let i=await t(),r=`setWithFree: ${e.join(", ")}`;return Gn(n,"setWithFree",[{state:"success",msg:r}],{tag:"cacheSt"}),i}catch(e){let t="";try{t=`${e&&e.message||e}`}catch(e){}throw Gn(n,"setWithFree",[{state:"error",msg:`setWithFree: fn threw: ${t}`}],{tag:"cacheSt"}),e}finally{for(let e of i)delete r[e]}},n.set=async(e,t=!0)=>{r[e]={time:Date.now(),value:t},Gn(n,"set",[{state:"success",msg:`set: ${e}`}],{tag:"cacheSt"})},n.get=async e=>{let t=r[e],i=void 0===t?null:t.value;return Gn(n,"get",[{state:"success",msg:`get: ${e}`}],{tag:"cacheSt"}),i},n.check=async e=>{let t=sr(r,e);return Gn(n,"check",[{state:"success",msg:`check: ${e} = ${t}`}],{tag:"cacheSt"}),t},n.del=async e=>{delete r[e],Gn(n,"del",[{state:"success",msg:`del: ${e}`}],{tag:"cacheSt"})},n.waitExist=async(e,t={})=>{let i=ke(t,"attemptNum",null);nn(i)||(i=30),i=tn(i);let s=ke(t,"timeInterval",null);nn(s)||(s=100),s=tn(s),Gn(n,"waitExist",[{state:"start"}],{tag:"cacheSt"});try{await yd(()=>sr(r,e),{attemptNum:i,timeInterval:s})}catch(t){let r=`waitExist timeout (${i*s}ms): ${e}`;return Gn(n,"waitExist",[{state:"error",msg:r}],{tag:"cacheSt"}),Promise.reject(r)}Gn(n,"waitExist",[{state:"success",msg:`waitExist resolved: ${e}`}],{tag:"cacheSt"})},n.waitNotExist=async(e,t={})=>{let i=ke(t,"attemptNum",null);nn(i)||(i=30),i=tn(i);let s=ke(t,"timeInterval",null);nn(s)||(s=100),s=tn(s),Gn(n,"waitNotExist",[{state:"start"}],{tag:"cacheSt"});try{await yd(()=>!sr(r,e),{attemptNum:i,timeInterval:s})}catch(t){let r=`waitNotExist timeout (${i*s}ms): ${e}`;return Gn(n,"waitNotExist",[{state:"error",msg:r}],{tag:"cacheSt"}),Promise.reject(r)}Gn(n,"waitNotExist",[{state:"success",msg:`waitNotExist resolved: ${e}`}],{tag:"cacheSt"})},n.clear=()=>{clearInterval(o)},n}function Dd(e,t,i={}){let n=ke(i,"mode","");if(Zi(n)||(n="scrypt"),"scrypt"!==n)throw new Error("暫時不支援scrypt以外方法");let r=L.randomBytes(16),s=`${e}:${t||""}`,o=L.scryptSync(s,r,64);return`scrypt:${r.toString("hex")}:${o.toString("hex")}`}function xd(e,t,i){if(!Zi(t))return!1;let n=t.split(":");if(3!==n.length)return!1;let r,s,[o,a,c]=n;if("scrypt"!==o)return!1;if(!Zi(a)||!Zi(c))return!1;try{r=Buffer.from(a,"hex"),s=Buffer.from(c,"hex")}catch(e){return!1}if(16!==r.length||64!==s.length)return!1;let l=`${e}:${i||""}`,u=L.scryptSync(l,r,64);return u.length===s.length&&L.timingSafeEqual(u,s)}function Id(e){return e[b.randomInt(e.length)]}function bd(e){for(let t=e.length-1;t>0;t--){let i=b.randomInt(t+1),n=e[t];e[t]=e[i],e[i]=n}return e}let Cd=["readUsers","writeUsers","readTokens","writeTokens","readIps","writeIps","readStats"],vd=["readUsers"];function Ld(e){return Zi(e)&&Cd.includes(e)}function Ed(e){return null==e||""===e||!!rn(e)&&e.every(Ld)}function Ad(e){return rn(e)?Cd.filter(t=>e.includes(t)):[]}function Nd(e,t){return!!Ld(t)&&function(e){let t=Ad(ke(e,"perms"));return Cd.filter(e=>vd.includes(e)||t.includes(e))}(e).includes(t)}var Sd={users:{table:"users",pk:"id",fields:["account","name","email","description","from","redir","isAdmin","timeVerified","timeExpired","timeBlocked","isForceChangePw","isActive"],serverOnly:["password","tokenVerify","userId","timeCreate","userIdUpdate","timeUpdate"],orderKey:"order",scope:null},tokens:{table:"tokens",pk:"id",fields:["token","userId","isApp","perms","timeCreate","timeEnd"],serverOnly:["timeUpdate","userIdUpdate"],scope:e=>"y"===e.isApp},tokensSession:{table:"tokens",pk:"id",fields:["token","userId","isApp","perms","timeCreate","timeEnd"],serverOnly:["timeUpdate","userIdUpdate"],scope:e=>"y"!==e.isApp},ips:{table:"ips",pk:"id",fields:["ip","timeBlocked"],serverOnly:["userIdUpdate"],scope:null}};let Td=["password","tokenVerify"],kd=Object.create(null);function jd(e){try{if(!Array.isArray(e))return null;let t=[];for(let i=0;i<e.length;i++){let n=Object.getOwnPropertyDescriptor(e,i);if(void 0===n||!("value"in n)||!Array.isArray(n.value)||2!==n.value.length)return null;let r=Object.getOwnPropertyDescriptor(n.value,0),s=Object.getOwnPropertyDescriptor(n.value,1);if(void 0===r||void 0===s||!("value"in r)||!("value"in s))return null;t.push([r.value,s.value])}return t}catch(e){return null}}kd[pa.mismatch]="saveStale",kd[pa.rowNotFound]="saveRowNotFound",kd[pa.format]="saveBaselineFormat";function Zd(e){return"string"!=typeof e&&(e=null==e?"":String(e)),e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function zd(e,t,{srLog:i,srEmail:n,salt:r,minExpired:s,kpLang:o,passwordPolicy:a,allowUserRegistration:c,siteUrl:l,verifyBaseUrl:u,withTabLocks:p,guardWrite:d}){if(!Mn(p)||!Mn(d))throw new Error("procCore needs withTabLocks and guardWrite from the WServOrm instance");let m=la(),h=Md(),f=function(e){return async(t,i,n,r={})=>{let s=ke(r,"errKey","");Zi(s)||(s="saveInProgress");let o=`${t}:${i}`;return await e.setWithFree([o],n).catch(e=>e===`setWithFree: key in use: ${o}`?Promise.reject(s):Promise.reject(e))}}(h),g=new Map,w=new Map,y=(e,t)=>ke(o,`${t}.${e}`,""),M=(e,t,i={})=>{"eng"!==t&&"cht"!==t&&(t="eng");let n=ke(o,`${t}.${e}`,"");for(let e in i)n=n.replaceAll(`{${e}}`,Zd(i[e]));return n},D=async(t,n,r={})=>{let s=null,o=ke(r,"deletePassword");Bi(o)||(o=!0);let a=await e.users.select({[t]:n,isActive:"y"}).catch(e=>{s=e});if(s)return console.log(s),console.log("keyUser",t),console.log("valueUser",wu(t,n)),console.log("failed to find user"),Promise.reject("failed to find user");o&&(a=Yr(a,e=>(delete e.password,e)));let c=Dt(a);return 0===c?(i&&Mn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userNotFound",keyUser:gu(t),valueUser:wu(t,n)}),Promise.reject(`can not find the user by ${t}`)):c>=2?(i&&Mn(i.debug)&&i.debug({event:"fun-getGenUserByKV",key:"userDuplicate",keyUser:gu(t),valueUser:wu(t,n)}),Promise.reject(`duplicate ${t}`)):a[0]},x=async(e,t)=>await D(e,t),I=async(e,t={})=>await x("id",e),b=async(i,n={})=>{let r=null;if(!un(s))return console.log("minExpired",s),console.log("invalid minExpired"),Promise.reject("invalid minExpired");let o=$l.tokens.funNew({userId:i});o.timeEnd=Tr().add(s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");let a=ke(o,"token",""),c=null,l=null;return await p(["tokens"],async()=>{if(!0===ke(n,"recheckUser")){let t=await e.users.select({id:i}),r=ke(t,0,null),s=!1,o=ke(r,"timeBlocked","");if(tu(o)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=o&&(s=!0),1!==Dt(t)||"n"===ke(r,"isActive","")||s)return void(c="failedLoginForCatch");let a=ke(n,"verifiedUser",null);if(null!==a){if(ke(r,"password","")!==ke(a,"password",""))return void(c="failedLoginForCatch");if(!Zi(ke(r,"timeVerified","")))return void(c="userRegistrationNotVerified");let e=ke(r,"timeExpired","");if(Zi(e)&&tu(e)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>e)return void(c="loginAccountExpired")}l=r}await t(i,"tokens","insert",[o])}).catch(e=>{r=e}),null!==c?Promise.reject(c):r?(console.log(r),console.log("can not create a token from userId"),Promise.reject("can not create a token from userId")):!0===ke(n,"withUser")?{token:a,user:l}:a},C=async(t,n={})=>{let r=await e.tokens.select({token:t}),s=Dt(r);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=ke(r,0,""),a=ke(o,"userId",""),c=await(async(e,t={})=>{let n=ke(e,"timeEnd","");if(!tu(n))return console.log("timeEnd",n),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let r=ke(e,"isApp",""),s=ke(t,"fun",null),o=ke(t,"perm",""),a=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<n,c=!0;if("y"!==r){if(Mn(s)){let t=ke(e,"userId","");c=s(e,await I(t)),vn(c)&&(c=await c)}}else Zi(o)?c=Nd(e,o):Mn(s)&&(c=!1),c||i.warn({event:"fun-checkToken",key:"appTokenPermDenied",token:hu(ke(e,"token","")),userId:ke(e,"userId",""),perm:o});return a&&c})(o,n);return i.info({event:"fun-checkToken",token:hu(t),userId:a,res:c}),c},v=async(e,t={})=>{if(!Zi(e))return Promise.reject("tokenExpired");let i=null;return await C(e,t).then(e=>{!1===e&&(i="tokenExpired")}).catch(e=>{console.log("checkToken inner reject",e),i="tokenExpired"}),null===i||Promise.reject(i)},L=async n=>{let r=null,o=await e.tokens.select({token:n}),a=Dt(o);if(0===a)return console.log("invalid token"),Promise.reject("invalid token");if(a>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let c=ke(o,0,""),l=ke(c,"timeEnd","");if(!tu(l))return console.log("timeEnd",l),console.log("invalid timeEnd"),Promise.reject("invalid timeEnd");let u=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ");if(u>=l)return console.log("tn",u),console.log("timeEnd",l),console.log("token expired"),Promise.reject("tokenExpired");let p=Tr().add(s,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");return await t(ke(c,"userId",""),"tokens","save",[{id:c.id,timeEnd:p}],{mustExist:!0}).catch(e=>{r=e}),r?(console.log(r),console.log("can not update timeEnd for token"),i.error({event:"fun-refreshToken-save",token:hu(n),err:Rn(r)}),Promise.reject("can not update timeEnd for token")):p},E=async t=>{let n=null,r=await e.tokens.select({token:t}),s=Dt(r);if(0===s)return console.log("invalid token"),Promise.reject("invalid token");if(s>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let o=ke(r,0,""),a=ke(o,"userId",""),c=await e.tokens.del({id:o.id}).catch(e=>{n=e});return n?(console.log(n),console.log("failed to delete token"),Promise.reject("failed to delete token")):(c=ke(c,"0.nDeleted",0),1!==c?(console.log("can not delete the token"),Promise.reject("can not delete the token")):(i.info({event:"fun-logout",token:hu(t),userId:a}),!0))},A=(e,t,i={})=>{Zi(e)||(e="eng");let n=ke(i,"account",""),r="";try{gd(t,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:a.minLength,numLenMax:a.maxLength,requireLetter:a.requireLetter,requireUppercase:a.requireUppercase,requireLowercase:a.requireLowercase,requireDigit:a.requireDigit,requireSpecial:a.requireSpecial,noSpace:a.noSpace,onlyAscii:a.onlyAscii,forbiddenChars:a.forbiddenChars,commonPasswordBlacklist:a.commonPasswordBlacklist,account:n,noConsecutiveCharsFromAccount:a.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:a.consecutiveCharsMinMatch})}catch(e){r=e.message}let s=null;return Zi(r)?(s={state:"error",key:`userPassword_${r}`},s):(s={state:"success",msg:"ok"},s)},N=async t=>{if(!Zi(t))return Promise.reject("invalid userId");let i=await e.tokens.select({userId:t});return 0===Dt(i)?0:(await async function(e,t,i){if("save"!==t&&"del"!==t)return Promise.reject(`invalid mode[${t}]`);if(!Mn(ke(e,t)))return Promise.reject(`invalid wo.${t}`);let n=await e[t](i),r=tl(n,i);if(Dt(r)>0){let e=Yr(r,e=>`id[${e.id}]: ${e.err}`);return Promise.reject(`${t} fail: ${ka(e,"; ")}`)}return n}(e.tokens,"del",Yr(i,e=>({id:e.id}))),Dt(i))},S=async(n,s,o,a={})=>{let c=Sd[n],l=Sd.tokensSession;if(!ki(c)||o!==c.pk)throw new Error(`invalid woName[${n}] or keyDetect[${o}] of updateTabItems`);let u=ke(a,"resetOrder");Bi(u)||(u=!1);let p=ke(a,"operatorId",""),m=ke(a,"lang","eng");Zi(m)||(m="eng");let h=ke(a,"ocList",null),f=ke(a,"optClient");if(!rn(s))return Promise.reject("invalidRows");let g=[],w=new Map;ar(s,e=>{!0===ke(e,"_isNew")&&g.push(ke(e,"id","")),"tokens"===n&&w.set(ke(e,"id",""),ke(e,"perms"))}),s=function(e,t,i=""){return ln(e)&&ln(t)?Yr(e,e=>Bl(e,t,i)):[]}(s,$l[n].keys),u&&(s=Yr(s,(e,t)=>(e.order=t+1,e)));let y=(e,t)=>{let i=null,n=Object.create(null);return ar(e,e=>{let r=ke(e,t,"");return Zi(r)?sr(n,r)?(i="duplicate",!1):void(n[r]=!0):(i="empty",!1)}),i};if(null!==y(s,"id")||s.some(e=>Buffer.byteLength(e.id,"utf8")>1978))return Promise.reject("invalidRows");if(function(e,t){function i(e){return rn(e)?e:[e]}if(cn(e))return!1;if(0===(e=i(e)).length)return!1;if(cn(e))return!1;if(0===(t=i(t)).length)return!1;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)if(hd(e[i],t[n]))return!0;return!1}(n,["users"])){let e=y(s,"email");if("empty"===e)return Promise.reject("userEmailEmpty");if("duplicate"===e)return Promise.reject("userEmailDuplicate")}let M=function(e,t){let i={err:pa.format};if(void 0===t)return{};if(!wn(t))return i;let n="tokens"===e?["baseline","baselineSession"]:["baseline"],r=Reflect.ownKeys(t);if(r.some(e=>n.indexOf(e)<0)||n.some(e=>r.indexOf(e)<0))return i;let s={};for(let e of n){let n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n||!("value"in n))return i;let r=jd(n.value);if(null===r||!Ea(r))return i;s[e]=r}return s}(n,f);if(void 0!==M.err)return Promise.reject(kd[M.err]);let D=void 0!==M.baseline,x=new Map;ar(s,e=>{x.set(e.id,e)});let I=x;"tokens"===n&&(I=new Map,ar(s,e=>{I.set(e.id,{...e,perms:Ad(w.get(e.id))})}));let b=s;"tokens"===n&&(b=Yr(s,e=>I.get(e.id)));let C="users"===n?["tokens","users"]:[n];try{await d({tables:C,read:()=>e[n].select(),baseline:M.baseline,contract:c,write:async e=>{let a=new Map;if(ar(e,e=>{a.set(ke(e,"id",""),e)}),Dt(g)>0&&g.some(e=>a.has(e)))return Promise.reject("saveNewRowExists");if("tokens"===n){let e=new Set(D?[...M.baseline,...M.baselineSession].map(([e])=>e):[]),t=s.find(t=>"y"!==ke(t,"isApp","")&&!a.has(t.id)&&!e.has(t.id));if(void 0!==t)return i.warn({event:"fun-updateTabItems-reject",key:"tokenSessionAddNotAllowed",woName:n}),Promise.reject("tokenSessionAddNotAllowed")}if("users"===n){let t=Object.create(null);ar(e,e=>{let i=ke(e,"account","");Zi(i)&&(t[i]=ke(e,"id",""))});let i=Object.create(null),n=null;if(ar(s,e=>{let r=ke(e,"account",""),s=ke(e,"id","");return Zi(r)?sr(i,r)||sr(t,r)&&t[r]!==s?(n="accountDuplicate",!1):void(i[r]=!0):(n="accountRequired",!1)}),null!==n)return Promise.reject(n)}if("tokens"===n){let e=new Map(D?[...M.baseline,...M.baselineSession]:[]);for(let t of s){let i=w.get(t.id),n=a.get(t.id);if((void 0===n||JSON.stringify(ke(n,"perms"))!==JSON.stringify(i))&&!(e.has(t.id)&&e.get(t.id)===Ca(x.get(t.id),c)||Ed(i)))return Promise.reject("tokenPermsInvalid")}}let u=[],d=[],f=[],y=e=>"y"===ke(e,"isApp","");if("tokens"===n&&D){let t=new Map(M.baseline),i=new Map(M.baselineSession),n=Aa(e,M.baselineSession,l),r=new Set(n.ok?[]:n.changed);for(let[e,i]of t){let t=x.get(e);void 0===t?u.push(a.get(e)):Ca(t,c)!==i&&f.push(I.get(e))}for(let[e,t]of i){let i=x.get(e),n=a.get(e),s=void 0!==n&&l.scope(n);if(void 0!==i){if(Ca(i,c)!==t){if(!s||r.has(e))return Promise.reject("saveStale");f.push(I.get(e))}}else{if(!s)continue;if(r.has(e))return Promise.reject("saveStale");u.push(n)}}for(let[e]of x)if(!t.has(e)&&!i.has(e)){if(a.has(e))return Promise.reject("saveStale");d.push(I.get(e))}}else if("tokens"===n){ar(e,e=>{y(e)&&!x.has(e.id)&&u.push(e)});for(let[e,t]of I){let i=a.get(e);void 0!==i?(y(i)||y(t))&&Ca(t,c)!==Ca(i,c)&&f.push(t):d.push(t)}}else{if(D)for(let[e]of M.baseline)!x.has(e)&&a.has(e)&&u.push(a.get(e));else ar(e,e=>{x.has(e.id)||u.push(e)});ar(s,e=>{let t=a.get(e.id);if(void 0===t)return void d.push(e);let i=Ca(e,c)!==Ca(t,c);!i&&c.orderKey&&(i=!hd(ke(t,c.orderKey),ke(e,c.orderKey))),i&&f.push(e)})}let b=Yr(d,e=>{let t={...e};return ar(c.serverOnly,e=>{t[e]=""}),"users"===n&&(t.password=ke(e,"password","")),t}),C=Yr(f,e=>{let t=function(e,t){if(Ma(t),!Ia(e))throw new Error("invalid row: need an object");let i={},n=[t.pk].concat(t.fields);for(let t=0;t<n.length;t++){let r=n[t];ma(e,r)&&void 0!==e[r]&&Object.defineProperty(i,r,{value:e[r],writable:!0,enumerable:!0,configurable:!0})}return i}(e,c);return c.orderKey&&(t[c.orderKey]=e[c.orderKey]),t});if(Dt(md([...b,...C],e=>Bt(e).some(t=>"password"!==t&&!hd(el(e[t]),e[t]))))>0)return Promise.reject("htmlMarkupNotAllowed");if("users"===n&&Dt(b)>0){for(let e of b){let t=ke(e,"password",""),i=ke(e,"account",""),n=A(m,t,{account:i});if("error"===n.state)return Promise.reject(n.key);e.password=Dd(t,r)}ar(b,e=>{Zi(ke(e,"timeVerified",""))||(e.timeVerified=Xa())})}let v=[];ar(C,e=>{let t=ke(e,o,""),i=null;ar(e,(e,n)=>{let r=ke(a.get(t),n);rn(e)&&rn(r)&&e.length<r.length&&(null===i&&(i={[o]:t}),i[n]=null)}),null!==i&&v.push(i)});let L=null;try{Dt(u)>0&&await t(p,n,"del",Yr(u,e=>({id:e.id})),{mustExist:!0}),Dt(b)>0&&("tokens"===n?await t(p,n,"insert",b,{keepUserId:!0}):await t(p,n,"insert",b)),Dt(v)>0&&await t(p,n,"save",v,{mustExist:!0}),Dt(C)>0&&await t(p,n,"save",C,{mustExist:!0})}catch(e){L=e}if("users"===n){for(let e of u){let t=ke(e,"id","");await N(t).catch(e=>{i.error({event:"fun-updateTabItems-revokeTokenOnDelete",userId:t,err:Rn(e)})})}for(let e of s){if("n"!==ke(e,"isActive",""))continue;let t=ke(e,"id","");await N(t).catch(e=>{i.error({event:"fun-updateTabItems-revokeTokenOnDisable",userId:t,err:Rn(e)})})}}return null!==h&&h.clear("fun"),null!==L?(i.error({event:"fun-updateTabItems-write",key:"saveWriteFail",woName:n,err:Rn(L)}),Promise.reject("saveWriteFail")):void 0}})}catch(e){let t=function(e){let t=Na(e);return"string"==typeof t&&void 0!==kd[t]?kd[t]:null}(e);return null!==t?(i&&Mn(i.warn)&&i.warn({event:"fun-updateTabItems-reject",key:t,woName:n}),Promise.reject(t)):"rowsInvalid"===Na(e)?(i.error({event:"fun-updateTabItems-rowsInvalid",key:"anUnexpectedErrorOccurred",woName:n,err:Rn(e)}),Promise.reject("anUnexpectedErrorOccurred")):Promise.reject(e)}return"users"===n&&(b=Yr(b,e=>{let t={...e};return delete t.password,delete t.tokenVerify,t})),b},T=async t=>{let i=await e.tokens.select({token:t}),n=Dt(i);if(0===n)return console.log("invalid token"),Promise.reject("invalid token");if(n>=2)return console.log("duplicate tokens"),Promise.reject("duplicate tokens");let r=ke(i,0,null),s=ke(r,"isApp",""),o=null;if("y"!==s){let e=ke(r,"userId","");o=await I(e)}else{let e=ke(r,"userId","");if(!Zi(e))return console.log("invalid userId from token"),Promise.reject("invalid userId from token");o={id:e,account:"no account",name:"no name",email:"no email",description:"no description",from:"no from",redir:"no redir",isAdmin:"y",timeVerified:"2000-01-01T00:00:00.000+08:00",timeExpired:"",timeBlocked:"",isActive:"y"}}return{id:o.id,account:o.account,name:o.name,email:o.email,description:o.description,from:o.from,redir:o.redir,isApp:"y"===s?"y":"n",isAdmin:o.isAdmin,timeVerified:o.timeVerified,timeExpired:o.timeExpired,timeBlocked:o.timeBlocked,isActive:o.isActive,isForceChangePw:o.isForceChangePw}},k=async(e,t,i={})=>{if(!Zi(e)||!fu.includes(e))return Promise.reject("invalidUserQueryKey");let n=await x(e,t).catch(()=>null);return ki(n)?{id:n.id,account:n.account,name:n.name,email:n.email,description:n.description,from:n.from,redir:n.redir,isAdmin:n.isAdmin,timeVerified:n.timeVerified,timeExpired:n.timeExpired,timeBlocked:n.timeBlocked,isActive:n.isActive}:null},j=async(t={})=>{let i=ke(t,"needActive");Bi(i)||(i=!1);let n=ke(t,"deletePassword");Bi(n)||(n=!0);let r={};i&&(r={isActive:"y"});let s=await e.users.select(r);return n&&(s=Yr(s,e=>(delete e.password,delete e.tokenVerify,e))),s},Z=wd(),z=async(e,t={})=>(await v(e,t),await j(t)),Y=async(e,t={})=>e=await S("users",e,"id",{resetOrder:!0,...t,ocList:Z}),X=async()=>await e.tokens.select(),F=wd(),G=async()=>await e.ips.select(),O=wd(),W={getTokenByKV:async(t,i)=>{let n=null,r=await e.tokens.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("failed to find token"),Promise.reject("failed to find token");let s=Dt(r);return 0===s?Promise.reject(`can not find the token by keyToken[${t}]`):s>=2?(console.log(`duplicate token by keyToken[${t}]`),Promise.reject(`duplicate token by keyToken[${t}]`)):r[0]},createUser:async(s,a)=>{if(Zi(s)||(s="eng"),!c)return Promise.reject("userRegistrationNotAllowed");let l=ke(a,"account","");if(!Zi(l))return Promise.reject("userRegistrationAccountInvalid");let d=ke(a,"email","");if(!Zi(d)||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d))return Promise.reject("userRegistrationEmailFormatInvalid");let m=ke(a,"password",""),f=ke(a,"confirmPassword","");if(m!==f)return Promise.reject("userChangePasswordNotSame");let g=A(s,m,{account:l});if("error"===g.state)return Promise.reject(g.key);let w=ke(a,"name","");if(!Zi(w))return Promise.reject("userRegistrationNameInvalid");if([l,w,d].some(e=>el(e)!==e))return Promise.reject("htmlMarkupNotAllowed");let D,x=`createUser:account:${l}`,I=`createUser:email:${d}`;await h.setWithFree([x,I],()=>p(["users"],async()=>{let n=await e.users.select(),s=n.some(e=>ke(e,"account","")===l);if(s)return Promise.reject("userRegistrationAccountExists");let o=n.some(e=>ke(e,"email","")===d);if(o)return Promise.reject("userRegistrationEmailExists");let a=Dd(m,r);D=`${Ua()}`;let c=$l.users.funNew({account:l,password:a,name:w,email:d,tokenVerify:D,isAdmin:"n",isActive:"y"});await t(c.id,"users","insert",[c]).catch(e=>(i.error({event:"fun-createUser-insert",key:"userRegistrationFailed",account:l,err:Rn(e)}),Promise.reject("userRegistrationFailed")))})).catch(e=>{let t=e&&"string"==typeof e?e:e&&e.message||String(e);return t.includes(x)?Promise.reject("userRegistrationAccountExists"):t.includes(I)?Promise.reject("userRegistrationEmailExists"):Promise.reject(e)});try{let e=ke(o,`${s}.webName`,""),t=y("regVerifyEmTitle",s),i=M("regVerifyEmContent",s,{sender:e,name:w,verifyUrl:`${u}/api/verifyEmail?token=${D}&lang=${s}`});await n.send(e,t,i,d)}catch(e){console.log("send verify email error",e)}return{state:"success",msg:"ok"}},verifyEmail:async n=>Zi(n)?await p(["users"],async()=>{let r=await e.users.select({tokenVerify:n});if(0===Dt(r))return Promise.reject("verifyEmailInvalidToken");let s=r[0];if(Zi(ke(s,"timeVerified","")))return Promise.reject("verifyEmailAlreadyVerified");let o=null;return await t(s.id,"users","save",[{id:s.id,timeVerified:Xa()}],{mustExist:!0}).catch(e=>{o=e}),null!==o?(i.error({event:"fun-verifyEmail-save",key:"verifyEmailFailed",userId:s.id,err:Rn(o)}),Promise.reject("verifyEmailFailed")):{state:"success",msg:"ok"}}):Promise.reject("verifyEmailInvalidToken"),resendVerifyEmail:async(e,r,s)=>(Zi(e)||(e="eng"),Zi(r)&&Zi(s)?await m(`resendVerifyEmail:${r}`,async()=>{let a=Date.now(),c=g.get(r);if(c&&a-c<3e4)return Promise.reject("userRegistrationResendThrottled");let{userId:l,name:d,tokenVerify:m,errTemp:h}=await p(["users"],async()=>{let e=null;try{e=await D("account",r)}catch(e){}if(!e)return Promise.reject("userRegistrationResendInvalidEmail");if(ke(e,"email","")!==s)return Promise.reject("userRegistrationResendInvalidEmail");if(Zi(ke(e,"timeVerified","")))return Promise.reject("userRegistrationAlreadyVerified");let i=ke(e,"id",""),n=ke(e,"name",""),o=`${Ua()}`,a=null;return await t(i,"users","save",[{id:i,tokenVerify:o}],{mustExist:!0}).catch(e=>{a=e}),{userId:i,name:n,tokenVerify:o,errTemp:a}});if(null!==h)return i.error({event:"fun-resendVerifyEmail-save",key:"userRegistrationResendFailed",userId:l,err:Rn(h)}),Promise.reject("userRegistrationResendFailed");g.set(r,a);try{let t=ke(o,`${e}.webName`,""),i=y("regVerifyEmTitle",e),r=M("regVerifyEmContent",e,{sender:t,name:d,verifyUrl:`${u}/api/verifyEmail?token=${m}&lang=${e}`});await n.send(t,i,r,s)}catch(e){return console.log("resend verify email error",e),Promise.reject("userRegistrationResendFailed")}return{state:"success",msg:"ok"}}):Promise.reject("userRegistrationResendInvalidEmail")),checkUserPassword:A,checkTokenAndChangePassword:async(e,s,a,c)=>{if(await v(e),Zi(s)||(s="eng"),!Zi(a))return Promise.reject("userChangePasswordFail");let l=ke(await T(e),"id","");return await m(`changeUserPassword:${l}`,async()=>{let{u:u,email:d}=await p(["users"],async()=>{let e=await D("id",l,{deletePassword:!1}),n=ke(e,"account",""),o=A(s,c,{account:n});if("error"===o.state)return Promise.reject(o.key);let u=ke(e,"password","");if(!xd(a,u,r))return Promise.reject("userChangePasswordIncorrectOld");let p=ke(e,"email","");if(!Zi(p))return Promise.reject("anUnexpectedErrorOccurred");let d=Dd(c,r),m=null;return await t(l,"users","save",[{id:l,password:d,isForceChangePw:"n"}],{mustExist:!0}).catch(e=>{m=e}),null!==m?(i.error({event:"fun-changePassword-save",key:"userChangePasswordFail",userId:l,err:Rn(m)}),Promise.reject("userChangePasswordFail")):{u:e,email:p}});try{let e=ke(o,`${s}.webName`,"");if(!Zi(e))throw console.log("get(kpLang, lang)",ke(o,s)),console.log("lang",s),new Error("invalid sender");let t=ke(u,"name","unknow"),i=y("chpwEmTitle",s);if(!Zi(i))throw console.log("chpwEmTitle 取不到, lang",s),new Error("invalid title");let r=M("chpwEmContent",s,{sender:e,name:t});await n.send(e,i,r,d)}catch(t){console.log(t),i.error({event:"fun-changePassword-sendEmail",token:hu(e),lang:s,err:Rn(t)})}})},adminResetUserPassword:async(e,s,c)=>{if(await v(e,{perm:"writeUsers"}),Zi(s)||(s="eng"),!Zi(c))return Promise.reject("anUnexpectedErrorOccurred");let l=await T(e),u=ke(l,"id","");return"y"!==ke(l,"isAdmin","")?Promise.reject("adminResetPasswordForbidden"):u===c?Promise.reject("adminResetPasswordCannotResetSelf"):await m(`adminResetUserPassword:${c}`,async()=>{let l=Date.now(),d=w.get(c);if(d&&l-d<3e4)return Promise.reject("adminResetPasswordAlreadyTriggered");let{targetAccount:m,targetName:h,targetEmail:f,newPassword:g}=await p(["users"],async()=>{let n=null;try{n=await D("id",c,{deletePassword:!0})}catch(e){return Promise.reject("adminResetPasswordUserNotFound")}if(!ki(n))return Promise.reject("adminResetPasswordUserNotFound");let s=ke(n,"account",""),o=ke(n,"name","unknow"),l=ke(n,"email",""),p=function(e,t=""){let i=e.minLength||8,n=e.maxLength||16,r=Math.min(Math.max(i,12),n),s="abcdefghijklmnopqrstuvwxyz".split(""),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),a="0123456789".split(""),c="!@#$%^&*()_+-=[]{}|;:,.<>?".split(""),l=e.forbiddenChars||[];c=c.filter(e=>!l.includes(e));let u=[];(e.requireLowercase||e.requireLetter)&&(u=u.concat(s)),e.requireUppercase&&(u=u.concat(o)),!e.requireLetter||e.requireUppercase||e.requireLowercase||(u=u.concat(o)),e.requireDigit&&(u=u.concat(a)),e.requireSpecial&&(u=u.concat(c)),0===u.length&&(u=s.concat(o).concat(a));for(let i=0;i<20;i++){let i=[];for(e.requireLetter&&i.push(Id(s.concat(o))),e.requireUppercase&&i.push(Id(o)),e.requireLowercase&&i.push(Id(s)),e.requireDigit&&i.push(Id(a)),e.requireSpecial&&i.push(Id(c));i.length<r;)i.push(Id(u));bd(i);let n=i.join("");try{return gd(n,{useKeyForError:!0,useOnlyOneError:!0,numLenMin:e.minLength,numLenMax:e.maxLength,requireLetter:e.requireLetter,requireUppercase:e.requireUppercase,requireLowercase:e.requireLowercase,requireDigit:e.requireDigit,requireSpecial:e.requireSpecial,noSpace:e.noSpace,onlyAscii:e.onlyAscii,forbiddenChars:e.forbiddenChars,commonPasswordBlacklist:e.commonPasswordBlacklist,account:t,noConsecutiveCharsFromAccount:e.noConsecutiveCharsFromAccount,consecutiveCharsMinMatch:e.consecutiveCharsMinMatch}),n}catch(e){}}throw new Error("cannot generate random password matching policy")}(a,s),d=Dd(p,r),m=null;return await t(u,"users","save",[{id:c,password:d,isForceChangePw:"y"}],{mustExist:!0}).catch(e=>{m=e}),null!==m?(i.error({event:"fun-adminResetUserPassword-save",key:"adminResetPasswordFailed",token:hu(e),targetUserId:c,err:Rn(m)}),Promise.reject("adminResetPasswordFailed")):{targetAccount:s,targetName:o,targetEmail:l,newPassword:p}});w.set(c,l);try{if(Zi(f)){let e=ke(o,`${s}.webName`,"");if(!Zi(e))throw new Error("invalid sender");let t=y("resetPwEmTitle",s);if(!Zi(t))throw new Error("invalid title");let i=M("resetPwEmContent",s,{sender:e,name:h,account:m,newPassword:g});await n.send(e,t,i,f)}else i.error({event:"fun-adminResetUserPassword-noEmail",token:hu(e),targetUserId:c})}catch(t){console.log(t),i.error({event:"fun-adminResetUserPassword-sendEmail",token:hu(e),targetUserId:c,err:Rn(t)})}return{state:"success"}})},getIpByKV:async(t,i)=>{let n=null,r=await e.ips.select({[t]:i}).catch(e=>{n=e});if(n)return console.log(n),console.log("keyIp",t),console.log("valueIp",i),console.log("failed to find ip"),Promise.reject("failed to find ip");let s=Dt(r);return 0===s?Promise.reject(`can not find the ip by keyIp[${t}]`):s>=2?(console.log("keyIp",t),console.log("valueIp",i),console.log(`duplicate ip by keyIp[${t}]`),Promise.reject(`duplicate ip by keyIp[${t}]`)):r[0]},revokeTokensByUserId:async e=>await p(["tokens"],()=>N(e)),revokeTokensByUserIdLocked:N,getGenUserByKV:x,getGenUserByUserId:I,getGenUserByAccount:async(e,t={})=>await x("account",e),loginByAccountAndPassword:async(t,i)=>{if(!Zi(t)||!Zi(i))return Promise.reject("failedLoginForCatch");let n=await e.users.select({account:t});if(0===Dt(n))return Promise.reject("failedLoginForCatch");let s=n[0];if(!xd(i,ke(s,"password",""),r))return Promise.reject("failedLoginForCatch");if(!Zi(ke(s,"timeVerified","")))return Promise.reject("userRegistrationNotVerified");let o=ke(s,"timeExpired","");if(Zi(o)&&tu(o)){if(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>o)return Promise.reject("loginAccountExpired")}let a=ke(s,"id",""),{token:c,user:l}=await b(a,{recheckUser:!0,verifiedUser:s,withUser:!0});return{id:l.id,account:l.account,name:l.name,email:l.email,description:l.description,from:l.from,redir:l.redir,isAdmin:l.isAdmin,isActive:l.isActive,isForceChangePw:l.isForceChangePw,token:c}},logoutByToken:async e=>Zi(e)?await p(["tokens"],()=>E(e)):Promise.reject("tokenExpired"),checkToken:v,refreshToken:async e=>Zi(e)?await p(["tokens"],()=>L(e)):Promise.reject("tokenExpired"),getUserByToken:T,checkTokenAndGetUserByToken:async(e,t,i={})=>(await v(e,i),await T(t).catch(()=>null)),getUserInfor:k,checkTokenAndGetUserInfor:async(e,t,i,n={})=>(await v(e,n),await k(t,i)),getUsersList:j,getUsersListCache:async()=>await Z.getProxy("fun",{fun:j,inputs:null,timeExpired:3e4}),checkTokenAndGetUsersList:z,checkTokenAndGetActiveUsersList:async(e,t={})=>await z(e,{...t,needActive:!0}),omitUserCredential:e=>{let t={...e};for(let e of Td)delete t[e];return t},updateUsersList:Y,checkTokenAndUpdateUsersList:async(e,t,i,n={},r=void 0)=>{await v(e,n),Zi(t)||(t="eng");let s=await T(e),o=ke(s,"id","");if(!rn(i))return Promise.reject("invalidRows");if(!("y"===ke(s,"isApp",""))){let e=null;for(let t of i)if(ke(t,"id","")===o){e=t;break}if(Zi(o)&&!ki(e))return Promise.reject("cannotDeleteSelf");if(ki(e)){if("y"!==ke(e,"isAdmin",""))return Promise.reject("cannotDemoteSelf");if("y"!==ke(e,"isActive",""))return Promise.reject("cannotDisableSelf")}}return await f("updateUsersList",o,async()=>i=await Y(i,{lang:t,operatorId:o,optClient:r}))},getTokensList:X,getTokensListCache:async()=>await F.getProxy("fun",{fun:X,inputs:null,timeExpired:3e4}),checkTokenAndGetTokensList:async(e,t={})=>(await v(e,t),await X()),checkTokenAndUpdateTokensList:async(e,t,i={},n=void 0)=>{await v(e,i);let r=ke(await T(e),"id","");return await f("updateTokensList",r,async()=>(t=await(async(e,t={})=>rn(e)?e=await S("tokens",e,"id",{resetOrder:!1,operatorId:ke(t,"operatorId",""),optClient:ke(t,"optClient"),ocList:F}):Promise.reject("invalidRows"))(t,{operatorId:r,optClient:n}),t))},getIpsList:G,getIpsListCache:async()=>await O.getProxy("fun",{fun:G,inputs:null,timeExpired:3e4}),checkTokenAndGetIpsList:async(e,t={})=>(await v(e,t),await G()),checkTokenAndUpdateIpsList:async(e,t,i={},n=void 0)=>{await v(e,i);let r=ke(await T(e),"id","");return await f("updateIpsList",r,async()=>(t=await(async(e,t={})=>await S("ips",e,"id",{resetOrder:!1,operatorId:ke(t,"operatorId",""),optClient:ke(t,"optClient"),ocList:O}))(t,{operatorId:r,optClient:n}),t))}};return W}let Yd={csIng:{eng:"Connecting...",cht:"連線中..."},csLogin:{eng:"Logged in",cht:"已登入"},csLogout:{eng:"Logged out",cht:"已登出"},csErrConn:{eng:"Unable to connect",cht:"無法連線"},csErrLogin:{eng:"Login denied",cht:"拒絕登入"},aggridLanguage:{eng:"en",cht:"zh-tw"},id:{eng:"ID",cht:"主鍵"},systemMessage:{eng:"System message",cht:"系統確認訊息"},ok:{eng:"OK",cht:"確認"},no:{eng:"No",cht:"取消"},yes:{eng:"Yes",cht:"確定"},y:{eng:"Yes",cht:"是"},n:{eng:"No",cht:"否"},empty:{eng:"Empty",cht:"無"},to:{eng:"To",cht:"至"},at:{eng:"At",cht:"於"},unknow:{eng:"Unknown",cht:"未知"},waitingData:{eng:"Waiting data...",cht:"等待數據中..."},saveChanges:{eng:"Save changes",cht:"儲存變更"},from:{eng:"From",cht:"來源"},save:{eng:"Save",cht:"儲存"},close:{eng:"Close",cht:"關閉"},send:{eng:"Send",cht:"送出"},cancel:{eng:"Cancel",cht:"取消"},processing:{eng:"Processing...",cht:"處理中請稍後..."},anUnexpectedErrorOccurred:{eng:"An unexpected error occurred, please contact the administrator",cht:"發生非預期錯誤,請洽管理員"},getDataError:{eng:"Failed to get data, please try again later",cht:"取得數據失敗,請稍後再試"},timeCreate:{eng:"Created time",cht:"創建時間"},userIdUpdate:{eng:"ID of the updated user",cht:"最新變更使用者主鍵"},timeUpdate:{eng:"Updated time",cht:"最新變更時間"},userId:{eng:"ID of the user",cht:"使用者主鍵"},account:{eng:"Account",cht:"帳號"},password:{eng:"Password",cht:"密碼"},toggleToShowPassword:{eng:"To show password",cht:"變更為顯示密碼模式"},toggleToHidePassword:{eng:"To hide password",cht:"變更為隱藏密碼模式"},username:{eng:"Username",cht:"使用者姓名"},email:{eng:"Email",cht:"電子郵件"},name:{eng:"Name",cht:"名稱"},description:{eng:"Description",cht:"說明"},redir:{eng:"Redirect",cht:"登入後轉至網址"},login:{eng:"Log in",cht:"登入"},logout:{eng:"Log out",cht:"登出"},menuTreeShow:{eng:"Show menu",cht:"顯示選單"},menuTreeHide:{eng:"Hide menu",cht:"隱藏選單"},menuUser:{eng:"User menu",cht:"使用者選單"},language:{eng:"Language",cht:"語系"},mmStaInfor:{eng:"Statistics information",cht:"統計資訊"},mmUserInfor:{eng:"User information",cht:"使用者資訊"},mmUsersList:{eng:"Users list",cht:"使用者清單"},mmUsersListMsg:{eng:"Provide a list of users, which can be added, edited, deleted, etc.",cht:"提供目前使用者資料清單,可進行新增、編輯、刪除等作業。"},mmTokensList:{eng:"Tokens list",cht:"金鑰清單"},mmTokensListMsg:{eng:"Provide a list of tokens, which can be deleted, etc.",cht:"提供目前金鑰資料清單,可進行強制登出等作業。"},mmIpsList:{eng:"Ips list",cht:"IP清單"},mmIpsListMsg:{eng:"Provide a list of IPs, which can be blocked, etc.",cht:"提供目前存取IP清單,可進行封鎖等作業。"},failedLoginForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLoginForNoToken:{eng:"Can not get the token",cht:"無有效金鑰"},failedLoginForNoRedir:{eng:"Can not get the url for redirection",cht:"無有效轉址"},failedLoginForCatch:{eng:"User account or password is incorrect",cht:"使用者帳密錯誤無法登入"},failedLogoutForNoWebKey:{eng:"Can not get the web key",cht:"無有效站台唯一識別資訊"},failedLogoutForCatch:{eng:"Can not logout",cht:"使用者登出失敗"},userStatus:{eng:"Status",cht:"帳號狀態"},isVerified:{eng:"Verified",cht:"帳號是否驗證"},isVerifiedY:{eng:"Verified",cht:"帳號已驗證"},isVerifiedN:{eng:"Not verified",cht:"帳號未驗證"},userTimeVerified:{eng:"Verified time",cht:"帳號驗證狀態與時間"},isVerifiedWaiting:{eng:"Waiting for verification",cht:"等待驗證中"},isExpired:{eng:"Expired",cht:"帳號是否過期"},isExpiredY:{eng:"Expired",cht:"帳號已過期"},isExpiredN:{eng:"Not expired",cht:"帳號未過期"},userTimeExpired:{eng:"Expired time",cht:"帳號過期狀態與時間"},isExpiredDeny:{eng:"Account login prohibited",cht:"禁止帳號登入"},isExpiredNever:{eng:"Never expires",cht:"永不過期"},isBlocked:{eng:"Blocked",cht:"帳號是否被封鎖"},isBlockedY:{eng:"Blocked",cht:"帳號已封鎖"},isBlockedN:{eng:"Not blocked",cht:"帳號未封鎖"},userTimeBlocked:{eng:"Blocked time",cht:"帳號封鎖狀態與時間"},isBlockedNormalStatus:{eng:"Normal status",cht:"狀態正常"},isAdmin:{eng:"Administrator",cht:"是否為系統管理者"},userRole:{eng:"Role",cht:"角色"},userRoleAdmin:{eng:"Administrator",cht:"系統管理者"},userRoleGeneral:{eng:"General",cht:"一般使用者"},isActive:{eng:"Active",cht:"帳號是否有效"},isActiveY:{eng:"Active",cht:"帳號有效"},isActiveMsgY:{eng:"Enabling",cht:"啟用中"},isActiveN:{eng:"Inactive",cht:"帳號無效"},isActiveMsgN:{eng:"Deactivated",cht:"已停用"},errInAccounts:{eng:"Account errors",cht:"帳號出現錯誤待修復"},errItemsByRedir:{eng:"Redirect errors",cht:"登入後轉址出現錯誤待修復"},modeEdit:{eng:"Edit mode",cht:"編輯模式"},showTabCols:{eng:"Show columns",cht:"顯示欄位"},selectDate:{eng:"Select date",cht:"請選擇日期"},dtPickerYear:{eng:"y",cht:"年"},dtPickerMonth:{eng:"m",cht:"月"},dtPickerWeekdays:{eng:"Su,Mo,Tu,We,Th,Fr,Sa",cht:"日,一,二,三,四,五,六"},userName:{eng:"Name of user",cht:"使用者名稱"},userAccountEmpty:{eng:"Invalid account of user",cht:"尚未給予有效使用者帳號"},userAccountDuplicate:{eng:"Duplicate account of user",cht:"使用者帳號出現重複"},userEmailEmpty:{eng:"Empty email of user",cht:"尚未給予使用者Email"},userEmailError:{eng:"Invalid email of user",cht:"使用者Email格式錯誤"},userEmailDuplicate:{eng:"Duplicate email of user",cht:"使用者Email出現重複"},userRedirEmpty:{eng:"Invalid redirect of user",cht:"尚未給予有效登入後轉址"},userPasswordEmpty:{eng:"Empty password of user",cht:"尚未給予使用者密碼"},userAddEmpty:{eng:"No user",cht:"尚未新增使用者資料"},userAdd:{eng:"Add user",cht:"新增使用者"},userAddNameNew:{eng:"New user",cht:"新使用者"},userAddIdNew:{eng:"Waiting generation",cht:"待自動給予"},userCopy:{eng:"Copy user",cht:"複製使用者"},userCopyNameNew:{eng:"copy",cht:"複製"},userDeleteCheckUsers:{eng:"Delete user(s)",cht:"刪除勾選使用者"},userResetPassword:{eng:"Reset password",cht:"重設密碼"},userSaveUsersFail:{eng:"Failed to save users",cht:"儲存使用者數據失敗"},userSaveUsersSuccess:{eng:"Save users successfully",cht:"儲存使用者數據成功"},userEditNoUserId:{eng:"Can not find the id of user",cht:"無法找到使用者Id"},userEditNoUserData:{eng:"Can not find the data of user",cht:"無法找到使用者數據"},userPassword_keyInvalidPassword:{eng:"Invalid password",cht:"密碼非有效字串"},userPassword_keyLimNumLenMinOrMax:{eng:"The minimum password length is greater than the maximum length",cht:"設定密碼最小長度大於最大長度"},userPassword_keyLimHasSpace:{eng:"Password must not contain whitespace characters",cht:"密碼不可包含空白字元"},userPassword_keyLimNonAsciiChar:{eng:"Password may only contain ASCII printable characters (letters, digits, symbols)",cht:"密碼僅允許使用英文大小寫、數字及特殊符號"},userPassword_keyLimNumLenMin:{eng:"Password length must be at least {minLength} characters",cht:"密碼長度須大於等於{minLength}個字元"},userPassword_keyLimNumLenMax:{eng:"Password length must not exceed {maxLength} characters",cht:"密碼長度須小於等於{maxLength}個字元"},userPassword_keyLimRequireLetter:{eng:"Password must contain at least one letter",cht:"密碼須包含至少一個英文字母"},userPassword_keyLimRequireUppercase:{eng:"Password must contain at least one uppercase letter",cht:"密碼須包含至少一個大寫英文字母"},userPassword_keyLimRequireLowercase:{eng:"Password must contain at least one lowercase letter",cht:"密碼須包含至少一個小寫英文字母"},userPassword_keyLimRequireDigit:{eng:"Password must contain at least one digit",cht:"密碼須包含至少一個數字"},userPassword_keyLimRequireSpecial:{eng:"Password must contain at least one special character",cht:"密碼須包含至少一個特殊符號"},userPassword_keyLimForbiddenChar:{eng:"Password must not contain forbidden characters",cht:"密碼不可包含禁止字元"},userPassword_keyLimCommonPassword:{eng:"This password is too common and not allowed",cht:"此密碼為常見弱密碼,不允許使用"},userPassword_keyLimConsecutiveCharsFromAccount:{eng:"Password must not contain {consecutiveCharsMinMatch} or more consecutive characters from your account name",cht:"密碼不可包含與帳號相同之{consecutiveCharsMinMatch}個以上連續字元"},userChangePassword:{eng:"Change Password",cht:"變更密碼"},userChangePasswordOldPassword:{eng:"Old password",cht:"舊密碼"},userChangePasswordNewPassword:{eng:"New password",cht:"新密碼"},userChangePasswordConfirmPassword:{eng:"Confirm password",cht:"確認新密碼"},userChangePasswordForNoOldPassword:{eng:"Please enter old password",cht:"尚未給予舊密碼"},userChangePasswordForNoNewPassword:{eng:"Please enter new password",cht:"尚未給予新密碼"},userChangePasswordForNoConfirmPassword:{eng:"Please enter confirm password",cht:"尚未給予確認密碼"},userChangePasswordNotSame:{eng:"New password and confirm password do not match",cht:"新密碼與確認密碼不一致"},userChangePasswordSuccess:{eng:"Password change successful, please log in again.",cht:"密碼變更成功,請使用新密碼重新登入。"},userChangePasswordFail:{eng:"Password change failed.",cht:"密碼變更失敗,請確認輸入密碼是否正確"},userChangePasswordIncorrectOld:{eng:"The old password is incorrect.",cht:"舊密碼不正確。"},userChangePasswordForNetError:{eng:"Password validation failed. Please try again later.",cht:"密碼檢測失敗,請稍後再試"},userRegistration:{eng:"Register",cht:"申請帳號"},userRegistrationName:{eng:"Name",cht:"姓名"},userRegistrationEmail:{eng:"Email",cht:"電子郵件"},userRegistrationConfirmPassword:{eng:"Confirm password",cht:"確認密碼"},userRegistrationSubmit:{eng:"Submit",cht:"送出申請"},userRegistrationSuccess:{eng:"Registration successful. Please check your email to verify your account.",cht:"帳號申請成功,請至信箱收取驗證信以啟用帳號。"},userRegistrationNotAllowed:{eng:"User registration is not available.",cht:"目前不開放使用者自行申請帳號。"},userRegistrationFailed:{eng:"Registration failed. Please try again later.",cht:"帳號申請失敗,請稍後再試。"},userRegistrationAccountInvalid:{eng:"Please enter a valid account.",cht:"請輸入有效的帳號。"},userRegistrationEmailFormatInvalid:{eng:"Please enter a valid email address.",cht:"請輸入有效的電子郵件格式。"},userRegistrationNameInvalid:{eng:"Please enter a valid name.",cht:"請輸入有效的姓名。"},userRegistrationAccountExists:{eng:"This account already exists.",cht:"此帳號已存在。"},userRegistrationEmailExists:{eng:"This email already exists.",cht:"此電子郵件已存在。"},userRegistrationBackToLogin:{eng:"Back to login",cht:"返回登入"},userRegistrationNotVerified:{eng:"Your account has not been verified. Please check your email and click the verification link.",cht:"您的帳號尚未完成 email 驗證,請至信箱點擊驗證連結。"},userRegistrationResendVerify:{eng:"Resend verification email",cht:"重寄驗證信"},userRegistrationResendSuccess:{eng:"Verification email has been resent. Please check your inbox.",cht:"驗證信已重新寄出,請至信箱收取。"},userRegistrationAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},userRegistrationResendSubmit:{eng:"Send verification email",cht:"寄送驗證信"},userRegistrationResendInvalidEmail:{eng:"The email address does not match the account. Please check and try again.",cht:"電子郵件與帳號不符,請確認後再試。"},userRegistrationResendFailed:{eng:"Failed to send verification email. Please try again later.",cht:"驗證信寄送失敗,請稍後再試。"},userRegistrationResendThrottled:{eng:"A verification email was just sent. Please wait a moment before trying again.",cht:"剛才已寄出驗證信,請稍候片刻再試。"},verifyEmailInvalidToken:{eng:"Invalid or expired verification link.",cht:"驗證連結無效或已失效。"},verifyEmailAlreadyVerified:{eng:"This account has already been verified.",cht:"此帳號已完成驗證。"},verifyEmailFailed:{eng:"Email verification failed. Please click the verification link again later.",cht:"電子郵件驗證失敗,請稍後再點一次驗證連結。"},userRegistrationVerifySuccess:{eng:"Email verified successfully. Please log in.",cht:"電子郵件驗證成功,請登入。"},loginAccountBlocked:{eng:"Your account has been temporarily locked due to multiple failed login attempts. Please try again later.",cht:"您的帳號因多次登入失敗已被暫時鎖定,請稍後再試。"},loginAccountExpired:{eng:"Your account has expired. Please contact the administrator.",cht:"您的帳號已過期,請聯繫管理員。"},loginUnknownError:{eng:"An unexpected error occurred during login. Please try again later.",cht:"登入時發生未預期的錯誤,請稍後再試。"},tokenExpired:{eng:"Your session has expired. Please log in again.",cht:"登入逾時,請重新登入。"},tokenNoPermission:{eng:"Token does not have permission.",cht:"權杖無存取權限。"},invalidUserQueryKey:{eng:"Invalid query field. Please use id, account, email or name.",cht:"查詢欄位無效,請使用 id、account、email 或 name。"},invalidUrl:{eng:"Invalid url.",cht:"網址無效。"},invalidTokenSelf:{eng:"Invalid self token.",cht:"自身權杖無效。"},invalidTokenTar:{eng:"Invalid target token.",cht:"目標權杖無效。"},invalidUserIdTar:{eng:"Invalid target user id.",cht:"目標使用者 Id 無效。"},noTokenKeyValueInUrl:{eng:"Missing token={sysToken}, key=token or value={token} in url.",cht:"網址缺少 token={sysToken}、key=token 或 value={token}。"},noTokenKeyUserIdInUrl:{eng:"Missing token={sysToken}, key=id or value={userId} in url.",cht:"網址缺少 token={sysToken}、key=id 或 value={userId}。"},noTokenInUrl:{eng:"Missing token={sysToken} in url.",cht:"網址缺少 token={sysToken}。"},cannotGetUserByUrl:{eng:"Cannot get user by url.",cht:"無法由網址取得使用者。"},cannotGetUsersByUrl:{eng:"Cannot get users by url.",cht:"無法由網址取得使用者清單。"},cannotGetUserDataByUrl:{eng:"Cannot get user data by url.",cht:"無法由網址取得使用者資料。"},cannotGetUsersDataByUrl:{eng:"Cannot get users data by url.",cht:"無法由網址取得使用者清單資料。"},noUserDataByUrl:{eng:"No user data by url.",cht:"該網址無使用者資料。"},noUsersDataByUrl:{eng:"No users data by url.",cht:"該網址無使用者清單資料。"},noUserDataAfterConvert:{eng:"No user data after conversion.",cht:"轉換後無使用者資料。"},invalidRows:{eng:"Invalid data format.",cht:"資料格式錯誤。"},htmlMarkupNotAllowed:{eng:'The input contains HTML markup that is not allowed (such as "<" followed by a letter). Please remove it and try again.',cht:"輸入內容含有不允許的 HTML 標記(如「<」後接英文字母),請移除後再試一次。"},accountRequired:{eng:"Account is required.",cht:"帳號為必填。"},accountDuplicate:{eng:"Account already exists.",cht:"帳號已存在。"},getStaDataFailed:{eng:"Failed to retrieve statistics data.",cht:"統計資料取得失敗。"},token:{eng:"Token",cht:"金鑰"},isApp:{eng:"For app",cht:"是否為應用系統金鑰"},tokenTimeCreate:{eng:"Created time",cht:"金鑰創建時間"},tokenTimeEnd:{eng:"End time",cht:"金鑰到期時間"},tokenTimeUpdate:{eng:"Updated time",cht:"金鑰更新時間"},tokenDeleteCheckTokens:{eng:"Delete checked token(s)",cht:"刪除勾選金鑰"},tokenSaveTokensFail:{eng:"Failed to save tokens",cht:"儲存金鑰數據失敗"},tokenSaveTokensSuccess:{eng:"Save tokens successfully",cht:"儲存金鑰數據成功"},tokenPerms:{eng:"App permissions",cht:"應用系統權限"},tokenPermsBase:{eng:"Basic permission, always granted",cht:"基本權限,恆具備"},tokenPermsHigh:{eng:"Equivalent to administrator",cht:"等同管理者權限"},tokenPermsInvalid:{eng:"Invalid app token permissions.",cht:"應用系統金鑰權限設定無效。"},tokenSessionAddNotAllowed:{eng:"Login tokens cannot be added. Nothing was saved.",cht:"不可新增登入權杖,本次未儲存任何變更"},appPerm_readUsers:{eng:"Read users",cht:"讀使用者"},appPerm_writeUsers:{eng:"Write users",cht:"寫使用者"},appPerm_readTokens:{eng:"Read tokens",cht:"讀金鑰"},appPerm_writeTokens:{eng:"Write tokens",cht:"寫金鑰"},appPerm_readIps:{eng:"Read IPs",cht:"讀IP"},appPerm_writeIps:{eng:"Write IPs",cht:"寫IP"},appPerm_readStats:{eng:"Read statistics",cht:"讀統計"},ip:{eng:"IP",cht:"IP"},ipTimeBlocked:{eng:"Blocked time",cht:"IP封鎖時間"},ipDeleteCheckIps:{eng:"Delete checked IP(s)",cht:"刪除勾選IP"},ipSaveIpsFail:{eng:"Failed to save IPs",cht:"儲存IP數據失敗"},ipSaveIpsSuccess:{eng:"Save IPs successfully",cht:"儲存IP數據成功"},statisticsInformation:{eng:"Statistics Information",cht:"統計資訊"},statisticsInformationDescription:{eng:"Provides an overview of system usage and security metrics.",cht:"提供系統使用情況和安全指標的總覽。"},userGroupInfor:{eng:"User Information",cht:"使用者資訊區"},totalUsers:{eng:"Total Users",cht:"總使用者"},activeUsers:{eng:"Active Users",cht:"活躍使用者"},blockedUsers:{eng:"Blocked Users",cht:"已封鎖使用者"},expiredUsers:{eng:"Expired Users",cht:"已過期使用者"},accessActivityMonitoring:{eng:"Access Activity Monitoring",cht:"存取活動監測"},userLoginFrequency:{eng:"User Login Frequency",cht:"使用者登入頻率"},last7Days:{eng:"Last 7 days",cht:"最近7天"},tokenUsageFrequency:{eng:"Token Usage Frequency",cht:"金鑰使用頻率"},ipConnectionFrequency:{eng:"IP Connection Frequency",cht:"IP 連線頻率"},controlStatus:{eng:"Control Status",cht:"管控狀態"},tokenCharacteristic:{eng:"Token Characteristic",cht:"金鑰狀態"},activeTokens:{eng:"Active Tokens",cht:"有效金鑰數量"},createdLast24h:{eng:"Created in last 24h",cht:"最近24小時內創建"},endingNext24h:{eng:"Ending in next 24h",cht:"未來24小時內到期"},endedTokens:{eng:"Ended Tokens",cht:"已到期金鑰數量"},ipCharacteristic:{eng:"IP Characteristic",cht:"IP狀態"},conn24h:{eng:"Connections in last 24h",cht:"最近24小時內連線數量"},blockedIps:{eng:"Blocked IPs",cht:"當前已封鎖IP數量"},selectItem1hr:{eng:"1 hour",cht:"1小時"},selectItem4hr:{eng:"4 hour",cht:"4小時"},selectItem8hr:{eng:"8 hour",cht:"8小時"},selectItem1day:{eng:"1 day",cht:"1日"},countAttempt:{eng:"Attempt",cht:"嘗試登入"},countSuccess:{eng:"Success",cht:"登入成功"},countError:{eng:"Error",cht:"登入失敗"},count:{eng:"Count",cht:"總次數"},showIndividually:{eng:"Show individually",cht:"個別顯示"},numberOrder:{eng:"No.",cht:"排序"},total:{eng:"Total",cht:"總計"},last1Day:{eng:"Last 1 day",cht:"最近1天"},last8Hour:{eng:"Last 8 hour",cht:"最近8小時"},last4Hour:{eng:"Last 4 hour",cht:"最近4小時"},last1Hour:{eng:"Last 1 hour",cht:"最近1小時"},showMax5:{eng:"Show max 5 rows",cht:"顯示前5筆"},showAll:{eng:"Show all",cht:"顯示全部"},regVerifyEmTitle:{eng:"Please verify your email",cht:"請驗證您的電子郵件"},regVerifyEmContent:{eng:'Dear {name},<br><br>Thank you for registering at {sender}.<br><br>Please click the link below to verify your email and activate your account:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>If you did not register, please ignore this email.<br><br>This is an automated notification. Please do not reply.',cht:'{name} 您好:<br><br>感謝您註冊「{sender}」。<br><br>請點擊以下連結以驗證您的電子郵件並啟用帳號:<br><a href="{verifyUrl}">{verifyUrl}</a><br><br>若您未曾進行此操作,請忽略此信。<br><br>此為系統自動通知信件,請勿直接回覆。'},chpwEmTitle:{eng:"Password has been changed",cht:"密碼已進行變更"},chpwEmContent:{eng:"Dear User {name},<br><br>This is to inform you that the password for your {sender} account has been successfully changed.<br><br>If you did not perform this action or have any concerns regarding your account security, please contact the system administrator as soon as possible to ensure the safety of your account.<br><br>This is an automated system notification. Please do not reply to this email.",cht:"使用者 {name} 您好:<br><br>您於「{sender}」的密碼已成功變更。<br><br>若您未曾進行此操作,或對帳號安全有任何疑慮,請您儘速聯絡系統管理單位,以確保帳號安全。<br><br>此為系統自動通知信件,請勿直接回覆。"},resetPwEmTitle:{eng:"Your password has been reset",cht:"您的密碼已被重設"},resetPwEmContent:{eng:"Dear {name},<br><br>The administrator has reset the password for your {sender} account.<br><br>Account: {account}<br>New password: <strong>{newPassword}</strong><br><br>Please log in with this password and immediately set your own new password upon login.<br><br>If you did not expect this change, please contact the administrator.<br><br>This is an automated notification.",cht:"使用者 {name} 您好:<br><br>管理員已重設您於「{sender}」的密碼。<br><br>帳號:{account}<br>新密碼:<strong>{newPassword}</strong><br><br>請以此密碼登入後,立即變更為您自己的新密碼。<br><br>若非您預期之操作,請聯繫管理員。<br><br>此為系統自動通知信件。"},adminResetPasswordConfirm:{eng:"Confirm to reset password for {account}?",cht:"確定對 {account} 重設密碼?"},adminResetPasswordSuccess:{eng:"Password reset and new password sent to {email}",cht:"已重設並寄送新密碼至 {email}"},adminResetPasswordCannotResetSelf:{eng:"Cannot reset your own password via this action",cht:"不可對自己重設密碼"},adminResetPasswordForbidden:{eng:"Forbidden: admin permission required",cht:"權限不足:須具管理員身分"},adminResetPasswordUserNotFound:{eng:"User not found",cht:"查無使用者"},adminResetPasswordFailed:{eng:"Failed to reset password",cht:"重設密碼失敗"},adminResetPasswordAlreadyTriggered:{eng:"A password reset was just triggered. Please wait a moment before trying again.",cht:"剛才已觸發重設密碼,請稍候片刻再試。"},userForceChangePwPrompt:{eng:"Your password has been reset by the administrator. Please change it to your own new password.",cht:"您的密碼已由管理員重設,請按確認後變更為您自己的新密碼。"},cannotDemoteSelf:{eng:"Cannot demote yourself from admin",cht:"不可解除自己的管理員權限"},cannotDisableSelf:{eng:"Cannot disable yourself",cht:"不可停用自己的帳號"},cannotDeleteSelf:{eng:"Admin cannot delete yourself",cht:"管理員不得刪除自己"},saveInProgress:{eng:"The previous save is still in progress. Please do not submit again.",cht:"上一次儲存仍在處理中,請勿重複送出"},saveNewRowExists:{eng:"The newly added data has already been saved. Please reload the page before making changes.",cht:"新增之資料已儲存過,請重新整理頁面後再操作"},saveWriteFail:{eng:"Not all changes were written, and some may have taken effect. Please reload the page and check before making changes.",cht:"資料寫入未全部完成,部分變更可能已生效,請重新整理頁面確認後再操作"},saveStale:{eng:"The data has been changed by another user or the system since you loaded this page. Nothing was saved. Please reload the page and make your changes again.",cht:"資料自您載入後已被其他使用者或系統更動,本次未儲存任何變更,請重新載入頁面後再操作"},saveRowNotFound:{eng:"Some of the data no longer exists (it may have been deleted by another user). Nothing was saved. Please reload the page and make your changes again.",cht:"部分資料已不存在(可能已被其他使用者刪除),本次未儲存任何變更,請重新載入頁面後再操作"},saveBaselineFormat:{eng:"The page data version is not recognized. Nothing was saved. Please reload the page and make your changes again.",cht:"頁面資料版本無法辨識,本次未儲存任何變更,請重新載入頁面後再操作"}},Xd=(e={})=>{let t=ke(e,"kpLangExtEmail");ki(t)||(t={});let i=ke(e,"kpLangExt");ki(i)||(i={});let n=ke(e,"webName");ki(n)||(n={});let r=ke(e,"webDescription");ki(r)||(r={});let s={};s={...s,...Yd},ki(t)&&ar(t,(e,t)=>{s[t]={...ke(s,t,{}),...e}}),ki(i)&&(s={...s,...i}),ki(n)&&(s={...s,webName:{...n}}),ki(r)&&(s={...s,webDescription:{...r}});let o={};return ar(["eng","cht"],e=>{let t={};ar(s,(i,n)=>{t[n]=i[e]}),o[e]=t}),o},Fd=Symbol("wrapTimer");function Gd(e,t,i=null){if(!Mn(t))throw new Error(`invalid fn of timer[${e}]`);let n=!1,r=async()=>{if(!n){n=!0;try{await t()}catch(t){if(Mn(i))try{await i({timer:e,err:t})}catch(e){}}finally{n=!1}}};return r[Fd]=e,r}let Od=/^(\d{1,3}(?:\.\d{1,3}){3}):(\d{1,5})$/,Wd=/^\[([^[\]]+)\]:(\d{1,5})$/;function Pd(e,t,i={}){let{procOrm:n,withTabLocks:r,srLog:s,minForAccountLoginFailed:o,numForAccountLoginFailed:a,minBlockForAccountLoginFailed:c,minForTokenCallApi:l,numForTokenCallApi:u,minBlockForTokenCallApi:p,minForIpCallApi:d,numForIpCallApi:m,minBlockForIpCallApi:h}=i;if(!Mn(n)||!Mn(r))throw new Error("procProtect needs procOrm and withTabLocks from the WServOrm instance");let f="system",g=e=>{s&&Mn(s.error)&&s.error(e)},w=({timer:e,err:t})=>{g({event:"timer-error",timer:e,err:Rn(t)})},y=()=>Object.create(null),M=(e,t,i,n)=>{if(e[t]!==i)return null;let r=i.filter(e=>e>=n);return 0===Dt(r)?delete e[t]:e[t]=r,r},D=y(),x=async e=>{if(!ki(e))return Promise.reject("invalid u");let t=ke(e,"timeBlocked","");if(tu(t)){return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},I=async e=>{let i=await t.getGenUserByAccount(e);return await x(i)};setInterval(Gd("accountLoginFailedPrune",async()=>{let e=Tr().add(-o,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(D,async(t,i)=>{M(D,i,t,e)})},w),2e3);let b=y(),C=async e=>{let t=b[e];return void 0===t&&(t=[]),t};setInterval(Gd("tokenCallApi",async()=>{let i=Tr().add(-l,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(b,async(o,a)=>{let c=M(b,a,o,i);null!==c&&Dt(c)>u&&await(async i=>{let o=await t.getTokenByKV("token",i);if("y"===ke(o,"isApp",""))return void(s&&Mn(s.debug)&&s.debug({event:"fun-blockAccountByToken",key:"appTokenSkipRateLimit",token:hu(i)}));let a=ke(o,"userId","");if(!Zi(a))return Promise.reject("invalid userId");let c=await t.getGenUserByUserId(a);await r(["tokens","users"],async()=>{let r=null;if(await t.getTokenByKV("token",i).then(e=>{r=e}).catch(()=>{}),null===r||"y"===ke(r,"isApp","")||ke(r,"userId","")!==c.id)return;let s=await e.users.select({id:c.id});if(1!==Dt(s))return;if(await x(s[0]))return;let o=Tr().add(p,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),a=null;await n(f,"users","save",[{id:c.id,timeBlocked:o}],{mustExist:!0}).catch(e=>{a=e});let l=null;return await t.revokeTokensByUserIdLocked(c.id).catch(e=>{l=e}),null!==a||null!==l?(g({event:"fun-blockAccountByToken",userId:c.id,token:hu(i),errBlock:null!==a?Rn(a):"",errRevoke:null!==l?Rn(l):""}),Promise.reject("failed to block account by token")):void 0})})(a).catch(e=>{console.log(e)})})},w),2e3);let v=y(),L=null,A=0,N=async e=>{if(!ki(e))return Promise.reject("invalid oip");let t=ke(e,"timeBlocked","");if(tu(t)){return Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")<=t}return""!==t&&Promise.reject(`invalid timeBlocked[${t}]`)},S=async e=>{let i=null,r=()=>Tr().add(h,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),s=null;if(await t.getIpByKV("ip",e).then(e=>{s=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?s=null:i=t}),null!==i)return Promise.reject(i);if(null===s){let t=r();return s=$l.ips.funNew({ip:e,timeBlocked:t}),await n(f,"ips","insert",[s]).catch(e=>{i=e}),null!==i?(g({event:"fun-blockIpByIp",ip:e,err:Rn(i)}),Promise.reject(i)):void 0}if(await N(s))return;let o=r(),a=null;return await n(f,"ips","save",[{id:s.id,timeBlocked:o}],{mustExist:!0}).catch(e=>{a=e}),null!==a?(g({event:"fun-blockIpByIp",ip:e,err:Rn(a)}),Promise.reject(a)):void 0},T=async e=>{let t=v[e];return void 0===t&&(t=[]),t};setInterval(Gd("ipDetectNew",()=>r(["ips"],async()=>{let e=await t.getIpsList(),i=Object.keys(v),r=y();ar(e,e=>{let t=e.ip;r[t]=!0});let s=y();ar(i,e=>{s[e]=!0});let o=[];for(let e of Object.keys(s))sr(r,e)||o.push(e);let a=Yr(o,e=>$l.ips.funNew({ip:e}));Dt(a)>0&&await n(f,"ips","insert",a)}),w),2e3),setInterval(Gd("ipCallApi",async()=>{let e=Tr().add(-d,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ");await ca(v,async(t,i)=>{let n=M(v,i,t,e);null!==n&&Dt(n)>m&&await(async e=>await r(["ips"],()=>S(e)))(i).catch(e=>{console.log(e)})})},w),2e3);let k={loginByAccountAndPassword:async(i,s)=>{let l=!1;try{l=await I(i)}catch(e){return Promise.reject("failedLoginForCatch")}if(l)return Promise.reject("failedLoginForCatch");let u=null;return await t.loginByAccountAndPassword(i,s).then(e=>{u={state:"success",msg:e},delete D[i]}).catch(async s=>{D[i]||(D[i]=[]),D[i].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"));let l=Tr().add(-o,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),p=D[i].filter(e=>e>=l);D[i]=p,Dt(p)>a&&await(async i=>{let s=await t.getGenUserByAccount(i);await r(["tokens","users"],async()=>{let r=await e.users.select({account:i,isActive:"y"});if(1!==Dt(r)||ke(r[0],"id","")!==s.id)return;let o=await e.users.select({id:s.id});if(1!==Dt(o))return;if(await x(o[0]))return;let a=Tr().add(c,"minute").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),l=null;await n(f,"users","save",[{id:s.id,timeBlocked:a}],{mustExist:!0}).catch(e=>{l=e});let u=null;return await t.revokeTokensByUserIdLocked(s.id).catch(e=>{u=e}),null!==l||null!==u?(g({event:"fun-blockAccount",userId:s.id,errBlock:null!==l?Rn(l):"",errRevoke:null!==u?Rn(u):""}),Promise.reject("failed to block account")):void 0})})(i).catch(e=>{console.log(e)}),u={state:"error",msg:s}}),"success"===u.state?u.msg:Promise.reject(u.msg)},cleanKpAccountLoginFailed:async()=>{D=y()},cleanKpIpCallApi:async()=>{v=y()},getKpKeyCounts:async()=>({accountLoginFailed:Object.keys(D).length,tokenCallApi:Object.keys(b).length,ipCallApi:Object.keys(v).length}),getBlockedByAccount:I,getBlockedByIp:async e=>{let i=null;if(!Zi(e))return Promise.reject("invalid ip");let n=null;return await t.getIpByKV("ip",e).then(e=>{n=e}).catch(e=>{let t="can not find the ip by keyIp[ip]";e===t?n=null:i=t}),null!==i?Promise.reject(i):null!==n&&await N(n)},callApiByToken:async e=>{b[e]||(b[e]=[]),b[e].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByTokenCallApi:C,getCountsByTokenCallApi:async e=>Dt(await C(e)),getIpByHeaders:e=>{let t=ke(e,"headers"),i="",n="";if(!Zi(i)){let e=ke(t,"x-forwarded-for","");if(i=ke(ts(e,","),0,""),i=es(i),Zi(i)){let e=(e=>{let t=e;if(0===E.isIP(e)){t="";let i=Od.exec(e),n=Wd.exec(e),r=i||n;r&&Number(r[2])<=65535&&E.isIP(r[1])===(i?4:6)&&(t=r[1])}return t.length>64?"":t})(i);Zi(e)||(n=i),i=e}}return Zi(i)||e&&e.info&&e.info.remoteAddress&&(i=e.info.remoteAddress,i=es(i)),Zi(i)||e&&e.socket&&e.socket.remoteAddress&&(i=e.socket.remoteAddress,i=es(i)),Zi(i)||e&&e.connection&&e.connection.remoteAddress&&(i=e.connection.remoteAddress,i=es(i)),""!==n&&((e,t)=>{if(!s||!Mn(s.warn))return;let i=Date.now();if(null!==L){if(i<L)return L=i,void A++;if(i-L<1e4)return void A++}let n=A;L=i,A=0;try{let i=s.warn({event:"fun-getIpByHeaders",key:"invalidForwardedFor",len:e.length,preview:mu(e.slice(0,64)),ip:t,suppressed:n});i&&Mn(i.catch)&&i.catch(()=>{})}catch(e){}})(n,i),Zi(i)||(console.log("headers(keys)",Object.keys(t||{})),console.log("can not get ip of user")),i},callApiByIp:async e=>{v[e]||(v[e]=[]),v[e].push(Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"))},getInforsByIpCallApi:T,getCountsByIpCallApi:async e=>Dt(await T(e))};return k}function Kd(i,n=1){return function(e,t=1,i={}){let n=1,r=ke(i,"path"),s=ke(i,"fs");if(!An(e,{fs:s}))throw new Error(`fd[${e}] is not a folder`);return null!==t&&nn(t)&&(t=tn(t))<1&&(t=1),function e(i){let o=[];return An(i,{fs:s})?(ar(s.readdirSync(i),function(a){let c=r.resolve(i,a),l=null;try{l=s.statSync(c)}catch(e){}l&&l.isDirectory()?(o.push({isFolder:!0,level:n,path:c,name:r.basename(c)}),n+=1,(n<=t||null===t)&&(o=o.concat(e(c))),n-=1):o.push({isFolder:!1,level:n,path:c,name:r.basename(c)})}),o):o}(e)}(i,n,{path:e,fs:t})}let Hd=new Map,Ud=new Map;function Bd(e,i,n){let r=Kd(e);r=r.filter(e=>!ke(e,"isFolder",!1)),r=function(e,t,i){let n=t.format(i);return md(e,e=>{let t=ke(e,"name","").replace(/\.log$/,"");return!/^\d{4}-\d{2}-\d{2}/.test(t)||t>=n.slice(0,t.length)})}(r,i,n);let s=[];for(let e of r)try{let i=t.statSync(e.path);if(!i.isFile())continue;s.push({path:e.path,name:e.name,size:i.size,mtimeMs:i.mtimeMs})}catch(e){}return s}function Vd(e){let t=new Map;return i=>{let n=Math.floor(i/6e4),r=t.get(n);return void 0===r&&(r=Tr(6e4*n).format(e),t.set(n,r)),r}}async function _d(e,i,n,r=null){Mn(r)||(r=Vd(n));let s={minTimeMs:null,token:{},ip:{},login:{}};return await function(e,i){return new Promise((n,r)=>{let s=null,o=t.createReadStream(e,{encoding:"utf8"}),a=A.createInterface({input:o,crlfDelay:1/0});a.on("line",i);let c=e=>{s=e,a.close()};o.on("error",c),a.on("error",c),o.on("close",()=>{s?r(s):n()})})}(e,e=>{let t=null;try{t=JSON.parse(e)}catch(e){return}if(null===t||"object"!=typeof t)return;let n=t.event,o=0;if("fun-checkToken"===n?o=1:"verifyConn"===n?o=2:"kpfun-loginByAccountAndPassword-before"===n?o=3:"kpfun-loginByAccountAndPassword-success"===n?o=4:"kpfun-loginByAccountAndPassword-error"===n&&(o=5),0===o)return;let a=function(e){return"number"==typeof e?e:Zi(e)?Tr(e).valueOf():NaN}(t.time);if(Number.isNaN(a))return;if((null===s.minTimeMs||a<s.minTimeMs)&&(s.minTimeMs=a),!(a>i))return;let c=r(a);if(1===o){let e=s.token[c];void 0===e&&(e={count:0,kp:Object.create(null)},s.token[c]=e),e.count+=1;let i=t.userId;e.kp[i]=(e.kp[i]||0)+1}else if(2===o){let e=s.ip[c];void 0===e&&(e={count:0,kp:Object.create(null)},s.ip[c]=e),e.count+=1;let i=t.ip;e.kp[i]=(e.kp[i]||0)+1}else{let e=s.login[c];void 0===e&&(e={attempt:0,success:0,error:0},s.login[c]=e),3===o?e.attempt+=1:4===o?e.success+=1:e.error+=1}}),s}async function Rd(e,t,i){let n=Vd(i),r=[];for(let s of e)try{let e=await _d(s.path,t,i,n);r.push({name:s.name,ok:!0,agg:e})}catch(e){r.push({name:s.name,ok:!1,err:String(ke(e,"message",e))})}return r}function Qd(e,t){for(let i in t.token){let n=t.token[i],r=e.token[i];void 0===r&&(r={count:0,kp:Object.create(null)},e.token[i]=r),r.count+=n.count;for(let e in n.kp)r.kp[e]=(r.kp[e]||0)+n.kp[e]}for(let i in t.ip){let n=t.ip[i],r=e.ip[i];void 0===r&&(r={count:0,kp:Object.create(null)},e.ip[i]=r),r.count+=n.count;for(let e in n.kp)r.kp[e]=(r.kp[e]||0)+n.kp[e]}for(let i in t.login){let n=t.login[i],r=e.login[i];void 0===r&&(r={attempt:0,success:0,error:0},e.login[i]=r),r.attempt+=n.attempt,r.success+=n.success,r.error+=n.error}return e}async function Jd(t,i={}){let n=!1!==ke(i,"useCache"),r=ke(i,"scanFiles");Mn(r)||(r=Rd);let s=ke(i,"srLog",null),o=Bd(t.fdLog,t.tStart,t.fmt),a=function(e){let t=Hd.get(e);return t||(t=new Map,Hd.set(e,t)),t}((c=t.fdLog,l=t.fmt,`${e.resolve(c)}|${l}`));var c,l;let u=[],p={};for(let e of o){let i=n?a.get(e.name):void 0;void 0!==i&&i.size===e.size&&i.mtimeMs===e.mtimeMs&&(null===i.minTimeMs||i.minTimeMs>i.scanTStartMs&&i.minTimeMs>t.tStartMs)?p[e.name]=i.agg:u.push(e)}if(n){let e=new Set(o.map(e=>e.name));for(let t of a.keys())e.has(t)||a.delete(t)}let d=[];if(u.length>0){let e=await r(u.map(e=>({path:e.path,name:e.name})),t.tStartMs,t.fmt),i={};for(let t of e)i[t.name]=t;for(let e of u){let r=i[e.name];if(r&&r.ok)p[e.name]=r.agg,n&&a.set(e.name,{size:e.size,mtimeMs:e.mtimeMs,minTimeMs:r.agg.minTimeMs,scanTStartMs:t.tStartMs,agg:r.agg});else{let t=ke(r,"err","no result");d.push({name:e.name,err:t}),n&&a.delete(e.name),s&&Mn(s.warn)&&s.warn({event:"fun-staLogs",key:"staLogsFileSkipped",name:e.name,err:t})}}}let m={token:{},ip:{},login:{}};for(let e of o){let t=p[e.name];t&&Qd(m,t)}let h=function(e,t){let i=(e,i,n)=>{let r={};for(let i of t)r[i]=e();for(let e in i)r[e]=n(i[e]);return Object.keys(r).sort().map(e=>({time:e,data:r[e]}))},n=e=>{let t={count:e.count,...e.kp};return t.count=e.count,t};return{token:i(()=>({count:0}),e.token,n),ip:i(()=>({count:0}),e.ip,n),login:i(()=>({attempt:0,success:0,error:0}),e.login,e=>({attempt:e.attempt,success:e.success,error:e.error}))}}(m,t.kpTime);return h.stat={nFiles:o.length,nScanned:u.length,nCached:o.length-u.length,errors:d},h}function $d(t=7,i="hr",n={}){let r=function(e=7,t="hr",i={}){let n=ke(i,"fdLog");Zi(n)||(n="./logs");let r=function(e){return"day"===e?"day":"hr"}(t),s="day"===r?"YYYY-MM-DD":"YYYY-MM-DDTHH",o="day"===r?"day":"hour",a=ke(i,"timeNow"),c="number"==typeof a?Tr(a):Tr(),l=c.subtract(e,"day"),u=l.valueOf(),p=l.startOf(o),d=c.startOf(o),m=[];for(;!p.isAfter(d);)m.push(p.format(s)),p=p.add(1,o);return{fdLog:n,timeInterval:r,fmt:s,unit:o,tStart:l,tStartMs:u,kpTime:m,timeNow:c.valueOf()}}(t,i,n),s=JSON.stringify([e.resolve(r.fdLog),t,r.timeInterval,ke(n,"timeNow",null)]);if(Ud.has(s))return Ud.get(s);let o=Jd(r,n).finally(()=>{Ud.delete(s)});return Ud.set(s,o),o}function qd(i={}){let n=i.fpSelf,r=i.cwd||process.cwd(),s=i.pkgName||"w-web-sso",o=i.rel||"server/staLogs/staLogsCore.shellWorker.mjs",a=i.existsSync||t.existsSync,c=i.readFileSync||t.readFileSync,l=i.createRequire||u.createRequire;if("string"!=typeof n||""===n)throw new Error("invalid fpSelf");let p=[],d=function(t,i){let n=t;for(;;){if(i(e.join(n,"package.json")))return n;let t=e.dirname(n);if(t===n)return"";n=t}}(e.dirname(n),a);if(""===d)p.push(`(a) no package.json above ${e.dirname(n)}`);else{let t="";try{t=JSON.parse(c(e.join(d,"package.json"),"utf8")).name}catch(e){}let i=e.join(d,o);if(t!==s)p.push(`(a) ${e.join(d,"package.json")} name[${t}]`);else{if(a(i))return i;p.push(`(a) ${i}`)}}let m=`${s}/${o}`,h=[["b",n],["c",e.join(r,"noop.js")]];for(let[e,t]of h)try{let i=l(t).resolve(m);if(a(i))return i;p.push(`(${e}) ${i}`)}catch(i){p.push(`(${e}) resolve ${m} from ${t}`)}throw new Error(`cannot resolve ${o} of ${s} (the package must be installed with its server folder), tried: ${p.join("; ")}`)}let em="";function tm(e,t=""){let i=Cn();if("string"!=typeof t||""===t)try{""===em&&(em=qd({fpSelf:c.fileURLToPath("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:N&&"SCRIPT"===N.tagName.toUpperCase()&&N.src||new URL("w-web-sso.umd.js",document.baseURI).href)})),t=em}catch(e){return i.reject(e),i}let n=new o.Worker(t),r=!1,s=(e,t)=>{r||(r=!0,e(t));try{n.terminate().catch(()=>{})}catch(e){}};return n.on("message",e=>{"done"===e.mode?s(i.resolve,e.payload):"error"===e.mode&&s(i.reject,e.payload)}),n.on("error",e=>{s(i.reject,e)}),n.on("exit",e=>{s(i.reject,new Error(`staLogs worker exited without result, code=${e}`))}),n.postMessage(e),i}async function im(e,t,i){return 0===e.length?[]:tm({files:e,tStartMs:t,fmt:i})}function nm(e=7,t="hr",i={}){return $d(e,t,{...i,scanFiles:im})}function rm(e,t,i={}){let{srLog:n,logFd:r}=i,s=async()=>{let e=await t.getUsersListCache(),i=Dt(e),n=0;n=Dt(md(e,e=>ru(e)));let r=0;r=Dt(md(e,e=>nu(e)));let s=0;s=Dt(md(e,e=>iu(e)));return{total:i,active:n,blocked:r,expired:s}},o=async()=>{let e=Tr().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ"),n=Tr().add(24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),r=await t.getTokensListCache(),s=Dt(r),o=0;{let t=md(r,t=>t.timeCreate>=e);o=Dt(t)}let a=0;{let e=md(r,e=>e.timeEnd>=i&&e.timeEnd<=n);a=Dt(e)}let c=0;{let e=md(r,e=>function(e){let t=ke(e,"timeEnd","");return!!tu(t)&&Tr().format("YYYY-MM-DDTHH:mm:ss.SSSZ")>t}(e));c=Dt(e)}return{active:s-c,created24h:o,ending24h:a,ended:c}},a=async()=>{let e=Tr().add(-24,"hour").format("YYYY-MM-DDTHH:mm:ss.SSSZ"),i=await t.getIpsListCache(),n=0;{let t=md(await g(),t=>Tr(t.time,"YYYY-MM-DDTHH").format("YYYY-MM-DDTHH:mm:ss.SSSZ")>=e);s="data.count",n=(r=t)&&r.length?function(e,t){for(var i,n=-1,r=e.length;++n<r;){var s=t(e[n]);void 0!==s&&(i=void 0===i?s:i+s)}return i}(r,Ni(s)):0}var r,s;let o=0;o=Dt(md(i,e=>nu(e)));return{conn24h:n,blocked:o}},c=async()=>{let e=await async function(e=7,t="hr",i={}){return(await nm(e,t,i)).login}(7,"hr",{fdLog:r,srLog:n});return e},l=wd(),u=async()=>await l.getProxy("fun",{fun:c,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaUserAccountLogin",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),p=async()=>{let e=await async function(e=7,t="hr",i={}){return(await nm(e,t,i)).token}(7,"hr",{fdLog:r,srLog:n}),i=Object.create(null);ar(e,e=>{for(let t of Object.keys(e.data))"count"!==t&&(i[t]=0)});let s=await t.getUsersListCache(),o=Object.create(null);return o.count=0,ar(s,e=>{o[e.id]=e.name}),e=Yr(e,e=>{let t=Object.assign(Object.create(null),i);for(let i of Object.keys(e.data))"count"!==i&&(t[i]=e.data[i]);var n,r,s;n=t,s={},r=Ni(r=(e,t)=>{let i=o[t];return void 0===i&&(i=t),i}),Vt(n,function(e,t,i){Zs(s,r(e,t,i),e)}),t=s;let a={time:e.time,data:{count:e.data.count,...t}};return a.data.count=e.data.count,a}),e},d=wd(),m=async()=>await d.getProxy("fun",{fun:p,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaToken",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),h=async()=>{let e=await async function(e=7,t="hr",i={}){return(await nm(e,t,i)).ip}(7,"hr",{fdLog:r,srLog:n}),t=Object.create(null);return ar(e,e=>{for(let i of Object.keys(e.data))"count"!==i&&(t[i]=0)}),e=Yr(e,e=>{let i=Object.assign(Object.create(null),t);for(let t of Object.keys(e.data))"count"!==t&&(i[t]=e.data[t]);let n={time:e.time,data:{count:e.data.count,...i}};return n.data.count=e.data.count,n}),e},f=wd(),g=async()=>await f.getProxy("fun",{fun:h,inputs:null,timeExpired:3e4,timeFrom:"end",useCacheWhenError:!1}).catch(e=>(n&&n.error({event:"fun-getStaIp",key:"getStaDataFailed",err:String(ke(e,"message",e))}),Promise.reject("getStaDataFailed"))),w={getStaUserSummary:s,checkTokenAndGetStaUserSummary:async(e,i={})=>(await t.checkToken(e,i),await s()),getStaTokenSummary:o,checkTokenAndGetStaTokenSummary:async(e,i={})=>(await t.checkToken(e,i),await o()),getStaIpSummary:a,checkTokenAndGetStaIpSummary:async(e,i={})=>(await t.checkToken(e,i),await a()),getStaUserAccountLogin:u,checkTokenAndGetStaUserAccountLogin:async(e,i={})=>(await t.checkToken(e,i),await u()),getStaToken:m,checkTokenAndGetStaToken:async(e,i={})=>(await t.checkToken(e,i),await m()),getStaIp:g,checkTokenAndGetStaIp:async(e,i={})=>(await t.checkToken(e,i),await g())};return w}var sm={exports:{}};!function(e){e.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)}),i=e(function(e){var t=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=t)});i.version;var n=function(e){return"object"==typeof e?null!==e:"function"==typeof e},r=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e},s=function(e){try{return!!e()}catch(e){return!0}},o=!s(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),a=t.document,c=n(a)&&n(a.createElement),l=function(e){return c?a.createElement(e):{}},u=!o&&!s(function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}),p=function(e,t){if(!n(e))return e;var i,r;if(t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;if("function"==typeof(i=e.valueOf)&&!n(r=i.call(e)))return r;if(!t&&"function"==typeof(i=e.toString)&&!n(r=i.call(e)))return r;throw TypeError("Can't convert object to primitive value")},d=Object.defineProperty,m={f:o?Object.defineProperty:function(e,t,i){if(r(e),t=p(t,!0),r(i),u)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},h=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f=o?function(e,t,i){return m.f(e,t,h(1,i))}:function(e,t,i){return e[t]=i,e},g={}.hasOwnProperty,w=function(e,t){return g.call(e,t)},y=0,M=Math.random(),D=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++y+M).toString(36))},x=e(function(e){var n="__core-js_shared__",r=t[n]||(t[n]={});(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),I=x("native-function-to-string",Function.toString),b=e(function(e){var n=D("src"),r="toString",s=(""+I).split(r);i.inspectSource=function(e){return I.call(e)},(e.exports=function(e,i,r,o){var a="function"==typeof r;a&&(w(r,"name")||f(r,"name",i)),e[i]!==r&&(a&&(w(r,n)||f(r,n,e[i]?""+e[i]:s.join(String(i)))),e===t?e[i]=r:o?e[i]?e[i]=r:f(e,i,r):(delete e[i],f(e,i,r)))})(Function.prototype,r,function(){return"function"==typeof this&&this[n]||I.call(this)})}),C=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},v=function(e,t,i){if(C(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)}}return function(){return e.apply(t,arguments)}},L="prototype",E=function(e,n,r){var s,o,a,c,l=e&E.F,u=e&E.G,p=e&E.S,d=e&E.P,m=e&E.B,h=u?t:p?t[n]||(t[n]={}):(t[n]||{})[L],g=u?i:i[n]||(i[n]={}),w=g[L]||(g[L]={});for(s in u&&(r=n),r)a=((o=!l&&h&&void 0!==h[s])?h:r)[s],c=m&&o?v(a,t):d&&"function"==typeof a?v(Function.call,a):a,h&&b(h,s,a,e&E.U),g[s]!=a&&f(g,s,c),d&&w[s]!=a&&(w[s]=a)};t.core=i,E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128;var A,N=E,S=Math.ceil,T=Math.floor,k=function(e){return isNaN(e=+e)?0:(e>0?T:S)(e)},j=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},Z=(A=!1,function(e,t){var i,n,r=String(j(e)),s=k(t),o=r.length;return s<0||s>=o?A?"":void 0:(i=r.charCodeAt(s))<55296||i>56319||s+1===o||(n=r.charCodeAt(s+1))<56320||n>57343?A?r.charAt(s):i:A?r.slice(s,s+2):n-56320+(i-55296<<10)+65536});N(N.P,"String",{codePointAt:function(e){return Z(this,e)}}),i.String.codePointAt;var z=Math.max,Y=Math.min,X=function(e,t){return(e=k(e))<0?z(e+t,0):Y(e,t)},F=String.fromCharCode,G=String.fromCodePoint;N(N.S+N.F*(!!G&&1!=G.length),"String",{fromCodePoint:function(e){for(var t,i=arguments,n=[],r=arguments.length,s=0;r>s;){if(t=+i[s++],X(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?F(t):F(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}}),i.String.fromCodePoint;var O,W,P,K,H,U,B,V,_,R,Q,J,$,q,ee={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0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\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\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DBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},te={isSpaceSeparator:function(e){return"string"==typeof e&&ee.Space_Separator.test(e)},isIdStartChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||ee.ID_Start.test(e))},isIdContinueChar:function(e){return"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||ee.ID_Continue.test(e))},isDigit:function(e){return"string"==typeof e&&/[0-9]/.test(e)},isHexDigit:function(e){return"string"==typeof e&&/[0-9A-Fa-f]/.test(e)}},ie=function(e,t){O=String(e),W="start",P=[],K=0,H=1,U=0,B=void 0,V=void 0,_=void 0;do{B=re(),me[W]()}while("eof"!==B.type);return"function"==typeof t?ne({"":_},"",t):_};function ne(e,t,i){var n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(var r=0;r<n.length;r++){var s=String(r),o=ne(n,s,i);void 0===o?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var a in n){var c=ne(n,a,i);void 0===c?delete n[a]:Object.defineProperty(n,a,{value:c,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}function re(){for(R="default",Q="",J=!1,$=1;;){q=se();var e=ae[R]();if(e)return e}}function se(){if(O[K])return String.fromCodePoint(O.codePointAt(K))}function oe(){var e=se();return"\n"===e?(H++,U=0):e?U+=e.length:U++,e&&(K+=e.length),e}var ae={default:function(){switch(q){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void oe();case"/":return oe(),void(R="comment");case void 0:return oe(),ce("eof")}if(!te.isSpaceSeparator(q))return ae[W]();oe()},comment:function(){switch(q){case"*":return oe(),void(R="multiLineComment");case"/":return oe(),void(R="singleLineComment")}throw ge(oe())},multiLineComment:function(){switch(q){case"*":return oe(),void(R="multiLineCommentAsterisk");case void 0:throw ge(oe())}oe()},multiLineCommentAsterisk:function(){switch(q){case"*":return void oe();case"/":return oe(),void(R="default");case void 0:throw ge(oe())}oe(),R="multiLineComment"},singleLineComment:function(){switch(q){case"\n":case"\r":case"\u2028":case"\u2029":return oe(),void(R="default");case void 0:return oe(),ce("eof")}oe()},value:function(){switch(q){case"{":case"[":return ce("punctuator",oe());case"n":return oe(),le("ull"),ce("null",null);case"t":return oe(),le("rue"),ce("boolean",!0);case"f":return oe(),le("alse"),ce("boolean",!1);case"-":case"+":return"-"===oe()&&($=-1),void(R="sign");case".":return Q=oe(),void(R="decimalPointLeading");case"0":return Q=oe(),void(R="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Q=oe(),void(R="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",1/0);case"N":return oe(),le("aN"),ce("numeric",NaN);case'"':case"'":return J='"'===oe(),Q="",void(R="string")}throw ge(oe())},identifierNameStartEscape:function(){if("u"!==q)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":break;default:if(!te.isIdStartChar(e))throw ye()}Q+=e,R="identifierName"},identifierName:function(){switch(q){case"$":case"_":case"":case"":return void(Q+=oe());case"\\":return oe(),void(R="identifierNameEscape")}if(!te.isIdContinueChar(q))return ce("identifier",Q);Q+=oe()},identifierNameEscape:function(){if("u"!==q)throw ge(oe());oe();var e=de();switch(e){case"$":case"_":case"":case"":break;default:if(!te.isIdContinueChar(e))throw ye()}Q+=e,R="identifierName"},sign:function(){switch(q){case".":return Q=oe(),void(R="decimalPointLeading");case"0":return Q=oe(),void(R="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Q=oe(),void(R="decimalInteger");case"I":return oe(),le("nfinity"),ce("numeric",$*(1/0));case"N":return oe(),le("aN"),ce("numeric",NaN)}throw ge(oe())},zero:function(){switch(q){case".":return Q+=oe(),void(R="decimalPoint");case"e":case"E":return Q+=oe(),void(R="decimalExponent");case"x":case"X":return Q+=oe(),void(R="hexadecimal")}return ce("numeric",0*$)},decimalInteger:function(){switch(q){case".":return Q+=oe(),void(R="decimalPoint");case"e":case"E":return Q+=oe(),void(R="decimalExponent")}if(!te.isDigit(q))return ce("numeric",$*Number(Q));Q+=oe()},decimalPointLeading:function(){if(te.isDigit(q))return Q+=oe(),void(R="decimalFraction");throw ge(oe())},decimalPoint:function(){switch(q){case"e":case"E":return Q+=oe(),void(R="decimalExponent")}return te.isDigit(q)?(Q+=oe(),void(R="decimalFraction")):ce("numeric",$*Number(Q))},decimalFraction:function(){switch(q){case"e":case"E":return Q+=oe(),void(R="decimalExponent")}if(!te.isDigit(q))return ce("numeric",$*Number(Q));Q+=oe()},decimalExponent:function(){switch(q){case"+":case"-":return Q+=oe(),void(R="decimalExponentSign")}if(te.isDigit(q))return Q+=oe(),void(R="decimalExponentInteger");throw ge(oe())},decimalExponentSign:function(){if(te.isDigit(q))return Q+=oe(),void(R="decimalExponentInteger");throw ge(oe())},decimalExponentInteger:function(){if(!te.isDigit(q))return ce("numeric",$*Number(Q));Q+=oe()},hexadecimal:function(){if(te.isHexDigit(q))return Q+=oe(),void(R="hexadecimalInteger");throw ge(oe())},hexadecimalInteger:function(){if(!te.isHexDigit(q))return ce("numeric",$*Number(Q));Q+=oe()},string:function(){switch(q){case"\\":return oe(),void(Q+=ue());case'"':return J?(oe(),ce("string",Q)):void(Q+=oe());case"'":return J?void(Q+=oe()):(oe(),ce("string",Q));case"\n":case"\r":throw ge(oe());case"\u2028":case"\u2029":Me(q);break;case void 0:throw ge(oe())}Q+=oe()},start:function(){switch(q){case"{":case"[":return ce("punctuator",oe())}R="value"},beforePropertyName:function(){switch(q){case"$":case"_":return Q=oe(),void(R="identifierName");case"\\":return oe(),void(R="identifierNameStartEscape");case"}":return ce("punctuator",oe());case'"':case"'":return J='"'===oe(),void(R="string")}if(te.isIdStartChar(q))return Q+=oe(),void(R="identifierName");throw ge(oe())},afterPropertyName:function(){if(":"===q)return ce("punctuator",oe());throw ge(oe())},beforePropertyValue:function(){R="value"},afterPropertyValue:function(){switch(q){case",":case"}":return ce("punctuator",oe())}throw ge(oe())},beforeArrayValue:function(){if("]"===q)return ce("punctuator",oe());R="value"},afterArrayValue:function(){switch(q){case",":case"]":return ce("punctuator",oe())}throw ge(oe())},end:function(){throw ge(oe())}};function ce(e,t){return{type:e,value:t,line:H,column:U}}function le(e){for(var t=0,i=e;t<i.length;t+=1){var n=i[t];if(se()!==n)throw ge(oe());oe()}}function ue(){switch(se()){case"b":return oe(),"\b";case"f":return oe(),"\f";case"n":return oe(),"\n";case"r":return oe(),"\r";case"t":return oe(),"\t";case"v":return oe(),"\v";case"0":if(oe(),te.isDigit(se()))throw ge(oe());return"\0";case"x":return oe(),pe();case"u":return oe(),de();case"\n":case"\u2028":case"\u2029":return oe(),"";case"\r":return oe(),"\n"===se()&&oe(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw ge(oe())}return oe()}function pe(){var e="",t=se();if(!te.isHexDigit(t))throw ge(oe());if(e+=oe(),t=se(),!te.isHexDigit(t))throw ge(oe());return e+=oe(),String.fromCodePoint(parseInt(e,16))}function de(){for(var e="",t=4;t-- >0;){var i=se();if(!te.isHexDigit(i))throw ge(oe());e+=oe()}return String.fromCodePoint(parseInt(e,16))}var me={start:function(){if("eof"===B.type)throw we();he()},beforePropertyName:function(){switch(B.type){case"identifier":case"string":return V=B.value,void(W="afterPropertyName");case"punctuator":return void fe();case"eof":throw we()}},afterPropertyName:function(){if("eof"===B.type)throw we();W="beforePropertyValue"},beforePropertyValue:function(){if("eof"===B.type)throw we();he()},beforeArrayValue:function(){if("eof"===B.type)throw we();"punctuator"!==B.type||"]"!==B.value?he():fe()},afterPropertyValue:function(){if("eof"===B.type)throw we();switch(B.value){case",":return void(W="beforePropertyName");case"}":fe()}},afterArrayValue:function(){if("eof"===B.type)throw we();switch(B.value){case",":return void(W="beforeArrayValue");case"]":fe()}},end:function(){}};function he(){var e;switch(B.type){case"punctuator":switch(B.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=B.value}if(void 0===_)_=e;else{var t=P[P.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,V,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)P.push(e),W=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{var i=P[P.length-1];W=null==i?"end":Array.isArray(i)?"afterArrayValue":"afterPropertyValue"}}function fe(){P.pop();var e=P[P.length-1];W=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function ge(e){return xe(void 0===e?"JSON5: invalid end of input at "+H+":"+U:"JSON5: invalid character '"+De(e)+"' at "+H+":"+U)}function we(){return xe("JSON5: invalid end of input at "+H+":"+U)}function ye(){return xe("JSON5: invalid identifier character at "+H+":"+(U-=5))}function Me(e){console.warn("JSON5: '"+De(e)+"' in strings is not valid ECMAScript; consider escaping")}function De(e){var t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){var i=e.charCodeAt(0).toString(16);return"\\x"+("00"+i).substring(i.length)}return e}function xe(e){var t=new SyntaxError(e);return t.lineNumber=H,t.columnNumber=U,t}var Ie=function(e,t,i){var n,r,s,o=[],a="",c="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,s=t.quote,t=t.replacer),"function"==typeof t)r=t;else if(Array.isArray(t)){n=[];for(var l=0,u=t;l<u.length;l+=1){var p=u[l],d=void 0;"string"==typeof p?d=p:("number"==typeof p||p instanceof String||p instanceof Number)&&(d=String(p)),void 0!==d&&n.indexOf(d)<0&&n.push(d)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),c=" ".substr(0,i)):"string"==typeof i&&(c=i.substr(0,10)),m("",{"":e});function m(e,t){var i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),r&&(i=r.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?h(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?w(i):f(i):void 0}function h(e){for(var t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},n="",r=0;r<e.length;r++){var o=e[r];switch(o){case"'":case'"':t[o]++,n+=o;continue;case"\0":if(te.isDigit(e[r+1])){n+="\\x00";continue}}if(i[o])n+=i[o];else if(o<" "){var a=o.charCodeAt(0).toString(16);n+="\\x"+("00"+a).substring(a.length)}else n+=o}var c=s||Object.keys(t).reduce(function(e,i){return t[e]<t[i]?e:i});return c+(n=n.replace(new RegExp(c,"g"),i[c]))+c}function f(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,r,s=[],l=0,u=n||Object.keys(e);l<u.length;l+=1){var p=u[l],d=m(p,e);if(void 0!==d){var h=g(p)+":";""!==c&&(h+=" "),h+=d,s.push(h)}}if(0===s.length)i="{}";else if(""===c)i="{"+(r=s.join(","))+"}";else{var f=",\n"+a;r=s.join(f),i="{\n"+a+r+",\n"+t+"}"}return o.pop(),a=t,i}function g(e){if(0===e.length)return h(e);var t=String.fromCodePoint(e.codePointAt(0));if(!te.isIdStartChar(t))return h(e);for(var i=t.length;i<e.length;i++)if(!te.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return h(e);return e}function w(e){if(o.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");o.push(e);var t=a;a+=c;for(var i,n=[],r=0;r<e.length;r++){var s=m(String(r),e);n.push(void 0!==s?s:"null")}if(0===n.length)i="[]";else if(""===c)i="["+n.join(",")+"]";else{var l=",\n"+a,u=n.join(l);i="[\n"+a+u+",\n"+t+"]"}return o.pop(),a=t,i}},be={parse:ie,stringify:Ie},Ce=be,ve=Ce;return ve}()}(sm);var om=Zn(sm.exports);let am=e.resolve(),cm=e.resolve(am,"settings.json"),lm=e=>{cm=e},um=()=>{let e=t.readFileSync(cm,"utf8");return om.parse(e)},pm=["useCheckUser","getUserById","useExcludeWhenNotAdmin"];let dm={minLength:8,maxLength:16,requireLetter:!0,requireUppercase:!1,requireLowercase:!1,requireDigit:!0,requireSpecial:!0,noSpace:!0,onlyAscii:!0,forbiddenChars:["\\"],noConsecutiveCharsFromAccount:!0,consecutiveCharsMinMatch:2,commonPasswordBlacklist:["1234","12345","123456","1234567","12345678","123456789","1234567890","12345678910","111111","000000","666666","888888","7777777","11111111","123123","123321","654321","987654321","qwerty","qwerty123","qwerty1","qwertyuiop","qazwsx","1q2w3e4r","1q2w3e4r5t","1q2w3e","1qaz2wsx","zxcvbnm","password","password1","passw0rd","admin","admin123","welcome","letmein","login","master","monkey","dragon","shadow","sunshine","superman","batman","football","baseball","soccer","hockey","michael","jordan","jennifer","hunter","ranger","harley","thomas","charlie","andrew","daniel","ashley","bailey","mustang","access","secret","ninja","jesus","hello","freedom","trustno1","1qaz@WSX","P@ssw0rd","Pass@123","Aa123456","Aa@123456","Admin@123","abc@123","abc123","abcdef","abcd1234","abc","iloveyou","fuckyou","f*ckyou","whatever","nothing","google","computer","internet","samsung","apple","killer","princess","lovely","tigger","starwars","pokemon","minecraft","123qwe","zaq1zaq1","photoshop","adobe123","18atcskd2w","mynoob"]};return function(i,n,r,s,o={}){let a=null;if(!Mn(i))throw console.log("invalid WOrm",i),new Error("invalid WOrm");if(!Zi(n))throw console.log("invalid url",n),new Error("invalid url");if(!Zi(r))throw console.log("invalid db",r),new Error("invalid db");Tn(s)||(s="./settings.json"),lm(s);let c=um();ki(o)&&(c={...c,...o});let l=ke(c,"serverPort");nn(l)||(l=11007),l=tn(l);let u=((e={})=>{let t=ke(e,"logFd","");Zi(t)||(t="./logs");let i=ke(e,"logInterval","");Zi(i)||(i="hr");let n=ke(e,"logNumKeep",null),r={fdLog:t,interval:i};if(null!=n&&""!==n){if(!nn(n))throw new Error(`invalid logNumKeep[${n}], must be positive integer`);r.numKeep=tn(n)}return pu(r)})(c),p=(e,t)=>{console.log(`[${e.toUpperCase()}] ${t}`),u[e]({event:"boot",msg:t})},d=function(e={}){let t=[];for(let i of pm)try{ua({[i]:ke(e,i)})}catch(e){t.push(i)}return t}(c);Dt(d)>0&&p("warn",`settings / optExt 之 ${d.join("、")} 已忽略: w-serv-orm 1.1.9 起已移除此類使用者檢查設定, 本套件之寫入皆於各功能內以權杖授權(使用者須為管理者、應用系統金鑰須具對應權限), 自助註冊為公開流程, 請自設定移除`);let m=ke(c,"webName",{}),h=ke(c,"webDescription",{}),f=ke(c,"webLogo",""),g=ke(c,"webBackgoundGradientColors",[]);ln(g)||(g=["#FFE0B2","#FFCC80","#FFF59D","#F2D6A2","#F0CC88"]);let w=ke(c,"webKey",""),y=ke(c,"salt","");Zi(process.env.SALT)&&(y=process.env.SALT);let M=ke(c,"minExpired","");un(M)||(M=30);let D=ke(c,"minForAccountLoginFailed","");un(D)||(D=10);let x=ke(c,"numForAccountLoginFailed","");un(x)||(x=3);let I=ke(c,"minBlockForAccountLoginFailed","");un(I)||(I=30);let b=ke(c,"minForTokenCallApi","");un(b)||(b=10);let C=ke(c,"numForTokenCallApi","");un(C)||(C=1e3);let v=ke(c,"minBlockForTokenCallApi","");un(v)||(v=30);let L=ke(c,"minForIpCallApi","");un(L)||(L=10);let E=ke(c,"numForIpCallApi","");un(E)||(E=1e4);let A=ke(c,"minBlockForIpCallApi","");un(A)||(A=30);let N=ke(c,"cleanKpIpCallApiForIps",[]);ln(N)||(N=["127.0.0.1","::1","::ffff:127.0.0.1"]);let T=ke(c,"cleanKpIpCallApiForToken",""),k=ke(c,"cleanKpAccountLoginFailedForIps",[]);ln(k)||(k=["127.0.0.1","::1","::ffff:127.0.0.1"]);let j=ke(c,"cleanKpAccountLoginFailedForToken",""),Z=!0===ke(c,"allowUserRegistration",!1),z=ke(c,"siteUrl","");Zi(z)||(z="");let Y=ke(c,"passwordPolicy");ki(Y)?Y={...dm,...Y}:(Y=dm,p("info","settings 未提供 passwordPolicy, 採用程式內建預設密碼政策"));let X=ke(Y,"minLength");if(!nn(X)||tn(X)<1)throw new Error("invalid passwordPolicy.minLength: must be a positive integer >= 1");let F=ke(Y,"maxLength");if(!nn(F)||tn(F)<tn(X))throw new Error("invalid passwordPolicy.maxLength: must be a positive integer >= minLength");if(!Bi(ke(Y,"requireLetter")))throw new Error("invalid passwordPolicy.requireLetter: must be a boolean");if(!Bi(ke(Y,"requireUppercase")))throw new Error("invalid passwordPolicy.requireUppercase: must be a boolean");if(!Bi(ke(Y,"requireLowercase")))throw new Error("invalid passwordPolicy.requireLowercase: must be a boolean");if(!Bi(ke(Y,"requireDigit")))throw new Error("invalid passwordPolicy.requireDigit: must be a boolean");if(!Bi(ke(Y,"requireSpecial")))throw new Error("invalid passwordPolicy.requireSpecial: must be a boolean");if(!Bi(ke(Y,"noSpace")))throw new Error("invalid passwordPolicy.noSpace: must be a boolean");if(!Bi(ke(Y,"onlyAscii")))throw new Error("invalid passwordPolicy.onlyAscii: must be a boolean");let G=ke(Y,"forbiddenChars");if(!rn(G))throw new Error("invalid passwordPolicy.forbiddenChars: must be an array");for(let e=0;e<Dt(G);e++)if(!ji(G[e])||1!==Dt(G[e]))throw new Error(`invalid passwordPolicy.forbiddenChars[${e}]: each element must be a single character string`);let O=ke(Y,"noConsecutiveCharsFromAccount");if(!Bi(O))throw new Error("invalid passwordPolicy.noConsecutiveCharsFromAccount: must be a boolean");if(O){let e=ke(Y,"consecutiveCharsMinMatch");if(!nn(e)||tn(e)<2)throw new Error("invalid passwordPolicy.consecutiveCharsMinMatch: must be a positive integer >= 2")}let W=ke(Y,"commonPasswordBlacklist");if(!rn(W))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: must be an array");if(!function(e,t,i){var n=S(e)?xt:Qt;return i&&Si(e,t,i)&&(t=void 0),n(e,Ni(t))}(W,e=>ji(e)))throw new Error("invalid passwordPolicy.commonPasswordBlacklist: each element must be a string");let P=ke(c,"userLogo",""),K=ke(c,"subfolder","");Zi(K)&&("/"===In(K,1)&&(K=bn(K,1)),"/"!==xn(K,1)&&(K=`/${K}`));let H=ke(c,"showLanguage","n"),U=ke(c,"language","eng"),B=ke(c,"showModeEditUsers","n"),V=ke(c,"modeEditUsers","n"),_=ke(c,"showModeEditTokens","n"),R=ke(c,"modeEditTokens","n"),Q=ke(c,"showModeEditIps","n"),J=ke(c,"modeEditIps","n");ke(c,"mappingBy","");let $=ke(c,"kpLangExt",{}),q=(e=>{let t=ke(e,"emSrcEmail","");if(!Zi(t))throw new Error(`invalid srcEmail[${t}]`);let i=ke(e,"emSrcPW","");if(!Zi(i))throw new Error(`invalid srcPW[${i}]`);let n=ke(e,"emSrcHost","");if(!Zi(n))throw new Error(`invalid srcHost[${n}]`);let r=ke(e,"emSrcPort","");if(!nn(r))throw new Error(`invalid srcPort[${r}]`);return{send:async(e,s,o,a)=>{if(!Zi(e))return Promise.reject(`invalid srcName[${e}]`);if(!Zi(s))return Promise.reject(`invalid emTitle[${s}]`);if(!Zi(o))return Promise.reject(`invalid emContent[${o}]`);if(Zi(a)&&(a=[a]),!ln(a))return Promise.reject(`invalid toEmails[${a}]`);let c={srcName:e,srcEmail:t,srcPW:i,srcHost:n,srcPort:r,emTitle:s,emContent:o,toEmails:a};return await new pd(c)}}})(c),ee=(i,n="")=>{if(!Zi(i))return i;let r=e.resolve(i);return Tn(r)?t.readFileSync(r,"utf8"):((/^(\.{1,2}[\\/]|[\\/]|[A-Za-z]:[\\/])/.test(i)||/\.(html|txt)$/i.test(i))&&p("warn",`settings.${n} 疑似檔案路徑但檔案不存在(${r}), 將原樣視為文字`),i)},te={},ie=["chpwEmTitle","chpwEmContent","regVerifyEmTitle","regVerifyEmContent","resetPwEmTitle","resetPwEmContent","userRegistrationVerifySuccess","verifyEmailAlreadyVerified","verifyEmailInvalidToken","verifyEmailFailed"];ie.forEach(e=>{let t=(e=>{let t=ke(c,e);if(!ki(t))return{};let i={};return Object.keys(t).forEach(n=>{i[n]=ee(t[n],`${e}.${n}`)}),i})(e);Dt(t)>0&&(te[e]=t)});let ne=Xd({kpLangExtEmail:te,kpLangExt:$,webName:m,webDescription:h}),re={};Object.keys(ne).forEach(e=>{let t={...ne[e]};ie.forEach(e=>{delete t[e]}),re[e]=t});let se={};try{se=Ul($l,i,n,r)}catch(e){throw console.log("WServOrm init failed",e),e}let{woItems:oe,procOrm:ae,withTabLocks:ce,guardWrite:le}=se,ue=ke(c,"verifyBaseUrl","");Zi(ue)||(ue=`http://localhost:${l}`,Z&&p("warn",`settings 未提供 verifyBaseUrl, 註冊驗證信連結將採 ${ue}, 非本機部署時收信人將無法完成驗證, 請於 settings 提供對外可連之後端 base URL`));let pe="./server/template",de="./node_modules/w-web-sso/server/template";Nn(de)&&(pe=de);let me=ke(c,"pathTemplate","");Zi(me)&&Nn(me)||(Zi(me)&&p("warn",`settings.pathTemplate 指定之資料夾不存在(${me}), 改採套件內建模板`),me=pe);let he=ee(ke(c,"verifyEmailResultContent",""),"verifyEmailResultContent");if(!Zi(he)){let i=e.resolve(me,"verifyEmailResult.html");Tn(i)||(i=e.resolve(pe,"verifyEmailResult.html")),he=t.readFileSync(i,"utf8")}let fe=zd(oe,ae,{srLog:u,srEmail:q,salt:y,minExpired:M,kpLang:ne,passwordPolicy:Y,allowUserRegistration:Z,siteUrl:z,verifyBaseUrl:ue,withTabLocks:ce,guardWrite:le}),ge=Pd(oe,fe,{procOrm:ae,withTabLocks:ce,srLog:u,minForAccountLoginFailed:D,numForAccountLoginFailed:x,minBlockForAccountLoginFailed:I,minForTokenCallApi:b,numForTokenCallApi:C,minBlockForTokenCallApi:v,minForIpCallApi:L,numForIpCallApi:E,minBlockForIpCallApi:A}),we=ke(c,"logFd",""),ye=rm(0,fe,{srLog:u,logFd:we}),Me=(...e)=>e.every(e=>Zi(e)),De=(e,t)=>su(t),xe="dist",Ie="./node_modules/w-web-sso/dist";Nn(Ie)&&(xe=Ie);let be="index.html";try{let i=e.resolve(xe,"index.tmp");if(Tn(i)||(i=e.resolve(xe,be)),!Tn(i))throw console.log("fpEntryIn",i),new Error("invalid fpEntryIn");let n=e.resolve(xe,be),r=t.readFileSync(i,"utf8");r=kn(r,"/msso/","{sfd}/"),r=kn(r,"{sfd}",K),r=kn(r,"{language}",U),t.writeFileSync(n,r,"utf8")}catch(e){console.log(e),console.log(`can not generate ${be}`)}let Ce=[{method:"GET",path:"/api/cleanKpIpCallApi",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");if(!Zi(T))return Promise.reject("invalid cleanKpIpCallApiForToken");if(t!==T)return Promise.reject("cleanKpIpCallApi invalid token");let i=ke(e,"info.remoteAddress","");return Zi(i)||(i=ke(e,"socket.remoteAddress","")),Zi(i)||(i=ke(e,"connection.remoteAddress","")),N.includes(i)?(u.info({event:"api/cleanKpIpCallApi",realIp:i}),await ge.cleanKpIpCallApi(),!0):Promise.reject(`cleanKpIpCallApi only allowed from cleanKpIpCallApiForIps, got realIp[${i}]`)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/cleanKpAccountLoginFailed",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");if(!Zi(j))return Promise.reject("invalid cleanKpAccountLoginFailedForToken");if(t!==j)return Promise.reject("cleanKpAccountLoginFailed invalid token");let i=ke(e,"info.remoteAddress","");return Zi(i)||(i=ke(e,"socket.remoteAddress","")),Zi(i)||(i=ke(e,"connection.remoteAddress","")),k.includes(i)?(u.info({event:"api/cleanKpAccountLoginFailed",realIp:i}),await ge.cleanKpAccountLoginFailed(),!0):Promise.reject(`cleanKpAccountLoginFailed only allowed from cleanKpAccountLoginFailedForIps, got realIp[${i}]`)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutSsoUser",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/logoutSsoUser",token:hu(t)}),await fe.logoutByToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/checkToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/checkToken",token:hu(t)}),ge.callApiByToken(t),await fe.checkToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/refreshToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/refreshToken",token:hu(t)}),ge.callApiByToken(t),await fe.refreshToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/logoutByToken",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/logoutByToken",token:hu(t)}),ge.callApiByToken(t),await fe.logoutByToken(t)})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUsersList",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");u.info({event:"api/getSsoUsersList",token:hu(t)}),ge.callApiByToken(t);let i=await fe.checkTokenAndGetUsersList(t,{fun:De,perm:"readUsers"});return i=i.map(fe.omitUserCredential),i})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/getSsoUserInfor",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token",""),i=ke(e,"query.key",""),n=ke(e,"query.value","");if(!Me(t,i,n))return Promise.reject("tokenExpired");let r=wu(i,n);u.info({event:"api/getSsoUserInfor",token:hu(t),key:gu(i),value:r}),ge.callApiByToken(t);let s=null;return s="token"===i?await fe.checkTokenAndGetUserByToken(t,n,{fun:De,perm:"readUsers"}):await fe.checkTokenAndGetUserInfor(t,i,n,{fun:De,perm:"readUsers"}),ki(s)?s:(console.log("token does not have permission"),Promise.reject("tokenNoPermission"))})();return yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg}),i}},{method:"GET",path:"/api/verifyEmail",handler:async function(e,t){let i=await Ln(async function(){let t=ke(e,"query.token","");return u.info({event:"api/verifyEmail",token:hu(t)}),await fe.verifyEmail(t)})();yn(i.msg)&&(i.msg=i.msg.message),"error"===i.state&&u.error({event:"api-error",key:i.msg});let n,r=ke(e,"query.lang","");"eng"!==r&&"cht"!==r&&(r="eng"),n="success"===i.state?"userRegistrationVerifySuccess":i.msg&&"string"==typeof i.msg?i.msg:"verifyEmailInvalidToken";let s=ke(ne,`${r}.webName`,""),o=ke(ne,`${r}.${n}`,n),a=he;return a=kn(a,"{title}",s),a=kn(a,"{message}",o),t.response(a).type("text/html; charset=utf-8")}}],ve={port:l,pathStaticFiles:xe,apiName:"api",apis:Ce,tokenType:"Bearer",verifyConn:async({apiType:e,authorization:t,query:i,headers:n,req:r})=>{let s=ge.getIpByHeaders(r),o=ke(n,"origin",""),a=du(ke(n,"referer",""));u.info({event:"verifyConn",ip:s,origin:o,referer:a}),ge.callApiByIp(s);let c=!0;return await ge.getBlockedByIp(s).then(e=>{c=e}).catch(()=>{c=!0}),c=!c,c||console.log(`block ip[${s}]`),c},getUserIdByToken:async e=>"",corsOrigins:["*"],useDbOrm:!1,tableNamesExec:[],methodsExec:[],tableNamesSync:[],kpFunExt:{getWebInfor:async e=>({webLogo:f,webBackgoundGradientColors:g,webKey:w,userLogo:P,showLanguage:H,language:U,kpLang:re,showModeEditUsers:B,modeEditUsers:V,showModeEditTokens:_,modeEditTokens:R,showModeEditIps:Q,modeEditIps:J,allowUserRegistration:Z,passwordPolicyInfo:{minLength:Y.minLength,maxLength:Y.maxLength,requireLetter:Y.requireLetter,requireUppercase:Y.requireUppercase,requireLowercase:Y.requireLowercase,requireDigit:Y.requireDigit,requireSpecial:Y.requireSpecial,consecutiveCharsMinMatch:Y.consecutiveCharsMinMatch}}),checkToken:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-checkToken",token:hu(t)}),await fe.checkToken(t)},refreshToken:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-refreshToken",token:hu(t)}),await fe.refreshToken(t)},loginByAccountAndPassword:async(e,t,i,n)=>{if(!Me(i,n))return Promise.reject("failedLoginForCatch");u.info({event:"kpfun-loginByAccountAndPassword-before",account:i});let r=null,s="";return await ge.loginByAccountAndPassword(i,n).then(e=>{r=e}).catch(e=>{s=e}),ki(r)?u.info({event:"kpfun-loginByAccountAndPassword-success",account:i}):u.info({event:"kpfun-loginByAccountAndPassword-error",account:i,msg:s}),ki(r)?r:Promise.reject(s)},logoutByToken:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-logoutByToken",token:hu(t)}),await fe.logoutByToken(t)},createUser:async(e,t,i,n,r,s,o)=>{u.info({event:"kpfun-createUser",lang:t,account:i});let a={lang:t,account:i,password:n,confirmPassword:r,name:s,email:o};return await fe.createUser(t,a)},verifyEmail:async(e,t)=>(u.info({event:"kpfun-verifyEmail",token:hu(t)}),await fe.verifyEmail(t)),resendVerifyEmail:async(e,t,i,n)=>(u.info({event:"kpfun-resendVerifyEmail",lang:t,account:i}),await fe.resendVerifyEmail(t,i,n)),getUserByToken:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUserByToken",token:hu(t)}),await fe.checkTokenAndGetUserByToken(t,t)},getUserInfor:async(e,t,i,n)=>{if(!Me(t,i,n))return Promise.reject("tokenExpired");let r=wu(i,n);return u.info({event:"kpfun-getUserInfor",token:hu(t),key:gu(i),value:r}),await fe.checkTokenAndGetUserInfor(t,i,n,{fun:De,perm:"readUsers"})},checkUserPassword:async(e,t,i)=>(u.info({event:"kpfun-checkUserPassword",lang:t}),await fe.checkUserPassword(t,i)),changeUserPassword:async(e,t,i,n,r)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-changeUserPassword",token:hu(t),lang:i}),await fe.checkTokenAndChangePassword(t,i,n,r)},adminResetUserPassword:async(e,t,i,n)=>{if(!Me(t,n))return Promise.reject("tokenExpired");return u.info({event:"kpfun-adminResetUserPassword",token:hu(t),lang:i,targetUserId:n}),await fe.adminResetUserPassword(t,i,n)},getUsersList:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getUsersList",token:hu(t)}),await fe.checkTokenAndGetUsersList(t,{fun:De,perm:"readUsers"})},updateUsersList:async(e,t,i,n,r)=>{if(!Me(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateUsersList",token:hu(t),lang:i}),await fe.checkTokenAndUpdateUsersList(t,i,n,{fun:De,perm:"writeUsers"},r)},getTokensList:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getTokensList",token:hu(t)}),await fe.checkTokenAndGetTokensList(t,{fun:De,perm:"readTokens"})},updateTokensList:async(e,t,i,n,r)=>{if(!Me(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateTokensList",token:hu(t),lang:i}),await fe.checkTokenAndUpdateTokensList(t,n,{fun:De,perm:"writeTokens"},r)},getIpsList:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getIpsList",token:hu(t)}),await fe.checkTokenAndGetIpsList(t,{fun:De,perm:"readIps"})},updateIpsList:async(e,t,i,n,r)=>{if(!Me(t))return Promise.reject("tokenExpired");if(!ln(n)||!n.every(e=>Zi(ke(e,"id",""))))return Promise.reject("invalidRows");return u.info({event:"kpfun-updateIpsList",token:hu(t),lang:i}),await fe.checkTokenAndUpdateIpsList(t,n,{fun:De,perm:"writeIps"},r)},getStaUserSummary:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserSummary",token:hu(t)}),await ye.checkTokenAndGetStaUserSummary(t,{fun:De,perm:"readStats"})},getStaTokenSummary:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaTokenSummary",token:hu(t)}),await ye.checkTokenAndGetStaTokenSummary(t,{fun:De,perm:"readStats"})},getStaIpSummary:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIpSummary",token:hu(t)}),await ye.checkTokenAndGetStaIpSummary(t,{fun:De,perm:"readStats"})},getStaUserAccountLogin:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaUserAccountLogin",token:hu(t)}),await ye.checkTokenAndGetStaUserAccountLogin(t,{fun:De,perm:"readStats"})},getStaToken:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaToken",token:hu(t)}),await ye.checkTokenAndGetStaToken(t,{fun:De,perm:"readStats"})},getStaIp:async(e,t)=>{if(!Me(t))return Promise.reject("tokenExpired");return u.info({event:"kpfun-getStaIp",token:hu(t)}),await ye.checkTokenAndGetStaIp(t,{fun:De,perm:"readStats"})}},fpTableTags:"tableTags-web-sso.json"};return ve.kpFunExt=Object.fromEntries(Object.entries(ve.kpFunExt).map(([e,t])=>[e,async(...i)=>{try{return await t(...i)}catch(t){throw u.error({event:"kpfun-error",fun:e,key:Zi(t)?t:yn(t)?t.message:String(t)}),t}}])),a=new oa(ve),a}});
|
|
14
14
|
//# sourceMappingURL=w-web-sso.umd.js.map
|