@amityco/ts-sdk 0.0.1-beta.21 → 0.0.1-beta.22
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/dist/@types/domains/content.d.ts +5 -2
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/message.d.ts +2 -2
- package/dist/@types/domains/message.d.ts.map +1 -1
- package/dist/channel/api/queryChannels.d.ts +1 -0
- package/dist/channel/api/queryChannels.d.ts.map +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +3 -3
- package/dist/index.umd.js +1 -1
- package/dist/message/api/createMessage.d.ts +2 -2
- package/dist/message/api/createMessage.d.ts.map +1 -1
- package/dist/message/api/updateMessage.d.ts +2 -2
- package/dist/message/api/updateMessage.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/@types/domains/content.ts +7 -1
- package/src/@types/domains/message.ts +2 -1
- package/src/channel/api/queryChannels.ts +1 -0
- package/src/core/query/paging.ts +3 -3
- package/src/message/api/createMessage.ts +2 -2
- package/src/message/api/updateMessage.ts +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Amity=function(e){"use strict";var t;const n="object"==typeof globalThis?globalThis:"object"==typeof global?global:window,{process:r={}}=n,o="production"===(null===(t=r.env)||void 0===t?void 0:t.NODE_ENV);var i,s;const a=null!==(s=null===(i=r.env)||void 0===i?void 0:i.VERSION)&&void 0!==s?s:"__dev__",c="function"==typeof atob,l="function"==typeof btoa,u="function"==typeof Buffer,h="function"==typeof TextDecoder?new TextDecoder:void 0,f="function"==typeof TextEncoder?new TextEncoder:void 0,p=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),d=(e=>{let t={};return e.forEach(((e,n)=>t[e]=n)),t})(p),m=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,g=String.fromCharCode.bind(String),y="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),v=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),b=l?e=>btoa(e):u?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,o,i="";const s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=p[t>>18&63]+p[t>>12&63]+p[t>>6&63]+p[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},w=u?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(g.apply(null,e.subarray(n,n+4096)));return b(t.join(""))},C=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?g(192|t>>>6)+g(128|63&t):g(224|t>>>12&15)+g(128|t>>>6&63)+g(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return g(240|t>>>18&7)+g(128|t>>>12&63)+g(128|t>>>6&63)+g(128|63&t)},_=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,k=u?e=>Buffer.from(e,"utf8").toString("base64"):f?e=>w(f.encode(e)):e=>b(e.replace(_,C)),S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return g(55296+(t>>>10))+g(56320+(1023&t));case 3:return g((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return g((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=c?e=>atob(v(e)):u?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!m.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,o="";for(let i=0;i<e.length;)t=d[e.charAt(i++)]<<18|d[e.charAt(i++)]<<12|(n=d[e.charAt(i++)])<<6|(r=d[e.charAt(i++)]),o+=64===n?g(t>>16&255):64===r?g(t>>16&255,t>>8&255):g(t>>16&255,t>>8&255,255&t);return o},T=u?e=>y(Buffer.from(e,"base64")):e=>y(A(e),(e=>e.charCodeAt(0))),x=u?e=>Buffer.from(e,"base64").toString("utf8"):h?e=>h.decode(T(e)):e=>A(e).replace(S,E),I=e=>x(v(e.replace(/[-_]/g,(e=>"-"==e?"+":"/")))),O=e=>["skip","limit"].some((t=>t in e)),R=e=>["after","before","first","last","limit"].some((t=>t in e)),P=e=>"limit"in e,B=e=>(null==e?void 0:e.hasOwnProperty("data"))&&(null==e?void 0:e.hasOwnProperty("nextPage"))&&(null==e?void 0:e.hasOwnProperty("prevPage")),F=(e,t)=>{var n;if(!e||!Object.keys(e).length)return;let r={};return"skiplimit"===t?r={skip:null!==(n=e.after)&&void 0!==n?n:0,limit:e.limit}:"afterbefore"===t&&R(e)?Number.isNaN(null==e?void 0:e.before)?Number.isNaN(null==e?void 0:e.after)?Number.isNaN(null==e?void 0:e.limit)||(r={last:e.limit}):r={after:e.after,first:e.limit}:r={before:e.before,last:e.limit}:"afterbeforeraw"===t&&(r=e),Object.keys(r).length?((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(k(e)):k(e))(JSON.stringify(r)):void 0},N=e=>{if(!e)return;const t=JSON.parse(I(e));if(O(t))return{after:t.skip,limit:t.limit};if(R(t)){if("before"in t)return{before:t.before,limit:t.last};if("after"in t)return{after:t.after,limit:t.first}}},j=e=>{if(!e)return;const t=JSON.parse(I(e));return P(t)?t:void 0},M=e=>"locally"in e,U=e=>"optimistically"in e,L=e=>M(e)||U(e),D=e=>null==e?void 0:e.hasOwnProperty("cachedAt"),q=(e,t=0)=>{var n;return Date.now()-(null!==(n=null==e?void 0:e.cachedAt)&&void 0!==n?n:0)<=t},z=(e,...t)=>({func:e,args:t}),$=(e,t=12e4)=>"cache_only"===e?{lifeSpan:1/0}:"server_only"===e?{lifeSpan:0}:{lifeSpan:t},H=({func:e,args:t},n,r=$("cache_then_server"))=>{let o;if(L(e)&&0!==r.lifeSpan){try{o=U(e)?e.optimistically(...t):e.locally(...t)}catch(e){null==n||n(V(void 0,{origin:"local",loading:!1,error:e}))}const i=D(o)&&q(o,r.lifeSpan);if(null==n||n(V(o,{origin:"local",loading:!(M(e)&&i)})),i)return}else null==n||n(V(void 0,{origin:"local",loading:!0}));e(...t).then((e=>{null==n||n(V(e,{origin:"server",loading:!1}))})).catch((e=>{null==n||n(V(void 0,{origin:"server",loading:!1,error:e}))}))};function V(e,t){return B(e)||D(e)?Object.assign(Object.assign({},t),e):Object.assign(Object.assign({},t),{data:e})}class W extends Error{constructor(e,t,n){super(`Amity SDK (${t}): ${e}`),this.code=t,this.level=n,this.type="ASC",this.timestamp=Date.now(),Error.captureStackTrace&&Error.captureStackTrace(this,W)}}class K extends W{constructor(e,t,n){super(e,t,n)}}class Q extends W{constructor(e=8e5,t="fatal"){super("Unexpected error",e,t)}}class J extends W{constructor(e,t="SDK client is having connection issues"){super(`${t} (${e})`,"disconnected"===e?800211:800210,"error"),this.event=e}}let Y=null;const X=()=>{if(!Y)throw new W("There is no active client",8e5,"fatal");return Y},G=e=>{Y=e};let Z,ee=[];const te=["disconnected","error","connect_error","reconnect_error","reconnect_failed","v3.channel.didUpdate","v3.channel.didUpdate","v3.channel.didJoin","v3.channel.didLeave","v3.channel.didAddUsers","v3.channel.didRemoveUsers","v3.channel.didBan","v3.channel.didUnban","v3.message.didCreate","v3.message.didUpdate","v3.message.didDelete"],ne=["connect","message","disconnect","error","close","end","reconnect"],re=()=>{return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}};var e},oe=(e,t,n,r)=>{const{log:o,emitter:i}=e,s=Date.now();o(`${t}(tmpid: ${s}) > listen`);const a=(...e)=>{o(`${t}(tmpid: ${s}) > trigger`,e),r(...e)};return i.on(n,a),()=>{o(`${t}(tmpid: ${s}) > dispose`),i.off(n,a)}},ie=(e,t)=>{const{emitter:n}=X();var r;r=()=>{n.emit(e,t)},clearTimeout(Z),ee.push(r),Z=setTimeout((()=>{ee.forEach((e=>e())),ee=[]}),0)};let se=null;const ae=()=>{if(!se)throw new W("Connect client first",8e5,"fatal");return se};var ce;e.SubscriptionLevels=void 0,(ce=e.SubscriptionLevels||(e.SubscriptionLevels={})).COMMUNITY="community",ce.POST="post",ce.COMMENT="comment",ce.POST_AND_COMMENT="post_and_comment",ce.USER="user";const le=(e,t)=>{switch(t){case"post":return`${e}/post/+`;case"comment":return`${e}/post/+/comment/+`;case"post_and_comment":return`${e}/post/#`;default:return e}},ue=()=>{const e=ae(),[t]=e.path.split("/user/");return t};let he,fe;function pe(e,t){const{mqtt:n,emitter:r,accessToken:o}=X(),i=ae();return he===o&&fe===i._id||(he=o,fe=i._id,n.connect({accessToken:he,userId:fe}),((e,t)=>{ne.forEach((n=>{e.on(n,((...e)=>t.emit(n,1===e.length?e[0]:e)))})),e.on("message",((e,n)=>{const r=JSON.parse(n.toString());t.emit(r.eventType,r.data)}))})(n,r)),n.subscribe(e,t)}var de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ge(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const ye=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:ve}=Object.prototype,{propertyIsEnumerable:be}=Object,we=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}),Ce=de,_e={concatArrays:!1,ignoreUndefined:!1},ke=e=>{const t=[];for(const n in e)ve.call(e,n)&&t.push(n);if(Object.getOwnPropertySymbols){const n=Object.getOwnPropertySymbols(e);for(const r of n)be.call(e,r)&&t.push(r)}return t};function Se(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ke(e).forEach((n=>{we(t,n,Se(e[n]))})),t}(e):ye(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ke(e).forEach((n=>{we(t,n,Se(e[n]))})),t}(e):e}const Ee=(e,t,n,r)=>(n.forEach((n=>{void 0===t[n]&&r.ignoreUndefined||(n in e&&e[n]!==Object.getPrototypeOf(e)?we(e,n,Ae(e[n],t[n],r)):we(e,n,Se(t[n])))})),e);function Ae(e,t,n){return n.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,n)=>{let r=e.slice(0,0),o=0;return[e,t].forEach((t=>{const i=[];for(let n=0;n<t.length;n++)ve.call(t,n)&&(i.push(String(n)),we(r,o++,t===e?t[n]:Se(t[n])));r=Ee(r,t,ke(t).filter((e=>!i.includes(e))),n)})),r})(e,t,n):ye(t)&&ye(e)?Ee(e,t,ke(t),n):Se(t)}const Te=function(...e){const t=Ae(Se(_e),this!==Ce&&this||{},_e);let n={_:{}};for(const r of e)if(void 0!==r){if(!ye(r))throw new TypeError("`"+r+"` is not an Option Object");n=Ae(n,{_:r},t)}return n._}.bind({concatArrays:!0,ignoreUndefined:!0});function xe(e,t){return new Promise(((n,r)=>{try{const r=e();null==t||t(null,r),n(r)}catch(e){null==t||t(e),r(e)}}))}function Ie(e,t,n){return Promise.all(e).then((e=>{var r;const o=null!==(r=null==n?void 0:n(e))&&void 0!==r?r:null;return null==t||t(null,o),Promise.resolve(o)}),(e=>(null==t||t(e),Promise.reject(e))))}const Oe={getItem:(e,t)=>xe((()=>window.localStorage.getItem(e)),t),setItem:(e,t,n)=>xe((()=>window.localStorage.setItem(e,t)),n),removeItem:(e,t)=>xe((()=>window.localStorage.removeItem(e)),t),mergeItem:(e,t,n)=>xe((()=>function(e,t){const n=window.localStorage.getItem(e);if(n){const r=JSON.parse(n),o=JSON.parse(t),i=JSON.stringify(Te(r,o));window.localStorage.setItem(e,i)}else window.localStorage.setItem(e,t)}(e,t)),n),clear:e=>xe((()=>window.localStorage.clear()),e),getAllKeys:e=>xe((()=>{const e=window.localStorage.length,t=[];for(let n=0;n<e;n+=1){const e=window.localStorage.key(n)||"";t.push(e)}return t}),e),flushGetRequests:()=>{},multiGet:(e,t)=>Ie(e.map((e=>Oe.getItem(e))),t,(t=>t.map(((t,n)=>[e[n],t])))),multiSet:(e,t)=>Ie(e.map((e=>Oe.setItem(e[0],e[1]))),t),multiRemove:(e,t)=>Ie(e.map((e=>Oe.removeItem(e))),t),multiMerge:(e,t)=>Ie(e.map((e=>{var t,n;return null!==(t=null===(n=Oe.mergeItem)||void 0===n?void 0:n.call(Oe,e[0],e[1]))&&void 0!==t?t:Promise.reject("Not implemented")})),t)},Re=e=>JSON.stringify(e,((e,t)=>{return"object"==typeof t?(n=t,Object.keys(n).sort().reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:n[t]})),{})):t;var n})),Pe=e=>JSON.parse(e),Be=(e,t)=>e===t||!(!e||!t)&&("object"==typeof e&&Object.keys(e).every((n=>Be(e[n],t[n])))),Fe=e=>{const{log:t,cache:n}=X();if(n)return t("cache/api/queryCache",{key:e}),Object.keys(n.data).filter((t=>{const n=Pe(t);return Be(e,n)})).map((e=>n.data[e]))},Ne=e=>{const{log:t,cache:n}=X();if(!n)return;t("cache/api/pullFromCache",e);const r=Re(e);return n.data[r]?n.data[r]:void 0},je=(e,t,n={cachedAt:Date.now()})=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/pushToCache",{key:e,data:t,options:n}),!(null==n?void 0:n.hasOwnProperty("offline"))&&o.persistIf&&(n.offline=o.persistIf(e,t));const i=Re(e);return o.data[i]=Object.assign({key:e,data:t},n),!0},Me=(e,t,n)=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/mergeInCache",{key:e,mutation:t});const i=Ne(e);if(!i)return!1;const s="function"==typeof t?t(i.data):Object.assign(Object.assign({},i.data),t);return je(e,s,n),!0},Ue=(e,t,n={cachedAt:Date.now()})=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/upsertInCache",{key:e,data:t,options:n});return Ne(e)?Me(e,t,n):je(e,t,n)},Le=(e,t=!1)=>{const{log:n,cache:r}=X();if(!r)return!1;if(n("cache/api/dropFromCache",{key:e,exact:t}),!t)return Object.keys(r.data).map((e=>Pe(e))).filter((t=>Be(e,t))).map((e=>Le(e,!0))).every((e=>e));const o=Re(e);return o in r.data&&(delete r.data[o],!0)};var De={exports:{}},qe=1e3,ze=6e4,$e=60*ze,He=24*$e,Ve=7*He,We=365.25*He,Ke=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*We;case"weeks":case"week":case"w":return n*Ve;case"days":case"day":case"d":return n*He;case"hours":case"hour":case"hrs":case"hr":case"h":return n*$e;case"minutes":case"minute":case"mins":case"min":case"m":return n*ze;case"seconds":case"second":case"secs":case"sec":case"s":return n*qe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=He)return Qe(e,t,He,"day");if(t>=$e)return Qe(e,t,$e,"hour");if(t>=ze)return Qe(e,t,ze,"minute");if(t>=qe)return Qe(e,t,qe,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=He)return Math.round(e/He)+"d";if(t>=$e)return Math.round(e/$e)+"h";if(t>=ze)return Math.round(e/ze)+"m";if(t>=qe)return Math.round(e/qe)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Qe(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}var Je=function(e){function t(e){let r,o,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,o)=>{if("%%"===r)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ke,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Je(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(De,De.exports);var Ye=De.exports;const Xe={EU:"eu",SG:"sg",US:"us"},Ge={http:"https://api.{region}.amity.co",mqtt:"wss://sse.{region}.amity.co:443/mqtt"};function Ze(e,t){return Ge[e].replace("{region}",t)}var et={exports:{}},tt=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},nt=tt,rt=Object.prototype.toString;function ot(e){return"[object Array]"===rt.call(e)}function it(e){return void 0===e}function st(e){return null!==e&&"object"==typeof e}function at(e){if("[object Object]"!==rt.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function ct(e){return"[object Function]"===rt.call(e)}function lt(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),ot(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var ut={isArray:ot,isArrayBuffer:function(e){return"[object ArrayBuffer]"===rt.call(e)},isBuffer:function(e){return null!==e&&!it(e)&&null!==e.constructor&&!it(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:st,isPlainObject:at,isUndefined:it,isDate:function(e){return"[object Date]"===rt.call(e)},isFile:function(e){return"[object File]"===rt.call(e)},isBlob:function(e){return"[object Blob]"===rt.call(e)},isFunction:ct,isStream:function(e){return st(e)&&ct(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:lt,merge:function e(){var t={};function n(n,r){at(t[r])&&at(n)?t[r]=e(t[r],n):at(n)?t[r]=e({},n):ot(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)lt(arguments[r],n);return t},extend:function(e,t,n){return lt(t,(function(t,r){e[r]=n&&"function"==typeof t?nt(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},ht=ut;function ft(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var pt=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(ht.isURLSearchParams(t))r=t.toString();else{var o=[];ht.forEach(t,(function(e,t){null!=e&&(ht.isArray(e)?t+="[]":e=[e],ht.forEach(e,(function(e){ht.isDate(e)?e=e.toISOString():ht.isObject(e)&&(e=JSON.stringify(e)),o.push(ft(t)+"="+ft(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},dt=ut;function mt(){this.handlers=[]}mt.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},mt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},mt.prototype.forEach=function(e){dt.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var gt=mt,yt=ut,vt=function(e){return!(!e||!e.__CANCEL__)},bt=ut,wt=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},Ct=function(e,t,n,r,o){var i=new Error(e);return wt(i,t,n,r,o)},_t=Ct,kt=ut,St=kt.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),kt.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),kt.isString(r)&&s.push("path="+r),kt.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Et=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},At=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Tt=ut,xt=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],It=ut,Ot=It.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=It.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},Rt=ut,Pt=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(_t("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},Bt=St,Ft=pt,Nt=function(e,t){return e&&!Et(t)?At(e,t):t},jt=function(e){var t,n,r,o={};return e?(Tt.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=Tt.trim(e.substr(0,r)).toLowerCase(),n=Tt.trim(e.substr(r+1)),t){if(o[t]&&xt.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},Mt=Ot,Ut=Ct,Lt=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;Rt.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",a=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+a)}var c=Nt(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),Ft(c,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?jt(i.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:e,request:i};Pt(t,n,o),i=null}},i.onabort=function(){i&&(n(Ut("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(Ut("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Ut(t,e,"ECONNABORTED",i)),i=null},Rt.isStandardBrowserEnv()){var l=(e.withCredentials||Mt(c))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;l&&(o[e.xsrfHeaderName]=l)}if("setRequestHeader"in i&&Rt.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),Rt.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},Dt=ut,qt=function(e,t){bt.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},zt={"Content-Type":"application/x-www-form-urlencoded"};function $t(e,t){!Dt.isUndefined(e)&&Dt.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ht,Vt={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ht=Lt),Ht),transformRequest:[function(e,t){return qt(t,"Accept"),qt(t,"Content-Type"),Dt.isFormData(e)||Dt.isArrayBuffer(e)||Dt.isBuffer(e)||Dt.isStream(e)||Dt.isFile(e)||Dt.isBlob(e)?e:Dt.isArrayBufferView(e)?e.buffer:Dt.isURLSearchParams(e)?($t(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Dt.isObject(e)?($t(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};Vt.headers={common:{Accept:"application/json, text/plain, */*"}},Dt.forEach(["delete","get","head"],(function(e){Vt.headers[e]={}})),Dt.forEach(["post","put","patch"],(function(e){Vt.headers[e]=Dt.merge(zt)}));var Wt=Vt,Kt=ut,Qt=function(e,t,n){return yt.forEach(n,(function(n){e=n(e,t)})),e},Jt=vt,Yt=Wt;function Xt(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Gt=ut,Zt=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function a(e,t){return Gt.isPlainObject(e)&&Gt.isPlainObject(t)?Gt.merge(e,t):Gt.isPlainObject(t)?Gt.merge({},t):Gt.isArray(t)?t.slice():t}function c(r){Gt.isUndefined(t[r])?Gt.isUndefined(e[r])||(n[r]=a(void 0,e[r])):n[r]=a(e[r],t[r])}Gt.forEach(r,(function(e){Gt.isUndefined(t[e])||(n[e]=a(void 0,t[e]))})),Gt.forEach(o,c),Gt.forEach(i,(function(r){Gt.isUndefined(t[r])?Gt.isUndefined(e[r])||(n[r]=a(void 0,e[r])):n[r]=a(void 0,t[r])})),Gt.forEach(s,(function(r){r in t?n[r]=a(e[r],t[r]):r in e&&(n[r]=a(void 0,e[r]))}));var l=r.concat(o).concat(i).concat(s),u=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return Gt.forEach(u,c),n},en=ut,tn=pt,nn=gt,rn=function(e){return Xt(e),e.headers=e.headers||{},e.data=Qt(e.data,e.headers,e.transformRequest),e.headers=Kt.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Kt.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Yt.adapter)(e).then((function(t){return Xt(e),t.data=Qt(t.data,t.headers,e.transformResponse),t}),(function(t){return Jt(t)||(Xt(e),t&&t.response&&(t.response.data=Qt(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},on=Zt;function sn(e){this.defaults=e,this.interceptors={request:new nn,response:new nn}}sn.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=on(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[rn,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},sn.prototype.getUri=function(e){return e=on(this.defaults,e),tn(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},en.forEach(["delete","get","head","options"],(function(e){sn.prototype[e]=function(t,n){return this.request(on(n||{},{method:e,url:t,data:(n||{}).data}))}})),en.forEach(["post","put","patch"],(function(e){sn.prototype[e]=function(t,n,r){return this.request(on(r||{},{method:e,url:t,data:n}))}}));var an=sn;function cn(e){this.message=e}cn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},cn.prototype.__CANCEL__=!0;var ln=cn,un=ln;function hn(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new un(e),t(n.reason))}))}hn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},hn.source=function(){var e;return{token:new hn((function(t){e=t})),cancel:e}};var fn=hn,pn=ut,dn=tt,mn=an,gn=Zt;function yn(e){var t=new mn(e),n=dn(mn.prototype.request,t);return pn.extend(n,mn.prototype,t),pn.extend(n,t),n}var vn=yn(Wt);vn.Axios=mn,vn.create=function(e){return yn(gn(vn.defaults,e))},vn.Cancel=ln,vn.CancelToken=fn,vn.isCancel=vt,vn.all=function(e){return Promise.all(e)},vn.spread=function(e){return function(t){return e.apply(null,t)}},vn.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},et.exports=vn,et.exports.default=vn;var bn=et.exports,wn={exports:{}};wn.exports=_n;var Cn=wn.exports.HttpsAgent=_n;function _n(){}var kn=wn.exports;const Sn=e=>{if("success"===e.status)return e.data;if("fail"===e.status)throw new Q(e.code);if("error"===e.status)throw new K(e.message,e.code,"error")},En=(e,t)=>Object.entries(e).filter((([,e])=>void 0!==e)).map((([e,n])=>{const r=t?`${t}[${e}]`:e;return Array.isArray(n)?n.map((e=>`${r}[]=${e}`)).join("&"):"object"!=typeof n?`${r}=${n}`:En(n,null!=t?t:e)})).join("&"),An=e=>{const t={maxSockets:100,maxFreeSockets:10,timeout:6e4,freeSocketTimeout:3e4},n=bn.create({baseURL:e,httpAgent:new kn(t),httpsAgent:new Cn(t),paramsSerializer:En});return n.interceptors.response.use((e=>e),(e=>{var t;const{response:n}=e;console.error(null!==(t=null==n?void 0:n.data)&&void 0!==t?t:e),n&&Sn(n.data)})),n};var Tn={exports:{}},xn=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,In=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],On=function(e){var t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));for(var o=xn.exec(e||""),i={},s=14;s--;)i[In[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},Rn={exports:{}},Pn={exports:{}},Bn=1e3,Fn=6e4,Nn=60*Fn,jn=24*Nn,Mn=365.25*jn,Un=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Mn;case"days":case"day":case"d":return n*jn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Nn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Fn;case"seconds":case"second":case"secs":case"sec":case"s":return n*Bn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return Ln(e,jn,"day")||Ln(e,Nn,"hour")||Ln(e,Fn,"minute")||Ln(e,Bn,"second")||e+" ms"}(e):function(e){if(e>=jn)return Math.round(e/jn)+"d";if(e>=Nn)return Math.round(e/Nn)+"h";if(e>=Fn)return Math.round(e/Fn)+"m";if(e>=Bn)return Math.round(e/Bn)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ln(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n})),t.formatArgs.call(e,s);var l=o.log||t.log||console.log.bind(console);l.apply(e,s)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),o.destroy=r,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function r(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Un,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(Pn,Pn.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Pn.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Rn,Rn.exports);var Dn=On,qn=Rn.exports("socket.io-client:url"),zn=function(e,t){var n=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(qn("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),qn("parse %s",e),n=Dn(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n};var $n={},Hn={exports:{}},Vn={exports:{}},Wn=1e3,Kn=6e4,Qn=60*Kn,Jn=24*Qn,Yn=365.25*Jn,Xn=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Yn;case"days":case"day":case"d":return n*Jn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Kn;case"seconds":case"second":case"secs":case"sec":case"s":return n*Wn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return Gn(e,Jn,"day")||Gn(e,Qn,"hour")||Gn(e,Kn,"minute")||Gn(e,Wn,"second")||e+" ms"}(e):function(e){if(e>=Jn)return Math.round(e/Jn)+"d";if(e>=Qn)return Math.round(e/Qn)+"h";if(e>=Kn)return Math.round(e/Kn)+"m";if(e>=Wn)return Math.round(e/Wn)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Gn(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n})),t.formatArgs.call(e,s);var l=o.log||t.log||console.log.bind(console);l.apply(e,s)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),o.destroy=r,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function r(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Xn,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(Vn,Vn.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Vn.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Hn,Hn.exports);var Zn={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(Zn);var er={},tr={}.toString,nr=Array.isArray||function(e){return"[object Array]"==tr.call(e)},rr=function(e){return or&&Buffer.isBuffer(e)||ir&&(e instanceof ArrayBuffer||function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}(e))},or="function"==typeof Buffer&&"function"==typeof Buffer.isBuffer,ir="function"==typeof ArrayBuffer;var sr=nr,ar=rr,cr=Object.prototype.toString,lr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===cr.call(Blob),ur="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===cr.call(File);function hr(e,t){if(!e)return e;if(ar(e)){var n={_placeholder:!0,num:t.length};return t.push(e),n}if(sr(e)){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=hr(e[o],t);return r}if("object"==typeof e&&!(e instanceof Date)){r={};for(var i in e)r[i]=hr(e[i],t);return r}return e}function fr(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(sr(e))for(var n=0;n<e.length;n++)e[n]=fr(e[n],t);else if("object"==typeof e)for(var r in e)e[r]=fr(e[r],t);return e}er.deconstructPacket=function(e){var t=[],n=e.data,r=e;return r.data=hr(n,t),r.attachments=t.length,{packet:r,buffers:t}},er.reconstructPacket=function(e,t){return e.data=fr(e.data,t),e.attachments=void 0,e},er.removeBlobs=function(e,t){var n=0,r=e;!function e(o,i,s){if(!o)return o;if(lr&&o instanceof Blob||ur&&o instanceof File){n++;var a=new FileReader;a.onload=function(){s?s[i]=this.result:r=this.result,--n||t(r)},a.readAsArrayBuffer(o)}else if(sr(o))for(var c=0;c<o.length;c++)e(o[c],c,o);else if("object"==typeof o&&!ar(o))for(var l in o)e(o[l],l,o)}(r),n||t(r)},function(e){var t=Hn.exports("socket.io-parser"),n=Zn.exports,r=er,o=nr,i=rr;function s(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=s,e.Decoder=l;var a=e.ERROR+'"encode error"';function c(n){var r=""+n.type;if(e.BINARY_EVENT!==n.type&&e.BINARY_ACK!==n.type||(r+=n.attachments+"-"),n.nsp&&"/"!==n.nsp&&(r+=n.nsp+","),null!=n.id&&(r+=n.id),null!=n.data){var o=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(n.data);if(!1===o)return a;r+=o}return t("encoded %j as %s",n,r),r}function l(){this.reconstructor=null}function u(e){this.reconPack=e,this.buffers=[]}function h(t){return{type:e.ERROR,data:"parser error: "+t}}s.prototype.encode=function(n,o){(t("encoding packet %j",n),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type)?function(e,t){function n(e){var n=r.deconstructPacket(e),o=c(n.packet),i=n.buffers;i.unshift(o),t(i)}r.removeBlobs(e,n)}(n,o):o([c(n)])},n(l.prototype),l.prototype.add=function(n){var r;if("string"==typeof n)r=function(n){var r=0,i={type:Number(n.charAt(0))};if(null==e.types[i.type])return h("unknown packet type "+i.type);if(e.BINARY_EVENT===i.type||e.BINARY_ACK===i.type){for(var s=r+1;"-"!==n.charAt(++r)&&r!=n.length;);var a=n.substring(s,r);if(a!=Number(a)||"-"!==n.charAt(r))throw new Error("Illegal attachments");i.attachments=Number(a)}if("/"===n.charAt(r+1)){for(s=r+1;++r;){if(","===(l=n.charAt(r)))break;if(r===n.length)break}i.nsp=n.substring(s,r)}else i.nsp="/";var c=n.charAt(r+1);if(""!==c&&Number(c)==c){for(s=r+1;++r;){var l;if(null==(l=n.charAt(r))||Number(l)!=l){--r;break}if(r===n.length)break}i.id=Number(n.substring(s,r+1))}if(n.charAt(++r)){var u=function(e){try{return JSON.parse(e)}catch(e){return!1}}(n.substr(r));if(!(!1!==u&&(i.type===e.ERROR||o(u))))return h("invalid payload");i.data=u}return t("decoded %s as %j",n,i),i}(n),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new u(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!i(n)&&!n.base64)throw new Error("Unknown type: "+n);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(n))&&(this.reconstructor=null,this.emit("decoded",r))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}($n);var pr={exports:{}},dr={},mr={exports:{}};try{mr.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){mr.exports=!1}var gr=mr.exports,yr=function(e){var t=e.xdomain,n=e.xscheme,r=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||gr))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(e){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},vr={exports:{}},br={},wr=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},Cr={}.toString,_r=Array.isArray||function(e){return"[object Array]"==Cr.call(e)},kr=Object.prototype.toString,Sr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===kr.call(Blob),Er="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===kr.call(File),Ar=function e(t){if(!t||"object"!=typeof t)return!1;if(_r(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if("function"==typeof Buffer&&Buffer.isBuffer&&Buffer.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||Sr&&t instanceof Blob||Er&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&e(t[o]))return!0;return!1};var Tr=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),s=t,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer},xr=function(e,t,n){var r=!1;return n=n||Ir,o.count=e,0===e?t():o;function o(e,i){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(r=!0,t(e),t=n):0!==o.count||r||t(null,i)}};function Ir(){}
|
|
1
|
+
var Amity=function(e){"use strict";var t;const n="object"==typeof globalThis?globalThis:"object"==typeof global?global:window,{process:r={}}=n,o="production"===(null===(t=r.env)||void 0===t?void 0:t.NODE_ENV);var i,s;const a=null!==(s=null===(i=r.env)||void 0===i?void 0:i.VERSION)&&void 0!==s?s:"__dev__",c="function"==typeof atob,l="function"==typeof btoa,u="function"==typeof Buffer,h="function"==typeof TextDecoder?new TextDecoder:void 0,f="function"==typeof TextEncoder?new TextEncoder:void 0,p=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),d=(e=>{let t={};return e.forEach(((e,n)=>t[e]=n)),t})(p),m=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,g=String.fromCharCode.bind(String),y="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),v=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),b=l?e=>btoa(e):u?e=>Buffer.from(e,"binary").toString("base64"):e=>{let t,n,r,o,i="";const s=e.length%3;for(let s=0;s<e.length;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=p[t>>18&63]+p[t>>12&63]+p[t>>6&63]+p[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},w=u?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(g.apply(null,e.subarray(n,n+4096)));return b(t.join(""))},C=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?g(192|t>>>6)+g(128|63&t):g(224|t>>>12&15)+g(128|t>>>6&63)+g(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return g(240|t>>>18&7)+g(128|t>>>12&63)+g(128|t>>>6&63)+g(128|63&t)},_=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,k=u?e=>Buffer.from(e,"utf8").toString("base64"):f?e=>w(f.encode(e)):e=>b(e.replace(_,C)),S=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return g(55296+(t>>>10))+g(56320+(1023&t));case 3:return g((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return g((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},A=c?e=>atob(v(e)):u?e=>Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!m.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,o="";for(let i=0;i<e.length;)t=d[e.charAt(i++)]<<18|d[e.charAt(i++)]<<12|(n=d[e.charAt(i++)])<<6|(r=d[e.charAt(i++)]),o+=64===n?g(t>>16&255):64===r?g(t>>16&255,t>>8&255):g(t>>16&255,t>>8&255,255&t);return o},T=u?e=>y(Buffer.from(e,"base64")):e=>y(A(e),(e=>e.charCodeAt(0))),x=u?e=>Buffer.from(e,"base64").toString("utf8"):h?e=>h.decode(T(e)):e=>A(e).replace(S,E),I=e=>x(v(e.replace(/[-_]/g,(e=>"-"==e?"+":"/")))),O=e=>["skip","limit"].some((t=>t in e)),R=e=>["after","before","first","last","limit"].some((t=>t in e)),P=e=>"limit"in e,B=e=>(null==e?void 0:e.hasOwnProperty("data"))&&(null==e?void 0:e.hasOwnProperty("nextPage"))&&(null==e?void 0:e.hasOwnProperty("prevPage")),F=(e,t)=>{var n;if(!e||!Object.keys(e).length)return;let r={};return"skiplimit"===t?r={skip:null!==(n=e.after)&&void 0!==n?n:0,limit:e.limit}:"afterbefore"===t&&R(e)?Number.isNaN(Number(null==e?void 0:e.before))?Number.isNaN(Number(null==e?void 0:e.after))?Number.isNaN(Number(null==e?void 0:e.limit))||(r={last:e.limit}):r={after:e.after,first:e.limit}:r={before:e.before,last:e.limit}:"afterbeforeraw"===t&&(r=e),Object.keys(r).length?((e,t=!1)=>t?(e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_")))(k(e)):k(e))(JSON.stringify(r)):void 0},N=e=>{if(!e)return;const t=JSON.parse(I(e));if(O(t))return{after:t.skip,limit:t.limit};if(R(t)){if("before"in t)return{before:t.before,limit:t.last};if("after"in t)return{after:t.after,limit:t.first}}},j=e=>{if(!e)return;const t=JSON.parse(I(e));return P(t)?t:void 0},M=e=>"locally"in e,U=e=>"optimistically"in e,L=e=>M(e)||U(e),D=e=>null==e?void 0:e.hasOwnProperty("cachedAt"),q=(e,t=0)=>{var n;return Date.now()-(null!==(n=null==e?void 0:e.cachedAt)&&void 0!==n?n:0)<=t},z=(e,...t)=>({func:e,args:t}),$=(e,t=12e4)=>"cache_only"===e?{lifeSpan:1/0}:"server_only"===e?{lifeSpan:0}:{lifeSpan:t},H=({func:e,args:t},n,r=$("cache_then_server"))=>{let o;if(L(e)&&0!==r.lifeSpan){try{o=U(e)?e.optimistically(...t):e.locally(...t)}catch(e){null==n||n(V(void 0,{origin:"local",loading:!1,error:e}))}const i=D(o)&&q(o,r.lifeSpan);if(null==n||n(V(o,{origin:"local",loading:!(M(e)&&i)})),i)return}else null==n||n(V(void 0,{origin:"local",loading:!0}));e(...t).then((e=>{null==n||n(V(e,{origin:"server",loading:!1}))})).catch((e=>{null==n||n(V(void 0,{origin:"server",loading:!1,error:e}))}))};function V(e,t){return B(e)||D(e)?Object.assign(Object.assign({},t),e):Object.assign(Object.assign({},t),{data:e})}class W extends Error{constructor(e,t,n){super(`Amity SDK (${t}): ${e}`),this.code=t,this.level=n,this.type="ASC",this.timestamp=Date.now(),Error.captureStackTrace&&Error.captureStackTrace(this,W)}}class K extends W{constructor(e,t,n){super(e,t,n)}}class Q extends W{constructor(e=8e5,t="fatal"){super("Unexpected error",e,t)}}class J extends W{constructor(e,t="SDK client is having connection issues"){super(`${t} (${e})`,"disconnected"===e?800211:800210,"error"),this.event=e}}let Y=null;const X=()=>{if(!Y)throw new W("There is no active client",8e5,"fatal");return Y},G=e=>{Y=e};let Z,ee=[];const te=["disconnected","error","connect_error","reconnect_error","reconnect_failed","v3.channel.didUpdate","v3.channel.didUpdate","v3.channel.didJoin","v3.channel.didLeave","v3.channel.didAddUsers","v3.channel.didRemoveUsers","v3.channel.didBan","v3.channel.didUnban","v3.message.didCreate","v3.message.didUpdate","v3.message.didDelete"],ne=["connect","message","disconnect","error","close","end","reconnect"],re=()=>{return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}};var e},oe=(e,t,n,r)=>{const{log:o,emitter:i}=e,s=Date.now();o(`${t}(tmpid: ${s}) > listen`);const a=(...e)=>{o(`${t}(tmpid: ${s}) > trigger`,e),r(...e)};return i.on(n,a),()=>{o(`${t}(tmpid: ${s}) > dispose`),i.off(n,a)}},ie=(e,t)=>{const{emitter:n}=X();var r;r=()=>{n.emit(e,t)},clearTimeout(Z),ee.push(r),Z=setTimeout((()=>{ee.forEach((e=>e())),ee=[]}),0)};let se=null;const ae=()=>{if(!se)throw new W("Connect client first",8e5,"fatal");return se};var ce;e.SubscriptionLevels=void 0,(ce=e.SubscriptionLevels||(e.SubscriptionLevels={})).COMMUNITY="community",ce.POST="post",ce.COMMENT="comment",ce.POST_AND_COMMENT="post_and_comment",ce.USER="user";const le=(e,t)=>{switch(t){case"post":return`${e}/post/+`;case"comment":return`${e}/post/+/comment/+`;case"post_and_comment":return`${e}/post/#`;default:return e}},ue=()=>{const e=ae(),[t]=e.path.split("/user/");return t};let he,fe;function pe(e,t){const{mqtt:n,emitter:r,accessToken:o}=X(),i=ae();return he===o&&fe===i._id||(he=o,fe=i._id,n.connect({accessToken:he,userId:fe}),((e,t)=>{ne.forEach((n=>{e.on(n,((...e)=>t.emit(n,1===e.length?e[0]:e)))})),e.on("message",((e,n)=>{const r=JSON.parse(n.toString());t.emit(r.eventType,r.data)}))})(n,r)),n.subscribe(e,t)}var de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ge(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const ye=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},{hasOwnProperty:ve}=Object.prototype,{propertyIsEnumerable:be}=Object,we=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}),Ce=de,_e={concatArrays:!1,ignoreUndefined:!1},ke=e=>{const t=[];for(const n in e)ve.call(e,n)&&t.push(n);if(Object.getOwnPropertySymbols){const n=Object.getOwnPropertySymbols(e);for(const r of n)be.call(e,r)&&t.push(r)}return t};function Se(e){return Array.isArray(e)?function(e){const t=e.slice(0,0);return ke(e).forEach((n=>{we(t,n,Se(e[n]))})),t}(e):ye(e)?function(e){const t=null===Object.getPrototypeOf(e)?Object.create(null):{};return ke(e).forEach((n=>{we(t,n,Se(e[n]))})),t}(e):e}const Ee=(e,t,n,r)=>(n.forEach((n=>{void 0===t[n]&&r.ignoreUndefined||(n in e&&e[n]!==Object.getPrototypeOf(e)?we(e,n,Ae(e[n],t[n],r)):we(e,n,Se(t[n])))})),e);function Ae(e,t,n){return n.concatArrays&&Array.isArray(e)&&Array.isArray(t)?((e,t,n)=>{let r=e.slice(0,0),o=0;return[e,t].forEach((t=>{const i=[];for(let n=0;n<t.length;n++)ve.call(t,n)&&(i.push(String(n)),we(r,o++,t===e?t[n]:Se(t[n])));r=Ee(r,t,ke(t).filter((e=>!i.includes(e))),n)})),r})(e,t,n):ye(t)&&ye(e)?Ee(e,t,ke(t),n):Se(t)}const Te=function(...e){const t=Ae(Se(_e),this!==Ce&&this||{},_e);let n={_:{}};for(const r of e)if(void 0!==r){if(!ye(r))throw new TypeError("`"+r+"` is not an Option Object");n=Ae(n,{_:r},t)}return n._}.bind({concatArrays:!0,ignoreUndefined:!0});function xe(e,t){return new Promise(((n,r)=>{try{const r=e();null==t||t(null,r),n(r)}catch(e){null==t||t(e),r(e)}}))}function Ie(e,t,n){return Promise.all(e).then((e=>{var r;const o=null!==(r=null==n?void 0:n(e))&&void 0!==r?r:null;return null==t||t(null,o),Promise.resolve(o)}),(e=>(null==t||t(e),Promise.reject(e))))}const Oe={getItem:(e,t)=>xe((()=>window.localStorage.getItem(e)),t),setItem:(e,t,n)=>xe((()=>window.localStorage.setItem(e,t)),n),removeItem:(e,t)=>xe((()=>window.localStorage.removeItem(e)),t),mergeItem:(e,t,n)=>xe((()=>function(e,t){const n=window.localStorage.getItem(e);if(n){const r=JSON.parse(n),o=JSON.parse(t),i=JSON.stringify(Te(r,o));window.localStorage.setItem(e,i)}else window.localStorage.setItem(e,t)}(e,t)),n),clear:e=>xe((()=>window.localStorage.clear()),e),getAllKeys:e=>xe((()=>{const e=window.localStorage.length,t=[];for(let n=0;n<e;n+=1){const e=window.localStorage.key(n)||"";t.push(e)}return t}),e),flushGetRequests:()=>{},multiGet:(e,t)=>Ie(e.map((e=>Oe.getItem(e))),t,(t=>t.map(((t,n)=>[e[n],t])))),multiSet:(e,t)=>Ie(e.map((e=>Oe.setItem(e[0],e[1]))),t),multiRemove:(e,t)=>Ie(e.map((e=>Oe.removeItem(e))),t),multiMerge:(e,t)=>Ie(e.map((e=>{var t,n;return null!==(t=null===(n=Oe.mergeItem)||void 0===n?void 0:n.call(Oe,e[0],e[1]))&&void 0!==t?t:Promise.reject("Not implemented")})),t)},Re=e=>JSON.stringify(e,((e,t)=>{return"object"==typeof t?(n=t,Object.keys(n).sort().reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:n[t]})),{})):t;var n})),Pe=e=>JSON.parse(e),Be=(e,t)=>e===t||!(!e||!t)&&("object"==typeof e&&Object.keys(e).every((n=>Be(e[n],t[n])))),Fe=e=>{const{log:t,cache:n}=X();if(n)return t("cache/api/queryCache",{key:e}),Object.keys(n.data).filter((t=>{const n=Pe(t);return Be(e,n)})).map((e=>n.data[e]))},Ne=e=>{const{log:t,cache:n}=X();if(!n)return;t("cache/api/pullFromCache",e);const r=Re(e);return n.data[r]?n.data[r]:void 0},je=(e,t,n={cachedAt:Date.now()})=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/pushToCache",{key:e,data:t,options:n}),!(null==n?void 0:n.hasOwnProperty("offline"))&&o.persistIf&&(n.offline=o.persistIf(e,t));const i=Re(e);return o.data[i]=Object.assign({key:e,data:t},n),!0},Me=(e,t,n)=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/mergeInCache",{key:e,mutation:t});const i=Ne(e);if(!i)return!1;const s="function"==typeof t?t(i.data):Object.assign(Object.assign({},i.data),t);return je(e,s,n),!0},Ue=(e,t,n={cachedAt:Date.now()})=>{const{log:r,cache:o}=X();if(!o)return!1;r("cache/api/upsertInCache",{key:e,data:t,options:n});return Ne(e)?Me(e,t,n):je(e,t,n)},Le=(e,t=!1)=>{const{log:n,cache:r}=X();if(!r)return!1;if(n("cache/api/dropFromCache",{key:e,exact:t}),!t)return Object.keys(r.data).map((e=>Pe(e))).filter((t=>Be(e,t))).map((e=>Le(e,!0))).every((e=>e));const o=Re(e);return o in r.data&&(delete r.data[o],!0)};var De={exports:{}},qe=1e3,ze=6e4,$e=60*ze,He=24*$e,Ve=7*He,We=365.25*He,Ke=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*We;case"weeks":case"week":case"w":return n*Ve;case"days":case"day":case"d":return n*He;case"hours":case"hour":case"hrs":case"hr":case"h":return n*$e;case"minutes":case"minute":case"mins":case"min":case"m":return n*ze;case"seconds":case"second":case"secs":case"sec":case"s":return n*qe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=He)return Qe(e,t,He,"day");if(t>=$e)return Qe(e,t,$e,"hour");if(t>=ze)return Qe(e,t,ze,"minute");if(t>=qe)return Qe(e,t,qe,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=He)return Math.round(e/He)+"d";if(t>=$e)return Math.round(e/$e)+"h";if(t>=ze)return Math.round(e/ze)+"m";if(t>=qe)return Math.round(e/qe)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Qe(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}var Je=function(e){function t(e){let r,o,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(r||o);n.diff=i,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,o)=>{if("%%"===r)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ke,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Je(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(De,De.exports);var Ye=De.exports;const Xe={EU:"eu",SG:"sg",US:"us"},Ge={http:"https://api.{region}.amity.co",mqtt:"wss://sse.{region}.amity.co:443/mqtt"};function Ze(e,t){return Ge[e].replace("{region}",t)}var et={exports:{}},tt=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},nt=tt,rt=Object.prototype.toString;function ot(e){return"[object Array]"===rt.call(e)}function it(e){return void 0===e}function st(e){return null!==e&&"object"==typeof e}function at(e){if("[object Object]"!==rt.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function ct(e){return"[object Function]"===rt.call(e)}function lt(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),ot(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var ut={isArray:ot,isArrayBuffer:function(e){return"[object ArrayBuffer]"===rt.call(e)},isBuffer:function(e){return null!==e&&!it(e)&&null!==e.constructor&&!it(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:st,isPlainObject:at,isUndefined:it,isDate:function(e){return"[object Date]"===rt.call(e)},isFile:function(e){return"[object File]"===rt.call(e)},isBlob:function(e){return"[object Blob]"===rt.call(e)},isFunction:ct,isStream:function(e){return st(e)&&ct(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:lt,merge:function e(){var t={};function n(n,r){at(t[r])&&at(n)?t[r]=e(t[r],n):at(n)?t[r]=e({},n):ot(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)lt(arguments[r],n);return t},extend:function(e,t,n){return lt(t,(function(t,r){e[r]=n&&"function"==typeof t?nt(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}},ht=ut;function ft(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var pt=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(ht.isURLSearchParams(t))r=t.toString();else{var o=[];ht.forEach(t,(function(e,t){null!=e&&(ht.isArray(e)?t+="[]":e=[e],ht.forEach(e,(function(e){ht.isDate(e)?e=e.toISOString():ht.isObject(e)&&(e=JSON.stringify(e)),o.push(ft(t)+"="+ft(e))})))})),r=o.join("&")}if(r){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e},dt=ut;function mt(){this.handlers=[]}mt.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},mt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},mt.prototype.forEach=function(e){dt.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var gt=mt,yt=ut,vt=function(e){return!(!e||!e.__CANCEL__)},bt=ut,wt=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e},Ct=function(e,t,n,r,o){var i=new Error(e);return wt(i,t,n,r,o)},_t=Ct,kt=ut,St=kt.isStandardBrowserEnv()?{write:function(e,t,n,r,o,i){var s=[];s.push(e+"="+encodeURIComponent(t)),kt.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),kt.isString(r)&&s.push("path="+r),kt.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Et=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)},At=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Tt=ut,xt=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],It=ut,Ot=It.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=It.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},Rt=ut,Pt=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(_t("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)},Bt=St,Ft=pt,Nt=function(e,t){return e&&!Et(t)?At(e,t):t},jt=function(e){var t,n,r,o={};return e?(Tt.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=Tt.trim(e.substr(0,r)).toLowerCase(),n=Tt.trim(e.substr(r+1)),t){if(o[t]&&xt.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([n]):o[t]?o[t]+", "+n:n}})),o):o},Mt=Ot,Ut=Ct,Lt=function(e){return new Promise((function(t,n){var r=e.data,o=e.headers;Rt.isFormData(r)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var s=e.auth.username||"",a=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(s+":"+a)}var c=Nt(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),Ft(c,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in i?jt(i.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:r,config:e,request:i};Pt(t,n,o),i=null}},i.onabort=function(){i&&(n(Ut("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){n(Ut("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Ut(t,e,"ECONNABORTED",i)),i=null},Rt.isStandardBrowserEnv()){var l=(e.withCredentials||Mt(c))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;l&&(o[e.xsrfHeaderName]=l)}if("setRequestHeader"in i&&Rt.forEach(o,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),Rt.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),n(e),i=null)})),r||(r=null),i.send(r)}))},Dt=ut,qt=function(e,t){bt.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},zt={"Content-Type":"application/x-www-form-urlencoded"};function $t(e,t){!Dt.isUndefined(e)&&Dt.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ht,Vt={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ht=Lt),Ht),transformRequest:[function(e,t){return qt(t,"Accept"),qt(t,"Content-Type"),Dt.isFormData(e)||Dt.isArrayBuffer(e)||Dt.isBuffer(e)||Dt.isStream(e)||Dt.isFile(e)||Dt.isBlob(e)?e:Dt.isArrayBufferView(e)?e.buffer:Dt.isURLSearchParams(e)?($t(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Dt.isObject(e)?($t(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};Vt.headers={common:{Accept:"application/json, text/plain, */*"}},Dt.forEach(["delete","get","head"],(function(e){Vt.headers[e]={}})),Dt.forEach(["post","put","patch"],(function(e){Vt.headers[e]=Dt.merge(zt)}));var Wt=Vt,Kt=ut,Qt=function(e,t,n){return yt.forEach(n,(function(n){e=n(e,t)})),e},Jt=vt,Yt=Wt;function Xt(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Gt=ut,Zt=function(e,t){t=t||{};var n={},r=["url","method","data"],o=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function a(e,t){return Gt.isPlainObject(e)&&Gt.isPlainObject(t)?Gt.merge(e,t):Gt.isPlainObject(t)?Gt.merge({},t):Gt.isArray(t)?t.slice():t}function c(r){Gt.isUndefined(t[r])?Gt.isUndefined(e[r])||(n[r]=a(void 0,e[r])):n[r]=a(e[r],t[r])}Gt.forEach(r,(function(e){Gt.isUndefined(t[e])||(n[e]=a(void 0,t[e]))})),Gt.forEach(o,c),Gt.forEach(i,(function(r){Gt.isUndefined(t[r])?Gt.isUndefined(e[r])||(n[r]=a(void 0,e[r])):n[r]=a(void 0,t[r])})),Gt.forEach(s,(function(r){r in t?n[r]=a(e[r],t[r]):r in e&&(n[r]=a(void 0,e[r]))}));var l=r.concat(o).concat(i).concat(s),u=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return Gt.forEach(u,c),n},en=ut,tn=pt,nn=gt,rn=function(e){return Xt(e),e.headers=e.headers||{},e.data=Qt(e.data,e.headers,e.transformRequest),e.headers=Kt.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Kt.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Yt.adapter)(e).then((function(t){return Xt(e),t.data=Qt(t.data,t.headers,e.transformResponse),t}),(function(t){return Jt(t)||(Xt(e),t&&t.response&&(t.response.data=Qt(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},on=Zt;function sn(e){this.defaults=e,this.interceptors={request:new nn,response:new nn}}sn.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=on(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[rn,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},sn.prototype.getUri=function(e){return e=on(this.defaults,e),tn(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},en.forEach(["delete","get","head","options"],(function(e){sn.prototype[e]=function(t,n){return this.request(on(n||{},{method:e,url:t,data:(n||{}).data}))}})),en.forEach(["post","put","patch"],(function(e){sn.prototype[e]=function(t,n,r){return this.request(on(r||{},{method:e,url:t,data:n}))}}));var an=sn;function cn(e){this.message=e}cn.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},cn.prototype.__CANCEL__=!0;var ln=cn,un=ln;function hn(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new un(e),t(n.reason))}))}hn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},hn.source=function(){var e;return{token:new hn((function(t){e=t})),cancel:e}};var fn=hn,pn=ut,dn=tt,mn=an,gn=Zt;function yn(e){var t=new mn(e),n=dn(mn.prototype.request,t);return pn.extend(n,mn.prototype,t),pn.extend(n,t),n}var vn=yn(Wt);vn.Axios=mn,vn.create=function(e){return yn(gn(vn.defaults,e))},vn.Cancel=ln,vn.CancelToken=fn,vn.isCancel=vt,vn.all=function(e){return Promise.all(e)},vn.spread=function(e){return function(t){return e.apply(null,t)}},vn.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError},et.exports=vn,et.exports.default=vn;var bn=et.exports,wn={exports:{}};wn.exports=_n;var Cn=wn.exports.HttpsAgent=_n;function _n(){}var kn=wn.exports;const Sn=e=>{if("success"===e.status)return e.data;if("fail"===e.status)throw new Q(e.code);if("error"===e.status)throw new K(e.message,e.code,"error")},En=(e,t)=>Object.entries(e).filter((([,e])=>void 0!==e)).map((([e,n])=>{const r=t?`${t}[${e}]`:e;return Array.isArray(n)?n.map((e=>`${r}[]=${e}`)).join("&"):"object"!=typeof n?`${r}=${n}`:En(n,null!=t?t:e)})).join("&"),An=e=>{const t={maxSockets:100,maxFreeSockets:10,timeout:6e4,freeSocketTimeout:3e4},n=bn.create({baseURL:e,httpAgent:new kn(t),httpsAgent:new Cn(t),paramsSerializer:En});return n.interceptors.response.use((e=>e),(e=>{var t;const{response:n}=e;console.error(null!==(t=null==n?void 0:n.data)&&void 0!==t?t:e),n&&Sn(n.data)})),n};var Tn={exports:{}},xn=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,In=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],On=function(e){var t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));for(var o=xn.exec(e||""),i={},s=14;s--;)i[In[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},Rn={exports:{}},Pn={exports:{}},Bn=1e3,Fn=6e4,Nn=60*Fn,jn=24*Nn,Mn=365.25*jn,Un=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Mn;case"days":case"day":case"d":return n*jn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Nn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Fn;case"seconds":case"second":case"secs":case"sec":case"s":return n*Bn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return Ln(e,jn,"day")||Ln(e,Nn,"hour")||Ln(e,Fn,"minute")||Ln(e,Bn,"second")||e+" ms"}(e):function(e){if(e>=jn)return Math.round(e/jn)+"d";if(e>=Nn)return Math.round(e/Nn)+"h";if(e>=Fn)return Math.round(e/Fn)+"m";if(e>=Bn)return Math.round(e/Bn)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ln(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n})),t.formatArgs.call(e,s);var l=o.log||t.log||console.log.bind(console);l.apply(e,s)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),o.destroy=r,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function r(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Un,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(Pn,Pn.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Pn.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Rn,Rn.exports);var Dn=On,qn=Rn.exports("socket.io-client:url"),zn=function(e,t){var n=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host);"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(qn("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),qn("parse %s",e),n=Dn(e));n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443"));n.path=n.path||"/";var r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n};var $n={},Hn={exports:{}},Vn={exports:{}},Wn=1e3,Kn=6e4,Qn=60*Kn,Jn=24*Qn,Yn=365.25*Jn,Xn=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Yn;case"days":case"day":case"d":return n*Jn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Qn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Kn;case"seconds":case"second":case"secs":case"sec":case"s":return n*Wn;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return Gn(e,Jn,"day")||Gn(e,Qn,"hour")||Gn(e,Kn,"minute")||Gn(e,Wn,"second")||e+" ms"}(e):function(e){if(e>=Jn)return Math.round(e/Jn)+"d";if(e>=Qn)return Math.round(e/Qn)+"h";if(e>=Kn)return Math.round(e/Kn)+"m";if(e>=Wn)return Math.round(e/Wn)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Gn(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n})),t.formatArgs.call(e,s);var l=o.log||t.log||console.log.bind(console);l.apply(e,s)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),o.destroy=r,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function r(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Xn,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(Vn,Vn.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Vn.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Hn,Hn.exports);var Zn={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(Zn);var er={},tr={}.toString,nr=Array.isArray||function(e){return"[object Array]"==tr.call(e)},rr=function(e){return or&&Buffer.isBuffer(e)||ir&&(e instanceof ArrayBuffer||function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}(e))},or="function"==typeof Buffer&&"function"==typeof Buffer.isBuffer,ir="function"==typeof ArrayBuffer;var sr=nr,ar=rr,cr=Object.prototype.toString,lr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===cr.call(Blob),ur="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===cr.call(File);function hr(e,t){if(!e)return e;if(ar(e)){var n={_placeholder:!0,num:t.length};return t.push(e),n}if(sr(e)){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=hr(e[o],t);return r}if("object"==typeof e&&!(e instanceof Date)){r={};for(var i in e)r[i]=hr(e[i],t);return r}return e}function fr(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(sr(e))for(var n=0;n<e.length;n++)e[n]=fr(e[n],t);else if("object"==typeof e)for(var r in e)e[r]=fr(e[r],t);return e}er.deconstructPacket=function(e){var t=[],n=e.data,r=e;return r.data=hr(n,t),r.attachments=t.length,{packet:r,buffers:t}},er.reconstructPacket=function(e,t){return e.data=fr(e.data,t),e.attachments=void 0,e},er.removeBlobs=function(e,t){var n=0,r=e;!function e(o,i,s){if(!o)return o;if(lr&&o instanceof Blob||ur&&o instanceof File){n++;var a=new FileReader;a.onload=function(){s?s[i]=this.result:r=this.result,--n||t(r)},a.readAsArrayBuffer(o)}else if(sr(o))for(var c=0;c<o.length;c++)e(o[c],c,o);else if("object"==typeof o&&!ar(o))for(var l in o)e(o[l],l,o)}(r),n||t(r)},function(e){var t=Hn.exports("socket.io-parser"),n=Zn.exports,r=er,o=nr,i=rr;function s(){}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=s,e.Decoder=l;var a=e.ERROR+'"encode error"';function c(n){var r=""+n.type;if(e.BINARY_EVENT!==n.type&&e.BINARY_ACK!==n.type||(r+=n.attachments+"-"),n.nsp&&"/"!==n.nsp&&(r+=n.nsp+","),null!=n.id&&(r+=n.id),null!=n.data){var o=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(n.data);if(!1===o)return a;r+=o}return t("encoded %j as %s",n,r),r}function l(){this.reconstructor=null}function u(e){this.reconPack=e,this.buffers=[]}function h(t){return{type:e.ERROR,data:"parser error: "+t}}s.prototype.encode=function(n,o){(t("encoding packet %j",n),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type)?function(e,t){function n(e){var n=r.deconstructPacket(e),o=c(n.packet),i=n.buffers;i.unshift(o),t(i)}r.removeBlobs(e,n)}(n,o):o([c(n)])},n(l.prototype),l.prototype.add=function(n){var r;if("string"==typeof n)r=function(n){var r=0,i={type:Number(n.charAt(0))};if(null==e.types[i.type])return h("unknown packet type "+i.type);if(e.BINARY_EVENT===i.type||e.BINARY_ACK===i.type){for(var s=r+1;"-"!==n.charAt(++r)&&r!=n.length;);var a=n.substring(s,r);if(a!=Number(a)||"-"!==n.charAt(r))throw new Error("Illegal attachments");i.attachments=Number(a)}if("/"===n.charAt(r+1)){for(s=r+1;++r;){if(","===(l=n.charAt(r)))break;if(r===n.length)break}i.nsp=n.substring(s,r)}else i.nsp="/";var c=n.charAt(r+1);if(""!==c&&Number(c)==c){for(s=r+1;++r;){var l;if(null==(l=n.charAt(r))||Number(l)!=l){--r;break}if(r===n.length)break}i.id=Number(n.substring(s,r+1))}if(n.charAt(++r)){var u=function(e){try{return JSON.parse(e)}catch(e){return!1}}(n.substr(r));if(!(!1!==u&&(i.type===e.ERROR||o(u))))return h("invalid payload");i.data=u}return t("decoded %s as %j",n,i),i}(n),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new u(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!i(n)&&!n.base64)throw new Error("Unknown type: "+n);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(n))&&(this.reconstructor=null,this.emit("decoded",r))}},l.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}}($n);var pr={exports:{}},dr={},mr={exports:{}};try{mr.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){mr.exports=!1}var gr=mr.exports,yr=function(e){var t=e.xdomain,n=e.xscheme,r=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||gr))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(e){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},vr={exports:{}},br={},wr=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},Cr={}.toString,_r=Array.isArray||function(e){return"[object Array]"==Cr.call(e)},kr=Object.prototype.toString,Sr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===kr.call(Blob),Er="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===kr.call(File),Ar=function e(t){if(!t||"object"!=typeof t)return!1;if(_r(t)){for(var n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if("function"==typeof Buffer&&Buffer.isBuffer&&Buffer.isBuffer(t)||"function"==typeof ArrayBuffer&&t instanceof ArrayBuffer||Sr&&t instanceof Blob||Er&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&e(t[o]))return!0;return!1};var Tr=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),s=t,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer},xr=function(e,t,n){var r=!1;return n=n||Ir,o.count=e,0===e?t():o;function o(e,i){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(r=!0,t(e),t=n):0!==o.count||r||t(null,i)}};function Ir(){}
|
|
2
2
|
/*! https://mths.be/utf8js v2.1.2 by @mathias */var Or,Rr,Pr,Br=String.fromCharCode;function Fr(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function Nr(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function jr(e,t){return Br(e>>t&63|128)}function Mr(e,t){if(0==(4294967168&e))return Br(e);var n="";return 0==(4294965248&e)?n=Br(e>>6&31|192):0==(4294901760&e)?(Nr(e,t)||(e=65533),n=Br(e>>12&15|224),n+=jr(e,6)):0==(4292870144&e)&&(n=Br(e>>18&7|240),n+=jr(e,12),n+=jr(e,6)),n+=Br(63&e|128)}function Ur(){if(Pr>=Rr)throw Error("Invalid byte index");var e=255&Or[Pr];if(Pr++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Lr(e){var t,n;if(Pr>Rr)throw Error("Invalid byte index");if(Pr==Rr)return!1;if(t=255&Or[Pr],Pr++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|Ur())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|Ur()<<6|Ur())>=2048)return Nr(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|Ur()<<12|Ur()<<6|Ur())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var Dr={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,r=Fr(e),o=r.length,i=-1,s="";++i<o;)s+=Mr(r[i],n);return s},decode:function(e,t){var n=!1!==(t=t||{}).strict;Or=Fr(e),Rr=Or.length,Pr=0;for(var r,o=[];!1!==(r=Lr(n));)o.push(r);return function(e){for(var t,n=e.length,r=-1,o="";++r<n;)(t=e[r])>65535&&(o+=Br((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=Br(t);return o}(o)}},qr={};!function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),n=0;n<e.length;n++)t[e.charCodeAt(n)]=n;qr.encode=function(t){var n,r=new Uint8Array(t),o=r.length,i="";for(n=0;n<o;n+=3)i+=e[r[n]>>2],i+=e[(3&r[n])<<4|r[n+1]>>4],i+=e[(15&r[n+1])<<2|r[n+2]>>6],i+=e[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},qr.decode=function(e){var n,r,o,i,s,a=.75*e.length,c=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),h=new Uint8Array(u);for(n=0;n<c;n+=4)r=t[e.charCodeAt(n)],o=t[e.charCodeAt(n+1)],i=t[e.charCodeAt(n+2)],s=t[e.charCodeAt(n+3)],h[l++]=r<<2|o>>4,h[l++]=(15&o)<<4|i>>2,h[l++]=(3&i)<<6|63&s;return u}}();var zr=void 0!==zr?zr:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,$r=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),Hr=$r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),Vr=zr&&zr.prototype.append&&zr.prototype.getBlob;function Wr(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e}))}function Kr(e,t){t=t||{};var n=new zr;return Wr(e).forEach((function(e){n.append(e)})),t.type?n.getBlob(t.type):n.getBlob()}function Qr(e,t){return new Blob(Wr(e),t||{})}"undefined"!=typeof Blob&&(Kr.prototype=Blob.prototype,Qr.prototype=Blob.prototype);var Jr=$r?Hr?Blob:Qr:Vr?Kr:void 0;!function(e){var t,n=wr,r=Ar,o=Tr,i=xr,s=Dr;"undefined"!=typeof ArrayBuffer&&(t=qr);var a="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),c="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),l=a||c;e.protocol=3;var u=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=n(u),f={type:"error",data:"parser error"},p=Jr;function d(e,t,n){for(var r=new Array(e.length),o=i(e.length,n),s=function(e,n,o){t(n,(function(t,n){r[e]=n,o(t,r)}))},a=0;a<e.length;a++)s(a,e[a],o)}e.encodePacket=function(t,n,r,o){"function"==typeof n&&(o=n,n=!1),"function"==typeof r&&(o=r,r=null);var i=void 0===t.data?void 0:t.data.buffer||t.data;if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=u[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return r(s.buffer)}(t,n,o);if(void 0!==p&&i instanceof p)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(l)return function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){e.encodePacket({type:t.type,data:o.result},n,!0,r)},o.readAsArrayBuffer(t.data)}(t,n,r);var o=new Uint8Array(1);o[0]=u[t.type];var i=new p([o.buffer,t.data]);return r(i)}(t,n,o);if(i&&i.base64)return function(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}(t,o);var a=u[t.type];return void 0!==t.data&&(a+=r?s.encode(String(t.data),{strict:!1}):String(t.data)),o(""+a)},e.encodeBase64Packet=function(t,n){var r,o="b"+e.packets[t.type];if(void 0!==p&&t.data instanceof p){var i=new FileReader;return i.onload=function(){var e=i.result.split(",")[1];n(o+e)},i.readAsDataURL(t.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),a=new Array(s.length),c=0;c<s.length;c++)a[c]=s[c];r=String.fromCharCode.apply(null,a)}return o+=btoa(r),n(o)},e.decodePacket=function(t,n,r){if(void 0===t)return f;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&!1===(t=function(e){try{e=s.decode(e,{strict:!1})}catch(e){return!1}return e}(t)))return f;var i=t.charAt(0);return Number(i)==i&&h[i]?t.length>1?{type:h[i],data:t.substring(1)}:{type:h[i]}:f}i=new Uint8Array(t)[0];var a=o(t,1);return p&&"blob"===n&&(a=new p([a])),{type:h[i],data:a}},e.decodeBase64Packet=function(e,n){var r=h[e.charAt(0)];if(!t)return{type:r,data:{base64:!0,data:e.substr(1)}};var o=t.decode(e.substr(1));return"blob"===n&&p&&(o=new p([o])),{type:r,data:o}},e.encodePayload=function(t,n,o){"function"==typeof n&&(o=n,n=null);var i=r(t);if(n&&i)return p&&!l?e.encodePayloadAsBlob(t,o):e.encodePayloadAsArrayBuffer(t,o);if(!t.length)return o("0:");d(t,(function(t,r){e.encodePacket(t,!!i&&n,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return o(t.join(""))}))},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);var o;if("function"==typeof n&&(r=n,n=null),""===t)return r(f,0,1);for(var i,s,a="",c=0,l=t.length;c<l;c++){var u=t.charAt(c);if(":"===u){if(""===a||a!=(i=Number(a)))return r(f,0,1);if(a!=(s=t.substr(c+1,i)).length)return r(f,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),f.type===o.type&&f.data===o.data)return r(f,0,1);if(!1===r(o,c+i,l))return}c+=i,a=""}else a+=u}return""!==a?r(f,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));d(t,(function(t,n){e.encodePacket(t,!0,!0,(function(e){return n(null,e)}))}),(function(e,t){var r=t.reduce((function(e,t){var n;return e+(n="string"==typeof t?t.length:t.byteLength).toString().length+n+2}),0),o=new Uint8Array(r),i=0;return t.forEach((function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);n=r.buffer}o[i++]=t?0:1;var a=n.byteLength.toString();for(s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]})),n(o.buffer)}))},e.encodePayloadAsBlob=function(t,n){d(t,(function(t,n){e.encodePacket(t,!0,!0,(function(e){var t=new Uint8Array(1);if(t[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,t[0]=0}var i=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,p){var a=new p([t.buffer,s.buffer,e]);n(null,a)}}))}),(function(e,t){return n(new p(t))}))},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var i=t,s=[];i.byteLength>0;){for(var a=new Uint8Array(i),c=0===a[0],l="",u=1;255!==a[u];u++){if(l.length>310)return r(f,0,1);l+=a[u]}i=o(i,2+l.length),l=parseInt(l);var h=o(i,0,l);if(c)try{h=String.fromCharCode.apply(null,new Uint8Array(h))}catch(e){var p=new Uint8Array(h);h="";for(u=0;u<p.length;u++)h+=String.fromCharCode(p[u])}s.push(h),i=o(i,l)}var d=s.length;s.forEach((function(t,o){r(e.decodePacket(t,n,!0),o,d)}))}}(br);var Yr={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(Yr);var Xr=br,Gr=Zr;function Zr(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}(0,Yr.exports)(Zr.prototype),Zr.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},Zr.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Zr.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Zr.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},Zr.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Zr.prototype.onData=function(e){var t=Xr.decodePacket(e,this.socket.binaryType);this.onPacket(t)},Zr.prototype.onPacket=function(e){this.emit("packet",e)},Zr.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var eo,to={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},no=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},ro="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),oo={},io=0,so=0;function ao(e){var t="";do{t=ro[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function co(){var e=ao(+new Date);return e!==eo?(io=0,eo=e):e+"."+ao(io++)}for(;so<64;so++)oo[ro[so]]=so;co.encode=ao,co.decode=function(e){var t=0;for(so=0;so<e.length;so++)t=64*t+oo[e.charAt(so)];return t};var lo=co,uo={exports:{}},ho={exports:{}},fo=1e3,po=60*fo,mo=60*po,go=24*mo,yo=365.25*go,vo=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*yo;case"days":case"day":case"d":return n*go;case"hours":case"hour":case"hrs":case"hr":case"h":return n*mo;case"minutes":case"minute":case"mins":case"min":case"m":return n*po;case"seconds":case"second":case"secs":case"sec":case"s":return n*fo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&!1===isNaN(e))return t.long?function(e){return bo(e,go,"day")||bo(e,mo,"hour")||bo(e,po,"minute")||bo(e,fo,"second")||e+" ms"}(e):function(e){if(e>=go)return Math.round(e/go)+"d";if(e>=mo)return Math.round(e/mo)+"h";if(e>=po)return Math.round(e/po)+"m";if(e>=fo)return Math.round(e/fo)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function bo(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){function n(e){var n;function o(){if(o.enabled){var e=o,r=+new Date,i=r-(n||r);e.diff=i,e.prev=n,e.curr=r,n=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;c++;var o=t.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(e,i),s.splice(c,1),c--}return n})),t.formatArgs.call(e,s);var l=o.log||t.log||console.log.bind(console);l.apply(e,s)}}return o.namespace=e,o.enabled=t.enabled(e),o.useColors=t.useColors(),o.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),o.destroy=r,"function"==typeof t.init&&t.init(o),t.instances.push(o),o}function r(){var e=t.instances.indexOf(this);return-1!==e&&(t.instances.splice(e,1),!0)}(t=e.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")));for(n=0;n<t.instances.length;n++){var i=t.instances[n];i.enabled=t.enabled(i.namespace)}},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=vo,t.instances=[],t.names=[],t.skips=[],t.formatters={}}(ho,ho.exports),function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=ho.exports).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var o=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(o++,"%c"===e&&(i=o))})),e.splice(i,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(uo,uo.exports);var wo=Gr,Co=to,_o=br,ko=no,So=lo,Eo=uo.exports("engine.io-client:polling"),Ao=xo,To=null!=new yr({xdomain:!1}).responseType;function xo(e){var t=e&&e.forceBase64;To&&!t||(this.supportsBinary=!1),wo.call(this,e)}ko(xo,wo),xo.prototype.name="polling",xo.prototype.doOpen=function(){this.poll()},xo.prototype.pause=function(e){var t=this;function n(){Eo("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(Eo("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){Eo("pre-pause polling complete"),--r||n()}))),this.writable||(Eo("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){Eo("pre-pause writing complete"),--r||n()})))}else n()},xo.prototype.poll=function(){Eo("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},xo.prototype.onData=function(e){var t=this;Eo("polling got data %s",e);_o.decodePayload(e,this.socket.binaryType,(function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Eo('ignoring poll - transport state "%s"',this.readyState))},xo.prototype.doClose=function(){var e=this;function t(){Eo("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Eo("transport open - closing"),t()):(Eo("transport not open - deferring close"),this.once("open",t))},xo.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};_o.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},xo.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=So()),this.supportsBinary||e.sid||(e.b64=1),e=Co.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Io=yr,Oo=Ao,Ro=Yr.exports,Po=no,Bo=uo.exports("engine.io-client:polling-xhr");function Fo(){}function No(e){if(Oo.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}}function jo(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if(vr.exports=No,vr.exports.Request=jo,Po(No,Oo),No.prototype.supportsBinary=!0,No.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new jo(e)},No.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=r},No.prototype.doPoll=function(){Bo("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},Ro(jo.prototype),jo.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new Io(e),n=this;try{Bo("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var r in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(r)&&t.setRequestHeader(r,this.extraHeaders[r])}catch(e){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===e&&(t.responseType="arraybuffer")}catch(e){}4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout((function(){n.onError(t.status)}),0))},Bo("xhr data %s",this.data),t.send(this.data)}catch(e){return void setTimeout((function(){n.onError(e)}),0)}"undefined"!=typeof document&&(this.index=jo.requestsCount++,jo.requests[this.index]=this)},jo.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},jo.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},jo.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},jo.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Fo:this.xhr.onreadystatechange=Fo,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete jo.requests[this.index],this.xhr=null}},jo.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},jo.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},jo.prototype.abort=function(){this.cleanup()},jo.requestsCount=0,jo.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Uo);else if("function"==typeof addEventListener){var Mo="onpagehide"in self?"pagehide":"unload";addEventListener(Mo,Uo,!1)}function Uo(){for(var e in jo.requests)jo.requests.hasOwnProperty(e)&&jo.requests[e].abort()}var Lo,Do=Ao,qo=Wo,zo=/\n/g,$o=/\\n/g;function Ho(){}function Vo(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==de?de:{}}function Wo(e){if(Do.call(this,e),this.query=this.query||{},!Lo){var t=Vo();Lo=t.___eio=t.___eio||[]}this.index=Lo.length;var n=this;Lo.push((function(e){n.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=Ho)}),!1)}no(Wo,Do),Wo.prototype.supportsBinary=!1,Wo.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Do.prototype.doClose.call(this)},Wo.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},Wo.prototype.doWrite=function(e,t){var n=this;if(!this.form){var r,o=document.createElement("form"),i=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index;o.className="socketio",o.style.position="absolute",o.style.top="-1000px",o.style.left="-1000px",o.target=s,o.method="POST",o.setAttribute("accept-charset","utf-8"),i.name="d",o.appendChild(i),document.body.appendChild(o),this.form=o,this.area=i}function a(){c(),t()}function c(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+n.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=n.iframeId,r.src="javascript:0"}r.id=n.iframeId,n.form.appendChild(r),n.iframe=r}this.form.action=this.uri(),c(),e=e.replace($o,"\\\n"),this.area.value=e.replace(zo,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===n.iframe.readyState&&a()}:this.iframe.onload=a};var Ko,Qo,Jo=Gr,Yo=br,Xo=to,Go=no,Zo=lo,ei=uo.exports("engine.io-client:websocket");if("undefined"!=typeof WebSocket)Ko=WebSocket;else if("undefined"!=typeof self)Ko=self.WebSocket||self.MozWebSocket;else try{Qo=require("ws")}catch(e){}var ti=Ko||Qo,ni=ri;function ri(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=Ko&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(ti=Qo),Jo.call(this,e)}Go(ri,Jo),ri.prototype.name="websocket",ri.prototype.supportsBinary=!0,ri.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new ti(e,t):new ti(e):new ti(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},ri.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},ri.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,r=0,o=n;r<o;r++)!function(e){Yo.encodePacket(e,t.supportsBinary,(function(r){if(!t.usingBrowserWebSocket){var o={};if(e.options&&(o.compress=e.options.compress),t.perMessageDeflate)("string"==typeof r?Buffer.byteLength(r):r.length)<t.perMessageDeflate.threshold&&(o.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(r):t.ws.send(r,o)}catch(e){ei("websocket closed before onclose event")}--n||i()}))}(e[r]);function i(){t.emit("flush"),setTimeout((function(){t.writable=!0,t.emit("drain")}),0)}},ri.prototype.onClose=function(){Jo.prototype.onClose.call(this)},ri.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},ri.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=Zo()),this.supportsBinary||(e.b64=1),(e=Xo.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},ri.prototype.check=function(){return!(!ti||"__initialize"in ti&&this.name===ri.prototype.name)};var oi=yr,ii=vr.exports,si=qo,ai=ni;dr.polling=function(e){var t=!1,n=!1,r=!1!==e.jsonp;if("undefined"!=typeof location){var o="https:"===location.protocol,i=location.port;i||(i=o?443:80),t=e.hostname!==location.hostname||i!==e.port,n=e.secure!==o}if(e.xdomain=t,e.xscheme=n,"open"in new oi(e)&&!e.forceJSONP)return new ii(e);if(!r)throw new Error("JSONP disabled");return new si(e)},dr.websocket=ai;var ci=[].indexOf,li=function(e,t){if(ci)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},ui=dr,hi=Yr.exports,fi=uo.exports("engine.io-client:socket"),pi=li,di=br,mi=On,gi=to,yi=vi;function vi(e,t){if(!(this instanceof vi))return new vi(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=mi(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=mi(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=gi.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}vi.priorWebsocketSuccess=!1,hi(vi.prototype),vi.protocol=di.protocol,vi.Socket=vi,vi.Transport=Gr,vi.transports=dr,vi.parser=br,vi.prototype.createTransport=function(e){fi('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);t.EIO=di.protocol,t.transport=e;var n=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new ui[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},vi.prototype.open=function(){var e;if(this.rememberUpgrade&&vi.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},vi.prototype.setTransport=function(e){fi("setting transport %s",e.name);var t=this;this.transport&&(fi("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},vi.prototype.probe=function(e){fi('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;function o(){if(r.onlyBinaryUpgrades){var o=!this.supportsBinary&&r.transport.supportsBinary;n=n||o}n||(fi('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(fi('probe transport "%s" pong',e),r.upgrading=!0,r.emit("upgrading",t),!t)return;vi.priorWebsocketSuccess="websocket"===t.name,fi('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(fi("changing transport and sending upgrade packet"),u(),r.setTransport(t),t.send([{type:"upgrade"}]),r.emit("upgrade",t),t=null,r.upgrading=!1,r.flush())}))}else{fi('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,r.emit("upgradeError",i)}})))}function i(){n||(n=!0,u(),t.close(),t=null)}function s(n){var o=new Error("probe error: "+n);o.transport=t.name,i(),fi('probe transport "%s" failed because of error: %s',e,n),r.emit("upgradeError",o)}function a(){s("transport closed")}function c(){s("socket closed")}function l(e){t&&e.name!==t.name&&(fi('"%s" works - aborting "%s"',e.name,t.name),i())}function u(){t.removeListener("open",o),t.removeListener("error",s),t.removeListener("close",a),r.removeListener("close",c),r.removeListener("upgrading",l)}vi.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",s),t.once("close",a),this.once("close",c),this.once("upgrading",l),t.open()},vi.prototype.onOpen=function(){if(fi("socket open"),this.readyState="open",vi.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){fi("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},vi.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(fi('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else fi('packet received with socket readyState "%s"',this.readyState)},vi.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},vi.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},vi.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){fi("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},vi.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},vi.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},vi.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(fi("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},vi.prototype.write=vi.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},vi.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},vi.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():t()})):this.upgrading?r():t()}function t(){e.onClose("forced close"),fi("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function r(){e.once("upgrade",n),e.once("upgradeError",n)}return this},vi.prototype.onError=function(e){fi("socket error %j",e),vi.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},vi.prototype.onClose=function(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){fi('socket close with reason: "%s"',e);clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0}},vi.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~pi(this.transports,e[n])&&t.push(e[n]);return t},pr.exports=yi,pr.exports.parser=br;var bi={exports:{}},wi={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(wi);var Ci=function(e,t){for(var n=[],r=(t=t||0)||0;r<e.length;r++)n[r-t]=e[r];return n};var _i=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}};var ki=[].slice,Si=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=ki.call(arguments,2);return function(){return t.apply(e,n.concat(ki.call(arguments)))}};!function(e,t){var n=$n,r=wi.exports,o=Ci,i=_i,s=Si,a=Rn.exports("socket.io-client:socket"),c=to,l=Ar;e.exports=f;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},h=r.prototype.emit;function f(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}r(f.prototype),f.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[i(e,"open",s(this,"onopen")),i(e,"packet",s(this,"onpacket")),i(e,"close",s(this,"onclose"))]}},f.prototype.open=f.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},f.prototype.send=function(){var e=o(arguments);return e.unshift("message"),this.emit.apply(this,e),this},f.prototype.emit=function(e){if(u.hasOwnProperty(e))return h.apply(this,arguments),this;var t=o(arguments),r={type:(void 0!==this.flags.binary?this.flags.binary:l(t))?n.BINARY_EVENT:n.EVENT,data:t,options:{}};return r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(a("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},f.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},f.prototype.onopen=function(){if(a("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?c.encode(this.query):this.query;a("sending connect packet with query %s",e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})},f.prototype.onclose=function(e){a("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},f.prototype.onpacket=function(e){var t=e.nsp===this.nsp,r=e.type===n.ERROR&&"/"===e.nsp;if(t||r)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data)}},f.prototype.onevent=function(e){var t=e.data||[];a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?h.apply(this,t):this.receiveBuffer.push(t)},f.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var i=o(arguments);a("sending ack %j",i),t.packet({type:l(i)?n.BINARY_ACK:n.ACK,id:e,data:i})}}},f.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):a("bad ack %s",e.id)},f.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},f.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)h.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},f.prototype.ondisconnect=function(){a("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},f.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},f.prototype.close=f.prototype.disconnect=function(){return this.connected&&(a("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},f.prototype.compress=function(e){return this.flags.compress=e,this},f.prototype.binary=function(e){return this.flags.binary=e,this}}(bi);var Ei=Ai;function Ai(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ai.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Ai.prototype.reset=function(){this.attempts=0},Ai.prototype.setMin=function(e){this.ms=e},Ai.prototype.setMax=function(e){this.max=e},Ai.prototype.setJitter=function(e){this.jitter=e};var Ti=pr.exports,xi=bi.exports,Ii=wi.exports,Oi=$n,Ri=_i,Pi=Si,Bi=Rn.exports("socket.io-client:manager"),Fi=li,Ni=Ei,ji=Object.prototype.hasOwnProperty,Mi=Ui;function Ui(e,t){if(!(this instanceof Ui))return new Ui(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new Ni({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||Oi;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Ui.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)ji.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Ui.prototype.updateSocketIds=function(){for(var e in this.nsps)ji.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Ui.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},Ii(Ui.prototype),Ui.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Ui.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Ui.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Ui.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Ui.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Ui.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Ui.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Ui.prototype.open=Ui.prototype.connect=function(e,t){if(Bi("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Bi("opening %s",this.uri),this.engine=Ti(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=Ri(n,"open",(function(){r.onopen(),e&&e()})),i=Ri(n,"error",(function(t){if(Bi("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var s=this._timeout;Bi("connect attempt will timeout after %d",s);var a=setTimeout((function(){Bi("connect attempt timed out after %d",s),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",s)}),s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(o),this.subs.push(i),this},Ui.prototype.onopen=function(){Bi("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Ri(e,"data",Pi(this,"ondata"))),this.subs.push(Ri(e,"ping",Pi(this,"onping"))),this.subs.push(Ri(e,"pong",Pi(this,"onpong"))),this.subs.push(Ri(e,"error",Pi(this,"onerror"))),this.subs.push(Ri(e,"close",Pi(this,"onclose"))),this.subs.push(Ri(this.decoder,"decoded",Pi(this,"ondecoded")))},Ui.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Ui.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Ui.prototype.ondata=function(e){this.decoder.add(e)},Ui.prototype.ondecoded=function(e){this.emit("packet",e)},Ui.prototype.onerror=function(e){Bi("error",e),this.emitAll("error",e)},Ui.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new xi(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",o),n.on("connect",(function(){n.id=r.generateId(e)})),this.autoConnect&&o()}function o(){~Fi(r.connecting,n)||r.connecting.push(n)}return n},Ui.prototype.destroy=function(e){var t=Fi(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Ui.prototype.packet=function(e){Bi("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()})))},Ui.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Ui.prototype.cleanup=function(){Bi("cleanup");for(var e=this.subs.length,t=0;t<e;t++){this.subs.shift().destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},Ui.prototype.close=Ui.prototype.disconnect=function(){Bi("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},Ui.prototype.onclose=function(e){Bi("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},Ui.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)Bi("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();Bi("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(Bi("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(Bi("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(Bi("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},Ui.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)},function(e,t){var n=zn,r=$n,o=Mi,i=Rn.exports("socket.io-client");e.exports=t=a;var s=t.managers={};function a(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,a=n(e),c=a.source,l=a.id,u=a.path,h=s[l]&&u in s[l].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||h?(i("ignoring socket cache for %s",c),r=o(c,t)):(s[l]||(i("new io instance for %s",c),s[l]=o(c,t)),r=s[l]),a.query&&!t.query&&(t.query=a.query),r.socket(a.path,t)}t.protocol=r.protocol,t.connect=a,t.Manager=Mi,t.Socket=bi.exports}(Tn,Tn.exports);var Li=Tn.exports;var Di={exports:{}};Di.exports=function(){function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){if(!a&&ge)return ge(s);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,(function(e){return o(t[s][1][e]||e)}),l,l.exports,e,t,n,r)}return n[s].exports}for(var i=ge,s=0;s<r.length;s++)o(r[s]);return o}return e}()({1:[function(e,t,n){(function(n,r){(function(){const o=e("events").EventEmitter,i=e("./store"),s=e("./topic-alias-recv"),a=e("./topic-alias-send"),c=e("mqtt-packet"),l=e("./default-message-id-provider"),u=e("readable-stream").Writable,h=e("inherits"),f=e("reinterval"),p=e("rfdc/default"),d=e("./validations"),m=e("xtend"),g=e("debug")("mqttjs:client"),y=n?n.nextTick:function(e){setTimeout(e,0)},v=r.setImmediate||function(e){y(e)},b={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},w=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],C={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function _(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function k(e,t){if(5===e.options.protocolVersion&&"publish"===t.cmd){let n;t.properties&&(n=t.properties.topicAlias);const r=t.topic.toString();if(e.topicAliasSend)if(n){if(0!==r.length&&(g("applyTopicAlias :: register topic: %s - alias: %d",r,n),!e.topicAliasSend.put(r,n)))return g("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,n),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(e.options.autoAssignTopicAlias?(n=e.topicAliasSend.getAliasByTopic(r),n?(t.topic="",t.properties={...t.properties,topicAlias:n},g("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,n)):(n=e.topicAliasSend.getLruAlias(),e.topicAliasSend.put(r,n),t.properties={...t.properties,topicAlias:n},g("applyTopicAlias :: auto assign topic: %s - alias: %d",r,n))):e.options.autoUseTopicAlias&&(n=e.topicAliasSend.getAliasByTopic(r),n&&(t.topic="",t.properties={...t.properties,topicAlias:n},g("applyTopicAlias :: auto use topic: %s - alias: %d",r,n))));else if(n)return g("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,n),new Error("Sending Topic Alias out of range")}}function S(e,t){let n;t.properties&&(n=t.properties.topicAlias);let r=t.topic.toString();if(0===r.length){if(void 0===n)return new Error("Unregistered Topic Alias");if(r=e.topicAliasSend.getTopicByAlias(n),void 0===r)return new Error("Unregistered Topic Alias");t.topic=r}n&&delete t.properties.topicAlias}function E(e,t,n){g("sendPacket :: packet: %O",t),g("sendPacket :: emitting `packetsend`"),e.emit("packetsend",t),g("sendPacket :: writing to stream");const r=c.writeToStream(t,e.stream,e.options);g("sendPacket :: writeToStream result %s",r),!r&&n&&n!==I?(g("sendPacket :: handle events on `drain` once through callback."),e.stream.once("drain",n)):n&&(g("sendPacket :: invoking cb"),n())}function A(e){e&&(g("flush: queue exists? %b",!!e),Object.keys(e).forEach((function(t){"function"==typeof e[t].cb&&(e[t].cb(new Error("Connection closed")),delete e[t])})))}function T(e){e&&(g("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(e).forEach((function(t){e[t].volatile&&"function"==typeof e[t].cb&&(e[t].cb(new Error("Connection closed")),delete e[t])})))}function x(e,t,n,r){g("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let o,i=t;if("publish"===i.cmd&&(i=p(t),o=S(e,i),o))return n&&n(o);e.outgoingStore.put(i,(function(o){if(o)return n&&n(o);r(),E(e,t,n)}))}function I(e){g("nop ::",e)}function O(e,t){let n;const r=this;if(!(this instanceof O))return new O(e,t);for(n in this.options=t||{},b)void 0===this.options[n]?this.options[n]=b[n]:this.options[n]=t[n];g("MqttClient :: options.protocol",t.protocol),g("MqttClient :: options.protocolVersion",t.protocolVersion),g("MqttClient :: options.username",t.username),g("MqttClient :: options.keepalive",t.keepalive),g("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),g("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),g("MqttClient :: options.topicAliasMaximum",t.topicAliasMaximum),this.options.clientId="string"==typeof t.clientId?t.clientId:_(),g("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new l:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new i,this.incomingStore=t.incomingStore||new i,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.topicAliasMaximum>0&&(t.topicAliasMaximum>65535?g("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new s(t.topicAliasMaximum)),this.on("connect",(function(){const e=this.queue;function t(){const n=e.shift();g("deliver :: entry %o",n);let o=null;if(!n)return void r._resubscribe();o=n.packet,g("deliver :: call _sendPacket for %o",o);let i=!0;o.messageId&&0!==o.messageId&&(r.messageIdProvider.register(o.messageId)||(i=!1)),i?r._sendPacket(o,(function(e){n.cb&&n.cb(e),t()})):(g("messageId: %d has already used. The message is skipped and removed.",o.messageId),t())}g("connect :: sending queued packets"),t()})),this.on("close",(function(){g("close :: connected set to `false`"),this.connected=!1,g("close :: clearing connackTimer"),clearTimeout(this.connackTimer),g("close :: clearing ping timer"),null!==r.pingTimer&&(r.pingTimer.clear(),r.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),g("close :: calling _setupReconnect"),this._setupReconnect()})),o.call(this),g("MqttClient :: setting up stream"),this._setupStream()}h(O,o),O.prototype._setupStream=function(){const e=this,t=new u,n=c.parser(this.options);let r=null;const o=[];function i(){if(o.length)y(s);else{const e=r;r=null,e()}}function s(){g("work :: getting next packet in queue");const t=o.shift();if(t)g("work :: packet pulled from queue"),e._handlePacket(t,i);else{g("work :: no packets in queue");const e=r;r=null,g("work :: done flag is %s",!!e),e&&e()}}function a(t){g("streamErrorHandler :: error",t.message),w.includes(t.code)?(g("streamErrorHandler :: emitting error"),e.emit("error",t)):I(t)}g("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),g("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),n.on("packet",(function(e){g("parser :: on packet push to packets array."),o.push(e)})),t._write=function(e,t,o){r=o,g("writable stream :: parsing buffer"),n.parse(e),s()},g("_setupStream :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",a),this.stream.on("close",(function(){g("(%s)stream :: on close",e.options.clientId),T(e.outgoing),g("stream: emit close to MqttClient"),e.emit("close")})),g("_setupStream: sending packet `connect`");const l=Object.create(this.options);if(l.cmd="connect",this.topicAliasRecv&&(l.properties||(l.properties={}),this.topicAliasRecv&&(l.properties.topicAliasMaximum=this.topicAliasRecv.max)),E(this,l),n.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end((()=>this.emit("error",new Error("Packet has no Authentication Method")))),this;this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket&&E(this,m({cmd:"auth",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){g("!!connectTimeout hit!! Calling _cleanUp with force `true`"),e._cleanUp(!0)}),this.options.connectTimeout)},O.prototype._handlePacket=function(e,t){const n=this.options;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<e.length)return this.emit("error",new Error("exceeding packets size "+e.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(g("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",e),e.cmd){case"publish":this._handlePublish(e,t);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(e),t();break;case"pubrel":this._handlePubrel(e,t);break;case"connack":this._handleConnack(e),t();break;case"auth":this._handleAuth(e),t();break;case"pingresp":this._handlePingresp(e),t();break;case"disconnect":this._handleDisconnect(e),t()}},O.prototype._checkDisconnecting=function(e){return this.disconnecting&&(e&&e!==I?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},O.prototype.publish=function(e,t,n,r){g("publish :: message `%s` to topic `%s`",t,e);const o=this.options;if("function"==typeof n&&(r=n,n=null),n=m({qos:0,retain:!1,dup:!1},n),this._checkDisconnecting(r))return this;const i=this,s=function(){let s=0;if((1===n.qos||2===n.qos)&&(s=i._nextId(),null===s))return g("No messageId left"),!1;const a={cmd:"publish",topic:e,payload:t,qos:n.qos,retain:n.retain,messageId:s,dup:n.dup};switch(5===o.protocolVersion&&(a.properties=n.properties),g("publish :: qos",n.qos),n.qos){case 1:case 2:i.outgoing[a.messageId]={volatile:!1,cb:r||I},g("MqttClient:publish: packet cmd: %s",a.cmd),i._sendPacket(a,void 0,n.cbStorePut);break;default:g("MqttClient:publish: packet cmd: %s",a.cmd),i._sendPacket(a,r,n.cbStorePut)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,cbStorePut:n.cbStorePut,callback:r}),this},O.prototype.subscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];const n=[];let r=t.shift();const o=r.resubscribe;let i=t.pop()||I,s=t.pop();const a=this.options.protocolVersion;delete r.resubscribe,"string"==typeof r&&(r=[r]),"function"!=typeof i&&(s=i,i=I);const c=d.validateTopics(r);if(null!==c)return v(i,new Error("Invalid topic "+c)),this;if(this._checkDisconnecting(i))return g("subscribe: discconecting true"),this;const l={qos:0};if(5===a&&(l.nl=!1,l.rap=!1,l.rh=0),s=m(l,s),Array.isArray(r)?r.forEach((function(t){if(g("subscribe: array topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<s.qos||o){const e={topic:t,qos:s.qos};5===a&&(e.nl=s.nl,e.rap=s.rap,e.rh=s.rh,e.properties=s.properties),g("subscribe: pushing topic `%s` and qos `%s` to subs list",e.topic,e.qos),n.push(e)}})):Object.keys(r).forEach((function(t){if(g("subscribe: object topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<r[t].qos||o){const e={topic:t,qos:r[t].qos};5===a&&(e.nl=r[t].nl,e.rap=r[t].rap,e.rh=r[t].rh,e.properties=s.properties),g("subscribe: pushing `%s` to subs list",e),n.push(e)}})),!n.length)return i(null,[]),this;const u=function(){const t=e._nextId();if(null===t)return g("No messageId left"),!1;const r={cmd:"subscribe",subscriptions:n,qos:1,retain:!1,dup:!1,messageId:t};if(s.properties&&(r.properties=s.properties),e.options.resubscribe){g("subscribe :: resubscribe true");const t=[];n.forEach((function(n){if(e.options.reconnectPeriod>0){const r={qos:n.qos};5===a&&(r.nl=n.nl||!1,r.rap=n.rap||!1,r.rh=n.rh||0,r.properties=n.properties),e._resubscribeTopics[n.topic]=r,t.push(n.topic)}})),e.messageIdToTopic[r.messageId]=t}return e.outgoing[r.messageId]={volatile:!0,cb:function(e,t){if(!e){const e=t.granted;for(let t=0;t<e.length;t+=1)n[t].qos=e[t]}i(e,n)}},g("subscribe :: call _sendPacket"),e._sendPacket(r),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,callback:i}),this},O.prototype.unsubscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];let n=t.shift(),r=t.pop()||I,o=t.pop();"string"==typeof n&&(n=[n]),"function"!=typeof r&&(o=r,r=I);const i=d.validateTopics(n);if(null!==i)return v(r,new Error("Invalid topic "+i)),this;if(e._checkDisconnecting(r))return this;const s=function(){const t=e._nextId();if(null===t)return g("No messageId left"),!1;const i={cmd:"unsubscribe",qos:1,messageId:t};return"string"==typeof n?i.unsubscriptions=[n]:Array.isArray(n)&&(i.unsubscriptions=n),e.options.resubscribe&&i.unsubscriptions.forEach((function(t){delete e._resubscribeTopics[t]})),"object"==typeof o&&o.properties&&(i.properties=o.properties),e.outgoing[i.messageId]={volatile:!0,cb:r},g("unsubscribe: call _sendPacket"),e._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:r}),this},O.prototype.end=function(e,t,n){const r=this;function o(){g("end :: closeStores: closing incoming and outgoing stores"),r.disconnected=!0,r.incomingStore.close((function(e){r.outgoingStore.close((function(t){if(g("end :: closeStores: emitting end"),r.emit("end"),n){const r=e||t;g("end :: closeStores: invoking callback with args"),n(r)}}))})),r._deferredReconnect&&r._deferredReconnect()}function i(){g("end :: (%s) :: finish :: calling _cleanUp with force %s",r.options.clientId,e),r._cleanUp(e,(()=>{g("end :: finish :: calling process.nextTick on closeStores"),y(o.bind(r))}),t)}return g("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(n=t||I,t=e,e=!1,"object"!=typeof t&&(n=t,t=null,"function"!=typeof n&&(n=I))),"object"!=typeof t&&(n=t,t=null),g("end :: cb? %s",!!n),n=n||I,this.disconnecting?(n(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(g("end :: (%s) :: calling finish in 10ms once outgoing is empty",r.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(g("end :: (%s) :: immediately calling finish",r.options.clientId),i()),this)},O.prototype.removeOutgoingMessage=function(e){const t=this.outgoing[e]?this.outgoing[e].cb:null;return delete this.outgoing[e],this.outgoingStore.del({messageId:e},(function(){t(new Error("Message removed"))})),this},O.prototype.reconnect=function(e){g("client reconnect");const t=this,n=function(){e?(t.options.incomingStore=e.incomingStore,t.options.outgoingStore=e.outgoingStore):(t.options.incomingStore=null,t.options.outgoingStore=null),t.incomingStore=t.options.incomingStore||new i,t.outgoingStore=t.options.outgoingStore||new i,t.disconnecting=!1,t.disconnected=!1,t._deferredReconnect=null,t._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=n:n(),this},O.prototype._reconnect=function(){g("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((()=>{this._setupStream()})),g("client already connected. disconnecting first.")):(g("_reconnect: calling _setupStream"),this._setupStream())},O.prototype._setupReconnect=function(){const e=this;!e.disconnecting&&!e.reconnectTimer&&e.options.reconnectPeriod>0?(this.reconnecting||(g("_setupReconnect :: emit `offline` state"),this.emit("offline"),g("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),g("_setupReconnect :: setting reconnectTimer for %d ms",e.options.reconnectPeriod),e.reconnectTimer=setInterval((function(){g("reconnectTimer :: reconnect triggered!"),e._reconnect()}),e.options.reconnectPeriod)):g("_setupReconnect :: doing nothing...")},O.prototype._clearReconnect=function(){g("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},O.prototype._cleanUp=function(e,t){const n=arguments[2];if(t&&(g("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),g("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&A(this.outgoing),g("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=m({cmd:"disconnect"},n);g("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,v.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(g("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(g("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(g("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())},O.prototype._sendPacket=function(e,t,n){g("_sendPacket :: (%s) :: start",this.options.clientId),n=n||I,t=t||I;const r=k(this,e);if(r)t(r);else{if(!this.connected)return"auth"===e.cmd?(this._shiftPingInterval(),void E(this,e,t)):(g("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,n));switch(this._shiftPingInterval(),e.cmd){case"publish":break;case"pubrel":return void x(this,e,t,n);default:return void E(this,e,t)}switch(e.qos){case 2:case 1:x(this,e,t,n);break;default:E(this,e,t)}g("_sendPacket :: (%s) :: end",this.options.clientId)}},O.prototype._storePacket=function(e,t,n){g("_storePacket :: packet: %o",e),g("_storePacket :: cb? %s",!!t),n=n||I;let r=e;if("publish"===r.cmd){r=p(e);const n=S(this,r);if(n)return t&&t(n)}0===(r.qos||0)&&this.queueQoSZero||"publish"!==r.cmd?this.queue.push({packet:r,cb:t}):r.qos>0?(t=this.outgoing[r.messageId]?this.outgoing[r.messageId].cb:null,this.outgoingStore.put(r,(function(e){if(e)return t&&t(e);n()}))):t&&t(new Error("No connection to broker"))},O.prototype._setupPingTimer=function(){g("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const e=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=f((function(){e._checkPing()}),1e3*this.options.keepalive))},O.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},O.prototype._checkPing=function(){g("_checkPing :: checking ping..."),this.pingResp?(g("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(g("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},O.prototype._handlePingresp=function(){this.pingResp=!0},O.prototype._handleConnack=function(e){g("_handleConnack");const t=this.options,n=5===t.protocolVersion?e.reasonCode:e.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535)return void this.emit("error",new Error("topicAliasMaximum from broker is out of range"));e.properties.topicAliasMaximum>0&&(this.topicAliasSend=new a(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=e.properties.serverKeepAlive,this._shiftPingInterval()),e.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(0===n)this.reconnecting=!1,this._onConnect(e);else if(n>0){const e=new Error("Connection refused: "+C[n]);e.code=n,this.emit("error",e)}},O.prototype._handleAuth=function(e){const t=this.options.protocolVersion,n=5===t?e.reasonCode:e.returnCode;if(5!==t){const e=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+t);return e.code=n,void this.emit("error",e)}const r=this;this.handleAuth(e,(function(e,t){if(e)r.emit("error",e);else if(24===n)r.reconnecting=!1,r._sendPacket(t);else{const t=new Error("Connection refused: "+C[n]);e.code=n,r.emit("error",t)}}))},O.prototype.handleAuth=function(e,t){t()},O.prototype._handlePublish=function(e,t){g("_handlePublish: packet %o",e),t=void 0!==t?t:I;let n=e.topic.toString();const r=e.payload,o=e.qos,i=e.messageId,s=this,a=this.options,c=[0,16,128,131,135,144,145,151,153];if(5===this.options.protocolVersion){let t;if(e.properties&&(t=e.properties.topicAlias),void 0!==t)if(0===n.length){if(!(t>0&&t<=65535))return g("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));{const e=this.topicAliasRecv.getTopicByAlias(t);if(!e)return g("_handlePublish :: unregistered topic alias. alias: %d",t),void this.emit("error",new Error("Received unregistered Topic Alias"));n=e,g("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",n,t)}}else{if(!this.topicAliasRecv.put(n,t))return g("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));g("_handlePublish :: registered topic: %s - alias: %d",n,t)}}switch(g("_handlePublish: qos %d",o),o){case 2:a.customHandleAcks(n,r,e,(function(n,r){return n instanceof Error||(r=n,n=null),n?s.emit("error",n):-1===c.indexOf(r)?s.emit("error",new Error("Wrong reason code for pubrec")):void(r?s._sendPacket({cmd:"pubrec",messageId:i,reasonCode:r},t):s.incomingStore.put(e,(function(){s._sendPacket({cmd:"pubrec",messageId:i},t)})))}));break;case 1:a.customHandleAcks(n,r,e,(function(o,a){return o instanceof Error||(a=o,o=null),o?s.emit("error",o):-1===c.indexOf(a)?s.emit("error",new Error("Wrong reason code for puback")):(a||s.emit("message",n,r,e),void s.handleMessage(e,(function(e){if(e)return t&&t(e);s._sendPacket({cmd:"puback",messageId:i,reasonCode:a},t)})))}));break;case 0:this.emit("message",n,r,e),this.handleMessage(e,t);break;default:g("_handlePublish: unknown QoS. Doing nothing.")}},O.prototype.handleMessage=function(e,t){t()},O.prototype._handleAck=function(e){const t=e.messageId,n=e.cmd;let r=null;const o=this.outgoing[t]?this.outgoing[t].cb:null,i=this;let s;if(o){switch(g("_handleAck :: packet type",n),n){case"pubcomp":case"puback":{const n=e.reasonCode;n&&n>0&&16!==n&&(s=new Error("Publish error: "+C[n]),s.code=n,o(s,e)),delete this.outgoing[t],this.outgoingStore.del(e,o),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue();break}case"pubrec":{r={cmd:"pubrel",qos:2,messageId:t};const n=e.reasonCode;n&&n>0&&16!==n?(s=new Error("Publish error: "+C[n]),s.code=n,o(s,e)):this._sendPacket(r);break}case"suback":delete this.outgoing[t],this.messageIdProvider.deallocate(t);for(let n=0;n<e.granted.length;n++)if(0!=(128&e.granted[n])){const e=this.messageIdToTopic[t];e&&e.forEach((function(e){delete i._resubscribeTopics[e]}))}this._invokeStoreProcessingQueue(),o(null,e);break;case"unsuback":delete this.outgoing[t],this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue(),o(null);break;default:i.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else g("_handleAck :: Server sent an ack in error. Ignoring.")},O.prototype._handlePubrel=function(e,t){g("handling pubrel packet"),t=void 0!==t?t:I;const n=e.messageId,r=this,o={cmd:"pubcomp",messageId:n};r.incomingStore.get(e,(function(e,n){e?r._sendPacket(o,t):(r.emit("message",n.topic,n.payload,n),r.handleMessage(n,(function(e){if(e)return t(e);r.incomingStore.del(n,I),r._sendPacket(o,t)})))}))},O.prototype._handleDisconnect=function(e){this.emit("disconnect",e)},O.prototype._nextId=function(){return this.messageIdProvider.allocate()},O.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},O.prototype._resubscribe=function(){g("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){g("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const n={};n[e[t]]=this._resubscribeTopics[e[t]],n.resubscribe=!0,this.subscribe(n,{properties:n[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},O.prototype._onConnect=function(e){if(this.disconnected)return void this.emit("connect",e);const t=this;function n(){let r=t.outgoingStore.createStream();function o(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}}function i(){r.destroy(),r=null,t._flushStoreProcessingQueue(),o()}function s(){if(!r)return;t._storeProcessing=!0;const e=r.read(1);let n;e?t._packetIdsDuringStoreProcessing[e.messageId]?s():t.disconnecting||t.reconnectTimer?r.destroy&&r.destroy():(n=t.outgoing[e.messageId]?t.outgoing[e.messageId].cb:null,t.outgoing[e.messageId]={volatile:!1,cb:function(e,t){n&&n(e,t),s()}},t._packetIdsDuringStoreProcessing[e.messageId]=!0,t.messageIdProvider.register(e.messageId)?t._sendPacket(e):g("messageId: %d has already used.",e.messageId)):r.once("readable",s)}t.once("close",i),r.on("error",(function(e){o(),t._flushStoreProcessingQueue(),t.removeListener("close",i),t.emit("error",e)})),r.on("end",(function(){let r=!0;for(const e in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[e]){r=!1;break}r?(o(),t.removeListener("close",i),t._invokeAllStoreProcessingQueue(),t.emit("connect",e)):n()})),s()}this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0,n()},O.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1},O.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},O.prototype._flushStoreProcessingQueue=function(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},t.exports=O}).call(this)}).call(this,e("_process"),void 0!==de?de:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(e,t,n){const{Buffer:r}=e("buffer"),o=e("readable-stream").Transform,i=e("duplexify");let s,a,c,l=!1;function u(){const e=new o;return e._write=function(e,t,n){s.sendSocketMessage({data:e.buffer,success:function(){n()},fail:function(){n(new Error)}})},e._flush=function(e){s.closeSocket({success:function(){e()}})},e}function h(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}function f(e,t){const n="alis"===e.protocol?"wss":"ws";let r=n+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(r=n+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function p(){l||(l=!0,s.onSocketOpen((function(){c.setReadable(a),c.setWritable(a),c.emit("connect")})),s.onSocketMessage((function(e){if("string"==typeof e.data){const t=r.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",(function(){let e=t.result;e=e instanceof ArrayBuffer?r.from(e):r.from(e,"utf8"),a.push(e)})),t.readAsArrayBuffer(e.data)}})),s.onSocketClose((function(){c.end(),c.destroy()})),s.onSocketError((function(e){c.destroy(e)})))}function d(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";h(t);const r=f(t,e);return s=t.my,s.connectSocket({url:r,protocols:n}),a=u(),c=i.obj(),p(),c}t.exports=d},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(e,t,n){const r=e("net"),o=e("debug")("mqttjs:tcp");function i(e,t){t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost";const n=t.port,i=t.hostname;return o("port %d and host %s",n,i),r.createConnection(n,i)}t.exports=i},{debug:18,net:16}],4:[function(e,t,n){const r=e("tls"),o=e("net"),i=e("debug")("mqttjs:tls");function s(e,t){t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===o.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,i("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const n=r.connect(t);function s(r){t.rejectUnauthorized&&e.emit("error",r),n.end()}return n.on("secureConnect",(function(){t.rejectUnauthorized&&!n.authorized?n.emit("error",new Error("TLS not authorized")):n.removeListener("error",s)})),n.on("error",s),n}t.exports=s},{debug:18,net:16,tls:16}],5:[function(e,t,n){(function(n){(function(){const{Buffer:r}=e("buffer"),o=e("ws"),i=e("debug")("mqttjs:ws"),s=e("duplexify"),a=e("readable-stream").Transform,c=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],l=void 0!==n&&"browser"===n.title||"function"==typeof __webpack_require__;function u(e,t){let n=e.protocol+"://"+e.hostname+":"+e.port+e.path;return"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}function h(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),l||"wss"!==e.protocol||c.forEach((function(n){Object.prototype.hasOwnProperty.call(e,n)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,n)&&(t.wsOptions[n]=e[n])})),t}function f(e){const t=h(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=e.port)}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}function p(e,t,n){i("createWebSocket"),i("protocol: "+n.protocolId+" "+n.protocolVersion);const r="MQIsdp"===n.protocolId&&3===n.protocolVersion?"mqttv3.1":"mqtt";return i("creating new Websocket for url: "+t+" and protocol: "+r),new o(t,[r],n.wsOptions)}function d(e,t){const n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",r=u(t,e),o=new WebSocket(r,[n]);return o.binaryType="arraybuffer",o}function m(e,t){i("streamBuilder");const n=h(t),r=u(n,e),s=p(e,r,n),a=o.createWebSocketStream(s,n.wsOptions);return a.url=r,s.on("close",(()=>{a.destroy()})),a}function g(e,t){let n;i("browserStreamBuilder");const o=f(t).browserBufferSize||524288,c=t.browserBufferTimeout||1e3,l=!t.objectMode,u=d(e,t),h=m(t,C,_);t.objectMode||(h._writev=w),h.on("close",(()=>{u.close()}));const p=void 0!==u.addEventListener;function m(e,t,n){const r=new a({objectModeMode:e.objectMode});return r._write=t,r._flush=n,r}function g(){n.setReadable(h),n.setWritable(h),n.emit("connect")}function y(){n.end(),n.destroy()}function v(e){n.destroy(e)}function b(e){let t=e.data;t=t instanceof ArrayBuffer?r.from(t):r.from(t,"utf8"),h.push(t)}function w(e,t){const n=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.from(e[t],"utf8"):n[t]=e[t].chunk;this._write(r.concat(n),"binary",t)}function C(e,t,n){u.bufferedAmount>o&&setTimeout(C,c,e,t,n),l&&"string"==typeof e&&(e=r.from(e,"utf8"));try{u.send(e)}catch(e){return n(e)}n()}function _(e){u.close(),e()}return u.readyState===u.OPEN?n=h:(n=n=s(void 0,void 0,t),t.objectMode||(n._writev=w),p?u.addEventListener("open",g):u.onopen=g),n.socket=u,p?(u.addEventListener("close",y),u.addEventListener("error",v),u.addEventListener("message",b)):(u.onclose=y,u.onerror=v,u.onmessage=b),n}t.exports=l?g:m}).call(this)}).call(this,e("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(e,t,n){const{Buffer:r}=e("buffer"),o=e("readable-stream").Transform,i=e("duplexify");let s,a,c;function l(){const e=new o;return e._write=function(e,t,n){s.send({data:e.buffer,success:function(){n()},fail:function(e){n(new Error(e))}})},e._flush=function(e){s.close({success:function(){e()}})},e}function u(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}function h(e,t){const n="wxs"===e.protocol?"wss":"ws";let r=n+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(r=n+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function f(){s.onOpen((function(){c.setReadable(a),c.setWritable(a),c.emit("connect")})),s.onMessage((function(e){let t=e.data;t=t instanceof ArrayBuffer?r.from(t):r.from(t,"utf8"),a.push(t)})),s.onClose((function(){c.end(),c.destroy()})),s.onError((function(e){c.destroy(new Error(e.errMsg))}))}function p(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";u(t);const r=h(t,e);s=wx.connectSocket({url:r,protocols:[n]}),a=l(),c=i.obj(),c._destroy=function(e,t){s.close({success:function(){t&&t(e)}})};const o=c.destroy;return c.destroy=function(){c.destroy=o;const e=this;setTimeout((function(){s.close({fail:function(){e._destroy(new Error)}})}),0)}.bind(c),f(),c}t.exports=p},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(e,t,n){function r(){if(!(this instanceof r))return new r;this.nextId=Math.max(1,Math.floor(65535*Math.random()))}r.prototype.allocate=function(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e},r.prototype.getLastAllocated=function(){return 1===this.nextId?65535:this.nextId-1},r.prototype.register=function(e){return!0},r.prototype.deallocate=function(e){},r.prototype.clear=function(){},t.exports=r},{}],8:[function(e,t,n){const r=e("xtend"),o=e("readable-stream").Readable,i={objectMode:!0},s={clean:!0};function a(e){if(!(this instanceof a))return new a(e);this.options=e||{},this.options=r(s,e),this._inflights=new Map}a.prototype.put=function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this},a.prototype.createStream=function(){const e=new o(i),t=[];let n=!1,r=0;return this._inflights.forEach((function(e,n){t.push(e)})),e._read=function(){!n&&r<t.length?this.push(t[r++]):this.push(null)},e.destroy=function(){if(n)return;const e=this;n=!0,setTimeout((function(){e.emit("close")}),0)},e},a.prototype.del=function(e,t){return(e=this._inflights.get(e.messageId))?(this._inflights.delete(e.messageId),t(null,e)):t&&t(new Error("missing packet")),this},a.prototype.get=function(e,t){return(e=this._inflights.get(e.messageId))?t(null,e):t&&t(new Error("missing packet")),this},a.prototype.close=function(e){this.options.clean&&(this._inflights=null),e&&e()},t.exports=a},{"readable-stream":69,xtend:81}],9:[function(e,t,n){function r(e){if(!(this instanceof r))return new r(e);this.aliasToTopic={},this.max=e}r.prototype.put=function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))},r.prototype.getTopicByAlias=function(e){return this.aliasToTopic[e]},r.prototype.clear=function(){this.aliasToTopic={}},t.exports=r},{}],10:[function(e,t,n){const r=e("lru-cache"),o=e("number-allocator").NumberAllocator;function i(e){if(!(this instanceof i))return new i(e);e>0&&(this.aliasToTopic=new r({max:e}),this.topicToAlias={},this.numberAllocator=new o(1,e),this.max=e,this.length=0)}i.prototype.put=function(e,t){if(0===t||t>this.max)return!1;const n=this.aliasToTopic.get(t);return n&&delete this.topicToAlias[n],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.length,!0},i.prototype.getTopicByAlias=function(e){return this.aliasToTopic.get(e)},i.prototype.getAliasByTopic=function(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t},i.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},i.prototype.getLruAlias=function(){const e=this.numberAllocator.firstVacant();return e||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},t.exports=i},{"lru-cache":37,"number-allocator":46}],11:[function(e,t,n){function r(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}function o(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!r(e[t]))return e[t];return null}t.exports={validateTopics:o}},{}],12:[function(e,t,n){(function(n){(function(){const r=e("../client"),o=e("../store"),i=e("url"),s=e("xtend"),a=e("debug")("mqttjs"),c={};function l(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}function u(e,t){if(a("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=null),t=t||{},e){const n=i.parse(e,!0);if(null!=n.port&&(n.port=Number(n.port)),null===(t=s(n,t)).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(l(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+t.protocol+'"!')}}if(!c[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((function(t,n){return(!e||n%2!=0)&&"function"==typeof c[t]}))[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");function n(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),a("calling streambuilder for",t.protocol),c[t.protocol](e,t)}t.protocol&&(t.defaultProtocol=t.protocol);const o=new r(n,t);return o.on("error",(function(){})),o}void 0!==n&&"browser"!==n.title||"function"!=typeof __webpack_require__?(c.mqtt=e("./tcp"),c.tcp=e("./tcp"),c.ssl=e("./tls"),c.tls=e("./tls"),c.mqtts=e("./tls")):(c.wx=e("./wx"),c.wxs=e("./wx"),c.ali=e("./ali"),c.alis=e("./ali")),c.ws=e("./ws"),c.wss=e("./ws"),t.exports=u,t.exports.connect=u,t.exports.MqttClient=r,t.exports.Store=o}).call(this)}).call(this,e("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(e,t,n){n.byteLength=u,n.toByteArray=f,n.fromByteArray=m;for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){var t=l(e),n=t[0],r=t[1];return 3*(n+r)/4-r}function h(e,t,n){return 3*(t+n)/4-n}function f(e){var t,n,r=l(e),s=r[0],a=r[1],c=new i(h(e,s,a)),u=0,f=a>0?s-4:s;for(n=0;n<f;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===a&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c}function p(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function d(e,t,n){for(var r,o=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(p(r));return o.join("")}function m(e){for(var t,n=e.length,o=n%3,i=[],s=16383,a=0,c=n-o;a<c;a+=s)i.push(d(e,a,a+s>c?c:a+s));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],14:[function(e,t,n){const{Buffer:r}=e("buffer"),o=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,o,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let n=0;n<this._bufs.length;n++){const r=t+this._bufs[n].length;if(e<r||n===this._bufs.length-1)return[n,e-t];t=r}},i.prototype._reverseOffset=function(e){const t=e[0];let n=e[1];for(let e=0;e<t;e++)n+=this._bufs[e].length;return n},i.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,o){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof o||o>this.length)&&(o=this.length),n>=this.length)return e||r.alloc(0);if(o<=0)return e||r.alloc(0);const i=!!e,s=this._offset(n),a=o-n;let c=a,l=i&&t||0,u=s[1];if(0===n&&o===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,l),l+=this._bufs[t].length;return e}if(c<=this._bufs[s[0]].length-u)return i?this._bufs[s[0]].copy(e,t,u,u+c):this._bufs[s[0]].slice(u,u+c);i||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const n=this._bufs[t].length-u;if(!(c>n)){this._bufs[t].copy(e,l,u,u+c),l+=n;break}this._bufs[t].copy(e,l,u),l+=n,c-=n,u&&(u=0)}return e.length>l?e.slice(0,l):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const n=this._offset(e),r=this._offset(t),o=this._bufs.slice(n[0],r[0]+1);return 0===r[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,r[1]),0!==n[1]&&(o[0]=o[0].slice(n[1])),this._new(o)},i.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)},i.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},i.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const o=this._offset(t);let i=o[0],s=o[1];for(;i<this._bufs.length;i++){const t=this._bufs[i];for(;s<t.length;)if(t.length-s>=e.length){const n=t.indexOf(e,s);if(-1!==n)return this._reverseOffset([i,n]);s=t.length-e.length+1}else{const t=this._reverseOffset([i,s]);if(this._match(t,e))return t;s++}s=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let n=0;n<t.length;n++)if(this.get(e+n)!==t[n])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)!function(t){null===e[t]?i.prototype[t]=function(e,n){return this.slice(e,e+n)[t](0,n)}:i.prototype[t]=function(n=0){return this.slice(n,n+e[t])[t](0)}}(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[o]},t.exports=i},{buffer:17}],15:[function(e,t,n){const r=e("readable-stream").Duplex,o=e("inherits"),i=e("./BufferList");function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",(function(e){e.on("error",t)})),this.on("unpipe",(function(e){e.removeListener("error",t)})),e=null}i._init.call(this,e),r.call(this)}o(s,r),Object.assign(s.prototype,i.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,n){this._appendBuffer(e),"function"==typeof n&&n()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof i||s.isBufferList(e)},s.isBufferList=i.isBufferList,t.exports=s,t.exports.BufferListStream=s,t.exports.BufferList=i},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(e,t,n){},{}],17:[function(e,t,n){(function(t){(function(){var t=e("base64-js"),r=e("ieee754");n.Buffer=a,n.SlowBuffer=y,n.INSPECT_MAX_BYTES=50;var o=2147483647;function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return f(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var o=m(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e,t,n){return l(e),e<=0?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)}function h(e){return l(e),s(e<0?0:0|g(e))}function f(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|v(e,t),r=s(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}function p(e){for(var t=e.length<0?0:0|g(e.length),n=s(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=a.prototype,r}function m(e){if(a.isBuffer(e)){var t=0|g(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?s(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}function g(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e){return+e!=e&&(e=0),a.alloc(+e)}function v(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(o)return r?-1:V(e).length;t=(""+t).toLowerCase(),o=!0}}function b(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return B(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function C(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,o){var i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var u=-1;for(i=n;i<a;i++)if(l(e,i)===l(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===c)return u*s}else-1!==u&&(i-=i-u),u=-1}else for(n+c>a&&(n=a-c),i=n;i>=0;i--){for(var h=!0,f=0;f<c;f++)if(l(e,i+f)!==l(t,f)){h=!1;break}if(h)return i}return-1}function k(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(X(a))return s;e[n+s]=a}return s}function S(e,t,n,r){return J(V(t,e.length-n),e,n,r)}function E(e,t,n,r){return J(W(t),e,n,r)}function A(e,t,n,r){return E(e,t,n,r)}function T(e,t,n,r){return J(Q(t),e,n,r)}function x(e,t,n,r){return J(K(t,e.length-n),e,n,r)}function I(e,n,r){return 0===n&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,s,a,c,l=e[o],u=null,h=l>239?4:l>223?3:l>191?2:1;if(o+h<=n)switch(h){case 1:l<128&&(u=l);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&l)<<6|63&i)>127&&(u=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&l)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=h}return P(r)}n.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,n){return c(e,t,n)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,n){return u(e,t,n)},a.allocUnsafe=function(e){return h(e)},a.allocUnsafeSlow=function(e){return h(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(Y(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=a.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(Y(i,Uint8Array)&&(i=a.from(i)),!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)w(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)w(this,t,t+3),w(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)w(this,t,t+7),w(this,t+1,t+6),w(this,t+2,t+5),w(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):b.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},a.prototype.compare=function(e,t,n,r,o){if(Y(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),c=Math.min(i,s),l=this.slice(r,o),u=e.slice(t,n),h=0;h<c;++h)if(l[h]!==u[h]){i=l[h],s=u[h];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},a.prototype.indexOf=function(e,t,n){return C(this,e,t,n,!0)},a.prototype.lastIndexOf=function(e,t,n){return C(this,e,t,n,!1)},a.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return k(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return A(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function P(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=R));return n}function B(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function F(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function N(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=H(e[i]);return o}function j(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function M(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,o,i){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,t,n,4),r.write(e,t,n,o,23,4),n+4}function q(e,t,n,o,i){return t=+t,n>>>=0,i||L(e,t,n,8),r.write(e,t,n,o,52,8),n+8}a.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=a.prototype,r},a.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},a.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},a.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||M(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),r.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),r.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),r.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),r.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},a.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||U(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},a.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},a.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);U(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},a.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},a.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},a.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},a.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},a.prototype.copy=function(e,t,n,r){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var i=o-1;i>=0;--i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},a.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var o=e.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var s=a.isBuffer(e)?e:a.from(e,r),c=s.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%c]}return this};var z=/[^+/0-9A-Za-z-_]/g;function $(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function H(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function W(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function K(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}function Q(e){return t.toByteArray($(e))}function J(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(e,t,n){(function(r){(function(){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),e.splice(o,0,n)}function s(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}}function a(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e}function c(){try{return localStorage}catch(e){}}n.formatArgs=i,n.save=s,n.load=a,n.useColors=o,n.storage=c(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:l}=t.exports;l.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":19,_process:50}],19:[function(e,t,n){function r(t){function n(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){let t,n,i,s=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),i=o-(t||o);n.diff=i,n.prev=t,n.curr=o,t=o,e[0]=r.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,o)=>{if("%%"===t)return"%";s++;const i=r.formatters[o];if("function"==typeof i){const r=e[s];t=i.call(n,r),e.splice(s,1),s--}return t})),r.formatArgs.call(n,e),(n.log||r.log).apply(n,e)}return a.namespace=e,a.useColors=r.useColors(),a.color=r.selectColor(e),a.extend=o,a.destroy=r.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(n!==r.namespaces&&(n=r.namespaces,i=r.enabled(e)),i),set:e=>{s=e}}),"function"==typeof r.init&&r.init(a),a}function o(e,t){const n=r(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function i(e){let t;r.save(e),r.namespaces=e,r.names=[],r.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")))}function s(){const e=[...r.names.map(c),...r.skips.map(c).map((e=>"-"+e))].join(",");return r.enable(""),e}function a(e){if("*"===e[e.length-1])return!0;let t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1}function c(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function l(e){return e instanceof Error?e.stack||e.message:e}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=i,r.enabled=a,r.humanize=e("ms"),r.destroy=u,Object.keys(t).forEach((e=>{r[e]=t[e]})),r.names=[],r.skips=[],r.formatters={},r.selectColor=n,r.enable(r.load()),r}t.exports=r},{ms:45}],20:[function(e,t,n){(function(n,r){(function(){var o=e("readable-stream"),i=e("end-of-stream"),s=e("inherits"),a=e("stream-shift"),c=r.from&&r.from!==Uint8Array.from?r.from([0]):new r([0]),l=function(e,t){e._corked?e.once("uncork",t):t()},u=function(e,t){e._autoDestroy&&e.destroy(t)},h=function(e,t){return function(n){n?u(e,"premature close"===n.message?null:n):t&&!e._ended&&e.end()}},f=function(e,t){return e?e._writableState&&e._writableState.finished?t():e._writableState?e.end(t):(e.end(),void t()):t()},p=function(){},d=function(e){return new o.Readable({objectMode:!0,highWaterMark:16}).wrap(e)},m=function(e,t,n){if(!(this instanceof m))return new m(e,t,n);o.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,e&&this.setWritable(e),t&&this.setReadable(t)};s(m,o.Duplex),m.obj=function(e,t,n){return n||(n={}),n.objectMode=!0,n.highWaterMark=16,new m(e,t,n)},m.prototype.cork=function(){1==++this._corked&&this.emit("cork")},m.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},m.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var t=this,r=i(e,{writable:!0,readable:!1},h(this,this._forwardEnd)),o=function(){var e=t._ondrain;t._ondrain=null,e&&e()},s=function(){t._writable.removeListener("drain",o),r()};this._unwrite&&n.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=s,this.uncork()}else this.end()},m.prototype.setReadable=function(e){if(this._unread&&this._unread(),this.destroyed)e&&e.destroy&&e.destroy();else{if(null===e||!1===e)return this.push(null),void this.resume();var t=this,n=i(e,{writable:!1,readable:!0},h(this)),r=function(){t._forward()},o=function(){t.push(null)},s=function(){t._readable2.removeListener("readable",r),t._readable2.removeListener("end",o),n()};this._drained=!0,this._readable=e,this._readable2=e._readableState?e:d(e),this._readable2.on("readable",r),this._readable2.on("end",o),this._unread=s,this._forward()}},m.prototype._read=function(){this._drained=!0,this._forward()},m.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=a(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},m.prototype.destroy=function(e,t){if(t||(t=p),this.destroyed)return t(null);this.destroyed=!0;var r=this;n.nextTick((function(){r._destroy(e),t(null)}))},m.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},m.prototype._write=function(e,t,n){if(!this.destroyed)return this._corked?l(this,this._write.bind(this,e,t,n)):e===c?this._finish(n):this._writable?void(!1===this._writable.write(e)?this._ondrain=n:this.destroyed||n()):n()},m.prototype._finish=function(e){var t=this;this.emit("preend"),l(this,(function(){f(t._forwardEnd&&t._writable,(function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),l(t,e)}))}))},m.prototype.end=function(e,t,n){return"function"==typeof e?this.end(null,null,e):"function"==typeof t?this.end(e,null,t):(this._ended=!0,e&&this.write(e),this._writableState.ending||this._writableState.destroyed||this.write(c),o.Writable.prototype.end.call(this,n))},t.exports=m}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(e,t,n){(function(n){(function(){var r=e("once"),o=function(){},i=function(e){return e.setHeader&&"function"==typeof e.abort},s=function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length},a=function(e,t,c){if("function"==typeof t)return a(e,null,t);t||(t={}),c=r(c||o);var l=e._writableState,u=e._readableState,h=t.readable||!1!==t.readable&&e.readable,f=t.writable||!1!==t.writable&&e.writable,p=!1,d=function(){e.writable||m()},m=function(){f=!1,h||c.call(e)},g=function(){h=!1,f||c.call(e)},y=function(t){c.call(e,t?new Error("exited with error code: "+t):null)},v=function(t){c.call(e,t)},b=function(){n.nextTick(w)},w=function(){if(!p)return(!h||u&&u.ended&&!u.destroyed)&&(!f||l&&l.ended&&!l.destroyed)?void 0:c.call(e,new Error("premature close"))},C=function(){e.req.on("finish",m)};return i(e)?(e.on("complete",m),e.on("abort",b),e.req?C():e.on("request",C)):f&&!l&&(e.on("end",d),e.on("close",d)),s(e)&&e.on("exit",y),e.on("end",g),e.on("finish",m),!1!==t.error&&e.on("error",v),e.on("close",b),function(){p=!0,e.removeListener("complete",m),e.removeListener("abort",b),e.removeListener("request",C),e.req&&e.req.removeListener("finish",m),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",m),e.removeListener("exit",y),e.removeListener("end",g),e.removeListener("error",v),e.removeListener("close",b)}};t.exports=a}).call(this)}).call(this,e("_process"))},{_process:50,once:48}],22:[function(e,t,n){var r=Object.create||S,o=Object.keys||E,i=Function.prototype.bind||A;function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=r(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var a,c=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),a=0===l.x}catch(e){a=!1}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function h(e,t,n){if(t)e.call(n);else for(var r=e.length,o=_(e,r),i=0;i<r;++i)o[i].call(n)}function f(e,t,n,r){if(t)e.call(n,r);else for(var o=e.length,i=_(e,o),s=0;s<o;++s)i[s].call(n,r)}function p(e,t,n,r,o){if(t)e.call(n,r,o);else for(var i=e.length,s=_(e,i),a=0;a<i;++a)s[a].call(n,r,o)}function d(e,t,n,r,o,i){if(t)e.call(n,r,o,i);else for(var s=e.length,a=_(e,s),c=0;c<s;++c)a[c].call(n,r,o,i)}function m(e,t,n,r){if(t)e.apply(n,r);else for(var o=e.length,i=_(e,o),s=0;s<o;++s)i[s].apply(n,r)}function g(e,t,n,o){var i,s,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),a=s[t]):(s=e._events=r(null),e._eventsCount=0),a){if("function"==typeof a?a=s[t]=o?[n,a]:[a,n]:o?a.unshift(n):a.push(n),!a.warned&&(i=u(e))&&i>0&&a.length>i){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else a=s[t]=n,++e._eventsCount;return e}function y(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function v(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=i.call(y,r);return o.listener=n,r.wrapFn=o,o}function b(e,t,n){var r=e._events;if(!r)return[];var o=r[t];return o?"function"==typeof o?n?[o.listener||o]:[o]:n?k(o):_(o,o.length):[]}function w(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function C(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}function _(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function k(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function S(e){var t=function(){};return t.prototype=e,new t}function E(e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t);return t}function A(e){var t=this;return function(){return t.apply(e,arguments)}}a?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');c=e}}):s.defaultMaxListeners=c,s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){var t,n,r,o,i,s,a="error"===e;if(s=this._events)a=a&&null==s.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var c=new Error('Unhandled "error" event. ('+t+")");throw c.context=t,c}if(!(n=s[e]))return!1;var l="function"==typeof n;switch(r=arguments.length){case 1:h(n,l,this);break;case 2:f(n,l,this,arguments[1]);break;case 3:p(n,l,this,arguments[1],arguments[2]);break;case 4:d(n,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];m(n,l,this,o)}return!0},s.prototype.addListener=function(e,t){return g(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return g(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,v(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,v(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,o,i,s,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(o=this._events))return this;if(!(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=r(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){a=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():C(n,i),1===n.length&&(o[e]=n[0]),o.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.removeAllListeners=function(e){var t,n,i;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=r(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=r(null):delete n[e]),this;if(0===arguments.length){var s,a=o(n);for(i=0;i<a.length;++i)"removeListener"!==(s=a[i])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=r(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return b(this,e,!0)},s.prototype.rawListeners=function(e){return b(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):w.call(e,t)},s.prototype.listenerCount=w,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],23:[function(e,t,n){
|
|
3
3
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
4
4
|
n.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<<a)-1,l=c>>1,u=-7,h=n?o-1:0,f=n?-1:1,p=e[t+h];for(h+=f,i=p&(1<<-u)-1,p>>=-u,u+=a;u>0;i=256*i+e[t+h],h+=f,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;u>0;s=256*s+e[t+h],h+=f,u-=8);if(0===i)i=1-l;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),i-=l}return(p?-1:1)*s*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var s,a,c,l=8*i-o-1,u=(1<<l)-1,h=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,o),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,l+=o;l>0;e[n+p]=255&s,p+=d,s/=256,l-=8);e[n+p-d]|=128*m}},{}],24:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],25:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=e,this.value=t}return e.prototype.rotateLeft=function(){var e=this.parent,t=this.brother,n=this.leftChild,r=this.rightChild;if(!r)throw new Error("unknown error");var o=r.leftChild,i=r.rightChild;return e&&(e.leftChild===this?e.leftChild=r:e.rightChild===this&&(e.rightChild=r)),r.parent=e,r.brother=t,r.leftChild=this,r.rightChild=i,t&&(t.brother=r),this.parent=r,this.brother=i,this.leftChild=n,this.rightChild=o,i&&(i.parent=r,i.brother=this),n&&(n.parent=this,n.brother=o),o&&(o.parent=this,o.brother=n),r},e.prototype.rotateRight=function(){var e=this.parent,t=this.brother,n=this.leftChild;if(!n)throw new Error("unknown error");var r=this.rightChild,o=n.leftChild,i=n.rightChild;return e&&(e.leftChild===this?e.leftChild=n:e.rightChild===this&&(e.rightChild=n)),n.parent=e,n.brother=t,n.leftChild=o,n.rightChild=this,t&&(t.brother=n),o&&(o.parent=n,o.brother=this),this.parent=n,this.brother=o,this.leftChild=i,this.rightChild=r,i&&(i.parent=this,i.brother=r),r&&(r.parent=this,r.brother=i),n},e.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},e.TreeNodeColorType={red:!0,black:!1},e}();Object.freeze(r),n.default=r},{}],26:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}};function o(e){var t=this;void 0===e&&(e=[]);var n=[],i=0,s=0,a=0,c=0,l=0,u=0;this.size=function(){return u},this.empty=function(){return 0===u},this.clear=function(){i=a=s=c=l=u=0,f.call(this,o.bucketSize),u=0},this.front=function(){return n[i][s]},this.back=function(){return n[a][c]},this.forEach=function(e){if(!this.empty()){var t=0;if(i!==a){for(l=s;l<o.bucketSize;++l)e(n[i][l],t++);for(l=i+1;l<a;++l)for(var r=0;r<o.bucketSize;++r)e(n[l][r],t++);for(l=0;l<=c;++l)e(n[a][l],t++)}else for(var l=s;l<=c;++l)e(n[i][l],t++)}};var h=function(e){var t=i*o.bucketSize+s,n=t+e,r=a*o.bucketSize+c;if(n<t||n>r)throw new Error("pos should more than 0 and less than queue's size");return{curNodeBucketIndex:Math.floor(n/o.bucketSize),curNodePointerIndex:n%o.bucketSize}};this.getElementByPos=function(e){var t=h(e),r=t.curNodeBucketIndex,o=t.curNodePointerIndex;return n[r][o]},this.eraseElementByPos=function(e){var t=this;if(e<0||e>u)throw new Error("pos should more than 0 and less than queue's size");if(0===e)this.popFront();else if(e===this.size())this.popBack();else{for(var n=[],r=e+1;r<u;++r)n.push(this.getElementByPos(r));this.cut(e),this.popBack(),n.forEach((function(e){return t.pushBack(e)}))}},this.eraseElementByValue=function(e){if(!this.empty()){var t=[];this.forEach((function(n){n!==e&&t.push(n)}));for(var n=t.length,r=0;r<n;++r)this.setElementByPos(r,t[r]);this.cut(n-1)}};var f=function(e){for(var t=[],r=e*o.sigma,h=Math.max(Math.ceil(r/o.bucketSize),2),f=0;f<h;++f)t.push(new Array(o.bucketSize));var p=Math.ceil(e/o.bucketSize),d=Math.floor(h/2)-Math.floor(p/2),m=d,g=0;if(this.size())for(f=0;f<p;++f){for(var y=0;y<o.bucketSize;++y)if(t[d+f][y]=this.front(),this.popFront(),this.empty()){m=d+f,g=y;break}if(this.empty())break}n=t,i=d,s=0,a=m,c=g,l=h,u=e};this.pushBack=function(e){this.empty()||(a===l-1&&c===o.bucketSize-1&&f.call(this,this.size()),c<o.bucketSize-1?++c:a<l-1&&(++a,c=0)),++u,n[a][c]=e},this.popBack=function(){this.empty()||(1!==this.size()&&(c>0?--c:i<a&&(--a,c=o.bucketSize-1)),u>0&&--u)},this.setElementByPos=function(e,t){var r=h(e),o=r.curNodeBucketIndex,i=r.curNodePointerIndex;n[o][i]=t},this.insert=function(e,t,n){var r=this;if(void 0===n&&(n=1),0===e)for(;n--;)this.pushFront(t);else if(e===this.size())for(;n--;)this.pushBack(t);else{for(var o=[],i=e;i<u;++i)o.push(this.getElementByPos(i));for(this.cut(e-1),i=0;i<n;++i)this.pushBack(t);o.forEach((function(e){return r.pushBack(e)}))}},this.find=function(e){if(i===a){for(var t=s;t<=c;++t)if(n[i][t]===e)return!0;return!1}for(t=s;t<o.bucketSize;++t)if(n[i][t]===e)return!0;for(t=i+1;t<a;++t)for(var r=0;r<o.bucketSize;++r)if(n[t][r]===e)return!0;for(t=0;t<=c;++t)if(n[a][t]===e)return!0;return!1},this.reverse=function(){for(var e=0,t=u-1;e<t;){var n=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,n),++e,--t}},this.unique=function(){if(!this.empty()){var e=[],t=this.front();this.forEach((function(n,r){0!==r&&n===t||(e.push(n),t=n)}));for(var n=0;n<u;++n)this.setElementByPos(n,e[n]);this.cut(e.length-1)}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);for(var n=0;n<u;++n)this.setElementByPos(n,t[n])},this.pushFront=function(e){this.empty()||(0===i&&0===s&&f.call(this,this.size()),s>0?--s:i>0&&(--i,s=o.bucketSize-1)),++u,n[i][s]=e},this.popFront=function(){this.empty()||(1!==this.size()&&(s<o.bucketSize-1?++s:i<a&&(++i,s=0)),u>0&&--u)},this.shrinkToFit=function(){var e=this,t=[];this.forEach((function(e){t.push(e)}));var r=t.length;n=[];for(var i=Math.ceil(r/o.bucketSize),s=0;s<i;++s)n.push(new Array(o.bucketSize));this.clear(),t.forEach((function(t){return e.pushBack(t)}))},this.cut=function(e){if(e<0)this.clear();else{var t=h(e),n=t.curNodeBucketIndex,r=t.curNodePointerIndex;a=n,c=r,u=e+1}},this[Symbol.iterator]=function(){return function(){var e,t;return r(this,(function(r){switch(r.label){case 0:if(0===u)return[2];if(i!==a)return[3,5];t=s,r.label=1;case 1:return t<=c?[4,n[i][t]]:[3,4];case 2:r.sent(),r.label=3;case 3:return++t,[3,1];case 4:return[2];case 5:t=s,r.label=6;case 6:return t<o.bucketSize?[4,n[i][t]]:[3,9];case 7:r.sent(),r.label=8;case 8:return++t,[3,6];case 9:t=i+1,r.label=10;case 10:if(!(t<a))return[3,15];e=0,r.label=11;case 11:return e<o.bucketSize?[4,n[t][e]]:[3,14];case 12:r.sent(),r.label=13;case 13:return++e,[3,11];case 14:return++t,[3,10];case 15:t=0,r.label=16;case 16:return t<=c?[4,n[a][t]]:[3,19];case 17:r.sent(),r.label=18;case 18:return++t,[3,16];case 19:return[2]}}))}()},function(){var r=o.bucketSize;e.size?r=e.size():e.length&&(r=e.length);var s=r*o.sigma;l=Math.ceil(s/o.bucketSize),l=Math.max(l,3);for(var c=0;c<l;++c)n.push(new Array(o.bucketSize));var u=Math.ceil(r/o.bucketSize);i=Math.floor(l/2)-Math.floor(u/2),a=i,e.forEach((function(e){return t.pushBack(e)}))}(),Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0}),o.sigma=3,o.bucketSize=5e3,Object.freeze(o),n.default=o},{}],27:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../LinkList/LinkList"),s=e("../Map/Map");function a(e,t,n){var c=this;if(void 0===e&&(e=[]),void 0===t&&(t=a.initSize),n=n||function(e){var t,n,r=0,i="";if("number"==typeof e)r=((r=Math.floor(e))<<5)-r,r&=r;else{i="string"!=typeof e?JSON.stringify(e):e;try{for(var s=o(i),a=s.next();!a.done;a=s.next())r=(r<<5)-r+a.value.charCodeAt(0),r&=r}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}return r^=r>>>16},0!=(t&t-1))throw new Error("initBucketNum must be 2 to the power of n");var l=0,u=[],h=Math.max(a.initSize,Math.min(a.maxSize,t));this.size=function(){return l},this.empty=function(){return 0===l},this.clear=function(){l=0,h=t,u=[]},this.forEach=function(e){var t=0;u.forEach((function(n){n.forEach((function(n){e(n,t++)}))}))};var f=function(e){if(!(e>=a.maxSize)){h=2*e;var t=[];u.forEach((function(r,o){if(!r.empty()){if(r instanceof i.default&&1===r.size()){var c=r.front(),l=c.key,f=c.value;t[n(l)&h-1]=new i.default([{key:l,value:f}])}else if(r instanceof s.default){var p=new i.default,d=new i.default;r.forEach((function(t){0==(n(t.key)&e)?p.pushBack(t):d.pushBack(t)})),p.size()>a.untreeifyThreshold?t[o]=new s.default(p):p.size()&&(t[o]=p),d.size()>a.untreeifyThreshold?t[o+e]=new s.default(d):d.size()&&(t[o+e]=d)}else{var m=new i.default,g=new i.default;r.forEach((function(t){0==(n(t.key)&e)?m.pushBack(t):g.pushBack(t)})),m.size()&&(t[o]=m),g.size()&&(t[o+e]=g)}u[o].clear()}})),u=t}};this.setElement=function(e,t){var r,c;if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(null!=t){var p=n(e)&h-1;if(u[p]){var d=u[p].size();if(u[p]instanceof i.default){try{for(var m=o(u[p]),g=m.next();!g.done;g=m.next()){var y=g.value;if(y.key===e)return void(y.value=t)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(c=m.return)&&c.call(m)}finally{if(r)throw r.error}}u[p].pushBack({key:e,value:t}),u[p].size()>=a.treeifyThreshold&&(u[p]=new s.default(u[p]))}else u[p].setElement(e,t);var v=u[p].size();l+=v-d}else++l,u[p]=new i.default([{key:e,value:t}]);l>h*a.sigma&&f.call(this,h)}else this.eraseElementByKey(e)},this.getElementByKey=function(e){var t,r,i=n(e)&h-1;if(u[i]){if(u[i]instanceof s.default)return u[i].getElementByKey(e);try{for(var a=o(u[i]),c=a.next();!c.done;c=a.next()){var l=c.value;if(l.key===e)return l.value}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}},this.eraseElementByKey=function(e){var t,r,c=n(e)&h-1;if(u[c]){var f=u[c].size();if(u[c]instanceof s.default)u[c].eraseElementByKey(e),u[c].size()<=a.untreeifyThreshold&&(u[c]=new i.default(u[c]));else{var p=-1;try{for(var d=o(u[c]),m=d.next();!m.done;m=d.next()){var g=m.value;if(++p,g.key===e){u[c].eraseElementByPos(p);break}}}catch(e){t={error:e}}finally{try{m&&!m.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}}var y=u[c].size();l+=y-f}},this.find=function(e){var t,r,i=n(e)&h-1;if(!u[i])return!1;if(u[i]instanceof s.default)return u[i].find(e);try{for(var a=o(u[i]),c=a.next();!c.done;c=a.next())if(c.value.key===e)return!0}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return!1},this[Symbol.iterator]=function(){return function(){var e,t,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:e=0,r.label=1;case 1:if(!(e<h))return[3,10];for(;e<h&&!u[e];)++e;if(e>=h)return[3,10];r.label=2;case 2:r.trys.push([2,7,8,9]),s=void 0,t=o(u[e]),n=t.next(),r.label=3;case 3:return n.done?[3,6]:[4,n.value];case 4:r.sent(),r.label=5;case 5:return n=t.next(),[3,3];case 6:return[3,9];case 7:return i=r.sent(),s={error:i},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){var t=e.key,n=e.value;return c.setElement(t,n)})),Object.freeze(this)}a.initSize=16,a.maxSize=1<<30,a.sigma=.75,a.treeifyThreshold=8,a.untreeifyThreshold=6,a.minTreeifySize=64,Object.freeze(a),n.default=a},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../Set/Set"),s=e("../LinkList/LinkList");function a(e,t,n){var c=this;if(void 0===e&&(e=[]),void 0===t&&(t=a.initSize),n=n||function(e){var t=0,n="";if("number"==typeof e)t=((t=Math.floor(e))<<5)-t,t&=t;else{n="string"!=typeof e?JSON.stringify(e):e;for(var r=0;r<n.length;r++)t=(t<<5)-t+n.charCodeAt(r),t&=t}return t^=t>>>16},0!=(t&t-1))throw new Error("initBucketNum must be 2 to the power of n");var l=0,u=[],h=Math.max(a.initSize,Math.min(a.maxSize,t));this.size=function(){return l},this.empty=function(){return 0===l},this.clear=function(){l=0,h=t,u=[]},this.forEach=function(e){var t=0;u.forEach((function(n){n.forEach((function(n){e(n,t++)}))}))};var f=function(e){if(!(e>=a.maxSize)){h=2*e;var t=[];u.forEach((function(r,o){if(!r.empty()){if(r instanceof s.default&&1===r.size()){var c=r.front();if(void 0===c)throw new Error("unknown error");t[n(c)&h-1]=new s.default([c])}else if(r instanceof i.default){var l=new s.default,f=new s.default;r.forEach((function(t){0==(n(t)&e)?l.pushBack(t):f.pushBack(t)})),l.size()>a.untreeifyThreshold?t[o]=new i.default(l):l.size()&&(t[o]=l),f.size()>a.untreeifyThreshold?t[o+e]=new i.default(f):f.size()&&(t[o+e]=f)}else{var p=new s.default,d=new s.default;r.forEach((function(t){0==(n(t)&e)?p.pushBack(t):d.pushBack(t)})),p.size()&&(t[o]=p),d.size()&&(t[o+e]=d)}u[o].clear()}})),u=t}};this.insert=function(e){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var t=n(e)&h-1;if(u[t]){var r=u[t].size();if(u[t]instanceof s.default){if(u[t].find(e))return;u[t].pushBack(e),u[t].size()>=a.treeifyThreshold&&(u[t]=new i.default(u[t]))}else u[t].insert(e);var o=u[t].size();l+=o-r}else u[t]=new s.default([e]),++l;l>h*a.sigma&&f.call(this,h)},this.eraseElementByValue=function(e){var t=n(e)&h-1;if(u[t]){var r=u[t].size();u[t].eraseElementByValue(e),u[t]instanceof i.default&&u[t].size()<=a.untreeifyThreshold&&(u[t]=new s.default(u[t]));var o=u[t].size();l+=o-r}},this.find=function(e){var t=n(e)&h-1;return!!u[t]&&u[t].find(e)},this[Symbol.iterator]=function(){return function(){var e,t,n,i,s,a;return r(this,(function(r){switch(r.label){case 0:e=0,r.label=1;case 1:if(!(e<h))return[3,10];for(;e<h&&!u[e];)++e;if(e>=h)return[3,10];r.label=2;case 2:r.trys.push([2,7,8,9]),s=void 0,t=o(u[e]),n=t.next(),r.label=3;case 3:return n.done?[3,6]:[4,n.value];case 4:r.sent(),r.label=5;case 5:return n=t.next(),[3,3];case 6:return[3,9];case 7:return i=r.sent(),s={error:i},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return++e,[3,1];case 10:return[2]}}))}()},e.forEach((function(e){return c.insert(e)})),Object.freeze(this)}a.initSize=16,a.maxSize=1<<30,a.sigma=.75,a.treeifyThreshold=8,a.untreeifyThreshold=6,a.minTreeifySize=64,Object.freeze(a),n.default=a},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}};Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=e}return e}();function i(e){var t=this;void 0===e&&(e=[]);var n=0,i=void 0,s=void 0;this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){i=s=void 0,n=0},this.front=function(){return null==i?void 0:i.value},this.back=function(){return null==s?void 0:s.value},this.forEach=function(e){for(var t=i,n=0;t;){if(void 0===t.value)throw new Error("unknown error");e(t.value,n++),t=t.next}},this.getElementByPos=function(e){if(e<0||e>=n)throw new Error("pos must more then 0 and less then the list length");for(var t=i;e--&&t;)t=t.next;if(!t||void 0===t.value)throw new Error("unknown error");return t.value},this.eraseElementByPos=function(e){if(e<0||e>=n)throw new Error("erase pos must more then 0 and less then the list length");if(0===e)this.popFront();else if(e===n-1)this.popBack();else{for(var t=i;e--;){if(!(null==t?void 0:t.next))throw new Error("unknown error");t=t.next}if(!t||!t.pre||!t.next)throw new Error("unknown error");var r=t.pre,o=t.next;o.pre=r,r.next=o,n>0&&--n}},this.eraseElementByValue=function(e){for(;i&&i.value===e;)this.popFront();for(;s&&s.value===e;)this.popBack();if(i)for(var t=i;t;){if(t.value===e){var r=t.pre,o=t.next;o&&(o.pre=r),r&&(r.next=o),n>0&&--n}t=t.next}},this.pushBack=function(e){if(null==e)throw new Error("you can't push null or undefined here");++n;var t=new o(e);s?(s.next=t,t.pre=s,s=t):i=s=t},this.popBack=function(){s&&(n>0&&--n,s&&(i===s?i=s=void 0:(s=s.pre)&&(s.next=void 0)))},this.setElementByPos=function(e,t){if(null==t)throw new Error("you can't set null or undefined here");if(e<0||e>=n)throw new Error("pos must more then 0 and less then the list length");for(var r=i;e--;){if(!r)throw new Error("unknown error");r=r.next}r&&(r.value=t)},this.insert=function(e,t,r){if(void 0===r&&(r=1),null==t)throw new Error("you can't insert null or undefined here");if(e<0||e>n)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(r<0)throw new Error("insert size must more than 0");if(0===e)for(;r--;)this.pushFront(t);else if(e===n)for(;r--;)this.pushBack(t);else{for(var s=i,a=1;a<e;++a){if(!(null==s?void 0:s.next))throw new Error("unknown error");s=null==s?void 0:s.next}if(!s)throw new Error("unknown error");var c=s.next;for(n+=r;r--;)s.next=new o(t),s.next.pre=s,s=s.next;s.next=c,c&&(c.pre=s)}},this.find=function(e){for(var t=i;t;){if(t.value===e)return!0;t=t.next}return!1},this.reverse=function(){for(var e=i,t=s,r=0;e&&t&&2*r<n;){var o=e.value;e.value=t.value,t.value=o,e=e.next,t=t.pre,++r}},this.unique=function(){for(var e=i;e;){for(var t=e;t&&t.next&&t.value===t.next.value;)t=t.next,n>0&&--n;e.next=t.next,e.next&&(e.next.pre=e),e=e.next}},this.sort=function(e){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);var n=i;t.forEach((function(e){n&&(n.value=e,n=n.next)}))},this.pushFront=function(e){if(null==e)throw new Error("you can't push null or undefined here");++n;var t=new o(e);i?(t.next=i,i.pre=t,i=t):i=s=t},this.popFront=function(){i&&(n>0&&--n,i&&(i===s?i=s=void 0:(i=i.next)&&(i.pre=void 0)))},this.merge=function(e){var t=this,r=i;e.forEach((function(e){for(;r&&void 0!==r.value&&r.value<=e;)r=r.next;if(void 0===r)t.pushBack(e),r=s;else if(r===i)t.pushFront(e),r=i;else{++n;var a=r.pre;a&&(a.next=new o(e),a.next.pre=a,a.next.next=r,r&&(r.pre=a.next))}}))},this[Symbol.iterator]=function(){return function(){var e;return r(this,(function(t){switch(t.label){case 0:e=i,t.label=1;case 1:if(void 0===e)return[3,3];if(!e.value)throw new Error("unknown error");return[4,e.value];case 2:return t.sent(),e=e.next,[3,1];case 3:return[2]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)}Object.freeze(i),n.default=i},{}],30:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../Base/TreeNode");function s(e,t){var n=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var s=0,a=new i.default;a.color=i.default.TreeNodeColorType.black,this.size=function(){return s},this.empty=function(){return 0===s},this.clear=function(){s=0,a.key=a.value=void 0,a.leftChild=a.rightChild=a.brother=void 0};var c=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.leftChild?c(e.leftChild):e},l=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.rightChild?l(e.rightChild):e};this.front=function(){if(!this.empty()){var e=c(a);if(void 0===e.key||void 0===e.value)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.back=function(){if(!this.empty()){var e=l(a);if(void 0===e.key||void 0===e.value)throw new Error("unknown error");return{key:e.key,value:e.value}}},this.forEach=function(e){var t,n,r=0;try{for(var i=o(this),s=i.next();!s.done;s=i.next())e(s.value,r++)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,n;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var r=0;try{for(var i=o(this),s=i.next();!s.done;s=i.next()){var a=s.value;if(r===e)return a;++r}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}throw new Error("unknown Error")};var u=function(e,n){if(e&&void 0!==e.key&&void 0!==e.value){var r=t(e.key,n);return 0===r?{key:e.key,value:e.value}:r<0?u(e.rightChild,n):u(e.leftChild,n)||{key:e.key,value:e.value}}};this.lowerBound=function(e){return u(a,e)};var h=function(e,n){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,n)<=0?h(e.rightChild,n):h(e.leftChild,n)||{key:e.key,value:e.value}};this.upperBound=function(e){return h(a,e)};var f=function(e,n){if(e&&void 0!==e.key&&void 0!==e.value){var r=t(e.key,n);return 0===r?{key:e.key,value:e.value}:r>0?f(e.leftChild,n):f(e.rightChild,n)||{key:e.key,value:e.value}}};this.reverseLowerBound=function(e){return f(a,e)};var p=function(e,n){if(e&&void 0!==e.key&&void 0!==e.value)return t(e.key,n)>=0?p(e.leftChild,n):p(e.rightChild,n)||{key:e.key,value:e.value}};this.reverseUpperBound=function(e){return p(a,e)};var d=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(e.color!==i.default.TreeNodeColorType.red){var n=e.brother;if(!n)throw new Error("unknown error");if(e===t.leftChild)if(n.color===i.default.TreeNodeColorType.red){n.color=i.default.TreeNodeColorType.black,t.color=i.default.TreeNodeColorType.red;var r=t.rotateLeft();a===t&&(a=r),d(e)}else n.color===i.default.TreeNodeColorType.black&&(n.rightChild&&n.rightChild.color===i.default.TreeNodeColorType.red?(n.color=t.color,t.color=i.default.TreeNodeColorType.black,n.rightChild&&(n.rightChild.color=i.default.TreeNodeColorType.black),r=t.rotateLeft(),a===t&&(a=r),e.color=i.default.TreeNodeColorType.black):n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||!n.leftChild||n.leftChild.color!==i.default.TreeNodeColorType.red?n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||(n.color=i.default.TreeNodeColorType.red,d(t)):(n.color=i.default.TreeNodeColorType.red,n.leftChild&&(n.leftChild.color=i.default.TreeNodeColorType.black),r=n.rotateRight(),a===n&&(a=r),d(e)));else e===t.rightChild&&(n.color===i.default.TreeNodeColorType.red?(n.color=i.default.TreeNodeColorType.black,t.color=i.default.TreeNodeColorType.red,r=t.rotateRight(),a===t&&(a=r),d(e)):n.color===i.default.TreeNodeColorType.black&&(n.leftChild&&n.leftChild.color===i.default.TreeNodeColorType.red?(n.color=t.color,t.color=i.default.TreeNodeColorType.black,n.leftChild&&(n.leftChild.color=i.default.TreeNodeColorType.black),r=t.rotateRight(),a===t&&(a=r),e.color=i.default.TreeNodeColorType.black):n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||!n.rightChild||n.rightChild.color!==i.default.TreeNodeColorType.red?n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||(n.color=i.default.TreeNodeColorType.red,d(t)):(n.color=i.default.TreeNodeColorType.red,n.rightChild&&(n.rightChild.color=i.default.TreeNodeColorType.black),r=n.rotateLeft(),a===n&&(a=r),d(e))))}else e.color=i.default.TreeNodeColorType.black},m=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=c(t.rightChild);var n=e.key;e.key=t.key,t.key=n;var r=e.value;e.value=t.value,t.value=r,e=t}t.leftChild&&(t=l(t.leftChild),n=e.key,e.key=t.key,t.key=n,r=e.value,e.value=t.value,t.value=r,e=t)}d(t),t&&t.remove(),--s,a.color=i.default.TreeNodeColorType.black},g=function(e,t){return!(!e||void 0===e.key)&&(!!g(e.leftChild,t)||!!t(e)||g(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=s)throw new Error("pos must more than 0 and less than set's size");var t=0;g(a,(function(n){return e===t?(m(n),!0):(++t,!1)}))},this.eraseElementByKey=function(e){if(!this.empty()){var n=b(a,e);void 0!==n&&void 0!==n.key&&0===t(n.key,e)&&m(n)}};var y=function(e,n){if(!e||void 0===e.key)throw new Error("unknown error");var r=t(n,e.key);return r<0?e.leftChild?y(e.leftChild,n):(e.leftChild=new i.default,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):r>0?e.rightChild?y(e.rightChild,n):(e.rightChild=new i.default,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},v=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(t.color!==i.default.TreeNodeColorType.black&&t.color===i.default.TreeNodeColorType.red){var n=t.brother,r=t.parent;if(!r)throw new Error("unknown error");if(n&&n.color===i.default.TreeNodeColorType.red)n.color=t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red,v(r);else if(!n||n.color===i.default.TreeNodeColorType.black)if(t===r.leftChild)if(e===t.leftChild){t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red;var o=r.rotateRight();r===a&&(a=o)}else e===t.rightChild&&(o=t.rotateLeft(),r===a&&(a=o),v(t));else t===r.rightChild&&(e===t.leftChild?(o=t.rotateRight(),r===a&&(a=o),v(t)):e===t.rightChild&&(t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red,o=r.rotateLeft(),r===a&&(a=o)))}};this.setElement=function(e,n){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(null!=n){if(this.empty())return++s,a.key=e,a.value=n,void(a.color=i.default.TreeNodeColorType.black);var r=y(a,e);void 0===r.key||0!==t(r.key,e)?(++s,r.key=e,r.value=n,v(r),a.color=i.default.TreeNodeColorType.black):r.value=n}else this.eraseElementByKey(e)};var b=function(e,n){if(e&&void 0!==e.key){var r=t(n,e.key);return r<0?b(e.leftChild,n):r>0?b(e.rightChild,n):e}};this.find=function(e){return!!b(a,e)},this.getElementByKey=function(e){var t=b(a,e);if(void 0===(null==t?void 0:t.key)||void 0===(null==t?void 0:t.value))throw new Error("unknown error");return t.value},this.union=function(e){var t=this;e.forEach((function(e){var n=e.key,r=e.value;return t.setElement(n,r)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(a)};var w=function(e){return r(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key&&void 0!==e.value?[5,o(w(e.leftChild))]:[2];case 1:return t.sent(),[4,{key:e.key,value:e.value}];case 2:return t.sent(),[5,o(w(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return w(a)},e.forEach((function(e){var t=e.key,r=e.value;return n.setElement(t,r)})),Object.freeze(this)}Object.freeze(s),n.default=s},{"../Base/TreeNode":25}],31:[function(e,t,n){function r(e,t){void 0===e&&(e=[]),t=t||function(e,t){return e>t?-1:e<t?1:0};var n=[];e.forEach((function(e){return n.push(e)}));var r=n.length,o=function(e,t){if(e<0||e>=r)throw new Error("unknown error");if(t<0||t>=r)throw new Error("unknown error");var o=n[e];n[e]=n[t],n[t]=o},i=function(e){if(e<0||e>=r)throw new Error("unknown error");var i=2*e+1,s=2*e+2;i<r&&t(n[e],n[i])>0&&o(e,i),s<r&&t(n[e],n[s])>0&&o(e,s)};!function(){for(var e=Math.floor((r-1)/2);e>=0;--e)for(var i=e,s=2*i+1;s<r;){var a=s+1,c=s;if(a<r&&t(n[s],n[a])>0&&(c=a),t(n[i],n[c])<=0)break;o(i,c),s=2*(i=c)+1}}(),this.size=function(){return r},this.empty=function(){return 0===r},this.clear=function(){r=0,n.length=0},this.push=function(e){if(n.push(e),1!=++r)for(var o=r-1;o>0;){var s=Math.floor((o-1)/2);if(t(n[s],e)<=0)break;i(s),o=s}},this.pop=function(){if(!this.empty())if(1!==this.size()){var e=n[r-1];--r;for(var o=0;o<this.size();){var i=2*o+1,s=2*o+2;if(i>=this.size())break;var a=i;if(s<this.size()&&t(n[i],n[s])>0&&(a=s),t(n[a],e)>=0)break;n[o]=n[a],o=a}n[o]=e}else--r},this.top=function(){return n[0]},Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0}),Object.freeze(r),n.default=r},{}],32:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r=e("../LinkList/LinkList");function o(e){void 0===e&&(e=[]);var t=new r.default(e);this.size=function(){return t.size()},this.empty=function(){return t.empty()},this.clear=function(){t.clear()},this.push=function(e){t.pushBack(e)},this.pop=function(){t.popFront()},this.front=function(){return t.front()},Object.freeze(this)}Object.freeze(o),n.default=o},{"../LinkList/LinkList":29}],33:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(n,"__esModule",{value:!0});var i=e("../Base/TreeNode");function s(e,t){var n=this;void 0===e&&(e=[]),t=t||function(e,t){return e<t?-1:e>t?1:0};var s=0,a=new i.default;a.color=i.default.TreeNodeColorType.black,this.size=function(){return s},this.empty=function(){return 0===s},this.clear=function(){s=0,a.key=void 0,a.leftChild=a.rightChild=a.brother=a.parent=void 0,a.color=i.default.TreeNodeColorType.black};var c=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.leftChild?c(e.leftChild):e},l=function(e){if(!e||void 0===e.key)throw new Error("unknown error");return e.rightChild?l(e.rightChild):e};this.front=function(){if(!this.empty())return c(a).key},this.back=function(){if(!this.empty())return l(a).key},this.forEach=function(e){var t,n,r=0;try{for(var i=o(this),s=i.next();!s.done;s=i.next())e(s.value,r++)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},this.getElementByPos=function(e){var t,n;if(e<0||e>=this.size())throw new Error("pos must more than 0 and less than set's size");var r=0;try{for(var i=o(this),s=i.next();!s.done;s=i.next()){var a=s.value;if(r===e)return a;++r}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}throw new Error("unknown error")};var u=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(e.color!==i.default.TreeNodeColorType.red){var n=e.brother;if(!n)throw new Error("unknown error");if(e===t.leftChild)if(n.color===i.default.TreeNodeColorType.red){n.color=i.default.TreeNodeColorType.black,t.color=i.default.TreeNodeColorType.red;var r=t.rotateLeft();a===t&&(a=r),u(e)}else n.color===i.default.TreeNodeColorType.black&&(n.rightChild&&n.rightChild.color===i.default.TreeNodeColorType.red?(n.color=t.color,t.color=i.default.TreeNodeColorType.black,n.rightChild&&(n.rightChild.color=i.default.TreeNodeColorType.black),r=t.rotateLeft(),a===t&&(a=r),e.color=i.default.TreeNodeColorType.black):n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||!n.leftChild||n.leftChild.color!==i.default.TreeNodeColorType.red?n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||(n.color=i.default.TreeNodeColorType.red,u(t)):(n.color=i.default.TreeNodeColorType.red,n.leftChild&&(n.leftChild.color=i.default.TreeNodeColorType.black),r=n.rotateRight(),a===n&&(a=r),u(e)));else e===t.rightChild&&(n.color===i.default.TreeNodeColorType.red?(n.color=i.default.TreeNodeColorType.black,t.color=i.default.TreeNodeColorType.red,r=t.rotateRight(),a===t&&(a=r),u(e)):n.color===i.default.TreeNodeColorType.black&&(n.leftChild&&n.leftChild.color===i.default.TreeNodeColorType.red?(n.color=t.color,t.color=i.default.TreeNodeColorType.black,n.leftChild&&(n.leftChild.color=i.default.TreeNodeColorType.black),r=t.rotateRight(),a===t&&(a=r),e.color=i.default.TreeNodeColorType.black):n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||!n.rightChild||n.rightChild.color!==i.default.TreeNodeColorType.red?n.leftChild&&n.leftChild.color!==i.default.TreeNodeColorType.black||n.rightChild&&n.rightChild.color!==i.default.TreeNodeColorType.black||(n.color=i.default.TreeNodeColorType.red,u(t)):(n.color=i.default.TreeNodeColorType.red,n.rightChild&&(n.rightChild.color=i.default.TreeNodeColorType.black),r=n.rotateLeft(),a===n&&(a=r),u(e))))}else e.color=i.default.TreeNodeColorType.black},h=function(e){for(var t=e;t.leftChild||t.rightChild;){if(t.rightChild){t=c(t.rightChild);var n=e.key;e.key=t.key,t.key=n,e=t}t.leftChild&&(t=l(t.leftChild),n=e.key,e.key=t.key,t.key=n,e=t)}u(t),t&&t.remove(),--s,a.color=i.default.TreeNodeColorType.black},f=function(e,t){return!(!e||void 0===e.key)&&(!!f(e.leftChild,t)||!!t(e)||f(e.rightChild,t))};this.eraseElementByPos=function(e){if(e<0||e>=s)throw new Error("pos must more than 0 and less than set's size");var t=0;f(a,(function(n){return e===t?(h(n),!0):(++t,!1)}))},this.eraseElementByValue=function(e){if(!this.empty()){var n=m(a,e);void 0!==n&&void 0!==n.key&&0===t(n.key,e)&&h(n)}};var p=function(e,n){if(!e||void 0===e.key)throw new Error("unknown error");var r=t(n,e.key);return r<0?e.leftChild?p(e.leftChild,n):(e.leftChild=new i.default,e.leftChild.parent=e,e.leftChild.brother=e.rightChild,e.rightChild&&(e.rightChild.brother=e.leftChild),e.leftChild):r>0?e.rightChild?p(e.rightChild,n):(e.rightChild=new i.default,e.rightChild.parent=e,e.rightChild.brother=e.leftChild,e.leftChild&&(e.leftChild.brother=e.rightChild),e.rightChild):e},d=function(e){var t=e.parent;if(!t){if(e===a)return;throw new Error("unknown error")}if(t.color!==i.default.TreeNodeColorType.black&&t.color===i.default.TreeNodeColorType.red){var n=t.brother,r=t.parent;if(!r)throw new Error("unknown error");if(n&&n.color===i.default.TreeNodeColorType.red)n.color=t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red,d(r);else if(!n||n.color===i.default.TreeNodeColorType.black)if(t===r.leftChild)if(e===t.leftChild){t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red;var o=r.rotateRight();r===a&&(a=o)}else e===t.rightChild&&(o=t.rotateLeft(),r===a&&(a=o),d(t));else t===r.rightChild&&(e===t.leftChild?(o=t.rotateRight(),r===a&&(a=o),d(t)):e===t.rightChild&&(t.color=i.default.TreeNodeColorType.black,r.color=i.default.TreeNodeColorType.red,o=r.rotateLeft(),r===a&&(a=o)))}};this.insert=function(e){if(null==e)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty())return++s,a.key=e,void(a.color=i.default.TreeNodeColorType.black);var n=p(a,e);void 0!==n.key&&0===t(n.key,e)||(++s,n.key=e,d(n),a.color=i.default.TreeNodeColorType.black)};var m=function(e,n){if(e&&void 0!==e.key){var r=t(n,e.key);return r<0?m(e.leftChild,n):r>0?m(e.rightChild,n):e}};this.find=function(e){var n=m(a,e);return void 0!==n&&void 0!==n.key&&0===t(n.key,e)};var g=function(e,n){if(e&&void 0!==e.key){var r=t(e.key,n);if(0===r)return e.key;if(r<0)return g(e.rightChild,n);var o=g(e.leftChild,n);return void 0!==o?o:e.key}};this.lowerBound=function(e){return g(a,e)};var y=function(e,n){if(e&&void 0!==e.key){if(t(e.key,n)<=0)return y(e.rightChild,n);var r=y(e.leftChild,n);return void 0!==r?r:e.key}};this.upperBound=function(e){return y(a,e)};var v=function(e,n){if(e&&void 0!==e.key){var r=t(e.key,n);if(0===r)return e.key;if(r>0)return v(e.leftChild,n);var o=v(e.rightChild,n);return void 0!==o?o:e.key}};this.reverseLowerBound=function(e){return v(a,e)};var b=function(e,n){if(e&&void 0!==e.key){if(t(e.key,n)>=0)return b(e.leftChild,n);var r=b(e.rightChild,n);return void 0!==r?r:e.key}};this.reverseUpperBound=function(e){return b(a,e)},this.union=function(e){var t=this;e.forEach((function(e){return t.insert(e)}))},this.getHeight=function(){if(this.empty())return 0;var e=function(t){return t?Math.max(e(t.leftChild),e(t.rightChild))+1:1};return e(a)};var w=function(e){return r(this,(function(t){switch(t.label){case 0:return e&&void 0!==e.key?[5,o(w(e.leftChild))]:[2];case 1:return t.sent(),[4,e.key];case 2:return t.sent(),[5,o(w(e.rightChild))];case 3:return t.sent(),[2]}}))};this[Symbol.iterator]=function(){return w(a)},e.forEach((function(e){return n.insert(e)})),Object.freeze(this)}Object.freeze(s),n.default=s},{"../Base/TreeNode":25}],34:[function(e,t,n){function r(e){var t=this;void 0===e&&(e=[]);var n=0,r=[];this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,r.length=0},this.push=function(e){r.push(e),++n},this.pop=function(){r.pop(),n>0&&--n},this.top=function(){return r[n-1]},e.forEach((function(e){return t.push(e)})),Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0}),Object.freeze(r),n.default=r},{}],35:[function(e,t,n){var r=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return c([e,t])}}function c(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function a(e){var t=this;void 0===e&&(e=[]);var n=0,a=[];this.size=function(){return n},this.empty=function(){return 0===n},this.clear=function(){n=0,a.length=0},this.front=function(){if(!this.empty())return a[0]},this.back=function(){if(!this.empty())return a[n-1]},this.forEach=function(e){a.forEach(e)},this.getElementByPos=function(e){if(e<0||e>=n)throw new Error("pos must more than 0 and less than vector's size");return a[e]},this.eraseElementByPos=function(e){if(e<0||e>=n)throw new Error("pos must more than 0 and less than vector's size");for(var t=e;t<n-1;++t)a[t]=a[t+1];this.popBack()},this.eraseElementByValue=function(e){var t=[];this.forEach((function(n){n!==e&&t.push(n)})),t.forEach((function(e,t){a[t]=e}));for(var r=t.length;n>r;)this.popBack()},this.pushBack=function(e){a.push(e),++n},this.popBack=function(){a.pop(),n>0&&--n},this.setElementByPos=function(e,t){if(e<0||e>=n)throw new Error("pos must more than 0 and less than vector's size");a[e]=t},this.insert=function(e,t,r){if(void 0===r&&(r=1),e<0||e>n)throw new Error("pos must more than 0 and less than or equal to vector's size");a.splice.apply(a,i([e,0],o(new Array(r).fill(t)),!1)),n+=r},this.find=function(e){return a.includes(e)},this.reverse=function(){a.reverse()},this.unique=function(){var e,t=[];this.forEach((function(n,r){0!==r&&n===e||(t.push(n),e=n)})),t.forEach((function(e,t){a[t]=e}));for(var r=t.length;n>r;)this.popBack()},this.sort=function(e){a.sort(e)},this[Symbol.iterator]=function(){return function(){return r(this,(function(e){switch(e.label){case 0:return[5,s(a)];case 1:return[2,e.sent()]}}))}()},e.forEach((function(e){return t.pushBack(e)})),Object.freeze(this)}Object.defineProperty(n,"__esModule",{value:!0}),Object.freeze(a),n.default=a},{}],36:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.HashMap=n.HashSet=n.Map=n.Set=n.PriorityQueue=n.Deque=n.LinkList=n.Queue=n.Stack=n.Vector=void 0;var r=e("./Vector/Vector");n.Vector=r.default;var o=e("./Stack/Stack");n.Stack=o.default;var i=e("./Queue/Queue");n.Queue=i.default;var s=e("./LinkList/LinkList");n.LinkList=s.default;var a=e("./Deque/Deque");n.Deque=a.default;var c=e("./PriorityQueue/PriorityQueue");n.PriorityQueue=c.default;var l=e("./Set/Set");n.Set=l.default;var u=e("./Map/Map");n.Map=u.default;var h=e("./HashSet/HashSet");n.HashSet=h.default;var f=e("./HashMap/HashMap");n.HashMap=f.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(e,t,n){const r=e("yallist"),o=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1;class m{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||d;if(this[s]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[l]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,v(this)}get max(){return this[o]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,v(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[s]&&(this[s]=e,this[i]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[i]+=e.length}))),v(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let n=this[h].tail;null!==n;){const r=n.prev;C(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[h].head;null!==n;){const r=n.next;C(this,e,n,t),n=r}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[l]&&this[h]&&this[h].length&&this[h].forEach((e=>this[l](e.key,e.value))),this[f]=new Map,this[h]=new r,this[i]=0}dump(){return this[h].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,n){if((n=n||this[c])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[s](t,e);if(this[f].has(e)){if(a>this[o])return b(this,this[f].get(e)),!1;const s=this[f].get(e).value;return this[l]&&(this[u]||this[l](e,s.value)),s.now=r,s.maxAge=n,s.value=t,this[i]+=a-s.length,s.length=a,this.get(e),v(this),!0}const p=new w(e,t,a,r,n);return p.length>this[o]?(this[l]&&this[l](e,t),!1):(this[i]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),v(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach(((e,t)=>g(this,t,!1)))}}const g=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[a])return}else n&&(e[p]&&(r.value.now=Date.now()),e[h].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[c]&&n>e[c]},v=e=>{if(e[i]>e[o])for(let t=e[h].tail;e[i]>e[o]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[l]&&e[l](n.key,n.value),e[i]-=n.length,e[f].delete(n.key),e[h].removeNode(t)}};class w{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const C=(e,t,n,r)=>{let o=n.value;y(e,o)&&(b(e,n),e[a]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};t.exports=m},{yallist:83}],38:[function(e,t,n){(function(e){(function(){const n=t.exports;n.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},n.codes={};for(const e in n.types){const t=n.types[e];n.codes[t]=e}n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=e.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=e.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=e.from([n.codes.connect<<n.CMD_SHIFT]),n.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},n.propertiesCodes={};for(const e in n.properties){const t=n.properties[e];n.propertiesCodes[t]=e}function r(t){return[0,1,2].map((r=>[0,1].map((o=>[0,1].map((i=>{const s=e.alloc(1);return s.writeUInt8(n.codes[t]<<n.CMD_SHIFT|(o?n.DUP_MASK:0)|r<<n.QOS_SHIFT|i,0,!0),s}))))))}n.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},n.PUBLISH_HEADER=r("publish"),n.SUBSCRIBE_HEADER=r("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=r("unsubscribe"),n.ACKS={unsuback:r("unsuback"),puback:r("puback"),pubcomp:r("pubcomp"),pubrel:r("pubrel"),pubrec:r("pubrec")},n.SUBACK_HEADER=e.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=e.from([3]),n.VERSION4=e.from([4]),n.VERSION5=e.from([5]),n.VERSION131=e.from([131]),n.VERSION132=e.from([132]),n.QOS=[0,1,2].map((t=>e.from([t]))),n.EMPTY={pingreq:e.from([n.codes.pingreq<<4,0]),pingresp:e.from([n.codes.pingresp<<4,0]),disconnect:e.from([n.codes.disconnect<<4,0])}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],39:[function(e,t,n){(function(n){(function(){const r=e("./writeToStream"),o=e("events");function i(e,t){const n=new s;return r(e,n,t),n.concat()}class s extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let o,i=0;for(o=0;o<r.length&&void 0!==r[o];o++)"string"!=typeof r[o]?t[o]=r[o].length:t[o]=n.byteLength(r[o]),e+=t[o];const s=n.allocUnsafe(e);for(o=0;o<r.length&&void 0!==r[o];o++)"string"!=typeof r[o]?(r[o].copy(s,i),i+=t[o]):(s.write(r[o],i),i+=t[o]);return s}}t.exports=i}).call(this)}).call(this,e("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(e,t,n){n.parser=e("./parser").parser,n.generate=e("./generate"),n.writeToStream=e("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(e,t,n){(function(e){(function(){const n=65536,r={},o=e.isBuffer(e.from([1,2]).subarray(0,1));function i(t){const n=e.allocUnsafe(2);return n.writeUInt8(t>>8,0),n.writeUInt8(255&t,1),n}function s(){for(let e=0;e<n;e++)r[e]=i(e)}function a(t){const n=4;let r=0,i=0;const s=e.allocUnsafe(n);do{r=t%128|0,(t=t/128|0)>0&&(r|=128),s.writeUInt8(r,i++)}while(t>0&&i<n);return t>0&&(i=0),o?s.subarray(0,i):s.slice(0,i)}function c(t){const n=e.allocUnsafe(4);return n.writeUInt32BE(t,0),n}t.exports={cache:r,generateCache:s,generateNumber:i,genBufVariableByteInt:a,generate4ByteBuffer:c}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],42:[function(e,t,n){class r{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}t.exports=r},{}],43:[function(e,t,n){const r=e("bl"),o=e("events"),i=e("./packet"),s=e("./constants"),a=e("debug")("mqtt-packet:parser");class c extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof c?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new c).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0);return this.packet.cmd=s.types[e>>s.CMD_SHIFT],this.packet.retain=0!=(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.dup=0!=(e&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,n,r;a("_parseConnect");const o={},i=this.packet,c=this._parseString();if(null===c)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==c&&"MQIsdp"!==c)return this._emitError(new Error("Invalid protocolId"));if(i.protocolId=c,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(i.protocolVersion=this._list.readUInt8(this._pos),i.protocolVersion>=128&&(i.bridgeMode=!0,i.protocolVersion=i.protocolVersion-128),3!==i.protocolVersion&&4!==i.protocolVersion&&5!==i.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK,o.will&&(i.will={},i.will.retain=0!=(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),i.will.qos=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT),i.clean=0!=(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,i.keepalive=this._parseNum(),-1===i.keepalive)return this._emitError(new Error("Packet too short"));if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.properties=e)}const l=this._parseString();if(null===l)return this._emitError(new Error("Packet too short"));if(i.clientId=l,a("_parseConnect: packet.clientId: %s",i.clientId),o.will){if(5===i.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(i.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(i.will.topic=e,a("_parseConnect: packet.will.topic: %s",i.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));i.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",i.will.payload)}if(o.username){if(r=this._parseString(),null===r)return this._emitError(new Error("Cannot parse username"));i.username=r,a("_parseConnect: packet.username: %s",i.username)}if(o.password){if(n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse password"));i.password=n}return this.settings=i,a("_parseConnect: complete"),i}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,n,r,o,i,c,l;if(1!==e.qos)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));n=this._parseByte(),r=n&s.SUBSCRIBE_OPTIONS_QOS_MASK,c=0!=(n>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),i=0!=(n>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),o=n>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,l={topic:t,qos:r},5===this.settings.protocolVersion?(l.nl=c,l.rap=i,l.rh=o):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",l),e.subscriptions.push(l)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(e.length>2?(e.reasonCode=this._parseByte(),a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),n=t+this._pos;if(-1===t||n>this._list.length||n>this.packet.length)return null;const r=this._list.toString("utf8",this._pos,n);return this._pos+=t,a("_parseString: result: %s",r),r}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const n=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");const t=4;let n,r=0,o=1,i=0,c=!1;const l=this._pos?this._pos:0;for(;r<t&&l+r<this._list.length;){if(n=this._list.readUInt8(l+r++),i+=o*(n&s.VARBYTEINT_MASK),o*=128,0==(n&s.VARBYTEINT_FIN_MASK)){c=!0;break}if(this._list.length<=r)break}return!c&&r===t&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),c=!!c&&(e?{bytes:r,value:i}:i),a("_parseVarByteNum: result: %o",c),c}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,n={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"!==t)n[t]?(Array.isArray(n[t])||(n[t]=[n[t]]),n[t].push(this._parseByType(s.propertiesTypes[t]))):n[t]=this._parseByType(s.propertiesTypes[t]);else{n[t]||(n[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(n[t][e.name])if(Array.isArray(n[t][e.name]))n[t][e.name].push(e.value);else{const r=n[t][e.name];n[t][e.name]=[r],n[t][e.name].push(e.value)}else n[t][e.name]=e.value}}return n}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),a("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){a("_emitError"),this.error=e,this.emit("error",e)}}t.exports=c},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(e,t,n){(function(n){(function(){const r=e("./constants"),o=n.allocUnsafe(0),i=n.from([0]),s=e("./numbers"),a=e("process-nextick-args").nextTick,c=e("debug")("mqtt-packet:writeToStream"),l=s.cache,u=s.generateNumber,h=s.generateCache,f=s.genBufVariableByteInt,p=s.generate4ByteBuffer;let d=B,m=!0;function g(e,t,n){switch(c("generate called"),t.cork&&(t.cork(),a(y,t)),m&&(m=!1,h()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return v(e,t);case"connack":return b(e,t,n);case"publish":return w(e,t,n);case"puback":case"pubrec":case"pubrel":case"pubcomp":return C(e,t,n);case"subscribe":return _(e,t,n);case"suback":return k(e,t,n);case"unsubscribe":return S(e,t,n);case"unsuback":return E(e,t,n);case"pingreq":case"pingresp":return A(e,t);case"disconnect":return T(e,t,n);case"auth":return x(e,t,n);default:return t.emit("error",new Error("Unknown command")),!1}}function y(e){e.uncork()}function v(e,t,o){const i=e||{},s=i.protocolId||"MQTT";let a=i.protocolVersion||4;const c=i.will;let l=i.clean;const u=i.keepalive||0,h=i.clientId||"",f=i.username,p=i.password,m=i.properties;void 0===l&&(l=!0);let g=0;if(!s||"string"!=typeof s&&!n.isBuffer(s))return t.emit("error",new Error("Invalid protocolId")),!1;if(g+=s.length+2,3!==a&&4!==a&&5!==a)return t.emit("error",new Error("Invalid protocol version")),!1;if(g+=1,("string"==typeof h||n.isBuffer(h))&&(h||a>=4)&&(h||l))g+=n.byteLength(h)+2;else{if(a<4)return t.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof u||u<0||u>65535||u%1!=0)return t.emit("error",new Error("Invalid keepalive")),!1;if(g+=2,g+=1,5===a){var y=M(t,m);if(!y)return!1;g+=y.length}if(c){if("object"!=typeof c)return t.emit("error",new Error("Invalid will")),!1;if(!c.topic||"string"!=typeof c.topic)return t.emit("error",new Error("Invalid will topic")),!1;if(g+=n.byteLength(c.topic)+2,g+=2,c.payload){if(!(c.payload.length>=0))return t.emit("error",new Error("Invalid will payload")),!1;"string"==typeof c.payload?g+=n.byteLength(c.payload):g+=c.payload.length}var v={};if(5===a){if(!(v=M(t,c.properties)))return!1;g+=v.length}}let b=!1;if(null!=f){if(!z(f))return t.emit("error",new Error("Invalid username")),!1;b=!0,g+=n.byteLength(f)+2}if(null!=p){if(!b)return t.emit("error",new Error("Username is required to use password")),!1;if(!z(p))return t.emit("error",new Error("Invalid password")),!1;g+=q(p)+2}t.write(r.CONNECT_HEADER),O(t,g),j(t,s),i.bridgeMode&&(a+=128),t.write(131===a?r.VERSION131:132===a?r.VERSION132:4===a?r.VERSION4:5===a?r.VERSION5:r.VERSION3);let w=0;return w|=null!=f?r.USERNAME_MASK:0,w|=null!=p?r.PASSWORD_MASK:0,w|=c&&c.retain?r.WILL_RETAIN_MASK:0,w|=c&&c.qos?c.qos<<r.WILL_QOS_SHIFT:0,w|=c?r.WILL_FLAG_MASK:0,w|=l?r.CLEAN_SESSION_MASK:0,t.write(n.from([w])),d(t,u),5===a&&y.write(),j(t,h),c&&(5===a&&v.write(),R(t,c.topic),j(t,c.payload)),null!=f&&j(t,f),null!=p&&j(t,p),!0}function b(e,t,o){const s=o?o.protocolVersion:4,a=e||{},c=5===s?a.reasonCode:a.returnCode,l=a.properties;let u=2;if("number"!=typeof c)return t.emit("error",new Error("Invalid return code")),!1;let h=null;if(5===s){if(h=M(t,l),!h)return!1;u+=h.length}return t.write(r.CONNACK_HEADER),O(t,u),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:i),t.write(n.from([c])),null!=h&&h.write(),!0}function w(e,t,i){c("publish: packet: %o",e);const s=i?i.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||o,p=a.messageId,m=a.properties;let g=0;if("string"==typeof h)g+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.emit("error",new Error("Invalid topic")),!1;g+=h.length+2}if(n.isBuffer(f)?g+=f.length:g+=n.byteLength(f),l&&"number"!=typeof p)return t.emit("error",new Error("Invalid messageId")),!1;l&&(g+=2);let y=null;if(5===s){if(y=M(t,m),!y)return!1;g+=y.length}return t.write(r.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),O(t,g),d(t,q(h)),t.write(h),l>0&&d(t,p),null!=y&&y.write(),c("publish: payload: %o",f),t.write(f)}function C(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.cmd||"puback",c=s.messageId,l=s.dup&&"pubrel"===a?r.DUP_MASK:0;let u=0;const h=s.reasonCode,f=s.properties;let p=5===i?3:2;if("pubrel"===a&&(u=1),"number"!=typeof c)return t.emit("error",new Error("Invalid messageId")),!1;let m=null;if(5===i&&"object"==typeof f){if(m=U(t,f,o,p),!m)return!1;p+=m.length}return t.write(r.ACKS[a][u][l][0]),O(t,p),d(t,c),5===i&&t.write(n.from([h])),null!==m&&m.write(),!0}function _(e,t,o){c("subscribe: packet: ");const i=o?o.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,l=s.messageId,u=s.subscriptions,h=s.properties;let f=0;if("number"!=typeof l)return t.emit("error",new Error("Invalid messageId")),!1;f+=2;let p=null;if(5===i){if(p=M(t,h),!p)return!1;f+=p.length}if("object"!=typeof u||!u.length)return t.emit("error",new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,o=u[e].qos;if("string"!=typeof r)return t.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof o)return t.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===i){if("boolean"!=typeof(u[e].nl||!1))return t.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const n=u[e].rh||0;if("number"!=typeof n||n>2)return t.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}c("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),O(t,f),d(t,l),null!==p&&p.write();let m=!0;for(const e of u){const o=e.topic,s=e.qos,a=+e.nl,c=+e.rap,l=e.rh;let u;R(t,o),u=r.SUBSCRIBE_OPTIONS_QOS[s],5===i&&(u|=a?r.SUBSCRIBE_OPTIONS_NL:0,u|=c?r.SUBSCRIBE_OPTIONS_RAP:0,u|=l?r.SUBSCRIBE_OPTIONS_RH[l]:0),m=t.write(n.from([u]))}return m}function k(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.messageId,c=s.granted,l=s.properties;let u=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof c||!c.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.emit("error",new Error("Invalid qos vector")),!1;u+=1}let h=null;if(5===i){if(h=U(t,l,o,u),!h)return!1;u+=h.length}return t.write(r.SUBACK_HEADER),O(t,u),d(t,a),null!==h&&h.write(),t.write(n.from(c))}function S(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?r.DUP_MASK:0,l=s.unsubscriptions,u=s.properties;let h=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid unsubscriptions")),!1;for(let e=0;e<l.length;e+=1){if("string"!=typeof l[e])return t.emit("error",new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(l[e])+2}let f=null;if(5===i){if(f=M(t,u),!f)return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][c?1:0][0]),O(t,h),d(t,a),null!==f&&f.write();let p=!0;for(let e=0;e<l.length;e++)p=R(t,l[e]);return p}function E(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?r.DUP_MASK:0,l=s.granted,u=s.properties,h=s.cmd,f=0;let p=2;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(5===i){if("object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.emit("error",new Error("Invalid qos vector")),!1;p+=1}}let m=null;if(5===i){if(m=U(t,u,o,p),!m)return!1;p+=m.length}return t.write(r.ACKS[h][f][c][0]),O(t,p),d(t,a),null!==m&&m.write(),5===i&&t.write(n.from(l)),!0}function A(e,t,n){return t.write(r.EMPTY[e.cmd])}function T(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===i?1:0,u=null;if(5===i){if(u=U(t,c,o,l),!u)return!1;l+=u.length}return t.write(n.from([r.codes.disconnect<<4])),O(t,l),5===i&&t.write(n.from([a])),null!==u&&u.write(),!0}function x(e,t,o){const i=o?o.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===i?1:0;5!==i&&t.emit("error",new Error("Invalid mqtt version for auth packet"));const u=U(t,c,o,l);return!!u&&(l+=u.length,t.write(n.from([r.codes.auth<<4])),O(t,l),t.write(n.from([a])),null!==u&&u.write(),!0)}Object.defineProperty(g,"cacheNumbers",{get:()=>d===B,set(e){e?(l&&0!==Object.keys(l).length||(m=!0),d=B):(m=!1,d=F)}});const I={};function O(e,t){if(t>r.VARBYTEINT_MAX)return e.emit("error",new Error(`Invalid variable byte integer: ${t}`)),!1;let n=I[t];return n||(n=f(t),t<16384&&(I[t]=n)),c("writeVarByteInt: writing to stream: %o",n),e.write(n)}function R(e,t){const r=n.byteLength(t);return d(e,r),c("writeString: %s",t),e.write(t,"utf8")}function P(e,t,n){R(e,t),R(e,n)}function B(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",l[t]),e.write(l[t])}function F(e,t){const n=u(t);return c("writeNumberGenerated: %o",n),e.write(n)}function N(e,t){const n=p(t);return c("write4ByteNumber: %o",n),e.write(n)}function j(e,t){"string"==typeof t?R(e,t):t?(d(e,t.length),e.write(t)):d(e,0)}function M(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){D(e,{},0)}};let o=0;function i(t,o){let i=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof o)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=2;break;case"int8":if("number"!=typeof o||o<0||o>255)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=2;break;case"binary":if(o&&null===o)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=1+n.byteLength(o)+2;break;case"int16":if("number"!=typeof o||o<0||o>65535)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=3;break;case"int32":if("number"!=typeof o||o<0||o>4294967295)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=5;break;case"var":if("number"!=typeof o||o<0||o>268435455)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=1+n.byteLength(f(o));break;case"string":if("string"!=typeof o)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=3+n.byteLength(o.toString());break;case"pair":if("object"!=typeof o)return e.emit("error",new Error(`Invalid ${t}: ${o}`)),!1;i+=Object.getOwnPropertyNames(o).reduce(((e,t)=>{const r=o[t];return Array.isArray(r)?e+=r.reduce(((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString())),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(o[t].toString()),e}),0);break;default:return e.emit("error",new Error(`Invalid property ${t}: ${o}`)),!1}return i}if(t)for(const e in t){let n=0,r=0;const s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(r=i(e,s[t]),!r)return!1;n+=r}else{if(r=i(e,s),!r)return!1;n=r}if(!n)return!1;o+=n}return{length:n.byteLength(f(o))+o,write(){D(e,t,o)}}}function U(e,t,n,r){const o=["reasonString","userProperties"],i=n&&n.properties&&n.properties.maximumPacketSize?n.properties.maximumPacketSize:0;let s=M(e,t);if(i)for(;r+s.length>i;){const n=o.shift();if(!n||!t[n])return!1;delete t[n],s=M(e,t)}return s}function L(e,t,o){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+o]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([o]));break;case"binary":e.write(n.from([r.properties[t]])),j(e,o);break;case"int16":e.write(n.from([r.properties[t]])),d(e,o);break;case"int32":e.write(n.from([r.properties[t]])),N(e,o);break;case"var":e.write(n.from([r.properties[t]])),O(e,o);break;case"string":e.write(n.from([r.properties[t]])),R(e,o);break;case"pair":Object.getOwnPropertyNames(o).forEach((i=>{const s=o[i];Array.isArray(s)?s.forEach((o=>{e.write(n.from([r.properties[t]])),P(e,i.toString(),o.toString())})):(e.write(n.from([r.properties[t]])),P(e,i.toString(),s.toString()))}));break;default:return e.emit("error",new Error(`Invalid property ${t} value: ${o}`)),!1}}function D(e,t,n){O(e,n);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&null!==t[n]){const r=t[n];if(Array.isArray(r))for(let t=0;t<r.length;t++)L(e,n,r[t]);else L(e,n,r)}}function q(e){return e?e instanceof n?e.length:n.byteLength(e):0}function z(e){return"string"==typeof e||e instanceof n}t.exports=g}).call(this)}).call(this,e("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(e,t,n){var r=1e3,o=60*r,i=60*o,s=24*i,a=7*s,c=365.25*s;function l(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"weeks":case"week":case"w":return n*a;case"days":case"day":case"d":return n*s;case"hours":case"hour":case"hrs":case"hr":case"h":return n*i;case"minutes":case"minute":case"mins":case"min":case"m":return n*o;case"seconds":case"second":case"secs":case"sec":case"s":return n*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function u(e){var t=Math.abs(e);return t>=s?Math.round(e/s)+"d":t>=i?Math.round(e/i)+"h":t>=o?Math.round(e/o)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}function h(e){var t=Math.abs(e);return t>=s?f(e,t,s,"day"):t>=i?f(e,t,i,"hour"):t>=o?f(e,t,o,"minute"):t>=r?f(e,t,r,"second"):e+" ms"}function f(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return l(e);if("number"===n&&isFinite(e))return t.long?h(e):u(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],46:[function(e,t,n){const r=e("./lib/number-allocator.js");t.exports.NumberAllocator=r},{"./lib/number-allocator.js":47}],47:[function(e,t,n){const r=e("js-sdsl").Set,o=e("debug")("number-allocator:trace"),i=e("debug")("number-allocator:error");function s(e,t){this.low=e,this.high=t}function a(e,t){if(!(this instanceof a))return new a(e,t);this.min=e,this.max=t,this.ss=new r([],((e,t)=>e.compare(t))),o("Create"),this.clear()}s.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},s.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},a.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},a.prototype.alloc=function(){if(0===this.ss.size())return o("alloc():empty"),null;const e=this.ss.front(),t=e.low;return t+1<=e.high?++e.low:this.ss.eraseElementByPos(0),o("alloc():"+t),t},a.prototype.use=function(e){const t=new s(e,e),n=this.ss.lowerBound(t);if(n){if(n.equals(t))return this.ss.eraseElementByValue(n),o("use():"+e),!0;if(n.low>e)return!1;if(n.low===e)return++n.low,o("use():"+e),!0;if(n.high===e)return--n.high,o("use():"+e),!0;const r=n.low;return n.low=e+1,this.ss.insert(new s(r,e-1)),o("use():"+e),!0}return o("use():failed"),!1},a.prototype.free=function(e){if(e<this.min||e>this.max)return void i("free():"+e+" is out of range");const t=new s(e,e),n=this.ss.lowerBound(t);if(n){if(n.low<=e&&e<=n.high)return void i("free():"+e+" has already been vacant");if(n===this.ss.front())e+1===n.low?--n.low:this.ss.insert(t);else{const r=this.ss.reverseLowerBound(t);r.high+1===e?e+1===n.low?(this.ss.eraseElementByValue(r),n.low=r.low):r.high=e:e+1===n.low?n.low=e:this.ss.insert(t)}}else{if(n===this.ss.front())return void this.ss.insert(t);const r=this.ss.reverseLowerBound(t);r.high+1===e?r.high=e:this.ss.insert(t)}o("free():"+e)},a.prototype.clear=function(){o("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){console.log("length:"+this.ss.size());for(const e of this.ss)console.log(e)},t.exports=a},{debug:18,"js-sdsl":36}],48:[function(e,t,n){var r=e("wrappy");function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}t.exports=r(o),t.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},{wrappy:79}],49:[function(e,t,n){(function(e){(function(){function n(t,n,r,o){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,o)}));default:for(i=new Array(a-1),s=0;s<i.length;)i[s++]=arguments[s];return e.nextTick((function(){t.apply(null,i)}))}}void 0===e||!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:n}:t.exports=e}).call(this)}).call(this,e("_process"))},{_process:50}],50:[function(e,t,n){var r,o,i=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===setTimeout)return setTimeout(e,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function l(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(e){r=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var u,h=[],f=!1,p=-1;function d(){f&&u&&(f=!1,u.length?h=u.concat(h):p=-1,h.length&&m())}function m(){if(!f){var e=c(d);f=!0;for(var t=h.length;t;){for(u=h,h=[];++p<t;)u&&u[p].run();p=-1,t=h.length}u=null,f=!1,l(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new g(e,t)),1!==h.length||f||c(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],51:[function(e,t,n){(function(e){(function(){!function(r){var o="object"==typeof n&&n&&!n.nodeType&&n,i="object"==typeof t&&t&&!t.nodeType&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s&&s.self!==s||(r=s);var a,c,l=2147483647,u=36,h=1,f=26,p=38,d=700,m=72,g=128,y="-",v=/^xn--/,b=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=u-h,k=Math.floor,S=String.fromCharCode;function E(e){throw new RangeError(C[e])}function A(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function T(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+A((e=e.replace(w,".")).split("."),t).join(".")}function x(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function I(e){return A(e,(function(e){var t="";return e>65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=S(e)})).join("")}function O(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:u}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function P(e,t,n){var r=0;for(e=n?k(e/d):e>>1,e+=k(e/t);e>_*f>>1;r+=u)e=k(e/_);return k(r+(_+1)*e/(e+p))}function B(e){var t,n,r,o,i,s,a,c,p,d,v=[],b=e.length,w=0,C=g,_=m;for((n=e.lastIndexOf(y))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&E("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<b;){for(i=w,s=1,a=u;o>=b&&E("invalid-input"),((c=O(e.charCodeAt(o++)))>=u||c>k((l-w)/s))&&E("overflow"),w+=c*s,!(c<(p=a<=_?h:a>=_+f?f:a-_));a+=u)s>k(l/(d=u-p))&&E("overflow"),s*=d;_=P(w-i,t=v.length+1,0==i),k(w/t)>l-C&&E("overflow"),C+=k(w/t),w%=t,v.splice(w++,0,C)}return I(v)}function F(e){var t,n,r,o,i,s,a,c,p,d,v,b,w,C,_,A=[];for(b=(e=x(e)).length,t=g,n=0,i=m,s=0;s<b;++s)(v=e[s])<128&&A.push(S(v));for(r=o=A.length,o&&A.push(y);r<b;){for(a=l,s=0;s<b;++s)(v=e[s])>=t&&v<a&&(a=v);for(a-t>k((l-n)/(w=r+1))&&E("overflow"),n+=(a-t)*w,t=a,s=0;s<b;++s)if((v=e[s])<t&&++n>l&&E("overflow"),v==t){for(c=n,p=u;!(c<(d=p<=i?h:p>=i+f?f:p-i));p+=u)_=c-d,C=u-d,A.push(S(R(d+_%C,0))),c=k(_/C);A.push(S(R(c,0))),i=P(n,w,r==o),n=0,++r}++n,++t}return A.join("")}function N(e){return T(e,(function(e){return v.test(e)?B(e.slice(4).toLowerCase()):e}))}function j(e){return T(e,(function(e){return b.test(e)?"xn--"+F(e):e}))}if(a={version:"1.4.1",ucs2:{decode:x,encode:I},decode:B,encode:F,toASCII:j,toUnicode:N},o&&i)if(t.exports==o)i.exports=a;else for(c in a)a.hasOwnProperty(c)&&(o[c]=a[c]);else r.punycode=a}(this)}).call(this)}).call(this,void 0!==de?de:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],52:[function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,i){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;i&&"number"==typeof i.maxKeys&&(c=i.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var u=0;u<l;++u){var h,f,p,d,m=e[u].replace(a,"%20"),g=m.indexOf(n);g>=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),r(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],53:[function(e,t,n){var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?i(s(e),(function(s){var a=encodeURIComponent(r(s))+n;return o(e[s])?i(e[s],(function(e){return a+encodeURIComponent(r(e))})).join(t):a+encodeURIComponent(r(e[s]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],54:[function(e,t,n){n.decode=n.parse=e("./decode"),n.encode=n.stringify=e("./encode")},{"./decode":52,"./encode":53}],55:[function(e,t,n){function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var o={};function i(e,t,n){function i(e,n,r){return"string"==typeof t?t:t(e,n,r)}n||(n=Error);var s=function(e){function t(t,n,r){return e.call(this,i(t,n,r))||this}return r(t,e),t}(n);s.prototype.name=n.name,s.prototype.code=e,o[e]=s}function s(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function a(e,t,n){return e.substr(!n||n<0?0:+n,t.length)===t}function c(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function l(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){var r,o;if("string"==typeof t&&a(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",c(e," argument"))o="The ".concat(e," ").concat(r," ").concat(s(t,"type"));else{var i=l(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(i," ").concat(r," ").concat(s(t,"type"))}return o+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=o},{}],56:[function(e,t,n){(function(n){(function(){var r=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=l;var o=e("./_stream_readable"),i=e("./_stream_writable");e("inherits")(l,o);for(var s=r(i.prototype),a=0;a<s.length;a++){var c=s[a];l.prototype[c]||(l.prototype[c]=i.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),i.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(e,t,n){t.exports=o;var r=e("./_stream_transform");function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}e("inherits")(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":59,inherits:24}],58:[function(e,t,n){(function(n,r){(function(){var o;t.exports=x,x.ReadableState=T,e("events").EventEmitter;var i=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),a=e("buffer").Buffer,c=r.Uint8Array||function(){};function l(e){return a.from(e)}function u(e){return a.isBuffer(e)||e instanceof c}var h,f=e("util");h=f&&f.debuglog?f.debuglog("stream"):function(){};var p,d,m,g=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),v=e("./internal/streams/state").getHighWaterMark,b=e("../errors").codes,w=b.ERR_INVALID_ARG_TYPE,C=b.ERR_STREAM_PUSH_AFTER_EOF,_=b.ERR_METHOD_NOT_IMPLEMENTED,k=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(x,s);var S=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function T(t,n,r){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof o),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",r),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=e("string_decoder/").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function x(t){if(o=o||e("./_stream_duplex"),!(this instanceof x))return new x(t);var n=this instanceof o;this._readableState=new T(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function I(e,t,n,r,o){h("readableAddChunk",t);var i,s=e._readableState;if(null===t)s.reading=!1,N(e,s);else if(o||(i=R(s,t)),i)S(e,i);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=l(t)),r)s.endEmitted?S(e,new k):O(e,s,t,!0);else if(s.ended)S(e,new C);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?O(e,s,t,!1):U(e,s)):O(e,s,t,!1)}else r||(s.reading=!1,U(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function O(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&j(e)),U(e,t)}function R(e,t){var n;return u(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new w("chunk",["string","Buffer","Uint8Array"],t)),n}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=y.destroy,x.prototype._undestroy=y.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=a.from(e,t),t=""),n=!0),I(this,e,t,!1,n)},x.prototype.unshift=function(e){return I(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){p||(p=e("string_decoder/").StringDecoder);var n=new p(t);this._readableState.decoder=n,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,o="";null!==r;)o+=n.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var P=1073741824;function B(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function F(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=B(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function N(e,t){if(h("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,M(e)))}}function j(e){var t=e._readableState;h("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(M,e))}function M(e){var t=e._readableState;h("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,V(e)}function U(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(h("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function D(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,V(e))}}function q(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){h("readable nexttick read 0"),e.read(0)}function $(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(H,e,t))}function H(e,t){h("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),V(e),t.flowing&&!t.reading&&e.read(0)}function V(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function W(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function K(e){var t=e._readableState;h("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(Q,t,e))}function Q(e,t){if(h("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function J(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}x.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?K(this):j(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&K(this),null;var r,o=t.needReadable;return h("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",o=!0),t.ended||t.reading?h("reading or ended",o=!1):o&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=F(n,t))),null===(r=e>0?W(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&K(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(e){S(this,new _("_read()"))},x.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function a(e,t){h("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function c(){h("onend"),e.end()}o.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=D(r);e.on("drain",l);var u=!1;function f(){h("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),u=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}function p(t){h("ondata");var n=e.write(t);h("dest.write",n),!1===n&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==J(o.pipes,e))&&!u&&(h("false write response, pause",o.awaitDrain),o.awaitDrain++),r.pause())}function d(t){h("onerror",t),y(),e.removeListener("error",d),0===i(e,"error")&&S(e,t)}function m(){e.removeListener("finish",g),y()}function g(){h("onfinish"),e.removeListener("close",m),y()}function y(){h("unpipe"),r.unpipe(e)}return r.on("data",p),A(e,"error",d),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=J(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},x.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,h("on readable",o.length,o.reading),o.length?j(this):o.reading||n.nextTick(z,this))),r},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(q,this),r},x.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(q,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!e.readableListening,$(this,e)),e.paused=!1,this},x.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(h("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){h("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!0,e.pause()))})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<E.length;i++)e.on(E[i],this.emit.bind(this,E[i]));return this._read=function(t){h("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=W,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,n){return void 0===m&&(m=e("./internal/streams/from")),m(x,t,n)})}).call(this)}).call(this,e("_process"),void 0!==de?de:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(e,t,n){t.exports=u;var r=e("../errors").codes,o=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function l(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new i);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,n){f(e,t,n)}))}function f(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}e("inherits")(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,n){n(new o("_transform()"))},u.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(e,t,n){(function(n,r){(function(){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){H(t,e)}}var i;t.exports=T,T.WritableState=A;var s={deprecate:e("util-deprecate")},a=e("./internal/streams/stream"),c=e("buffer").Buffer,l=r.Uint8Array||function(){};function u(e){return c.from(e)}function h(e){return c.isBuffer(e)||e instanceof l}var f,p=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,g=m.ERR_INVALID_ARG_TYPE,y=m.ERR_METHOD_NOT_IMPLEMENTED,v=m.ERR_MULTIPLE_CALLBACK,b=m.ERR_STREAM_CANNOT_PIPE,w=m.ERR_STREAM_DESTROYED,C=m.ERR_STREAM_NULL_VALUES,_=m.ERR_STREAM_WRITE_AFTER_END,k=m.ERR_UNKNOWN_ENCODING,S=p.errorOrDestroy;function E(){}function A(t,n,r){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){N(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function T(t){var n=this instanceof(i=i||e("./_stream_duplex"));if(!n&&!f.call(T,this))return new T(t);this._writableState=new A(t,this,n),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function x(e,t){var r=new _;S(e,r),n.nextTick(t,r)}function I(e,t,r,o){var i;return null===r?i=new C:"string"==typeof r||t.objectMode||(i=new g("chunk",["string","Buffer"],r)),!i||(S(e,i),n.nextTick(o,i),!1)}function O(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n)),t}function R(e,t,n,r,o,i){if(!n){var s=O(t,r,o);r!==s&&(n=!0,o="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else P(e,t,!1,a,r,o,i);return c}function P(e,t,n,r,o,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new w("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function B(e,t,r,o,i){--t.pendingcb,r?(n.nextTick(i,o),n.nextTick(z,e,t),e._writableState.errorEmitted=!0,S(e,o)):(i(o),e._writableState.errorEmitted=!0,S(e,o),z(e,t))}function F(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function N(e,t){var r=e._writableState,o=r.sync,i=r.writecb;if("function"!=typeof i)throw new v;if(F(r),t)B(e,r,o,t,i);else{var s=L(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||U(e,r),o?n.nextTick(j,e,r,s,i):j(e,r,s,i)}}function j(e,t,n,r){n||M(e,t),t.pendingcb--,r(),z(e,t)}function M(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function U(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),s=t.corkedRequestsFree;s.entry=n;for(var a=0,c=!0;n;)i[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;i.allBuffers=c,P(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,h=n.callback;if(P(e,t,!1,t.objectMode?1:l.length,l,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function L(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function D(e,t){e._final((function(n){t.pendingcb--,n&&S(e,n),t.prefinished=!0,e.emit("prefinish"),z(e,t)}))}function q(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(D,e,t)))}function z(e,t){var n=L(t);if(n&&(q(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function $(e,t,r){t.ending=!0,z(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function H(e,t,n){var r=e.entry;for(e.entry=null;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}e("inherits")(T,a),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===T&&e&&e._writableState instanceof A}})):f=function(e){return e instanceof this},T.prototype.pipe=function(){S(this,new b)},T.prototype.write=function(e,t,n){var r=this._writableState,o=!1,i=!r.objectMode&&h(e);return i&&!c.isBuffer(e)&&(e=u(e)),"function"==typeof t&&(n=t,t=null),i?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=E),r.ending?x(this,n):(i||I(this,r,e,n))&&(r.pendingcb++,o=R(this,r,i,e,t,n)),o},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||U(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,n){n(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||$(this,r,n),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0!==de?de:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(e,t,n){(function(n){(function(){var r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=e("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[s];if(null!==t){var n=e[f].read();null!==n&&(e[u]=null,e[s]=null,e[a]=null,t(p(n,!1)))}}function m(e){n.nextTick(d,e)}function g(e,t){return function(n,r){e.then((function(){t[l]?n(p(void 0,!0)):t[h](n,r)}),r)}}var y=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(r={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(t,r){n.nextTick((function(){e[c]?r(e[c]):t(p(void 0,!0))}))}));var r,o=this[u];if(o)r=new Promise(g(o,this));else{var i=this[f].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[h])}return this[u]=r,r}},Symbol.asyncIterator,(function(){return this})),o(r,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(p(void 0,!0))}))}))})),r),y),b=function(e){var t,n=Object.create(v,(o(t={},f,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var r=n[f].read();r?(n[u]=null,n[s]=null,n[a]=null,e(p(r,!1))):(n[s]=e,n[a]=t)},writable:!0}),t));return n[u]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[u]=null,n[s]=null,n[a]=null,t(e)),void(n[c]=e)}var r=n[s];null!==r&&(n[u]=null,n[s]=null,n[a]=null,r(p(void 0,!0))),n[l]=!0})),e.on("readable",m.bind(null,n)),n};t.exports=b}).call(this)}).call(this,e("_process"))},{"./end-of-stream":64,_process:50}],62:[function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e}var l=e("buffer").Buffer,u=e("util").inspect,h=u&&u.custom||"inspect";function f(e,t,n){l.prototype.copy.call(e,t,n)}t.exports=function(){function e(){s(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return l.alloc(0);for(var t=l.allocUnsafe(e>>>0),n=this.head,r=0;n;)f(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(i===o.length?r+=o:r+=o.slice(0,e),0==(e-=i)){i===o.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=l.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(i));break}++r}return this.length-=r,t}},{key:h,value:function(e,t){return u(this,o({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:17,util:16}],63:[function(e,t,n){(function(e){(function(){function n(t,n){var i=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(s,this,t)):e.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(o,i):(i._writableState.errorEmitted=!0,e.nextTick(r,i,t)):e.nextTick(r,i,t):n?(e.nextTick(o,i),n(t)):e.nextTick(o,i)})),this)}function r(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(e,t){e.emit("error",t)}function a(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}t.exports={destroy:n,undestroy:i,errorOrDestroy:a}}).call(this)}).call(this,e("_process"))},{_process:50}],64:[function(e,t,n){var r=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function o(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}function i(){}function s(e){return e.setHeader&&"function"==typeof e.abort}function a(e,t,n){if("function"==typeof t)return a(e,null,t);t||(t={}),n=o(n||i);var c=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,u=function(){e.writable||f()},h=e._writableState&&e._writableState.finished,f=function(){l=!1,h=!0,c||n.call(e)},p=e._readableState&&e._readableState.endEmitted,d=function(){c=!1,p=!0,l||n.call(e)},m=function(t){n.call(e,t)},g=function(){var t;return c&&!p?(e._readableState&&e._readableState.ended||(t=new r),n.call(e,t)):l&&!h?(e._writableState&&e._writableState.ended||(t=new r),n.call(e,t)):void 0},y=function(){e.req.on("finish",f)};return s(e)?(e.on("complete",f),e.on("abort",g),e.req?y():e.on("request",y)):l&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",d),e.on("finish",f),!1!==t.error&&e.on("error",m),e.on("close",g),function(){e.removeListener("complete",f),e.removeListener("abort",g),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",d),e.removeListener("error",m),e.removeListener("close",g)}}t.exports=a},{"../../../errors":55}],65:[function(e,t,n){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(e,t,n){var r;function o(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i=e("../../../errors").codes,s=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function l(e){return e.setHeader&&"function"==typeof e.abort}function u(t,n,i,s){s=o(s);var c=!1;t.on("close",(function(){c=!0})),void 0===r&&(r=e("./end-of-stream")),r(t,{readable:n,writable:i},(function(e){if(e)return s(e);c=!0,s()}));var u=!1;return function(e){if(!c&&!u)return u=!0,l(t)?t.abort():"function"==typeof t.destroy?t.destroy():void s(e||new a("pipe"))}}function h(e){e()}function f(e,t){return e.pipe(t)}function p(e){return e.length?"function"!=typeof e[e.length-1]?c:e.pop():c}function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=p(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var i=t.map((function(e,n){var s=n<t.length-1;return u(e,s,n>0,(function(e){r||(r=e),e&&i.forEach(h),s||(i.forEach(h),o(r))}))}));return t.reduce(f)}t.exports=d},{"../../../errors":55,"./end-of-stream":64}],67:[function(e,t,n){var r=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;function o(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}function i(e,t,n,i){var s=o(t,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new r(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}t.exports={getHighWaterMark:i}},{"../../../errors":55}],68:[function(e,t,n){t.exports=e("events").EventEmitter},{events:22}],69:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(e,t,n){function r(e,t,n){var r=this;this._callback=e,this._args=n,this._interval=setInterval(e,t,this._args),this.reschedule=function(e){e||(e=r._interval),r._interval&&clearInterval(r._interval),r._interval=setInterval(r._callback,e,r._args)},this.clear=function(){r._interval&&(clearInterval(r._interval),r._interval=void 0)},this.destroy=function(){r._interval&&clearInterval(r._interval),r._callback=void 0,r._interval=void 0,r._args=void 0}}function o(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var t=0;t<e.length;t++)e[t]=arguments[t+2]}return new r(arguments[0],arguments[1],e)}t.exports=o},{}],71:[function(e,t,n){t.exports=e("./index.js")()},{"./index.js":72}],72:[function(e,t,n){(function(e){(function(){function n(t){return t instanceof e?e.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function r(e){return(e=e||{}).circles?o(e):e.proto?i:r;function t(e,t){for(var r=Object.keys(e),o=new Array(r.length),i=0;i<r.length;i++){var s=r[i],a=e[s];"object"!=typeof a||null===a?o[s]=a:a instanceof Date?o[s]=new Date(a):ArrayBuffer.isView(a)?o[s]=n(a):o[s]=t(a)}return o}function r(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,r);if(e instanceof Map)return new Map(t(Array.from(e),r));if(e instanceof Set)return new Set(t(Array.from(e),r));var o={};for(var i in e)if(!1!==Object.hasOwnProperty.call(e,i)){var s=e[i];"object"!=typeof s||null===s?o[i]=s:s instanceof Date?o[i]=new Date(s):s instanceof Map?o[i]=new Map(t(Array.from(s),r)):s instanceof Set?o[i]=new Set(t(Array.from(s),r)):ArrayBuffer.isView(s)?o[i]=n(s):o[i]=r(s)}return o}function i(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,i);if(e instanceof Map)return new Map(t(Array.from(e),i));if(e instanceof Set)return new Set(t(Array.from(e),i));var r={};for(var o in e){var s=e[o];"object"!=typeof s||null===s?r[o]=s:s instanceof Date?r[o]=new Date(s):s instanceof Map?r[o]=new Map(t(Array.from(s),i)):s instanceof Set?r[o]=new Set(t(Array.from(s),i)):ArrayBuffer.isView(s)?r[o]=n(s):r[o]=i(s)}return r}}function o(e){var t=[],r=[];return e.proto?s:i;function o(e,o){for(var i=Object.keys(e),s=new Array(i.length),a=0;a<i.length;a++){var c=i[a],l=e[c];if("object"!=typeof l||null===l)s[c]=l;else if(l instanceof Date)s[c]=new Date(l);else if(ArrayBuffer.isView(l))s[c]=n(l);else{var u=t.indexOf(l);s[c]=-1!==u?r[u]:o(l)}}return s}function i(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return o(e,i);if(e instanceof Map)return new Map(o(Array.from(e),i));if(e instanceof Set)return new Set(o(Array.from(e),i));var s={};for(var a in t.push(e),r.push(s),e)if(!1!==Object.hasOwnProperty.call(e,a)){var c=e[a];if("object"!=typeof c||null===c)s[a]=c;else if(c instanceof Date)s[a]=new Date(c);else if(c instanceof Map)s[a]=new Map(o(Array.from(c),i));else if(c instanceof Set)s[a]=new Set(o(Array.from(c),i));else if(ArrayBuffer.isView(c))s[a]=n(c);else{var l=t.indexOf(c);s[a]=-1!==l?r[l]:i(c)}}return t.pop(),r.pop(),s}function s(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return o(e,s);if(e instanceof Map)return new Map(o(Array.from(e),s));if(e instanceof Set)return new Set(o(Array.from(e),s));var i={};for(var a in t.push(e),r.push(i),e){var c=e[a];if("object"!=typeof c||null===c)i[a]=c;else if(c instanceof Date)i[a]=new Date(c);else if(c instanceof Map)i[a]=new Map(o(Array.from(c),s));else if(c instanceof Set)i[a]=new Set(o(Array.from(c),s));else if(ArrayBuffer.isView(c))i[a]=n(c);else{var l=t.indexOf(c);i[a]=-1!==l?r[l]:s(c)}}return t.pop(),r.pop(),i}}t.exports=r}).call(this)}).call(this,e("buffer").Buffer)},{buffer:17}],73:[function(e,t,n){
|