(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00ee":function(t,e,r){var n=r("b622"),i=n("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"0366":function(t,e,r){var n=r("1c0b");t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},"06cf":function(t,e,r){var n=r("83ab"),i=r("d1e7"),o=r("5c6c"),s=r("fc6a"),a=r("c04e"),c=r("5135"),u=r("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=n?l:function(t,e){if(t=s(t),e=a(e,!0),u)try{return l(t,e)}catch(r){}if(c(t,e))return o(!i.f.call(t,e),t[e])}},"0cfb":function(t,e,r){var n=r("83ab"),i=r("d039"),o=r("cc12");t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"19aa":function(t,e){t.exports=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},"1be4":function(t,e,r){var n=r("d066");t.exports=n("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,r){var n=r("b622"),i=n("iterator"),o=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){o=!0}};a[i]=function(){return this},Array.from(a,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var n={};n[i]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(c){}return r}},"1cdc":function(t,e,r){var n=r("342f");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(n)},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},2266:function(t,e,r){var n=r("825a"),i=r("e95a"),o=r("50c4"),s=r("0366"),a=r("35a1"),c=r("2a62"),u=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,r){var l,f,h,d,p,v,y,g=r&&r.that,m=!(!r||!r.AS_ENTRIES),b=!(!r||!r.IS_ITERATOR),_=!(!r||!r.INTERRUPTED),w=s(e,g,1+m+_),O=function(t){return l&&c(l),new u(!0,t)},A=function(t){return m?(n(t),_?w(t[0],t[1],O):w(t[0],t[1])):_?w(t,O):w(t)};if(b)l=t;else{if(f=a(t),"function"!=typeof f)throw TypeError("Target is not iterable");if(i(f)){for(h=0,d=o(t.length);d>h;h++)if(p=A(t[h]),p&&p instanceof u)return p;return new u(!1)}l=f.call(t)}v=l.next;while(!(y=v.call(l)).done){try{p=A(y.value)}catch(S){throw c(l),S}if("object"==typeof p&&p&&p instanceof u)return p}return new u(!1)}},"23cb":function(t,e,r){var n=r("a691"),i=Math.max,o=Math.min;t.exports=function(t,e){var r=n(t);return r<0?i(r+e,0):o(r,e)}},"23e7":function(t,e,r){var n=r("da84"),i=r("06cf").f,o=r("9112"),s=r("6eeb"),a=r("ce4e"),c=r("e893"),u=r("94ca");t.exports=function(t,e){var r,l,f,h,d,p,v=t.target,y=t.global,g=t.stat;if(l=y?n:g?n[v]||a(v,{}):(n[v]||{}).prototype,l)for(f in e){if(d=e[f],t.noTargetGet?(p=i(l,f),h=p&&p.value):h=l[f],r=u(y?f:v+(g?".":"#")+f,t.forced),!r&&void 0!==h){if(typeof d===typeof h)continue;c(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),s(l,f,d,t)}}},"241c":function(t,e,r){var n=r("ca84"),i=r("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},2626:function(t,e,r){"use strict";var n=r("d066"),i=r("9bf2"),o=r("b622"),s=r("83ab"),a=o("species");t.exports=function(t){var e=n(t),r=i.f;s&&e&&!e[a]&&r(e,a,{configurable:!0,get:function(){return this}})}},2877:function(t,e,r){"use strict";function n(t,e,r,n,i,o,s,a){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),s?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},u._ssrRegister=c):i&&(c=a?function(){i.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return{exports:t,options:u}}r.d(e,"a",(function(){return n}))},"2a62":function(t,e,r){var n=r("825a");t.exports=function(t){var e=t["return"];if(void 0!==e)return n(e.call(t)).value}},"2b0e":function(t,e,r){"use strict";(function(t){ /*! * Vue.js v2.6.12 * (c) 2014-2020 Evan You * Released under the MIT License. */ var r=Object.freeze({});function n(t){return void 0===t||null===t}function i(t){return void 0!==t&&null!==t}function o(t){return!0===t}function s(t){return!1===t}function a(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function c(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function l(t){return"[object Object]"===u.call(t)}function f(t){return"[object RegExp]"===u.call(t)}function h(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function y(t,e){for(var r=Object.create(null),n=t.split(","),i=0;i-1)return t.splice(r,1)}}var b=Object.prototype.hasOwnProperty;function _(t,e){return b.call(t,e)}function w(t){var e=Object.create(null);return function(r){var n=e[r];return n||(e[r]=t(r))}}var O=/-(\w)/g,A=w((function(t){return t.replace(O,(function(t,e){return e?e.toUpperCase():""}))})),S=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),C=/\B([A-Z])/g,P=w((function(t){return t.replace(C,"-$1").toLowerCase()}));function E(t,e){function r(r){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,r):t.call(e)}return r._length=t.length,r}function N(t,e){return t.bind(e)}var x=Function.prototype.bind?N:E;function I(t,e){e=e||0;var r=t.length-e,n=new Array(r);while(r--)n[r]=t[r+e];return n}function k(t,e){for(var r in e)t[r]=e[r];return t}function T(t){for(var e={},r=0;r0,rt=Q&&Q.indexOf("edge/")>0,nt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),it=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ot={}.watch,st=!1;if(J)try{var at={};Object.defineProperty(at,"passive",{get:function(){st=!0}}),window.addEventListener("test-passive",null,at)}catch(As){}var ct=function(){return void 0===W&&(W=!J&&!X&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),W},ut=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function lt(t){return"function"===typeof t&&/native code/.test(t.toString())}var ft,ht="undefined"!==typeof Symbol&<(Symbol)&&"undefined"!==typeof Reflect&<(Reflect.ownKeys);ft="undefined"!==typeof Set&<(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var dt=M,pt=0,vt=function(){this.id=pt++,this.subs=[]};vt.prototype.addSub=function(t){this.subs.push(t)},vt.prototype.removeSub=function(t){m(this.subs,t)},vt.prototype.depend=function(){vt.target&&vt.target.addDep(this)},vt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,r=t.length;e-1)if(o&&!_(i,"default"))s=!1;else if(""===s||s===P(t)){var c=te(String,i.type);(c<0||a0&&(s=Ee(s,(e||"")+"_"+r),Pe(s[0])&&Pe(u)&&(l[c]=Ot(u.text+s[0].text),s.shift()),l.push.apply(l,s)):a(s)?Pe(u)?l[c]=Ot(u.text+s):""!==s&&l.push(Ot(s)):Pe(s)&&Pe(u)?l[c]=Ot(u.text+s.text):(o(t._isVList)&&i(s.tag)&&n(s.key)&&i(e)&&(s.key="__vlist"+e+"_"+r+"__"),l.push(s)));return l}function Ne(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function xe(t){var e=Ie(t.$options.inject,t);e&&(xt(!1),Object.keys(e).forEach((function(r){Rt(t,r,e[r])})),xt(!0))}function Ie(t,e){if(t){for(var r=Object.create(null),n=ht?Reflect.ownKeys(t):Object.keys(t),i=0;i0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&n&&n!==r&&a===n.$key&&!o&&!n.$hasNormal)return n;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=Re(e,c,t[c]))}else i={};for(var u in e)u in i||(i[u]=$e(e,u));return t&&Object.isExtensible(t)&&(t._normalized=i),V(i,"$stable",s),V(i,"$key",a),V(i,"$hasNormal",o),i}function Re(t,e,r){var n=function(){var t=arguments.length?r.apply(null,arguments):r({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Ce(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return r.proxy&&Object.defineProperty(t,e,{get:n,enumerable:!0,configurable:!0}),n}function $e(t,e){return function(){return t[e]}}function De(t,e){var r,n,o,s,a;if(Array.isArray(t)||"string"===typeof t)for(r=new Array(t.length),n=0,o=t.length;n1?I(r):r;for(var n=I(arguments,1),i='event handler for "'+t+'"',o=0,s=r.length;odocument.createEvent("Event").timeStamp&&(qr=function(){return Wr.now()})}function Yr(){var t,e;for(zr=qr(),Kr=!0,Ur.sort((function(t,e){return t.id-e.id})),Hr=0;HrHr&&Ur[r].id>t.id)r--;Ur.splice(r+1,0,t)}else Ur.push(t);Gr||(Gr=!0,pe(Yr))}}var tn=0,en=function(t,e,r,n,i){this.vm=t,i&&(t._watcher=this),t._watchers.push(this),n?(this.deep=!!n.deep,this.user=!!n.user,this.lazy=!!n.lazy,this.sync=!!n.sync,this.before=n.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=r,this.id=++tn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ft,this.newDepIds=new ft,this.expression="","function"===typeof e?this.getter=e:(this.getter=q(e),this.getter||(this.getter=M)),this.value=this.lazy?void 0:this.get()};en.prototype.get=function(){var t;gt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(As){if(!this.user)throw As;ee(As,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ye(t),mt(),this.cleanupDeps()}return t},en.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},en.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},en.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():Qr(this)},en.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(As){ee(As,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},en.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},en.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},en.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var rn={enumerable:!0,configurable:!0,get:M,set:M};function nn(t,e,r){rn.get=function(){return this[e][r]},rn.set=function(t){this[e][r]=t},Object.defineProperty(t,r,rn)}function on(t){t._watchers=[];var e=t.$options;e.props&&sn(t,e.props),e.methods&&pn(t,e.methods),e.data?an(t):Mt(t._data={},!0),e.computed&&ln(t,e.computed),e.watch&&e.watch!==ot&&vn(t,e.watch)}function sn(t,e){var r=t.$options.propsData||{},n=t._props={},i=t.$options._propKeys=[],o=!t.$parent;o||xt(!1);var s=function(o){i.push(o);var s=Jt(o,e,r,t);Rt(n,o,s),o in t||nn(t,"_props",o)};for(var a in e)s(a);xt(!0)}function an(t){var e=t.$options.data;e=t._data="function"===typeof e?cn(e,t):e||{},l(e)||(e={});var r=Object.keys(e),n=t.$options.props,i=(t.$options.methods,r.length);while(i--){var o=r[i];0,n&&_(n,o)||H(o)||nn(t,"_data",o)}Mt(e,!0)}function cn(t,e){gt();try{return t.call(e,e)}catch(As){return ee(As,e,"data()"),{}}finally{mt()}}var un={lazy:!0};function ln(t,e){var r=t._computedWatchers=Object.create(null),n=ct();for(var i in e){var o=e[i],s="function"===typeof o?o:o.get;0,n||(r[i]=new en(t,s||M,M,un)),i in t||fn(t,i,o)}}function fn(t,e,r){var n=!ct();"function"===typeof r?(rn.get=n?hn(e):dn(r),rn.set=M):(rn.get=r.get?n&&!1!==r.cache?hn(e):dn(r.get):M,rn.set=r.set||M),Object.defineProperty(t,e,rn)}function hn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),vt.target&&e.depend(),e.value}}function dn(t){return function(){return t.call(this,this)}}function pn(t,e){t.$options.props;for(var r in e)t[r]="function"!==typeof e[r]?M:x(e[r],t)}function vn(t,e){for(var r in e){var n=e[r];if(Array.isArray(n))for(var i=0;i-1)return this;var r=I(arguments,1);return r.unshift(this),"function"===typeof t.install?t.install.apply(t,r):"function"===typeof t&&t.apply(null,r),e.push(t),this}}function Cn(t){t.mixin=function(t){return this.options=Wt(this.options,t),this}}function Pn(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var r=this,n=r.cid,i=t._Ctor||(t._Ctor={});if(i[n])return i[n];var o=t.name||r.options.name;var s=function(t){this._init(t)};return s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.cid=e++,s.options=Wt(r.options,t),s["super"]=r,s.options.props&&En(s),s.options.computed&&Nn(s),s.extend=r.extend,s.mixin=r.mixin,s.use=r.use,B.forEach((function(t){s[t]=r[t]})),o&&(s.options.components[o]=s),s.superOptions=r.options,s.extendOptions=t,s.sealedOptions=k({},s.options),i[n]=s,s}}function En(t){var e=t.options.props;for(var r in e)nn(t.prototype,"_props",r)}function Nn(t){var e=t.options.computed;for(var r in e)fn(t.prototype,r,e[r])}function xn(t){B.forEach((function(e){t[e]=function(t,r){return r?("component"===e&&l(r)&&(r.name=r.name||t,r=this.options._base.extend(r)),"directive"===e&&"function"===typeof r&&(r={bind:r,update:r}),this.options[e+"s"][t]=r,r):this.options[e+"s"][t]}}))}function In(t){return t&&(t.Ctor.options.name||t.tag)}function kn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Tn(t,e){var r=t.cache,n=t.keys,i=t._vnode;for(var o in r){var s=r[o];if(s){var a=In(s.componentOptions);a&&!e(a)&&Mn(r,o,n,i)}}}function Mn(t,e,r,n){var i=t[e];!i||n&&i.tag===n.tag||i.componentInstance.$destroy(),t[e]=null,m(r,e)}bn(An),gn(An),Nr(An),Tr(An),gr(An);var Rn=[String,RegExp,Array],$n={name:"keep-alive",abstract:!0,props:{include:Rn,exclude:Rn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Mn(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Tn(t,(function(t){return kn(e,t)}))})),this.$watch("exclude",(function(e){Tn(t,(function(t){return!kn(e,t)}))}))},render:function(){var t=this.$slots.default,e=Or(t),r=e&&e.componentOptions;if(r){var n=In(r),i=this,o=i.include,s=i.exclude;if(o&&(!n||!kn(o,n))||s&&n&&kn(s,n))return e;var a=this,c=a.cache,u=a.keys,l=null==e.key?r.Ctor.cid+(r.tag?"::"+r.tag:""):e.key;c[l]?(e.componentInstance=c[l].componentInstance,m(u,l),u.push(l)):(c[l]=e,u.push(l),this.max&&u.length>parseInt(this.max)&&Mn(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Dn={KeepAlive:$n};function Ln(t){var e={get:function(){return G}};Object.defineProperty(t,"config",e),t.util={warn:dt,extend:k,mergeOptions:Wt,defineReactive:Rt},t.set=$t,t.delete=Dt,t.nextTick=pe,t.observable=function(t){return Mt(t),t},t.options=Object.create(null),B.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,k(t.options.components,Dn),Sn(t),Cn(t),Pn(t),xn(t)}Ln(An),Object.defineProperty(An.prototype,"$isServer",{get:ct}),Object.defineProperty(An.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(An,"FunctionalRenderContext",{value:Xe}),An.version="2.6.12";var jn=y("style,class"),Un=y("input,textarea,option,select,progress"),Bn=function(t,e,r){return"value"===r&&Un(t)&&"button"!==e||"selected"===r&&"option"===t||"checked"===r&&"input"===t||"muted"===r&&"video"===t},Fn=y("contenteditable,draggable,spellcheck"),Gn=y("events,caret,typing,plaintext-only"),Kn=function(t,e){return Wn(e)||"false"===e?"false":"contenteditable"===t&&Gn(e)?e:"true"},Hn=y("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Vn="http://www.w3.org/1999/xlink",zn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},qn=function(t){return zn(t)?t.slice(6,t.length):""},Wn=function(t){return null==t||!1===t};function Yn(t){var e=t.data,r=t,n=t;while(i(n.componentInstance))n=n.componentInstance._vnode,n&&n.data&&(e=Jn(n.data,e));while(i(r=r.parent))r&&r.data&&(e=Jn(e,r.data));return Xn(e.staticClass,e.class)}function Jn(t,e){return{staticClass:Zn(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Xn(t,e){return i(t)||i(e)?Zn(t,Qn(e)):""}function Zn(t,e){return t?e?t+" "+e:t:e||""}function Qn(t){return Array.isArray(t)?ti(t):c(t)?ei(t):"string"===typeof t?t:""}function ti(t){for(var e,r="",n=0,o=t.length;n-1?ai[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ai[t]=/HTMLUnknownElement/.test(e.toString())}var ui=y("text,number,password,search,email,tel,url");function li(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function fi(t,e){var r=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&r.setAttribute("multiple","multiple"),r}function hi(t,e){return document.createElementNS(ri[t],e)}function di(t){return document.createTextNode(t)}function pi(t){return document.createComment(t)}function vi(t,e,r){t.insertBefore(e,r)}function yi(t,e){t.removeChild(e)}function gi(t,e){t.appendChild(e)}function mi(t){return t.parentNode}function bi(t){return t.nextSibling}function _i(t){return t.tagName}function wi(t,e){t.textContent=e}function Oi(t,e){t.setAttribute(e,"")}var Ai=Object.freeze({createElement:fi,createElementNS:hi,createTextNode:di,createComment:pi,insertBefore:vi,removeChild:yi,appendChild:gi,parentNode:mi,nextSibling:bi,tagName:_i,setTextContent:wi,setStyleScope:Oi}),Si={create:function(t,e){Ci(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Ci(t,!0),Ci(e))},destroy:function(t){Ci(t,!0)}};function Ci(t,e){var r=t.data.ref;if(i(r)){var n=t.context,o=t.componentInstance||t.elm,s=n.$refs;e?Array.isArray(s[r])?m(s[r],o):s[r]===o&&(s[r]=void 0):t.data.refInFor?Array.isArray(s[r])?s[r].indexOf(o)<0&&s[r].push(o):s[r]=[o]:s[r]=o}}var Pi=new bt("",{},[]),Ei=["create","activate","update","remove","destroy"];function Ni(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&xi(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&n(e.asyncFactory.error))}function xi(t,e){if("input"!==t.tag)return!0;var r,n=i(r=t.data)&&i(r=r.attrs)&&r.type,o=i(r=e.data)&&i(r=r.attrs)&&r.type;return n===o||ui(n)&&ui(o)}function Ii(t,e,r){var n,o,s={};for(n=e;n<=r;++n)o=t[n].key,i(o)&&(s[o]=n);return s}function ki(t){var e,r,s={},c=t.modules,u=t.nodeOps;for(e=0;ev?(f=n(r[m+1])?null:r[m+1].elm,A(t,f,r,p,m,o)):p>m&&C(e,h,v)}function N(t,e,r,n){for(var o=r;o-1?Gi(t,e,r):Hn(e)?Wn(r)?t.removeAttribute(e):(r="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,r)):Fn(e)?t.setAttribute(e,Kn(e,r)):zn(e)?Wn(r)?t.removeAttributeNS(Vn,qn(e)):t.setAttributeNS(Vn,e,r):Gi(t,e,r)}function Gi(t,e,r){if(Wn(r))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==r&&!t.__ieph){var n=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",n)};t.addEventListener("input",n),t.__ieph=!0}t.setAttribute(e,r)}}var Ki={create:Bi,update:Bi};function Hi(t,e){var r=e.elm,o=e.data,s=t.data;if(!(n(o.staticClass)&&n(o.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=Yn(e),c=r._transitionClasses;i(c)&&(a=Zn(a,Qn(c))),a!==r._prevClass&&(r.setAttribute("class",a),r._prevClass=a)}}var Vi,zi={create:Hi,update:Hi},qi="__r",Wi="__c";function Yi(t){if(i(t[qi])){var e=tt?"change":"input";t[e]=[].concat(t[qi],t[e]||[]),delete t[qi]}i(t[Wi])&&(t.change=[].concat(t[Wi],t.change||[]),delete t[Wi])}function Ji(t,e,r){var n=Vi;return function i(){var o=e.apply(null,arguments);null!==o&&Qi(t,i,r,n)}}var Xi=se&&!(it&&Number(it[1])<=53);function Zi(t,e,r,n){if(Xi){var i=zr,o=e;e=o._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=i||t.timeStamp<=0||t.target.ownerDocument!==document)return o.apply(this,arguments)}}Vi.addEventListener(t,e,st?{capture:r,passive:n}:r)}function Qi(t,e,r,n){(n||Vi).removeEventListener(t,e._wrapper||e,r)}function to(t,e){if(!n(t.data.on)||!n(e.data.on)){var r=e.data.on||{},i=t.data.on||{};Vi=e.elm,Yi(r),_e(r,i,Zi,Qi,Ji,e.context),Vi=void 0}}var eo,ro={create:to,update:to};function no(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var r,o,s=e.elm,a=t.data.domProps||{},c=e.data.domProps||{};for(r in i(c.__ob__)&&(c=e.data.domProps=k({},c)),a)r in c||(s[r]="");for(r in c){if(o=c[r],"textContent"===r||"innerHTML"===r){if(e.children&&(e.children.length=0),o===a[r])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===r&&"PROGRESS"!==s.tagName){s._value=o;var u=n(o)?"":String(o);io(s,u)&&(s.value=u)}else if("innerHTML"===r&&ii(s.tagName)&&n(s.innerHTML)){eo=eo||document.createElement("div"),eo.innerHTML=""+o+"";var l=eo.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(l.firstChild)s.appendChild(l.firstChild)}else if(o!==a[r])try{s[r]=o}catch(As){}}}}function io(t,e){return!t.composing&&("OPTION"===t.tagName||oo(t,e)||so(t,e))}function oo(t,e){var r=!0;try{r=document.activeElement!==t}catch(As){}return r&&t.value!==e}function so(t,e){var r=t.value,n=t._vModifiers;if(i(n)){if(n.number)return v(r)!==v(e);if(n.trim)return r.trim()!==e.trim()}return r!==e}var ao={create:no,update:no},co=w((function(t){var e={},r=/;(?![^(]*\))/g,n=/:(.+)/;return t.split(r).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function uo(t){var e=lo(t.style);return t.staticStyle?k(t.staticStyle,e):e}function lo(t){return Array.isArray(t)?T(t):"string"===typeof t?co(t):t}function fo(t,e){var r,n={};if(e){var i=t;while(i.componentInstance)i=i.componentInstance._vnode,i&&i.data&&(r=uo(i.data))&&k(n,r)}(r=uo(t.data))&&k(n,r);var o=t;while(o=o.parent)o.data&&(r=uo(o.data))&&k(n,r);return n}var ho,po=/^--/,vo=/\s*!important$/,yo=function(t,e,r){if(po.test(e))t.style.setProperty(e,r);else if(vo.test(r))t.style.setProperty(P(e),r.replace(vo,""),"important");else{var n=mo(e);if(Array.isArray(r))for(var i=0,o=r.length;i-1?e.split(wo).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var r=" "+(t.getAttribute("class")||"")+" ";r.indexOf(" "+e+" ")<0&&t.setAttribute("class",(r+e).trim())}}function Ao(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(wo).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var r=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";while(r.indexOf(n)>=0)r=r.replace(n," ");r=r.trim(),r?t.setAttribute("class",r):t.removeAttribute("class")}}function So(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&k(e,Co(t.name||"v")),k(e,t),e}return"string"===typeof t?Co(t):void 0}}var Co=w((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Po=J&&!et,Eo="transition",No="animation",xo="transition",Io="transitionend",ko="animation",To="animationend";Po&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(xo="WebkitTransition",Io="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(ko="WebkitAnimation",To="webkitAnimationEnd"));var Mo=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Ro(t){Mo((function(){Mo(t)}))}function $o(t,e){var r=t._transitionClasses||(t._transitionClasses=[]);r.indexOf(e)<0&&(r.push(e),Oo(t,e))}function Do(t,e){t._transitionClasses&&m(t._transitionClasses,e),Ao(t,e)}function Lo(t,e,r){var n=Uo(t,e),i=n.type,o=n.timeout,s=n.propCount;if(!i)return r();var a=i===Eo?Io:To,c=0,u=function(){t.removeEventListener(a,l),r()},l=function(e){e.target===t&&++c>=s&&u()};setTimeout((function(){c0&&(r=Eo,l=s,f=o.length):e===No?u>0&&(r=No,l=u,f=c.length):(l=Math.max(s,u),r=l>0?s>u?Eo:No:null,f=r?r===Eo?o.length:c.length:0);var h=r===Eo&&jo.test(n[xo+"Property"]);return{type:r,timeout:l,propCount:f,hasTransform:h}}function Bo(t,e){while(t.length1}function zo(t,e){!0!==e.data.show&&Go(e)}var qo=J?{create:zo,activate:zo,remove:function(t,e){!0!==t.data.show?Ko(t,e):e()}}:{},Wo=[Ki,zi,ro,ao,_o,qo],Yo=Wo.concat(Ui),Jo=ki({nodeOps:Ai,modules:Yo});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&is(t,"input")}));var Xo={inserted:function(t,e,r,n){"select"===r.tag?(n.elm&&!n.elm._vOptions?we(r,"postpatch",(function(){Xo.componentUpdated(t,e,r)})):Zo(t,e,r.context),t._vOptions=[].map.call(t.options,es)):("textarea"===r.tag||ui(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",rs),t.addEventListener("compositionend",ns),t.addEventListener("change",ns),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,r){if("select"===r.tag){Zo(t,e,r.context);var n=t._vOptions,i=t._vOptions=[].map.call(t.options,es);if(i.some((function(t,e){return!D(t,n[e])}))){var o=t.multiple?e.value.some((function(t){return ts(t,i)})):e.value!==e.oldValue&&ts(e.value,i);o&&is(t,"change")}}}};function Zo(t,e,r){Qo(t,e,r),(tt||rt)&&setTimeout((function(){Qo(t,e,r)}),0)}function Qo(t,e,r){var n=e.value,i=t.multiple;if(!i||Array.isArray(n)){for(var o,s,a=0,c=t.options.length;a-1,s.selected!==o&&(s.selected=o);else if(D(es(s),n))return void(t.selectedIndex!==a&&(t.selectedIndex=a));i||(t.selectedIndex=-1)}}function ts(t,e){return e.every((function(e){return!D(e,t)}))}function es(t){return"_value"in t?t._value:t.value}function rs(t){t.target.composing=!0}function ns(t){t.target.composing&&(t.target.composing=!1,is(t.target,"input"))}function is(t,e){var r=document.createEvent("HTMLEvents");r.initEvent(e,!0,!0),t.dispatchEvent(r)}function os(t){return!t.componentInstance||t.data&&t.data.transition?t:os(t.componentInstance._vnode)}var ss={bind:function(t,e,r){var n=e.value;r=os(r);var i=r.data&&r.data.transition,o=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;n&&i?(r.data.show=!0,Go(r,(function(){t.style.display=o}))):t.style.display=n?o:"none"},update:function(t,e,r){var n=e.value,i=e.oldValue;if(!n!==!i){r=os(r);var o=r.data&&r.data.transition;o?(r.data.show=!0,n?Go(r,(function(){t.style.display=t.__vOriginalDisplay})):Ko(r,(function(){t.style.display="none"}))):t.style.display=n?t.__vOriginalDisplay:"none"}},unbind:function(t,e,r,n,i){i||(t.style.display=t.__vOriginalDisplay)}},as={model:Xo,show:ss},cs={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function us(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?us(Or(e.children)):t}function ls(t){var e={},r=t.$options;for(var n in r.propsData)e[n]=t[n];var i=r._parentListeners;for(var o in i)e[A(o)]=i[o];return e}function fs(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function hs(t){while(t=t.parent)if(t.data.transition)return!0}function ds(t,e){return e.key===t.key&&e.tag===t.tag}var ps=function(t){return t.tag||wr(t)},vs=function(t){return"show"===t.name},ys={name:"transition",props:cs,abstract:!0,render:function(t){var e=this,r=this.$slots.default;if(r&&(r=r.filter(ps),r.length)){0;var n=this.mode;0;var i=r[0];if(hs(this.$vnode))return i;var o=us(i);if(!o)return i;if(this._leaving)return fs(t,i);var s="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?s+"comment":s+o.tag:a(o.key)?0===String(o.key).indexOf(s)?o.key:s+o.key:o.key;var c=(o.data||(o.data={})).transition=ls(this),u=this._vnode,l=us(u);if(o.data.directives&&o.data.directives.some(vs)&&(o.data.show=!0),l&&l.data&&!ds(o,l)&&!wr(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=k({},c);if("out-in"===n)return this._leaving=!0,we(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),fs(t,i);if("in-out"===n){if(wr(o))return u;var h,d=function(){h()};we(c,"afterEnter",d),we(c,"enterCancelled",d),we(f,"delayLeave",(function(t){h=t}))}}return i}}},gs=k({tag:String,moveClass:String},cs);delete gs.mode;var ms={props:gs,beforeMount:function(){var t=this,e=this._update;this._update=function(r,n){var i=Ir(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,i(),e.call(t,r,n)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",r=Object.create(null),n=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=ls(this),a=0;ar)e.push(arguments[r++]);return _[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},n(b),b},v=function(t){delete _[t]},h?n=function(t){y.nextTick(A(t))}:m&&m.now?n=function(t){m.now(A(t))}:g&&!f?(i=new g,o=i.port2,i.port1.onmessage=S,n=c(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&d&&"file:"!==d.protocol&&!a(C)?(n=C,s.addEventListener("message",S,!1)):n=w in l("script")?function(t){u.appendChild(l("script"))[w]=function(){u.removeChild(this),O(t)}}:function(t){setTimeout(A(t),0)}),t.exports={set:p,clear:v}},"2d00":function(t,e,r){var n,i,o=r("da84"),s=r("342f"),a=o.process,c=a&&a.versions,u=c&&c.v8;u?(n=u.split("."),i=n[0]+n[1]):s&&(n=s.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/),n&&(i=n[1]))),t.exports=i&&+i},3092:function(t,e,r){"use strict";r.d(e,"a",(function(){return jr}));const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=36,o=0xcfd41b9100000,s=33,a=333,c=22,u=l();function l(){let t=null;return"undefined"!==typeof globalThis&&"crypto"in globalThis&&globalThis.crypto.getRandomValues&&(t=globalThis.crypto),t||(t={getRandomValues:function(t){for(let e=0;e=12;e--)this.buf[e]=n.charCodeAt(t%i),t=Math.floor(t/i)}next(){return this.seq+=this.inc,this.seq>0xcfd41b9100000&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}}const h=new f,d=h,p=d;var v;(function(t){t["API_ERROR"]="BAD API",t["BAD_AUTHENTICATION"]="BAD_AUTHENTICATION",t["BAD_CREDS"]="BAD_CREDS",t["BAD_HEADER"]="BAD_HEADER",t["BAD_JSON"]="BAD_JSON",t["BAD_PAYLOAD"]="BAD_PAYLOAD",t["BAD_SUBJECT"]="BAD_SUBJECT",t["CANCELLED"]="CANCELLED",t["CONNECTION_CLOSED"]="CONNECTION_CLOSED",t["CONNECTION_DRAINING"]="CONNECTION_DRAINING",t["CONNECTION_REFUSED"]="CONNECTION_REFUSED",t["CONNECTION_TIMEOUT"]="CONNECTION_TIMEOUT",t["DISCONNECT"]="DISCONNECT",t["INVALID_OPTION"]="INVALID_OPTION",t["INVALID_PAYLOAD_TYPE"]="INVALID_PAYLOAD",t["MAX_PAYLOAD_EXCEEDED"]="MAX_PAYLOAD_EXCEEDED",t["NO_RESPONDERS"]="NO_RESPONDERS",t["NOT_FUNC"]="NOT_FUNC",t["REQUEST_ERROR"]="REQUEST_ERROR",t["SERVER_OPTION_NA"]="SERVER_OPT_NA",t["SUB_CLOSED"]="SUB_CLOSED",t["SUB_DRAINING"]="SUB_DRAINING",t["TIMEOUT"]="TIMEOUT",t["TLS"]="TLS",t["UNKNOWN"]="UNKNOWN_ERROR",t["WSS_REQUIRED"]="WSS_REQUIRED",t["AUTHORIZATION_VIOLATION"]="AUTHORIZATION_VIOLATION",t["AUTHENTICATION_EXPIRED"]="AUTHENTICATION_EXPIRED",t["NATS_PROTOCOL_ERR"]="NATS_PROTOCOL_ERR",t["PERMISSIONS_VIOLATION"]="PERMISSIONS_VIOLATION"})(v||(v={}));const y=v,g=y,m=y;class b{constructor(){this.messages=new Map,this.messages.set(v.INVALID_PAYLOAD_TYPE,"Invalid payload type - payloads can be 'binary', 'string', or 'json'"),this.messages.set(v.BAD_JSON,"Bad JSON"),this.messages.set(v.WSS_REQUIRED,"TLS is required, therefore a secure websocket connection is also required")}static getMessage(t){return _.getMessage(t)}getMessage(t){return this.messages.get(t)||t}}const _=new b;class w extends Error{constructor(t,e,r){super(t),this.name="NatsError",this.message=t,this.code=e,this.chainedError=r}static errorForCode(t,e){const r=b.getMessage(t);return new w(r,t,e)}isAuthError(){return this.code===v.AUTHENTICATION_EXPIRED||this.code===v.AUTHORIZATION_VIOLATION}isPermissionError(){return this.code===v.PERMISSIONS_VIOLATION}isProtocolError(){return this.code===v.NATS_PROTOCOL_ERR}}const O=w,A=O,S=O,C=new Uint8Array(0),P=C;var E;(function(t){t["DISCONNECT"]="disconnect",t["RECONNECT"]="reconnect",t["UPDATE"]="update",t["LDM"]="ldm",t["ERROR"]="error"})(E||(E={}));const N=E;var x;(function(t){t["RECONNECTING"]="reconnecting",t["PING_TIMER"]="pingTimer",t["STALE_CONNECTION"]="staleConnection"})(x||(x={}));const I=x,k=I,T=4222,M="127.0.0.1",R=M,$=R,D=2e3,L=D,j=12e4,U=j,B=U,F=2;const G="NATS/1.0",K=new TextEncoder,H=K,V=new TextDecoder,z=V,q=z;function W(...t){let e=0;for(let i=0;i{if(t){const r=t.indexOf(": "),n=t.slice(0,r),i=t.slice(r+2);e.append(n,i)}});return e}toString(){if(0===this.headers.size)return"";let t=G;for(const[e,r]of this.headers)for(let n=0;n126)throw new O(`'${t[o]}' is not a valid character for a header key`,y.BAD_HEADER);n&&97<=s&&s<=122?s-=r:!n&&65<=s&&s<=90&&(s+=r),i[o]=s,n=s==e}return String.fromCharCode(...i)}static validHeaderValue(t){const e=/[\r\n]/;if(e.test(t))throw new O("invalid header value - \\r and \\n are not allowed.",y.BAD_HEADER);return t.trim()}get(t){const e=Q.canonicalMIMEHeaderKey(t),r=this.headers.get(e);return r?r[0]:""}has(t){return""!==this.get(t)}set(t,e){const r=Q.canonicalMIMEHeaderKey(t),n=Q.validHeaderValue(e);this.headers.set(r,[n])}append(t,e){const r=Q.canonicalMIMEHeaderKey(t),n=Q.validHeaderValue(e);let i=this.headers.get(r);i||(i=[],this.headers.set(r,i)),i.push(n)}values(t){const e=Q.canonicalMIMEHeaderKey(t);return this.headers.get(e)||[]}delete(t){const e=Q.canonicalMIMEHeaderKey(t);this.headers.delete(e)}get hasError(){return!!this.code&&(this.code>0&&(this.code<200||this.code>=300))}get status(){return`${this.code} ${this.description}`.trim()}}const tt=Q,et="503";function rt(t){if(t&&t.headers){const e=t.headers;if(e.hasError)return e.status===et?O.errorForCode(y.NO_RESPONDERS):new O(e.status,y.REQUEST_ERROR)}return null}const nt=rt,it=nt,ot=nt;class st{constructor(t,e,r){this._msg=t,this._rdata=e,this.publisher=r}get subject(){return this._subject||(this._subject=q.decode(this._msg.subject)),this._subject}get reply(){return this._reply||(this._reply=q.decode(this._msg.reply)),this._reply}get sid(){return this._msg.sid}get headers(){if(this._msg.hdr>-1&&!this._headers){const t=this._rdata.subarray(0,this._msg.hdr);this._headers=tt.decode(t)}return this._headers}get data(){return this._rdata?this._msg.hdr>-1?this._rdata.subarray(this._msg.hdr):this._rdata:new Uint8Array(0)}respond(t=P,e){return!!this.reply&&(this.publisher.publish(this.reply,t,e),!0)}}const at=st,ct="\r\n",ut=ct,lt=ut;class ft{constructor(){this.buffers=[],this.byteLength=0}static concat(...t){let e=0;for(let i=0;i1){const t=new Uint8Array(this.byteLength);let e=0;for(let r=0;rr)&&(t=r);const n=e.subarray(0,t);return r>t&&this.buffers.push(e.subarray(t)),this.byteLength=r-t,n}}return new Uint8Array(0)}fill(t,...e){t&&(this.buffers.push(t),this.byteLength+=t.length);for(let r=0;rr&&t[e]===yt&&t[r]===gt)return r+1}return-1}function wt(t){const e=_t(t);if(e){const r=new Uint8Array(t),n=r.slice(0,e);return z.decode(n)}return""}const Ot=wt,At=Ot;function St(t,...e){for(let r=0;r{const o=()=>{r&&clearTimeout(r)};e={cancel:o},r=setTimeout(()=>{i(A.errorForCode(g.TIMEOUT))},t)});return Object.assign(n,e)}const It=xt,kt=It,Tt=It,Mt=It;function Rt(t=0){return new Promise(e=>{setTimeout(()=>{e()},t)})}const $t=Rt;function Dt(){let t={};const e=new Promise((e,r)=>{t={resolve:e,reject:r}});return Object.assign(e,t)}const Lt=Dt,jt=Lt,Ut=Lt,Bt=Lt,Ft=Lt,Gt=Lt,Kt=Lt;function Ht(t){for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t}const Vt=Ht,zt=Vt;class qt{constructor(){this.inflight=0,this.processed=0,this.received=0,this.noIterator=!1,this.done=!1,this.signal=jt(),this.yields=[]}[Symbol.asyncIterator](){return this.iterate()}push(t){this.done||(this.yields.push(t),this.signal.resolve())}async*iterate(){if(this.noIterator)throw new O("unsupported iterator",y.API_ERROR);while(1){if(0===this.yields.length&&await this.signal,this.err)throw this.err;const t=this.yields;this.inflight=t.length,this.yields=[];for(let e=0;e{this.timer=void 0}).catch(t=>{this.stop(t)}))}setYieldedCb(t){if(this.noIterator){const e=this.callback,r=(r,n)=>{e(r,n),t(n)};this.callback=r}else this.yieldedCb=t}callback(t,e){this.cancelTimeout(),t?this.stop(t):this.push(e)}close(){this.isClosed()||(this.cancelTimeout(),this.stop())}unsubscribe(t){this.protocol.unsubscribe(this,t)}cancelTimeout(){this.timer&&(this.timer.cancel(),this.timer=void 0)}drain(){if(this.protocol.isClosed())throw O.errorForCode(y.CONNECTION_CLOSED);if(this.isClosed())throw O.errorForCode(y.SUB_CLOSED);return this.drained||(this.protocol.unsub(this),this.drained=this.protocol.flush(Gt()),this.drained.then(()=>{this.protocol.subscriptions.cancel(this)})),this.drained}isDraining(){return this.draining}isClosed(){return this.done}getSubject(){return this.subject}getMax(){return this.max}getID(){return this.sid}}const Jt=Yt;class Xt{constructor(){this.sidCounter=0,this.subs=new Map}size(){return this.subs.size}add(t){return this.sidCounter++,t.sid=this.sidCounter,this.subs.set(t.sid,t),t}setMux(t){return this.mux=t,t}getMux(){return this.mux}get(t){return this.subs.get(t)}all(){const t=[];for(const e of this.subs.values())t.push(e);return t}cancel(t){if(t){if(t.close(),t.cleanupFn)try{t.cleanupFn(t,t.info)}catch(e){}this.subs.delete(t.sid)}}handleError(t){let e=!1;if(t){const r=/^'Permissions Violation for Subscription to "(\S+)"'/i,n=r.exec(t.message);if(n){const r=n[1];this.subs.forEach(n=>{r==n.subject&&(n.callback(t,{}),n.close(),e=n!==this.mux)})}}return e}close(){this.subs.forEach(t=>{t.close()})}}const Zt=Xt,Qt=Zt;let te;function ee(t){te=t}function re(){return void 0!==te&&void 0!==te.defaultPort?te.defaultPort:4222}function ne(){return void 0!==te&&te.urlParseFn?te.urlParseFn:void 0}function ie(){if(!te||"function"!==typeof te.factory)throw new Error("transport fn is not set");return te.factory()}const oe=ie;class se{constructor(t,e=!1){this.src=t,this.tlsName="",t.match(/^(.*:\/\/)(.*)/m)&&(t=t.replace(/^(.*:\/\/)(.*)/gm,"$2"));const r=new URL("http://"+t);r.port||(r.port=""+T),this.listen=r.host,this.hostname=r.hostname,this.port=parseInt(r.port,10),this.didConnect=!1,this.reconnects=0,this.lastConnect=0,this.gossiped=e}toString(){return this.listen}}const ae=4,ce=48,ue=65,le=97;function fe(t,e,r,n){const i=new Uint8Array(16),o=[0,0,0,0,0,0,0,0,0,0,255,255];return o.forEach((t,e)=>{i[e]=t}),i[12]=t,i[13]=e,i[14]=r,i[15]=n,i}function he(t){return void 0!==pe(t)}const de=he;function pe(t){for(let e=0;e0){if("."!==t[0])return;t=t.substring(1)}const{n:n,c:i,ok:o}=ge(t);if(!o||n>255)return;t=t.substring(i),e[r]=n}return fe(e[0],e[1],e[2],e[3])}function ye(t){const e=new Uint8Array(16);let r=-1;if(t.length>=2&&":"===t[0]&&":"===t[1]&&(r=0,t=t.substring(2),0===t.length))return e;let n=0;while(n<16){const{n:i,c:o,ok:s}=me(t);if(!s||i>65535)return;if(o16)return;const i=ve(t);if(void 0===i)return;e[n]=i[12],e[n+1]=i[13],e[n+2]=i[14],e[n+3]=i[15],t="",n+=ae;break}if(e[n]=i>>8,e[n+1]=i,n+=2,t=t.substring(o),0===t.length)break;if(":"!==t[0]||1==t.length)return;if(t=t.substring(1),":"===t[0]){if(r>=0)return;if(r=n,t=t.substring(1),0===t.length)break}}if(0===t.length){if(n<16){if(r<0)return;const t=16-n;for(let i=n-1;i>=r;i--)e[i+t]=e[i];for(let n=r+t-1;n>=r;n--)e[n]=0}else if(r>=0)return;return e}}function ge(t){let e=0,r=0;for(e=0;e=16777215)return{n:16777215,c:e,ok:!1};return 0===e?{n:0,c:0,ok:!1}:{n:r,c:e,ok:!0}}function me(t){let e=0,r=0;for(r=0;r=16777215)return{n:0,c:r,ok:!1}}return 0===r?{n:0,c:r,ok:!1}:{n:e,c:r,ok:!0}}class be{constructor(t,e=[],r={}){this.firstSelect=!0,this.servers=[],this.tlsName="";const n=ne();e&&(e.forEach(t=>{t=n?n(t):t,this.servers.push(new se(t))}),t&&(this.servers=zt(this.servers))),0===this.servers.length&&this.addServer(`${R}:${re()}`,!1),this.currentServer=this.servers[0]}updateTLSName(){const t=this.getCurrentServer();de(t.hostname)||(this.tlsName=t.hostname,this.servers.forEach(t=>{t.gossiped&&(t.tlsName=this.tlsName)}))}getCurrentServer(){return this.currentServer}addServer(t,e=!1){const r=ne();t=r?r(t):t;const n=new se(t,e);de(n.hostname)&&(n.tlsName=this.tlsName),this.servers.push(n)}selectServer(){if(this.firstSelect)return this.firstSelect=!1,this.currentServer;const t=this.servers.shift();return t&&(this.servers.push(t),this.currentServer=t),t}removeCurrentServer(){this.removeServer(this.currentServer)}removeServer(t){if(t){const e=this.servers.indexOf(t);this.servers.splice(e,1)}}length(){return this.servers.length}next(){return this.servers.length?this.servers[0]:void 0}getServers(){return this.servers}update(t){const e=[];let r=[];const n=ne(),i=new Map;t.connect_urls&&t.connect_urls.length>0&&t.connect_urls.forEach(t=>{t=n?n(t):t;const e=new se(t,!0);i.set(t,e)});const o=[];return this.servers.forEach((t,e)=>{const r=t.listen;t.gossiped&&this.currentServer.listen!==r&&void 0===i.get(r)&&o.push(e),i.delete(r)}),o.reverse(),o.forEach(t=>{const e=this.servers.splice(t,1);r=r.concat(e[0].listen)}),i.forEach((t,r,n)=>{this.servers.push(t),e.push(r)}),{added:e,deleted:r}}}const _e=be,we=32768,Oe=/^INFO\s+([^\r\n]+)\r\n/i,Ae=Oe,Se=Ae;function Ce(t=""){if(t=t||"_INBOX","string"!==typeof t)throw new Error("prefix must be a string");return`${t}.${d.next()}`}const Pe=Ce,Ee=Pe,Ne=Y("PONG\r\n"),xe=Y("PING\r\n");class Ie{constructor(t,e,r){this.protocol=1,this.version=t.version,this.lang=t.lang,this.echo=!e.noEcho&&void 0,this.verbose=e.verbose,this.pedantic=e.pedantic,this.tls_required=!!e.tls||void 0,this.name=e.name;const n=(e&&e.authenticator?e.authenticator(r):{})||{};Ct(this,n)}}class ke{constructor(){this.reqs=new Map}size(){return this.reqs.size}init(t){return this.baseInbox=Ee(t)+".",this.baseInbox}add(t){isNaN(t.received)||(t.received=0),this.reqs.set(t.token,t)}get(t){return this.reqs.get(t)}cancel(t){this.reqs.delete(t.token)}getToken(t){const e=t.subject||"";return 0===e.indexOf(this.baseInbox)?e.substring(this.baseInbox.length):null}dispatcher(){return(t,e)=>{const r=this.getToken(e);if(r){const n=this.get(r);n&&(null===t&&e.headers&&(t=ot(e)),n.resolver(t,e))}}}close(){const t=O.errorForCode(y.TIMEOUT);this.reqs.forEach(e=>{e.resolver(t,{})})}}const Te=ke;class Me extends Error{constructor(t){super(t),this.name="AssertionError"}}function Re(t,e="Assertion failed."){if(!t)throw new Me(e)}const $e=32768,De=2**32-2;function Le(t,e,r=0){const n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}class je{constructor(t){this._off=0,this._buf=null!=t?new Uint8Array(t):new Uint8Array(0)}bytes(t={copy:!0}){return!1===t.copy?this._buf.subarray(this._off):this._buf.slice(this._off)}empty(){return this._buf.byteLength<=this._off}get length(){return this._buf.byteLength-this._off}get capacity(){return this._buf.buffer.byteLength}truncate(t){if(0!==t){if(t<0||t>this.length)throw Error("bytes.Buffer: truncation out of range");this._reslice(this._off+t)}else this.reset()}reset(){this._reslice(0),this._off=0}_tryGrowByReslice(t){const e=this._buf.byteLength;return t<=this.capacity-e?(this._reslice(e+t),e):-1}_reslice(t){Re(t<=this._buf.buffer.byteLength),this._buf=new Uint8Array(this._buf.buffer,0,t)}readByte(){const t=new Uint8Array(1);return this.read(t)?t[0]:null}read(t){if(this.empty())return this.reset(),0===t.byteLength?0:null;const e=Le(this._buf.subarray(this._off),t);return this._off+=e,e}writeByte(t){return this.write(Uint8Array.of(t))}writeString(t){return this.write(H.encode(t))}write(t){const e=this._grow(t.byteLength);return Le(t,this._buf,e)}_grow(t){const e=this.length;0===e&&0!==this._off&&this.reset();const r=this._tryGrowByReslice(t);if(r>=0)return r;const n=this.capacity;if(t<=Math.floor(n/2)-e)Le(this._buf.subarray(this._off),this._buf);else{if(n+t>De)throw new Error("The buffer cannot be grown beyond the maximum size.");{const e=new Uint8Array(Math.min(2*n+t,De));Le(this._buf.subarray(this._off),e),this._buf=e}}return this._off=0,this._reslice(Math.min(e+t,De)),e}grow(t){if(t<0)throw Error("Buffer._grow: negative count");const e=this._grow(t);this._reslice(e)}readFrom(t){let e=0;const r=new Uint8Array($e);while(1){const n=this.capacity-this.length<$e,i=n?r:new Uint8Array(this._buf.buffer,this.length),o=t.read(i);if(null===o)return e;n?this.write(i.subarray(0,o)):this._reslice(this.length+o),e+=o}}}const Ue=je,Be=Ue;var Fe;(function(t){t[t["OK"]=0]="OK",t[t["ERR"]=1]="ERR",t[t["MSG"]=2]="MSG",t[t["INFO"]=3]="INFO",t[t["PING"]=4]="PING",t[t["PONG"]=5]="PONG"})(Fe||(Fe={}));const Ge=Fe;function Ke(){const t={sid:-1,hdr:-1,size:-1};return t}const He=48;class Ve{constructor(t){this.dispatcher=t,this.state=We.OP_START,this.as=0,this.drop=0,this.hdr=0}parse(t){let e;for("undefined"!==typeof module&&module.exports&&(t.subarray=t.slice),e=0;e=this.ma.size){const t=this.msgBuf.bytes({copy:!1});this.dispatcher.push({kind:Fe.MSG,msg:this.ma,data:t}),this.argBuf=void 0,this.msgBuf=void 0,this.state=We.MSG_END}else{let n=this.ma.size-this.msgBuf.length;const i=t.length-e;i0?(this.msgBuf.write(t.subarray(e,e+n)),e=e+n-1):this.msgBuf.writeByte(r)}else e-this.as>=this.ma.size&&(this.dispatcher.push({kind:Fe.MSG,msg:this.ma,data:t.subarray(this.as,e)}),this.argBuf=void 0,this.msgBuf=void 0,this.state=We.MSG_END);break;case We.MSG_END:switch(r){case Ye.NL:this.drop=0,this.as=e+1,this.state=We.OP_START;break;default:continue}break;case We.OP_PLUS:switch(r){case Ye.O:case Ye.o:this.state=We.OP_PLUS_O;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PLUS_O:switch(r){case Ye.K:case Ye.k:this.state=We.OP_PLUS_OK;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PLUS_OK:switch(r){case Ye.NL:this.dispatcher.push({kind:Fe.OK}),this.drop=0,this.state=We.OP_START;break}break;case We.OP_MINUS:switch(r){case Ye.E:case Ye.e:this.state=We.OP_MINUS_E;break;default:throw this.fail(t.subarray(e))}break;case We.OP_MINUS_E:switch(r){case Ye.R:case Ye.r:this.state=We.OP_MINUS_ER;break;default:throw this.fail(t.subarray(e))}break;case We.OP_MINUS_ER:switch(r){case Ye.R:case Ye.r:this.state=We.OP_MINUS_ERR;break;default:throw this.fail(t.subarray(e))}break;case We.OP_MINUS_ERR:switch(r){case Ye.SPACE:case Ye.TAB:this.state=We.OP_MINUS_ERR_SPC;break;default:throw this.fail(t.subarray(e))}break;case We.OP_MINUS_ERR_SPC:switch(r){case Ye.SPACE:case Ye.TAB:continue;default:this.state=We.MINUS_ERR_ARG,this.as=e}break;case We.MINUS_ERR_ARG:switch(r){case Ye.CR:this.drop=1;break;case Ye.NL:{let r;this.argBuf?(r=this.argBuf.bytes(),this.argBuf=void 0):r=t.subarray(this.as,e-this.drop),this.dispatcher.push({kind:Fe.ERR,data:r}),this.drop=0,this.as=e+1,this.state=We.OP_START;break}default:this.argBuf&&this.argBuf.write(Uint8Array.of(r))}break;case We.OP_P:switch(r){case Ye.I:case Ye.i:this.state=We.OP_PI;break;case Ye.O:case Ye.o:this.state=We.OP_PO;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PO:switch(r){case Ye.N:case Ye.n:this.state=We.OP_PON;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PON:switch(r){case Ye.G:case Ye.g:this.state=We.OP_PONG;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PONG:switch(r){case Ye.NL:this.dispatcher.push({kind:Fe.PONG}),this.drop=0,this.state=We.OP_START;break}break;case We.OP_PI:switch(r){case Ye.N:case Ye.n:this.state=We.OP_PIN;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PIN:switch(r){case Ye.G:case Ye.g:this.state=We.OP_PING;break;default:throw this.fail(t.subarray(e))}break;case We.OP_PING:switch(r){case Ye.NL:this.dispatcher.push({kind:Fe.PING}),this.drop=0,this.state=We.OP_START;break}break;case We.OP_I:switch(r){case Ye.N:case Ye.n:this.state=We.OP_IN;break;default:throw this.fail(t.subarray(e))}break;case We.OP_IN:switch(r){case Ye.F:case Ye.f:this.state=We.OP_INF;break;default:throw this.fail(t.subarray(e))}break;case We.OP_INF:switch(r){case Ye.O:case Ye.o:this.state=We.OP_INFO;break;default:throw this.fail(t.subarray(e))}break;case We.OP_INFO:switch(r){case Ye.SPACE:case Ye.TAB:this.state=We.OP_INFO_SPC;break;default:throw this.fail(t.subarray(e))}break;case We.OP_INFO_SPC:switch(r){case Ye.SPACE:case Ye.TAB:continue;default:this.state=We.INFO_ARG,this.as=e}break;case We.INFO_ARG:switch(r){case Ye.CR:this.drop=1;break;case Ye.NL:{let r;this.argBuf?(r=this.argBuf.bytes(),this.argBuf=void 0):r=t.subarray(this.as,e-this.drop),this.dispatcher.push({kind:Fe.INFO,data:r}),this.drop=0,this.as=e+1,this.state=We.OP_START;break}default:this.argBuf&&this.argBuf.writeByte(r)}break;default:throw this.fail(t.subarray(e))}}this.state!==We.MSG_ARG&&this.state!==We.MINUS_ERR_ARG&&this.state!==We.INFO_ARG||this.argBuf||(this.argBuf=new Be(t.subarray(this.as,e-this.drop))),this.state!==We.MSG_PAYLOAD||this.msgBuf||(this.argBuf||this.cloneMsgArg(),this.msgBuf=new Be(t.subarray(this.as)))}cloneMsgArg(){const t=this.ma.subject.length,e=this.ma.reply?this.ma.reply.length:0,r=new Uint8Array(t+e);r.set(this.ma.subject),this.ma.reply&&r.set(this.ma.reply,t),this.argBuf=new Be(r),this.ma.subject=r.subarray(0,t),this.ma.reply&&(this.ma.reply=r.subarray(e))}processMsgArgs(t){if(this.hdr>=0)return this.processHeaderMsgArgs(t);const e=[];let r=-1;for(let n=0;n=0&&(e.push(t.subarray(r,n)),r=-1);break;default:r<0&&(r=n)}}switch(r>=0&&e.push(t.subarray(r)),e.length){case 3:this.ma.subject=e[0],this.ma.sid=this.protoParseInt(e[1]),this.ma.reply=void 0,this.ma.size=this.protoParseInt(e[2]);break;case 4:this.ma.subject=e[0],this.ma.sid=this.protoParseInt(e[1]),this.ma.reply=e[2],this.ma.size=this.protoParseInt(e[3]);break;default:throw this.fail(t,"processMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(t,"processMsgArgs Bad or Missing Sid Error");if(this.ma.size<0)throw this.fail(t,"processMsgArgs Bad or Missing Size Error")}fail(t,e=""){return e=e?`${e} [${this.state}]`:`parse error [${this.state}]`,new Error(`${e}: ${z.decode(t)}`)}processHeaderMsgArgs(t){const e=[];let r=-1;for(let n=0;n=0&&(e.push(t.subarray(r,n)),r=-1);break;default:r<0&&(r=n)}}switch(r>=0&&e.push(t.subarray(r)),e.length){case 4:this.ma.subject=e[0],this.ma.sid=this.protoParseInt(e[1]),this.ma.reply=void 0,this.ma.hdr=this.protoParseInt(e[2]),this.ma.size=this.protoParseInt(e[3]);break;case 5:this.ma.subject=e[0],this.ma.sid=this.protoParseInt(e[1]),this.ma.reply=e[2],this.ma.hdr=this.protoParseInt(e[3]),this.ma.size=this.protoParseInt(e[4]);break;default:throw this.fail(t,"processHeaderMsgArgs Parse Error")}if(this.ma.sid<0)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Sid Error");if(this.ma.hdr<0||this.ma.hdr>this.ma.size)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Header Size Error");if(this.ma.size<0)throw this.fail(t,"processHeaderMsgArgs Bad or Missing Size Error")}protoParseInt(t){if(0===t.length)return-1;let e=0;for(let r=0;r57)return-1;e=10*e+(t[r]-He)}return e}}const ze=Ve,qe=ze;var We;(function(t){t[t["OP_START"]=0]="OP_START",t[t["OP_PLUS"]=1]="OP_PLUS",t[t["OP_PLUS_O"]=2]="OP_PLUS_O",t[t["OP_PLUS_OK"]=3]="OP_PLUS_OK",t[t["OP_MINUS"]=4]="OP_MINUS",t[t["OP_MINUS_E"]=5]="OP_MINUS_E",t[t["OP_MINUS_ER"]=6]="OP_MINUS_ER",t[t["OP_MINUS_ERR"]=7]="OP_MINUS_ERR",t[t["OP_MINUS_ERR_SPC"]=8]="OP_MINUS_ERR_SPC",t[t["MINUS_ERR_ARG"]=9]="MINUS_ERR_ARG",t[t["OP_M"]=10]="OP_M",t[t["OP_MS"]=11]="OP_MS",t[t["OP_MSG"]=12]="OP_MSG",t[t["OP_MSG_SPC"]=13]="OP_MSG_SPC",t[t["MSG_ARG"]=14]="MSG_ARG",t[t["MSG_PAYLOAD"]=15]="MSG_PAYLOAD",t[t["MSG_END"]=16]="MSG_END",t[t["OP_H"]=17]="OP_H",t[t["OP_P"]=18]="OP_P",t[t["OP_PI"]=19]="OP_PI",t[t["OP_PIN"]=20]="OP_PIN",t[t["OP_PING"]=21]="OP_PING",t[t["OP_PO"]=22]="OP_PO",t[t["OP_PON"]=23]="OP_PON",t[t["OP_PONG"]=24]="OP_PONG",t[t["OP_I"]=25]="OP_I",t[t["OP_IN"]=26]="OP_IN",t[t["OP_INF"]=27]="OP_INF",t[t["OP_INFO"]=28]="OP_INFO",t[t["OP_INFO_SPC"]=29]="OP_INFO_SPC",t[t["INFO_ARG"]=30]="INFO_ARG"})(We||(We={}));var Ye;(function(t){t[t["CR"]="\r".charCodeAt(0)]="CR",t[t["E"]="E".charCodeAt(0)]="E",t[t["e"]="e".charCodeAt(0)]="e",t[t["F"]="F".charCodeAt(0)]="F",t[t["f"]="f".charCodeAt(0)]="f",t[t["G"]="G".charCodeAt(0)]="G",t[t["g"]="g".charCodeAt(0)]="g",t[t["H"]="H".charCodeAt(0)]="H",t[t["h"]="h".charCodeAt(0)]="h",t[t["I"]="I".charCodeAt(0)]="I",t[t["i"]="i".charCodeAt(0)]="i",t[t["K"]="K".charCodeAt(0)]="K",t[t["k"]="k".charCodeAt(0)]="k",t[t["M"]="M".charCodeAt(0)]="M",t[t["m"]="m".charCodeAt(0)]="m",t[t["MINUS"]="-".charCodeAt(0)]="MINUS",t[t["N"]="N".charCodeAt(0)]="N",t[t["n"]="n".charCodeAt(0)]="n",t[t["NL"]="\n".charCodeAt(0)]="NL",t[t["O"]="O".charCodeAt(0)]="O",t[t["o"]="o".charCodeAt(0)]="o",t[t["P"]="P".charCodeAt(0)]="P",t[t["p"]="p".charCodeAt(0)]="p",t[t["PLUS"]="+".charCodeAt(0)]="PLUS",t[t["R"]="R".charCodeAt(0)]="R",t[t["r"]="r".charCodeAt(0)]="r",t[t["S"]="S".charCodeAt(0)]="S",t[t["s"]="s".charCodeAt(0)]="s",t[t["SPACE"]=" ".charCodeAt(0)]="SPACE",t[t["TAB"]="\t".charCodeAt(0)]="TAB"})(Ye||(Ye={}));class Je{constructor(t,e,r){this.ph=t,this.interval=e,this.maxOut=r,this.pendings=[]}start(){this.cancel(),this._schedule()}cancel(t){this.timer&&(clearTimeout(this.timer),this.timer=void 0),this._reset(),t&&this.ph.disconnect()}_schedule(){this.timer=setTimeout(()=>{if(this.ph.dispatchStatus({type:k.PING_TIMER,data:""+(this.pendings.length+1)}),this.pendings.length===this.maxOut)return void this.cancel(!0);const t=Bt();this.ph.flush(t).then(()=>{this._reset()}).catch(()=>{this.cancel()}),this.pendings.push(t),this._schedule()},this.interval)}_reset(){this.pendings=this.pendings.filter(t=>{const e=t;return e.resolve(),!1})}}const Xe=Je,Ze=Xe;class Qe{constructor(t,e){this._closed=!1,this.connected=!1,this.connectedOnce=!1,this.infoReceived=!1,this.noMorePublishing=!1,this.abortReconnect=!1,this.listeners=[],this.pendingLimit=we,this.outMsgs=0,this.inMsgs=0,this.outBytes=0,this.inBytes=0,this.options=t,this.publisher=e,this.subscriptions=new Qt,this.muxSubscriptions=new Te,this.outbound=new ht,this.pongs=[],this.pendingLimit=t.pendingLimit||this.pendingLimit,this.servers=new _e(!t.noRandomize,t.servers),this.closed=Ft(),this.parser=new qe(this),this.heartbeats=new Ze(this,this.options.pingInterval||B,this.options.maxPingOut||F)}resetOutbound(){this.outbound.reset();const t=this.pongs;this.pongs=[],t.forEach(t=>{t.reject(O.errorForCode(y.DISCONNECT))}),this.parser=new qe(this),this.infoReceived=!1}dispatchStatus(t){this.listeners.forEach(e=>{e.push(t)})}status(){const t=new Wt;return this.listeners.push(t),t}prepare(){this.info=void 0,this.resetOutbound();const t=Lt();return this.pongs.unshift(t),this.connectError=e=>{t.reject(e)},this.transport=oe(),this.transport.closed().then(async t=>{this.connected=!1,this.isClosed()||await this.disconnected(this.transport.closeError)}),t}disconnect(){this.dispatchStatus({type:I.STALE_CONNECTION,data:""}),this.transport.disconnect()}async disconnected(t){this.dispatchStatus({type:N.DISCONNECT,data:this.servers.getCurrentServer().toString()}),this.options.reconnect?await this.dialLoop().then(()=>{this.dispatchStatus({type:N.RECONNECT,data:this.servers.getCurrentServer().toString()})}).catch(t=>{this._close(t)}):await this._close()}async dial(t){const e=this.prepare();let r;try{r=Tt(this.options.timeout||2e4);const e=this.transport.connect(t,this.options);await Promise.race([e,r]),(async()=>{try{for await(const t of this.transport)this.parser.parse(t)}catch(t){console.log("reader closed",t)}})().then()}catch(n){e.reject(n)}try{await Promise.race([r,e]),r&&r.cancel(),this.connected=!0,this.connectError=void 0,this.sendSubscriptions(),this.connectedOnce=!0,this.server.didConnect=!0,this.server.reconnects=0,this.flushPending(),this.heartbeats.start()}catch(n){throw r&&r.cancel(),await this.transport.close(n),n}}async dialLoop(){let t;while(1){const r=this.options.reconnectDelayHandler?this.options.reconnectDelayHandler():L;let n=r;const i=this.selectServer();if(!i||this.abortReconnect)throw t||O.errorForCode(y.CONNECTION_REFUSED);const o=Date.now();if(0===i.lastConnect||i.lastConnect+r<=o){i.lastConnect=Date.now();try{this.dispatchStatus({type:I.RECONNECTING,data:i.toString()}),await this.dial(i);break}catch(e){if(t=e,!this.connectedOnce){if(this.options.waitOnFirstConnect)continue;this.servers.removeCurrentServer()}i.reconnects++;const r=this.options.maxReconnectAttempts||0;-1!==r&&i.reconnects>=r&&this.servers.removeCurrentServer()}}else n=Math.min(n,i.lastConnect+r-o),await $t(n)}}static async connect(t,e){const r=new Qe(t,e);return await r.dialLoop(),r}static toError(t){const e=t?t.toLowerCase():"";return-1!==e.indexOf("permissions violation")?new O(t,y.PERMISSIONS_VIOLATION):-1!==e.indexOf("authorization violation")?new O(t,y.AUTHORIZATION_VIOLATION):-1!==e.indexOf("user authentication expired")?new O(t,y.AUTHENTICATION_EXPIRED):new O(t,y.NATS_PROTOCOL_ERR)}processMsg(t,e){if(this.inMsgs++,this.inBytes+=e.length,!this.subscriptions.sidCounter)return;const r=this.subscriptions.get(t.sid);r&&(r.received+=1,r.callback&&r.callback(null,new at(t,e,this)),void 0!==r.max&&r.received>=r.max&&r.unsubscribe())}async processError(t){const e=Z(t),r=Qe.toError(e),n=this.subscriptions.handleError(r);n||this.dispatchStatus({type:N.ERROR,data:r.code}),await this.handleError(r)}async handleError(t){t.isAuthError()&&this.handleAuthError(t),(t.isPermissionError()||t.isProtocolError())&&await this._close(t),this.lastError=t}handleAuthError(t){this.lastError&&t.code===this.lastError.code&&(this.abortReconnect=!0),this.connectError?this.connectError(t):this.disconnect()}processPing(){this.transport.send(Ne)}processPong(){const t=this.pongs.shift();t&&t.resolve()}processInfo(t){const e=JSON.parse(Z(t));this.info=e;const r=this.options&&this.options.ignoreClusterUpdates?void 0:this.servers.update(e);if(!this.infoReceived){this.infoReceived=!0,this.transport.isEncrypted()&&this.servers.updateTLSName();const{version:t,lang:r}=this.transport;try{const n=new Ie({version:t,lang:r},this.options,e.nonce);e.headers&&(n.headers=!0,n.no_responders=!0);const i=JSON.stringify(n);this.transport.send(Y(`CONNECT ${i}${ut}`)),this.transport.send(xe)}catch(i){this._close(O.errorForCode(y.BAD_AUTHENTICATION,i))}}r&&this.dispatchStatus({type:N.UPDATE,data:r});const n=void 0!==e.ldm&&e.ldm;n&&this.dispatchStatus({type:N.LDM,data:this.servers.getCurrentServer().toString()})}push(t){switch(t.kind){case Ge.MSG:{const{msg:e,data:r}=t;this.processMsg(e,r);break}case Ge.OK:break;case Ge.ERR:this.processError(t.data);break;case Ge.PING:this.processPing();break;case Ge.PONG:this.processPong();break;case Ge.INFO:this.processInfo(t.data);break}}sendCommand(t,...e){const r=this.outbound.length();let n;n="string"===typeof t?J(t):t,this.outbound.fill(n,...e),0===r?setTimeout(()=>{this.flushPending()}):this.outbound.size()>=this.pendingLimit&&this.flushPending()}publish(t,e,r){if(this.isClosed())throw O.errorForCode(y.CONNECTION_CLOSED);if(this.noMorePublishing)throw O.errorForCode(y.CONNECTION_DRAINING);let n=e.length;r=r||{},r.reply=r.reply||"";let i,o=P,s=0;if(r.headers){if(this.info&&!this.info.headers)throw new O("headers",y.SERVER_OPTION_NA);const t=r.headers;o=t.encode(),s=o.length,n=e.length+s}if(this.info&&n>this.info.max_payload)throw O.errorForCode(y.MAX_PAYLOAD_EXCEEDED);this.outBytes+=n,this.outMsgs++,r.headers?(i=r.reply?`HPUB ${t} ${r.reply} ${s} ${n}${lt}`:`HPUB ${t} ${s} ${n}\r\n`,this.sendCommand(i,o,e,vt)):(i=r.reply?`PUB ${t} ${r.reply} ${n}\r\n`:`PUB ${t} ${n}\r\n`,this.sendCommand(i,e,vt))}request(t){return this.initMux(),this.muxSubscriptions.add(t),t}subscribe(t){return this.subscriptions.add(t),t.queue?this.sendCommand(`SUB ${t.subject} ${t.queue} ${t.sid}\r\n`):this.sendCommand(`SUB ${t.subject} ${t.sid}\r\n`),t.max&&this.unsubscribe(t,t.max),t}unsubscribe(t,e){this.unsub(t,e),(void 0===t.max||t.received>=t.max)&&this.subscriptions.cancel(t)}unsub(t,e){t&&!this.isClosed()&&(e?this.sendCommand(`UNSUB ${t.sid} ${e}${ut}`):this.sendCommand(`UNSUB ${t.sid}${ut}`),t.max=e)}flush(t){return t||(t=Ft()),this.pongs.push(t),this.sendCommand(xe),t}sendSubscriptions(){const t=[];this.subscriptions.all().forEach(e=>{const r=e;r.queue?t.push(`SUB ${r.subject} ${r.queue} ${r.sid}${ut}`):t.push(`SUB ${r.subject} ${r.sid}${ut}`)}),t.length&&this.transport.send(Y(t.join("")))}async _close(t){this._closed||(this.heartbeats.cancel(),this.connectError&&(this.connectError(t),this.connectError=void 0),this.muxSubscriptions.close(),this.subscriptions.close(),this.listeners.forEach(t=>{t.stop()}),this._closed=!0,await this.transport.close(t),await this.closed.resolve(t))}close(){return this._close()}isClosed(){return this._closed}drain(){const t=this.subscriptions.all(),e=[];return t.forEach(t=>{e.push(t.drain())}),Promise.all(e).then(async()=>(this.noMorePublishing=!0,await this.flush(),this.close())).catch(()=>{})}flushPending(){if(this.infoReceived&&this.connected&&this.outbound.size()){const t=this.outbound.drain();this.transport.send(t)}}initMux(){const t=this.subscriptions.getMux();if(!t){const t=this.muxSubscriptions.init(Ce(this.options.inboxPrefix)),e=new Jt(this,t+"*");e.callback=this.muxSubscriptions.dispatcher(),this.subscriptions.setMux(e),this.subscribe(e)}}selectServer(){const t=this.servers.selectServer();if(void 0!==t)return this.server=t,this.server}getServer(){return this.server}}const tr=Qe;class er{constructor(t,e={timeout:1e3}){this.mux=t,this.received=0,this.deferred=Ut(),this.token=p.next(),Ct(this,e),this.timer=kt(e.timeout)}resolver(t,e){this.timer&&this.timer.cancel(),t?this.deferred.reject(t):this.deferred.resolve(e),this.cancel()}cancel(t){this.timer&&this.timer.cancel(),this.mux.cancel(this),this.deferred.reject(t||O.errorForCode(y.CANCELLED))}}const rr=er;function nr(t){return new Uint8Array(t)}function ir(t){return new Uint32Array(t)}function or(t){return new Int32Array(t)}const sr=nr(32);function ar(t){return new Float64Array(t)}nr(16);function cr(t){const e=ar(16);if(t)for(let r=0;r>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function s(t,e,r){const n=new Array((r-e)/3);for(let i=e,s=0;i>16&255,s[l++]=c>>8&255,s[l++]=255&c;return 2===o?(c=r[e.charCodeAt(u)]<<2|r[e.charCodeAt(u+1)]>>4,s[l++]=255&c):1===o&&(c=r[e.charCodeAt(u)]<<10|r[e.charCodeAt(u+1)]<<4|r[e.charCodeAt(u+2)]>>2,s[l++]=c>>8&255,s[l++]=255&c),s},fromUint8Array(t){const r=16383,i=t.length,o=i%3,a=i-o,c=new Array(Math.ceil(a/16383)+(o?1:0));let u,l,f=0;for(let e=0;ea?a:u);return 1===o?(l=t[a],c[f]=e[l>>2]+e[l<<4&63],n||(c[f]+="==")):2===o&&(l=t[a]<<8|255&t[a+1],c[f]=e[l>>10]+e[l>>4&63]+e[l<<2&63],n||(c[f]+="=")),c.join("")}}}const r=[],n=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let Mt=0,Rt=i.length;Mt>>8)-1}function p(t,e,r,n){return d(t,e,r,n,32)}var v;(function(t){t[t["Scalar"]=32]="Scalar",t[t["GroupElement"]=32]="GroupElement"})(v||(v={}));function y(t,e){for(let r=0;r<16;r++)t[r]=0|e[r]}function g(t){let e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function m(t,e,r){let n,i=~(r-1);for(let o=0;o<16;o++)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function b(t,e){const r=cr(),n=cr();let i,o,s;for(i=0;i<16;i++)n[i]=e[i];for(g(n),g(n),g(n),o=0;o<2;o++){for(r[0]=n[0]-65517,i=1;i<15;i++)r[i]=n[i]-65535-(r[i-1]>>16&1),r[i-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1),s=r[15]>>16&1,r[14]&=65535,m(n,r,1-s)}for(i=0;i<16;i++)t[2*i]=255&n[i],t[2*i+1]=n[i]>>8}function _(t,e){const r=nr(32),n=nr(32);return b(r,t),b(n,e),p(r,0,n,0)}function w(t){const e=nr(32);return b(e,t),1&e[0]}const O=w;function A(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function S(t,e){const r=cr();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=253;n>=0;n--)br(r,r),2!==n&&4!==n&&mr(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}var C;(function(t){t[t["PublicKey"]=32]="PublicKey",t[t["SecretKey"]=64]="SecretKey",t[t["Seed"]=32]="Seed",t[t["Signature"]=64]="Signature"})(C||(C={}));function P(t,e){if(h(t,e),e.length!==C.SecretKey)throw new Error("bad secret key size");const r=nr(C.Signature+t.length);return D(r,t,t.length,e),r}function E(t,e){const r=P(t,e),n=nr(C.Signature);for(let i=0;i=0}function x(t){if(h(t),t.length!==C.Seed)throw new Error("bad seed size");const e=nr(C.PublicKey),r=nr(C.SecretKey);for(let n=0;n<32;n++)r[n]=t[n];return $(e,r,!0),{publicKey:e,secretKey:r}}var I;(function(t){t[t["Hash"]=64]="Hash"})(I||(I={}));function k(t,e,r){const n=or(8),i=or(8),o=nr(256);let s,a=r;for(n[0]=1779033703,n[1]=3144134277,n[2]=1013904242,n[3]=2773480762,n[4]=1359893119,n[5]=2600822924,n[6]=528734635,n[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,M(n,i,e,r),r%=128,s=0;s=128){for(S=0;S<16;S++)C=8*S+Y,i[S]=r[C+0]<<24|r[C+1]<<16|r[C+2]<<8|r[C+3],o[S]=r[C+4]<<24|r[C+5]<<16|r[C+6]<<8|r[C+7];for(S=0;S<80;S++)if(s=M,a=R,c=$,u=D,l=L,f=j,h=U,d=B,p=F,v=G,y=K,g=H,m=V,b=z,_=q,w=W,P=B,E=W,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=(L>>>14|V<<18)^(L>>>18|V<<14)^(V>>>9|L<<23),E=(V>>>14|L<<18)^(V>>>18|L<<14)^(L>>>9|V<<23),N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,P=L&j^~L&U,E=V&z^~V&q,N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,P=T[2*S],E=T[2*S+1],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,P=i[S%16],E=o[S%16],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,O=65535&I|k<<16,A=65535&N|x<<16,P=O,E=A,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=(M>>>28|F<<4)^(F>>>2|M<<30)^(F>>>7|M<<25),E=(F>>>28|M<<4)^(M>>>2|F<<30)^(M>>>7|F<<25),N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,P=M&R^M&$^R&$,E=F&G^F&K^G&K,N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,d=65535&I|k<<16,w=65535&N|x<<16,P=u,E=g,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=O,E=A,N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,u=65535&I|k<<16,g=65535&N|x<<16,R=s,$=a,D=c,L=u,j=l,U=f,B=h,M=d,G=p,K=v,H=y,V=g,z=m,q=b,W=_,F=w,S%16===15)for(C=0;C<16;C++)P=i[C],E=o[C],N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=i[(C+9)%16],E=o[(C+9)%16],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,O=i[(C+1)%16],A=o[(C+1)%16],P=(O>>>1|A<<31)^(O>>>8|A<<24)^O>>>7,E=(A>>>1|O<<31)^(A>>>8|O<<24)^(A>>>7|O<<25),N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,O=i[(C+14)%16],A=o[(C+14)%16],P=(O>>>19|A<<13)^(A>>>29|O<<3)^O>>>6,E=(A>>>19|O<<13)^(O>>>29|A<<3)^(A>>>6|O<<26),N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,i[C]=65535&I|k<<16,o[C]=65535&N|x<<16;P=M,E=F,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[0],E=e[0],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[0]=M=65535&I|k<<16,e[0]=F=65535&N|x<<16,P=R,E=G,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[1],E=e[1],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[1]=R=65535&I|k<<16,e[1]=G=65535&N|x<<16,P=$,E=K,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[2],E=e[2],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[2]=$=65535&I|k<<16,e[2]=K=65535&N|x<<16,P=D,E=H,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[3],E=e[3],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[3]=D=65535&I|k<<16,e[3]=H=65535&N|x<<16,P=L,E=V,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[4],E=e[4],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[4]=L=65535&I|k<<16,e[4]=V=65535&N|x<<16,P=j,E=z,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[5],E=e[5],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[5]=j=65535&I|k<<16,e[5]=z=65535&N|x<<16,P=U,E=q,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[6],E=e[6],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[6]=U=65535&I|k<<16,e[6]=q=65535&N|x<<16,P=B,E=W,N=65535&E,x=E>>>16,I=65535&P,k=P>>>16,P=t[7],E=e[7],N+=65535&E,x+=E>>>16,I+=65535&P,k+=P>>>16,x+=N>>>16,I+=x>>>16,k+=I>>>16,t[7]=B=65535&I|k<<16,e[7]=W=65535&N|x<<16,Y+=128,n-=128}return n}function R(t,e,r,n){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function $(t,e,r){const n=nr(64),i=[cr(),cr(),cr(),cr()];let o;for(r||e.set(_r(32)),k(n,e,32),n[0]&=248,n[31]&=127,n[31]|=64,j(i,n),B(t,i),o=0;o<32;o++)e[o+32]=t[o];return 0}function D(t,e,r,n){const i=nr(64),o=nr(64),s=nr(64),a=ar(64),c=[cr(),cr(),cr(),cr()];let u,l;k(i,n,32),i[0]&=248,i[31]&=127,i[31]|=64;const f=r+64;for(u=0;u=0;--i)n=r[i/8|0]>>(7&i)&1,z(t,e,n),V(e,t),V(t,t),z(t,e,n)}function B(t,e){const r=cr(),n=cr(),i=cr();S(i,e[2]),mr(r,e[0],i),mr(n,e[1],i),b(t,n),t[31]^=O(r)<<7}function F(t,e){const r=cr(),n=cr(),i=cr(),o=cr(),s=cr(),a=cr(),c=cr();return y(t[2],lr),A(t[1],e),br(i,t[1]),mr(o,i,fr),gr(i,i,t[2]),yr(o,t[2],o),br(s,o),br(a,s),mr(c,a,s),mr(r,c,i),mr(r,r,o),q(r,r),mr(r,r,i),mr(r,r,o),mr(r,r,o),mr(t[0],r,o),br(n,t[0]),mr(n,n,o),_(n,i)&&mr(t[0],t[0],vr),br(n,t[0]),mr(n,n,o),_(n,i)?-1:(w(t[0])===e[31]>>7&&gr(t[0],ur,t[0]),mr(t[3],t[0],t[1]),0)}function G(t){const e=ar(64);let r;for(r=0;r<64;r++)e[r]=t[r];for(r=0;r<64;r++)t[r]=0;H(t,e)}const K=ar([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function H(t,e){let r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*K[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*K[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function V(t,e){const r=cr(),n=cr(),i=cr(),o=cr(),s=cr(),a=cr(),c=cr(),u=cr(),l=cr();gr(r,t[1],t[0]),gr(l,e[1],e[0]),mr(r,r,l),yr(n,t[0],t[1]),yr(l,e[0],e[1]),mr(n,n,l),mr(i,t[3],e[3]),mr(i,i,hr),mr(o,t[2],e[2]),yr(o,o,o),gr(s,n,r),gr(a,o,i),yr(c,o,i),yr(u,n,r),mr(t[0],s,a),mr(t[1],u,c),mr(t[2],c,a),mr(t[3],s,u)}function z(t,e,r){for(let n=0;n<4;n++)m(t[n],e[n],r)}function q(t,e){const r=cr();let n;for(n=0;n<16;n++)r[n]=e[n];for(n=250;n>=0;n--)br(r,r),1!==n&&mr(r,r,e);for(n=0;n<16;n++)t[n]=r[n]}var W;(function(t){t[t["Auth"]=32]="Auth",t[t["AuthFull"]=64]="AuthFull",t[t["Key"]=32]="Key"})(W||(W={}));ir([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),nr([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),ir(16),ir(16);ir([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]);const Y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3];nr(Y.map(t=>2*t)),ir(32),ir(32);var J;(function(t){t[t["PublicKey"]=f.PublicKey]="PublicKey",t[t["SecretKey"]=f.SecretKey]="SecretKey",t[t["Nonce"]=f.Nonce]="Nonce",t[t["Overhead"]=f.PublicKey+f.Overhead]="Overhead"})(J||(J={}));const X={fromSeed:x,sign:E,verify:N,randomBytes:_r};let Z;function Q(t){Z=t}function tt(){return Z}class et extends Error{constructor(t,e){super(t),this.name="NKeysError",this.code=t,this.chainedError=e}}const rt=et;function nt(){return Ot(ft.Operator)}const it=nt;function ot(){return Ot(ft.Account)}const st=ot;function at(){return Ot(ft.User)}const ct=at;var ut;(function(t){t["InvalidPrefixByte"]="nkeys: invalid prefix byte",t["InvalidKey"]="nkeys: invalid key",t["InvalidPublicKey"]="nkeys: invalid public key",t["InvalidSeedLen"]="nkeys: invalid seed length",t["InvalidSeed"]="nkeys: invalid seed",t["InvalidEncoding"]="nkeys: invalid encoded key",t["InvalidSignature"]="nkeys: signature verification failed",t["CannotSign"]="nkeys: cannot sign, no private key available",t["PublicKeyOnly"]="nkeys: no seed or private key available",t["InvalidChecksum"]="nkeys: invalid checksum",t["SerializationError"]="nkeys: serialization error",t["ApiError"]="nkeys: api error",t["ClearedPair"]="nkeys: pair is cleared"})(ut||(ut={}));const lt=ut;var ft;(function(t){t[t["Seed"]=144]="Seed",t[t["Private"]=120]="Private",t[t["Operator"]=112]="Operator",t[t["Server"]=104]="Server",t[t["Cluster"]=16]="Cluster",t[t["Account"]=0]="Account",t[t["User"]=160]="User"})(ft||(ft={}));const ht=ft;class dt{static isValidPublicPrefix(t){return t==ft.Server||t==ft.Operator||t==ft.Cluster||t==ft.Account||t==ft.User}static startsWithValidPrefix(t){let e=t[0];return"S"==e||"P"==e||"O"==e||"N"==e||"C"==e||"A"==e||"U"==e}static isValidPrefix(t){let e=this.parsePrefix(t);return-1!=e}static parsePrefix(t){switch(t){case ft.Seed:return ft.Seed;case ft.Private:return ft.Private;case ft.Operator:return ft.Operator;case ft.Server:return ft.Server;case ft.Cluster:return ft.Cluster;case ft.Account:return ft.Account;case ft.User:return ft.User;default:return-1}}}const pt=dt,vt=new Uint16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);class yt{static checksum(t){let e=0;for(let r=0;r>8^n)]}return e}static validate(t,e){let r=yt.checksum(t);return r==e}}const gt="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";class mt{static encode(t){let e=0,r=0,n=new Uint8Array(t),i=new Uint8Array(2*t.byteLength),o=0;for(let s=0;s=5){let t=r>>>e-5&31;i[o++]=gt.charAt(t).charCodeAt(0),e-=5}}if(e>0){let t=r<<5-e&31;i[o++]=gt.charAt(t).charCodeAt(0)}return i.slice(0,o)}static decode(t){let e=0,r=0,n=0,i=new Uint8Array(t),o=new Uint8Array(5*i.byteLength/8|0);for(let s=0;s=8&&(o[n++]=r>>>e-8&255,e-=8)}return o.slice(0,n)}}const bt=mt;class _t{static encode(t,e){if(!e||!(e instanceof Uint8Array))throw new rt(lt.SerializationError);if(!pt.isValidPrefix(t))throw new rt(lt.InvalidPrefixByte);return _t._encode(!1,t,e)}static encodeSeed(t,e){if(!e)throw new rt(lt.ApiError);if(!pt.isValidPublicPrefix(t))throw new rt(lt.InvalidPrefixByte);if(32!==e.byteLength)throw new rt(lt.InvalidSeedLen);return _t._encode(!0,t,e)}static decode(t,e){if(!pt.isValidPrefix(t))throw new rt(lt.InvalidPrefixByte);const r=_t._decode(e);if(r[0]!==t)throw new rt(lt.InvalidPrefixByte);return r.slice(1)}static decodeSeed(t){const e=_t._decode(t),r=_t._decodePrefix(e);if(r[0]!=ht.Seed)throw new rt(lt.InvalidSeed);if(!pt.isValidPublicPrefix(r[1]))throw new rt(lt.InvalidPrefixByte);return{buf:e.slice(2),prefix:r[1]}}static _encode(t,e,r){const n=t?2:1,i=r.byteLength,o=n+i+2,s=n+i,a=new Uint8Array(o);if(t){const t=_t._encodePrefix(ht.Seed,e);a.set(t)}else a[0]=e;a.set(r,n);const c=yt.checksum(a.slice(0,s)),u=new DataView(a.buffer);return u.setUint16(s,c,!0),mt.encode(a)}static _decode(t){if(t.byteLength<4)throw new rt(lt.InvalidEncoding);let e;try{e=bt.decode(t)}catch(s){throw new rt(lt.InvalidEncoding,s)}const r=e.byteLength-2,n=new DataView(e.buffer),i=n.getUint16(r,!0),o=e.slice(0,r);if(!yt.validate(o,i))throw new rt(lt.InvalidChecksum);return o}static _encodePrefix(t,e){const r=t|e>>5,n=(31&e)<<3;return new Uint8Array([r,n])}static _decodePrefix(t){const e=248&t[0],r=(7&t[0])<<5|(248&t[1])>>3;return new Uint8Array([e,r])}}class wt{constructor(t){this.seed=t}getRawSeed(){if(!this.seed)throw new rt(lt.ClearedPair);let t=_t.decodeSeed(this.seed);return t.buf}getSeed(){if(!this.seed)throw new rt(lt.ClearedPair);return this.seed}getPublicKey(){if(!this.seed)throw new rt(lt.ClearedPair);const t=_t.decodeSeed(this.seed),e=tt().fromSeed(this.getRawSeed()),r=_t.encode(t.prefix,e.publicKey);return(new TextDecoder).decode(r)}getPrivateKey(){if(!this.seed)throw new rt(lt.ClearedPair);const t=tt().fromSeed(this.getRawSeed());return _t.encode(ht.Private,t.secretKey)}sign(t){if(!this.seed)throw new rt(lt.ClearedPair);const e=tt().fromSeed(this.getRawSeed());return tt().sign(t,e.secretKey)}verify(t,e){if(!this.seed)throw new rt(lt.ClearedPair);const r=tt().fromSeed(this.getRawSeed());return tt().verify(t,e,r.publicKey)}clear(){this.seed&&(this.seed.fill(0),this.seed=void 0)}}function Ot(t){const e=tt().randomBytes(32);let r=_t.encodeSeed(t,new Uint8Array(e));return new wt(r)}const At=Ot;class St{constructor(t){this.publicKey=t}getPublicKey(){if(!this.publicKey)throw new rt(lt.ClearedPair);return(new TextDecoder).decode(this.publicKey)}getPrivateKey(){if(!this.publicKey)throw new rt(lt.ClearedPair);throw new rt(lt.PublicKeyOnly)}getSeed(){if(!this.publicKey)throw new rt(lt.ClearedPair);throw new rt(lt.PublicKeyOnly)}sign(t){if(!this.publicKey)throw new rt(lt.ClearedPair);throw new rt(lt.CannotSign)}verify(t,e){if(!this.publicKey)throw new rt(lt.ClearedPair);let r=_t._decode(this.publicKey);return tt().verify(t,e,r.slice(1))}clear(){this.publicKey&&(this.publicKey.fill(0),this.publicKey=void 0)}}function Ct(t){const e=(new TextEncoder).encode(t),r=_t._decode(e),n=dt.parsePrefix(r[0]);if(dt.isValidPublicPrefix(n))return new St(e);throw new et(ut.InvalidPublicKey)}const Pt=Ct;function Et(t){return _t.decodeSeed(t),new wt(t)}const Nt=Et;function xt(t){return btoa(String.fromCharCode(...t))}const It=xt;function kt(t){const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{}}function Cr(t,e){return()=>({user:t,pass:e})}function Pr(t){return()=>({auth_token:t})}function Er(){return{maxPingOut:2,maxReconnectAttempts:10,noRandomize:!1,pedantic:!1,pingInterval:U,reconnect:!0,reconnectJitter:100,reconnectJitterTLS:1e3,reconnectTimeWait:L,tls:void 0,verbose:!1,waitOnFirstConnect:!1}}function Nr(t){const e=`${R}:${re()}`;t=t||{servers:[e]},t.port&&(t.servers=[`${$}:${t.port}`]),"string"===typeof t.servers&&(t.servers=[t.servers]),t.servers&&0===t.servers.length&&(t.servers=[e]);const r=Ct(Er(),t);if(t.user&&t.token)throw O.errorForCode(y.BAD_AUTHENTICATION);if(t.authenticator&&(t.token||t.user||t.pass))throw O.errorForCode(y.BAD_AUTHENTICATION);if(r.authenticator=Ar(r),["reconnectDelayHandler","authenticator"].forEach(t=>{if(r[t]&&"function"!==typeof r[t])throw new O(t+" option should be a function",y.NOT_FUNC)}),r.reconnectDelayHandler||(r.reconnectDelayHandler=()=>{let t=r.tls?r.reconnectJitterTLS:r.reconnectJitter;return t&&(t++,t=Math.floor(Math.random()*t)),r.reconnectTimeWait+t}),r.inboxPrefix)try{Pe(r.inboxPrefix)}catch(n){throw new O(n.message,y.API_ERROR)}return r}const xr=Nr;function Ir(t,e){const{proto:r,tls_required:n}=t;if((void 0===r||r<1)&&e.noEcho)throw new O("noEcho",y.SERVER_OPTION_NA);if(e.tls&&!n)throw new O("tls",y.SERVER_OPTION_NA)}const kr=Ir;class Tr{constructor(t){this.draining=!1,this.options=xr(t),this.listeners=[]}static connect(t={}){return new Promise((e,r)=>{const n=new Tr(t);tr.connect(n.options,n).then(t=>{n.protocol=t,async function(){for await(const e of t.status())n.listeners.forEach(t=>{t.push(e)})}(),e(n)}).catch(t=>{r(t)})})}closed(){return this.protocol.closed}async close(){await this.protocol.close()}publish(t,e=P,r){if(t=t||"",0===t.length)throw O.errorForCode(y.BAD_SUBJECT);if(e&&!bt(e))throw O.errorForCode(y.BAD_PAYLOAD);this.protocol.publish(t,e,r)}subscribe(t,e={}){if(this.isClosed())throw O.errorForCode(y.CONNECTION_CLOSED);if(this.isDraining())throw O.errorForCode(y.CONNECTION_DRAINING);if(t=t||"",0===t.length)throw O.errorForCode(y.BAD_SUBJECT);const r=new Jt(this.protocol,t,e);return this.protocol.subscribe(r),r}request(t,e=P,r={timeout:1e3,noMux:!1}){if(this.isClosed())return Promise.reject(O.errorForCode(y.CONNECTION_CLOSED));if(this.isDraining())return Promise.reject(O.errorForCode(y.CONNECTION_DRAINING));if(t=t||"",0===t.length)return Promise.reject(O.errorForCode(y.BAD_SUBJECT));if(r.timeout=r.timeout||1e3,r.timeout<1)return Promise.reject(new O("timeout",y.INVALID_OPTION));if(!r.noMux&&r.reply)return Promise.reject(new O("reply can only be used with noMux",y.INVALID_OPTION));if(r.noMux){const n=r.reply?r.reply:Pe(this.options.inboxPrefix),i=Lt();return this.subscribe(n,{max:1,timeout:r.timeout,callback:(t,e)=>{t?i.reject(t):(t=it(e),t?i.reject(t):i.resolve(e))}}),this.publish(t,e,{reply:n}),i}{const i=new rr(this.protocol.muxSubscriptions,r);this.protocol.request(i);try{this.publish(t,e,{reply:`${this.protocol.muxSubscriptions.baseInbox}${i.token}`,headers:r.headers})}catch(n){i.cancel(n)}const o=Promise.race([i.timer,i.deferred]);return o.catch(()=>{i.cancel()}),o}}flush(){return this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(O.errorForCode(y.CONNECTION_CLOSED)):this.isDraining()?Promise.reject(O.errorForCode(y.CONNECTION_DRAINING)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const t=this.protocol.getServer();return t?t.listen:""}status(){const t=new Wt;return this.listeners.push(t),t}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}}const Mr="1.0.0-122",Rr="nats.ws";class $r{constructor(){this.version=Mr,this.lang=Rr,this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=Kt(),this.closedNotification=Kt()}connect(t,e){const r=!1,n=Lt();if(e.tls)return n.reject(new O("tls",y.INVALID_OPTION)),n;this.options=e;const i=t.src;return this.encrypted=0===i.indexOf("wss://"),this.socket=new WebSocket(i),this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{},this.socket.onmessage=t=>{if(this.yields.push(new Uint8Array(t.data)),this.peeked)return void this.signal.resolve();const r=dt.concat(...this.yields),i=At(r);if(i){const t=Se.exec(i);if(!t)return e.debug&&console.error("!!!",Nt(r)),void n.reject(new Error("unexpected response from server"));try{const e=JSON.parse(t[1]);kr(e,this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),n.resolve()}catch(o){return void n.reject(o)}}},this.socket.onclose=t=>{let e;this.socketClosed=!0,this.done||(t.wasClean||(e=new Error(t.reason)),this._closed(e))},this.socket.onerror=t=>{const e=t,i=new S(e.message,m.UNKNOWN,new Error(e.error));r?this._closed(i):n.reject(i)},n}disconnect(){this._closed(void 0,!0)}async _closed(t,e=!0){if(this.connected&&!this.done){if(this.closeError=t,!t)while(!this.socketClosed&&this.socket.bufferedAmount>0)console.log(this.socket.bufferedAmount),await $t(100);this.done=!0;try{this.socket.close(t?1002:1e3,t?t.message:void 0)}catch(t){}e&&this.closedNotification.resolve(t)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){while(1){0===this.yields.length&&await this.signal;const t=this.yields;this.yields=[];for(let e=0;e "+Et(t[e])),yield t[e];if(this.done)break;0===this.yields.length&&(t.length=0,this.yields=t,this.signal=Kt())}}isEncrypted(){return this.connected&&this.encrypted}send(t){if(this.done)return Promise.resolve();try{return this.socket.send(t.buffer),this.options.debug&&console.info("< "+Et(t)),Promise.resolve()}catch(e){return this.options.debug&&console.error(`!!! ${Et(t)}: ${e}`),Promise.reject(e)}}close(t){return this._closed(t,!1)}closed(){return this.closedNotification}}function Dr(t){const e=/^(.*:\/\/)(.*)/;e.test(t)||(t="https://"+t);let r=new URL(t);const n=r.protocol.toLowerCase();let i,o;"https:"!==n&&"http"!==n&&(t=t.replace(/^(.*:\/\/)(.*)/gm,"$2"),r=new URL("http://"+t));const s=r.hostname,a=r.pathname,c=r.search||"";switch(n){case"http:":case"ws:":case"nats:":o=r.port||"80",i="ws:";break;default:o=r.port||"443",i="wss:";break}return`${i}//${s}:${o}${a}${c}`}function Lr(t={}){return ee({defaultPort:443,urlParseFn:Dr,factory:()=>new $r}),Tr.connect(t)}const jr=Lr},"342f":function(t,e,r){var n=r("d066");t.exports=n("navigator","userAgent")||""},"35a1":function(t,e,r){var n=r("f5df"),i=r("3f8c"),o=r("b622"),s=o("iterator");t.exports=function(t){if(void 0!=t)return t[s]||t["@@iterator"]||i[n(t)]}},"37e8":function(t,e,r){var n=r("83ab"),i=r("9bf2"),o=r("825a"),s=r("df75");t.exports=n?Object.defineProperties:function(t,e){o(t);var r,n=s(e),a=n.length,c=0;while(a>c)i.f(t,r=n[c++],e[r]);return t}},"3bbe":function(t,e,r){var n=r("861d");t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3f8c":function(t,e){t.exports={}},"428f":function(t,e,r){var n=r("da84");t.exports=n},"44ad":function(t,e,r){var n=r("d039"),i=r("c6b6"),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},"44d2":function(t,e,r){var n=r("b622"),i=r("7c73"),o=r("9bf2"),s=n("unscopables"),a=Array.prototype;void 0==a[s]&&o.f(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},"44de":function(t,e,r){var n=r("da84");t.exports=function(t,e){var r=n.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))}},4840:function(t,e,r){var n=r("825a"),i=r("1c0b"),o=r("b622"),s=o("species");t.exports=function(t,e){var r,o=n(t).constructor;return void 0===o||void 0==(r=n(o)[s])?e:i(r)}},4930:function(t,e,r){var n=r("605d"),i=r("2d00"),o=r("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!Symbol.sham&&(n?38===i:i>37&&i<41)}))},"4d64":function(t,e,r){var n=r("fc6a"),i=r("50c4"),o=r("23cb"),s=function(t){return function(e,r,s){var a,c=n(e),u=i(c.length),l=o(s,u);if(t&&r!=r){while(u>l)if(a=c[l++],a!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},"50c4":function(t,e,r){var n=r("a691"),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},5135:function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},5692:function(t,e,r){var n=r("c430"),i=r("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.9.1",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,r){var n=r("d066"),i=r("241c"),o=r("7418"),s=r("825a");t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(s(t)),r=o.f;return r?e.concat(r(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"605d":function(t,e,r){var n=r("c6b6"),i=r("da84");t.exports="process"==n(i.process)},"60da":function(t,e,r){"use strict";var n=r("83ab"),i=r("d039"),o=r("df75"),s=r("7418"),a=r("d1e7"),c=r("7b0b"),u=r("44ad"),l=Object.assign,f=Object.defineProperty;t.exports=!l||i((function(){if(n&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),i="abcdefghijklmnopqrst";return t[r]=7,i.split("").forEach((function(t){e[t]=t})),7!=l({},t)[r]||o(l({},e)).join("")!=i}))?function(t,e){var r=c(t),i=arguments.length,l=1,f=s.f,h=a.f;while(i>l){var d,p=u(arguments[l++]),v=f?o(p).concat(f(p)):o(p),y=v.length,g=0;while(y>g)d=v[g++],n&&!h.call(p,d)||(r[d]=p[d])}return r}:l},"69f3":function(t,e,r){var n,i,o,s=r("7f9a"),a=r("da84"),c=r("861d"),u=r("9112"),l=r("5135"),f=r("c6cd"),h=r("f772"),d=r("d012"),p=a.WeakMap,v=function(t){return o(t)?i(t):n(t,{})},y=function(t){return function(e){var r;if(!c(e)||(r=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(s){var g=f.state||(f.state=new p),m=g.get,b=g.has,_=g.set;n=function(t,e){return e.facade=t,_.call(g,t,e),e},i=function(t){return m.call(g,t)||{}},o=function(t){return b.call(g,t)}}else{var w=h("state");d[w]=!0,n=function(t,e){return e.facade=t,u(t,w,e),e},i=function(t){return l(t,w)?t[w]:{}},o=function(t){return l(t,w)}}t.exports={set:n,get:i,has:o,enforce:v,getterFor:y}},"6eeb":function(t,e,r){var n=r("da84"),i=r("9112"),o=r("5135"),s=r("ce4e"),a=r("8925"),c=r("69f3"),u=c.get,l=c.enforce,f=String(String).split("String");(t.exports=function(t,e,r,a){var c,u=!!a&&!!a.unsafe,h=!!a&&!!a.enumerable,d=!!a&&!!a.noTargetGet;"function"==typeof r&&("string"!=typeof e||o(r,"name")||i(r,"name",e),c=l(r),c.source||(c.source=f.join("string"==typeof e?e:""))),t!==n?(u?!d&&t[e]&&(h=!0):delete t[e],h?t[e]=r:i(t,e,r)):h?t[e]=r:s(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||a(this)}))},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,r){var n=r("1d80");t.exports=function(t){return Object(n(t))}},"7c73":function(t,e,r){var n,i=r("825a"),o=r("37e8"),s=r("7839"),a=r("d012"),c=r("1be4"),u=r("cc12"),l=r("f772"),f=">",h="<",d="prototype",p="script",v=l("IE_PROTO"),y=function(){},g=function(t){return h+p+f+t+h+"/"+p+f},m=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=u("iframe"),r="java"+p+":";return e.style.display="none",c.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(g("document.F=Object")),t.close(),t.F},_=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}_=n?m(n):b();var t=s.length;while(t--)delete _[d][s[t]];return _()};a[v]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(y[d]=i(t),r=new y,y[d]=null,r[v]=t):r=_(),void 0===e?r:o(r,e)}},"7dd0":function(t,e,r){"use strict";var n=r("23e7"),i=r("9ed3"),o=r("e163"),s=r("d2bb"),a=r("d44e"),c=r("9112"),u=r("6eeb"),l=r("b622"),f=r("c430"),h=r("3f8c"),d=r("ae93"),p=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,y=l("iterator"),g="keys",m="values",b="entries",_=function(){return this};t.exports=function(t,e,r,l,d,w,O){i(r,e,l);var A,S,C,P=function(t){if(t===d&&k)return k;if(!v&&t in x)return x[t];switch(t){case g:return function(){return new r(this,t)};case m:return function(){return new r(this,t)};case b:return function(){return new r(this,t)}}return function(){return new r(this)}},E=e+" Iterator",N=!1,x=t.prototype,I=x[y]||x["@@iterator"]||d&&x[d],k=!v&&I||P(d),T="Array"==e&&x.entries||I;if(T&&(A=o(T.call(new t)),p!==Object.prototype&&A.next&&(f||o(A)===p||(s?s(A,p):"function"!=typeof A[y]&&c(A,y,_)),a(A,E,!0,!0),f&&(h[E]=_))),d==m&&I&&I.name!==m&&(N=!0,k=function(){return I.call(this)}),f&&!O||x[y]===k||c(x,y,k),h[e]=k,d)if(S={values:P(m),keys:w?k:P(g),entries:P(b)},O)for(C in S)(v||N||!(C in x))&&u(x,C,S[C]);else n({target:e,proto:!0,forced:v||N},S);return S}},"7f9a":function(t,e,r){var n=r("da84"),i=r("8925"),o=n.WeakMap;t.exports="function"===typeof o&&/native code/.test(i(o))},"825a":function(t,e,r){var n=r("861d");t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,r){var n=r("d039");t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8925:function(t,e,r){var n=r("c6cd"),i=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return i.call(t)}),t.exports=n.inspectSource},"90e3":function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+n).toString(36)}},9112:function(t,e,r){var n=r("83ab"),i=r("9bf2"),o=r("5c6c");t.exports=n?function(t,e,r){return i.f(t,e,o(1,r))}:function(t,e,r){return t[e]=r,t}},"94ca":function(t,e,r){var n=r("d039"),i=/#|\.prototype\./,o=function(t,e){var r=a[s(t)];return r==u||r!=c&&("function"==typeof e?n(e):!!e)},s=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},"9bf2":function(t,e,r){var n=r("83ab"),i=r("0cfb"),o=r("825a"),s=r("c04e"),a=Object.defineProperty;e.f=n?a:function(t,e,r){if(o(t),e=s(e,!0),o(r),i)try{return a(t,e,r)}catch(n){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},"9ed3":function(t,e,r){"use strict";var n=r("ae93").IteratorPrototype,i=r("7c73"),o=r("5c6c"),s=r("d44e"),a=r("3f8c"),c=function(){return this};t.exports=function(t,e,r){var u=e+" Iterator";return t.prototype=i(n,{next:o(1,r)}),s(t,u,!1,!0),a[u]=c,t}},a4b4:function(t,e,r){var n=r("342f");t.exports=/web0s(?!.*chrome)/i.test(n)},a691:function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},a79d:function(t,e,r){"use strict";var n=r("23e7"),i=r("c430"),o=r("fea9"),s=r("d039"),a=r("d066"),c=r("4840"),u=r("cdf9"),l=r("6eeb"),f=!!o&&s((function(){o.prototype["finally"].call({then:function(){}},(function(){}))}));n({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(t){var e=c(this,a("Promise")),r="function"==typeof t;return this.then(r?function(r){return u(e,t()).then((function(){return r}))}:t,r?function(r){return u(e,t()).then((function(){throw r}))}:t)}}),i||"function"!=typeof o||o.prototype["finally"]||l(o.prototype,"finally",a("Promise").prototype["finally"])},ae93:function(t,e,r){"use strict";var n,i,o,s=r("d039"),a=r("e163"),c=r("9112"),u=r("5135"),l=r("b622"),f=r("c430"),h=l("iterator"),d=!1,p=function(){return this};[].keys&&(o=[].keys(),"next"in o?(i=a(a(o)),i!==Object.prototype&&(n=i)):d=!0);var v=void 0==n||s((function(){var t={};return n[h].call(t)!==t}));v&&(n={}),f&&!v||u(n,h)||c(n,h,p),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},b575:function(t,e,r){var n,i,o,s,a,c,u,l,f=r("da84"),h=r("06cf").f,d=r("2cf4").set,p=r("1cdc"),v=r("a4b4"),y=r("605d"),g=f.MutationObserver||f.WebKitMutationObserver,m=f.document,b=f.process,_=f.Promise,w=h(f,"queueMicrotask"),O=w&&w.value;O||(n=function(){var t,e;y&&(t=b.domain)&&t.exit();while(i){e=i.fn,i=i.next;try{e()}catch(r){throw i?s():o=void 0,r}}o=void 0,t&&t.enter()},p||y||v||!g||!m?_&&_.resolve?(u=_.resolve(void 0),l=u.then,s=function(){l.call(u,n)}):s=y?function(){b.nextTick(n)}:function(){d.call(f,n)}:(a=!0,c=m.createTextNode(""),new g(n).observe(c,{characterData:!0}),s=function(){c.data=a=!a})),t.exports=O||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,s()),o=e}},b622:function(t,e,r){var n=r("da84"),i=r("5692"),o=r("5135"),s=r("90e3"),a=r("4930"),c=r("fdbf"),u=i("wks"),l=n.Symbol,f=c?l:l&&l.withoutSetter||s;t.exports=function(t){return o(u,t)&&(a||"string"==typeof u[t])||(a&&o(l,t)?u[t]=l[t]:u[t]=f("Symbol."+t)),u[t]}},c04e:function(t,e,r){var n=r("861d");t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},c6cd:function(t,e,r){var n=r("da84"),i=r("ce4e"),o="__core-js_shared__",s=n[o]||i(o,{});t.exports=s},c8ba:function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}t.exports=r},ca84:function(t,e,r){var n=r("5135"),i=r("fc6a"),o=r("4d64").indexOf,s=r("d012");t.exports=function(t,e){var r,a=i(t),c=0,u=[];for(r in a)!n(s,r)&&n(a,r)&&u.push(r);while(e.length>c)n(a,r=e[c++])&&(~o(u,r)||u.push(r));return u}},cc12:function(t,e,r){var n=r("da84"),i=r("861d"),o=n.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},cca6:function(t,e,r){var n=r("23e7"),i=r("60da");n({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},cdf9:function(t,e,r){var n=r("825a"),i=r("861d"),o=r("f069");t.exports=function(t,e){if(n(t),i(e)&&e.constructor===t)return e;var r=o.f(t),s=r.resolve;return s(e),r.promise}},ce4e:function(t,e,r){var n=r("da84"),i=r("9112");t.exports=function(t,e){try{i(n,t,e)}catch(r){n[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,r){var n=r("428f"),i=r("da84"),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t])||o(i[t]):n[t]&&n[t][e]||i[t]&&i[t][e]}},d1e7:function(t,e,r){"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!n.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},d2bb:function(t,e,r){var n=r("825a"),i=r("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(r,[]),e=r instanceof Array}catch(o){}return function(r,o){return n(r),i(o),e?t.call(r,o):r.__proto__=o,r}}():void 0)},d44e:function(t,e,r){var n=r("9bf2").f,i=r("5135"),o=r("b622"),s=o("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,s)&&n(t,s,{configurable:!0,value:e})}},da84:function(t,e,r){(function(e){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,r("c8ba"))},df75:function(t,e,r){var n=r("ca84"),i=r("7839");t.exports=Object.keys||function(t){return n(t,i)}},e163:function(t,e,r){var n=r("5135"),i=r("7b0b"),o=r("f772"),s=r("e177"),a=o("IE_PROTO"),c=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){return t=i(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},e177:function(t,e,r){var n=r("d039");t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,r){"use strict";var n=r("fc6a"),i=r("44d2"),o=r("3f8c"),s=r("69f3"),a=r("7dd0"),c="Array Iterator",u=s.set,l=s.getterFor(c);t.exports=a(Array,"Array",(function(t,e){u(this,{type:c,target:n(t),index:0,kind:e})}),(function(){var t=l(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},e2cc:function(t,e,r){var n=r("6eeb");t.exports=function(t,e,r){for(var i in e)n(t,i,e[i],r);return t}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,r){"use strict";var n,i,o,s,a=r("23e7"),c=r("c430"),u=r("da84"),l=r("d066"),f=r("fea9"),h=r("6eeb"),d=r("e2cc"),p=r("d44e"),v=r("2626"),y=r("861d"),g=r("1c0b"),m=r("19aa"),b=r("8925"),_=r("2266"),w=r("1c7e"),O=r("4840"),A=r("2cf4").set,S=r("b575"),C=r("cdf9"),P=r("44de"),E=r("f069"),N=r("e667"),x=r("69f3"),I=r("94ca"),k=r("b622"),T=r("605d"),M=r("2d00"),R=k("species"),$="Promise",D=x.get,L=x.set,j=x.getterFor($),U=f,B=u.TypeError,F=u.document,G=u.process,K=l("fetch"),H=E.f,V=H,z=!!(F&&F.createEvent&&u.dispatchEvent),q="function"==typeof PromiseRejectionEvent,W="unhandledrejection",Y="rejectionhandled",J=0,X=1,Z=2,Q=1,tt=2,et=I($,(function(){var t=b(U)!==String(U);if(!t){if(66===M)return!0;if(!T&&!q)return!0}if(c&&!U.prototype["finally"])return!0;if(M>=51&&/native code/.test(U))return!1;var e=U.resolve(1),r=function(t){t((function(){}),(function(){}))},n=e.constructor={};return n[R]=r,!(e.then((function(){}))instanceof r)})),rt=et||!w((function(t){U.all(t)["catch"]((function(){}))})),nt=function(t){var e;return!(!y(t)||"function"!=typeof(e=t.then))&&e},it=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;S((function(){var n=t.value,i=t.state==X,o=0;while(r.length>o){var s,a,c,u=r[o++],l=i?u.ok:u.fail,f=u.resolve,h=u.reject,d=u.domain;try{l?(i||(t.rejection===tt&&ct(t),t.rejection=Q),!0===l?s=n:(d&&d.enter(),s=l(n),d&&(d.exit(),c=!0)),s===u.promise?h(B("Promise-chain cycle")):(a=nt(s))?a.call(s,f,h):f(s)):h(n)}catch(p){d&&!c&&d.exit(),h(p)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&st(t)}))}},ot=function(t,e,r){var n,i;z?(n=F.createEvent("Event"),n.promise=e,n.reason=r,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:r},!q&&(i=u["on"+t])?i(n):t===W&&P("Unhandled promise rejection",r)},st=function(t){A.call(u,(function(){var e,r=t.facade,n=t.value,i=at(t);if(i&&(e=N((function(){T?G.emit("unhandledRejection",n,r):ot(W,r,n)})),t.rejection=T||at(t)?tt:Q,e.error))throw e.value}))},at=function(t){return t.rejection!==Q&&!t.parent},ct=function(t){A.call(u,(function(){var e=t.facade;T?G.emit("rejectionHandled",e):ot(Y,e,t.value)}))},ut=function(t,e,r){return function(n){t(e,n,r)}},lt=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=Z,it(t,!0))},ft=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw B("Promise can't be resolved itself");var n=nt(e);n?S((function(){var r={done:!1};try{n.call(e,ut(ft,r,t),ut(lt,r,t))}catch(i){lt(r,i,t)}})):(t.value=e,t.state=X,it(t,!1))}catch(i){lt({done:!1},i,t)}}};et&&(U=function(t){m(this,U,$),g(t),n.call(this);var e=D(this);try{t(ut(ft,e),ut(lt,e))}catch(r){lt(e,r)}},n=function(t){L(this,{type:$,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:J,value:void 0})},n.prototype=d(U.prototype,{then:function(t,e){var r=j(this),n=H(O(this,U));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=T?G.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=J&&it(r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new n,e=D(t);this.promise=t,this.resolve=ut(ft,e),this.reject=ut(lt,e)},E.f=H=function(t){return t===U||t===o?new i(t):V(t)},c||"function"!=typeof f||(s=f.prototype.then,h(f.prototype,"then",(function(t,e){var r=this;return new U((function(t,e){s.call(r,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof K&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return C(U,K.apply(u,arguments))}}))),a({global:!0,wrap:!0,forced:et},{Promise:U}),p(U,$,!1,!0),v($),o=l($),a({target:$,stat:!0,forced:et},{reject:function(t){var e=H(this);return e.reject.call(void 0,t),e.promise}}),a({target:$,stat:!0,forced:c||et},{resolve:function(t){return C(c&&this===o?U:this,t)}}),a({target:$,stat:!0,forced:rt},{all:function(t){var e=this,r=H(e),n=r.resolve,i=r.reject,o=N((function(){var r=g(e.resolve),o=[],s=0,a=1;_(t,(function(t){var c=s++,u=!1;o.push(void 0),a++,r.call(e,t).then((function(t){u||(u=!0,o[c]=t,--a||n(o))}),i)})),--a||n(o)}));return o.error&&i(o.value),r.promise},race:function(t){var e=this,r=H(e),n=r.reject,i=N((function(){var i=g(e.resolve);_(t,(function(t){i.call(e,t).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},e893:function(t,e,r){var n=r("5135"),i=r("56ef"),o=r("06cf"),s=r("9bf2");t.exports=function(t,e){for(var r=i(e),a=s.f,c=o.f,u=0;u