w-web-sso
Version:
A web service for SSO.
6 lines • 281 kB
JavaScript
/*!
* w-web-sso v1.0.27
* (c) 2018-2021 yuda-lyu(semisphere)
* Released under the MIT License.
*/
!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("worker_threads"),require("url")):"function"==typeof define&&define.amd?define(["path","fs","@hapi/hapi","@hapi/inert","stream","worker_threads","url"],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.require$$0,e.url)}(this,(function(e,t,n,i,u,s,r){"use strict";var o="undefined"!=typeof document?document.currentScript:null,c=Array.isArray,l="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,D=l||a||Function("return this")(),d=D.Symbol,w=Object.prototype,M=w.hasOwnProperty,y=w.toString,C=d?d.toStringTag:void 0;var I=Object.prototype.toString;var m=d?d.toStringTag:void 0;function g(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":m&&m in Object(e)?function(e){var t=M.call(e,C),n=e[C];try{e[C]=void 0;var i=!0}catch(e){}var u=y.call(e);return i&&(t?e[C]=n:delete e[C]),u}(e):function(e){return I.call(e)}(e)}function p(e){return null!=e&&"object"==typeof e}function f(e){return"symbol"==typeof e||p(e)&&"[object Symbol]"==g(e)}var L=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,h=/^\w*$/;function b(e,t){if(c(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!f(e))||(h.test(e)||!L.test(e)||null!=t&&e in Object(t))}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function x(e){if(!A(e))return!1;var t=g(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var N,Z=D["__core-js_shared__"],E=(N=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+N:"";var T=Function.prototype.toString;function S(e){if(null!=e){try{return T.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var X=/^\[object .+?Constructor\]$/,v=Function.prototype,Y=Object.prototype,j=v.toString,z=Y.hasOwnProperty,G=RegExp("^"+j.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function F(e){return!(!A(e)||(t=e,E&&E in t))&&(x(e)?G:X).test(S(e));var t}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}var W=K(Object,"create");var k=Object.prototype.hasOwnProperty;var V=Object.prototype.hasOwnProperty;function B(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function H(e,t){return e===t||e!=e&&t!=t}function U(e,t){for(var n=e.length;n--;)if(H(e[n][0],t))return n;return-1}B.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},B.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},B.prototype.get=function(e){var t=this.__data__;if(W){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return k.call(t,e)?t[e]:void 0},B.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:V.call(t,e)},B.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this};var Q=Array.prototype.splice;function J(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(e){var t=this.__data__,n=U(t,e);return!(n<0)&&(n==t.length-1?t.pop():Q.call(t,n,1),--this.size,!0)},J.prototype.get=function(e){var t=this.__data__,n=U(t,e);return n<0?void 0:t[n][1]},J.prototype.has=function(e){return U(this.__data__,e)>-1},J.prototype.set=function(e,t){var n=this.__data__,i=U(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this};var P=K(D,"Map");function R(e,t){var n,i,u=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?u["string"==typeof t?"string":"hash"]:u.map}function O(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}O.prototype.clear=function(){this.size=0,this.__data__={hash:new B,map:new(P||J),string:new B}},O.prototype.delete=function(e){var t=R(this,e).delete(e);return this.size-=t?1:0,t},O.prototype.get=function(e){return R(this,e).get(e)},O.prototype.has=function(e){return R(this,e).has(e)},O.prototype.set=function(e,t){var n=R(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this};function _(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,u=t?t.apply(this,i):i[0],s=n.cache;if(s.has(u))return s.get(u);var r=e.apply(this,i);return n.cache=s.set(u,r)||s,r};return n.cache=new(_.Cache||O),n}_.Cache=O;var $=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/\\(\\)?/g,ee=function(e){var t=_(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($,(function(e,n,i,u){t.push(i?u.replace(q,"$1"):n||e)})),t})),te=ee;function ne(e,t){for(var n=-1,i=null==e?0:e.length,u=Array(i);++n<i;)u[n]=t(e[n],n,e);return u}var ie=d?d.prototype:void 0,ue=ie?ie.toString:void 0;function se(e){if("string"==typeof e)return e;if(c(e))return ne(e,se)+"";if(f(e))return ue?ue.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function re(e){return null==e?"":se(e)}function oe(e,t){return c(e)?e:b(e,t)?[e]:te(re(e))}function ce(e){if("string"==typeof e||f(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function le(e,t){for(var n=0,i=(t=oe(t,e)).length;null!=e&&n<i;)e=e[ce(t[n++])];return n&&n==i?e:void 0}function ae(e,t,n){var i=null==e?void 0:le(e,t);return void 0===i?n:i}function De(e){return"[object Object]"===Object.prototype.toString.call(e)}function de(e){if(De(e)){for(let t in e)return!0;return!1}return!1}function we(e){return"[object String]"===Object.prototype.toString.call(e)}function Me(e){return!(!we(e)||""===e)}var ye=/\s/;var Ce=/^\s+/;function Ie(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&ye.test(e.charAt(t)););return t}(e)+1).replace(Ce,""):e}var me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,pe=/^0o[0-7]+$/i,fe=parseInt;function Le(e){if("number"==typeof e)return e;if(f(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ie(e);var n=ge.test(e);return n||pe.test(e)?fe(e.slice(2),n?2:8):me.test(e)?NaN:+e}var he=1/0;function be(e){return e?(e=Le(e))===he||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function Ae(e){var t=be(e),n=t%1;return t==t?n?t-n:t:0}function xe(e){return e!=e}function Ne(e){let t=!1;if(Me(e))t=!isNaN(Number(e));else if(function(e){return"[object Number]"===Object.prototype.toString.call(e)}(e)){if(xe(e))return!1;t=!0}return t}function Ze(e){if(!Ne(e))return 0;return be(e)}function Ee(e){return!!Ne(e)&&(e=Ze(e),"number"==typeof(t=e)&&t==Ae(t));var t}var Te=D.isFinite,Se=Math.min;var Xe,ve=(Xe=Math["round"],function(e,t){if(e=Le(e),(t=null==t?0:Se(Ae(t),292))&&Te(e)){var n=(re(e)+"e").split("e");return+((n=(re(Xe(n[0]+"e"+(+n[1]+t)))+"e").split("e"))[0]+"e"+(+n[1]-t))}return Xe(e)});function Ye(e){if(!Ne(e))return 0;e=Ze(e);let t=ve(e);return"0"===String(t)?0:t}function je(e){if(!Ee(e))return!1;return Ye(e)>0}function ze(e){return"[object Array]"===Object.prototype.toString.call(e)}function Ge(e){return"[object Undefined]"===Object.prototype.toString.call(e)}function Fe(e){if(De(e)){for(let t in e)return!1;return!0}return!1}function Ke(e){return!!Ge(e)||(!!function(e){return"[object Null]"===Object.prototype.toString.call(e)}(e)||(!!Fe(e)||(!!function(e){return!(!we(e)||""!==e)}(e)||(!!function(e){return!!ze(e)&&0===e.length}(e)||!!xe(e)))))}function We(e){return!!ze(e)&&(0!==e.length&&(1!==e.length||!Ke(e[0])))}function ke(e){if(!Ne(e))return!1;return Ze(e)>0}function Ve(e,t){return function(n){return e(t(n))}}var Be=Ve(Object.getPrototypeOf,Object),He=Function.prototype,Ue=Object.prototype,Qe=He.toString,Je=Ue.hasOwnProperty,Pe=Qe.call(Object);function Re(e){if(!p(e)||"[object Object]"!=g(e))return!1;var t=Be(e);if(null===t)return!0;var n=Je.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Qe.call(n)==Pe}function Oe(e){if(!p(e))return!1;var t=g(e);return"[object Error]"==t||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Re(e)}function _e(e){return Oe(e)}function $e(e){let t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}function qe(e){if(!Ee(e))return!1;return Ye(e)>=0}function et(e,t){return Me(e)&&qe(t)?0===(t=Ye(t))?"":e.substring(0,t):""}function tt(e,t){if(!Me(e))return"";if(!qe(t))return"";if(0===(t=Ye(t)))return"";let n=e.length-t;return n<0&&(n=0),e.substring(n,n+t)}function nt(e,t){return Me(e)&&qe(t)?0===(t=Ye(t))?e:et(e,e.length-t):""}function it(){let e,t,n=new Promise((function(){e=arguments[0],t=arguments[1]}));return n.resolve=e,n.reject=t,n}function ut(e){let t,n=Object.prototype.toString.call(e);if(t="[object Promise]"===n,t)return!0;if("[object Function]"!==n)return!1;try{t="function"!=typeof e.subscribe&&"function"==typeof e.then}catch(e){}return t}let st=function(e){if(!$e(e))throw new Error("fn is not a function");return function(){let t=it(),n=null,i=null;try{n=e.apply(this,arguments)}catch(e){i=e}return null!==i?t.resolve({state:"error",msg:i}):ut(n)?n.then((e=>{t.resolve({state:"success",msg:e})})).catch((e=>{"cancelled"===ae(e,"reason")?t.resolve({state:"cancelled",msg:""}):t.resolve({state:"error",msg:e})})):t.resolve({state:"success",msg:n}),t}};function rt(e,t={}){let n=ae(t,"fs");if(!n.existsSync(e))return!1;let i=n.lstatSync(e);return!i.isFile()&&!i.isSymbolicLink()}function ot(e){return rt(e,{fs:t})}function ct(e,t={}){let n=ae(t,"fs");return!!n.existsSync(e)&&(!n.lstatSync(e).isDirectory()&&!n.lstatSync(e).isSymbolicLink())}function lt(e){return ct(e,{fs:t})}function at(e,t,n){if(!Me(e))return"";if(!Me(t))return"";if(!we(n))return"";return String(e).replaceAll(t,n)}var Dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var wt={exports:{}};!function(e){e.exports=function(){var e=1e3,t=6e4,n=36e5,i="millisecond",u="second",s="minute",r="hour",o="day",c="week",l="month",a="quarter",D="year",d="date",w="Invalid Date",M=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={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"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},I=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},m={s:I,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),u=n%60;return(t<=0?"+":"-")+I(i,2,"0")+":"+I(u,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var i=12*(n.year()-t.year())+(n.month()-t.month()),u=t.clone().add(i,l),s=n-u<0,r=t.clone().add(i+(s?-1:1),l);return+(-(i+(n-u)/(s?u-r:r-u))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:D,w:c,d:o,D:d,h:r,m:s,s:u,ms:i,Q:a}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},g="en",p={};p[g]=C;var f="$isDayjsObject",L=function(e){return e instanceof x||!(!e||!e[f])},h=function e(t,n,i){var u;if(!t)return g;if("string"==typeof t){var s=t.toLowerCase();p[s]&&(u=s),n&&(p[s]=n,u=s);var r=t.split("-");if(!u&&r.length>1)return e(r[0])}else{var o=t.name;p[o]=t,u=o}return!i&&u&&(g=u),u||!i&&g},b=function(e,t){if(L(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new x(n)},A=m;A.l=h,A.i=L,A.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var x=function(){function C(e){this.$L=h(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[f]=!0}var I=C.prototype;return I.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(A.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var i=t.match(M);if(i){var u=i[2]-1||0,s=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],u,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)):new Date(i[1],u,i[3]||1,i[4]||0,i[5]||0,i[6]||0,s)}}return new Date(t)}(e),this.init()},I.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()},I.$utils=function(){return A},I.isValid=function(){return!(this.$d.toString()===w)},I.isSame=function(e,t){var n=b(e);return this.startOf(t)<=n&&n<=this.endOf(t)},I.isAfter=function(e,t){return b(e)<this.startOf(t)},I.isBefore=function(e,t){return this.endOf(t)<b(e)},I.$g=function(e,t,n){return A.u(e)?this[t]:this.set(n,e)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(e,t){var n=this,i=!!A.u(t)||t,a=A.p(e),w=function(e,t){var u=A.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return i?u:u.endOf(o)},M=function(e,t){return A.w(n.toDate()[e].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},y=this.$W,C=this.$M,I=this.$D,m="set"+(this.$u?"UTC":"");switch(a){case D:return i?w(1,0):w(31,11);case l:return i?w(1,C):w(0,C+1);case c:var g=this.$locale().weekStart||0,p=(y<g?y+7:y)-g;return w(i?I-p:I+(6-p),C);case o:case d:return M(m+"Hours",0);case r:return M(m+"Minutes",1);case s:return M(m+"Seconds",2);case u:return M(m+"Milliseconds",3);default:return this.clone()}},I.endOf=function(e){return this.startOf(e,!1)},I.$set=function(e,t){var n,c=A.p(e),a="set"+(this.$u?"UTC":""),w=(n={},n[o]=a+"Date",n[d]=a+"Date",n[l]=a+"Month",n[D]=a+"FullYear",n[r]=a+"Hours",n[s]=a+"Minutes",n[u]=a+"Seconds",n[i]=a+"Milliseconds",n)[c],M=c===o?this.$D+(t-this.$W):t;if(c===l||c===D){var y=this.clone().set(d,1);y.$d[w](M),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else w&&this.$d[w](M);return this.init(),this},I.set=function(e,t){return this.clone().$set(e,t)},I.get=function(e){return this[A.p(e)]()},I.add=function(i,a){var d,w=this;i=Number(i);var M=A.p(a),y=function(e){var t=b(w);return A.w(t.date(t.date()+Math.round(e*i)),w)};if(M===l)return this.set(l,this.$M+i);if(M===D)return this.set(D,this.$y+i);if(M===o)return y(1);if(M===c)return y(7);var C=(d={},d[s]=t,d[r]=n,d[u]=e,d)[M]||1,I=this.$d.getTime()+i*C;return A.w(I,this)},I.subtract=function(e,t){return this.add(-1*e,t)},I.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||w;var i=e||"YYYY-MM-DDTHH:mm:ssZ",u=A.z(this),s=this.$H,r=this.$m,o=this.$M,c=n.weekdays,l=n.months,a=n.meridiem,D=function(e,n,u,s){return e&&(e[n]||e(t,i))||u[n].slice(0,s)},d=function(e){return A.s(s%12||12,e,"0")},M=a||function(e,t,n){var i=e<12?"AM":"PM";return n?i.toLowerCase():i};return i.replace(y,(function(e,i){return i||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return A.s(t.$y,4,"0");case"M":return o+1;case"MM":return A.s(o+1,2,"0");case"MMM":return D(n.monthsShort,o,l,3);case"MMMM":return D(l,o);case"D":return t.$D;case"DD":return A.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return D(n.weekdaysMin,t.$W,c,2);case"ddd":return D(n.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return A.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return M(s,r,!0);case"A":return M(s,r,!1);case"m":return String(r);case"mm":return A.s(r,2,"0");case"s":return String(t.$s);case"ss":return A.s(t.$s,2,"0");case"SSS":return A.s(t.$ms,3,"0");case"Z":return u}return null}(e)||u.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(i,d,w){var M,y=this,C=A.p(d),I=b(i),m=(I.utcOffset()-this.utcOffset())*t,g=this-I,p=function(){return A.m(y,I)};switch(C){case D:M=p()/12;break;case l:M=p();break;case a:M=p()/3;break;case c:M=(g-m)/6048e5;break;case o:M=(g-m)/864e5;break;case r:M=g/n;break;case s:M=g/t;break;case u:M=g/e;break;default:M=g}return w?M:A.a(M)},I.daysInMonth=function(){return this.endOf(l).$D},I.$locale=function(){return p[this.$L]},I.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),i=h(e,t,!0);return i&&(n.$L=i),n},I.clone=function(){return A.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},C}(),N=x.prototype;return b.prototype=N,[["$ms",i],["$s",u],["$m",s],["$H",r],["$W",o],["$M",l],["$y",D],["$D",d]].forEach((function(e){N[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),b.extend=function(e,t){return e.$i||(e(t,x,b),e.$i=!0),b},b.locale=h,b.isDayjs=L,b.unix=function(e){return b(1e3*e)},b.en=p[g],b.Ls=p,b.p={},b}()}(wt);var Mt=dt(wt.exports);function yt(){if(!$e(Mt))throw new Error("invalid dayjs");return Mt().format("YYYY-MM-DDTHH:mm:ssZ")}let Ct="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),It=Ct.length;function mt(e=32){let t=[];e=je(e)?Ye(e):32;for(let n=0;n<e;n++)t[n]=Ct[0|Math.random()*It];return t.join("")}function gt(e){return!0===(t=e)||!1===t||p(t)&&"[object Boolean]"==g(t);var t}var pt={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function u(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new u(i,s||e,r),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function r(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,u=[];if(0===this._eventsCount)return u;for(i in e=this._events)t.call(e,i)&&u.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(e)):u},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var u=0,s=i.length,r=new Array(s);u<s;u++)r[u]=i[u].fn;return r},o.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(e,t,i,u,s,r){var o=n?n+e:e;if(!this._events[o])return!1;var c,l,a=this._events[o],D=arguments.length;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),D){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,t),!0;case 3:return a.fn.call(a.context,t,i),!0;case 4:return a.fn.call(a.context,t,i,u),!0;case 5:return a.fn.call(a.context,t,i,u,s),!0;case 6:return a.fn.call(a.context,t,i,u,s,r),!0}for(l=1,c=new Array(D-1);l<D;l++)c[l-1]=arguments[l];a.fn.apply(a.context,c)}else{var d,w=a.length;for(l=0;l<w;l++)switch(a[l].once&&this.removeListener(e,a[l].fn,void 0,!0),D){case 1:a[l].fn.call(a[l].context);break;case 2:a[l].fn.call(a[l].context,t);break;case 3:a[l].fn.call(a[l].context,t,i);break;case 4:a[l].fn.call(a[l].context,t,i,u);break;default:if(!c)for(d=1,c=new Array(D-1);d<D;d++)c[d-1]=arguments[d];a[l].fn.apply(a[l].context,c)}}return!0},o.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,i,u){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return r(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||u&&!o.once||i&&o.context!==i||r(this,s);else{for(var c=0,l=[],a=o.length;c<a;c++)(o[c].fn!==t||u&&!o[c].once||i&&o[c].context!==i)&&l.push(o[c]);l.length?this._events[s]=1===l.length?l[0]:l:r(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&r(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(pt);var ft=dt(pt.exports);function Lt(){return new ft}async function ht(e,t={}){let n=null,i=it();if(!$e(e))return i.reject("waitfunction需輸入函數f"),i;let u=async()=>{let t=e();return ut(t)&&(t=await t),t};if(n=await u(),!0===n)return i.resolve(),i;let s=ae(t,"attemptNum",null);je(s)||(s=200);let r=ae(t,"timeInterval",null);je(r)||(r=1e3);let o=0,c=setInterval((async()=>{o+=1,n=await u(),!0===n&&(clearInterval(c),i.resolve()),o>s&&(clearInterval(c),i.reject(`exceeded attemptNum[${s}]`))}),r);return i}function bt(e){return function(e,t={}){let n=ae(t,"fs");if(rt(e,{fs:n}))return{success:"input folder is already exists: "+e};if(n.existsSync(e))return{error:"input path already exists: "+e};try{n.mkdirSync(e,{recursive:!0})}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}function At(e){return"number"==typeof e||p(e)&&"[object Number]"==g(e)}function xt(e){if(!Me(e)&&!Ne(e)&&!f(e))return"";let t="";try{t=String(e)}catch(e){}try{t=e.toString()}catch(e){}return t}var Nt={exports:{}};var Zt,Et={exports:{}};function Tt(){return Zt||(Zt=1,function(e){var t;e.exports=(t=t||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==Dt&&Dt.crypto&&(n=Dt.crypto),!n)try{n=require("crypto")}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},u=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},r=s.lib={},o=r.Base={extend:function(e){var t=u(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=r.WordArray=o.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,i=this.sigBytes,u=e.sigBytes;if(this.clamp(),i%4)for(var s=0;s<u;s++){var r=n[s>>>2]>>>24-s%4*8&255;t[i+s>>>2]|=r<<24-(i+s)%4*8}else for(var o=0;o<u;o+=4)t[i+o>>>2]=n[o>>>2];return this.sigBytes+=u,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new c.init(t,e)}}),l=s.enc={},a=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],u=0;u<n;u++){var s=t[u>>>2]>>>24-u%4*8&255;i.push((s>>>4).toString(16)),i.push((15&s).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(n,t/2)}},D=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],u=0;u<n;u++){var s=t[u>>>2]>>>24-u%4*8&255;i.push(String.fromCharCode(s))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(n,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(D.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return D.parse(unescape(encodeURIComponent(e)))}},w=r.BufferedBlockAlgorithm=o.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 n,i=this._data,u=i.words,s=i.sigBytes,r=this.blockSize,o=s/(4*r),l=(o=t?e.ceil(o):e.max((0|o)-this._minBufferSize,0))*r,a=e.min(4*l,s);if(l){for(var D=0;D<l;D+=r)this._doProcessBlock(u,D);n=u.splice(0,l),i.sigBytes-=a}return new c.init(n,a)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=w.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){w.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,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new M.HMAC.init(e,n).finalize(t)}}});var M=s.algo={};return s}(Math),t)}(Et)),Et.exports}!function(e){e.exports=Tt().enc.Utf8}(Nt);var St=dt(Nt.exports),Xt={exports:{}};!function(e){var t;e.exports=(t=Tt(),function(){var e=t,n=e.lib.WordArray;function i(e,t,i){for(var u=[],s=0,r=0;r<t;r++)if(r%4){var o=i[e.charCodeAt(r-1)]<<r%4*2|i[e.charCodeAt(r)]>>>6-r%4*2;u[s>>>2]|=o<<24-s%4*8,s++}return n.create(u,s)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var u=[],s=0;s<n;s+=3)for(var r=(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,o=0;o<4&&s+.75*o<n;o++)u.push(i.charAt(r>>>6*(3-o)&63));var c=i.charAt(64);if(c)for(;u.length%4;)u.push(c);return u.join("")},parse:function(e){var t=e.length,n=this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var s=0;s<n.length;s++)u[n.charCodeAt(s)]=s}var r=n.charAt(64);if(r){var o=e.indexOf(r);-1!==o&&(t=o)}return i(e,t,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(Xt);var vt=dt(Xt.exports);function Yt(e){if(!Me(e))return"";let t=St.parse(e);return vt.stringify(t)}function jt(e,t){return!!De(e)&&(!(!Me(t)&&!Ne(t))&&t in e)}function zt(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}var Gt,Ft=function(e,t,n){for(var i=-1,u=Object(e),s=n(e),r=s.length;r--;){var o=s[Gt?r:++i];if(!1===t(u[o],o,u))break}return e};function Kt(e){return p(e)&&"[object Arguments]"==g(e)}var Wt=Object.prototype,kt=Wt.hasOwnProperty,Vt=Wt.propertyIsEnumerable,Bt=Kt(function(){return arguments}())?Kt:function(e){return p(e)&&kt.call(e,"callee")&&!Vt.call(e,"callee")},Ht=Bt;var Ut="object"==typeof exports&&exports&&!exports.nodeType&&exports,Qt=Ut&&"object"==typeof module&&module&&!module.nodeType&&module,Jt=Qt&&Qt.exports===Ut?D.Buffer:void 0,Pt=(Jt?Jt.isBuffer:void 0)||function(){return!1},Rt=/^(?:0|[1-9]\d*)$/;function Ot(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Rt.test(e))&&e>-1&&e%1==0&&e<t}function _t(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var $t={};function qt(e){return function(t){return e(t)}}$t["[object Float32Array]"]=$t["[object Float64Array]"]=$t["[object Int8Array]"]=$t["[object Int16Array]"]=$t["[object Int32Array]"]=$t["[object Uint8Array]"]=$t["[object Uint8ClampedArray]"]=$t["[object Uint16Array]"]=$t["[object Uint32Array]"]=!0,$t["[object Arguments]"]=$t["[object Array]"]=$t["[object ArrayBuffer]"]=$t["[object Boolean]"]=$t["[object DataView]"]=$t["[object Date]"]=$t["[object Error]"]=$t["[object Function]"]=$t["[object Map]"]=$t["[object Number]"]=$t["[object Object]"]=$t["[object RegExp]"]=$t["[object Set]"]=$t["[object String]"]=$t["[object WeakMap]"]=!1;var en="object"==typeof exports&&exports&&!exports.nodeType&&exports,tn=en&&"object"==typeof module&&module&&!module.nodeType&&module,nn=tn&&tn.exports===en&&l.process,un=function(){try{var e=tn&&tn.require&&tn.require("util").types;return e||nn&&nn.binding&&nn.binding("util")}catch(e){}}(),sn=un&&un.isTypedArray,rn=sn?qt(sn):function(e){return p(e)&&_t(e.length)&&!!$t[g(e)]},on=Object.prototype.hasOwnProperty;function cn(e,t){var n=c(e),i=!n&&Ht(e),u=!n&&!i&&Pt(e),s=!n&&!i&&!u&&rn(e),r=n||i||u||s,o=r?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],l=o.length;for(var a in e)!t&&!on.call(e,a)||r&&("length"==a||u&&("offset"==a||"parent"==a)||s&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Ot(a,l))||o.push(a);return o}var ln=Object.prototype;function an(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ln)}var Dn=Ve(Object.keys,Object),dn=Object.prototype.hasOwnProperty;function wn(e){if(!an(e))return Dn(e);var t=[];for(var n in Object(e))dn.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Mn(e){return null!=e&&_t(e.length)&&!x(e)}function yn(e){return Mn(e)?cn(e):wn(e)}function Cn(e,t){return e&&Ft(e,t,yn)}var In=function(e,t){return function(n,i){if(null==n)return n;if(!Mn(n))return e(n,i);for(var u=n.length,s=t?u:-1,r=Object(n);(t?s--:++s<u)&&!1!==i(r[s],s,r););return n}}(Cn),mn=In;function gn(e){return e}function pn(e,t){var n;return(c(e)?zt:mn)(e,"function"==typeof(n=t)?n:gn)}function fn(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function Ln(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function hn(e){return"[object Uint16Array]"===Object.prototype.toString.call(e)}function bn(e){if(!(fn(e)||(t=e,"[object Blob]"===Object.prototype.toString.call(t))||Ln(e)||hn(e)))return null;var t;try{if(e.byteLength)return e.byteLength}catch(e){}try{if(e.length)return e.length}catch(e){}try{if(e.size)return e.size}catch(e){}return null}function An(e){if(!Me(e))return new Uint8Array;let t;try{t=function(e){if(!we(e))return new Uint8Array;let t=vt.parse(e),n=t.words,i=t.sigBytes,u=new Uint8Array(i);for(let e=0;e<i;e++){let t=n[e>>>2]>>>24-e%4*8&255;u[e]=t}return u}(Yt(e))}catch(e){return new Uint8Array}return t}function xn(e,t,n=0,i=!0,u=52,s=8){return function(e,t,n,i,u,s){if(!Ne(e))return null;if(!Ln(t))return null;if(!Ee(n))return null;if(!gt(i))return null;if(!Ee(u))return null;if(!Ee(s))return null;let r,o,c;e=Ze(e);let l=8*s-u-1,a=(1<<l)-1,D=a>>1,d=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,w=i?s-1:0,M=i?-1:1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,r=a):(r=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-r))<1&&(r--,c*=2),(e+=r+D>=1?d/c:d*Math.pow(2,1-D))*c>=2&&(r++,c/=2),r+D>=a?(o=0,r=a):r+D>=1?(o=(e*c-1)*Math.pow(2,u),r+=D):(o=e*Math.pow(2,D-1)*Math.pow(2,u),r=0));u>=8;t[n+w]=255&o,w+=M,o/=256,u-=8);for(r=r<<u|o,l+=u;l>0;t[n+w]=255&r,w+=M,r/=256,l-=8);return t[n+w-M]|=128*y,null}(e,t,n,i,u,s)}function Nn(e){let t=[],n=[];if(!We(e)&&!de(e))return null;let i=[],u=[];function s(e){i.push(bn(e)),u.push(e)}try{let r=function(e){if(!De(e))return{results:"",binarys:[]};if(Fe(e))return{results:"",binarys:[]};let t="",n=[];try{let i=-1;t=JSON.stringify(e,(function(e,t){if(Ln(t)){i+=1;let e=`[Uint8Array]::${i}`;return n.push(t),e}if(hn(t)){i+=1;let e=`[Uint16Array]::${i}`;return n.push(t),e}if(fn(t)){i+=1;let e=`[ArrayBuffer]::${i}`;return n.push(t),e}return Oe(t)&&(t=t.toString()),t}))}catch(e){}return{results:t,binarys:n}}(e);s(An(r.results)),pn(r.binarys,(e=>{s(e)}));let o=i,c=An(JSON.stringify(o)),l=new Uint8Array(8);xn(bn(c),l),t.push(l),t.push(c),pn(u,(e=>{t.push(e)})),pn(t,(e=>{n=function(e,t){let n=bn(e),i=bn(t),u=new Uint8Array(n+i);return u.set(new Uint8Array(e),0),u.set(new Uint8Array(t),n),u}(n,e)}))}catch(e){return null}return n}function Zn(e,t=0,n=!0,i=52,u=8){return function(e,t,n,i,u){if(!Ln(e))return null;if(!Ee(t))return null;if(!gt(n))return null;if(!Ee(i))return null;if(!Ee(u))return null;let s,r,o=8*u-i-1,c=(1<<o)-1,l=c>>1,a=-7,D=n?0:u-1,d=n?1:-1,w=e[t+D];for(D+=d,s=w&(1<<-a)-1,w>>=-a,a+=o;a>0;s=256*s+e[t+D],D+=d,a-=8);for(r=s&(1<<-a)-1,s>>=-a,a+=i;a>0;r=256*r+e[t+D],D+=d,a-=8);if(0===s)s=1-l;else{if(s===c)return r?NaN:1/0*(w?-1:1);r+=Math.pow(2,i),s-=l}return(w?-1:1)*r*Math.pow(2,s-i)}(e,t,n,i,u)}var En={exports:{}};!function(e){var t;e.exports=(t=Tt(),function(){if("function"==typeof ArrayBuffer){var e=t.lib.WordArray,n=e.init,i=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,i=[],u=0;u<t;u++)i[u>>>2]|=e[u]<<24-u%4*8;n.call(this,i,t)}else n.apply(this,arguments)};i.prototype=e}}(),t.lib.WordArray)}(En);var Tn=dt(En.exports);function Sn(e){if(!Ln(e))return"";let t;try{n=function(e){return Ln(e)?Tn.create(e).toString(vt):""}(e),t=Me(n)?vt.parse(n).toString(St):""}catch(e){return""}var n;return t}function Xn(e){let t=null;if(!Ln(e))return null;try{let n=8,i=e.slice(0,n),u=e.slice(n,bn(e)),s=Zn(i),r=u.slice(0,s),o=u.slice(s,bn(u)),c=Sn(r),l=function(e,t){let n=0,i=0,u=[];return pn(t,(t=>{i=n+t;let s=e.slice(n,i);n=i,u.push(s)})),u}(o,JSON.parse(c));t=function(e){if(!de(e))return{};let{results:t,binarys:n}=e;if(!Me(t))return{};if(!ze(n))return{};let i={};try{i=JSON.parse(t,(function(e,t){if(Me(t)){if(t.indexOf("[Uint8Array]::")>=0){let e=Ye(t.replace("[Uint8Array]::",""));return n[e]}if(t.indexOf("[Uint16Array]::")>=0){let e=Ye(t.replace("[Uint16Array]::",""));return n[e]}if(t.indexOf("[ArrayBuffer]::")>=0){let e=Ye(t.replace("[ArrayBuffer]::",""));return n[e]}}return t}))}catch(e){}return i}({results:Sn(l.shift()),binarys:l})}catch(e){}return t}function vn(e){var t=this.__data__=new J(e);this.size=t.size}vn.prototype.clear=function(){this.__data__=new J,this.size=0},vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},vn.prototype.get=function(e){return this.__data__.get(e)},vn.prototype.has=function(e){return this.__data__.has(e)},vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof J){var i=n.__data__;if(!P||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new O(i)}return n.set(e,t),this.size=n.size,this};function Yn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new O;++t<n;)this.add(e[t])}function jn(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function zn(e,t){return e.has(t)}Yn.prototype.add=Yn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Yn.prototype.has=function(e){return this.__data__.has(e)};function Gn(e,t,n,i,u,s){var r=1&n,o=e.length,c=t.length;if(o!=c&&!(r&&c>o))return!1;var l=s.get(e),a=s.get(t);if(l&&a)return l==t&&a==e;var D=-1,d=!0,w=2&n?new Yn:void 0;for(s.set(e,t),s.set(t,e);++D<o;){var M=e[D],y=t[D];if(i)var C=r?i(y,M,D,t,e,s):i(M,y,D,e,t,s);if(void 0!==C){if(C)continue;d=!1;break}if(w){if(!jn(t,(function(e,t){if(!zn(w,t)&&(M===e||u(M,e,n,i,s)))return w.push(t)}))){d=!1;break}}else if(M!==y&&!u(M,y,n,i,s)){d=!1;break}}return s.delete(e),s.delete(t),d}var Fn=D.Uint8Array;function Kn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function Wn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var kn=d?d.prototype:void 0,Vn=kn?kn.valueOf:void 0;function Bn(e,t){for(var n=-1,i=t.length,u=e.length;++n<i;)e[u+n]=t[n];return e}function Hn(e,t,n){var i=t(e);return c(e)?i:Bn(i,n(e))}function Un(e,t){for(var n=-1,i=null==e?0:e.length,u=0,s=[];++n<i;){var r=e[n];t(r,n,e)&&(s[u++]=r)}return s}function Qn(){return[]}var Jn=Object.prototype.propertyIsEnumerable,Pn=Object.getOwnPropertySymbols,Rn=Pn?function(e){return null==e?[]:(e=Object(e),Un(Pn(e),(function(t){return Jn.call(e,t)})))}:Qn;function On(e){return Hn(e,yn,Rn)}var _n=Object.prototype.hasOwnProperty;var $n=K(D,"DataView"),qn=K(D,"Promise"),ei=K(D,"Set"),ti=K(D,"WeakMap"),ni="[object Map]",ii="[object Promise]",ui="[object Set]",si="[object WeakMap]",ri="[object DataView]",oi=S($n),ci=S(P),li=S(qn),ai=S(ei),Di=S(ti),di=g;($n&&di(new $n(new ArrayBuffer(1)))!=ri||P&&di(new P)!=ni||qn&&di(qn.resolve())!=ii||ei&&di(new ei)!=ui||ti&&di(new ti)!=si)&&(di=function(e){var t=g(e),n="[object Object]"==t?e.constructor:void 0,i=n?S(n):"";if(i)switch(i){case oi:return ri;case ci:return ni;case li:return ii;case ai:return ui;case Di:return si}return t});var wi=di,Mi="[object Arguments]",yi="[object Array]",Ci="[object Object]",Ii=Object.prototype.hasOwnProperty;function mi(e,t,n,i,u,s){var r=c(e),o=c(t),l=r?yi:wi(e),a=o?yi:wi(t),D=(l=l==Mi?Ci:l)==Ci,d=(a=a==Mi?Ci:a)==Ci,w=l==a;if(w&&Pt(e)){if(!Pt(t))return!1;r=!0,D=!1}if(w&&!D)return s||(s=new vn),r||rn(e)?Gn(e,t,n,i,u,s):function(e,t,n,i,u,s,r){switch(n){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 Fn(e),new Fn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return H(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var o=Kn;case"[object Set]":var c=1&i;if(o||(o=Wn),e.size!=t.size&&!c)return!1;var l=r.get(e);if(l)return l==t;i|=2,r.set(e,t);var a=Gn(o(e),o(t),i,u,s,r);return r.delete(e),a;case"[object Symbol]":if(Vn)return Vn.call(e)==Vn.call(t)}return!1}(e,t,l,n,i,u,s);if(!(1&n)){var M=D&&Ii.call(e,"__wrapped__"),y=d&&Ii.call(t,"__wrapped__");if(M||y){var C=M?e.value():e,I=y?t.value():t;return s||(s=new vn),u(C,I,n,i,s)}}return!!w&&(s||(s=new vn),function(e,t,n,i,u,s){var r=1&n,o=On(e),c=o.length;if(c!=On(t).length&&!r)return!1;for(var l=c;l--;){var a=o[l];if(!(r?a in t:_n.call(t,a)))return!1}var D=s.get(e),d=s.get(t);if(D&&d)return D==t&&d==e;var w=!0;s.set(e,t),s.set(t,e);for(var M=r;++l<c;){var y=e[a=o[l]],C=t[a];if(i)var I=r?i(C,y,a,t,e,s):i(y,C,a,e,t,s);if(!(void 0===I?y===C||u(y,C,n,i,s):I)){w=!1;break}M||(M="constructor"==a)}if(w&&!M){var m=e.constructor,g=t.constructor;m==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&m instanceof m&&"function"==typeof g&&g instanceof g||(w=!1)}return s.delete(e),s.delete(t),w}(e,t,n,i,u,s))}function gi(e,t,n,i,u){return e===t||(null==e||null==t||!p(e)&&!p(t)?e!=e&&t!=t:mi(e,t,n,i,gi,u))}function pi(e){return e==e&&!A(e)}function fi(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function Li(e){var t=function(e){for(var t=yn(e),n=t.length;n--;){var i=t[n],u=e[i];t[n]=[i,u,pi(u)]}return t}(e);return 1==t.length&&t[0][2]?fi(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,i){var u=n.length,s=u,r=!i;if(null==e)return!s;for(e=Object(e);u--;){var o=n[u];if(r&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++u<s;){var c=(o=n[u])[0],l=e[c],a=o[1];if(r&&o[2]){if(void 0===l&&!(c in e))return!1}else{var D=new vn;if(i)var d=i(l,a,c,e,t,D);if(!(void 0===d?gi(a,l,3,i,D):d))return!1}}return!0}(n,e,t)}}function hi(e,t){return null!=e&&t in Object(e)}function bi(e,t){return null!=e&&function(e,t,n){for(var i=-1,u=(t=oe(t,e)).length,s=!1;++i<u;){var r=ce(t[i]);if(!(s=null!=e&&n(e,r)))break;e=e[r]}return s||++i!=u?s:!!(u=null==e?0:e.length)&&_t(u)&&Ot(r,u)&&(c(e)||Ht(e))}(e,t,hi)}function Ai(e){return function(t){return null==t?void 0:t[e]}}function xi(e){return b(e)?Ai(ce(e)):function(e){return function(t){return le(t,e)}}(e)}function Ni(e){return"function"==typeof e?e:null==e?gn:"object"==typeof e?c(e)?function(e,t){return b(e)&&pi(t)?fi(ce(e),t):function(n){var i=ae(n,e);return void 0===i&&i===t?bi(n,e):gi(t,i,3)}}(e[0],e[1]):Li(e):xi(e)}function Zi(e,t){var n=-1,i=Mn(e)?Array(e.length):[];return mn(e,(function(e,u,s){i[++n]=t(e,u,s)})),i}function Ei(e,t){return(c(e)?ne:Zi)(e,Ni(t))}function Ti(e,t,n){var i=-1,u=e.length;t<0&&(t=-t>u?0:u+t),(n=n>u?u:n)<0&&(n+=u),u=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(u);++i<u;)s[i]=e[i+t];return s}function Si(e){return e!=e}function Xi(e,t,n){return t==t?function(e,t,n){for(var i=n-1,u=e.length;++i<u;)if(e[i]===t)return i;return-1}(e,t,n):function(e,t,n,i){for(var u=e.length,s=n+(i?1:-1);i?s--:++s<u;)if(t(e[s],s,e))return s;return-1}(e,Si,n)}var vi=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Yi(e){return vi.test(e)}var ji="\\ud800-\\udfff",zi="["+ji+"]",Gi="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Fi="\\ud83c[\\udffb-\\udfff]",Ki="[^"+ji+"]",Wi="(?:\\ud83c[\\udde6-\\uddff]){2}",ki="[\\ud800-\\udbff][\\udc00-\\udfff]",Vi="(?:"+Gi+"|"+Fi+")"+"?",Bi="[\\ufe0e\\ufe0f]?",Hi=Bi+Vi+("(?:\\u200d(?:"+[Ki,Wi,ki].join("|")+")"+Bi+Vi+")*"),Ui="(?:"+[Ki+Gi+"?",Gi,Wi,ki,zi].join("|")+")",Qi=RegExp(Fi+"(?="+Fi+")|"+Ui+Hi,"g");function Ji(e){return Yi(e)?function(e){return e.match(Qi)||[]}(e):function(e){return e.split("")}(e)}function Pi(e,t,n){if((e=re(e))&&(n||void 0===t))return Ie(e);if(!e||!(t=se(t)))return e;var i=Ji(e),u=Ji(t),s=function(e,t){for(var n=-1,i=e.length;++n<i&&Xi(t,e[n],0)>-1;);return n}(i,u),r=function(e,t){for(var n=e.length;n--&&Xi(t,e[n],0)>-1;);return n}(i,u)+1;return function(e,t,n){var i=e.length;return n=void 0===n?i:n,!t&&n>=i?e:Ti(e,t,n)}(i,s,r).join("")}function Ri(e,t){if(!Me(e))return[];if(!Me(t))return[];let n=function(e,t){return Me(e)&&Me(t)?e.split(t):[]}(e,t);n=Ei(n,Pi);let i=[];return pn(n,(function(e){Me(e)&&i.push(e)})),i}function Oi(e){return function(e,t={}){let n=ae(t,"fs");if(!n.existsSync(e))return{success:"file does not exist: "+e};if(!ct(e,{fs:n}))return{error:"input path is not a file: "+e};try{n.unlinkSync(e)}catch(e){return{error:e}}return{success:"done: "+e}}(e,{fs:t})}var _i={exports:{}};!function(e){var t,n;e.exports=(t=s,n={},function(e){e.exports=function(e){var t={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function u(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,i,s,r){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new u(i,s||e,r),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,u=[];if(0===this._eventsCount)return u;for(i in e=this._events)t.call(e,i)&&u.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(e)):u},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var u=0,s=i.length,r=new Array(s);u<s;u++)r[u]=i[u].fn;return r},o.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(e,t,i,u,s,r){var o=n?n+e:e;if(!this._events[o])return!1;var c,l,a=this._events[o],D=arguments.length;if(a.fn){switch(a.once&&this.removeListener(e,a.fn,void 0,!0),D){case 1:return a.fn.call(a.context),!0;case 2:return a.fn.call(a.context,t),!0;case 3:return a.fn.call(a.context,t,i),!0;case 4:return a.fn.call(a.context,t,i,u),!0;case 5:return a.fn.call(a.context,t,i,u,s),!0;case 6:return a.fn.call(a.context,t,i,u,s,r),!0}for(l=1,c=new Array(D-1);l<D;l++)c[l-1]=arguments[l];a.fn.apply(a.context,c)}else{var d,w=a.length;for(l=0;l<w;l++)switch(a[l].once&&this.removeListener(e,a[l].fn,void 0,!0),D){case 1:a[l].fn.call(a[l].context);break;case 2:a[l].fn.call(a[l].context,t);break;case 3:a[l].fn.call(a[l].context,t,i);break;case 4:a[l].fn.call(a[l].context,t,i,u);break;default:if(!c)for(d=1,c=new Array(D-1);d<D;d++)c[d-1]=arguments[d];a[l].fn.apply(a[l].context,c)}}return!0},o.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,i,u){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return r(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||u&&!o.once||i&&o.context!==i||r(this,s);else{for(var c=0,l=[],a=o.length;c<a;c++)(o[c].fn!==t||u&&!o[c].once||i&&o[c].context!==i)&&l.push(o[c]);l.length?this._events[s]=1===l.length?l[0]:l:r(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&r(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}({get exports(){return t},set exports(e){t=e}});var n=t;let i;!function(){if("nodejs"!=("undefined"!=typeof window&&void 0!==window.document?"browser":"nodejs"))return null;let t=(u="CgogICAgICAgIC8vaW1wb3J0IHsgcGFyZW50UG9ydCB9IGZyb20gJ3dvcmtlcl90aHJlYWRzJwogICAgICAgIGxldCB7IHBhcmVudFBvcnQgfSA9IHJlcXVpcmUoJ3dvcmtlcl90aHJlYWRzJykgLy/lm6BwYWNrYWdlLmpzb27kuI3ntaZ0eXBlPW1vZHVsZeaVheeEoeazleaUr+aPtGVzNiBpbXBvcnQsIOW+l+S9v+eUqHJlcXVpcmUKICAgICAgICAvL+iLpeimgeaWvG5vZGVqcyB3b3JrZXLlhafkvb/nlKjnhKHms5XovYnora/nmoTljp/nlJ/lpZfku7bkvovlpoJmcywg6YG/5YWN5L2/55So6aCC5bGkaW1wb3J05Yqg6LyJ5L2/55SoLCDlm6DnhKHms5XovYnora/mnIPnm7TmjqXkv53nlZkKICAgICAgICAvL+S4puWboGltcG9ydOS9jeaWvHdvcmtlcuWkluWxpOmZkOWumueCunJlcXVpcmXljYAocGFja2FnZS5qc29u5LiN57WmdHlwZT1tb2R1bGUpLCDmlYXlh7rnj77pjK/oqqTnhKHms5XovYnora8KICAgICAgICAKCiJ1c2Ugc3RyaWN0Ijt2YXIgdD1yZXF1aXJlKCJwYXRoIikscj1yZXF1aXJlKCJmcyIpLGU9QXJyYXkuaXNBcnJheSxuPSJvYmplY3QiP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