coinrayjs 2.0.5 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/coinrayjs.js CHANGED
@@ -1,19 +1,19 @@
1
- var Coinray=(function(ee){"use strict";function Lc(t,e){return function(){return t.apply(e,arguments)}}const{toString:Lp}=Object.prototype,{getPrototypeOf:Ka}=Object,{iterator:is,toStringTag:Nc}=Symbol,ss=(t=>e=>{const n=Lp.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ir=t=>(t=t.toLowerCase(),e=>ss(e)===t),as=t=>e=>typeof e===t,{isArray:Ln}=Array,Nn=as("undefined");function fi(t){return t!==null&&!Nn(t)&&t.constructor!==null&&!Nn(t.constructor)&&Et(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Uc=ir("ArrayBuffer");function Np(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Uc(t.buffer),e}const Up=as("string"),Et=as("function"),Bc=as("number"),hi=t=>t!==null&&typeof t=="object",Bp=t=>t===!0||t===!1,os=t=>{if(ss(t)!=="object")return!1;const e=Ka(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Nc in t)&&!(is in t)},Ip=t=>{if(!hi(t)||fi(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Fp=ir("Date"),Wp=ir("File"),Hp=ir("Blob"),Yp=ir("FileList"),Kp=t=>hi(t)&&Et(t.pipe),qp=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Et(t.append)&&((e=ss(t))==="formdata"||e==="object"&&Et(t.toString)&&t.toString()==="[object FormData]"))},$p=ir("URLSearchParams"),[Gp,Vp,zp,jp]=["ReadableStream","Request","Response","Headers"].map(ir),Jp=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function di(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,a;if(typeof t!="object"&&(t=[t]),Ln(t))for(s=0,a=t.length;s<a;s++)e.call(null,t[s],s,t);else{if(fi(t))return;const c=n?Object.getOwnPropertyNames(t):Object.keys(t),u=c.length;let l;for(s=0;s<u;s++)l=c[s],e.call(null,t[l],l,t)}}function Ic(t,e){if(fi(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,a;for(;s-- >0;)if(a=n[s],e===a.toLowerCase())return a;return null}const dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Fc=t=>!Nn(t)&&t!==dn;function qa(){const{caseless:t,skipUndefined:e}=Fc(this)&&this||{},n={},s=(a,c)=>{const u=t&&Ic(n,c)||c;os(n[u])&&os(a)?n[u]=qa(n[u],a):os(a)?n[u]=qa({},a):Ln(a)?n[u]=a.slice():(!e||!Nn(a))&&(n[u]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&di(arguments[a],s);return n}const Qp=(t,e,n,{allOwnKeys:s}={})=>(di(e,(a,c)=>{n&&Et(a)?t[c]=Lc(a,n):t[c]=a},{allOwnKeys:s}),t),Zp=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xp=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},em=(t,e,n,s)=>{let a,c,u;const l={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),c=a.length;c-- >0;)u=a[c],(!s||s(u,t,e))&&!l[u]&&(e[u]=t[u],l[u]=!0);t=n!==!1&&Ka(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},tm=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},rm=t=>{if(!t)return null;if(Ln(t))return t;let e=t.length;if(!Bc(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},nm=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ka(Uint8Array)),im=(t,e)=>{const s=(t&&t[is]).call(t);let a;for(;(a=s.next())&&!a.done;){const c=a.value;e.call(t,c[0],c[1])}},sm=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},am=ir("HTMLFormElement"),om=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,a){return s.toUpperCase()+a}),Wc=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),um=ir("RegExp"),Hc=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};di(n,(a,c)=>{let u;(u=e(a,c,t))!==!1&&(s[c]=u||a)}),Object.defineProperties(t,s)},cm=t=>{Hc(t,(e,n)=>{if(Et(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(Et(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lm=(t,e)=>{const n={},s=a=>{a.forEach(c=>{n[c]=!0})};return Ln(t)?s(t):s(String(t).split(e)),n},fm=()=>{},hm=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function dm(t){return!!(t&&Et(t.append)&&t[Nc]==="FormData"&&t[is])}const pm=t=>{const e=new Array(10),n=(s,a)=>{if(hi(s)){if(e.indexOf(s)>=0)return;if(fi(s))return s;if(!("toJSON"in s)){e[a]=s;const c=Ln(s)?[]:{};return di(s,(u,l)=>{const h=n(u,a+1);!Nn(h)&&(c[l]=h)}),e[a]=void 0,c}}return s};return n(t,0)},mm=ir("AsyncFunction"),gm=t=>t&&(hi(t)||Et(t))&&Et(t.then)&&Et(t.catch),Yc=((t,e)=>t?setImmediate:e?((n,s)=>(dn.addEventListener("message",({source:a,data:c})=>{a===dn&&c===n&&s.length&&s.shift()()},!1),a=>{s.push(a),dn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Et(dn.postMessage)),ym=typeof queueMicrotask<"u"?queueMicrotask.bind(dn):typeof process<"u"&&process.nextTick||Yc,U={isArray:Ln,isArrayBuffer:Uc,isBuffer:fi,isFormData:qp,isArrayBufferView:Np,isString:Up,isNumber:Bc,isBoolean:Bp,isObject:hi,isPlainObject:os,isEmptyObject:Ip,isReadableStream:Gp,isRequest:Vp,isResponse:zp,isHeaders:jp,isUndefined:Nn,isDate:Fp,isFile:Wp,isBlob:Hp,isRegExp:um,isFunction:Et,isStream:Kp,isURLSearchParams:$p,isTypedArray:nm,isFileList:Yp,forEach:di,merge:qa,extend:Qp,trim:Jp,stripBOM:Zp,inherits:Xp,toFlatObject:em,kindOf:ss,kindOfTest:ir,endsWith:tm,toArray:rm,forEachEntry:im,matchAll:sm,isHTMLForm:am,hasOwnProperty:Wc,hasOwnProp:Wc,reduceDescriptors:Hc,freezeMethods:cm,toObjectSet:lm,toCamelCase:om,noop:fm,toFiniteNumber:hm,findKey:Ic,global:dn,isContextDefined:Fc,isSpecCompliantForm:dm,toJSONObject:pm,isAsyncFn:mm,isThenable:gm,setImmediate:Yc,asap:ym,isIterable:t=>t!=null&&Et(t[is])};function he(t,e,n,s,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),a&&(this.response=a,this.status=a.status?a.status:null)}U.inherits(he,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.status}}});const Kc=he.prototype,qc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{qc[t]={value:t}}),Object.defineProperties(he,qc),Object.defineProperty(Kc,"isAxiosError",{value:!0}),he.from=(t,e,n,s,a,c)=>{const u=Object.create(Kc);U.toFlatObject(t,u,function(b){return b!==Error.prototype},m=>m!=="isAxiosError");const l=t&&t.message?t.message:"Error",h=e==null&&t?t.code:e;return he.call(u,l,h,n,s,a),t&&u.cause==null&&Object.defineProperty(u,"cause",{value:t,configurable:!0}),u.name=t&&t.name||"Error",c&&Object.assign(u,c),u};const _m=null;function $a(t){return U.isPlainObject(t)||U.isArray(t)}function $c(t){return U.endsWith(t,"[]")?t.slice(0,-2):t}function Gc(t,e,n){return t?t.concat(e).map(function(a,c){return a=$c(a),!n&&c?"["+a+"]":a}).join(n?".":""):e}function wm(t){return U.isArray(t)&&!t.some($a)}const bm=U.toFlatObject(U,{},null,function(e){return/^is[A-Z]/.test(e)});function us(t,e,n){if(!U.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,F){return!U.isUndefined(F[I])});const s=n.metaTokens,a=n.visitor||b,c=n.dots,u=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(e);if(!U.isFunction(a))throw new TypeError("visitor must be a function");function m(O){if(O===null)return"";if(U.isDate(O))return O.toISOString();if(U.isBoolean(O))return O.toString();if(!h&&U.isBlob(O))throw new he("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(O)||U.isTypedArray(O)?h&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function b(O,I,F){let ne=O;if(O&&!F&&typeof O=="object"){if(U.endsWith(I,"{}"))I=s?I:I.slice(0,-2),O=JSON.stringify(O);else if(U.isArray(O)&&wm(O)||(U.isFileList(O)||U.endsWith(I,"[]"))&&(ne=U.toArray(O)))return I=$c(I),ne.forEach(function(Ae,ve){!(U.isUndefined(Ae)||Ae===null)&&e.append(u===!0?Gc([I],ve,c):u===null?I:I+"[]",m(Ae))}),!1}return $a(O)?!0:(e.append(Gc(F,I,c),m(O)),!1)}const T=[],P=Object.assign(bm,{defaultVisitor:b,convertValue:m,isVisitable:$a});function $(O,I){if(!U.isUndefined(O)){if(T.indexOf(O)!==-1)throw Error("Circular reference detected in "+I.join("."));T.push(O),U.forEach(O,function(ne,Y){(!(U.isUndefined(ne)||ne===null)&&a.call(e,ne,U.isString(Y)?Y.trim():Y,I,P))===!0&&$(ne,I?I.concat(Y):[Y])}),T.pop()}}if(!U.isObject(t))throw new TypeError("data must be an object");return $(t),e}function Vc(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ga(t,e){this._pairs=[],t&&us(t,this,e)}const zc=Ga.prototype;zc.append=function(e,n){this._pairs.push([e,n])},zc.toString=function(e){const n=e?function(s){return e.call(this,s,Vc)}:Vc;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Sm(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jc(t,e,n){if(!e)return t;const s=n&&n.encode||Sm;U.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let c;if(a?c=a(e,n):c=U.isURLSearchParams(e)?e.toString():new Ga(e,n).toString(s),c){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+c}return t}class Jc{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Qc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ga,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Va=typeof window<"u"&&typeof document<"u",za=typeof navigator=="object"&&navigator||void 0,Tm=Va&&(!za||["ReactNative","NativeScript","NS"].indexOf(za.product)<0),Em=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Am=Va&&window.location.href||"http://localhost",dt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Va,hasStandardBrowserEnv:Tm,hasStandardBrowserWebWorkerEnv:Em,navigator:za,origin:Am},Symbol.toStringTag,{value:"Module"})),...vm};function Om(t,e){return us(t,new dt.classes.URLSearchParams,{visitor:function(n,s,a,c){return dt.isNode&&U.isBuffer(n)?(this.append(s,n.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...e})}function km(t){return U.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Cm(t){const e={},n=Object.keys(t);let s;const a=n.length;let c;for(s=0;s<a;s++)c=n[s],e[c]=t[c];return e}function Zc(t){function e(n,s,a,c){let u=n[c++];if(u==="__proto__")return!0;const l=Number.isFinite(+u),h=c>=n.length;return u=!u&&U.isArray(a)?a.length:u,h?(U.hasOwnProp(a,u)?a[u]=[a[u],s]:a[u]=s,!l):((!a[u]||!U.isObject(a[u]))&&(a[u]=[]),e(n,s,a[u],c)&&U.isArray(a[u])&&(a[u]=Cm(a[u])),!l)}if(U.isFormData(t)&&U.isFunction(t.entries)){const n={};return U.forEachEntry(t,(s,a)=>{e(km(s),a,n,0)}),n}return null}function xm(t,e,n){if(U.isString(t))try{return(e||JSON.parse)(t),U.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const pi={transitional:Qc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",a=s.indexOf("application/json")>-1,c=U.isObject(e);if(c&&U.isHTMLForm(e)&&(e=new FormData(e)),U.isFormData(e))return a?JSON.stringify(Zc(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e)||U.isReadableStream(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(c){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Om(e,this.formSerializer).toString();if((l=U.isFileList(e))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return us(l?{"files[]":e}:e,h&&new h,this.formSerializer)}}return c||a?(n.setContentType("application/json",!1),xm(e)):e}],transformResponse:[function(e){const n=this.transitional||pi.transitional,s=n&&n.forcedJSONParsing,a=this.responseType==="json";if(U.isResponse(e)||U.isReadableStream(e))return e;if(e&&U.isString(e)&&(s&&!this.responseType||a)){const u=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(l){if(u)throw l.name==="SyntaxError"?he.from(l,he.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],t=>{pi.headers[t]={}});const Pm=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rm=t=>{const e={};let n,s,a;return t&&t.split(`
2
- `).forEach(function(u){a=u.indexOf(":"),n=u.substring(0,a).trim().toLowerCase(),s=u.substring(a+1).trim(),!(!n||e[n]&&Pm[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},Xc=Symbol("internals");function mi(t){return t&&String(t).trim().toLowerCase()}function cs(t){return t===!1||t==null?t:U.isArray(t)?t.map(cs):String(t)}function Dm(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const Mm=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ja(t,e,n,s,a){if(U.isFunction(s))return s.call(this,e,n);if(a&&(e=n),!!U.isString(e)){if(U.isString(s))return e.indexOf(s)!==-1;if(U.isRegExp(s))return s.test(e)}}function Lm(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Nm(t,e){const n=U.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(a,c,u){return this[s].call(this,e,a,c,u)},configurable:!0})})}let At=class{constructor(e){e&&this.set(e)}set(e,n,s){const a=this;function c(l,h,m){const b=mi(h);if(!b)throw new Error("header name must be a non-empty string");const T=U.findKey(a,b);(!T||a[T]===void 0||m===!0||m===void 0&&a[T]!==!1)&&(a[T||h]=cs(l))}const u=(l,h)=>U.forEach(l,(m,b)=>c(m,b,h));if(U.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(U.isString(e)&&(e=e.trim())&&!Mm(e))u(Rm(e),n);else if(U.isObject(e)&&U.isIterable(e)){let l={},h,m;for(const b of e){if(!U.isArray(b))throw TypeError("Object iterator must return a key-value pair");l[m=b[0]]=(h=l[m])?U.isArray(h)?[...h,b[1]]:[h,b[1]]:b[1]}u(l,n)}else e!=null&&c(n,e,s);return this}get(e,n){if(e=mi(e),e){const s=U.findKey(this,e);if(s){const a=this[s];if(!n)return a;if(n===!0)return Dm(a);if(U.isFunction(n))return n.call(this,a,s);if(U.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=mi(e),e){const s=U.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||ja(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let a=!1;function c(u){if(u=mi(u),u){const l=U.findKey(s,u);l&&(!n||ja(s,s[l],l,n))&&(delete s[l],a=!0)}}return U.isArray(e)?e.forEach(c):c(e),a}clear(e){const n=Object.keys(this);let s=n.length,a=!1;for(;s--;){const c=n[s];(!e||ja(this,this[c],c,e,!0))&&(delete this[c],a=!0)}return a}normalize(e){const n=this,s={};return U.forEach(this,(a,c)=>{const u=U.findKey(s,c);if(u){n[u]=cs(a),delete n[c];return}const l=e?Lm(c):String(c).trim();l!==c&&delete n[c],n[l]=cs(a),s[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return U.forEach(this,(s,a)=>{s!=null&&s!==!1&&(n[a]=e&&U.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(a=>s.set(a)),s}static accessor(e){const s=(this[Xc]=this[Xc]={accessors:{}}).accessors,a=this.prototype;function c(u){const l=mi(u);s[l]||(Nm(a,u),s[l]=!0)}return U.isArray(e)?e.forEach(c):c(e),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(At.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),U.freezeMethods(At);function Ja(t,e){const n=this||pi,s=e||n,a=At.from(s.headers);let c=s.data;return U.forEach(t,function(l){c=l.call(n,c,a.normalize(),e?e.status:void 0)}),a.normalize(),c}function el(t){return!!(t&&t.__CANCEL__)}function Un(t,e,n){he.call(this,t??"canceled",he.ERR_CANCELED,e,n),this.name="CanceledError"}U.inherits(Un,he,{__CANCEL__:!0});function tl(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Um(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Bm(t,e){t=t||10;const n=new Array(t),s=new Array(t);let a=0,c=0,u;return e=e!==void 0?e:1e3,function(h){const m=Date.now(),b=s[c];u||(u=m),n[a]=h,s[a]=m;let T=c,P=0;for(;T!==a;)P+=n[T++],T=T%t;if(a=(a+1)%t,a===c&&(c=(c+1)%t),m-u<e)return;const $=b&&m-b;return $?Math.round(P*1e3/$):void 0}}function Im(t,e){let n=0,s=1e3/e,a,c;const u=(m,b=Date.now())=>{n=b,a=null,c&&(clearTimeout(c),c=null),t(...m)};return[(...m)=>{const b=Date.now(),T=b-n;T>=s?u(m,b):(a=m,c||(c=setTimeout(()=>{c=null,u(a)},s-T)))},()=>a&&u(a)]}const ls=(t,e,n=3)=>{let s=0;const a=Bm(50,250);return Im(c=>{const u=c.loaded,l=c.lengthComputable?c.total:void 0,h=u-s,m=a(h),b=u<=l;s=u;const T={loaded:u,total:l,progress:l?u/l:void 0,bytes:h,rate:m||void 0,estimated:m&&l&&b?(l-u)/m:void 0,event:c,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(T)},n)},rl=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},nl=t=>(...e)=>U.asap(()=>t(...e)),Fm=dt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,dt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(dt.origin),dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent)):()=>!0,Wm=dt.hasStandardBrowserEnv?{write(t,e,n,s,a,c){const u=[t+"="+encodeURIComponent(e)];U.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),U.isString(s)&&u.push("path="+s),U.isString(a)&&u.push("domain="+a),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hm(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ym(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function il(t,e,n){let s=!Hm(e);return t&&(s||n==!1)?Ym(t,e):e}const sl=t=>t instanceof At?{...t}:t;function pn(t,e){e=e||{};const n={};function s(m,b,T,P){return U.isPlainObject(m)&&U.isPlainObject(b)?U.merge.call({caseless:P},m,b):U.isPlainObject(b)?U.merge({},b):U.isArray(b)?b.slice():b}function a(m,b,T,P){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m,T,P)}else return s(m,b,T,P)}function c(m,b){if(!U.isUndefined(b))return s(void 0,b)}function u(m,b){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m)}else return s(void 0,b)}function l(m,b,T){if(T in e)return s(m,b);if(T in t)return s(void 0,m)}const h={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(m,b,T)=>a(sl(m),sl(b),T,!0)};return U.forEach(Object.keys({...t,...e}),function(b){const T=h[b]||a,P=T(t[b],e[b],b);U.isUndefined(P)&&T!==l||(n[b]=P)}),n}const al=t=>{const e=pn({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:c,headers:u,auth:l}=e;if(e.headers=u=At.from(u),e.url=jc(il(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(n)){if(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(U.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([b,T])=>{m.includes(b.toLowerCase())&&u.set(b,T)})}}if(dt.hasStandardBrowserEnv&&(s&&U.isFunction(s)&&(s=s(e)),s||s!==!1&&Fm(e.url))){const h=a&&c&&Wm.read(c);h&&u.set(a,h)}return e},Km=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const a=al(t);let c=a.data;const u=At.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:m}=a,b,T,P,$,O;function I(){$&&$(),O&&O(),a.cancelToken&&a.cancelToken.unsubscribe(b),a.signal&&a.signal.removeEventListener("abort",b)}let F=new XMLHttpRequest;F.open(a.method.toUpperCase(),a.url,!0),F.timeout=a.timeout;function ne(){if(!F)return;const Ae=At.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders()),_e={data:!l||l==="text"||l==="json"?F.responseText:F.response,status:F.status,statusText:F.statusText,headers:Ae,config:t,request:F};tl(function(Pe){n(Pe),I()},function(Pe){s(Pe),I()},_e),F=null}"onloadend"in F?F.onloadend=ne:F.onreadystatechange=function(){!F||F.readyState!==4||F.status===0&&!(F.responseURL&&F.responseURL.indexOf("file:")===0)||setTimeout(ne)},F.onabort=function(){F&&(s(new he("Request aborted",he.ECONNABORTED,t,F)),F=null)},F.onerror=function(ve){const _e=ve&&ve.message?ve.message:"Network Error",Fe=new he(_e,he.ERR_NETWORK,t,F);Fe.event=ve||null,s(Fe),F=null},F.ontimeout=function(){let ve=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _e=a.transitional||Qc;a.timeoutErrorMessage&&(ve=a.timeoutErrorMessage),s(new he(ve,_e.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,t,F)),F=null},c===void 0&&u.setContentType(null),"setRequestHeader"in F&&U.forEach(u.toJSON(),function(ve,_e){F.setRequestHeader(_e,ve)}),U.isUndefined(a.withCredentials)||(F.withCredentials=!!a.withCredentials),l&&l!=="json"&&(F.responseType=a.responseType),m&&([P,O]=ls(m,!0),F.addEventListener("progress",P)),h&&F.upload&&([T,$]=ls(h),F.upload.addEventListener("progress",T),F.upload.addEventListener("loadend",$)),(a.cancelToken||a.signal)&&(b=Ae=>{F&&(s(!Ae||Ae.type?new Un(null,t,F):Ae),F.abort(),F=null)},a.cancelToken&&a.cancelToken.subscribe(b),a.signal&&(a.signal.aborted?b():a.signal.addEventListener("abort",b)));const Y=Um(a.url);if(Y&&dt.protocols.indexOf(Y)===-1){s(new he("Unsupported protocol "+Y+":",he.ERR_BAD_REQUEST,t));return}F.send(c||null)})},qm=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,a;const c=function(m){if(!a){a=!0,l();const b=m instanceof Error?m:this.reason;s.abort(b instanceof he?b:new Un(b instanceof Error?b.message:b))}};let u=e&&setTimeout(()=>{u=null,c(new he(`timeout ${e} of ms exceeded`,he.ETIMEDOUT))},e);const l=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),t=null)};t.forEach(m=>m.addEventListener("abort",c));const{signal:h}=s;return h.unsubscribe=()=>U.asap(l),h}},$m=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,a;for(;s<n;)a=s+e,yield t.slice(s,a),s=a},Gm=async function*(t,e){for await(const n of Vm(t))yield*$m(n,e)},Vm=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},ol=(t,e,n,s)=>{const a=Gm(t,e);let c=0,u,l=h=>{u||(u=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:m,value:b}=await a.next();if(m){l(),h.close();return}let T=b.byteLength;if(n){let P=c+=T;n(P)}h.enqueue(new Uint8Array(b))}catch(m){throw l(m),m}},cancel(h){return l(h),a.return()}},{highWaterMark:2})},ul=64*1024,{isFunction:fs}=U,zm=(({Request:t,Response:e})=>({Request:t,Response:e}))(U.global),{ReadableStream:cl,TextEncoder:ll}=U.global,fl=(t,...e)=>{try{return!!t(...e)}catch{return!1}},jm=t=>{t=U.merge.call({skipUndefined:!0},zm,t);const{fetch:e,Request:n,Response:s}=t,a=e?fs(e):typeof fetch=="function",c=fs(n),u=fs(s);if(!a)return!1;const l=a&&fs(cl),h=a&&(typeof ll=="function"?(O=>I=>O.encode(I))(new ll):async O=>new Uint8Array(await new n(O).arrayBuffer())),m=c&&l&&fl(()=>{let O=!1;const I=new n(dt.origin,{body:new cl,method:"POST",get duplex(){return O=!0,"half"}}).headers.has("Content-Type");return O&&!I}),b=u&&l&&fl(()=>U.isReadableStream(new s("").body)),T={stream:b&&(O=>O.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!T[O]&&(T[O]=(I,F)=>{let ne=I&&I[O];if(ne)return ne.call(I);throw new he(`Response type '${O}' is not supported`,he.ERR_NOT_SUPPORT,F)})});const P=async O=>{if(O==null)return 0;if(U.isBlob(O))return O.size;if(U.isSpecCompliantForm(O))return(await new n(dt.origin,{method:"POST",body:O}).arrayBuffer()).byteLength;if(U.isArrayBufferView(O)||U.isArrayBuffer(O))return O.byteLength;if(U.isURLSearchParams(O)&&(O=O+""),U.isString(O))return(await h(O)).byteLength},$=async(O,I)=>{const F=U.toFiniteNumber(O.getContentLength());return F??P(I)};return async O=>{let{url:I,method:F,data:ne,signal:Y,cancelToken:Ae,timeout:ve,onDownloadProgress:_e,onUploadProgress:Fe,responseType:Pe,headers:y,withCredentials:_="same-origin",fetchOptions:S}=al(O),M=e||fetch;Pe=Pe?(Pe+"").toLowerCase():"text";let k=qm([Y,Ae&&Ae.toAbortSignal()],ve),R=null;const N=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let E;try{if(Fe&&m&&F!=="get"&&F!=="head"&&(E=await $(y,ne))!==0){let J=new n(I,{method:"POST",body:ne,duplex:"half"}),pe;if(U.isFormData(ne)&&(pe=J.headers.get("content-type"))&&y.setContentType(pe),J.body){const[Ne,We]=rl(E,ls(nl(Fe)));ne=ol(J.body,ul,Ne,We)}}U.isString(_)||(_=_?"include":"omit");const C=c&&"credentials"in n.prototype,L={...S,signal:k,method:F.toUpperCase(),headers:y.normalize().toJSON(),body:ne,duplex:"half",credentials:C?_:void 0};R=c&&new n(I,L);let D=await(c?M(R,S):M(I,L));const q=b&&(Pe==="stream"||Pe==="response");if(b&&(_e||q&&N)){const J={};["status","statusText","headers"].forEach(le=>{J[le]=D[le]});const pe=U.toFiniteNumber(D.headers.get("content-length")),[Ne,We]=_e&&rl(pe,ls(nl(_e),!0))||[];D=new s(ol(D.body,ul,Ne,()=>{We&&We(),N&&N()}),J)}Pe=Pe||"text";let te=await T[U.findKey(T,Pe)||"text"](D,O);return!q&&N&&N(),await new Promise((J,pe)=>{tl(J,pe,{data:te,headers:At.from(D.headers),status:D.status,statusText:D.statusText,config:O,request:R})})}catch(C){throw N&&N(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new he("Network Error",he.ERR_NETWORK,O,R),{cause:C.cause||C}):he.from(C,C&&C.code,O,R)}}},Jm=new Map,hl=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:a}=e,c=[s,a,n];let u=c.length,l=u,h,m,b=Jm;for(;l--;)h=c[l],m=b.get(h),m===void 0&&b.set(h,m=l?new Map:jm(e)),b=m;return m};hl();const Qa={http:_m,xhr:Km,fetch:{get:hl}};U.forEach(Qa,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const dl=t=>`- ${t}`,Qm=t=>U.isFunction(t)||t===null||t===!1,pl={getAdapter:(t,e)=>{t=U.isArray(t)?t:[t];const{length:n}=t;let s,a;const c={};for(let u=0;u<n;u++){s=t[u];let l;if(a=s,!Qm(s)&&(a=Qa[(l=String(s)).toLowerCase()],a===void 0))throw new he(`Unknown adapter '${l}'`);if(a&&(U.isFunction(a)||(a=a.get(e))))break;c[l||"#"+u]=a}if(!a){const u=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
4
- `+u.map(dl).join(`
5
- `):" "+dl(u[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a},adapters:Qa};function Za(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Un(null,t)}function ml(t){return Za(t),t.headers=At.from(t.headers),t.data=Ja.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),pl.getAdapter(t.adapter||pi.adapter,t)(t).then(function(s){return Za(t),s.data=Ja.call(t,t.transformResponse,s),s.headers=At.from(s.headers),s},function(s){return el(s)||(Za(t),s&&s.response&&(s.response.data=Ja.call(t,t.transformResponse,s.response),s.response.headers=At.from(s.response.headers))),Promise.reject(s)})}const gl="1.12.2",hs={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{hs[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const yl={};hs.transitional=function(e,n,s){function a(c,u){return"[Axios v"+gl+"] Transitional option '"+c+"'"+u+(s?". "+s:"")}return(c,u,l)=>{if(e===!1)throw new he(a(u," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!yl[u]&&(yl[u]=!0,console.warn(a(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(c,u,l):!0}},hs.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Zm(t,e,n){if(typeof t!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let a=s.length;for(;a-- >0;){const c=s[a],u=e[c];if(u){const l=t[c],h=l===void 0||u(l,c,t);if(h!==!0)throw new he("option "+c+" must be "+h,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+c,he.ERR_BAD_OPTION)}}const ds={assertOptions:Zm,validators:hs},mr=ds.validators;let mn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Jc,response:new Jc}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const c=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+c):s.stack=c}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=pn(this.defaults,n);const{transitional:s,paramsSerializer:a,headers:c}=n;s!==void 0&&ds.assertOptions(s,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),a!=null&&(U.isFunction(a)?n.paramsSerializer={serialize:a}:ds.assertOptions(a,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ds.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=c&&U.merge(c.common,c[n.method]);c&&U.forEach(["delete","get","head","post","put","patch","common"],O=>{delete c[O]}),n.headers=At.concat(u,c);const l=[];let h=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(h=h&&I.synchronous,l.unshift(I.fulfilled,I.rejected))});const m=[];this.interceptors.response.forEach(function(I){m.push(I.fulfilled,I.rejected)});let b,T=0,P;if(!h){const O=[ml.bind(this),void 0];for(O.unshift(...l),O.push(...m),P=O.length,b=Promise.resolve(n);T<P;)b=b.then(O[T++],O[T++]);return b}P=l.length;let $=n;for(;T<P;){const O=l[T++],I=l[T++];try{$=O($)}catch(F){I.call(this,F);break}}try{b=ml.call(this,$)}catch(O){return Promise.reject(O)}for(T=0,P=m.length;T<P;)b=b.then(m[T++],m[T++]);return b}getUri(e){e=pn(this.defaults,e);const n=il(e.baseURL,e.url,e.allowAbsoluteUrls);return jc(n,e.params,e.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(e){mn.prototype[e]=function(n,s){return this.request(pn(s||{},{method:e,url:n,data:(s||{}).data}))}}),U.forEach(["post","put","patch"],function(e){function n(s){return function(c,u,l){return this.request(pn(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}mn.prototype[e]=n(),mn.prototype[e+"Form"]=n(!0)});let Xm=class Mp{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(c){n=c});const s=this;this.promise.then(a=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](a);s._listeners=null}),this.promise.then=a=>{let c;const u=new Promise(l=>{s.subscribe(l),c=l}).then(a);return u.cancel=function(){s.unsubscribe(c)},u},e(function(c,u,l){s.reason||(s.reason=new Un(c,u,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Mp(function(a){e=a}),cancel:e}}};function eg(t){return function(n){return t.apply(null,n)}}function tg(t){return U.isObject(t)&&t.isAxiosError===!0}const Xa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xa).forEach(([t,e])=>{Xa[e]=t});function _l(t){const e=new mn(t),n=Lc(mn.prototype.request,e);return U.extend(n,mn.prototype,e,{allOwnKeys:!0}),U.extend(n,e,null,{allOwnKeys:!0}),n.create=function(a){return _l(pn(t,a))},n}const Qe=_l(pi);Qe.Axios=mn,Qe.CanceledError=Un,Qe.CancelToken=Xm,Qe.isCancel=el,Qe.VERSION=gl,Qe.toFormData=us,Qe.AxiosError=he,Qe.Cancel=Qe.CanceledError,Qe.all=function(e){return Promise.all(e)},Qe.spread=eg,Qe.isAxiosError=tg,Qe.mergeConfig=pn,Qe.AxiosHeaders=At,Qe.formToJSON=t=>Zc(U.isHTMLForm(t)?new FormData(t):t),Qe.getAdapter=pl.getAdapter,Qe.HttpStatusCode=Xa,Qe.default=Qe;const{Axios:pk,AxiosError:mk,CanceledError:gk,isCancel:yk,CancelToken:_k,VERSION:wk,all:bk,Cancel:Sk,isAxiosError:vk,spread:Tk,toFormData:Ek,AxiosHeaders:Ak,HttpStatusCode:Ok,formToJSON:kk,getAdapter:Ck,mergeConfig:xk}=Qe;var gi=t=>typeof t=="function"?t:function(){return t},rg=typeof self<"u"?self:null,yi=typeof window<"u"?window:null,gr=rg||yi||globalThis,ng="2.0.0",yr={connecting:0,open:1,closing:2,closed:3},ig=1e4,sg=1e3,Lt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Cr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},eo={longpoll:"longpoll",websocket:"websocket"},ag={complete:4},to="base64url.bearer.phx.",ps=class{constructor(t,e,n,s){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},wl=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},og=class{constructor(t,e,n){this.state=Lt.closed,this.topic=t,this.params=gi(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ps(this,Cr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new wl(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Lt.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new ps(this,Cr.leave,gi({}),this.timeout).send(),this.state=Lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Cr.reply,(s,a)=>{this.trigger(this.replyEventName(a),s)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(Cr.close,t)}onError(t){return this.on(Cr.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new ps(this,t,function(){return e},n);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Cr.close,"leave")},n=new ps(this,Cr.leave,gi({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}isMember(t,e,n,s){return this.topic!==t?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lt.joining,this.joinPush.resend(t))}trigger(t,e,n,s){let a=this.onMessage(t,e,n,s);if(e&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===t);for(let u=0;u<c.length;u++)c[u].callback(a,n,s||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Lt.closed}isErrored(){return this.state===Lt.errored}isJoined(){return this.state===Lt.joined}isJoining(){return this.state===Lt.joining}isLeaving(){return this.state===Lt.leaving}},ms=class{static request(t,e,n,s,a,c,u){if(gr.XDomainRequest){let l=new gr.XDomainRequest;return this.xdomainRequest(l,t,e,s,a,c,u)}else if(gr.XMLHttpRequest){let l=new gr.XMLHttpRequest;return this.xhrRequest(l,t,e,n,s,a,c,u)}else{if(gr.fetch&&gr.AbortController)return this.fetchRequest(t,e,n,s,a,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,s,a,c,u){let l={method:t,headers:n,body:s},h=null;return a&&(h=new AbortController,setTimeout(()=>h.abort(),a),l.signal=h.signal),gr.fetch(e,l).then(m=>m.text()).then(m=>this.parseJSON(m)).then(m=>u&&u(m)).catch(m=>{m.name==="AbortError"&&c?c():u&&u(null)}),h}static xdomainRequest(t,e,n,s,a,c,u){return t.timeout=a,t.open(e,n),t.onload=()=>{let l=this.parseJSON(t.responseText);u&&u(l)},c&&(t.ontimeout=c),t.onprogress=()=>{},t.send(s),t}static xhrRequest(t,e,n,s,a,c,u,l){t.open(e,n,!0),t.timeout=c;for(let[h,m]of Object.entries(s))t.setRequestHeader(h,m);return t.onerror=()=>l&&l(null),t.onreadystatechange=()=>{if(t.readyState===ag.complete&&l){let h=this.parseJSON(t.responseText);l(h)}},u&&(t.ontimeout=u),t.send(a),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let a=e?`${e}[${s}]`:s,c=t[s];typeof c=="object"?n.push(this.serialize(c,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},ug=t=>{let e="",n=new Uint8Array(t),s=n.byteLength;for(let a=0;a<s;a++)e+=String.fromCharCode(n[a]);return btoa(e)},_i=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(to)&&(this.authToken=atob(e[1].slice(to.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=yr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+eo.websocket),"$1/"+eo.longpoll)}endpointURL(){return ms.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=yr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===yr.open||this.readyState===yr.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:s,messages:a}=e;this.token=s}else n=0;switch(n){case 200:a.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=yr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!="string"&&(t=ug(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
7
- `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,n){for(let a of this.reqs)a.abort();this.readyState=yr.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(t,e,n,s,a){let c,u=()=>{this.reqs.delete(c),s()};c=ms.request(t,this.endpointURL(),e,n,this.timeout,u,l=>{this.reqs.delete(c),this.isActive()&&a(l)}),this.reqs.add(c)}},gs={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,s,a,c,u]=JSON.parse(t);return e({join_ref:n,ref:s,topic:a,event:c,payload:u})}},binaryEncode(t){let{join_ref:e,ref:n,event:s,topic:a,payload:c}=t,u=this.META_LENGTH+e.length+n.length+a.length+s.length,l=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(l),m=0;h.setUint8(m++,this.KINDS.push),h.setUint8(m++,e.length),h.setUint8(m++,n.length),h.setUint8(m++,a.length),h.setUint8(m++,s.length),Array.from(e,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(n,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(a,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(s,T=>h.setUint8(m++,T.charCodeAt(0)));var b=new Uint8Array(l.byteLength+c.byteLength);return b.set(new Uint8Array(l),0),b.set(new Uint8Array(c),l.byteLength),b.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,s);case this.KINDS.reply:return this.decodeReply(t,e,s);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,s)}},decodePush(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=e.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(t.slice(u,u+s));u=u+s;let h=n.decode(t.slice(u,u+a));u=u+a;let m=n.decode(t.slice(u,u+c));u=u+c;let b=t.slice(u,t.byteLength);return{join_ref:l,ref:null,topic:h,event:m,payload:b}},decodeReply(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=e.getUint8(3),u=e.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,h=n.decode(t.slice(l,l+s));l=l+s;let m=n.decode(t.slice(l,l+a));l=l+a;let b=n.decode(t.slice(l,l+c));l=l+c;let T=n.decode(t.slice(l,l+u));l=l+u;let P=t.slice(l,t.byteLength),$={status:T,response:P};return{join_ref:h,ref:m,topic:b,event:Cr.reply,payload:$}},decodeBroadcast(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=this.HEADER_LENGTH+2,u=n.decode(t.slice(c,c+s));c=c+s;let l=n.decode(t.slice(c,c+a));c=c+a;let h=t.slice(c,t.byteLength);return{join_ref:null,ref:null,topic:u,event:l,payload:h}}},cg=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=e.timeout||ig,this.transport=e.transport||gr.WebSocket||_i,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||gr&&gr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=gs.encode.bind(gs),this.defaultDecoder=gs.decode.bind(gs),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.transport!==_i?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;yi&&yi.addEventListener&&(yi.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),yi.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,a,c)=>{console.log(`${s}: ${a}`,c)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=gi(e.params||{}),this.endPoint=`${t}/${eo.websocket}`,this.vsn=e.vsn||ng,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new wl(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return _i}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=ms.appendParams(ms.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=gi(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==_i?this.connectWithFallback(_i,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let s=this.onMessage(a=>{a.ref===e&&(this.off([s]),t(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${to}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,s=!0,a,c,u=l=>{this.log("transport",`falling back to ${t.name}...`,l),this.off([a,c]),s=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${t.name}`))return u("memorized");this.fallbackTimer=setTimeout(u,e),c=this.onError(l=>{this.log("transport","error",l),s&&!n&&(clearTimeout(this.fallbackTimer),u(l))}),this.onOpen(()=>{if(n=!0,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t.name}`,"true"),this.log("transport",`established ${t.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),sg,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(e?this.conn.close(e,n||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t())}))})}waitForBufferDone(t,e=1){if(e===5||!this.conn||!this.conn.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e)}waitForSocketClosed(t,e=1){if(e===5||!this.conn||this.conn.readyState===yr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e)}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&e!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,n])=>n(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(t,e,n)}),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Cr.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case yr.connecting:return"connecting";case yr.open:return"open";case yr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new og(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:s,ref:a,join_ref:c}=t;this.log("push",`${e} ${n} (${c}, ${a})`,s)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:s,payload:a,ref:c,join_ref:u}=e;c&&c===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${a.status||""} ${n} ${s} ${c&&"("+c+")"||""}`,a);for(let l=0;l<this.channels.length;l++){const h=this.channels[l];h.isMember(n,s,a,u)&&h.trigger(s,a,c,u)}for(let l=0;l<this.stateChangeCallbacks.message.length;l++){let[,h]=this.stateChangeCallbacks.message[l];h(e)}})}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}},ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wi={exports:{}};/**
1
+ var Coinray=(function(ee){"use strict";function Nc(t,e){return function(){return t.apply(e,arguments)}}const{toString:Lp}=Object.prototype,{getPrototypeOf:Ka}=Object,{iterator:ss,toStringTag:Uc}=Symbol,as=(t=>e=>{const n=Lp.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ir=t=>(t=t.toLowerCase(),e=>as(e)===t),os=t=>e=>typeof e===t,{isArray:Ln}=Array,Nn=os("undefined");function fi(t){return t!==null&&!Nn(t)&&t.constructor!==null&&!Nn(t.constructor)&&Et(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Bc=ir("ArrayBuffer");function Np(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Bc(t.buffer),e}const Up=os("string"),Et=os("function"),Ic=os("number"),hi=t=>t!==null&&typeof t=="object",Bp=t=>t===!0||t===!1,us=t=>{if(as(t)!=="object")return!1;const e=Ka(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Uc in t)&&!(ss in t)},Ip=t=>{if(!hi(t)||fi(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Fp=ir("Date"),Wp=ir("File"),Hp=ir("Blob"),Yp=ir("FileList"),Kp=t=>hi(t)&&Et(t.pipe),qp=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Et(t.append)&&((e=as(t))==="formdata"||e==="object"&&Et(t.toString)&&t.toString()==="[object FormData]"))},$p=ir("URLSearchParams"),[Gp,Vp,zp,jp]=["ReadableStream","Request","Response","Headers"].map(ir),Jp=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function di(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,a;if(typeof t!="object"&&(t=[t]),Ln(t))for(s=0,a=t.length;s<a;s++)e.call(null,t[s],s,t);else{if(fi(t))return;const c=n?Object.getOwnPropertyNames(t):Object.keys(t),u=c.length;let l;for(s=0;s<u;s++)l=c[s],e.call(null,t[l],l,t)}}function Fc(t,e){if(fi(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,a;for(;s-- >0;)if(a=n[s],e===a.toLowerCase())return a;return null}const dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wc=t=>!Nn(t)&&t!==dn;function qa(){const{caseless:t,skipUndefined:e}=Wc(this)&&this||{},n={},s=(a,c)=>{const u=t&&Fc(n,c)||c;us(n[u])&&us(a)?n[u]=qa(n[u],a):us(a)?n[u]=qa({},a):Ln(a)?n[u]=a.slice():(!e||!Nn(a))&&(n[u]=a)};for(let a=0,c=arguments.length;a<c;a++)arguments[a]&&di(arguments[a],s);return n}const Qp=(t,e,n,{allOwnKeys:s}={})=>(di(e,(a,c)=>{n&&Et(a)?t[c]=Nc(a,n):t[c]=a},{allOwnKeys:s}),t),Zp=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xp=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},em=(t,e,n,s)=>{let a,c,u;const l={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),c=a.length;c-- >0;)u=a[c],(!s||s(u,t,e))&&!l[u]&&(e[u]=t[u],l[u]=!0);t=n!==!1&&Ka(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},tm=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},rm=t=>{if(!t)return null;if(Ln(t))return t;let e=t.length;if(!Ic(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},nm=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ka(Uint8Array)),im=(t,e)=>{const s=(t&&t[ss]).call(t);let a;for(;(a=s.next())&&!a.done;){const c=a.value;e.call(t,c[0],c[1])}},sm=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},am=ir("HTMLFormElement"),om=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,a){return s.toUpperCase()+a}),Hc=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),um=ir("RegExp"),Yc=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};di(n,(a,c)=>{let u;(u=e(a,c,t))!==!1&&(s[c]=u||a)}),Object.defineProperties(t,s)},cm=t=>{Yc(t,(e,n)=>{if(Et(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(Et(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lm=(t,e)=>{const n={},s=a=>{a.forEach(c=>{n[c]=!0})};return Ln(t)?s(t):s(String(t).split(e)),n},fm=()=>{},hm=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function dm(t){return!!(t&&Et(t.append)&&t[Uc]==="FormData"&&t[ss])}const pm=t=>{const e=new Array(10),n=(s,a)=>{if(hi(s)){if(e.indexOf(s)>=0)return;if(fi(s))return s;if(!("toJSON"in s)){e[a]=s;const c=Ln(s)?[]:{};return di(s,(u,l)=>{const h=n(u,a+1);!Nn(h)&&(c[l]=h)}),e[a]=void 0,c}}return s};return n(t,0)},mm=ir("AsyncFunction"),gm=t=>t&&(hi(t)||Et(t))&&Et(t.then)&&Et(t.catch),Kc=((t,e)=>t?setImmediate:e?((n,s)=>(dn.addEventListener("message",({source:a,data:c})=>{a===dn&&c===n&&s.length&&s.shift()()},!1),a=>{s.push(a),dn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Et(dn.postMessage)),ym=typeof queueMicrotask<"u"?queueMicrotask.bind(dn):typeof process<"u"&&process.nextTick||Kc,U={isArray:Ln,isArrayBuffer:Bc,isBuffer:fi,isFormData:qp,isArrayBufferView:Np,isString:Up,isNumber:Ic,isBoolean:Bp,isObject:hi,isPlainObject:us,isEmptyObject:Ip,isReadableStream:Gp,isRequest:Vp,isResponse:zp,isHeaders:jp,isUndefined:Nn,isDate:Fp,isFile:Wp,isBlob:Hp,isRegExp:um,isFunction:Et,isStream:Kp,isURLSearchParams:$p,isTypedArray:nm,isFileList:Yp,forEach:di,merge:qa,extend:Qp,trim:Jp,stripBOM:Zp,inherits:Xp,toFlatObject:em,kindOf:as,kindOfTest:ir,endsWith:tm,toArray:rm,forEachEntry:im,matchAll:sm,isHTMLForm:am,hasOwnProperty:Hc,hasOwnProp:Hc,reduceDescriptors:Yc,freezeMethods:cm,toObjectSet:lm,toCamelCase:om,noop:fm,toFiniteNumber:hm,findKey:Fc,global:dn,isContextDefined:Wc,isSpecCompliantForm:dm,toJSONObject:pm,isAsyncFn:mm,isThenable:gm,setImmediate:Kc,asap:ym,isIterable:t=>t!=null&&Et(t[ss])};function he(t,e,n,s,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),a&&(this.response=a,this.status=a.status?a.status:null)}U.inherits(he,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.status}}});const qc=he.prototype,$c={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{$c[t]={value:t}}),Object.defineProperties(he,$c),Object.defineProperty(qc,"isAxiosError",{value:!0}),he.from=(t,e,n,s,a,c)=>{const u=Object.create(qc);U.toFlatObject(t,u,function(b){return b!==Error.prototype},m=>m!=="isAxiosError");const l=t&&t.message?t.message:"Error",h=e==null&&t?t.code:e;return he.call(u,l,h,n,s,a),t&&u.cause==null&&Object.defineProperty(u,"cause",{value:t,configurable:!0}),u.name=t&&t.name||"Error",c&&Object.assign(u,c),u};const _m=null;function $a(t){return U.isPlainObject(t)||U.isArray(t)}function Gc(t){return U.endsWith(t,"[]")?t.slice(0,-2):t}function Vc(t,e,n){return t?t.concat(e).map(function(a,c){return a=Gc(a),!n&&c?"["+a+"]":a}).join(n?".":""):e}function wm(t){return U.isArray(t)&&!t.some($a)}const bm=U.toFlatObject(U,{},null,function(e){return/^is[A-Z]/.test(e)});function cs(t,e,n){if(!U.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=U.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,F){return!U.isUndefined(F[I])});const s=n.metaTokens,a=n.visitor||b,c=n.dots,u=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&U.isSpecCompliantForm(e);if(!U.isFunction(a))throw new TypeError("visitor must be a function");function m(O){if(O===null)return"";if(U.isDate(O))return O.toISOString();if(U.isBoolean(O))return O.toString();if(!h&&U.isBlob(O))throw new he("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(O)||U.isTypedArray(O)?h&&typeof Blob=="function"?new Blob([O]):Buffer.from(O):O}function b(O,I,F){let ne=O;if(O&&!F&&typeof O=="object"){if(U.endsWith(I,"{}"))I=s?I:I.slice(0,-2),O=JSON.stringify(O);else if(U.isArray(O)&&wm(O)||(U.isFileList(O)||U.endsWith(I,"[]"))&&(ne=U.toArray(O)))return I=Gc(I),ne.forEach(function(Ae,ve){!(U.isUndefined(Ae)||Ae===null)&&e.append(u===!0?Vc([I],ve,c):u===null?I:I+"[]",m(Ae))}),!1}return $a(O)?!0:(e.append(Vc(F,I,c),m(O)),!1)}const T=[],P=Object.assign(bm,{defaultVisitor:b,convertValue:m,isVisitable:$a});function $(O,I){if(!U.isUndefined(O)){if(T.indexOf(O)!==-1)throw Error("Circular reference detected in "+I.join("."));T.push(O),U.forEach(O,function(ne,Y){(!(U.isUndefined(ne)||ne===null)&&a.call(e,ne,U.isString(Y)?Y.trim():Y,I,P))===!0&&$(ne,I?I.concat(Y):[Y])}),T.pop()}}if(!U.isObject(t))throw new TypeError("data must be an object");return $(t),e}function zc(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ga(t,e){this._pairs=[],t&&cs(t,this,e)}const jc=Ga.prototype;jc.append=function(e,n){this._pairs.push([e,n])},jc.toString=function(e){const n=e?function(s){return e.call(this,s,zc)}:zc;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Sm(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Jc(t,e,n){if(!e)return t;const s=n&&n.encode||Sm;U.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let c;if(a?c=a(e,n):c=U.isURLSearchParams(e)?e.toString():new Ga(e,n).toString(s),c){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+c}return t}class Qc{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Zc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vm={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ga,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Va=typeof window<"u"&&typeof document<"u",za=typeof navigator=="object"&&navigator||void 0,Tm=Va&&(!za||["ReactNative","NativeScript","NS"].indexOf(za.product)<0),Em=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Am=Va&&window.location.href||"http://localhost",dt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Va,hasStandardBrowserEnv:Tm,hasStandardBrowserWebWorkerEnv:Em,navigator:za,origin:Am},Symbol.toStringTag,{value:"Module"})),...vm};function Om(t,e){return cs(t,new dt.classes.URLSearchParams,{visitor:function(n,s,a,c){return dt.isNode&&U.isBuffer(n)?(this.append(s,n.toString("base64")),!1):c.defaultVisitor.apply(this,arguments)},...e})}function km(t){return U.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Cm(t){const e={},n=Object.keys(t);let s;const a=n.length;let c;for(s=0;s<a;s++)c=n[s],e[c]=t[c];return e}function Xc(t){function e(n,s,a,c){let u=n[c++];if(u==="__proto__")return!0;const l=Number.isFinite(+u),h=c>=n.length;return u=!u&&U.isArray(a)?a.length:u,h?(U.hasOwnProp(a,u)?a[u]=[a[u],s]:a[u]=s,!l):((!a[u]||!U.isObject(a[u]))&&(a[u]=[]),e(n,s,a[u],c)&&U.isArray(a[u])&&(a[u]=Cm(a[u])),!l)}if(U.isFormData(t)&&U.isFunction(t.entries)){const n={};return U.forEachEntry(t,(s,a)=>{e(km(s),a,n,0)}),n}return null}function xm(t,e,n){if(U.isString(t))try{return(e||JSON.parse)(t),U.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const pi={transitional:Zc,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",a=s.indexOf("application/json")>-1,c=U.isObject(e);if(c&&U.isHTMLForm(e)&&(e=new FormData(e)),U.isFormData(e))return a?JSON.stringify(Xc(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e)||U.isReadableStream(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(c){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Om(e,this.formSerializer).toString();if((l=U.isFileList(e))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return cs(l?{"files[]":e}:e,h&&new h,this.formSerializer)}}return c||a?(n.setContentType("application/json",!1),xm(e)):e}],transformResponse:[function(e){const n=this.transitional||pi.transitional,s=n&&n.forcedJSONParsing,a=this.responseType==="json";if(U.isResponse(e)||U.isReadableStream(e))return e;if(e&&U.isString(e)&&(s&&!this.responseType||a)){const u=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(l){if(u)throw l.name==="SyntaxError"?he.from(l,he.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dt.classes.FormData,Blob:dt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],t=>{pi.headers[t]={}});const Pm=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rm=t=>{const e={};let n,s,a;return t&&t.split(`
2
+ `).forEach(function(u){a=u.indexOf(":"),n=u.substring(0,a).trim().toLowerCase(),s=u.substring(a+1).trim(),!(!n||e[n]&&Pm[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},el=Symbol("internals");function mi(t){return t&&String(t).trim().toLowerCase()}function ls(t){return t===!1||t==null?t:U.isArray(t)?t.map(ls):String(t)}function Dm(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const Mm=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ja(t,e,n,s,a){if(U.isFunction(s))return s.call(this,e,n);if(a&&(e=n),!!U.isString(e)){if(U.isString(s))return e.indexOf(s)!==-1;if(U.isRegExp(s))return s.test(e)}}function Lm(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Nm(t,e){const n=U.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(a,c,u){return this[s].call(this,e,a,c,u)},configurable:!0})})}let At=class{constructor(e){e&&this.set(e)}set(e,n,s){const a=this;function c(l,h,m){const b=mi(h);if(!b)throw new Error("header name must be a non-empty string");const T=U.findKey(a,b);(!T||a[T]===void 0||m===!0||m===void 0&&a[T]!==!1)&&(a[T||h]=ls(l))}const u=(l,h)=>U.forEach(l,(m,b)=>c(m,b,h));if(U.isPlainObject(e)||e instanceof this.constructor)u(e,n);else if(U.isString(e)&&(e=e.trim())&&!Mm(e))u(Rm(e),n);else if(U.isObject(e)&&U.isIterable(e)){let l={},h,m;for(const b of e){if(!U.isArray(b))throw TypeError("Object iterator must return a key-value pair");l[m=b[0]]=(h=l[m])?U.isArray(h)?[...h,b[1]]:[h,b[1]]:b[1]}u(l,n)}else e!=null&&c(n,e,s);return this}get(e,n){if(e=mi(e),e){const s=U.findKey(this,e);if(s){const a=this[s];if(!n)return a;if(n===!0)return Dm(a);if(U.isFunction(n))return n.call(this,a,s);if(U.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=mi(e),e){const s=U.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||ja(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let a=!1;function c(u){if(u=mi(u),u){const l=U.findKey(s,u);l&&(!n||ja(s,s[l],l,n))&&(delete s[l],a=!0)}}return U.isArray(e)?e.forEach(c):c(e),a}clear(e){const n=Object.keys(this);let s=n.length,a=!1;for(;s--;){const c=n[s];(!e||ja(this,this[c],c,e,!0))&&(delete this[c],a=!0)}return a}normalize(e){const n=this,s={};return U.forEach(this,(a,c)=>{const u=U.findKey(s,c);if(u){n[u]=ls(a),delete n[c];return}const l=e?Lm(c):String(c).trim();l!==c&&delete n[c],n[l]=ls(a),s[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return U.forEach(this,(s,a)=>{s!=null&&s!==!1&&(n[a]=e&&U.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(a=>s.set(a)),s}static accessor(e){const s=(this[el]=this[el]={accessors:{}}).accessors,a=this.prototype;function c(u){const l=mi(u);s[l]||(Nm(a,u),s[l]=!0)}return U.isArray(e)?e.forEach(c):c(e),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(At.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),U.freezeMethods(At);function Ja(t,e){const n=this||pi,s=e||n,a=At.from(s.headers);let c=s.data;return U.forEach(t,function(l){c=l.call(n,c,a.normalize(),e?e.status:void 0)}),a.normalize(),c}function tl(t){return!!(t&&t.__CANCEL__)}function Un(t,e,n){he.call(this,t??"canceled",he.ERR_CANCELED,e,n),this.name="CanceledError"}U.inherits(Un,he,{__CANCEL__:!0});function rl(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new he("Request failed with status code "+n.status,[he.ERR_BAD_REQUEST,he.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Um(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Bm(t,e){t=t||10;const n=new Array(t),s=new Array(t);let a=0,c=0,u;return e=e!==void 0?e:1e3,function(h){const m=Date.now(),b=s[c];u||(u=m),n[a]=h,s[a]=m;let T=c,P=0;for(;T!==a;)P+=n[T++],T=T%t;if(a=(a+1)%t,a===c&&(c=(c+1)%t),m-u<e)return;const $=b&&m-b;return $?Math.round(P*1e3/$):void 0}}function Im(t,e){let n=0,s=1e3/e,a,c;const u=(m,b=Date.now())=>{n=b,a=null,c&&(clearTimeout(c),c=null),t(...m)};return[(...m)=>{const b=Date.now(),T=b-n;T>=s?u(m,b):(a=m,c||(c=setTimeout(()=>{c=null,u(a)},s-T)))},()=>a&&u(a)]}const fs=(t,e,n=3)=>{let s=0;const a=Bm(50,250);return Im(c=>{const u=c.loaded,l=c.lengthComputable?c.total:void 0,h=u-s,m=a(h),b=u<=l;s=u;const T={loaded:u,total:l,progress:l?u/l:void 0,bytes:h,rate:m||void 0,estimated:m&&l&&b?(l-u)/m:void 0,event:c,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(T)},n)},nl=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},il=t=>(...e)=>U.asap(()=>t(...e)),Fm=dt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,dt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(dt.origin),dt.navigator&&/(msie|trident)/i.test(dt.navigator.userAgent)):()=>!0,Wm=dt.hasStandardBrowserEnv?{write(t,e,n,s,a,c){const u=[t+"="+encodeURIComponent(e)];U.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),U.isString(s)&&u.push("path="+s),U.isString(a)&&u.push("domain="+a),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Hm(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ym(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function sl(t,e,n){let s=!Hm(e);return t&&(s||n==!1)?Ym(t,e):e}const al=t=>t instanceof At?{...t}:t;function pn(t,e){e=e||{};const n={};function s(m,b,T,P){return U.isPlainObject(m)&&U.isPlainObject(b)?U.merge.call({caseless:P},m,b):U.isPlainObject(b)?U.merge({},b):U.isArray(b)?b.slice():b}function a(m,b,T,P){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m,T,P)}else return s(m,b,T,P)}function c(m,b){if(!U.isUndefined(b))return s(void 0,b)}function u(m,b){if(U.isUndefined(b)){if(!U.isUndefined(m))return s(void 0,m)}else return s(void 0,b)}function l(m,b,T){if(T in e)return s(m,b);if(T in t)return s(void 0,m)}const h={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l,headers:(m,b,T)=>a(al(m),al(b),T,!0)};return U.forEach(Object.keys({...t,...e}),function(b){const T=h[b]||a,P=T(t[b],e[b],b);U.isUndefined(P)&&T!==l||(n[b]=P)}),n}const ol=t=>{const e=pn({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:c,headers:u,auth:l}=e;if(e.headers=u=At.from(u),e.url=Jc(sl(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&u.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),U.isFormData(n)){if(dt.hasStandardBrowserEnv||dt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(U.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([b,T])=>{m.includes(b.toLowerCase())&&u.set(b,T)})}}if(dt.hasStandardBrowserEnv&&(s&&U.isFunction(s)&&(s=s(e)),s||s!==!1&&Fm(e.url))){const h=a&&c&&Wm.read(c);h&&u.set(a,h)}return e},Km=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const a=ol(t);let c=a.data;const u=At.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:m}=a,b,T,P,$,O;function I(){$&&$(),O&&O(),a.cancelToken&&a.cancelToken.unsubscribe(b),a.signal&&a.signal.removeEventListener("abort",b)}let F=new XMLHttpRequest;F.open(a.method.toUpperCase(),a.url,!0),F.timeout=a.timeout;function ne(){if(!F)return;const Ae=At.from("getAllResponseHeaders"in F&&F.getAllResponseHeaders()),_e={data:!l||l==="text"||l==="json"?F.responseText:F.response,status:F.status,statusText:F.statusText,headers:Ae,config:t,request:F};rl(function(Pe){n(Pe),I()},function(Pe){s(Pe),I()},_e),F=null}"onloadend"in F?F.onloadend=ne:F.onreadystatechange=function(){!F||F.readyState!==4||F.status===0&&!(F.responseURL&&F.responseURL.indexOf("file:")===0)||setTimeout(ne)},F.onabort=function(){F&&(s(new he("Request aborted",he.ECONNABORTED,t,F)),F=null)},F.onerror=function(ve){const _e=ve&&ve.message?ve.message:"Network Error",Fe=new he(_e,he.ERR_NETWORK,t,F);Fe.event=ve||null,s(Fe),F=null},F.ontimeout=function(){let ve=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _e=a.transitional||Zc;a.timeoutErrorMessage&&(ve=a.timeoutErrorMessage),s(new he(ve,_e.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,t,F)),F=null},c===void 0&&u.setContentType(null),"setRequestHeader"in F&&U.forEach(u.toJSON(),function(ve,_e){F.setRequestHeader(_e,ve)}),U.isUndefined(a.withCredentials)||(F.withCredentials=!!a.withCredentials),l&&l!=="json"&&(F.responseType=a.responseType),m&&([P,O]=fs(m,!0),F.addEventListener("progress",P)),h&&F.upload&&([T,$]=fs(h),F.upload.addEventListener("progress",T),F.upload.addEventListener("loadend",$)),(a.cancelToken||a.signal)&&(b=Ae=>{F&&(s(!Ae||Ae.type?new Un(null,t,F):Ae),F.abort(),F=null)},a.cancelToken&&a.cancelToken.subscribe(b),a.signal&&(a.signal.aborted?b():a.signal.addEventListener("abort",b)));const Y=Um(a.url);if(Y&&dt.protocols.indexOf(Y)===-1){s(new he("Unsupported protocol "+Y+":",he.ERR_BAD_REQUEST,t));return}F.send(c||null)})},qm=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,a;const c=function(m){if(!a){a=!0,l();const b=m instanceof Error?m:this.reason;s.abort(b instanceof he?b:new Un(b instanceof Error?b.message:b))}};let u=e&&setTimeout(()=>{u=null,c(new he(`timeout ${e} of ms exceeded`,he.ETIMEDOUT))},e);const l=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(m=>{m.unsubscribe?m.unsubscribe(c):m.removeEventListener("abort",c)}),t=null)};t.forEach(m=>m.addEventListener("abort",c));const{signal:h}=s;return h.unsubscribe=()=>U.asap(l),h}},$m=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,a;for(;s<n;)a=s+e,yield t.slice(s,a),s=a},Gm=async function*(t,e){for await(const n of Vm(t))yield*$m(n,e)},Vm=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},ul=(t,e,n,s)=>{const a=Gm(t,e);let c=0,u,l=h=>{u||(u=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:m,value:b}=await a.next();if(m){l(),h.close();return}let T=b.byteLength;if(n){let P=c+=T;n(P)}h.enqueue(new Uint8Array(b))}catch(m){throw l(m),m}},cancel(h){return l(h),a.return()}},{highWaterMark:2})},cl=64*1024,{isFunction:hs}=U,zm=(({Request:t,Response:e})=>({Request:t,Response:e}))(U.global),{ReadableStream:ll,TextEncoder:fl}=U.global,hl=(t,...e)=>{try{return!!t(...e)}catch{return!1}},jm=t=>{t=U.merge.call({skipUndefined:!0},zm,t);const{fetch:e,Request:n,Response:s}=t,a=e?hs(e):typeof fetch=="function",c=hs(n),u=hs(s);if(!a)return!1;const l=a&&hs(ll),h=a&&(typeof fl=="function"?(O=>I=>O.encode(I))(new fl):async O=>new Uint8Array(await new n(O).arrayBuffer())),m=c&&l&&hl(()=>{let O=!1;const I=new n(dt.origin,{body:new ll,method:"POST",get duplex(){return O=!0,"half"}}).headers.has("Content-Type");return O&&!I}),b=u&&l&&hl(()=>U.isReadableStream(new s("").body)),T={stream:b&&(O=>O.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(O=>{!T[O]&&(T[O]=(I,F)=>{let ne=I&&I[O];if(ne)return ne.call(I);throw new he(`Response type '${O}' is not supported`,he.ERR_NOT_SUPPORT,F)})});const P=async O=>{if(O==null)return 0;if(U.isBlob(O))return O.size;if(U.isSpecCompliantForm(O))return(await new n(dt.origin,{method:"POST",body:O}).arrayBuffer()).byteLength;if(U.isArrayBufferView(O)||U.isArrayBuffer(O))return O.byteLength;if(U.isURLSearchParams(O)&&(O=O+""),U.isString(O))return(await h(O)).byteLength},$=async(O,I)=>{const F=U.toFiniteNumber(O.getContentLength());return F??P(I)};return async O=>{let{url:I,method:F,data:ne,signal:Y,cancelToken:Ae,timeout:ve,onDownloadProgress:_e,onUploadProgress:Fe,responseType:Pe,headers:y,withCredentials:_="same-origin",fetchOptions:S}=ol(O),M=e||fetch;Pe=Pe?(Pe+"").toLowerCase():"text";let k=qm([Y,Ae&&Ae.toAbortSignal()],ve),R=null;const N=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let E;try{if(Fe&&m&&F!=="get"&&F!=="head"&&(E=await $(y,ne))!==0){let J=new n(I,{method:"POST",body:ne,duplex:"half"}),pe;if(U.isFormData(ne)&&(pe=J.headers.get("content-type"))&&y.setContentType(pe),J.body){const[Ne,We]=nl(E,fs(il(Fe)));ne=ul(J.body,cl,Ne,We)}}U.isString(_)||(_=_?"include":"omit");const C=c&&"credentials"in n.prototype,L={...S,signal:k,method:F.toUpperCase(),headers:y.normalize().toJSON(),body:ne,duplex:"half",credentials:C?_:void 0};R=c&&new n(I,L);let D=await(c?M(R,S):M(I,L));const q=b&&(Pe==="stream"||Pe==="response");if(b&&(_e||q&&N)){const J={};["status","statusText","headers"].forEach(le=>{J[le]=D[le]});const pe=U.toFiniteNumber(D.headers.get("content-length")),[Ne,We]=_e&&nl(pe,fs(il(_e),!0))||[];D=new s(ul(D.body,cl,Ne,()=>{We&&We(),N&&N()}),J)}Pe=Pe||"text";let te=await T[U.findKey(T,Pe)||"text"](D,O);return!q&&N&&N(),await new Promise((J,pe)=>{rl(J,pe,{data:te,headers:At.from(D.headers),status:D.status,statusText:D.statusText,config:O,request:R})})}catch(C){throw N&&N(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new he("Network Error",he.ERR_NETWORK,O,R),{cause:C.cause||C}):he.from(C,C&&C.code,O,R)}}},Jm=new Map,dl=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:a}=e,c=[s,a,n];let u=c.length,l=u,h,m,b=Jm;for(;l--;)h=c[l],m=b.get(h),m===void 0&&b.set(h,m=l?new Map:jm(e)),b=m;return m};dl();const Qa={http:_m,xhr:Km,fetch:{get:dl}};U.forEach(Qa,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const pl=t=>`- ${t}`,Qm=t=>U.isFunction(t)||t===null||t===!1,ml={getAdapter:(t,e)=>{t=U.isArray(t)?t:[t];const{length:n}=t;let s,a;const c={};for(let u=0;u<n;u++){s=t[u];let l;if(a=s,!Qm(s)&&(a=Qa[(l=String(s)).toLowerCase()],a===void 0))throw new he(`Unknown adapter '${l}'`);if(a&&(U.isFunction(a)||(a=a.get(e))))break;c[l||"#"+u]=a}if(!a){const u=Object.entries(c).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let l=n?u.length>1?`since :
4
+ `+u.map(pl).join(`
5
+ `):" "+pl(u[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a},adapters:Qa};function Za(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Un(null,t)}function gl(t){return Za(t),t.headers=At.from(t.headers),t.data=Ja.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ml.getAdapter(t.adapter||pi.adapter,t)(t).then(function(s){return Za(t),s.data=Ja.call(t,t.transformResponse,s),s.headers=At.from(s.headers),s},function(s){return tl(s)||(Za(t),s&&s.response&&(s.response.data=Ja.call(t,t.transformResponse,s.response),s.response.headers=At.from(s.response.headers))),Promise.reject(s)})}const yl="1.12.2",ds={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ds[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const _l={};ds.transitional=function(e,n,s){function a(c,u){return"[Axios v"+yl+"] Transitional option '"+c+"'"+u+(s?". "+s:"")}return(c,u,l)=>{if(e===!1)throw new he(a(u," has been removed"+(n?" in "+n:"")),he.ERR_DEPRECATED);return n&&!_l[u]&&(_l[u]=!0,console.warn(a(u," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(c,u,l):!0}},ds.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Zm(t,e,n){if(typeof t!="object")throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let a=s.length;for(;a-- >0;){const c=s[a],u=e[c];if(u){const l=t[c],h=l===void 0||u(l,c,t);if(h!==!0)throw new he("option "+c+" must be "+h,he.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new he("Unknown option "+c,he.ERR_BAD_OPTION)}}const ps={assertOptions:Zm,validators:ds},mr=ps.validators;let mn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Qc,response:new Qc}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const c=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
+ `+c):s.stack=c}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=pn(this.defaults,n);const{transitional:s,paramsSerializer:a,headers:c}=n;s!==void 0&&ps.assertOptions(s,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),a!=null&&(U.isFunction(a)?n.paramsSerializer={serialize:a}:ps.assertOptions(a,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ps.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let u=c&&U.merge(c.common,c[n.method]);c&&U.forEach(["delete","get","head","post","put","patch","common"],O=>{delete c[O]}),n.headers=At.concat(u,c);const l=[];let h=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(h=h&&I.synchronous,l.unshift(I.fulfilled,I.rejected))});const m=[];this.interceptors.response.forEach(function(I){m.push(I.fulfilled,I.rejected)});let b,T=0,P;if(!h){const O=[gl.bind(this),void 0];for(O.unshift(...l),O.push(...m),P=O.length,b=Promise.resolve(n);T<P;)b=b.then(O[T++],O[T++]);return b}P=l.length;let $=n;for(;T<P;){const O=l[T++],I=l[T++];try{$=O($)}catch(F){I.call(this,F);break}}try{b=gl.call(this,$)}catch(O){return Promise.reject(O)}for(T=0,P=m.length;T<P;)b=b.then(m[T++],m[T++]);return b}getUri(e){e=pn(this.defaults,e);const n=sl(e.baseURL,e.url,e.allowAbsoluteUrls);return Jc(n,e.params,e.paramsSerializer)}};U.forEach(["delete","get","head","options"],function(e){mn.prototype[e]=function(n,s){return this.request(pn(s||{},{method:e,url:n,data:(s||{}).data}))}}),U.forEach(["post","put","patch"],function(e){function n(s){return function(c,u,l){return this.request(pn(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:c,data:u}))}}mn.prototype[e]=n(),mn.prototype[e+"Form"]=n(!0)});let Xm=class Mp{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(c){n=c});const s=this;this.promise.then(a=>{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](a);s._listeners=null}),this.promise.then=a=>{let c;const u=new Promise(l=>{s.subscribe(l),c=l}).then(a);return u.cancel=function(){s.unsubscribe(c)},u},e(function(c,u,l){s.reason||(s.reason=new Un(c,u,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Mp(function(a){e=a}),cancel:e}}};function eg(t){return function(n){return t.apply(null,n)}}function tg(t){return U.isObject(t)&&t.isAxiosError===!0}const Xa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Xa).forEach(([t,e])=>{Xa[e]=t});function wl(t){const e=new mn(t),n=Nc(mn.prototype.request,e);return U.extend(n,mn.prototype,e,{allOwnKeys:!0}),U.extend(n,e,null,{allOwnKeys:!0}),n.create=function(a){return wl(pn(t,a))},n}const Qe=wl(pi);Qe.Axios=mn,Qe.CanceledError=Un,Qe.CancelToken=Xm,Qe.isCancel=tl,Qe.VERSION=yl,Qe.toFormData=cs,Qe.AxiosError=he,Qe.Cancel=Qe.CanceledError,Qe.all=function(e){return Promise.all(e)},Qe.spread=eg,Qe.isAxiosError=tg,Qe.mergeConfig=pn,Qe.AxiosHeaders=At,Qe.formToJSON=t=>Xc(U.isHTMLForm(t)?new FormData(t):t),Qe.getAdapter=ml.getAdapter,Qe.HttpStatusCode=Xa,Qe.default=Qe;const{Axios:pk,AxiosError:mk,CanceledError:gk,isCancel:yk,CancelToken:_k,VERSION:wk,all:bk,Cancel:Sk,isAxiosError:vk,spread:Tk,toFormData:Ek,AxiosHeaders:Ak,HttpStatusCode:Ok,formToJSON:kk,getAdapter:Ck,mergeConfig:xk}=Qe;var gi=t=>typeof t=="function"?t:function(){return t},rg=typeof self<"u"?self:null,yi=typeof window<"u"?window:null,gr=rg||yi||globalThis,ng="2.0.0",yr={connecting:0,open:1,closing:2,closed:3},ig=1e4,sg=1e3,Lt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Cr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},eo={longpoll:"longpoll",websocket:"websocket"},ag={complete:4},to="base64url.bearer.phx.",ms=class{constructor(t,e,n,s){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(s=>s.status===t).forEach(s=>s.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},bl=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},og=class{constructor(t,e,n){this.state=Lt.closed,this.topic=t,this.params=gi(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ms(this,Cr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new bl(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",()=>{this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Lt.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new ms(this,Cr.leave,gi({}),this.timeout).send(),this.state=Lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Cr.reply,(s,a)=>{this.trigger(this.replyEventName(a),s)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(t){this.on(Cr.close,t)}onError(t){return this.on(Cr.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new ms(this,t,function(){return e},n);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Lt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Cr.close,"leave")},n=new ms(this,Cr.leave,gi({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}isMember(t,e,n,s){return this.topic!==t?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Lt.joining,this.joinPush.resend(t))}trigger(t,e,n,s){let a=this.onMessage(t,e,n,s);if(e&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===t);for(let u=0;u<c.length;u++)c[u].callback(a,n,s||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Lt.closed}isErrored(){return this.state===Lt.errored}isJoined(){return this.state===Lt.joined}isJoining(){return this.state===Lt.joining}isLeaving(){return this.state===Lt.leaving}},gs=class{static request(t,e,n,s,a,c,u){if(gr.XDomainRequest){let l=new gr.XDomainRequest;return this.xdomainRequest(l,t,e,s,a,c,u)}else if(gr.XMLHttpRequest){let l=new gr.XMLHttpRequest;return this.xhrRequest(l,t,e,n,s,a,c,u)}else{if(gr.fetch&&gr.AbortController)return this.fetchRequest(t,e,n,s,a,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,s,a,c,u){let l={method:t,headers:n,body:s},h=null;return a&&(h=new AbortController,setTimeout(()=>h.abort(),a),l.signal=h.signal),gr.fetch(e,l).then(m=>m.text()).then(m=>this.parseJSON(m)).then(m=>u&&u(m)).catch(m=>{m.name==="AbortError"&&c?c():u&&u(null)}),h}static xdomainRequest(t,e,n,s,a,c,u){return t.timeout=a,t.open(e,n),t.onload=()=>{let l=this.parseJSON(t.responseText);u&&u(l)},c&&(t.ontimeout=c),t.onprogress=()=>{},t.send(s),t}static xhrRequest(t,e,n,s,a,c,u,l){t.open(e,n,!0),t.timeout=c;for(let[h,m]of Object.entries(s))t.setRequestHeader(h,m);return t.onerror=()=>l&&l(null),t.onreadystatechange=()=>{if(t.readyState===ag.complete&&l){let h=this.parseJSON(t.responseText);l(h)}},u&&(t.ontimeout=u),t.send(a),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;let a=e?`${e}[${s}]`:s,c=t[s];typeof c=="object"?n.push(this.serialize(c,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},ug=t=>{let e="",n=new Uint8Array(t),s=n.byteLength;for(let a=0;a<s;a++)e+=String.fromCharCode(n[a]);return btoa(e)},_i=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(to)&&(this.authToken=atob(e[1].slice(to.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=yr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+eo.websocket),"$1/"+eo.longpoll)}endpointURL(){return gs.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=yr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===yr.open||this.readyState===yr.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:s,messages:a}=e;this.token=s}else n=0;switch(n){case 200:a.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=yr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!="string"&&(t=ug(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
7
+ `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,n){for(let a of this.reqs)a.abort();this.readyState=yr.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(t,e,n,s,a){let c,u=()=>{this.reqs.delete(c),s()};c=gs.request(t,this.endpointURL(),e,n,this.timeout,u,l=>{this.reqs.delete(c),this.isActive()&&a(l)}),this.reqs.add(c)}},ys={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,s,a,c,u]=JSON.parse(t);return e({join_ref:n,ref:s,topic:a,event:c,payload:u})}},binaryEncode(t){let{join_ref:e,ref:n,event:s,topic:a,payload:c}=t,u=this.META_LENGTH+e.length+n.length+a.length+s.length,l=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(l),m=0;h.setUint8(m++,this.KINDS.push),h.setUint8(m++,e.length),h.setUint8(m++,n.length),h.setUint8(m++,a.length),h.setUint8(m++,s.length),Array.from(e,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(n,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(a,T=>h.setUint8(m++,T.charCodeAt(0))),Array.from(s,T=>h.setUint8(m++,T.charCodeAt(0)));var b=new Uint8Array(l.byteLength+c.byteLength);return b.set(new Uint8Array(l),0),b.set(new Uint8Array(c),l.byteLength),b.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,s);case this.KINDS.reply:return this.decodeReply(t,e,s);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,s)}},decodePush(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=e.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,l=n.decode(t.slice(u,u+s));u=u+s;let h=n.decode(t.slice(u,u+a));u=u+a;let m=n.decode(t.slice(u,u+c));u=u+c;let b=t.slice(u,t.byteLength);return{join_ref:l,ref:null,topic:h,event:m,payload:b}},decodeReply(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=e.getUint8(3),u=e.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,h=n.decode(t.slice(l,l+s));l=l+s;let m=n.decode(t.slice(l,l+a));l=l+a;let b=n.decode(t.slice(l,l+c));l=l+c;let T=n.decode(t.slice(l,l+u));l=l+u;let P=t.slice(l,t.byteLength),$={status:T,response:P};return{join_ref:h,ref:m,topic:b,event:Cr.reply,payload:$}},decodeBroadcast(t,e,n){let s=e.getUint8(1),a=e.getUint8(2),c=this.HEADER_LENGTH+2,u=n.decode(t.slice(c,c+s));c=c+s;let l=n.decode(t.slice(c,c+a));c=c+a;let h=t.slice(c,t.byteLength);return{join_ref:null,ref:null,topic:u,event:l,payload:h}}},cg=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=e.timeout||ig,this.transport=e.transport||gr.WebSocket||_i,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||gr&&gr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=ys.encode.bind(ys),this.defaultDecoder=ys.decode.bind(ys),this.closeWasClean=!1,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.transport!==_i?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;yi&&yi.addEventListener&&(yi.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),yi.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,a,c)=>{console.log(`${s}: ${a}`,c)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=gi(e.params||{}),this.endPoint=`${t}/${eo.websocket}`,this.vsn=e.vsn||ng,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new bl(()=>{this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return _i}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=gs.appendParams(gs.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=gi(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==_i?this.connectWithFallback(_i,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let s=this.onMessage(a=>{a.ref===e&&(this.off([s]),t(Date.now()-n))});return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${to}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,s=!0,a,c,u=l=>{this.log("transport",`falling back to ${t.name}...`,l),this.off([a,c]),s=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${t.name}`))return u("memorized");this.fallbackTimer=setTimeout(u,e),c=this.onError(l=>{this.log("transport","error",l),s&&!n&&(clearTimeout(this.fallbackTimer),u(l))}),this.onOpen(()=>{if(n=!0,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t.name}`,"true"),this.log("transport",`established ${t.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,t])=>t())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),sg,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(e?this.conn.close(e,n||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t())}))})}waitForBufferDone(t,e=1){if(e===5||!this.conn||!this.conn.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(t,e+1)},150*e)}waitForSocketClosed(t,e=1){if(e===5||!this.conn||this.conn.readyState===yr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(t,e+1)},150*e)}onConnClose(t){let e=t&&t.code;this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&e!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,n])=>n(t))}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(t,e,n)}),(e===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Cr.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case yr.connecting:return"connecting";case yr.open:return"open";case yr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new og(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:s,ref:a,join_ref:c}=t;this.log("push",`${e} ${n} (${c}, ${a})`,s)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:s,payload:a,ref:c,join_ref:u}=e;c&&c===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${a.status||""} ${n} ${s} ${c&&"("+c+")"||""}`,a);for(let l=0;l<this.channels.length;l++){const h=this.channels[l];h.isMember(n,s,a,u)&&h.trigger(s,a,c,u)}for(let l=0;l<this.stateChangeCallbacks.message.length;l++){let[,h]=this.stateChangeCallbacks.message[l];h(e)}})}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}},_s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wi={exports:{}};/**
8
8
  * @license
9
9
  * Lodash <https://lodash.com/>
10
10
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
11
11
  * Released under MIT license <https://lodash.com/license>
12
12
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
13
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
- */var lg=wi.exports,Sl;function fg(){return Sl||(Sl=1,(function(t,e){(function(){var n,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",m=500,b="__lodash_placeholder__",T=1,P=2,$=4,O=1,I=2,F=1,ne=2,Y=4,Ae=8,ve=16,_e=32,Fe=64,Pe=128,y=256,_=512,S=30,M="...",k=800,R=16,N=1,E=2,C=3,L=1/0,D=9007199254740991,q=17976931348623157e292,te=NaN,J=4294967295,pe=J-1,Ne=J>>>1,We=[["ary",Pe],["bind",F],["bindKey",ne],["curry",Ae],["curryRight",ve],["flip",_],["partial",_e],["partialRight",Fe],["rearg",y]],le="[object Arguments]",Oe="[object Array]",at="[object AsyncFunction]",Tr="[object Boolean]",Fr="[object Date]",Ii="[object DOMException]",wt="[object Error]",Er="[object Function]",bt="[object GeneratorFunction]",Be="[object Map]",Ue="[object Number]",A1="[object Null]",Wr="[object Object]",nh="[object Promise]",O1="[object Proxy]",Fi="[object RegExp]",lr="[object Set]",Wi="[object String]",ea="[object Symbol]",k1="[object Undefined]",Hi="[object WeakMap]",C1="[object WeakSet]",Yi="[object ArrayBuffer]",Jn="[object DataView]",du="[object Float32Array]",pu="[object Float64Array]",mu="[object Int8Array]",gu="[object Int16Array]",yu="[object Int32Array]",_u="[object Uint8Array]",wu="[object Uint8ClampedArray]",bu="[object Uint16Array]",Su="[object Uint32Array]",x1=/\b__p \+= '';/g,P1=/\b(__p \+=) '' \+/g,R1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ih=/&(?:amp|lt|gt|quot|#39);/g,sh=/[&<>"']/g,D1=RegExp(ih.source),M1=RegExp(sh.source),L1=/<%-([\s\S]+?)%>/g,N1=/<%([\s\S]+?)%>/g,ah=/<%=([\s\S]+?)%>/g,U1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B1=/^\w*$/,I1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vu=/[\\^$.*+?()[\]{}|]/g,F1=RegExp(vu.source),Tu=/^\s+/,W1=/\s/,H1=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y1=/\{\n\/\* \[wrapped with (.+)\] \*/,K1=/,? & /,q1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$1=/[()=,{}\[\]\/\s]/,G1=/\\(\\)?/g,V1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oh=/\w*$/,z1=/^[-+]0x[0-9a-f]+$/i,j1=/^0b[01]+$/i,J1=/^\[object .+?Constructor\]$/,Q1=/^0o[0-7]+$/i,Z1=/^(?:0|[1-9]\d*)$/,X1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ta=/($^)/,eb=/['\n\r\u2028\u2029\\]/g,ra="\\ud800-\\udfff",tb="\\u0300-\\u036f",rb="\\ufe20-\\ufe2f",nb="\\u20d0-\\u20ff",uh=tb+rb+nb,ch="\\u2700-\\u27bf",lh="a-z\\xdf-\\xf6\\xf8-\\xff",ib="\\xac\\xb1\\xd7\\xf7",sb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ab="\\u2000-\\u206f",ob=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fh="A-Z\\xc0-\\xd6\\xd8-\\xde",hh="\\ufe0e\\ufe0f",dh=ib+sb+ab+ob,Eu="['’]",ub="["+ra+"]",ph="["+dh+"]",na="["+uh+"]",mh="\\d+",cb="["+ch+"]",gh="["+lh+"]",yh="[^"+ra+dh+mh+ch+lh+fh+"]",Au="\\ud83c[\\udffb-\\udfff]",lb="(?:"+na+"|"+Au+")",_h="[^"+ra+"]",Ou="(?:\\ud83c[\\udde6-\\uddff]){2}",ku="[\\ud800-\\udbff][\\udc00-\\udfff]",Qn="["+fh+"]",wh="\\u200d",bh="(?:"+gh+"|"+yh+")",fb="(?:"+Qn+"|"+yh+")",Sh="(?:"+Eu+"(?:d|ll|m|re|s|t|ve))?",vh="(?:"+Eu+"(?:D|LL|M|RE|S|T|VE))?",Th=lb+"?",Eh="["+hh+"]?",hb="(?:"+wh+"(?:"+[_h,Ou,ku].join("|")+")"+Eh+Th+")*",db="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ah=Eh+Th+hb,mb="(?:"+[cb,Ou,ku].join("|")+")"+Ah,gb="(?:"+[_h+na+"?",na,Ou,ku,ub].join("|")+")",yb=RegExp(Eu,"g"),_b=RegExp(na,"g"),Cu=RegExp(Au+"(?="+Au+")|"+gb+Ah,"g"),wb=RegExp([Qn+"?"+gh+"+"+Sh+"(?="+[ph,Qn,"$"].join("|")+")",fb+"+"+vh+"(?="+[ph,Qn+bh,"$"].join("|")+")",Qn+"?"+bh+"+"+Sh,Qn+"+"+vh,pb,db,mh,mb].join("|"),"g"),bb=RegExp("["+wh+ra+uh+hh+"]"),Sb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tb=-1,qe={};qe[du]=qe[pu]=qe[mu]=qe[gu]=qe[yu]=qe[_u]=qe[wu]=qe[bu]=qe[Su]=!0,qe[le]=qe[Oe]=qe[Yi]=qe[Tr]=qe[Jn]=qe[Fr]=qe[wt]=qe[Er]=qe[Be]=qe[Ue]=qe[Wr]=qe[Fi]=qe[lr]=qe[Wi]=qe[Hi]=!1;var He={};He[le]=He[Oe]=He[Yi]=He[Jn]=He[Tr]=He[Fr]=He[du]=He[pu]=He[mu]=He[gu]=He[yu]=He[Be]=He[Ue]=He[Wr]=He[Fi]=He[lr]=He[Wi]=He[ea]=He[_u]=He[wu]=He[bu]=He[Su]=!0,He[wt]=He[Er]=He[Hi]=!1;var Eb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ab={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ob={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},kb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cb=parseFloat,xb=parseInt,Oh=typeof ys=="object"&&ys&&ys.Object===Object&&ys,Pb=typeof self=="object"&&self&&self.Object===Object&&self,ft=Oh||Pb||Function("return this")(),xu=e&&!e.nodeType&&e,An=xu&&!0&&t&&!t.nodeType&&t,kh=An&&An.exports===xu,Pu=kh&&Oh.process,Jt=(function(){try{var A=An&&An.require&&An.require("util").types;return A||Pu&&Pu.binding&&Pu.binding("util")}catch{}})(),Ch=Jt&&Jt.isArrayBuffer,xh=Jt&&Jt.isDate,Ph=Jt&&Jt.isMap,Rh=Jt&&Jt.isRegExp,Dh=Jt&&Jt.isSet,Mh=Jt&&Jt.isTypedArray;function Ut(A,W,B){switch(B.length){case 0:return A.call(W);case 1:return A.call(W,B[0]);case 2:return A.call(W,B[0],B[1]);case 3:return A.call(W,B[0],B[1],B[2])}return A.apply(W,B)}function Rb(A,W,B,Z){for(var ue=-1,Re=A==null?0:A.length;++ue<Re;){var nt=A[ue];W(Z,nt,B(nt),A)}return Z}function Qt(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z&&W(A[B],B,A)!==!1;);return A}function Db(A,W){for(var B=A==null?0:A.length;B--&&W(A[B],B,A)!==!1;);return A}function Lh(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z;)if(!W(A[B],B,A))return!1;return!0}function nn(A,W){for(var B=-1,Z=A==null?0:A.length,ue=0,Re=[];++B<Z;){var nt=A[B];W(nt,B,A)&&(Re[ue++]=nt)}return Re}function ia(A,W){var B=A==null?0:A.length;return!!B&&Zn(A,W,0)>-1}function Ru(A,W,B){for(var Z=-1,ue=A==null?0:A.length;++Z<ue;)if(B(W,A[Z]))return!0;return!1}function Ve(A,W){for(var B=-1,Z=A==null?0:A.length,ue=Array(Z);++B<Z;)ue[B]=W(A[B],B,A);return ue}function sn(A,W){for(var B=-1,Z=W.length,ue=A.length;++B<Z;)A[ue+B]=W[B];return A}function Du(A,W,B,Z){var ue=-1,Re=A==null?0:A.length;for(Z&&Re&&(B=A[++ue]);++ue<Re;)B=W(B,A[ue],ue,A);return B}function Mb(A,W,B,Z){var ue=A==null?0:A.length;for(Z&&ue&&(B=A[--ue]);ue--;)B=W(B,A[ue],ue,A);return B}function Mu(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z;)if(W(A[B],B,A))return!0;return!1}var Lb=Lu("length");function Nb(A){return A.split("")}function Ub(A){return A.match(q1)||[]}function Nh(A,W,B){var Z;return B(A,function(ue,Re,nt){if(W(ue,Re,nt))return Z=Re,!1}),Z}function sa(A,W,B,Z){for(var ue=A.length,Re=B+(Z?1:-1);Z?Re--:++Re<ue;)if(W(A[Re],Re,A))return Re;return-1}function Zn(A,W,B){return W===W?zb(A,W,B):sa(A,Uh,B)}function Bb(A,W,B,Z){for(var ue=B-1,Re=A.length;++ue<Re;)if(Z(A[ue],W))return ue;return-1}function Uh(A){return A!==A}function Bh(A,W){var B=A==null?0:A.length;return B?Uu(A,W)/B:te}function Lu(A){return function(W){return W==null?n:W[A]}}function Nu(A){return function(W){return A==null?n:A[W]}}function Ih(A,W,B,Z,ue){return ue(A,function(Re,nt,Ie){B=Z?(Z=!1,Re):W(B,Re,nt,Ie)}),B}function Ib(A,W){var B=A.length;for(A.sort(W);B--;)A[B]=A[B].value;return A}function Uu(A,W){for(var B,Z=-1,ue=A.length;++Z<ue;){var Re=W(A[Z]);Re!==n&&(B=B===n?Re:B+Re)}return B}function Bu(A,W){for(var B=-1,Z=Array(A);++B<A;)Z[B]=W(B);return Z}function Fb(A,W){return Ve(W,function(B){return[B,A[B]]})}function Fh(A){return A&&A.slice(0,Kh(A)+1).replace(Tu,"")}function Bt(A){return function(W){return A(W)}}function Iu(A,W){return Ve(W,function(B){return A[B]})}function Ki(A,W){return A.has(W)}function Wh(A,W){for(var B=-1,Z=A.length;++B<Z&&Zn(W,A[B],0)>-1;);return B}function Hh(A,W){for(var B=A.length;B--&&Zn(W,A[B],0)>-1;);return B}function Wb(A,W){for(var B=A.length,Z=0;B--;)A[B]===W&&++Z;return Z}var Hb=Nu(Eb),Yb=Nu(Ab);function Kb(A){return"\\"+kb[A]}function qb(A,W){return A==null?n:A[W]}function Xn(A){return bb.test(A)}function $b(A){return Sb.test(A)}function Gb(A){for(var W,B=[];!(W=A.next()).done;)B.push(W.value);return B}function Fu(A){var W=-1,B=Array(A.size);return A.forEach(function(Z,ue){B[++W]=[ue,Z]}),B}function Yh(A,W){return function(B){return A(W(B))}}function an(A,W){for(var B=-1,Z=A.length,ue=0,Re=[];++B<Z;){var nt=A[B];(nt===W||nt===b)&&(A[B]=b,Re[ue++]=B)}return Re}function aa(A){var W=-1,B=Array(A.size);return A.forEach(function(Z){B[++W]=Z}),B}function Vb(A){var W=-1,B=Array(A.size);return A.forEach(function(Z){B[++W]=[Z,Z]}),B}function zb(A,W,B){for(var Z=B-1,ue=A.length;++Z<ue;)if(A[Z]===W)return Z;return-1}function jb(A,W,B){for(var Z=B+1;Z--;)if(A[Z]===W)return Z;return Z}function ei(A){return Xn(A)?Qb(A):Lb(A)}function fr(A){return Xn(A)?Zb(A):Nb(A)}function Kh(A){for(var W=A.length;W--&&W1.test(A.charAt(W)););return W}var Jb=Nu(Ob);function Qb(A){for(var W=Cu.lastIndex=0;Cu.test(A);)++W;return W}function Zb(A){return A.match(Cu)||[]}function Xb(A){return A.match(wb)||[]}var eS=(function A(W){W=W==null?ft:ti.defaults(ft.Object(),W,ti.pick(ft,vb));var B=W.Array,Z=W.Date,ue=W.Error,Re=W.Function,nt=W.Math,Ie=W.Object,Wu=W.RegExp,tS=W.String,Zt=W.TypeError,oa=B.prototype,rS=Re.prototype,ri=Ie.prototype,ua=W["__core-js_shared__"],ca=rS.toString,Me=ri.hasOwnProperty,nS=0,qh=(function(){var r=/[^.]+$/.exec(ua&&ua.keys&&ua.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),la=ri.toString,iS=ca.call(Ie),sS=ft._,aS=Wu("^"+ca.call(Me).replace(vu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=kh?W.Buffer:n,on=W.Symbol,ha=W.Uint8Array,$h=fa?fa.allocUnsafe:n,da=Yh(Ie.getPrototypeOf,Ie),Gh=Ie.create,Vh=ri.propertyIsEnumerable,pa=oa.splice,zh=on?on.isConcatSpreadable:n,qi=on?on.iterator:n,On=on?on.toStringTag:n,ma=(function(){try{var r=Rn(Ie,"defineProperty");return r({},"",{}),r}catch{}})(),oS=W.clearTimeout!==ft.clearTimeout&&W.clearTimeout,uS=Z&&Z.now!==ft.Date.now&&Z.now,cS=W.setTimeout!==ft.setTimeout&&W.setTimeout,ga=nt.ceil,ya=nt.floor,Hu=Ie.getOwnPropertySymbols,lS=fa?fa.isBuffer:n,jh=W.isFinite,fS=oa.join,hS=Yh(Ie.keys,Ie),it=nt.max,mt=nt.min,dS=Z.now,pS=W.parseInt,Jh=nt.random,mS=oa.reverse,Yu=Rn(W,"DataView"),$i=Rn(W,"Map"),Ku=Rn(W,"Promise"),ni=Rn(W,"Set"),Gi=Rn(W,"WeakMap"),Vi=Rn(Ie,"create"),_a=Gi&&new Gi,ii={},gS=Dn(Yu),yS=Dn($i),_S=Dn(Ku),wS=Dn(ni),bS=Dn(Gi),wa=on?on.prototype:n,zi=wa?wa.valueOf:n,Qh=wa?wa.toString:n;function p(r){if(Je(r)&&!fe(r)&&!(r instanceof Se)){if(r instanceof Xt)return r;if(Me.call(r,"__wrapped__"))return Zd(r)}return new Xt(r)}var si=(function(){function r(){}return function(i){if(!je(i))return{};if(Gh)return Gh(i);r.prototype=i;var o=new r;return r.prototype=n,o}})();function ba(){}function Xt(r,i){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}p.templateSettings={escape:L1,evaluate:N1,interpolate:ah,variable:"",imports:{_:p}},p.prototype=ba.prototype,p.prototype.constructor=p,Xt.prototype=si(ba.prototype),Xt.prototype.constructor=Xt;function Se(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=J,this.__views__=[]}function SS(){var r=new Se(this.__wrapped__);return r.__actions__=Pt(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=Pt(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=Pt(this.__views__),r}function vS(){if(this.__filtered__){var r=new Se(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function TS(){var r=this.__wrapped__.value(),i=this.__dir__,o=fe(r),f=i<0,d=o?r.length:0,g=Nv(0,d,this.__views__),w=g.start,v=g.end,x=v-w,H=f?v:w-1,K=this.__iteratees__,G=K.length,j=0,re=mt(x,this.__takeCount__);if(!o||!f&&d==x&&re==x)return Sd(r,this.__actions__);var ae=[];e:for(;x--&&j<re;){H+=i;for(var ge=-1,oe=r[H];++ge<G;){var we=K[ge],Te=we.iteratee,Wt=we.type,Tt=Te(oe);if(Wt==E)oe=Tt;else if(!Tt){if(Wt==N)continue e;break e}}ae[j++]=oe}return ae}Se.prototype=si(ba.prototype),Se.prototype.constructor=Se;function kn(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function ES(){this.__data__=Vi?Vi(null):{},this.size=0}function AS(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function OS(r){var i=this.__data__;if(Vi){var o=i[r];return o===h?n:o}return Me.call(i,r)?i[r]:n}function kS(r){var i=this.__data__;return Vi?i[r]!==n:Me.call(i,r)}function CS(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=Vi&&i===n?h:i,this}kn.prototype.clear=ES,kn.prototype.delete=AS,kn.prototype.get=OS,kn.prototype.has=kS,kn.prototype.set=CS;function Hr(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function xS(){this.__data__=[],this.size=0}function PS(r){var i=this.__data__,o=Sa(i,r);if(o<0)return!1;var f=i.length-1;return o==f?i.pop():pa.call(i,o,1),--this.size,!0}function RS(r){var i=this.__data__,o=Sa(i,r);return o<0?n:i[o][1]}function DS(r){return Sa(this.__data__,r)>-1}function MS(r,i){var o=this.__data__,f=Sa(o,r);return f<0?(++this.size,o.push([r,i])):o[f][1]=i,this}Hr.prototype.clear=xS,Hr.prototype.delete=PS,Hr.prototype.get=RS,Hr.prototype.has=DS,Hr.prototype.set=MS;function Yr(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function LS(){this.size=0,this.__data__={hash:new kn,map:new($i||Hr),string:new kn}}function NS(r){var i=Ma(this,r).delete(r);return this.size-=i?1:0,i}function US(r){return Ma(this,r).get(r)}function BS(r){return Ma(this,r).has(r)}function IS(r,i){var o=Ma(this,r),f=o.size;return o.set(r,i),this.size+=o.size==f?0:1,this}Yr.prototype.clear=LS,Yr.prototype.delete=NS,Yr.prototype.get=US,Yr.prototype.has=BS,Yr.prototype.set=IS;function Cn(r){var i=-1,o=r==null?0:r.length;for(this.__data__=new Yr;++i<o;)this.add(r[i])}function FS(r){return this.__data__.set(r,h),this}function WS(r){return this.__data__.has(r)}Cn.prototype.add=Cn.prototype.push=FS,Cn.prototype.has=WS;function hr(r){var i=this.__data__=new Hr(r);this.size=i.size}function HS(){this.__data__=new Hr,this.size=0}function YS(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}function KS(r){return this.__data__.get(r)}function qS(r){return this.__data__.has(r)}function $S(r,i){var o=this.__data__;if(o instanceof Hr){var f=o.__data__;if(!$i||f.length<a-1)return f.push([r,i]),this.size=++o.size,this;o=this.__data__=new Yr(f)}return o.set(r,i),this.size=o.size,this}hr.prototype.clear=HS,hr.prototype.delete=YS,hr.prototype.get=KS,hr.prototype.has=qS,hr.prototype.set=$S;function Zh(r,i){var o=fe(r),f=!o&&Mn(r),d=!o&&!f&&hn(r),g=!o&&!f&&!d&&ci(r),w=o||f||d||g,v=w?Bu(r.length,tS):[],x=v.length;for(var H in r)(i||Me.call(r,H))&&!(w&&(H=="length"||d&&(H=="offset"||H=="parent")||g&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Gr(H,x)))&&v.push(H);return v}function Xh(r){var i=r.length;return i?r[ec(0,i-1)]:n}function GS(r,i){return La(Pt(r),xn(i,0,r.length))}function VS(r){return La(Pt(r))}function qu(r,i,o){(o!==n&&!dr(r[i],o)||o===n&&!(i in r))&&Kr(r,i,o)}function ji(r,i,o){var f=r[i];(!(Me.call(r,i)&&dr(f,o))||o===n&&!(i in r))&&Kr(r,i,o)}function Sa(r,i){for(var o=r.length;o--;)if(dr(r[o][0],i))return o;return-1}function zS(r,i,o,f){return un(r,function(d,g,w){i(f,d,o(d),w)}),f}function ed(r,i){return r&&Or(i,ot(i),r)}function jS(r,i){return r&&Or(i,Dt(i),r)}function Kr(r,i,o){i=="__proto__"&&ma?ma(r,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[i]=o}function $u(r,i){for(var o=-1,f=i.length,d=B(f),g=r==null;++o<f;)d[o]=g?n:Ac(r,i[o]);return d}function xn(r,i,o){return r===r&&(o!==n&&(r=r<=o?r:o),i!==n&&(r=r>=i?r:i)),r}function er(r,i,o,f,d,g){var w,v=i&T,x=i&P,H=i&$;if(o&&(w=d?o(r,f,d,g):o(r)),w!==n)return w;if(!je(r))return r;var K=fe(r);if(K){if(w=Bv(r),!v)return Pt(r,w)}else{var G=gt(r),j=G==Er||G==bt;if(hn(r))return Ed(r,v);if(G==Wr||G==le||j&&!d){if(w=x||j?{}:Kd(r),!v)return x?Ov(r,jS(w,r)):Av(r,ed(w,r))}else{if(!He[G])return d?r:{};w=Iv(r,G,v)}}g||(g=new hr);var re=g.get(r);if(re)return re;g.set(r,w),_p(r)?r.forEach(function(oe){w.add(er(oe,i,o,oe,r,g))}):gp(r)&&r.forEach(function(oe,we){w.set(we,er(oe,i,o,we,r,g))});var ae=H?x?fc:lc:x?Dt:ot,ge=K?n:ae(r);return Qt(ge||r,function(oe,we){ge&&(we=oe,oe=r[we]),ji(w,we,er(oe,i,o,we,r,g))}),w}function JS(r){var i=ot(r);return function(o){return td(o,r,i)}}function td(r,i,o){var f=o.length;if(r==null)return!f;for(r=Ie(r);f--;){var d=o[f],g=i[d],w=r[d];if(w===n&&!(d in r)||!g(w))return!1}return!0}function rd(r,i,o){if(typeof r!="function")throw new Zt(u);return rs(function(){r.apply(n,o)},i)}function Ji(r,i,o,f){var d=-1,g=ia,w=!0,v=r.length,x=[],H=i.length;if(!v)return x;o&&(i=Ve(i,Bt(o))),f?(g=Ru,w=!1):i.length>=a&&(g=Ki,w=!1,i=new Cn(i));e:for(;++d<v;){var K=r[d],G=o==null?K:o(K);if(K=f||K!==0?K:0,w&&G===G){for(var j=H;j--;)if(i[j]===G)continue e;x.push(K)}else g(i,G,f)||x.push(K)}return x}var un=xd(Ar),nd=xd(Vu,!0);function QS(r,i){var o=!0;return un(r,function(f,d,g){return o=!!i(f,d,g),o}),o}function va(r,i,o){for(var f=-1,d=r.length;++f<d;){var g=r[f],w=i(g);if(w!=null&&(v===n?w===w&&!Ft(w):o(w,v)))var v=w,x=g}return x}function ZS(r,i,o,f){var d=r.length;for(o=me(o),o<0&&(o=-o>d?0:d+o),f=f===n||f>d?d:me(f),f<0&&(f+=d),f=o>f?0:bp(f);o<f;)r[o++]=i;return r}function id(r,i){var o=[];return un(r,function(f,d,g){i(f,d,g)&&o.push(f)}),o}function ht(r,i,o,f,d){var g=-1,w=r.length;for(o||(o=Wv),d||(d=[]);++g<w;){var v=r[g];i>0&&o(v)?i>1?ht(v,i-1,o,f,d):sn(d,v):f||(d[d.length]=v)}return d}var Gu=Pd(),sd=Pd(!0);function Ar(r,i){return r&&Gu(r,i,ot)}function Vu(r,i){return r&&sd(r,i,ot)}function Ta(r,i){return nn(i,function(o){return Vr(r[o])})}function Pn(r,i){i=ln(i,r);for(var o=0,f=i.length;r!=null&&o<f;)r=r[kr(i[o++])];return o&&o==f?r:n}function ad(r,i,o){var f=i(r);return fe(r)?f:sn(f,o(r))}function St(r){return r==null?r===n?k1:A1:On&&On in Ie(r)?Lv(r):Vv(r)}function zu(r,i){return r>i}function XS(r,i){return r!=null&&Me.call(r,i)}function ev(r,i){return r!=null&&i in Ie(r)}function tv(r,i,o){return r>=mt(i,o)&&r<it(i,o)}function ju(r,i,o){for(var f=o?Ru:ia,d=r[0].length,g=r.length,w=g,v=B(g),x=1/0,H=[];w--;){var K=r[w];w&&i&&(K=Ve(K,Bt(i))),x=mt(K.length,x),v[w]=!o&&(i||d>=120&&K.length>=120)?new Cn(w&&K):n}K=r[0];var G=-1,j=v[0];e:for(;++G<d&&H.length<x;){var re=K[G],ae=i?i(re):re;if(re=o||re!==0?re:0,!(j?Ki(j,ae):f(H,ae,o))){for(w=g;--w;){var ge=v[w];if(!(ge?Ki(ge,ae):f(r[w],ae,o)))continue e}j&&j.push(ae),H.push(re)}}return H}function rv(r,i,o,f){return Ar(r,function(d,g,w){i(f,o(d),g,w)}),f}function Qi(r,i,o){i=ln(i,r),r=Vd(r,i);var f=r==null?r:r[kr(rr(i))];return f==null?n:Ut(f,r,o)}function od(r){return Je(r)&&St(r)==le}function nv(r){return Je(r)&&St(r)==Yi}function iv(r){return Je(r)&&St(r)==Fr}function Zi(r,i,o,f,d){return r===i?!0:r==null||i==null||!Je(r)&&!Je(i)?r!==r&&i!==i:sv(r,i,o,f,Zi,d)}function sv(r,i,o,f,d,g){var w=fe(r),v=fe(i),x=w?Oe:gt(r),H=v?Oe:gt(i);x=x==le?Wr:x,H=H==le?Wr:H;var K=x==Wr,G=H==Wr,j=x==H;if(j&&hn(r)){if(!hn(i))return!1;w=!0,K=!1}if(j&&!K)return g||(g=new hr),w||ci(r)?Wd(r,i,o,f,d,g):Dv(r,i,x,o,f,d,g);if(!(o&O)){var re=K&&Me.call(r,"__wrapped__"),ae=G&&Me.call(i,"__wrapped__");if(re||ae){var ge=re?r.value():r,oe=ae?i.value():i;return g||(g=new hr),d(ge,oe,o,f,g)}}return j?(g||(g=new hr),Mv(r,i,o,f,d,g)):!1}function av(r){return Je(r)&&gt(r)==Be}function Ju(r,i,o,f){var d=o.length,g=d,w=!f;if(r==null)return!g;for(r=Ie(r);d--;){var v=o[d];if(w&&v[2]?v[1]!==r[v[0]]:!(v[0]in r))return!1}for(;++d<g;){v=o[d];var x=v[0],H=r[x],K=v[1];if(w&&v[2]){if(H===n&&!(x in r))return!1}else{var G=new hr;if(f)var j=f(H,K,x,r,i,G);if(!(j===n?Zi(K,H,O|I,f,G):j))return!1}}return!0}function ud(r){if(!je(r)||Yv(r))return!1;var i=Vr(r)?aS:J1;return i.test(Dn(r))}function ov(r){return Je(r)&&St(r)==Fi}function uv(r){return Je(r)&&gt(r)==lr}function cv(r){return Je(r)&&Wa(r.length)&&!!qe[St(r)]}function cd(r){return typeof r=="function"?r:r==null?Mt:typeof r=="object"?fe(r)?hd(r[0],r[1]):fd(r):Rp(r)}function Qu(r){if(!ts(r))return hS(r);var i=[];for(var o in Ie(r))Me.call(r,o)&&o!="constructor"&&i.push(o);return i}function lv(r){if(!je(r))return Gv(r);var i=ts(r),o=[];for(var f in r)f=="constructor"&&(i||!Me.call(r,f))||o.push(f);return o}function Zu(r,i){return r<i}function ld(r,i){var o=-1,f=Rt(r)?B(r.length):[];return un(r,function(d,g,w){f[++o]=i(d,g,w)}),f}function fd(r){var i=dc(r);return i.length==1&&i[0][2]?$d(i[0][0],i[0][1]):function(o){return o===r||Ju(o,r,i)}}function hd(r,i){return mc(r)&&qd(i)?$d(kr(r),i):function(o){var f=Ac(o,r);return f===n&&f===i?Oc(o,r):Zi(i,f,O|I)}}function Ea(r,i,o,f,d){r!==i&&Gu(i,function(g,w){if(d||(d=new hr),je(g))fv(r,i,w,o,Ea,f,d);else{var v=f?f(yc(r,w),g,w+"",r,i,d):n;v===n&&(v=g),qu(r,w,v)}},Dt)}function fv(r,i,o,f,d,g,w){var v=yc(r,o),x=yc(i,o),H=w.get(x);if(H){qu(r,o,H);return}var K=g?g(v,x,o+"",r,i,w):n,G=K===n;if(G){var j=fe(x),re=!j&&hn(x),ae=!j&&!re&&ci(x);K=x,j||re||ae?fe(v)?K=v:et(v)?K=Pt(v):re?(G=!1,K=Ed(x,!0)):ae?(G=!1,K=Ad(x,!0)):K=[]:ns(x)||Mn(x)?(K=v,Mn(v)?K=Sp(v):(!je(v)||Vr(v))&&(K=Kd(x))):G=!1}G&&(w.set(x,K),d(K,x,f,g,w),w.delete(x)),qu(r,o,K)}function dd(r,i){var o=r.length;if(o)return i+=i<0?o:0,Gr(i,o)?r[i]:n}function pd(r,i,o){i.length?i=Ve(i,function(g){return fe(g)?function(w){return Pn(w,g.length===1?g[0]:g)}:g}):i=[Mt];var f=-1;i=Ve(i,Bt(se()));var d=ld(r,function(g,w,v){var x=Ve(i,function(H){return H(g)});return{criteria:x,index:++f,value:g}});return Ib(d,function(g,w){return Ev(g,w,o)})}function hv(r,i){return md(r,i,function(o,f){return Oc(r,f)})}function md(r,i,o){for(var f=-1,d=i.length,g={};++f<d;){var w=i[f],v=Pn(r,w);o(v,w)&&Xi(g,ln(w,r),v)}return g}function dv(r){return function(i){return Pn(i,r)}}function Xu(r,i,o,f){var d=f?Bb:Zn,g=-1,w=i.length,v=r;for(r===i&&(i=Pt(i)),o&&(v=Ve(r,Bt(o)));++g<w;)for(var x=0,H=i[g],K=o?o(H):H;(x=d(v,K,x,f))>-1;)v!==r&&pa.call(v,x,1),pa.call(r,x,1);return r}function gd(r,i){for(var o=r?i.length:0,f=o-1;o--;){var d=i[o];if(o==f||d!==g){var g=d;Gr(d)?pa.call(r,d,1):nc(r,d)}}return r}function ec(r,i){return r+ya(Jh()*(i-r+1))}function pv(r,i,o,f){for(var d=-1,g=it(ga((i-r)/(o||1)),0),w=B(g);g--;)w[f?g:++d]=r,r+=o;return w}function tc(r,i){var o="";if(!r||i<1||i>D)return o;do i%2&&(o+=r),i=ya(i/2),i&&(r+=r);while(i);return o}function ye(r,i){return _c(Gd(r,i,Mt),r+"")}function mv(r){return Xh(li(r))}function gv(r,i){var o=li(r);return La(o,xn(i,0,o.length))}function Xi(r,i,o,f){if(!je(r))return r;i=ln(i,r);for(var d=-1,g=i.length,w=g-1,v=r;v!=null&&++d<g;){var x=kr(i[d]),H=o;if(x==="__proto__"||x==="constructor"||x==="prototype")return r;if(d!=w){var K=v[x];H=f?f(K,x,v):n,H===n&&(H=je(K)?K:Gr(i[d+1])?[]:{})}ji(v,x,H),v=v[x]}return r}var yd=_a?function(r,i){return _a.set(r,i),r}:Mt,yv=ma?function(r,i){return ma(r,"toString",{configurable:!0,enumerable:!1,value:Cc(i),writable:!0})}:Mt;function _v(r){return La(li(r))}function tr(r,i,o){var f=-1,d=r.length;i<0&&(i=-i>d?0:d+i),o=o>d?d:o,o<0&&(o+=d),d=i>o?0:o-i>>>0,i>>>=0;for(var g=B(d);++f<d;)g[f]=r[f+i];return g}function wv(r,i){var o;return un(r,function(f,d,g){return o=i(f,d,g),!o}),!!o}function Aa(r,i,o){var f=0,d=r==null?f:r.length;if(typeof i=="number"&&i===i&&d<=Ne){for(;f<d;){var g=f+d>>>1,w=r[g];w!==null&&!Ft(w)&&(o?w<=i:w<i)?f=g+1:d=g}return d}return rc(r,i,Mt,o)}function rc(r,i,o,f){var d=0,g=r==null?0:r.length;if(g===0)return 0;i=o(i);for(var w=i!==i,v=i===null,x=Ft(i),H=i===n;d<g;){var K=ya((d+g)/2),G=o(r[K]),j=G!==n,re=G===null,ae=G===G,ge=Ft(G);if(w)var oe=f||ae;else H?oe=ae&&(f||j):v?oe=ae&&j&&(f||!re):x?oe=ae&&j&&!re&&(f||!ge):re||ge?oe=!1:oe=f?G<=i:G<i;oe?d=K+1:g=K}return mt(g,pe)}function _d(r,i){for(var o=-1,f=r.length,d=0,g=[];++o<f;){var w=r[o],v=i?i(w):w;if(!o||!dr(v,x)){var x=v;g[d++]=w===0?0:w}}return g}function wd(r){return typeof r=="number"?r:Ft(r)?te:+r}function It(r){if(typeof r=="string")return r;if(fe(r))return Ve(r,It)+"";if(Ft(r))return Qh?Qh.call(r):"";var i=r+"";return i=="0"&&1/r==-L?"-0":i}function cn(r,i,o){var f=-1,d=ia,g=r.length,w=!0,v=[],x=v;if(o)w=!1,d=Ru;else if(g>=a){var H=i?null:Pv(r);if(H)return aa(H);w=!1,d=Ki,x=new Cn}else x=i?[]:v;e:for(;++f<g;){var K=r[f],G=i?i(K):K;if(K=o||K!==0?K:0,w&&G===G){for(var j=x.length;j--;)if(x[j]===G)continue e;i&&x.push(G),v.push(K)}else d(x,G,o)||(x!==v&&x.push(G),v.push(K))}return v}function nc(r,i){return i=ln(i,r),r=Vd(r,i),r==null||delete r[kr(rr(i))]}function bd(r,i,o,f){return Xi(r,i,o(Pn(r,i)),f)}function Oa(r,i,o,f){for(var d=r.length,g=f?d:-1;(f?g--:++g<d)&&i(r[g],g,r););return o?tr(r,f?0:g,f?g+1:d):tr(r,f?g+1:0,f?d:g)}function Sd(r,i){var o=r;return o instanceof Se&&(o=o.value()),Du(i,function(f,d){return d.func.apply(d.thisArg,sn([f],d.args))},o)}function ic(r,i,o){var f=r.length;if(f<2)return f?cn(r[0]):[];for(var d=-1,g=B(f);++d<f;)for(var w=r[d],v=-1;++v<f;)v!=d&&(g[d]=Ji(g[d]||w,r[v],i,o));return cn(ht(g,1),i,o)}function vd(r,i,o){for(var f=-1,d=r.length,g=i.length,w={};++f<d;){var v=f<g?i[f]:n;o(w,r[f],v)}return w}function sc(r){return et(r)?r:[]}function ac(r){return typeof r=="function"?r:Mt}function ln(r,i){return fe(r)?r:mc(r,i)?[r]:Qd(De(r))}var bv=ye;function fn(r,i,o){var f=r.length;return o=o===n?f:o,!i&&o>=f?r:tr(r,i,o)}var Td=oS||function(r){return ft.clearTimeout(r)};function Ed(r,i){if(i)return r.slice();var o=r.length,f=$h?$h(o):new r.constructor(o);return r.copy(f),f}function oc(r){var i=new r.constructor(r.byteLength);return new ha(i).set(new ha(r)),i}function Sv(r,i){var o=i?oc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}function vv(r){var i=new r.constructor(r.source,oh.exec(r));return i.lastIndex=r.lastIndex,i}function Tv(r){return zi?Ie(zi.call(r)):{}}function Ad(r,i){var o=i?oc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}function Od(r,i){if(r!==i){var o=r!==n,f=r===null,d=r===r,g=Ft(r),w=i!==n,v=i===null,x=i===i,H=Ft(i);if(!v&&!H&&!g&&r>i||g&&w&&x&&!v&&!H||f&&w&&x||!o&&x||!d)return 1;if(!f&&!g&&!H&&r<i||H&&o&&d&&!f&&!g||v&&o&&d||!w&&d||!x)return-1}return 0}function Ev(r,i,o){for(var f=-1,d=r.criteria,g=i.criteria,w=d.length,v=o.length;++f<w;){var x=Od(d[f],g[f]);if(x){if(f>=v)return x;var H=o[f];return x*(H=="desc"?-1:1)}}return r.index-i.index}function kd(r,i,o,f){for(var d=-1,g=r.length,w=o.length,v=-1,x=i.length,H=it(g-w,0),K=B(x+H),G=!f;++v<x;)K[v]=i[v];for(;++d<w;)(G||d<g)&&(K[o[d]]=r[d]);for(;H--;)K[v++]=r[d++];return K}function Cd(r,i,o,f){for(var d=-1,g=r.length,w=-1,v=o.length,x=-1,H=i.length,K=it(g-v,0),G=B(K+H),j=!f;++d<K;)G[d]=r[d];for(var re=d;++x<H;)G[re+x]=i[x];for(;++w<v;)(j||d<g)&&(G[re+o[w]]=r[d++]);return G}function Pt(r,i){var o=-1,f=r.length;for(i||(i=B(f));++o<f;)i[o]=r[o];return i}function Or(r,i,o,f){var d=!o;o||(o={});for(var g=-1,w=i.length;++g<w;){var v=i[g],x=f?f(o[v],r[v],v,o,r):n;x===n&&(x=r[v]),d?Kr(o,v,x):ji(o,v,x)}return o}function Av(r,i){return Or(r,pc(r),i)}function Ov(r,i){return Or(r,Hd(r),i)}function ka(r,i){return function(o,f){var d=fe(o)?Rb:zS,g=i?i():{};return d(o,r,se(f,2),g)}}function ai(r){return ye(function(i,o){var f=-1,d=o.length,g=d>1?o[d-1]:n,w=d>2?o[2]:n;for(g=r.length>3&&typeof g=="function"?(d--,g):n,w&&vt(o[0],o[1],w)&&(g=d<3?n:g,d=1),i=Ie(i);++f<d;){var v=o[f];v&&r(i,v,f,g)}return i})}function xd(r,i){return function(o,f){if(o==null)return o;if(!Rt(o))return r(o,f);for(var d=o.length,g=i?d:-1,w=Ie(o);(i?g--:++g<d)&&f(w[g],g,w)!==!1;);return o}}function Pd(r){return function(i,o,f){for(var d=-1,g=Ie(i),w=f(i),v=w.length;v--;){var x=w[r?v:++d];if(o(g[x],x,g)===!1)break}return i}}function kv(r,i,o){var f=i&F,d=es(r);function g(){var w=this&&this!==ft&&this instanceof g?d:r;return w.apply(f?o:this,arguments)}return g}function Rd(r){return function(i){i=De(i);var o=Xn(i)?fr(i):n,f=o?o[0]:i.charAt(0),d=o?fn(o,1).join(""):i.slice(1);return f[r]()+d}}function oi(r){return function(i){return Du(xp(Cp(i).replace(yb,"")),r,"")}}function es(r){return function(){var i=arguments;switch(i.length){case 0:return new r;case 1:return new r(i[0]);case 2:return new r(i[0],i[1]);case 3:return new r(i[0],i[1],i[2]);case 4:return new r(i[0],i[1],i[2],i[3]);case 5:return new r(i[0],i[1],i[2],i[3],i[4]);case 6:return new r(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new r(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var o=si(r.prototype),f=r.apply(o,i);return je(f)?f:o}}function Cv(r,i,o){var f=es(r);function d(){for(var g=arguments.length,w=B(g),v=g,x=ui(d);v--;)w[v]=arguments[v];var H=g<3&&w[0]!==x&&w[g-1]!==x?[]:an(w,x);if(g-=H.length,g<o)return Ud(r,i,Ca,d.placeholder,n,w,H,n,n,o-g);var K=this&&this!==ft&&this instanceof d?f:r;return Ut(K,this,w)}return d}function Dd(r){return function(i,o,f){var d=Ie(i);if(!Rt(i)){var g=se(o,3);i=ot(i),o=function(v){return g(d[v],v,d)}}var w=r(i,o,f);return w>-1?d[g?i[w]:w]:n}}function Md(r){return $r(function(i){var o=i.length,f=o,d=Xt.prototype.thru;for(r&&i.reverse();f--;){var g=i[f];if(typeof g!="function")throw new Zt(u);if(d&&!w&&Da(g)=="wrapper")var w=new Xt([],!0)}for(f=w?f:o;++f<o;){g=i[f];var v=Da(g),x=v=="wrapper"?hc(g):n;x&&gc(x[0])&&x[1]==(Pe|Ae|_e|y)&&!x[4].length&&x[9]==1?w=w[Da(x[0])].apply(w,x[3]):w=g.length==1&&gc(g)?w[v]():w.thru(g)}return function(){var H=arguments,K=H[0];if(w&&H.length==1&&fe(K))return w.plant(K).value();for(var G=0,j=o?i[G].apply(this,H):K;++G<o;)j=i[G].call(this,j);return j}})}function Ca(r,i,o,f,d,g,w,v,x,H){var K=i&Pe,G=i&F,j=i&ne,re=i&(Ae|ve),ae=i&_,ge=j?n:es(r);function oe(){for(var we=arguments.length,Te=B(we),Wt=we;Wt--;)Te[Wt]=arguments[Wt];if(re)var Tt=ui(oe),Ht=Wb(Te,Tt);if(f&&(Te=kd(Te,f,d,re)),g&&(Te=Cd(Te,g,w,re)),we-=Ht,re&&we<H){var tt=an(Te,Tt);return Ud(r,i,Ca,oe.placeholder,o,Te,tt,v,x,H-we)}var pr=G?o:this,jr=j?pr[r]:r;return we=Te.length,v?Te=zv(Te,v):ae&&we>1&&Te.reverse(),K&&x<we&&(Te.length=x),this&&this!==ft&&this instanceof oe&&(jr=ge||es(jr)),jr.apply(pr,Te)}return oe}function Ld(r,i){return function(o,f){return rv(o,r,i(f),{})}}function xa(r,i){return function(o,f){var d;if(o===n&&f===n)return i;if(o!==n&&(d=o),f!==n){if(d===n)return f;typeof o=="string"||typeof f=="string"?(o=It(o),f=It(f)):(o=wd(o),f=wd(f)),d=r(o,f)}return d}}function uc(r){return $r(function(i){return i=Ve(i,Bt(se())),ye(function(o){var f=this;return r(i,function(d){return Ut(d,f,o)})})})}function Pa(r,i){i=i===n?" ":It(i);var o=i.length;if(o<2)return o?tc(i,r):i;var f=tc(i,ga(r/ei(i)));return Xn(i)?fn(fr(f),0,r).join(""):f.slice(0,r)}function xv(r,i,o,f){var d=i&F,g=es(r);function w(){for(var v=-1,x=arguments.length,H=-1,K=f.length,G=B(K+x),j=this&&this!==ft&&this instanceof w?g:r;++H<K;)G[H]=f[H];for(;x--;)G[H++]=arguments[++v];return Ut(j,d?o:this,G)}return w}function Nd(r){return function(i,o,f){return f&&typeof f!="number"&&vt(i,o,f)&&(o=f=n),i=zr(i),o===n?(o=i,i=0):o=zr(o),f=f===n?i<o?1:-1:zr(f),pv(i,o,f,r)}}function Ra(r){return function(i,o){return typeof i=="string"&&typeof o=="string"||(i=nr(i),o=nr(o)),r(i,o)}}function Ud(r,i,o,f,d,g,w,v,x,H){var K=i&Ae,G=K?w:n,j=K?n:w,re=K?g:n,ae=K?n:g;i|=K?_e:Fe,i&=~(K?Fe:_e),i&Y||(i&=-4);var ge=[r,i,d,re,G,ae,j,v,x,H],oe=o.apply(n,ge);return gc(r)&&zd(oe,ge),oe.placeholder=f,jd(oe,r,i)}function cc(r){var i=nt[r];return function(o,f){if(o=nr(o),f=f==null?0:mt(me(f),292),f&&jh(o)){var d=(De(o)+"e").split("e"),g=i(d[0]+"e"+(+d[1]+f));return d=(De(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-f))}return i(o)}}var Pv=ni&&1/aa(new ni([,-0]))[1]==L?function(r){return new ni(r)}:Rc;function Bd(r){return function(i){var o=gt(i);return o==Be?Fu(i):o==lr?Vb(i):Fb(i,r(i))}}function qr(r,i,o,f,d,g,w,v){var x=i&ne;if(!x&&typeof r!="function")throw new Zt(u);var H=f?f.length:0;if(H||(i&=-97,f=d=n),w=w===n?w:it(me(w),0),v=v===n?v:me(v),H-=d?d.length:0,i&Fe){var K=f,G=d;f=d=n}var j=x?n:hc(r),re=[r,i,o,f,d,K,G,g,w,v];if(j&&$v(re,j),r=re[0],i=re[1],o=re[2],f=re[3],d=re[4],v=re[9]=re[9]===n?x?0:r.length:it(re[9]-H,0),!v&&i&(Ae|ve)&&(i&=-25),!i||i==F)var ae=kv(r,i,o);else i==Ae||i==ve?ae=Cv(r,i,v):(i==_e||i==(F|_e))&&!d.length?ae=xv(r,i,o,f):ae=Ca.apply(n,re);var ge=j?yd:zd;return jd(ge(ae,re),r,i)}function Id(r,i,o,f){return r===n||dr(r,ri[o])&&!Me.call(f,o)?i:r}function Fd(r,i,o,f,d,g){return je(r)&&je(i)&&(g.set(i,r),Ea(r,i,n,Fd,g),g.delete(i)),r}function Rv(r){return ns(r)?n:r}function Wd(r,i,o,f,d,g){var w=o&O,v=r.length,x=i.length;if(v!=x&&!(w&&x>v))return!1;var H=g.get(r),K=g.get(i);if(H&&K)return H==i&&K==r;var G=-1,j=!0,re=o&I?new Cn:n;for(g.set(r,i),g.set(i,r);++G<v;){var ae=r[G],ge=i[G];if(f)var oe=w?f(ge,ae,G,i,r,g):f(ae,ge,G,r,i,g);if(oe!==n){if(oe)continue;j=!1;break}if(re){if(!Mu(i,function(we,Te){if(!Ki(re,Te)&&(ae===we||d(ae,we,o,f,g)))return re.push(Te)})){j=!1;break}}else if(!(ae===ge||d(ae,ge,o,f,g))){j=!1;break}}return g.delete(r),g.delete(i),j}function Dv(r,i,o,f,d,g,w){switch(o){case Jn:if(r.byteLength!=i.byteLength||r.byteOffset!=i.byteOffset)return!1;r=r.buffer,i=i.buffer;case Yi:return!(r.byteLength!=i.byteLength||!g(new ha(r),new ha(i)));case Tr:case Fr:case Ue:return dr(+r,+i);case wt:return r.name==i.name&&r.message==i.message;case Fi:case Wi:return r==i+"";case Be:var v=Fu;case lr:var x=f&O;if(v||(v=aa),r.size!=i.size&&!x)return!1;var H=w.get(r);if(H)return H==i;f|=I,w.set(r,i);var K=Wd(v(r),v(i),f,d,g,w);return w.delete(r),K;case ea:if(zi)return zi.call(r)==zi.call(i)}return!1}function Mv(r,i,o,f,d,g){var w=o&O,v=lc(r),x=v.length,H=lc(i),K=H.length;if(x!=K&&!w)return!1;for(var G=x;G--;){var j=v[G];if(!(w?j in i:Me.call(i,j)))return!1}var re=g.get(r),ae=g.get(i);if(re&&ae)return re==i&&ae==r;var ge=!0;g.set(r,i),g.set(i,r);for(var oe=w;++G<x;){j=v[G];var we=r[j],Te=i[j];if(f)var Wt=w?f(Te,we,j,i,r,g):f(we,Te,j,r,i,g);if(!(Wt===n?we===Te||d(we,Te,o,f,g):Wt)){ge=!1;break}oe||(oe=j=="constructor")}if(ge&&!oe){var Tt=r.constructor,Ht=i.constructor;Tt!=Ht&&"constructor"in r&&"constructor"in i&&!(typeof Tt=="function"&&Tt instanceof Tt&&typeof Ht=="function"&&Ht instanceof Ht)&&(ge=!1)}return g.delete(r),g.delete(i),ge}function $r(r){return _c(Gd(r,n,tp),r+"")}function lc(r){return ad(r,ot,pc)}function fc(r){return ad(r,Dt,Hd)}var hc=_a?function(r){return _a.get(r)}:Rc;function Da(r){for(var i=r.name+"",o=ii[i],f=Me.call(ii,i)?o.length:0;f--;){var d=o[f],g=d.func;if(g==null||g==r)return d.name}return i}function ui(r){var i=Me.call(p,"placeholder")?p:r;return i.placeholder}function se(){var r=p.iteratee||xc;return r=r===xc?cd:r,arguments.length?r(arguments[0],arguments[1]):r}function Ma(r,i){var o=r.__data__;return Hv(i)?o[typeof i=="string"?"string":"hash"]:o.map}function dc(r){for(var i=ot(r),o=i.length;o--;){var f=i[o],d=r[f];i[o]=[f,d,qd(d)]}return i}function Rn(r,i){var o=qb(r,i);return ud(o)?o:n}function Lv(r){var i=Me.call(r,On),o=r[On];try{r[On]=n;var f=!0}catch{}var d=la.call(r);return f&&(i?r[On]=o:delete r[On]),d}var pc=Hu?function(r){return r==null?[]:(r=Ie(r),nn(Hu(r),function(i){return Vh.call(r,i)}))}:Dc,Hd=Hu?function(r){for(var i=[];r;)sn(i,pc(r)),r=da(r);return i}:Dc,gt=St;(Yu&&gt(new Yu(new ArrayBuffer(1)))!=Jn||$i&&gt(new $i)!=Be||Ku&&gt(Ku.resolve())!=nh||ni&&gt(new ni)!=lr||Gi&&gt(new Gi)!=Hi)&&(gt=function(r){var i=St(r),o=i==Wr?r.constructor:n,f=o?Dn(o):"";if(f)switch(f){case gS:return Jn;case yS:return Be;case _S:return nh;case wS:return lr;case bS:return Hi}return i});function Nv(r,i,o){for(var f=-1,d=o.length;++f<d;){var g=o[f],w=g.size;switch(g.type){case"drop":r+=w;break;case"dropRight":i-=w;break;case"take":i=mt(i,r+w);break;case"takeRight":r=it(r,i-w);break}}return{start:r,end:i}}function Uv(r){var i=r.match(Y1);return i?i[1].split(K1):[]}function Yd(r,i,o){i=ln(i,r);for(var f=-1,d=i.length,g=!1;++f<d;){var w=kr(i[f]);if(!(g=r!=null&&o(r,w)))break;r=r[w]}return g||++f!=d?g:(d=r==null?0:r.length,!!d&&Wa(d)&&Gr(w,d)&&(fe(r)||Mn(r)))}function Bv(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&Me.call(r,"index")&&(o.index=r.index,o.input=r.input),o}function Kd(r){return typeof r.constructor=="function"&&!ts(r)?si(da(r)):{}}function Iv(r,i,o){var f=r.constructor;switch(i){case Yi:return oc(r);case Tr:case Fr:return new f(+r);case Jn:return Sv(r,o);case du:case pu:case mu:case gu:case yu:case _u:case wu:case bu:case Su:return Ad(r,o);case Be:return new f;case Ue:case Wi:return new f(r);case Fi:return vv(r);case lr:return new f;case ea:return Tv(r)}}function Fv(r,i){var o=i.length;if(!o)return r;var f=o-1;return i[f]=(o>1?"& ":"")+i[f],i=i.join(o>2?", ":" "),r.replace(H1,`{
14
+ */var lg=wi.exports,vl;function fg(){return vl||(vl=1,(function(t,e){(function(){var n,s="4.17.21",a=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",m=500,b="__lodash_placeholder__",T=1,P=2,$=4,O=1,I=2,F=1,ne=2,Y=4,Ae=8,ve=16,_e=32,Fe=64,Pe=128,y=256,_=512,S=30,M="...",k=800,R=16,N=1,E=2,C=3,L=1/0,D=9007199254740991,q=17976931348623157e292,te=NaN,J=4294967295,pe=J-1,Ne=J>>>1,We=[["ary",Pe],["bind",F],["bindKey",ne],["curry",Ae],["curryRight",ve],["flip",_],["partial",_e],["partialRight",Fe],["rearg",y]],le="[object Arguments]",Oe="[object Array]",at="[object AsyncFunction]",Tr="[object Boolean]",Fr="[object Date]",Fi="[object DOMException]",wt="[object Error]",Er="[object Function]",bt="[object GeneratorFunction]",Be="[object Map]",Ue="[object Number]",A1="[object Null]",Wr="[object Object]",nh="[object Promise]",O1="[object Proxy]",Wi="[object RegExp]",lr="[object Set]",Hi="[object String]",ea="[object Symbol]",k1="[object Undefined]",Yi="[object WeakMap]",C1="[object WeakSet]",Ki="[object ArrayBuffer]",Jn="[object DataView]",pu="[object Float32Array]",mu="[object Float64Array]",gu="[object Int8Array]",yu="[object Int16Array]",_u="[object Int32Array]",wu="[object Uint8Array]",bu="[object Uint8ClampedArray]",Su="[object Uint16Array]",vu="[object Uint32Array]",x1=/\b__p \+= '';/g,P1=/\b(__p \+=) '' \+/g,R1=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ih=/&(?:amp|lt|gt|quot|#39);/g,sh=/[&<>"']/g,D1=RegExp(ih.source),M1=RegExp(sh.source),L1=/<%-([\s\S]+?)%>/g,N1=/<%([\s\S]+?)%>/g,ah=/<%=([\s\S]+?)%>/g,U1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B1=/^\w*$/,I1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tu=/[\\^$.*+?()[\]{}|]/g,F1=RegExp(Tu.source),Eu=/^\s+/,W1=/\s/,H1=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y1=/\{\n\/\* \[wrapped with (.+)\] \*/,K1=/,? & /,q1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$1=/[()=,{}\[\]\/\s]/,G1=/\\(\\)?/g,V1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oh=/\w*$/,z1=/^[-+]0x[0-9a-f]+$/i,j1=/^0b[01]+$/i,J1=/^\[object .+?Constructor\]$/,Q1=/^0o[0-7]+$/i,Z1=/^(?:0|[1-9]\d*)$/,X1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ta=/($^)/,eb=/['\n\r\u2028\u2029\\]/g,ra="\\ud800-\\udfff",tb="\\u0300-\\u036f",rb="\\ufe20-\\ufe2f",nb="\\u20d0-\\u20ff",uh=tb+rb+nb,ch="\\u2700-\\u27bf",lh="a-z\\xdf-\\xf6\\xf8-\\xff",ib="\\xac\\xb1\\xd7\\xf7",sb="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ab="\\u2000-\\u206f",ob=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fh="A-Z\\xc0-\\xd6\\xd8-\\xde",hh="\\ufe0e\\ufe0f",dh=ib+sb+ab+ob,Au="['’]",ub="["+ra+"]",ph="["+dh+"]",na="["+uh+"]",mh="\\d+",cb="["+ch+"]",gh="["+lh+"]",yh="[^"+ra+dh+mh+ch+lh+fh+"]",Ou="\\ud83c[\\udffb-\\udfff]",lb="(?:"+na+"|"+Ou+")",_h="[^"+ra+"]",ku="(?:\\ud83c[\\udde6-\\uddff]){2}",Cu="[\\ud800-\\udbff][\\udc00-\\udfff]",Qn="["+fh+"]",wh="\\u200d",bh="(?:"+gh+"|"+yh+")",fb="(?:"+Qn+"|"+yh+")",Sh="(?:"+Au+"(?:d|ll|m|re|s|t|ve))?",vh="(?:"+Au+"(?:D|LL|M|RE|S|T|VE))?",Th=lb+"?",Eh="["+hh+"]?",hb="(?:"+wh+"(?:"+[_h,ku,Cu].join("|")+")"+Eh+Th+")*",db="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ah=Eh+Th+hb,mb="(?:"+[cb,ku,Cu].join("|")+")"+Ah,gb="(?:"+[_h+na+"?",na,ku,Cu,ub].join("|")+")",yb=RegExp(Au,"g"),_b=RegExp(na,"g"),xu=RegExp(Ou+"(?="+Ou+")|"+gb+Ah,"g"),wb=RegExp([Qn+"?"+gh+"+"+Sh+"(?="+[ph,Qn,"$"].join("|")+")",fb+"+"+vh+"(?="+[ph,Qn+bh,"$"].join("|")+")",Qn+"?"+bh+"+"+Sh,Qn+"+"+vh,pb,db,mh,mb].join("|"),"g"),bb=RegExp("["+wh+ra+uh+hh+"]"),Sb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tb=-1,qe={};qe[pu]=qe[mu]=qe[gu]=qe[yu]=qe[_u]=qe[wu]=qe[bu]=qe[Su]=qe[vu]=!0,qe[le]=qe[Oe]=qe[Ki]=qe[Tr]=qe[Jn]=qe[Fr]=qe[wt]=qe[Er]=qe[Be]=qe[Ue]=qe[Wr]=qe[Wi]=qe[lr]=qe[Hi]=qe[Yi]=!1;var He={};He[le]=He[Oe]=He[Ki]=He[Jn]=He[Tr]=He[Fr]=He[pu]=He[mu]=He[gu]=He[yu]=He[_u]=He[Be]=He[Ue]=He[Wr]=He[Wi]=He[lr]=He[Hi]=He[ea]=He[wu]=He[bu]=He[Su]=He[vu]=!0,He[wt]=He[Er]=He[Yi]=!1;var Eb={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ab={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ob={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},kb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cb=parseFloat,xb=parseInt,Oh=typeof _s=="object"&&_s&&_s.Object===Object&&_s,Pb=typeof self=="object"&&self&&self.Object===Object&&self,ft=Oh||Pb||Function("return this")(),Pu=e&&!e.nodeType&&e,An=Pu&&!0&&t&&!t.nodeType&&t,kh=An&&An.exports===Pu,Ru=kh&&Oh.process,Jt=(function(){try{var A=An&&An.require&&An.require("util").types;return A||Ru&&Ru.binding&&Ru.binding("util")}catch{}})(),Ch=Jt&&Jt.isArrayBuffer,xh=Jt&&Jt.isDate,Ph=Jt&&Jt.isMap,Rh=Jt&&Jt.isRegExp,Dh=Jt&&Jt.isSet,Mh=Jt&&Jt.isTypedArray;function Ut(A,W,B){switch(B.length){case 0:return A.call(W);case 1:return A.call(W,B[0]);case 2:return A.call(W,B[0],B[1]);case 3:return A.call(W,B[0],B[1],B[2])}return A.apply(W,B)}function Rb(A,W,B,Z){for(var ue=-1,Re=A==null?0:A.length;++ue<Re;){var nt=A[ue];W(Z,nt,B(nt),A)}return Z}function Qt(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z&&W(A[B],B,A)!==!1;);return A}function Db(A,W){for(var B=A==null?0:A.length;B--&&W(A[B],B,A)!==!1;);return A}function Lh(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z;)if(!W(A[B],B,A))return!1;return!0}function nn(A,W){for(var B=-1,Z=A==null?0:A.length,ue=0,Re=[];++B<Z;){var nt=A[B];W(nt,B,A)&&(Re[ue++]=nt)}return Re}function ia(A,W){var B=A==null?0:A.length;return!!B&&Zn(A,W,0)>-1}function Du(A,W,B){for(var Z=-1,ue=A==null?0:A.length;++Z<ue;)if(B(W,A[Z]))return!0;return!1}function Ve(A,W){for(var B=-1,Z=A==null?0:A.length,ue=Array(Z);++B<Z;)ue[B]=W(A[B],B,A);return ue}function sn(A,W){for(var B=-1,Z=W.length,ue=A.length;++B<Z;)A[ue+B]=W[B];return A}function Mu(A,W,B,Z){var ue=-1,Re=A==null?0:A.length;for(Z&&Re&&(B=A[++ue]);++ue<Re;)B=W(B,A[ue],ue,A);return B}function Mb(A,W,B,Z){var ue=A==null?0:A.length;for(Z&&ue&&(B=A[--ue]);ue--;)B=W(B,A[ue],ue,A);return B}function Lu(A,W){for(var B=-1,Z=A==null?0:A.length;++B<Z;)if(W(A[B],B,A))return!0;return!1}var Lb=Nu("length");function Nb(A){return A.split("")}function Ub(A){return A.match(q1)||[]}function Nh(A,W,B){var Z;return B(A,function(ue,Re,nt){if(W(ue,Re,nt))return Z=Re,!1}),Z}function sa(A,W,B,Z){for(var ue=A.length,Re=B+(Z?1:-1);Z?Re--:++Re<ue;)if(W(A[Re],Re,A))return Re;return-1}function Zn(A,W,B){return W===W?zb(A,W,B):sa(A,Uh,B)}function Bb(A,W,B,Z){for(var ue=B-1,Re=A.length;++ue<Re;)if(Z(A[ue],W))return ue;return-1}function Uh(A){return A!==A}function Bh(A,W){var B=A==null?0:A.length;return B?Bu(A,W)/B:te}function Nu(A){return function(W){return W==null?n:W[A]}}function Uu(A){return function(W){return A==null?n:A[W]}}function Ih(A,W,B,Z,ue){return ue(A,function(Re,nt,Ie){B=Z?(Z=!1,Re):W(B,Re,nt,Ie)}),B}function Ib(A,W){var B=A.length;for(A.sort(W);B--;)A[B]=A[B].value;return A}function Bu(A,W){for(var B,Z=-1,ue=A.length;++Z<ue;){var Re=W(A[Z]);Re!==n&&(B=B===n?Re:B+Re)}return B}function Iu(A,W){for(var B=-1,Z=Array(A);++B<A;)Z[B]=W(B);return Z}function Fb(A,W){return Ve(W,function(B){return[B,A[B]]})}function Fh(A){return A&&A.slice(0,Kh(A)+1).replace(Eu,"")}function Bt(A){return function(W){return A(W)}}function Fu(A,W){return Ve(W,function(B){return A[B]})}function qi(A,W){return A.has(W)}function Wh(A,W){for(var B=-1,Z=A.length;++B<Z&&Zn(W,A[B],0)>-1;);return B}function Hh(A,W){for(var B=A.length;B--&&Zn(W,A[B],0)>-1;);return B}function Wb(A,W){for(var B=A.length,Z=0;B--;)A[B]===W&&++Z;return Z}var Hb=Uu(Eb),Yb=Uu(Ab);function Kb(A){return"\\"+kb[A]}function qb(A,W){return A==null?n:A[W]}function Xn(A){return bb.test(A)}function $b(A){return Sb.test(A)}function Gb(A){for(var W,B=[];!(W=A.next()).done;)B.push(W.value);return B}function Wu(A){var W=-1,B=Array(A.size);return A.forEach(function(Z,ue){B[++W]=[ue,Z]}),B}function Yh(A,W){return function(B){return A(W(B))}}function an(A,W){for(var B=-1,Z=A.length,ue=0,Re=[];++B<Z;){var nt=A[B];(nt===W||nt===b)&&(A[B]=b,Re[ue++]=B)}return Re}function aa(A){var W=-1,B=Array(A.size);return A.forEach(function(Z){B[++W]=Z}),B}function Vb(A){var W=-1,B=Array(A.size);return A.forEach(function(Z){B[++W]=[Z,Z]}),B}function zb(A,W,B){for(var Z=B-1,ue=A.length;++Z<ue;)if(A[Z]===W)return Z;return-1}function jb(A,W,B){for(var Z=B+1;Z--;)if(A[Z]===W)return Z;return Z}function ei(A){return Xn(A)?Qb(A):Lb(A)}function fr(A){return Xn(A)?Zb(A):Nb(A)}function Kh(A){for(var W=A.length;W--&&W1.test(A.charAt(W)););return W}var Jb=Uu(Ob);function Qb(A){for(var W=xu.lastIndex=0;xu.test(A);)++W;return W}function Zb(A){return A.match(xu)||[]}function Xb(A){return A.match(wb)||[]}var eS=(function A(W){W=W==null?ft:ti.defaults(ft.Object(),W,ti.pick(ft,vb));var B=W.Array,Z=W.Date,ue=W.Error,Re=W.Function,nt=W.Math,Ie=W.Object,Hu=W.RegExp,tS=W.String,Zt=W.TypeError,oa=B.prototype,rS=Re.prototype,ri=Ie.prototype,ua=W["__core-js_shared__"],ca=rS.toString,Me=ri.hasOwnProperty,nS=0,qh=(function(){var r=/[^.]+$/.exec(ua&&ua.keys&&ua.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),la=ri.toString,iS=ca.call(Ie),sS=ft._,aS=Hu("^"+ca.call(Me).replace(Tu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fa=kh?W.Buffer:n,on=W.Symbol,ha=W.Uint8Array,$h=fa?fa.allocUnsafe:n,da=Yh(Ie.getPrototypeOf,Ie),Gh=Ie.create,Vh=ri.propertyIsEnumerable,pa=oa.splice,zh=on?on.isConcatSpreadable:n,$i=on?on.iterator:n,On=on?on.toStringTag:n,ma=(function(){try{var r=Rn(Ie,"defineProperty");return r({},"",{}),r}catch{}})(),oS=W.clearTimeout!==ft.clearTimeout&&W.clearTimeout,uS=Z&&Z.now!==ft.Date.now&&Z.now,cS=W.setTimeout!==ft.setTimeout&&W.setTimeout,ga=nt.ceil,ya=nt.floor,Yu=Ie.getOwnPropertySymbols,lS=fa?fa.isBuffer:n,jh=W.isFinite,fS=oa.join,hS=Yh(Ie.keys,Ie),it=nt.max,mt=nt.min,dS=Z.now,pS=W.parseInt,Jh=nt.random,mS=oa.reverse,Ku=Rn(W,"DataView"),Gi=Rn(W,"Map"),qu=Rn(W,"Promise"),ni=Rn(W,"Set"),Vi=Rn(W,"WeakMap"),zi=Rn(Ie,"create"),_a=Vi&&new Vi,ii={},gS=Dn(Ku),yS=Dn(Gi),_S=Dn(qu),wS=Dn(ni),bS=Dn(Vi),wa=on?on.prototype:n,ji=wa?wa.valueOf:n,Qh=wa?wa.toString:n;function p(r){if(Je(r)&&!fe(r)&&!(r instanceof Se)){if(r instanceof Xt)return r;if(Me.call(r,"__wrapped__"))return Zd(r)}return new Xt(r)}var si=(function(){function r(){}return function(i){if(!je(i))return{};if(Gh)return Gh(i);r.prototype=i;var o=new r;return r.prototype=n,o}})();function ba(){}function Xt(r,i){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}p.templateSettings={escape:L1,evaluate:N1,interpolate:ah,variable:"",imports:{_:p}},p.prototype=ba.prototype,p.prototype.constructor=p,Xt.prototype=si(ba.prototype),Xt.prototype.constructor=Xt;function Se(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=J,this.__views__=[]}function SS(){var r=new Se(this.__wrapped__);return r.__actions__=Pt(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=Pt(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=Pt(this.__views__),r}function vS(){if(this.__filtered__){var r=new Se(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function TS(){var r=this.__wrapped__.value(),i=this.__dir__,o=fe(r),f=i<0,d=o?r.length:0,g=Nv(0,d,this.__views__),w=g.start,v=g.end,x=v-w,H=f?v:w-1,K=this.__iteratees__,G=K.length,j=0,re=mt(x,this.__takeCount__);if(!o||!f&&d==x&&re==x)return Sd(r,this.__actions__);var ae=[];e:for(;x--&&j<re;){H+=i;for(var ge=-1,oe=r[H];++ge<G;){var we=K[ge],Te=we.iteratee,Wt=we.type,Tt=Te(oe);if(Wt==E)oe=Tt;else if(!Tt){if(Wt==N)continue e;break e}}ae[j++]=oe}return ae}Se.prototype=si(ba.prototype),Se.prototype.constructor=Se;function kn(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function ES(){this.__data__=zi?zi(null):{},this.size=0}function AS(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function OS(r){var i=this.__data__;if(zi){var o=i[r];return o===h?n:o}return Me.call(i,r)?i[r]:n}function kS(r){var i=this.__data__;return zi?i[r]!==n:Me.call(i,r)}function CS(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=zi&&i===n?h:i,this}kn.prototype.clear=ES,kn.prototype.delete=AS,kn.prototype.get=OS,kn.prototype.has=kS,kn.prototype.set=CS;function Hr(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function xS(){this.__data__=[],this.size=0}function PS(r){var i=this.__data__,o=Sa(i,r);if(o<0)return!1;var f=i.length-1;return o==f?i.pop():pa.call(i,o,1),--this.size,!0}function RS(r){var i=this.__data__,o=Sa(i,r);return o<0?n:i[o][1]}function DS(r){return Sa(this.__data__,r)>-1}function MS(r,i){var o=this.__data__,f=Sa(o,r);return f<0?(++this.size,o.push([r,i])):o[f][1]=i,this}Hr.prototype.clear=xS,Hr.prototype.delete=PS,Hr.prototype.get=RS,Hr.prototype.has=DS,Hr.prototype.set=MS;function Yr(r){var i=-1,o=r==null?0:r.length;for(this.clear();++i<o;){var f=r[i];this.set(f[0],f[1])}}function LS(){this.size=0,this.__data__={hash:new kn,map:new(Gi||Hr),string:new kn}}function NS(r){var i=Ma(this,r).delete(r);return this.size-=i?1:0,i}function US(r){return Ma(this,r).get(r)}function BS(r){return Ma(this,r).has(r)}function IS(r,i){var o=Ma(this,r),f=o.size;return o.set(r,i),this.size+=o.size==f?0:1,this}Yr.prototype.clear=LS,Yr.prototype.delete=NS,Yr.prototype.get=US,Yr.prototype.has=BS,Yr.prototype.set=IS;function Cn(r){var i=-1,o=r==null?0:r.length;for(this.__data__=new Yr;++i<o;)this.add(r[i])}function FS(r){return this.__data__.set(r,h),this}function WS(r){return this.__data__.has(r)}Cn.prototype.add=Cn.prototype.push=FS,Cn.prototype.has=WS;function hr(r){var i=this.__data__=new Hr(r);this.size=i.size}function HS(){this.__data__=new Hr,this.size=0}function YS(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}function KS(r){return this.__data__.get(r)}function qS(r){return this.__data__.has(r)}function $S(r,i){var o=this.__data__;if(o instanceof Hr){var f=o.__data__;if(!Gi||f.length<a-1)return f.push([r,i]),this.size=++o.size,this;o=this.__data__=new Yr(f)}return o.set(r,i),this.size=o.size,this}hr.prototype.clear=HS,hr.prototype.delete=YS,hr.prototype.get=KS,hr.prototype.has=qS,hr.prototype.set=$S;function Zh(r,i){var o=fe(r),f=!o&&Mn(r),d=!o&&!f&&hn(r),g=!o&&!f&&!d&&ci(r),w=o||f||d||g,v=w?Iu(r.length,tS):[],x=v.length;for(var H in r)(i||Me.call(r,H))&&!(w&&(H=="length"||d&&(H=="offset"||H=="parent")||g&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Gr(H,x)))&&v.push(H);return v}function Xh(r){var i=r.length;return i?r[tc(0,i-1)]:n}function GS(r,i){return La(Pt(r),xn(i,0,r.length))}function VS(r){return La(Pt(r))}function $u(r,i,o){(o!==n&&!dr(r[i],o)||o===n&&!(i in r))&&Kr(r,i,o)}function Ji(r,i,o){var f=r[i];(!(Me.call(r,i)&&dr(f,o))||o===n&&!(i in r))&&Kr(r,i,o)}function Sa(r,i){for(var o=r.length;o--;)if(dr(r[o][0],i))return o;return-1}function zS(r,i,o,f){return un(r,function(d,g,w){i(f,d,o(d),w)}),f}function ed(r,i){return r&&Or(i,ot(i),r)}function jS(r,i){return r&&Or(i,Dt(i),r)}function Kr(r,i,o){i=="__proto__"&&ma?ma(r,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[i]=o}function Gu(r,i){for(var o=-1,f=i.length,d=B(f),g=r==null;++o<f;)d[o]=g?n:Oc(r,i[o]);return d}function xn(r,i,o){return r===r&&(o!==n&&(r=r<=o?r:o),i!==n&&(r=r>=i?r:i)),r}function er(r,i,o,f,d,g){var w,v=i&T,x=i&P,H=i&$;if(o&&(w=d?o(r,f,d,g):o(r)),w!==n)return w;if(!je(r))return r;var K=fe(r);if(K){if(w=Bv(r),!v)return Pt(r,w)}else{var G=gt(r),j=G==Er||G==bt;if(hn(r))return Ed(r,v);if(G==Wr||G==le||j&&!d){if(w=x||j?{}:Kd(r),!v)return x?Ov(r,jS(w,r)):Av(r,ed(w,r))}else{if(!He[G])return d?r:{};w=Iv(r,G,v)}}g||(g=new hr);var re=g.get(r);if(re)return re;g.set(r,w),_p(r)?r.forEach(function(oe){w.add(er(oe,i,o,oe,r,g))}):gp(r)&&r.forEach(function(oe,we){w.set(we,er(oe,i,o,we,r,g))});var ae=H?x?hc:fc:x?Dt:ot,ge=K?n:ae(r);return Qt(ge||r,function(oe,we){ge&&(we=oe,oe=r[we]),Ji(w,we,er(oe,i,o,we,r,g))}),w}function JS(r){var i=ot(r);return function(o){return td(o,r,i)}}function td(r,i,o){var f=o.length;if(r==null)return!f;for(r=Ie(r);f--;){var d=o[f],g=i[d],w=r[d];if(w===n&&!(d in r)||!g(w))return!1}return!0}function rd(r,i,o){if(typeof r!="function")throw new Zt(u);return ns(function(){r.apply(n,o)},i)}function Qi(r,i,o,f){var d=-1,g=ia,w=!0,v=r.length,x=[],H=i.length;if(!v)return x;o&&(i=Ve(i,Bt(o))),f?(g=Du,w=!1):i.length>=a&&(g=qi,w=!1,i=new Cn(i));e:for(;++d<v;){var K=r[d],G=o==null?K:o(K);if(K=f||K!==0?K:0,w&&G===G){for(var j=H;j--;)if(i[j]===G)continue e;x.push(K)}else g(i,G,f)||x.push(K)}return x}var un=xd(Ar),nd=xd(zu,!0);function QS(r,i){var o=!0;return un(r,function(f,d,g){return o=!!i(f,d,g),o}),o}function va(r,i,o){for(var f=-1,d=r.length;++f<d;){var g=r[f],w=i(g);if(w!=null&&(v===n?w===w&&!Ft(w):o(w,v)))var v=w,x=g}return x}function ZS(r,i,o,f){var d=r.length;for(o=me(o),o<0&&(o=-o>d?0:d+o),f=f===n||f>d?d:me(f),f<0&&(f+=d),f=o>f?0:bp(f);o<f;)r[o++]=i;return r}function id(r,i){var o=[];return un(r,function(f,d,g){i(f,d,g)&&o.push(f)}),o}function ht(r,i,o,f,d){var g=-1,w=r.length;for(o||(o=Wv),d||(d=[]);++g<w;){var v=r[g];i>0&&o(v)?i>1?ht(v,i-1,o,f,d):sn(d,v):f||(d[d.length]=v)}return d}var Vu=Pd(),sd=Pd(!0);function Ar(r,i){return r&&Vu(r,i,ot)}function zu(r,i){return r&&sd(r,i,ot)}function Ta(r,i){return nn(i,function(o){return Vr(r[o])})}function Pn(r,i){i=ln(i,r);for(var o=0,f=i.length;r!=null&&o<f;)r=r[kr(i[o++])];return o&&o==f?r:n}function ad(r,i,o){var f=i(r);return fe(r)?f:sn(f,o(r))}function St(r){return r==null?r===n?k1:A1:On&&On in Ie(r)?Lv(r):Vv(r)}function ju(r,i){return r>i}function XS(r,i){return r!=null&&Me.call(r,i)}function ev(r,i){return r!=null&&i in Ie(r)}function tv(r,i,o){return r>=mt(i,o)&&r<it(i,o)}function Ju(r,i,o){for(var f=o?Du:ia,d=r[0].length,g=r.length,w=g,v=B(g),x=1/0,H=[];w--;){var K=r[w];w&&i&&(K=Ve(K,Bt(i))),x=mt(K.length,x),v[w]=!o&&(i||d>=120&&K.length>=120)?new Cn(w&&K):n}K=r[0];var G=-1,j=v[0];e:for(;++G<d&&H.length<x;){var re=K[G],ae=i?i(re):re;if(re=o||re!==0?re:0,!(j?qi(j,ae):f(H,ae,o))){for(w=g;--w;){var ge=v[w];if(!(ge?qi(ge,ae):f(r[w],ae,o)))continue e}j&&j.push(ae),H.push(re)}}return H}function rv(r,i,o,f){return Ar(r,function(d,g,w){i(f,o(d),g,w)}),f}function Zi(r,i,o){i=ln(i,r),r=Vd(r,i);var f=r==null?r:r[kr(rr(i))];return f==null?n:Ut(f,r,o)}function od(r){return Je(r)&&St(r)==le}function nv(r){return Je(r)&&St(r)==Ki}function iv(r){return Je(r)&&St(r)==Fr}function Xi(r,i,o,f,d){return r===i?!0:r==null||i==null||!Je(r)&&!Je(i)?r!==r&&i!==i:sv(r,i,o,f,Xi,d)}function sv(r,i,o,f,d,g){var w=fe(r),v=fe(i),x=w?Oe:gt(r),H=v?Oe:gt(i);x=x==le?Wr:x,H=H==le?Wr:H;var K=x==Wr,G=H==Wr,j=x==H;if(j&&hn(r)){if(!hn(i))return!1;w=!0,K=!1}if(j&&!K)return g||(g=new hr),w||ci(r)?Wd(r,i,o,f,d,g):Dv(r,i,x,o,f,d,g);if(!(o&O)){var re=K&&Me.call(r,"__wrapped__"),ae=G&&Me.call(i,"__wrapped__");if(re||ae){var ge=re?r.value():r,oe=ae?i.value():i;return g||(g=new hr),d(ge,oe,o,f,g)}}return j?(g||(g=new hr),Mv(r,i,o,f,d,g)):!1}function av(r){return Je(r)&&gt(r)==Be}function Qu(r,i,o,f){var d=o.length,g=d,w=!f;if(r==null)return!g;for(r=Ie(r);d--;){var v=o[d];if(w&&v[2]?v[1]!==r[v[0]]:!(v[0]in r))return!1}for(;++d<g;){v=o[d];var x=v[0],H=r[x],K=v[1];if(w&&v[2]){if(H===n&&!(x in r))return!1}else{var G=new hr;if(f)var j=f(H,K,x,r,i,G);if(!(j===n?Xi(K,H,O|I,f,G):j))return!1}}return!0}function ud(r){if(!je(r)||Yv(r))return!1;var i=Vr(r)?aS:J1;return i.test(Dn(r))}function ov(r){return Je(r)&&St(r)==Wi}function uv(r){return Je(r)&&gt(r)==lr}function cv(r){return Je(r)&&Wa(r.length)&&!!qe[St(r)]}function cd(r){return typeof r=="function"?r:r==null?Mt:typeof r=="object"?fe(r)?hd(r[0],r[1]):fd(r):Rp(r)}function Zu(r){if(!rs(r))return hS(r);var i=[];for(var o in Ie(r))Me.call(r,o)&&o!="constructor"&&i.push(o);return i}function lv(r){if(!je(r))return Gv(r);var i=rs(r),o=[];for(var f in r)f=="constructor"&&(i||!Me.call(r,f))||o.push(f);return o}function Xu(r,i){return r<i}function ld(r,i){var o=-1,f=Rt(r)?B(r.length):[];return un(r,function(d,g,w){f[++o]=i(d,g,w)}),f}function fd(r){var i=pc(r);return i.length==1&&i[0][2]?$d(i[0][0],i[0][1]):function(o){return o===r||Qu(o,r,i)}}function hd(r,i){return gc(r)&&qd(i)?$d(kr(r),i):function(o){var f=Oc(o,r);return f===n&&f===i?kc(o,r):Xi(i,f,O|I)}}function Ea(r,i,o,f,d){r!==i&&Vu(i,function(g,w){if(d||(d=new hr),je(g))fv(r,i,w,o,Ea,f,d);else{var v=f?f(_c(r,w),g,w+"",r,i,d):n;v===n&&(v=g),$u(r,w,v)}},Dt)}function fv(r,i,o,f,d,g,w){var v=_c(r,o),x=_c(i,o),H=w.get(x);if(H){$u(r,o,H);return}var K=g?g(v,x,o+"",r,i,w):n,G=K===n;if(G){var j=fe(x),re=!j&&hn(x),ae=!j&&!re&&ci(x);K=x,j||re||ae?fe(v)?K=v:et(v)?K=Pt(v):re?(G=!1,K=Ed(x,!0)):ae?(G=!1,K=Ad(x,!0)):K=[]:is(x)||Mn(x)?(K=v,Mn(v)?K=Sp(v):(!je(v)||Vr(v))&&(K=Kd(x))):G=!1}G&&(w.set(x,K),d(K,x,f,g,w),w.delete(x)),$u(r,o,K)}function dd(r,i){var o=r.length;if(o)return i+=i<0?o:0,Gr(i,o)?r[i]:n}function pd(r,i,o){i.length?i=Ve(i,function(g){return fe(g)?function(w){return Pn(w,g.length===1?g[0]:g)}:g}):i=[Mt];var f=-1;i=Ve(i,Bt(se()));var d=ld(r,function(g,w,v){var x=Ve(i,function(H){return H(g)});return{criteria:x,index:++f,value:g}});return Ib(d,function(g,w){return Ev(g,w,o)})}function hv(r,i){return md(r,i,function(o,f){return kc(r,f)})}function md(r,i,o){for(var f=-1,d=i.length,g={};++f<d;){var w=i[f],v=Pn(r,w);o(v,w)&&es(g,ln(w,r),v)}return g}function dv(r){return function(i){return Pn(i,r)}}function ec(r,i,o,f){var d=f?Bb:Zn,g=-1,w=i.length,v=r;for(r===i&&(i=Pt(i)),o&&(v=Ve(r,Bt(o)));++g<w;)for(var x=0,H=i[g],K=o?o(H):H;(x=d(v,K,x,f))>-1;)v!==r&&pa.call(v,x,1),pa.call(r,x,1);return r}function gd(r,i){for(var o=r?i.length:0,f=o-1;o--;){var d=i[o];if(o==f||d!==g){var g=d;Gr(d)?pa.call(r,d,1):ic(r,d)}}return r}function tc(r,i){return r+ya(Jh()*(i-r+1))}function pv(r,i,o,f){for(var d=-1,g=it(ga((i-r)/(o||1)),0),w=B(g);g--;)w[f?g:++d]=r,r+=o;return w}function rc(r,i){var o="";if(!r||i<1||i>D)return o;do i%2&&(o+=r),i=ya(i/2),i&&(r+=r);while(i);return o}function ye(r,i){return wc(Gd(r,i,Mt),r+"")}function mv(r){return Xh(li(r))}function gv(r,i){var o=li(r);return La(o,xn(i,0,o.length))}function es(r,i,o,f){if(!je(r))return r;i=ln(i,r);for(var d=-1,g=i.length,w=g-1,v=r;v!=null&&++d<g;){var x=kr(i[d]),H=o;if(x==="__proto__"||x==="constructor"||x==="prototype")return r;if(d!=w){var K=v[x];H=f?f(K,x,v):n,H===n&&(H=je(K)?K:Gr(i[d+1])?[]:{})}Ji(v,x,H),v=v[x]}return r}var yd=_a?function(r,i){return _a.set(r,i),r}:Mt,yv=ma?function(r,i){return ma(r,"toString",{configurable:!0,enumerable:!1,value:xc(i),writable:!0})}:Mt;function _v(r){return La(li(r))}function tr(r,i,o){var f=-1,d=r.length;i<0&&(i=-i>d?0:d+i),o=o>d?d:o,o<0&&(o+=d),d=i>o?0:o-i>>>0,i>>>=0;for(var g=B(d);++f<d;)g[f]=r[f+i];return g}function wv(r,i){var o;return un(r,function(f,d,g){return o=i(f,d,g),!o}),!!o}function Aa(r,i,o){var f=0,d=r==null?f:r.length;if(typeof i=="number"&&i===i&&d<=Ne){for(;f<d;){var g=f+d>>>1,w=r[g];w!==null&&!Ft(w)&&(o?w<=i:w<i)?f=g+1:d=g}return d}return nc(r,i,Mt,o)}function nc(r,i,o,f){var d=0,g=r==null?0:r.length;if(g===0)return 0;i=o(i);for(var w=i!==i,v=i===null,x=Ft(i),H=i===n;d<g;){var K=ya((d+g)/2),G=o(r[K]),j=G!==n,re=G===null,ae=G===G,ge=Ft(G);if(w)var oe=f||ae;else H?oe=ae&&(f||j):v?oe=ae&&j&&(f||!re):x?oe=ae&&j&&!re&&(f||!ge):re||ge?oe=!1:oe=f?G<=i:G<i;oe?d=K+1:g=K}return mt(g,pe)}function _d(r,i){for(var o=-1,f=r.length,d=0,g=[];++o<f;){var w=r[o],v=i?i(w):w;if(!o||!dr(v,x)){var x=v;g[d++]=w===0?0:w}}return g}function wd(r){return typeof r=="number"?r:Ft(r)?te:+r}function It(r){if(typeof r=="string")return r;if(fe(r))return Ve(r,It)+"";if(Ft(r))return Qh?Qh.call(r):"";var i=r+"";return i=="0"&&1/r==-L?"-0":i}function cn(r,i,o){var f=-1,d=ia,g=r.length,w=!0,v=[],x=v;if(o)w=!1,d=Du;else if(g>=a){var H=i?null:Pv(r);if(H)return aa(H);w=!1,d=qi,x=new Cn}else x=i?[]:v;e:for(;++f<g;){var K=r[f],G=i?i(K):K;if(K=o||K!==0?K:0,w&&G===G){for(var j=x.length;j--;)if(x[j]===G)continue e;i&&x.push(G),v.push(K)}else d(x,G,o)||(x!==v&&x.push(G),v.push(K))}return v}function ic(r,i){return i=ln(i,r),r=Vd(r,i),r==null||delete r[kr(rr(i))]}function bd(r,i,o,f){return es(r,i,o(Pn(r,i)),f)}function Oa(r,i,o,f){for(var d=r.length,g=f?d:-1;(f?g--:++g<d)&&i(r[g],g,r););return o?tr(r,f?0:g,f?g+1:d):tr(r,f?g+1:0,f?d:g)}function Sd(r,i){var o=r;return o instanceof Se&&(o=o.value()),Mu(i,function(f,d){return d.func.apply(d.thisArg,sn([f],d.args))},o)}function sc(r,i,o){var f=r.length;if(f<2)return f?cn(r[0]):[];for(var d=-1,g=B(f);++d<f;)for(var w=r[d],v=-1;++v<f;)v!=d&&(g[d]=Qi(g[d]||w,r[v],i,o));return cn(ht(g,1),i,o)}function vd(r,i,o){for(var f=-1,d=r.length,g=i.length,w={};++f<d;){var v=f<g?i[f]:n;o(w,r[f],v)}return w}function ac(r){return et(r)?r:[]}function oc(r){return typeof r=="function"?r:Mt}function ln(r,i){return fe(r)?r:gc(r,i)?[r]:Qd(De(r))}var bv=ye;function fn(r,i,o){var f=r.length;return o=o===n?f:o,!i&&o>=f?r:tr(r,i,o)}var Td=oS||function(r){return ft.clearTimeout(r)};function Ed(r,i){if(i)return r.slice();var o=r.length,f=$h?$h(o):new r.constructor(o);return r.copy(f),f}function uc(r){var i=new r.constructor(r.byteLength);return new ha(i).set(new ha(r)),i}function Sv(r,i){var o=i?uc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}function vv(r){var i=new r.constructor(r.source,oh.exec(r));return i.lastIndex=r.lastIndex,i}function Tv(r){return ji?Ie(ji.call(r)):{}}function Ad(r,i){var o=i?uc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}function Od(r,i){if(r!==i){var o=r!==n,f=r===null,d=r===r,g=Ft(r),w=i!==n,v=i===null,x=i===i,H=Ft(i);if(!v&&!H&&!g&&r>i||g&&w&&x&&!v&&!H||f&&w&&x||!o&&x||!d)return 1;if(!f&&!g&&!H&&r<i||H&&o&&d&&!f&&!g||v&&o&&d||!w&&d||!x)return-1}return 0}function Ev(r,i,o){for(var f=-1,d=r.criteria,g=i.criteria,w=d.length,v=o.length;++f<w;){var x=Od(d[f],g[f]);if(x){if(f>=v)return x;var H=o[f];return x*(H=="desc"?-1:1)}}return r.index-i.index}function kd(r,i,o,f){for(var d=-1,g=r.length,w=o.length,v=-1,x=i.length,H=it(g-w,0),K=B(x+H),G=!f;++v<x;)K[v]=i[v];for(;++d<w;)(G||d<g)&&(K[o[d]]=r[d]);for(;H--;)K[v++]=r[d++];return K}function Cd(r,i,o,f){for(var d=-1,g=r.length,w=-1,v=o.length,x=-1,H=i.length,K=it(g-v,0),G=B(K+H),j=!f;++d<K;)G[d]=r[d];for(var re=d;++x<H;)G[re+x]=i[x];for(;++w<v;)(j||d<g)&&(G[re+o[w]]=r[d++]);return G}function Pt(r,i){var o=-1,f=r.length;for(i||(i=B(f));++o<f;)i[o]=r[o];return i}function Or(r,i,o,f){var d=!o;o||(o={});for(var g=-1,w=i.length;++g<w;){var v=i[g],x=f?f(o[v],r[v],v,o,r):n;x===n&&(x=r[v]),d?Kr(o,v,x):Ji(o,v,x)}return o}function Av(r,i){return Or(r,mc(r),i)}function Ov(r,i){return Or(r,Hd(r),i)}function ka(r,i){return function(o,f){var d=fe(o)?Rb:zS,g=i?i():{};return d(o,r,se(f,2),g)}}function ai(r){return ye(function(i,o){var f=-1,d=o.length,g=d>1?o[d-1]:n,w=d>2?o[2]:n;for(g=r.length>3&&typeof g=="function"?(d--,g):n,w&&vt(o[0],o[1],w)&&(g=d<3?n:g,d=1),i=Ie(i);++f<d;){var v=o[f];v&&r(i,v,f,g)}return i})}function xd(r,i){return function(o,f){if(o==null)return o;if(!Rt(o))return r(o,f);for(var d=o.length,g=i?d:-1,w=Ie(o);(i?g--:++g<d)&&f(w[g],g,w)!==!1;);return o}}function Pd(r){return function(i,o,f){for(var d=-1,g=Ie(i),w=f(i),v=w.length;v--;){var x=w[r?v:++d];if(o(g[x],x,g)===!1)break}return i}}function kv(r,i,o){var f=i&F,d=ts(r);function g(){var w=this&&this!==ft&&this instanceof g?d:r;return w.apply(f?o:this,arguments)}return g}function Rd(r){return function(i){i=De(i);var o=Xn(i)?fr(i):n,f=o?o[0]:i.charAt(0),d=o?fn(o,1).join(""):i.slice(1);return f[r]()+d}}function oi(r){return function(i){return Mu(xp(Cp(i).replace(yb,"")),r,"")}}function ts(r){return function(){var i=arguments;switch(i.length){case 0:return new r;case 1:return new r(i[0]);case 2:return new r(i[0],i[1]);case 3:return new r(i[0],i[1],i[2]);case 4:return new r(i[0],i[1],i[2],i[3]);case 5:return new r(i[0],i[1],i[2],i[3],i[4]);case 6:return new r(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new r(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var o=si(r.prototype),f=r.apply(o,i);return je(f)?f:o}}function Cv(r,i,o){var f=ts(r);function d(){for(var g=arguments.length,w=B(g),v=g,x=ui(d);v--;)w[v]=arguments[v];var H=g<3&&w[0]!==x&&w[g-1]!==x?[]:an(w,x);if(g-=H.length,g<o)return Ud(r,i,Ca,d.placeholder,n,w,H,n,n,o-g);var K=this&&this!==ft&&this instanceof d?f:r;return Ut(K,this,w)}return d}function Dd(r){return function(i,o,f){var d=Ie(i);if(!Rt(i)){var g=se(o,3);i=ot(i),o=function(v){return g(d[v],v,d)}}var w=r(i,o,f);return w>-1?d[g?i[w]:w]:n}}function Md(r){return $r(function(i){var o=i.length,f=o,d=Xt.prototype.thru;for(r&&i.reverse();f--;){var g=i[f];if(typeof g!="function")throw new Zt(u);if(d&&!w&&Da(g)=="wrapper")var w=new Xt([],!0)}for(f=w?f:o;++f<o;){g=i[f];var v=Da(g),x=v=="wrapper"?dc(g):n;x&&yc(x[0])&&x[1]==(Pe|Ae|_e|y)&&!x[4].length&&x[9]==1?w=w[Da(x[0])].apply(w,x[3]):w=g.length==1&&yc(g)?w[v]():w.thru(g)}return function(){var H=arguments,K=H[0];if(w&&H.length==1&&fe(K))return w.plant(K).value();for(var G=0,j=o?i[G].apply(this,H):K;++G<o;)j=i[G].call(this,j);return j}})}function Ca(r,i,o,f,d,g,w,v,x,H){var K=i&Pe,G=i&F,j=i&ne,re=i&(Ae|ve),ae=i&_,ge=j?n:ts(r);function oe(){for(var we=arguments.length,Te=B(we),Wt=we;Wt--;)Te[Wt]=arguments[Wt];if(re)var Tt=ui(oe),Ht=Wb(Te,Tt);if(f&&(Te=kd(Te,f,d,re)),g&&(Te=Cd(Te,g,w,re)),we-=Ht,re&&we<H){var tt=an(Te,Tt);return Ud(r,i,Ca,oe.placeholder,o,Te,tt,v,x,H-we)}var pr=G?o:this,jr=j?pr[r]:r;return we=Te.length,v?Te=zv(Te,v):ae&&we>1&&Te.reverse(),K&&x<we&&(Te.length=x),this&&this!==ft&&this instanceof oe&&(jr=ge||ts(jr)),jr.apply(pr,Te)}return oe}function Ld(r,i){return function(o,f){return rv(o,r,i(f),{})}}function xa(r,i){return function(o,f){var d;if(o===n&&f===n)return i;if(o!==n&&(d=o),f!==n){if(d===n)return f;typeof o=="string"||typeof f=="string"?(o=It(o),f=It(f)):(o=wd(o),f=wd(f)),d=r(o,f)}return d}}function cc(r){return $r(function(i){return i=Ve(i,Bt(se())),ye(function(o){var f=this;return r(i,function(d){return Ut(d,f,o)})})})}function Pa(r,i){i=i===n?" ":It(i);var o=i.length;if(o<2)return o?rc(i,r):i;var f=rc(i,ga(r/ei(i)));return Xn(i)?fn(fr(f),0,r).join(""):f.slice(0,r)}function xv(r,i,o,f){var d=i&F,g=ts(r);function w(){for(var v=-1,x=arguments.length,H=-1,K=f.length,G=B(K+x),j=this&&this!==ft&&this instanceof w?g:r;++H<K;)G[H]=f[H];for(;x--;)G[H++]=arguments[++v];return Ut(j,d?o:this,G)}return w}function Nd(r){return function(i,o,f){return f&&typeof f!="number"&&vt(i,o,f)&&(o=f=n),i=zr(i),o===n?(o=i,i=0):o=zr(o),f=f===n?i<o?1:-1:zr(f),pv(i,o,f,r)}}function Ra(r){return function(i,o){return typeof i=="string"&&typeof o=="string"||(i=nr(i),o=nr(o)),r(i,o)}}function Ud(r,i,o,f,d,g,w,v,x,H){var K=i&Ae,G=K?w:n,j=K?n:w,re=K?g:n,ae=K?n:g;i|=K?_e:Fe,i&=~(K?Fe:_e),i&Y||(i&=-4);var ge=[r,i,d,re,G,ae,j,v,x,H],oe=o.apply(n,ge);return yc(r)&&zd(oe,ge),oe.placeholder=f,jd(oe,r,i)}function lc(r){var i=nt[r];return function(o,f){if(o=nr(o),f=f==null?0:mt(me(f),292),f&&jh(o)){var d=(De(o)+"e").split("e"),g=i(d[0]+"e"+(+d[1]+f));return d=(De(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-f))}return i(o)}}var Pv=ni&&1/aa(new ni([,-0]))[1]==L?function(r){return new ni(r)}:Dc;function Bd(r){return function(i){var o=gt(i);return o==Be?Wu(i):o==lr?Vb(i):Fb(i,r(i))}}function qr(r,i,o,f,d,g,w,v){var x=i&ne;if(!x&&typeof r!="function")throw new Zt(u);var H=f?f.length:0;if(H||(i&=-97,f=d=n),w=w===n?w:it(me(w),0),v=v===n?v:me(v),H-=d?d.length:0,i&Fe){var K=f,G=d;f=d=n}var j=x?n:dc(r),re=[r,i,o,f,d,K,G,g,w,v];if(j&&$v(re,j),r=re[0],i=re[1],o=re[2],f=re[3],d=re[4],v=re[9]=re[9]===n?x?0:r.length:it(re[9]-H,0),!v&&i&(Ae|ve)&&(i&=-25),!i||i==F)var ae=kv(r,i,o);else i==Ae||i==ve?ae=Cv(r,i,v):(i==_e||i==(F|_e))&&!d.length?ae=xv(r,i,o,f):ae=Ca.apply(n,re);var ge=j?yd:zd;return jd(ge(ae,re),r,i)}function Id(r,i,o,f){return r===n||dr(r,ri[o])&&!Me.call(f,o)?i:r}function Fd(r,i,o,f,d,g){return je(r)&&je(i)&&(g.set(i,r),Ea(r,i,n,Fd,g),g.delete(i)),r}function Rv(r){return is(r)?n:r}function Wd(r,i,o,f,d,g){var w=o&O,v=r.length,x=i.length;if(v!=x&&!(w&&x>v))return!1;var H=g.get(r),K=g.get(i);if(H&&K)return H==i&&K==r;var G=-1,j=!0,re=o&I?new Cn:n;for(g.set(r,i),g.set(i,r);++G<v;){var ae=r[G],ge=i[G];if(f)var oe=w?f(ge,ae,G,i,r,g):f(ae,ge,G,r,i,g);if(oe!==n){if(oe)continue;j=!1;break}if(re){if(!Lu(i,function(we,Te){if(!qi(re,Te)&&(ae===we||d(ae,we,o,f,g)))return re.push(Te)})){j=!1;break}}else if(!(ae===ge||d(ae,ge,o,f,g))){j=!1;break}}return g.delete(r),g.delete(i),j}function Dv(r,i,o,f,d,g,w){switch(o){case Jn:if(r.byteLength!=i.byteLength||r.byteOffset!=i.byteOffset)return!1;r=r.buffer,i=i.buffer;case Ki:return!(r.byteLength!=i.byteLength||!g(new ha(r),new ha(i)));case Tr:case Fr:case Ue:return dr(+r,+i);case wt:return r.name==i.name&&r.message==i.message;case Wi:case Hi:return r==i+"";case Be:var v=Wu;case lr:var x=f&O;if(v||(v=aa),r.size!=i.size&&!x)return!1;var H=w.get(r);if(H)return H==i;f|=I,w.set(r,i);var K=Wd(v(r),v(i),f,d,g,w);return w.delete(r),K;case ea:if(ji)return ji.call(r)==ji.call(i)}return!1}function Mv(r,i,o,f,d,g){var w=o&O,v=fc(r),x=v.length,H=fc(i),K=H.length;if(x!=K&&!w)return!1;for(var G=x;G--;){var j=v[G];if(!(w?j in i:Me.call(i,j)))return!1}var re=g.get(r),ae=g.get(i);if(re&&ae)return re==i&&ae==r;var ge=!0;g.set(r,i),g.set(i,r);for(var oe=w;++G<x;){j=v[G];var we=r[j],Te=i[j];if(f)var Wt=w?f(Te,we,j,i,r,g):f(we,Te,j,r,i,g);if(!(Wt===n?we===Te||d(we,Te,o,f,g):Wt)){ge=!1;break}oe||(oe=j=="constructor")}if(ge&&!oe){var Tt=r.constructor,Ht=i.constructor;Tt!=Ht&&"constructor"in r&&"constructor"in i&&!(typeof Tt=="function"&&Tt instanceof Tt&&typeof Ht=="function"&&Ht instanceof Ht)&&(ge=!1)}return g.delete(r),g.delete(i),ge}function $r(r){return wc(Gd(r,n,tp),r+"")}function fc(r){return ad(r,ot,mc)}function hc(r){return ad(r,Dt,Hd)}var dc=_a?function(r){return _a.get(r)}:Dc;function Da(r){for(var i=r.name+"",o=ii[i],f=Me.call(ii,i)?o.length:0;f--;){var d=o[f],g=d.func;if(g==null||g==r)return d.name}return i}function ui(r){var i=Me.call(p,"placeholder")?p:r;return i.placeholder}function se(){var r=p.iteratee||Pc;return r=r===Pc?cd:r,arguments.length?r(arguments[0],arguments[1]):r}function Ma(r,i){var o=r.__data__;return Hv(i)?o[typeof i=="string"?"string":"hash"]:o.map}function pc(r){for(var i=ot(r),o=i.length;o--;){var f=i[o],d=r[f];i[o]=[f,d,qd(d)]}return i}function Rn(r,i){var o=qb(r,i);return ud(o)?o:n}function Lv(r){var i=Me.call(r,On),o=r[On];try{r[On]=n;var f=!0}catch{}var d=la.call(r);return f&&(i?r[On]=o:delete r[On]),d}var mc=Yu?function(r){return r==null?[]:(r=Ie(r),nn(Yu(r),function(i){return Vh.call(r,i)}))}:Mc,Hd=Yu?function(r){for(var i=[];r;)sn(i,mc(r)),r=da(r);return i}:Mc,gt=St;(Ku&&gt(new Ku(new ArrayBuffer(1)))!=Jn||Gi&&gt(new Gi)!=Be||qu&&gt(qu.resolve())!=nh||ni&&gt(new ni)!=lr||Vi&&gt(new Vi)!=Yi)&&(gt=function(r){var i=St(r),o=i==Wr?r.constructor:n,f=o?Dn(o):"";if(f)switch(f){case gS:return Jn;case yS:return Be;case _S:return nh;case wS:return lr;case bS:return Yi}return i});function Nv(r,i,o){for(var f=-1,d=o.length;++f<d;){var g=o[f],w=g.size;switch(g.type){case"drop":r+=w;break;case"dropRight":i-=w;break;case"take":i=mt(i,r+w);break;case"takeRight":r=it(r,i-w);break}}return{start:r,end:i}}function Uv(r){var i=r.match(Y1);return i?i[1].split(K1):[]}function Yd(r,i,o){i=ln(i,r);for(var f=-1,d=i.length,g=!1;++f<d;){var w=kr(i[f]);if(!(g=r!=null&&o(r,w)))break;r=r[w]}return g||++f!=d?g:(d=r==null?0:r.length,!!d&&Wa(d)&&Gr(w,d)&&(fe(r)||Mn(r)))}function Bv(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&Me.call(r,"index")&&(o.index=r.index,o.input=r.input),o}function Kd(r){return typeof r.constructor=="function"&&!rs(r)?si(da(r)):{}}function Iv(r,i,o){var f=r.constructor;switch(i){case Ki:return uc(r);case Tr:case Fr:return new f(+r);case Jn:return Sv(r,o);case pu:case mu:case gu:case yu:case _u:case wu:case bu:case Su:case vu:return Ad(r,o);case Be:return new f;case Ue:case Hi:return new f(r);case Wi:return vv(r);case lr:return new f;case ea:return Tv(r)}}function Fv(r,i){var o=i.length;if(!o)return r;var f=o-1;return i[f]=(o>1?"& ":"")+i[f],i=i.join(o>2?", ":" "),r.replace(H1,`{
15
15
  /* [wrapped with `+i+`] */
16
- `)}function Wv(r){return fe(r)||Mn(r)||!!(zh&&r&&r[zh])}function Gr(r,i){var o=typeof r;return i=i??D,!!i&&(o=="number"||o!="symbol"&&Z1.test(r))&&r>-1&&r%1==0&&r<i}function vt(r,i,o){if(!je(o))return!1;var f=typeof i;return(f=="number"?Rt(o)&&Gr(i,o.length):f=="string"&&i in o)?dr(o[i],r):!1}function mc(r,i){if(fe(r))return!1;var o=typeof r;return o=="number"||o=="symbol"||o=="boolean"||r==null||Ft(r)?!0:B1.test(r)||!U1.test(r)||i!=null&&r in Ie(i)}function Hv(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function gc(r){var i=Da(r),o=p[i];if(typeof o!="function"||!(i in Se.prototype))return!1;if(r===o)return!0;var f=hc(o);return!!f&&r===f[0]}function Yv(r){return!!qh&&qh in r}var Kv=ua?Vr:Mc;function ts(r){var i=r&&r.constructor,o=typeof i=="function"&&i.prototype||ri;return r===o}function qd(r){return r===r&&!je(r)}function $d(r,i){return function(o){return o==null?!1:o[r]===i&&(i!==n||r in Ie(o))}}function qv(r){var i=Ia(r,function(f){return o.size===m&&o.clear(),f}),o=i.cache;return i}function $v(r,i){var o=r[1],f=i[1],d=o|f,g=d<(F|ne|Pe),w=f==Pe&&o==Ae||f==Pe&&o==y&&r[7].length<=i[8]||f==(Pe|y)&&i[7].length<=i[8]&&o==Ae;if(!(g||w))return r;f&F&&(r[2]=i[2],d|=o&F?0:Y);var v=i[3];if(v){var x=r[3];r[3]=x?kd(x,v,i[4]):v,r[4]=x?an(r[3],b):i[4]}return v=i[5],v&&(x=r[5],r[5]=x?Cd(x,v,i[6]):v,r[6]=x?an(r[5],b):i[6]),v=i[7],v&&(r[7]=v),f&Pe&&(r[8]=r[8]==null?i[8]:mt(r[8],i[8])),r[9]==null&&(r[9]=i[9]),r[0]=i[0],r[1]=d,r}function Gv(r){var i=[];if(r!=null)for(var o in Ie(r))i.push(o);return i}function Vv(r){return la.call(r)}function Gd(r,i,o){return i=it(i===n?r.length-1:i,0),function(){for(var f=arguments,d=-1,g=it(f.length-i,0),w=B(g);++d<g;)w[d]=f[i+d];d=-1;for(var v=B(i+1);++d<i;)v[d]=f[d];return v[i]=o(w),Ut(r,this,v)}}function Vd(r,i){return i.length<2?r:Pn(r,tr(i,0,-1))}function zv(r,i){for(var o=r.length,f=mt(i.length,o),d=Pt(r);f--;){var g=i[f];r[f]=Gr(g,o)?d[g]:n}return r}function yc(r,i){if(!(i==="constructor"&&typeof r[i]=="function")&&i!="__proto__")return r[i]}var zd=Jd(yd),rs=cS||function(r,i){return ft.setTimeout(r,i)},_c=Jd(yv);function jd(r,i,o){var f=i+"";return _c(r,Fv(f,jv(Uv(f),o)))}function Jd(r){var i=0,o=0;return function(){var f=dS(),d=R-(f-o);if(o=f,d>0){if(++i>=k)return arguments[0]}else i=0;return r.apply(n,arguments)}}function La(r,i){var o=-1,f=r.length,d=f-1;for(i=i===n?f:i;++o<i;){var g=ec(o,d),w=r[g];r[g]=r[o],r[o]=w}return r.length=i,r}var Qd=qv(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(I1,function(o,f,d,g){i.push(d?g.replace(G1,"$1"):f||o)}),i});function kr(r){if(typeof r=="string"||Ft(r))return r;var i=r+"";return i=="0"&&1/r==-L?"-0":i}function Dn(r){if(r!=null){try{return ca.call(r)}catch{}try{return r+""}catch{}}return""}function jv(r,i){return Qt(We,function(o){var f="_."+o[0];i&o[1]&&!ia(r,f)&&r.push(f)}),r.sort()}function Zd(r){if(r instanceof Se)return r.clone();var i=new Xt(r.__wrapped__,r.__chain__);return i.__actions__=Pt(r.__actions__),i.__index__=r.__index__,i.__values__=r.__values__,i}function Jv(r,i,o){(o?vt(r,i,o):i===n)?i=1:i=it(me(i),0);var f=r==null?0:r.length;if(!f||i<1)return[];for(var d=0,g=0,w=B(ga(f/i));d<f;)w[g++]=tr(r,d,d+=i);return w}function Qv(r){for(var i=-1,o=r==null?0:r.length,f=0,d=[];++i<o;){var g=r[i];g&&(d[f++]=g)}return d}function Zv(){var r=arguments.length;if(!r)return[];for(var i=B(r-1),o=arguments[0],f=r;f--;)i[f-1]=arguments[f];return sn(fe(o)?Pt(o):[o],ht(i,1))}var Xv=ye(function(r,i){return et(r)?Ji(r,ht(i,1,et,!0)):[]}),eT=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Ji(r,ht(i,1,et,!0),se(o,2)):[]}),tT=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Ji(r,ht(i,1,et,!0),n,o):[]});function rT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),tr(r,i<0?0:i,f)):[]}function nT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),i=f-i,tr(r,0,i<0?0:i)):[]}function iT(r,i){return r&&r.length?Oa(r,se(i,3),!0,!0):[]}function sT(r,i){return r&&r.length?Oa(r,se(i,3),!0):[]}function aT(r,i,o,f){var d=r==null?0:r.length;return d?(o&&typeof o!="number"&&vt(r,i,o)&&(o=0,f=d),ZS(r,i,o,f)):[]}function Xd(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),sa(r,se(i,3),d)}function ep(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f-1;return o!==n&&(d=me(o),d=o<0?it(f+d,0):mt(d,f-1)),sa(r,se(i,3),d,!0)}function tp(r){var i=r==null?0:r.length;return i?ht(r,1):[]}function oT(r){var i=r==null?0:r.length;return i?ht(r,L):[]}function uT(r,i){var o=r==null?0:r.length;return o?(i=i===n?1:me(i),ht(r,i)):[]}function cT(r){for(var i=-1,o=r==null?0:r.length,f={};++i<o;){var d=r[i];f[d[0]]=d[1]}return f}function rp(r){return r&&r.length?r[0]:n}function lT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),Zn(r,i,d)}function fT(r){var i=r==null?0:r.length;return i?tr(r,0,-1):[]}var hT=ye(function(r){var i=Ve(r,sc);return i.length&&i[0]===r[0]?ju(i):[]}),dT=ye(function(r){var i=rr(r),o=Ve(r,sc);return i===rr(o)?i=n:o.pop(),o.length&&o[0]===r[0]?ju(o,se(i,2)):[]}),pT=ye(function(r){var i=rr(r),o=Ve(r,sc);return i=typeof i=="function"?i:n,i&&o.pop(),o.length&&o[0]===r[0]?ju(o,n,i):[]});function mT(r,i){return r==null?"":fS.call(r,i)}function rr(r){var i=r==null?0:r.length;return i?r[i-1]:n}function gT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f;return o!==n&&(d=me(o),d=d<0?it(f+d,0):mt(d,f-1)),i===i?jb(r,i,d):sa(r,Uh,d,!0)}function yT(r,i){return r&&r.length?dd(r,me(i)):n}var _T=ye(np);function np(r,i){return r&&r.length&&i&&i.length?Xu(r,i):r}function wT(r,i,o){return r&&r.length&&i&&i.length?Xu(r,i,se(o,2)):r}function bT(r,i,o){return r&&r.length&&i&&i.length?Xu(r,i,n,o):r}var ST=$r(function(r,i){var o=r==null?0:r.length,f=$u(r,i);return gd(r,Ve(i,function(d){return Gr(d,o)?+d:d}).sort(Od)),f});function vT(r,i){var o=[];if(!(r&&r.length))return o;var f=-1,d=[],g=r.length;for(i=se(i,3);++f<g;){var w=r[f];i(w,f,r)&&(o.push(w),d.push(f))}return gd(r,d),o}function wc(r){return r==null?r:mS.call(r)}function TT(r,i,o){var f=r==null?0:r.length;return f?(o&&typeof o!="number"&&vt(r,i,o)?(i=0,o=f):(i=i==null?0:me(i),o=o===n?f:me(o)),tr(r,i,o)):[]}function ET(r,i){return Aa(r,i)}function AT(r,i,o){return rc(r,i,se(o,2))}function OT(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i);if(f<o&&dr(r[f],i))return f}return-1}function kT(r,i){return Aa(r,i,!0)}function CT(r,i,o){return rc(r,i,se(o,2),!0)}function xT(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i,!0)-1;if(dr(r[f],i))return f}return-1}function PT(r){return r&&r.length?_d(r):[]}function RT(r,i){return r&&r.length?_d(r,se(i,2)):[]}function DT(r){var i=r==null?0:r.length;return i?tr(r,1,i):[]}function MT(r,i,o){return r&&r.length?(i=o||i===n?1:me(i),tr(r,0,i<0?0:i)):[]}function LT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),i=f-i,tr(r,i<0?0:i,f)):[]}function NT(r,i){return r&&r.length?Oa(r,se(i,3),!1,!0):[]}function UT(r,i){return r&&r.length?Oa(r,se(i,3)):[]}var BT=ye(function(r){return cn(ht(r,1,et,!0))}),IT=ye(function(r){var i=rr(r);return et(i)&&(i=n),cn(ht(r,1,et,!0),se(i,2))}),FT=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,cn(ht(r,1,et,!0),n,i)});function WT(r){return r&&r.length?cn(r):[]}function HT(r,i){return r&&r.length?cn(r,se(i,2)):[]}function YT(r,i){return i=typeof i=="function"?i:n,r&&r.length?cn(r,n,i):[]}function bc(r){if(!(r&&r.length))return[];var i=0;return r=nn(r,function(o){if(et(o))return i=it(o.length,i),!0}),Bu(i,function(o){return Ve(r,Lu(o))})}function ip(r,i){if(!(r&&r.length))return[];var o=bc(r);return i==null?o:Ve(o,function(f){return Ut(i,n,f)})}var KT=ye(function(r,i){return et(r)?Ji(r,i):[]}),qT=ye(function(r){return ic(nn(r,et))}),$T=ye(function(r){var i=rr(r);return et(i)&&(i=n),ic(nn(r,et),se(i,2))}),GT=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,ic(nn(r,et),n,i)}),VT=ye(bc);function zT(r,i){return vd(r||[],i||[],ji)}function jT(r,i){return vd(r||[],i||[],Xi)}var JT=ye(function(r){var i=r.length,o=i>1?r[i-1]:n;return o=typeof o=="function"?(r.pop(),o):n,ip(r,o)});function sp(r){var i=p(r);return i.__chain__=!0,i}function QT(r,i){return i(r),r}function Na(r,i){return i(r)}var ZT=$r(function(r){var i=r.length,o=i?r[0]:0,f=this.__wrapped__,d=function(g){return $u(g,r)};return i>1||this.__actions__.length||!(f instanceof Se)||!Gr(o)?this.thru(d):(f=f.slice(o,+o+(i?1:0)),f.__actions__.push({func:Na,args:[d],thisArg:n}),new Xt(f,this.__chain__).thru(function(g){return i&&!g.length&&g.push(n),g}))});function XT(){return sp(this)}function eE(){return new Xt(this.value(),this.__chain__)}function tE(){this.__values__===n&&(this.__values__=wp(this.value()));var r=this.__index__>=this.__values__.length,i=r?n:this.__values__[this.__index__++];return{done:r,value:i}}function rE(){return this}function nE(r){for(var i,o=this;o instanceof ba;){var f=Zd(o);f.__index__=0,f.__values__=n,i?d.__wrapped__=f:i=f;var d=f;o=o.__wrapped__}return d.__wrapped__=r,i}function iE(){var r=this.__wrapped__;if(r instanceof Se){var i=r;return this.__actions__.length&&(i=new Se(this)),i=i.reverse(),i.__actions__.push({func:Na,args:[wc],thisArg:n}),new Xt(i,this.__chain__)}return this.thru(wc)}function sE(){return Sd(this.__wrapped__,this.__actions__)}var aE=ka(function(r,i,o){Me.call(r,o)?++r[o]:Kr(r,o,1)});function oE(r,i,o){var f=fe(r)?Lh:QS;return o&&vt(r,i,o)&&(i=n),f(r,se(i,3))}function uE(r,i){var o=fe(r)?nn:id;return o(r,se(i,3))}var cE=Dd(Xd),lE=Dd(ep);function fE(r,i){return ht(Ua(r,i),1)}function hE(r,i){return ht(Ua(r,i),L)}function dE(r,i,o){return o=o===n?1:me(o),ht(Ua(r,i),o)}function ap(r,i){var o=fe(r)?Qt:un;return o(r,se(i,3))}function op(r,i){var o=fe(r)?Db:nd;return o(r,se(i,3))}var pE=ka(function(r,i,o){Me.call(r,o)?r[o].push(i):Kr(r,o,[i])});function mE(r,i,o,f){r=Rt(r)?r:li(r),o=o&&!f?me(o):0;var d=r.length;return o<0&&(o=it(d+o,0)),Ha(r)?o<=d&&r.indexOf(i,o)>-1:!!d&&Zn(r,i,o)>-1}var gE=ye(function(r,i,o){var f=-1,d=typeof i=="function",g=Rt(r)?B(r.length):[];return un(r,function(w){g[++f]=d?Ut(i,w,o):Qi(w,i,o)}),g}),yE=ka(function(r,i,o){Kr(r,o,i)});function Ua(r,i){var o=fe(r)?Ve:ld;return o(r,se(i,3))}function _E(r,i,o,f){return r==null?[]:(fe(i)||(i=i==null?[]:[i]),o=f?n:o,fe(o)||(o=o==null?[]:[o]),pd(r,i,o))}var wE=ka(function(r,i,o){r[o?0:1].push(i)},function(){return[[],[]]});function bE(r,i,o){var f=fe(r)?Du:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,un)}function SE(r,i,o){var f=fe(r)?Mb:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,nd)}function vE(r,i){var o=fe(r)?nn:id;return o(r,Fa(se(i,3)))}function TE(r){var i=fe(r)?Xh:mv;return i(r)}function EE(r,i,o){(o?vt(r,i,o):i===n)?i=1:i=me(i);var f=fe(r)?GS:gv;return f(r,i)}function AE(r){var i=fe(r)?VS:_v;return i(r)}function OE(r){if(r==null)return 0;if(Rt(r))return Ha(r)?ei(r):r.length;var i=gt(r);return i==Be||i==lr?r.size:Qu(r).length}function kE(r,i,o){var f=fe(r)?Mu:wv;return o&&vt(r,i,o)&&(i=n),f(r,se(i,3))}var CE=ye(function(r,i){if(r==null)return[];var o=i.length;return o>1&&vt(r,i[0],i[1])?i=[]:o>2&&vt(i[0],i[1],i[2])&&(i=[i[0]]),pd(r,ht(i,1),[])}),Ba=uS||function(){return ft.Date.now()};function xE(r,i){if(typeof i!="function")throw new Zt(u);return r=me(r),function(){if(--r<1)return i.apply(this,arguments)}}function up(r,i,o){return i=o?n:i,i=r&&i==null?r.length:i,qr(r,Pe,n,n,n,n,i)}function cp(r,i){var o;if(typeof i!="function")throw new Zt(u);return r=me(r),function(){return--r>0&&(o=i.apply(this,arguments)),r<=1&&(i=n),o}}var Sc=ye(function(r,i,o){var f=F;if(o.length){var d=an(o,ui(Sc));f|=_e}return qr(r,f,i,o,d)}),lp=ye(function(r,i,o){var f=F|ne;if(o.length){var d=an(o,ui(lp));f|=_e}return qr(i,f,r,o,d)});function fp(r,i,o){i=o?n:i;var f=qr(r,Ae,n,n,n,n,n,i);return f.placeholder=fp.placeholder,f}function hp(r,i,o){i=o?n:i;var f=qr(r,ve,n,n,n,n,n,i);return f.placeholder=hp.placeholder,f}function dp(r,i,o){var f,d,g,w,v,x,H=0,K=!1,G=!1,j=!0;if(typeof r!="function")throw new Zt(u);i=nr(i)||0,je(o)&&(K=!!o.leading,G="maxWait"in o,g=G?it(nr(o.maxWait)||0,i):g,j="trailing"in o?!!o.trailing:j);function re(tt){var pr=f,jr=d;return f=d=n,H=tt,w=r.apply(jr,pr),w}function ae(tt){return H=tt,v=rs(we,i),K?re(tt):w}function ge(tt){var pr=tt-x,jr=tt-H,Dp=i-pr;return G?mt(Dp,g-jr):Dp}function oe(tt){var pr=tt-x,jr=tt-H;return x===n||pr>=i||pr<0||G&&jr>=g}function we(){var tt=Ba();if(oe(tt))return Te(tt);v=rs(we,ge(tt))}function Te(tt){return v=n,j&&f?re(tt):(f=d=n,w)}function Wt(){v!==n&&Td(v),H=0,f=x=d=v=n}function Tt(){return v===n?w:Te(Ba())}function Ht(){var tt=Ba(),pr=oe(tt);if(f=arguments,d=this,x=tt,pr){if(v===n)return ae(x);if(G)return Td(v),v=rs(we,i),re(x)}return v===n&&(v=rs(we,i)),w}return Ht.cancel=Wt,Ht.flush=Tt,Ht}var PE=ye(function(r,i){return rd(r,1,i)}),RE=ye(function(r,i,o){return rd(r,nr(i)||0,o)});function DE(r){return qr(r,_)}function Ia(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new Zt(u);var o=function(){var f=arguments,d=i?i.apply(this,f):f[0],g=o.cache;if(g.has(d))return g.get(d);var w=r.apply(this,f);return o.cache=g.set(d,w)||g,w};return o.cache=new(Ia.Cache||Yr),o}Ia.Cache=Yr;function Fa(r){if(typeof r!="function")throw new Zt(u);return function(){var i=arguments;switch(i.length){case 0:return!r.call(this);case 1:return!r.call(this,i[0]);case 2:return!r.call(this,i[0],i[1]);case 3:return!r.call(this,i[0],i[1],i[2])}return!r.apply(this,i)}}function ME(r){return cp(2,r)}var LE=bv(function(r,i){i=i.length==1&&fe(i[0])?Ve(i[0],Bt(se())):Ve(ht(i,1),Bt(se()));var o=i.length;return ye(function(f){for(var d=-1,g=mt(f.length,o);++d<g;)f[d]=i[d].call(this,f[d]);return Ut(r,this,f)})}),vc=ye(function(r,i){var o=an(i,ui(vc));return qr(r,_e,n,i,o)}),pp=ye(function(r,i){var o=an(i,ui(pp));return qr(r,Fe,n,i,o)}),NE=$r(function(r,i){return qr(r,y,n,n,n,i)});function UE(r,i){if(typeof r!="function")throw new Zt(u);return i=i===n?i:me(i),ye(r,i)}function BE(r,i){if(typeof r!="function")throw new Zt(u);return i=i==null?0:it(me(i),0),ye(function(o){var f=o[i],d=fn(o,0,i);return f&&sn(d,f),Ut(r,this,d)})}function IE(r,i,o){var f=!0,d=!0;if(typeof r!="function")throw new Zt(u);return je(o)&&(f="leading"in o?!!o.leading:f,d="trailing"in o?!!o.trailing:d),dp(r,i,{leading:f,maxWait:i,trailing:d})}function FE(r){return up(r,1)}function WE(r,i){return vc(ac(i),r)}function HE(){if(!arguments.length)return[];var r=arguments[0];return fe(r)?r:[r]}function YE(r){return er(r,$)}function KE(r,i){return i=typeof i=="function"?i:n,er(r,$,i)}function qE(r){return er(r,T|$)}function $E(r,i){return i=typeof i=="function"?i:n,er(r,T|$,i)}function GE(r,i){return i==null||td(r,i,ot(i))}function dr(r,i){return r===i||r!==r&&i!==i}var VE=Ra(zu),zE=Ra(function(r,i){return r>=i}),Mn=od((function(){return arguments})())?od:function(r){return Je(r)&&Me.call(r,"callee")&&!Vh.call(r,"callee")},fe=B.isArray,jE=Ch?Bt(Ch):nv;function Rt(r){return r!=null&&Wa(r.length)&&!Vr(r)}function et(r){return Je(r)&&Rt(r)}function JE(r){return r===!0||r===!1||Je(r)&&St(r)==Tr}var hn=lS||Mc,QE=xh?Bt(xh):iv;function ZE(r){return Je(r)&&r.nodeType===1&&!ns(r)}function XE(r){if(r==null)return!0;if(Rt(r)&&(fe(r)||typeof r=="string"||typeof r.splice=="function"||hn(r)||ci(r)||Mn(r)))return!r.length;var i=gt(r);if(i==Be||i==lr)return!r.size;if(ts(r))return!Qu(r).length;for(var o in r)if(Me.call(r,o))return!1;return!0}function eA(r,i){return Zi(r,i)}function tA(r,i,o){o=typeof o=="function"?o:n;var f=o?o(r,i):n;return f===n?Zi(r,i,n,o):!!f}function Tc(r){if(!Je(r))return!1;var i=St(r);return i==wt||i==Ii||typeof r.message=="string"&&typeof r.name=="string"&&!ns(r)}function rA(r){return typeof r=="number"&&jh(r)}function Vr(r){if(!je(r))return!1;var i=St(r);return i==Er||i==bt||i==at||i==O1}function mp(r){return typeof r=="number"&&r==me(r)}function Wa(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=D}function je(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}function Je(r){return r!=null&&typeof r=="object"}var gp=Ph?Bt(Ph):av;function nA(r,i){return r===i||Ju(r,i,dc(i))}function iA(r,i,o){return o=typeof o=="function"?o:n,Ju(r,i,dc(i),o)}function sA(r){return yp(r)&&r!=+r}function aA(r){if(Kv(r))throw new ue(c);return ud(r)}function oA(r){return r===null}function uA(r){return r==null}function yp(r){return typeof r=="number"||Je(r)&&St(r)==Ue}function ns(r){if(!Je(r)||St(r)!=Wr)return!1;var i=da(r);if(i===null)return!0;var o=Me.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&ca.call(o)==iS}var Ec=Rh?Bt(Rh):ov;function cA(r){return mp(r)&&r>=-D&&r<=D}var _p=Dh?Bt(Dh):uv;function Ha(r){return typeof r=="string"||!fe(r)&&Je(r)&&St(r)==Wi}function Ft(r){return typeof r=="symbol"||Je(r)&&St(r)==ea}var ci=Mh?Bt(Mh):cv;function lA(r){return r===n}function fA(r){return Je(r)&&gt(r)==Hi}function hA(r){return Je(r)&&St(r)==C1}var dA=Ra(Zu),pA=Ra(function(r,i){return r<=i});function wp(r){if(!r)return[];if(Rt(r))return Ha(r)?fr(r):Pt(r);if(qi&&r[qi])return Gb(r[qi]());var i=gt(r),o=i==Be?Fu:i==lr?aa:li;return o(r)}function zr(r){if(!r)return r===0?r:0;if(r=nr(r),r===L||r===-L){var i=r<0?-1:1;return i*q}return r===r?r:0}function me(r){var i=zr(r),o=i%1;return i===i?o?i-o:i:0}function bp(r){return r?xn(me(r),0,J):0}function nr(r){if(typeof r=="number")return r;if(Ft(r))return te;if(je(r)){var i=typeof r.valueOf=="function"?r.valueOf():r;r=je(i)?i+"":i}if(typeof r!="string")return r===0?r:+r;r=Fh(r);var o=j1.test(r);return o||Q1.test(r)?xb(r.slice(2),o?2:8):z1.test(r)?te:+r}function Sp(r){return Or(r,Dt(r))}function mA(r){return r?xn(me(r),-D,D):r===0?r:0}function De(r){return r==null?"":It(r)}var gA=ai(function(r,i){if(ts(i)||Rt(i)){Or(i,ot(i),r);return}for(var o in i)Me.call(i,o)&&ji(r,o,i[o])}),vp=ai(function(r,i){Or(i,Dt(i),r)}),Ya=ai(function(r,i,o,f){Or(i,Dt(i),r,f)}),yA=ai(function(r,i,o,f){Or(i,ot(i),r,f)}),_A=$r($u);function wA(r,i){var o=si(r);return i==null?o:ed(o,i)}var bA=ye(function(r,i){r=Ie(r);var o=-1,f=i.length,d=f>2?i[2]:n;for(d&&vt(i[0],i[1],d)&&(f=1);++o<f;)for(var g=i[o],w=Dt(g),v=-1,x=w.length;++v<x;){var H=w[v],K=r[H];(K===n||dr(K,ri[H])&&!Me.call(r,H))&&(r[H]=g[H])}return r}),SA=ye(function(r){return r.push(n,Fd),Ut(Tp,n,r)});function vA(r,i){return Nh(r,se(i,3),Ar)}function TA(r,i){return Nh(r,se(i,3),Vu)}function EA(r,i){return r==null?r:Gu(r,se(i,3),Dt)}function AA(r,i){return r==null?r:sd(r,se(i,3),Dt)}function OA(r,i){return r&&Ar(r,se(i,3))}function kA(r,i){return r&&Vu(r,se(i,3))}function CA(r){return r==null?[]:Ta(r,ot(r))}function xA(r){return r==null?[]:Ta(r,Dt(r))}function Ac(r,i,o){var f=r==null?n:Pn(r,i);return f===n?o:f}function PA(r,i){return r!=null&&Yd(r,i,XS)}function Oc(r,i){return r!=null&&Yd(r,i,ev)}var RA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),r[i]=o},Cc(Mt)),DA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),Me.call(r,i)?r[i].push(o):r[i]=[o]},se),MA=ye(Qi);function ot(r){return Rt(r)?Zh(r):Qu(r)}function Dt(r){return Rt(r)?Zh(r,!0):lv(r)}function LA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,i(f,d,g),f)}),o}function NA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,d,i(f,d,g))}),o}var UA=ai(function(r,i,o){Ea(r,i,o)}),Tp=ai(function(r,i,o,f){Ea(r,i,o,f)}),BA=$r(function(r,i){var o={};if(r==null)return o;var f=!1;i=Ve(i,function(g){return g=ln(g,r),f||(f=g.length>1),g}),Or(r,fc(r),o),f&&(o=er(o,T|P|$,Rv));for(var d=i.length;d--;)nc(o,i[d]);return o});function IA(r,i){return Ep(r,Fa(se(i)))}var FA=$r(function(r,i){return r==null?{}:hv(r,i)});function Ep(r,i){if(r==null)return{};var o=Ve(fc(r),function(f){return[f]});return i=se(i),md(r,o,function(f,d){return i(f,d[0])})}function WA(r,i,o){i=ln(i,r);var f=-1,d=i.length;for(d||(d=1,r=n);++f<d;){var g=r==null?n:r[kr(i[f])];g===n&&(f=d,g=o),r=Vr(g)?g.call(r):g}return r}function HA(r,i,o){return r==null?r:Xi(r,i,o)}function YA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:Xi(r,i,o,f)}var Ap=Bd(ot),Op=Bd(Dt);function KA(r,i,o){var f=fe(r),d=f||hn(r)||ci(r);if(i=se(i,4),o==null){var g=r&&r.constructor;d?o=f?new g:[]:je(r)?o=Vr(g)?si(da(r)):{}:o={}}return(d?Qt:Ar)(r,function(w,v,x){return i(o,w,v,x)}),o}function qA(r,i){return r==null?!0:nc(r,i)}function $A(r,i,o){return r==null?r:bd(r,i,ac(o))}function GA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:bd(r,i,ac(o),f)}function li(r){return r==null?[]:Iu(r,ot(r))}function VA(r){return r==null?[]:Iu(r,Dt(r))}function zA(r,i,o){return o===n&&(o=i,i=n),o!==n&&(o=nr(o),o=o===o?o:0),i!==n&&(i=nr(i),i=i===i?i:0),xn(nr(r),i,o)}function jA(r,i,o){return i=zr(i),o===n?(o=i,i=0):o=zr(o),r=nr(r),tv(r,i,o)}function JA(r,i,o){if(o&&typeof o!="boolean"&&vt(r,i,o)&&(i=o=n),o===n&&(typeof i=="boolean"?(o=i,i=n):typeof r=="boolean"&&(o=r,r=n)),r===n&&i===n?(r=0,i=1):(r=zr(r),i===n?(i=r,r=0):i=zr(i)),r>i){var f=r;r=i,i=f}if(o||r%1||i%1){var d=Jh();return mt(r+d*(i-r+Cb("1e-"+((d+"").length-1))),i)}return ec(r,i)}var QA=oi(function(r,i,o){return i=i.toLowerCase(),r+(o?kp(i):i)});function kp(r){return kc(De(r).toLowerCase())}function Cp(r){return r=De(r),r&&r.replace(X1,Hb).replace(_b,"")}function ZA(r,i,o){r=De(r),i=It(i);var f=r.length;o=o===n?f:xn(me(o),0,f);var d=o;return o-=i.length,o>=0&&r.slice(o,d)==i}function XA(r){return r=De(r),r&&M1.test(r)?r.replace(sh,Yb):r}function eO(r){return r=De(r),r&&F1.test(r)?r.replace(vu,"\\$&"):r}var tO=oi(function(r,i,o){return r+(o?"-":"")+i.toLowerCase()}),rO=oi(function(r,i,o){return r+(o?" ":"")+i.toLowerCase()}),nO=Rd("toLowerCase");function iO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;if(!i||f>=i)return r;var d=(i-f)/2;return Pa(ya(d),o)+r+Pa(ga(d),o)}function sO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?r+Pa(i-f,o):r}function aO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?Pa(i-f,o)+r:r}function oO(r,i,o){return o||i==null?i=0:i&&(i=+i),pS(De(r).replace(Tu,""),i||0)}function uO(r,i,o){return(o?vt(r,i,o):i===n)?i=1:i=me(i),tc(De(r),i)}function cO(){var r=arguments,i=De(r[0]);return r.length<3?i:i.replace(r[1],r[2])}var lO=oi(function(r,i,o){return r+(o?"_":"")+i.toLowerCase()});function fO(r,i,o){return o&&typeof o!="number"&&vt(r,i,o)&&(i=o=n),o=o===n?J:o>>>0,o?(r=De(r),r&&(typeof i=="string"||i!=null&&!Ec(i))&&(i=It(i),!i&&Xn(r))?fn(fr(r),0,o):r.split(i,o)):[]}var hO=oi(function(r,i,o){return r+(o?" ":"")+kc(i)});function dO(r,i,o){return r=De(r),o=o==null?0:xn(me(o),0,r.length),i=It(i),r.slice(o,o+i.length)==i}function pO(r,i,o){var f=p.templateSettings;o&&vt(r,i,o)&&(i=n),r=De(r),i=Ya({},i,f,Id);var d=Ya({},i.imports,f.imports,Id),g=ot(d),w=Iu(d,g),v,x,H=0,K=i.interpolate||ta,G="__p += '",j=Wu((i.escape||ta).source+"|"+K.source+"|"+(K===ah?V1:ta).source+"|"+(i.evaluate||ta).source+"|$","g"),re="//# sourceURL="+(Me.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tb+"]")+`
16
+ `)}function Wv(r){return fe(r)||Mn(r)||!!(zh&&r&&r[zh])}function Gr(r,i){var o=typeof r;return i=i??D,!!i&&(o=="number"||o!="symbol"&&Z1.test(r))&&r>-1&&r%1==0&&r<i}function vt(r,i,o){if(!je(o))return!1;var f=typeof i;return(f=="number"?Rt(o)&&Gr(i,o.length):f=="string"&&i in o)?dr(o[i],r):!1}function gc(r,i){if(fe(r))return!1;var o=typeof r;return o=="number"||o=="symbol"||o=="boolean"||r==null||Ft(r)?!0:B1.test(r)||!U1.test(r)||i!=null&&r in Ie(i)}function Hv(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function yc(r){var i=Da(r),o=p[i];if(typeof o!="function"||!(i in Se.prototype))return!1;if(r===o)return!0;var f=dc(o);return!!f&&r===f[0]}function Yv(r){return!!qh&&qh in r}var Kv=ua?Vr:Lc;function rs(r){var i=r&&r.constructor,o=typeof i=="function"&&i.prototype||ri;return r===o}function qd(r){return r===r&&!je(r)}function $d(r,i){return function(o){return o==null?!1:o[r]===i&&(i!==n||r in Ie(o))}}function qv(r){var i=Ia(r,function(f){return o.size===m&&o.clear(),f}),o=i.cache;return i}function $v(r,i){var o=r[1],f=i[1],d=o|f,g=d<(F|ne|Pe),w=f==Pe&&o==Ae||f==Pe&&o==y&&r[7].length<=i[8]||f==(Pe|y)&&i[7].length<=i[8]&&o==Ae;if(!(g||w))return r;f&F&&(r[2]=i[2],d|=o&F?0:Y);var v=i[3];if(v){var x=r[3];r[3]=x?kd(x,v,i[4]):v,r[4]=x?an(r[3],b):i[4]}return v=i[5],v&&(x=r[5],r[5]=x?Cd(x,v,i[6]):v,r[6]=x?an(r[5],b):i[6]),v=i[7],v&&(r[7]=v),f&Pe&&(r[8]=r[8]==null?i[8]:mt(r[8],i[8])),r[9]==null&&(r[9]=i[9]),r[0]=i[0],r[1]=d,r}function Gv(r){var i=[];if(r!=null)for(var o in Ie(r))i.push(o);return i}function Vv(r){return la.call(r)}function Gd(r,i,o){return i=it(i===n?r.length-1:i,0),function(){for(var f=arguments,d=-1,g=it(f.length-i,0),w=B(g);++d<g;)w[d]=f[i+d];d=-1;for(var v=B(i+1);++d<i;)v[d]=f[d];return v[i]=o(w),Ut(r,this,v)}}function Vd(r,i){return i.length<2?r:Pn(r,tr(i,0,-1))}function zv(r,i){for(var o=r.length,f=mt(i.length,o),d=Pt(r);f--;){var g=i[f];r[f]=Gr(g,o)?d[g]:n}return r}function _c(r,i){if(!(i==="constructor"&&typeof r[i]=="function")&&i!="__proto__")return r[i]}var zd=Jd(yd),ns=cS||function(r,i){return ft.setTimeout(r,i)},wc=Jd(yv);function jd(r,i,o){var f=i+"";return wc(r,Fv(f,jv(Uv(f),o)))}function Jd(r){var i=0,o=0;return function(){var f=dS(),d=R-(f-o);if(o=f,d>0){if(++i>=k)return arguments[0]}else i=0;return r.apply(n,arguments)}}function La(r,i){var o=-1,f=r.length,d=f-1;for(i=i===n?f:i;++o<i;){var g=tc(o,d),w=r[g];r[g]=r[o],r[o]=w}return r.length=i,r}var Qd=qv(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(I1,function(o,f,d,g){i.push(d?g.replace(G1,"$1"):f||o)}),i});function kr(r){if(typeof r=="string"||Ft(r))return r;var i=r+"";return i=="0"&&1/r==-L?"-0":i}function Dn(r){if(r!=null){try{return ca.call(r)}catch{}try{return r+""}catch{}}return""}function jv(r,i){return Qt(We,function(o){var f="_."+o[0];i&o[1]&&!ia(r,f)&&r.push(f)}),r.sort()}function Zd(r){if(r instanceof Se)return r.clone();var i=new Xt(r.__wrapped__,r.__chain__);return i.__actions__=Pt(r.__actions__),i.__index__=r.__index__,i.__values__=r.__values__,i}function Jv(r,i,o){(o?vt(r,i,o):i===n)?i=1:i=it(me(i),0);var f=r==null?0:r.length;if(!f||i<1)return[];for(var d=0,g=0,w=B(ga(f/i));d<f;)w[g++]=tr(r,d,d+=i);return w}function Qv(r){for(var i=-1,o=r==null?0:r.length,f=0,d=[];++i<o;){var g=r[i];g&&(d[f++]=g)}return d}function Zv(){var r=arguments.length;if(!r)return[];for(var i=B(r-1),o=arguments[0],f=r;f--;)i[f-1]=arguments[f];return sn(fe(o)?Pt(o):[o],ht(i,1))}var Xv=ye(function(r,i){return et(r)?Qi(r,ht(i,1,et,!0)):[]}),eT=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Qi(r,ht(i,1,et,!0),se(o,2)):[]}),tT=ye(function(r,i){var o=rr(i);return et(o)&&(o=n),et(r)?Qi(r,ht(i,1,et,!0),n,o):[]});function rT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),tr(r,i<0?0:i,f)):[]}function nT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),i=f-i,tr(r,0,i<0?0:i)):[]}function iT(r,i){return r&&r.length?Oa(r,se(i,3),!0,!0):[]}function sT(r,i){return r&&r.length?Oa(r,se(i,3),!0):[]}function aT(r,i,o,f){var d=r==null?0:r.length;return d?(o&&typeof o!="number"&&vt(r,i,o)&&(o=0,f=d),ZS(r,i,o,f)):[]}function Xd(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),sa(r,se(i,3),d)}function ep(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f-1;return o!==n&&(d=me(o),d=o<0?it(f+d,0):mt(d,f-1)),sa(r,se(i,3),d,!0)}function tp(r){var i=r==null?0:r.length;return i?ht(r,1):[]}function oT(r){var i=r==null?0:r.length;return i?ht(r,L):[]}function uT(r,i){var o=r==null?0:r.length;return o?(i=i===n?1:me(i),ht(r,i)):[]}function cT(r){for(var i=-1,o=r==null?0:r.length,f={};++i<o;){var d=r[i];f[d[0]]=d[1]}return f}function rp(r){return r&&r.length?r[0]:n}function lT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=o==null?0:me(o);return d<0&&(d=it(f+d,0)),Zn(r,i,d)}function fT(r){var i=r==null?0:r.length;return i?tr(r,0,-1):[]}var hT=ye(function(r){var i=Ve(r,ac);return i.length&&i[0]===r[0]?Ju(i):[]}),dT=ye(function(r){var i=rr(r),o=Ve(r,ac);return i===rr(o)?i=n:o.pop(),o.length&&o[0]===r[0]?Ju(o,se(i,2)):[]}),pT=ye(function(r){var i=rr(r),o=Ve(r,ac);return i=typeof i=="function"?i:n,i&&o.pop(),o.length&&o[0]===r[0]?Ju(o,n,i):[]});function mT(r,i){return r==null?"":fS.call(r,i)}function rr(r){var i=r==null?0:r.length;return i?r[i-1]:n}function gT(r,i,o){var f=r==null?0:r.length;if(!f)return-1;var d=f;return o!==n&&(d=me(o),d=d<0?it(f+d,0):mt(d,f-1)),i===i?jb(r,i,d):sa(r,Uh,d,!0)}function yT(r,i){return r&&r.length?dd(r,me(i)):n}var _T=ye(np);function np(r,i){return r&&r.length&&i&&i.length?ec(r,i):r}function wT(r,i,o){return r&&r.length&&i&&i.length?ec(r,i,se(o,2)):r}function bT(r,i,o){return r&&r.length&&i&&i.length?ec(r,i,n,o):r}var ST=$r(function(r,i){var o=r==null?0:r.length,f=Gu(r,i);return gd(r,Ve(i,function(d){return Gr(d,o)?+d:d}).sort(Od)),f});function vT(r,i){var o=[];if(!(r&&r.length))return o;var f=-1,d=[],g=r.length;for(i=se(i,3);++f<g;){var w=r[f];i(w,f,r)&&(o.push(w),d.push(f))}return gd(r,d),o}function bc(r){return r==null?r:mS.call(r)}function TT(r,i,o){var f=r==null?0:r.length;return f?(o&&typeof o!="number"&&vt(r,i,o)?(i=0,o=f):(i=i==null?0:me(i),o=o===n?f:me(o)),tr(r,i,o)):[]}function ET(r,i){return Aa(r,i)}function AT(r,i,o){return nc(r,i,se(o,2))}function OT(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i);if(f<o&&dr(r[f],i))return f}return-1}function kT(r,i){return Aa(r,i,!0)}function CT(r,i,o){return nc(r,i,se(o,2),!0)}function xT(r,i){var o=r==null?0:r.length;if(o){var f=Aa(r,i,!0)-1;if(dr(r[f],i))return f}return-1}function PT(r){return r&&r.length?_d(r):[]}function RT(r,i){return r&&r.length?_d(r,se(i,2)):[]}function DT(r){var i=r==null?0:r.length;return i?tr(r,1,i):[]}function MT(r,i,o){return r&&r.length?(i=o||i===n?1:me(i),tr(r,0,i<0?0:i)):[]}function LT(r,i,o){var f=r==null?0:r.length;return f?(i=o||i===n?1:me(i),i=f-i,tr(r,i<0?0:i,f)):[]}function NT(r,i){return r&&r.length?Oa(r,se(i,3),!1,!0):[]}function UT(r,i){return r&&r.length?Oa(r,se(i,3)):[]}var BT=ye(function(r){return cn(ht(r,1,et,!0))}),IT=ye(function(r){var i=rr(r);return et(i)&&(i=n),cn(ht(r,1,et,!0),se(i,2))}),FT=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,cn(ht(r,1,et,!0),n,i)});function WT(r){return r&&r.length?cn(r):[]}function HT(r,i){return r&&r.length?cn(r,se(i,2)):[]}function YT(r,i){return i=typeof i=="function"?i:n,r&&r.length?cn(r,n,i):[]}function Sc(r){if(!(r&&r.length))return[];var i=0;return r=nn(r,function(o){if(et(o))return i=it(o.length,i),!0}),Iu(i,function(o){return Ve(r,Nu(o))})}function ip(r,i){if(!(r&&r.length))return[];var o=Sc(r);return i==null?o:Ve(o,function(f){return Ut(i,n,f)})}var KT=ye(function(r,i){return et(r)?Qi(r,i):[]}),qT=ye(function(r){return sc(nn(r,et))}),$T=ye(function(r){var i=rr(r);return et(i)&&(i=n),sc(nn(r,et),se(i,2))}),GT=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,sc(nn(r,et),n,i)}),VT=ye(Sc);function zT(r,i){return vd(r||[],i||[],Ji)}function jT(r,i){return vd(r||[],i||[],es)}var JT=ye(function(r){var i=r.length,o=i>1?r[i-1]:n;return o=typeof o=="function"?(r.pop(),o):n,ip(r,o)});function sp(r){var i=p(r);return i.__chain__=!0,i}function QT(r,i){return i(r),r}function Na(r,i){return i(r)}var ZT=$r(function(r){var i=r.length,o=i?r[0]:0,f=this.__wrapped__,d=function(g){return Gu(g,r)};return i>1||this.__actions__.length||!(f instanceof Se)||!Gr(o)?this.thru(d):(f=f.slice(o,+o+(i?1:0)),f.__actions__.push({func:Na,args:[d],thisArg:n}),new Xt(f,this.__chain__).thru(function(g){return i&&!g.length&&g.push(n),g}))});function XT(){return sp(this)}function eE(){return new Xt(this.value(),this.__chain__)}function tE(){this.__values__===n&&(this.__values__=wp(this.value()));var r=this.__index__>=this.__values__.length,i=r?n:this.__values__[this.__index__++];return{done:r,value:i}}function rE(){return this}function nE(r){for(var i,o=this;o instanceof ba;){var f=Zd(o);f.__index__=0,f.__values__=n,i?d.__wrapped__=f:i=f;var d=f;o=o.__wrapped__}return d.__wrapped__=r,i}function iE(){var r=this.__wrapped__;if(r instanceof Se){var i=r;return this.__actions__.length&&(i=new Se(this)),i=i.reverse(),i.__actions__.push({func:Na,args:[bc],thisArg:n}),new Xt(i,this.__chain__)}return this.thru(bc)}function sE(){return Sd(this.__wrapped__,this.__actions__)}var aE=ka(function(r,i,o){Me.call(r,o)?++r[o]:Kr(r,o,1)});function oE(r,i,o){var f=fe(r)?Lh:QS;return o&&vt(r,i,o)&&(i=n),f(r,se(i,3))}function uE(r,i){var o=fe(r)?nn:id;return o(r,se(i,3))}var cE=Dd(Xd),lE=Dd(ep);function fE(r,i){return ht(Ua(r,i),1)}function hE(r,i){return ht(Ua(r,i),L)}function dE(r,i,o){return o=o===n?1:me(o),ht(Ua(r,i),o)}function ap(r,i){var o=fe(r)?Qt:un;return o(r,se(i,3))}function op(r,i){var o=fe(r)?Db:nd;return o(r,se(i,3))}var pE=ka(function(r,i,o){Me.call(r,o)?r[o].push(i):Kr(r,o,[i])});function mE(r,i,o,f){r=Rt(r)?r:li(r),o=o&&!f?me(o):0;var d=r.length;return o<0&&(o=it(d+o,0)),Ha(r)?o<=d&&r.indexOf(i,o)>-1:!!d&&Zn(r,i,o)>-1}var gE=ye(function(r,i,o){var f=-1,d=typeof i=="function",g=Rt(r)?B(r.length):[];return un(r,function(w){g[++f]=d?Ut(i,w,o):Zi(w,i,o)}),g}),yE=ka(function(r,i,o){Kr(r,o,i)});function Ua(r,i){var o=fe(r)?Ve:ld;return o(r,se(i,3))}function _E(r,i,o,f){return r==null?[]:(fe(i)||(i=i==null?[]:[i]),o=f?n:o,fe(o)||(o=o==null?[]:[o]),pd(r,i,o))}var wE=ka(function(r,i,o){r[o?0:1].push(i)},function(){return[[],[]]});function bE(r,i,o){var f=fe(r)?Mu:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,un)}function SE(r,i,o){var f=fe(r)?Mb:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,nd)}function vE(r,i){var o=fe(r)?nn:id;return o(r,Fa(se(i,3)))}function TE(r){var i=fe(r)?Xh:mv;return i(r)}function EE(r,i,o){(o?vt(r,i,o):i===n)?i=1:i=me(i);var f=fe(r)?GS:gv;return f(r,i)}function AE(r){var i=fe(r)?VS:_v;return i(r)}function OE(r){if(r==null)return 0;if(Rt(r))return Ha(r)?ei(r):r.length;var i=gt(r);return i==Be||i==lr?r.size:Zu(r).length}function kE(r,i,o){var f=fe(r)?Lu:wv;return o&&vt(r,i,o)&&(i=n),f(r,se(i,3))}var CE=ye(function(r,i){if(r==null)return[];var o=i.length;return o>1&&vt(r,i[0],i[1])?i=[]:o>2&&vt(i[0],i[1],i[2])&&(i=[i[0]]),pd(r,ht(i,1),[])}),Ba=uS||function(){return ft.Date.now()};function xE(r,i){if(typeof i!="function")throw new Zt(u);return r=me(r),function(){if(--r<1)return i.apply(this,arguments)}}function up(r,i,o){return i=o?n:i,i=r&&i==null?r.length:i,qr(r,Pe,n,n,n,n,i)}function cp(r,i){var o;if(typeof i!="function")throw new Zt(u);return r=me(r),function(){return--r>0&&(o=i.apply(this,arguments)),r<=1&&(i=n),o}}var vc=ye(function(r,i,o){var f=F;if(o.length){var d=an(o,ui(vc));f|=_e}return qr(r,f,i,o,d)}),lp=ye(function(r,i,o){var f=F|ne;if(o.length){var d=an(o,ui(lp));f|=_e}return qr(i,f,r,o,d)});function fp(r,i,o){i=o?n:i;var f=qr(r,Ae,n,n,n,n,n,i);return f.placeholder=fp.placeholder,f}function hp(r,i,o){i=o?n:i;var f=qr(r,ve,n,n,n,n,n,i);return f.placeholder=hp.placeholder,f}function dp(r,i,o){var f,d,g,w,v,x,H=0,K=!1,G=!1,j=!0;if(typeof r!="function")throw new Zt(u);i=nr(i)||0,je(o)&&(K=!!o.leading,G="maxWait"in o,g=G?it(nr(o.maxWait)||0,i):g,j="trailing"in o?!!o.trailing:j);function re(tt){var pr=f,jr=d;return f=d=n,H=tt,w=r.apply(jr,pr),w}function ae(tt){return H=tt,v=ns(we,i),K?re(tt):w}function ge(tt){var pr=tt-x,jr=tt-H,Dp=i-pr;return G?mt(Dp,g-jr):Dp}function oe(tt){var pr=tt-x,jr=tt-H;return x===n||pr>=i||pr<0||G&&jr>=g}function we(){var tt=Ba();if(oe(tt))return Te(tt);v=ns(we,ge(tt))}function Te(tt){return v=n,j&&f?re(tt):(f=d=n,w)}function Wt(){v!==n&&Td(v),H=0,f=x=d=v=n}function Tt(){return v===n?w:Te(Ba())}function Ht(){var tt=Ba(),pr=oe(tt);if(f=arguments,d=this,x=tt,pr){if(v===n)return ae(x);if(G)return Td(v),v=ns(we,i),re(x)}return v===n&&(v=ns(we,i)),w}return Ht.cancel=Wt,Ht.flush=Tt,Ht}var PE=ye(function(r,i){return rd(r,1,i)}),RE=ye(function(r,i,o){return rd(r,nr(i)||0,o)});function DE(r){return qr(r,_)}function Ia(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new Zt(u);var o=function(){var f=arguments,d=i?i.apply(this,f):f[0],g=o.cache;if(g.has(d))return g.get(d);var w=r.apply(this,f);return o.cache=g.set(d,w)||g,w};return o.cache=new(Ia.Cache||Yr),o}Ia.Cache=Yr;function Fa(r){if(typeof r!="function")throw new Zt(u);return function(){var i=arguments;switch(i.length){case 0:return!r.call(this);case 1:return!r.call(this,i[0]);case 2:return!r.call(this,i[0],i[1]);case 3:return!r.call(this,i[0],i[1],i[2])}return!r.apply(this,i)}}function ME(r){return cp(2,r)}var LE=bv(function(r,i){i=i.length==1&&fe(i[0])?Ve(i[0],Bt(se())):Ve(ht(i,1),Bt(se()));var o=i.length;return ye(function(f){for(var d=-1,g=mt(f.length,o);++d<g;)f[d]=i[d].call(this,f[d]);return Ut(r,this,f)})}),Tc=ye(function(r,i){var o=an(i,ui(Tc));return qr(r,_e,n,i,o)}),pp=ye(function(r,i){var o=an(i,ui(pp));return qr(r,Fe,n,i,o)}),NE=$r(function(r,i){return qr(r,y,n,n,n,i)});function UE(r,i){if(typeof r!="function")throw new Zt(u);return i=i===n?i:me(i),ye(r,i)}function BE(r,i){if(typeof r!="function")throw new Zt(u);return i=i==null?0:it(me(i),0),ye(function(o){var f=o[i],d=fn(o,0,i);return f&&sn(d,f),Ut(r,this,d)})}function IE(r,i,o){var f=!0,d=!0;if(typeof r!="function")throw new Zt(u);return je(o)&&(f="leading"in o?!!o.leading:f,d="trailing"in o?!!o.trailing:d),dp(r,i,{leading:f,maxWait:i,trailing:d})}function FE(r){return up(r,1)}function WE(r,i){return Tc(oc(i),r)}function HE(){if(!arguments.length)return[];var r=arguments[0];return fe(r)?r:[r]}function YE(r){return er(r,$)}function KE(r,i){return i=typeof i=="function"?i:n,er(r,$,i)}function qE(r){return er(r,T|$)}function $E(r,i){return i=typeof i=="function"?i:n,er(r,T|$,i)}function GE(r,i){return i==null||td(r,i,ot(i))}function dr(r,i){return r===i||r!==r&&i!==i}var VE=Ra(ju),zE=Ra(function(r,i){return r>=i}),Mn=od((function(){return arguments})())?od:function(r){return Je(r)&&Me.call(r,"callee")&&!Vh.call(r,"callee")},fe=B.isArray,jE=Ch?Bt(Ch):nv;function Rt(r){return r!=null&&Wa(r.length)&&!Vr(r)}function et(r){return Je(r)&&Rt(r)}function JE(r){return r===!0||r===!1||Je(r)&&St(r)==Tr}var hn=lS||Lc,QE=xh?Bt(xh):iv;function ZE(r){return Je(r)&&r.nodeType===1&&!is(r)}function XE(r){if(r==null)return!0;if(Rt(r)&&(fe(r)||typeof r=="string"||typeof r.splice=="function"||hn(r)||ci(r)||Mn(r)))return!r.length;var i=gt(r);if(i==Be||i==lr)return!r.size;if(rs(r))return!Zu(r).length;for(var o in r)if(Me.call(r,o))return!1;return!0}function eA(r,i){return Xi(r,i)}function tA(r,i,o){o=typeof o=="function"?o:n;var f=o?o(r,i):n;return f===n?Xi(r,i,n,o):!!f}function Ec(r){if(!Je(r))return!1;var i=St(r);return i==wt||i==Fi||typeof r.message=="string"&&typeof r.name=="string"&&!is(r)}function rA(r){return typeof r=="number"&&jh(r)}function Vr(r){if(!je(r))return!1;var i=St(r);return i==Er||i==bt||i==at||i==O1}function mp(r){return typeof r=="number"&&r==me(r)}function Wa(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=D}function je(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}function Je(r){return r!=null&&typeof r=="object"}var gp=Ph?Bt(Ph):av;function nA(r,i){return r===i||Qu(r,i,pc(i))}function iA(r,i,o){return o=typeof o=="function"?o:n,Qu(r,i,pc(i),o)}function sA(r){return yp(r)&&r!=+r}function aA(r){if(Kv(r))throw new ue(c);return ud(r)}function oA(r){return r===null}function uA(r){return r==null}function yp(r){return typeof r=="number"||Je(r)&&St(r)==Ue}function is(r){if(!Je(r)||St(r)!=Wr)return!1;var i=da(r);if(i===null)return!0;var o=Me.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&ca.call(o)==iS}var Ac=Rh?Bt(Rh):ov;function cA(r){return mp(r)&&r>=-D&&r<=D}var _p=Dh?Bt(Dh):uv;function Ha(r){return typeof r=="string"||!fe(r)&&Je(r)&&St(r)==Hi}function Ft(r){return typeof r=="symbol"||Je(r)&&St(r)==ea}var ci=Mh?Bt(Mh):cv;function lA(r){return r===n}function fA(r){return Je(r)&&gt(r)==Yi}function hA(r){return Je(r)&&St(r)==C1}var dA=Ra(Xu),pA=Ra(function(r,i){return r<=i});function wp(r){if(!r)return[];if(Rt(r))return Ha(r)?fr(r):Pt(r);if($i&&r[$i])return Gb(r[$i]());var i=gt(r),o=i==Be?Wu:i==lr?aa:li;return o(r)}function zr(r){if(!r)return r===0?r:0;if(r=nr(r),r===L||r===-L){var i=r<0?-1:1;return i*q}return r===r?r:0}function me(r){var i=zr(r),o=i%1;return i===i?o?i-o:i:0}function bp(r){return r?xn(me(r),0,J):0}function nr(r){if(typeof r=="number")return r;if(Ft(r))return te;if(je(r)){var i=typeof r.valueOf=="function"?r.valueOf():r;r=je(i)?i+"":i}if(typeof r!="string")return r===0?r:+r;r=Fh(r);var o=j1.test(r);return o||Q1.test(r)?xb(r.slice(2),o?2:8):z1.test(r)?te:+r}function Sp(r){return Or(r,Dt(r))}function mA(r){return r?xn(me(r),-D,D):r===0?r:0}function De(r){return r==null?"":It(r)}var gA=ai(function(r,i){if(rs(i)||Rt(i)){Or(i,ot(i),r);return}for(var o in i)Me.call(i,o)&&Ji(r,o,i[o])}),vp=ai(function(r,i){Or(i,Dt(i),r)}),Ya=ai(function(r,i,o,f){Or(i,Dt(i),r,f)}),yA=ai(function(r,i,o,f){Or(i,ot(i),r,f)}),_A=$r(Gu);function wA(r,i){var o=si(r);return i==null?o:ed(o,i)}var bA=ye(function(r,i){r=Ie(r);var o=-1,f=i.length,d=f>2?i[2]:n;for(d&&vt(i[0],i[1],d)&&(f=1);++o<f;)for(var g=i[o],w=Dt(g),v=-1,x=w.length;++v<x;){var H=w[v],K=r[H];(K===n||dr(K,ri[H])&&!Me.call(r,H))&&(r[H]=g[H])}return r}),SA=ye(function(r){return r.push(n,Fd),Ut(Tp,n,r)});function vA(r,i){return Nh(r,se(i,3),Ar)}function TA(r,i){return Nh(r,se(i,3),zu)}function EA(r,i){return r==null?r:Vu(r,se(i,3),Dt)}function AA(r,i){return r==null?r:sd(r,se(i,3),Dt)}function OA(r,i){return r&&Ar(r,se(i,3))}function kA(r,i){return r&&zu(r,se(i,3))}function CA(r){return r==null?[]:Ta(r,ot(r))}function xA(r){return r==null?[]:Ta(r,Dt(r))}function Oc(r,i,o){var f=r==null?n:Pn(r,i);return f===n?o:f}function PA(r,i){return r!=null&&Yd(r,i,XS)}function kc(r,i){return r!=null&&Yd(r,i,ev)}var RA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),r[i]=o},xc(Mt)),DA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=la.call(i)),Me.call(r,i)?r[i].push(o):r[i]=[o]},se),MA=ye(Zi);function ot(r){return Rt(r)?Zh(r):Zu(r)}function Dt(r){return Rt(r)?Zh(r,!0):lv(r)}function LA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,i(f,d,g),f)}),o}function NA(r,i){var o={};return i=se(i,3),Ar(r,function(f,d,g){Kr(o,d,i(f,d,g))}),o}var UA=ai(function(r,i,o){Ea(r,i,o)}),Tp=ai(function(r,i,o,f){Ea(r,i,o,f)}),BA=$r(function(r,i){var o={};if(r==null)return o;var f=!1;i=Ve(i,function(g){return g=ln(g,r),f||(f=g.length>1),g}),Or(r,hc(r),o),f&&(o=er(o,T|P|$,Rv));for(var d=i.length;d--;)ic(o,i[d]);return o});function IA(r,i){return Ep(r,Fa(se(i)))}var FA=$r(function(r,i){return r==null?{}:hv(r,i)});function Ep(r,i){if(r==null)return{};var o=Ve(hc(r),function(f){return[f]});return i=se(i),md(r,o,function(f,d){return i(f,d[0])})}function WA(r,i,o){i=ln(i,r);var f=-1,d=i.length;for(d||(d=1,r=n);++f<d;){var g=r==null?n:r[kr(i[f])];g===n&&(f=d,g=o),r=Vr(g)?g.call(r):g}return r}function HA(r,i,o){return r==null?r:es(r,i,o)}function YA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:es(r,i,o,f)}var Ap=Bd(ot),Op=Bd(Dt);function KA(r,i,o){var f=fe(r),d=f||hn(r)||ci(r);if(i=se(i,4),o==null){var g=r&&r.constructor;d?o=f?new g:[]:je(r)?o=Vr(g)?si(da(r)):{}:o={}}return(d?Qt:Ar)(r,function(w,v,x){return i(o,w,v,x)}),o}function qA(r,i){return r==null?!0:ic(r,i)}function $A(r,i,o){return r==null?r:bd(r,i,oc(o))}function GA(r,i,o,f){return f=typeof f=="function"?f:n,r==null?r:bd(r,i,oc(o),f)}function li(r){return r==null?[]:Fu(r,ot(r))}function VA(r){return r==null?[]:Fu(r,Dt(r))}function zA(r,i,o){return o===n&&(o=i,i=n),o!==n&&(o=nr(o),o=o===o?o:0),i!==n&&(i=nr(i),i=i===i?i:0),xn(nr(r),i,o)}function jA(r,i,o){return i=zr(i),o===n?(o=i,i=0):o=zr(o),r=nr(r),tv(r,i,o)}function JA(r,i,o){if(o&&typeof o!="boolean"&&vt(r,i,o)&&(i=o=n),o===n&&(typeof i=="boolean"?(o=i,i=n):typeof r=="boolean"&&(o=r,r=n)),r===n&&i===n?(r=0,i=1):(r=zr(r),i===n?(i=r,r=0):i=zr(i)),r>i){var f=r;r=i,i=f}if(o||r%1||i%1){var d=Jh();return mt(r+d*(i-r+Cb("1e-"+((d+"").length-1))),i)}return tc(r,i)}var QA=oi(function(r,i,o){return i=i.toLowerCase(),r+(o?kp(i):i)});function kp(r){return Cc(De(r).toLowerCase())}function Cp(r){return r=De(r),r&&r.replace(X1,Hb).replace(_b,"")}function ZA(r,i,o){r=De(r),i=It(i);var f=r.length;o=o===n?f:xn(me(o),0,f);var d=o;return o-=i.length,o>=0&&r.slice(o,d)==i}function XA(r){return r=De(r),r&&M1.test(r)?r.replace(sh,Yb):r}function eO(r){return r=De(r),r&&F1.test(r)?r.replace(Tu,"\\$&"):r}var tO=oi(function(r,i,o){return r+(o?"-":"")+i.toLowerCase()}),rO=oi(function(r,i,o){return r+(o?" ":"")+i.toLowerCase()}),nO=Rd("toLowerCase");function iO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;if(!i||f>=i)return r;var d=(i-f)/2;return Pa(ya(d),o)+r+Pa(ga(d),o)}function sO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?r+Pa(i-f,o):r}function aO(r,i,o){r=De(r),i=me(i);var f=i?ei(r):0;return i&&f<i?Pa(i-f,o)+r:r}function oO(r,i,o){return o||i==null?i=0:i&&(i=+i),pS(De(r).replace(Eu,""),i||0)}function uO(r,i,o){return(o?vt(r,i,o):i===n)?i=1:i=me(i),rc(De(r),i)}function cO(){var r=arguments,i=De(r[0]);return r.length<3?i:i.replace(r[1],r[2])}var lO=oi(function(r,i,o){return r+(o?"_":"")+i.toLowerCase()});function fO(r,i,o){return o&&typeof o!="number"&&vt(r,i,o)&&(i=o=n),o=o===n?J:o>>>0,o?(r=De(r),r&&(typeof i=="string"||i!=null&&!Ac(i))&&(i=It(i),!i&&Xn(r))?fn(fr(r),0,o):r.split(i,o)):[]}var hO=oi(function(r,i,o){return r+(o?" ":"")+Cc(i)});function dO(r,i,o){return r=De(r),o=o==null?0:xn(me(o),0,r.length),i=It(i),r.slice(o,o+i.length)==i}function pO(r,i,o){var f=p.templateSettings;o&&vt(r,i,o)&&(i=n),r=De(r),i=Ya({},i,f,Id);var d=Ya({},i.imports,f.imports,Id),g=ot(d),w=Fu(d,g),v,x,H=0,K=i.interpolate||ta,G="__p += '",j=Hu((i.escape||ta).source+"|"+K.source+"|"+(K===ah?V1:ta).source+"|"+(i.evaluate||ta).source+"|$","g"),re="//# sourceURL="+(Me.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tb+"]")+`
17
17
  `;r.replace(j,function(oe,we,Te,Wt,Tt,Ht){return Te||(Te=Wt),G+=r.slice(H,Ht).replace(eb,Kb),we&&(v=!0,G+=`' +
18
18
  __e(`+we+`) +
19
19
  '`),Tt&&(x=!0,G+=`';
@@ -30,23 +30,23 @@ __p += '`),Te&&(G+=`' +
30
30
  function print() { __p += __j.call(arguments, '') }
31
31
  `:`;
32
32
  `)+G+`return __p
33
- }`;var ge=Pp(function(){return Re(g,re+"return "+G).apply(n,w)});if(ge.source=G,Tc(ge))throw ge;return ge}function mO(r){return De(r).toLowerCase()}function gO(r){return De(r).toUpperCase()}function yO(r,i,o){if(r=De(r),r&&(o||i===n))return Fh(r);if(!r||!(i=It(i)))return r;var f=fr(r),d=fr(i),g=Wh(f,d),w=Hh(f,d)+1;return fn(f,g,w).join("")}function _O(r,i,o){if(r=De(r),r&&(o||i===n))return r.slice(0,Kh(r)+1);if(!r||!(i=It(i)))return r;var f=fr(r),d=Hh(f,fr(i))+1;return fn(f,0,d).join("")}function wO(r,i,o){if(r=De(r),r&&(o||i===n))return r.replace(Tu,"");if(!r||!(i=It(i)))return r;var f=fr(r),d=Wh(f,fr(i));return fn(f,d).join("")}function bO(r,i){var o=S,f=M;if(je(i)){var d="separator"in i?i.separator:d;o="length"in i?me(i.length):o,f="omission"in i?It(i.omission):f}r=De(r);var g=r.length;if(Xn(r)){var w=fr(r);g=w.length}if(o>=g)return r;var v=o-ei(f);if(v<1)return f;var x=w?fn(w,0,v).join(""):r.slice(0,v);if(d===n)return x+f;if(w&&(v+=x.length-v),Ec(d)){if(r.slice(v).search(d)){var H,K=x;for(d.global||(d=Wu(d.source,De(oh.exec(d))+"g")),d.lastIndex=0;H=d.exec(K);)var G=H.index;x=x.slice(0,G===n?v:G)}}else if(r.indexOf(It(d),v)!=v){var j=x.lastIndexOf(d);j>-1&&(x=x.slice(0,j))}return x+f}function SO(r){return r=De(r),r&&D1.test(r)?r.replace(ih,Jb):r}var vO=oi(function(r,i,o){return r+(o?" ":"")+i.toUpperCase()}),kc=Rd("toUpperCase");function xp(r,i,o){return r=De(r),i=o?n:i,i===n?$b(r)?Xb(r):Ub(r):r.match(i)||[]}var Pp=ye(function(r,i){try{return Ut(r,n,i)}catch(o){return Tc(o)?o:new ue(o)}}),TO=$r(function(r,i){return Qt(i,function(o){o=kr(o),Kr(r,o,Sc(r[o],r))}),r});function EO(r){var i=r==null?0:r.length,o=se();return r=i?Ve(r,function(f){if(typeof f[1]!="function")throw new Zt(u);return[o(f[0]),f[1]]}):[],ye(function(f){for(var d=-1;++d<i;){var g=r[d];if(Ut(g[0],this,f))return Ut(g[1],this,f)}})}function AO(r){return JS(er(r,T))}function Cc(r){return function(){return r}}function OO(r,i){return r==null||r!==r?i:r}var kO=Md(),CO=Md(!0);function Mt(r){return r}function xc(r){return cd(typeof r=="function"?r:er(r,T))}function xO(r){return fd(er(r,T))}function PO(r,i){return hd(r,er(i,T))}var RO=ye(function(r,i){return function(o){return Qi(o,r,i)}}),DO=ye(function(r,i){return function(o){return Qi(r,o,i)}});function Pc(r,i,o){var f=ot(i),d=Ta(i,f);o==null&&!(je(i)&&(d.length||!f.length))&&(o=i,i=r,r=this,d=Ta(i,ot(i)));var g=!(je(o)&&"chain"in o)||!!o.chain,w=Vr(r);return Qt(d,function(v){var x=i[v];r[v]=x,w&&(r.prototype[v]=function(){var H=this.__chain__;if(g||H){var K=r(this.__wrapped__),G=K.__actions__=Pt(this.__actions__);return G.push({func:x,args:arguments,thisArg:r}),K.__chain__=H,K}return x.apply(r,sn([this.value()],arguments))})}),r}function MO(){return ft._===this&&(ft._=sS),this}function Rc(){}function LO(r){return r=me(r),ye(function(i){return dd(i,r)})}var NO=uc(Ve),UO=uc(Lh),BO=uc(Mu);function Rp(r){return mc(r)?Lu(kr(r)):dv(r)}function IO(r){return function(i){return r==null?n:Pn(r,i)}}var FO=Nd(),WO=Nd(!0);function Dc(){return[]}function Mc(){return!1}function HO(){return{}}function YO(){return""}function KO(){return!0}function qO(r,i){if(r=me(r),r<1||r>D)return[];var o=J,f=mt(r,J);i=se(i),r-=J;for(var d=Bu(f,i);++o<r;)i(o);return d}function $O(r){return fe(r)?Ve(r,kr):Ft(r)?[r]:Pt(Qd(De(r)))}function GO(r){var i=++nS;return De(r)+i}var VO=xa(function(r,i){return r+i},0),zO=cc("ceil"),jO=xa(function(r,i){return r/i},1),JO=cc("floor");function QO(r){return r&&r.length?va(r,Mt,zu):n}function ZO(r,i){return r&&r.length?va(r,se(i,2),zu):n}function XO(r){return Bh(r,Mt)}function ek(r,i){return Bh(r,se(i,2))}function tk(r){return r&&r.length?va(r,Mt,Zu):n}function rk(r,i){return r&&r.length?va(r,se(i,2),Zu):n}var nk=xa(function(r,i){return r*i},1),ik=cc("round"),sk=xa(function(r,i){return r-i},0);function ak(r){return r&&r.length?Uu(r,Mt):0}function ok(r,i){return r&&r.length?Uu(r,se(i,2)):0}return p.after=xE,p.ary=up,p.assign=gA,p.assignIn=vp,p.assignInWith=Ya,p.assignWith=yA,p.at=_A,p.before=cp,p.bind=Sc,p.bindAll=TO,p.bindKey=lp,p.castArray=HE,p.chain=sp,p.chunk=Jv,p.compact=Qv,p.concat=Zv,p.cond=EO,p.conforms=AO,p.constant=Cc,p.countBy=aE,p.create=wA,p.curry=fp,p.curryRight=hp,p.debounce=dp,p.defaults=bA,p.defaultsDeep=SA,p.defer=PE,p.delay=RE,p.difference=Xv,p.differenceBy=eT,p.differenceWith=tT,p.drop=rT,p.dropRight=nT,p.dropRightWhile=iT,p.dropWhile=sT,p.fill=aT,p.filter=uE,p.flatMap=fE,p.flatMapDeep=hE,p.flatMapDepth=dE,p.flatten=tp,p.flattenDeep=oT,p.flattenDepth=uT,p.flip=DE,p.flow=kO,p.flowRight=CO,p.fromPairs=cT,p.functions=CA,p.functionsIn=xA,p.groupBy=pE,p.initial=fT,p.intersection=hT,p.intersectionBy=dT,p.intersectionWith=pT,p.invert=RA,p.invertBy=DA,p.invokeMap=gE,p.iteratee=xc,p.keyBy=yE,p.keys=ot,p.keysIn=Dt,p.map=Ua,p.mapKeys=LA,p.mapValues=NA,p.matches=xO,p.matchesProperty=PO,p.memoize=Ia,p.merge=UA,p.mergeWith=Tp,p.method=RO,p.methodOf=DO,p.mixin=Pc,p.negate=Fa,p.nthArg=LO,p.omit=BA,p.omitBy=IA,p.once=ME,p.orderBy=_E,p.over=NO,p.overArgs=LE,p.overEvery=UO,p.overSome=BO,p.partial=vc,p.partialRight=pp,p.partition=wE,p.pick=FA,p.pickBy=Ep,p.property=Rp,p.propertyOf=IO,p.pull=_T,p.pullAll=np,p.pullAllBy=wT,p.pullAllWith=bT,p.pullAt=ST,p.range=FO,p.rangeRight=WO,p.rearg=NE,p.reject=vE,p.remove=vT,p.rest=UE,p.reverse=wc,p.sampleSize=EE,p.set=HA,p.setWith=YA,p.shuffle=AE,p.slice=TT,p.sortBy=CE,p.sortedUniq=PT,p.sortedUniqBy=RT,p.split=fO,p.spread=BE,p.tail=DT,p.take=MT,p.takeRight=LT,p.takeRightWhile=NT,p.takeWhile=UT,p.tap=QT,p.throttle=IE,p.thru=Na,p.toArray=wp,p.toPairs=Ap,p.toPairsIn=Op,p.toPath=$O,p.toPlainObject=Sp,p.transform=KA,p.unary=FE,p.union=BT,p.unionBy=IT,p.unionWith=FT,p.uniq=WT,p.uniqBy=HT,p.uniqWith=YT,p.unset=qA,p.unzip=bc,p.unzipWith=ip,p.update=$A,p.updateWith=GA,p.values=li,p.valuesIn=VA,p.without=KT,p.words=xp,p.wrap=WE,p.xor=qT,p.xorBy=$T,p.xorWith=GT,p.zip=VT,p.zipObject=zT,p.zipObjectDeep=jT,p.zipWith=JT,p.entries=Ap,p.entriesIn=Op,p.extend=vp,p.extendWith=Ya,Pc(p,p),p.add=VO,p.attempt=Pp,p.camelCase=QA,p.capitalize=kp,p.ceil=zO,p.clamp=zA,p.clone=YE,p.cloneDeep=qE,p.cloneDeepWith=$E,p.cloneWith=KE,p.conformsTo=GE,p.deburr=Cp,p.defaultTo=OO,p.divide=jO,p.endsWith=ZA,p.eq=dr,p.escape=XA,p.escapeRegExp=eO,p.every=oE,p.find=cE,p.findIndex=Xd,p.findKey=vA,p.findLast=lE,p.findLastIndex=ep,p.findLastKey=TA,p.floor=JO,p.forEach=ap,p.forEachRight=op,p.forIn=EA,p.forInRight=AA,p.forOwn=OA,p.forOwnRight=kA,p.get=Ac,p.gt=VE,p.gte=zE,p.has=PA,p.hasIn=Oc,p.head=rp,p.identity=Mt,p.includes=mE,p.indexOf=lT,p.inRange=jA,p.invoke=MA,p.isArguments=Mn,p.isArray=fe,p.isArrayBuffer=jE,p.isArrayLike=Rt,p.isArrayLikeObject=et,p.isBoolean=JE,p.isBuffer=hn,p.isDate=QE,p.isElement=ZE,p.isEmpty=XE,p.isEqual=eA,p.isEqualWith=tA,p.isError=Tc,p.isFinite=rA,p.isFunction=Vr,p.isInteger=mp,p.isLength=Wa,p.isMap=gp,p.isMatch=nA,p.isMatchWith=iA,p.isNaN=sA,p.isNative=aA,p.isNil=uA,p.isNull=oA,p.isNumber=yp,p.isObject=je,p.isObjectLike=Je,p.isPlainObject=ns,p.isRegExp=Ec,p.isSafeInteger=cA,p.isSet=_p,p.isString=Ha,p.isSymbol=Ft,p.isTypedArray=ci,p.isUndefined=lA,p.isWeakMap=fA,p.isWeakSet=hA,p.join=mT,p.kebabCase=tO,p.last=rr,p.lastIndexOf=gT,p.lowerCase=rO,p.lowerFirst=nO,p.lt=dA,p.lte=pA,p.max=QO,p.maxBy=ZO,p.mean=XO,p.meanBy=ek,p.min=tk,p.minBy=rk,p.stubArray=Dc,p.stubFalse=Mc,p.stubObject=HO,p.stubString=YO,p.stubTrue=KO,p.multiply=nk,p.nth=yT,p.noConflict=MO,p.noop=Rc,p.now=Ba,p.pad=iO,p.padEnd=sO,p.padStart=aO,p.parseInt=oO,p.random=JA,p.reduce=bE,p.reduceRight=SE,p.repeat=uO,p.replace=cO,p.result=WA,p.round=ik,p.runInContext=A,p.sample=TE,p.size=OE,p.snakeCase=lO,p.some=kE,p.sortedIndex=ET,p.sortedIndexBy=AT,p.sortedIndexOf=OT,p.sortedLastIndex=kT,p.sortedLastIndexBy=CT,p.sortedLastIndexOf=xT,p.startCase=hO,p.startsWith=dO,p.subtract=sk,p.sum=ak,p.sumBy=ok,p.template=pO,p.times=qO,p.toFinite=zr,p.toInteger=me,p.toLength=bp,p.toLower=mO,p.toNumber=nr,p.toSafeInteger=mA,p.toString=De,p.toUpper=gO,p.trim=yO,p.trimEnd=_O,p.trimStart=wO,p.truncate=bO,p.unescape=SO,p.uniqueId=GO,p.upperCase=vO,p.upperFirst=kc,p.each=ap,p.eachRight=op,p.first=rp,Pc(p,(function(){var r={};return Ar(p,function(i,o){Me.call(p.prototype,o)||(r[o]=i)}),r})(),{chain:!1}),p.VERSION=s,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){p[r].placeholder=p}),Qt(["drop","take"],function(r,i){Se.prototype[r]=function(o){o=o===n?1:it(me(o),0);var f=this.__filtered__&&!i?new Se(this):this.clone();return f.__filtered__?f.__takeCount__=mt(o,f.__takeCount__):f.__views__.push({size:mt(o,J),type:r+(f.__dir__<0?"Right":"")}),f},Se.prototype[r+"Right"]=function(o){return this.reverse()[r](o).reverse()}}),Qt(["filter","map","takeWhile"],function(r,i){var o=i+1,f=o==N||o==C;Se.prototype[r]=function(d){var g=this.clone();return g.__iteratees__.push({iteratee:se(d,3),type:o}),g.__filtered__=g.__filtered__||f,g}}),Qt(["head","last"],function(r,i){var o="take"+(i?"Right":"");Se.prototype[r]=function(){return this[o](1).value()[0]}}),Qt(["initial","tail"],function(r,i){var o="drop"+(i?"":"Right");Se.prototype[r]=function(){return this.__filtered__?new Se(this):this[o](1)}}),Se.prototype.compact=function(){return this.filter(Mt)},Se.prototype.find=function(r){return this.filter(r).head()},Se.prototype.findLast=function(r){return this.reverse().find(r)},Se.prototype.invokeMap=ye(function(r,i){return typeof r=="function"?new Se(this):this.map(function(o){return Qi(o,r,i)})}),Se.prototype.reject=function(r){return this.filter(Fa(se(r)))},Se.prototype.slice=function(r,i){r=me(r);var o=this;return o.__filtered__&&(r>0||i<0)?new Se(o):(r<0?o=o.takeRight(-r):r&&(o=o.drop(r)),i!==n&&(i=me(i),o=i<0?o.dropRight(-i):o.take(i-r)),o)},Se.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Se.prototype.toArray=function(){return this.take(J)},Ar(Se.prototype,function(r,i){var o=/^(?:filter|find|map|reject)|While$/.test(i),f=/^(?:head|last)$/.test(i),d=p[f?"take"+(i=="last"?"Right":""):i],g=f||/^find/.test(i);d&&(p.prototype[i]=function(){var w=this.__wrapped__,v=f?[1]:arguments,x=w instanceof Se,H=v[0],K=x||fe(w),G=function(we){var Te=d.apply(p,sn([we],v));return f&&j?Te[0]:Te};K&&o&&typeof H=="function"&&H.length!=1&&(x=K=!1);var j=this.__chain__,re=!!this.__actions__.length,ae=g&&!j,ge=x&&!re;if(!g&&K){w=ge?w:new Se(this);var oe=r.apply(w,v);return oe.__actions__.push({func:Na,args:[G],thisArg:n}),new Xt(oe,j)}return ae&&ge?r.apply(this,v):(oe=this.thru(G),ae?f?oe.value()[0]:oe.value():oe)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(r){var i=oa[r],o=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",f=/^(?:pop|shift)$/.test(r);p.prototype[r]=function(){var d=arguments;if(f&&!this.__chain__){var g=this.value();return i.apply(fe(g)?g:[],d)}return this[o](function(w){return i.apply(fe(w)?w:[],d)})}}),Ar(Se.prototype,function(r,i){var o=p[i];if(o){var f=o.name+"";Me.call(ii,f)||(ii[f]=[]),ii[f].push({name:i,func:o})}}),ii[Ca(n,ne).name]=[{name:"wrapper",func:n}],Se.prototype.clone=SS,Se.prototype.reverse=vS,Se.prototype.value=TS,p.prototype.at=ZT,p.prototype.chain=XT,p.prototype.commit=eE,p.prototype.next=tE,p.prototype.plant=nE,p.prototype.reverse=iE,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=sE,p.prototype.first=p.prototype.head,qi&&(p.prototype[qi]=rE),p}),ti=eS();An?((An.exports=ti)._=ti,xu._=ti):ft._=ti}).call(lg)})(wi,wi.exports)),wi.exports}var ro=fg();const ut=bl(ro);var hg=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,no=Math.ceil,Yt=Math.floor,Ot="[BigNumber Error] ",vl=Ot+"Number primitive has more than 15 significant digits: ",sr=1e14,ce=14,io=9007199254740991,so=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Jr=1e7,st=1e9;function Tl(t){var e,n,s,a=Y.prototype={constructor:Y,toString:null,valueOf:null},c=new Y(1),u=20,l=4,h=-7,m=21,b=-1e7,T=1e7,P=!1,$=1,O=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",ne=!0;function Y(y,_){var S,M,k,R,N,E,C,L,D=this;if(!(D instanceof Y))return new Y(y,_);if(_==null){if(y&&y._isBigNumber===!0){D.s=y.s,!y.c||y.e>T?D.c=D.e=null:y.e<b?D.c=[D.e=0]:(D.e=y.e,D.c=y.c.slice());return}if((E=typeof y=="number")&&y*0==0){if(D.s=1/y<0?(y=-y,-1):1,y===~~y){for(R=0,N=y;N>=10;N/=10,R++);R>T?D.c=D.e=null:(D.e=R,D.c=[y]);return}L=String(y)}else{if(!hg.test(L=String(y)))return s(D,L,E);D.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(R=L.indexOf("."))>-1&&(L=L.replace(".","")),(N=L.search(/e/i))>0?(R<0&&(R=N),R+=+L.slice(N+1),L=L.substring(0,N)):R<0&&(R=L.length)}else{if(ze(_,2,F.length,"Base"),_==10&&ne)return D=new Y(y),Fe(D,u+D.e+1,l);if(L=String(y),E=typeof y=="number"){if(y*0!=0)return s(D,L,E,_);if(D.s=1/y<0?(L=L.slice(1),-1):1,Y.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(vl+y)}else D.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(S=F.slice(0,_),R=N=0,C=L.length;N<C;N++)if(S.indexOf(M=L.charAt(N))<0){if(M=="."){if(N>R){R=C;continue}}else if(!k&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){k=!0,N=-1,R=0;continue}return s(D,String(y),E,_)}E=!1,L=n(L,_,10,D.s),(R=L.indexOf("."))>-1?L=L.replace(".",""):R=L.length}for(N=0;L.charCodeAt(N)===48;N++);for(C=L.length;L.charCodeAt(--C)===48;);if(L=L.slice(N,++C)){if(C-=N,E&&Y.DEBUG&&C>15&&(y>io||y!==Yt(y)))throw Error(vl+D.s*y);if((R=R-N-1)>T)D.c=D.e=null;else if(R<b)D.c=[D.e=0];else{if(D.e=R,D.c=[],N=(R+1)%ce,R<0&&(N+=ce),N<C){for(N&&D.c.push(+L.slice(0,N)),C-=ce;N<C;)D.c.push(+L.slice(N,N+=ce));N=ce-(L=L.slice(N)).length}else N-=C;for(;N--;L+="0");D.c.push(+L)}}else D.c=[D.e=0]}Y.clone=Tl,Y.ROUND_UP=0,Y.ROUND_DOWN=1,Y.ROUND_CEIL=2,Y.ROUND_FLOOR=3,Y.ROUND_HALF_UP=4,Y.ROUND_HALF_DOWN=5,Y.ROUND_HALF_EVEN=6,Y.ROUND_HALF_CEIL=7,Y.ROUND_HALF_FLOOR=8,Y.EUCLID=9,Y.config=Y.set=function(y){var _,S;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(_="DECIMAL_PLACES")&&(S=y[_],ze(S,0,st,_),u=S),y.hasOwnProperty(_="ROUNDING_MODE")&&(S=y[_],ze(S,0,8,_),l=S),y.hasOwnProperty(_="EXPONENTIAL_AT")&&(S=y[_],S&&S.pop?(ze(S[0],-st,0,_),ze(S[1],0,st,_),h=S[0],m=S[1]):(ze(S,-st,st,_),h=-(m=S<0?-S:S))),y.hasOwnProperty(_="RANGE"))if(S=y[_],S&&S.pop)ze(S[0],-st,-1,_),ze(S[1],1,st,_),b=S[0],T=S[1];else if(ze(S,-st,st,_),S)b=-(T=S<0?-S:S);else throw Error(Ot+_+" cannot be zero: "+S);if(y.hasOwnProperty(_="CRYPTO"))if(S=y[_],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=S;else throw P=!S,Error(Ot+"crypto unavailable");else P=S;else throw Error(Ot+_+" not true or false: "+S);if(y.hasOwnProperty(_="MODULO_MODE")&&(S=y[_],ze(S,0,9,_),$=S),y.hasOwnProperty(_="POW_PRECISION")&&(S=y[_],ze(S,0,st,_),O=S),y.hasOwnProperty(_="FORMAT"))if(S=y[_],typeof S=="object")I=S;else throw Error(Ot+_+" not an object: "+S);if(y.hasOwnProperty(_="ALPHABET"))if(S=y[_],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))ne=S.slice(0,10)=="0123456789",F=S;else throw Error(Ot+_+" invalid: "+S)}else throw Error(Ot+"Object expected: "+y);return{DECIMAL_PLACES:u,ROUNDING_MODE:l,EXPONENTIAL_AT:[h,m],RANGE:[b,T],CRYPTO:P,MODULO_MODE:$,POW_PRECISION:O,FORMAT:I,ALPHABET:F}},Y.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!Y.DEBUG)return!0;var _,S,M=y.c,k=y.e,R=y.s;e:if({}.toString.call(M)=="[object Array]"){if((R===1||R===-1)&&k>=-st&&k<=st&&k===Yt(k)){if(M[0]===0){if(k===0&&M.length===1)return!0;break e}if(_=(k+1)%ce,_<1&&(_+=ce),String(M[0]).length==_){for(_=0;_<M.length;_++)if(S=M[_],S<0||S>=sr||S!==Yt(S))break e;if(S!==0)return!0}}}else if(M===null&&k===null&&(R===null||R===1||R===-1))return!0;throw Error(Ot+"Invalid BigNumber: "+y)},Y.maximum=Y.max=function(){return ve(arguments,-1)},Y.minimum=Y.min=function(){return ve(arguments,1)},Y.random=(function(){var y=9007199254740992,_=Math.random()*y&2097151?function(){return Yt(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var M,k,R,N,E,C=0,L=[],D=new Y(c);if(S==null?S=u:ze(S,0,st),N=no(S/ce),P)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(N*=2));C<N;)E=M[C]*131072+(M[C+1]>>>11),E>=9e15?(k=crypto.getRandomValues(new Uint32Array(2)),M[C]=k[0],M[C+1]=k[1]):(L.push(E%1e14),C+=2);C=N/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(N*=7);C<N;)E=(M[C]&31)*281474976710656+M[C+1]*1099511627776+M[C+2]*4294967296+M[C+3]*16777216+(M[C+4]<<16)+(M[C+5]<<8)+M[C+6],E>=9e15?crypto.randomBytes(7).copy(M,C):(L.push(E%1e14),C+=7);C=N/7}else throw P=!1,Error(Ot+"crypto unavailable");if(!P)for(;C<N;)E=_(),E<9e15&&(L[C++]=E%1e14);for(N=L[--C],S%=ce,N&&S&&(E=so[ce-S],L[C]=Yt(N/E)*E);L[C]===0;L.pop(),C--);if(C<0)L=[R=0];else{for(R=-1;L[0]===0;L.splice(0,1),R-=ce);for(C=1,E=L[0];E>=10;E/=10,C++);C<ce&&(R-=ce-C)}return D.e=R,D.c=L,D}})(),Y.sum=function(){for(var y=1,_=arguments,S=new Y(_[0]);y<_.length;)S=S.plus(_[y++]);return S},n=(function(){var y="0123456789";function _(S,M,k,R){for(var N,E=[0],C,L=0,D=S.length;L<D;){for(C=E.length;C--;E[C]*=M);for(E[0]+=R.indexOf(S.charAt(L++)),N=0;N<E.length;N++)E[N]>k-1&&(E[N+1]==null&&(E[N+1]=0),E[N+1]+=E[N]/k|0,E[N]%=k)}return E.reverse()}return function(S,M,k,R,N){var E,C,L,D,q,te,J,pe,Ne=S.indexOf("."),We=u,le=l;for(Ne>=0&&(D=O,O=0,S=S.replace(".",""),pe=new Y(M),te=pe.pow(S.length-Ne),O=D,pe.c=_(xr(qt(te.c),te.e,"0"),10,k,y),pe.e=pe.c.length),J=_(S,M,k,N?(E=F,y):(E=y,F)),L=D=J.length;J[--D]==0;J.pop());if(!J[0])return E.charAt(0);if(Ne<0?--L:(te.c=J,te.e=L,te.s=R,te=e(te,pe,We,le,k),J=te.c,q=te.r,L=te.e),C=L+We+1,Ne=J[C],D=k/2,q=q||C<0||J[C+1]!=null,q=le<4?(Ne!=null||q)&&(le==0||le==(te.s<0?3:2)):Ne>D||Ne==D&&(le==4||q||le==6&&J[C-1]&1||le==(te.s<0?8:7)),C<1||!J[0])S=q?xr(E.charAt(1),-We,E.charAt(0)):E.charAt(0);else{if(J.length=C,q)for(--k;++J[--C]>k;)J[C]=0,C||(++L,J=[1].concat(J));for(D=J.length;!J[--D];);for(Ne=0,S="";Ne<=D;S+=E.charAt(J[Ne++]));S=xr(S,L,E.charAt(0))}return S}})(),e=(function(){function y(M,k,R){var N,E,C,L,D=0,q=M.length,te=k%Jr,J=k/Jr|0;for(M=M.slice();q--;)C=M[q]%Jr,L=M[q]/Jr|0,N=J*C+L*te,E=te*C+N%Jr*Jr+D,D=(E/R|0)+(N/Jr|0)+J*L,M[q]=E%R;return D&&(M=[D].concat(M)),M}function _(M,k,R,N){var E,C;if(R!=N)C=R>N?1:-1;else for(E=C=0;E<R;E++)if(M[E]!=k[E]){C=M[E]>k[E]?1:-1;break}return C}function S(M,k,R,N){for(var E=0;R--;)M[R]-=E,E=M[R]<k[R]?1:0,M[R]=E*N+M[R]-k[R];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,k,R,N,E){var C,L,D,q,te,J,pe,Ne,We,le,Oe,at,Tr,Fr,Ii,wt,Er,bt=M.s==k.s?1:-1,Be=M.c,Ue=k.c;if(!Be||!Be[0]||!Ue||!Ue[0])return new Y(!M.s||!k.s||(Be?Ue&&Be[0]==Ue[0]:!Ue)?NaN:Be&&Be[0]==0||!Ue?bt*0:bt/0);for(Ne=new Y(bt),We=Ne.c=[],L=M.e-k.e,bt=R+L+1,E||(E=sr,L=Kt(M.e/ce)-Kt(k.e/ce),bt=bt/ce|0),D=0;Ue[D]==(Be[D]||0);D++);if(Ue[D]>(Be[D]||0)&&L--,bt<0)We.push(1),q=!0;else{for(Fr=Be.length,wt=Ue.length,D=0,bt+=2,te=Yt(E/(Ue[0]+1)),te>1&&(Ue=y(Ue,te,E),Be=y(Be,te,E),wt=Ue.length,Fr=Be.length),Tr=wt,le=Be.slice(0,wt),Oe=le.length;Oe<wt;le[Oe++]=0);Er=Ue.slice(),Er=[0].concat(Er),Ii=Ue[0],Ue[1]>=E/2&&Ii++;do{if(te=0,C=_(Ue,le,wt,Oe),C<0){if(at=le[0],wt!=Oe&&(at=at*E+(le[1]||0)),te=Yt(at/Ii),te>1)for(te>=E&&(te=E-1),J=y(Ue,te,E),pe=J.length,Oe=le.length;_(J,le,pe,Oe)==1;)te--,S(J,wt<pe?Er:Ue,pe,E),pe=J.length,C=1;else te==0&&(C=te=1),J=Ue.slice(),pe=J.length;if(pe<Oe&&(J=[0].concat(J)),S(le,J,Oe,E),Oe=le.length,C==-1)for(;_(Ue,le,wt,Oe)<1;)te++,S(le,wt<Oe?Er:Ue,Oe,E),Oe=le.length}else C===0&&(te++,le=[0]);We[D++]=te,le[0]?le[Oe++]=Be[Tr]||0:(le=[Be[Tr]],Oe=1)}while((Tr++<Fr||le[0]!=null)&&bt--);q=le[0]!=null,We[0]||We.splice(0,1)}if(E==sr){for(D=1,bt=We[0];bt>=10;bt/=10,D++);Fe(Ne,R+(Ne.e=D+L*ce-1)+1,N,q)}else Ne.e=L,Ne.r=+q;return Ne}})();function Ae(y,_,S,M){var k,R,N,E,C;if(S==null?S=l:ze(S,0,8),!y.c)return y.toString();if(k=y.c[0],N=y.e,_==null)C=qt(y.c),C=M==1||M==2&&(N<=h||N>=m)?ws(C,N):xr(C,N,"0");else if(y=Fe(new Y(y),_,S),R=y.e,C=qt(y.c),E=C.length,M==1||M==2&&(_<=R||R<=h)){for(;E<_;C+="0",E++);C=ws(C,R)}else if(_-=N+(M===2&&R>N),C=xr(C,R,"0"),R+1>E){if(--_>0)for(C+=".";_--;C+="0");}else if(_+=R-E,_>0)for(R+1==E&&(C+=".");_--;C+="0");return y.s<0&&k?"-"+C:C}function ve(y,_){for(var S,M,k=1,R=new Y(y[0]);k<y.length;k++)M=new Y(y[k]),(!M.s||(S=gn(R,M))===_||S===0&&R.s===_)&&(R=M);return R}function _e(y,_,S){for(var M=1,k=_.length;!_[--k];_.pop());for(k=_[0];k>=10;k/=10,M++);return(S=M+S*ce-1)>T?y.c=y.e=null:S<b?y.c=[y.e=0]:(y.e=S,y.c=_),y}s=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,S=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(R,N,E,C){var L,D=E?N:N.replace(k,"");if(M.test(D))R.s=isNaN(D)?null:D<0?-1:1;else{if(!E&&(D=D.replace(y,function(q,te,J){return L=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!C||C==L?te:q}),C&&(L=C,D=D.replace(_,"$1").replace(S,"0.$1")),N!=D))return new Y(D,L);if(Y.DEBUG)throw Error(Ot+"Not a"+(C?" base "+C:"")+" number: "+N);R.s=null}R.c=R.e=null}})();function Fe(y,_,S,M){var k,R,N,E,C,L,D,q=y.c,te=so;if(q){e:{for(k=1,E=q[0];E>=10;E/=10,k++);if(R=_-k,R<0)R+=ce,N=_,C=q[L=0],D=Yt(C/te[k-N-1]%10);else if(L=no((R+1)/ce),L>=q.length)if(M){for(;q.length<=L;q.push(0));C=D=0,k=1,R%=ce,N=R-ce+1}else break e;else{for(C=E=q[L],k=1;E>=10;E/=10,k++);R%=ce,N=R-ce+k,D=N<0?0:Yt(C/te[k-N-1]%10)}if(M=M||_<0||q[L+1]!=null||(N<0?C:C%te[k-N-1]),M=S<4?(D||M)&&(S==0||S==(y.s<0?3:2)):D>5||D==5&&(S==4||M||S==6&&(R>0?N>0?C/te[k-N]:0:q[L-1])%10&1||S==(y.s<0?8:7)),_<1||!q[0])return q.length=0,M?(_-=y.e+1,q[0]=te[(ce-_%ce)%ce],y.e=-_||0):q[0]=y.e=0,y;if(R==0?(q.length=L,E=1,L--):(q.length=L+1,E=te[ce-R],q[L]=N>0?Yt(C/te[k-N]%te[N])*E:0),M)for(;;)if(L==0){for(R=1,N=q[0];N>=10;N/=10,R++);for(N=q[0]+=E,E=1;N>=10;N/=10,E++);R!=E&&(y.e++,q[0]==sr&&(q[0]=1));break}else{if(q[L]+=E,q[L]!=sr)break;q[L--]=0,E=1}for(R=q.length;q[--R]===0;q.pop());}y.e>T?y.c=y.e=null:y.e<b&&(y.c=[y.e=0])}return y}function Pe(y){var _,S=y.e;return S===null?y.toString():(_=qt(y.c),_=S<=h||S>=m?ws(_,S):xr(_,S,"0"),y.s<0?"-"+_:_)}return a.absoluteValue=a.abs=function(){var y=new Y(this);return y.s<0&&(y.s=1),y},a.comparedTo=function(y,_){return gn(this,new Y(y,_))},a.decimalPlaces=a.dp=function(y,_){var S,M,k,R=this;if(y!=null)return ze(y,0,st),_==null?_=l:ze(_,0,8),Fe(new Y(R),y+R.e+1,_);if(!(S=R.c))return null;if(M=((k=S.length-1)-Kt(this.e/ce))*ce,k=S[k])for(;k%10==0;k/=10,M--);return M<0&&(M=0),M},a.dividedBy=a.div=function(y,_){return e(this,new Y(y,_),u,l)},a.dividedToIntegerBy=a.idiv=function(y,_){return e(this,new Y(y,_),0,1)},a.exponentiatedBy=a.pow=function(y,_){var S,M,k,R,N,E,C,L,D,q=this;if(y=new Y(y),y.c&&!y.isInteger())throw Error(Ot+"Exponent not an integer: "+Pe(y));if(_!=null&&(_=new Y(_)),E=y.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!y.c||!y.c[0])return D=new Y(Math.pow(+Pe(q),E?y.s*(2-_s(y)):+Pe(y))),_?D.mod(_):D;if(C=y.s<0,_){if(_.c?!_.c[0]:!_.s)return new Y(NaN);M=!C&&q.isInteger()&&_.isInteger(),M&&(q=q.mod(_))}else{if(y.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||E&&q.c[1]>=24e7:q.c[0]<8e13||E&&q.c[0]<=9999975e7)))return R=q.s<0&&_s(y)?-0:0,q.e>-1&&(R=1/R),new Y(C?1/R:R);O&&(R=no(O/ce+2))}for(E?(S=new Y(.5),C&&(y.s=1),L=_s(y)):(k=Math.abs(+Pe(y)),L=k%2),D=new Y(c);;){if(L){if(D=D.times(q),!D.c)break;R?D.c.length>R&&(D.c.length=R):M&&(D=D.mod(_))}if(k){if(k=Yt(k/2),k===0)break;L=k%2}else if(y=y.times(S),Fe(y,y.e+1,1),y.e>14)L=_s(y);else{if(k=+Pe(y),k===0)break;L=k%2}q=q.times(q),R?q.c&&q.c.length>R&&(q.c.length=R):M&&(q=q.mod(_))}return M?D:(C&&(D=c.div(D)),_?D.mod(_):R?Fe(D,O,l,N):D)},a.integerValue=function(y){var _=new Y(this);return y==null?y=l:ze(y,0,8),Fe(_,_.e+1,y)},a.isEqualTo=a.eq=function(y,_){return gn(this,new Y(y,_))===0},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(y,_){return gn(this,new Y(y,_))>0},a.isGreaterThanOrEqualTo=a.gte=function(y,_){return(_=gn(this,new Y(y,_)))===1||_===0},a.isInteger=function(){return!!this.c&&Kt(this.e/ce)>this.c.length-2},a.isLessThan=a.lt=function(y,_){return gn(this,new Y(y,_))<0},a.isLessThanOrEqualTo=a.lte=function(y,_){return(_=gn(this,new Y(y,_)))===-1||_===0},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&this.c[0]==0},a.minus=function(y,_){var S,M,k,R,N=this,E=N.s;if(y=new Y(y,_),_=y.s,!E||!_)return new Y(NaN);if(E!=_)return y.s=-_,N.plus(y);var C=N.e/ce,L=y.e/ce,D=N.c,q=y.c;if(!C||!L){if(!D||!q)return D?(y.s=-_,y):new Y(q?N:NaN);if(!D[0]||!q[0])return q[0]?(y.s=-_,y):new Y(D[0]?N:l==3?-0:0)}if(C=Kt(C),L=Kt(L),D=D.slice(),E=C-L){for((R=E<0)?(E=-E,k=D):(L=C,k=q),k.reverse(),_=E;_--;k.push(0));k.reverse()}else for(M=(R=(E=D.length)<(_=q.length))?E:_,E=_=0;_<M;_++)if(D[_]!=q[_]){R=D[_]<q[_];break}if(R&&(k=D,D=q,q=k,y.s=-y.s),_=(M=q.length)-(S=D.length),_>0)for(;_--;D[S++]=0);for(_=sr-1;M>E;){if(D[--M]<q[M]){for(S=M;S&&!D[--S];D[S]=_);--D[S],D[M]+=sr}D[M]-=q[M]}for(;D[0]==0;D.splice(0,1),--L);return D[0]?_e(y,D,L):(y.s=l==3?-1:1,y.c=[y.e=0],y)},a.modulo=a.mod=function(y,_){var S,M,k=this;return y=new Y(y,_),!k.c||!y.s||y.c&&!y.c[0]?new Y(NaN):!y.c||k.c&&!k.c[0]?new Y(k):($==9?(M=y.s,y.s=1,S=e(k,y,0,3),y.s=M,S.s*=M):S=e(k,y,0,$),y=k.minus(S.times(y)),!y.c[0]&&$==1&&(y.s=k.s),y)},a.multipliedBy=a.times=function(y,_){var S,M,k,R,N,E,C,L,D,q,te,J,pe,Ne,We,le=this,Oe=le.c,at=(y=new Y(y,_)).c;if(!Oe||!at||!Oe[0]||!at[0])return!le.s||!y.s||Oe&&!Oe[0]&&!at||at&&!at[0]&&!Oe?y.c=y.e=y.s=null:(y.s*=le.s,!Oe||!at?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(M=Kt(le.e/ce)+Kt(y.e/ce),y.s*=le.s,C=Oe.length,q=at.length,C<q&&(pe=Oe,Oe=at,at=pe,k=C,C=q,q=k),k=C+q,pe=[];k--;pe.push(0));for(Ne=sr,We=Jr,k=q;--k>=0;){for(S=0,te=at[k]%We,J=at[k]/We|0,N=C,R=k+N;R>k;)L=Oe[--N]%We,D=Oe[N]/We|0,E=J*L+D*te,L=te*L+E%We*We+pe[R]+S,S=(L/Ne|0)+(E/We|0)+J*D,pe[R--]=L%Ne;pe[R]=S}return S?++M:pe.splice(0,1),_e(y,pe,M)},a.negated=function(){var y=new Y(this);return y.s=-y.s||null,y},a.plus=function(y,_){var S,M=this,k=M.s;if(y=new Y(y,_),_=y.s,!k||!_)return new Y(NaN);if(k!=_)return y.s=-_,M.minus(y);var R=M.e/ce,N=y.e/ce,E=M.c,C=y.c;if(!R||!N){if(!E||!C)return new Y(k/0);if(!E[0]||!C[0])return C[0]?y:new Y(E[0]?M:k*0)}if(R=Kt(R),N=Kt(N),E=E.slice(),k=R-N){for(k>0?(N=R,S=C):(k=-k,S=E),S.reverse();k--;S.push(0));S.reverse()}for(k=E.length,_=C.length,k-_<0&&(S=C,C=E,E=S,_=k),k=0;_;)k=(E[--_]=E[_]+C[_]+k)/sr|0,E[_]=sr===E[_]?0:E[_]%sr;return k&&(E=[k].concat(E),++N),_e(y,E,N)},a.precision=a.sd=function(y,_){var S,M,k,R=this;if(y!=null&&y!==!!y)return ze(y,1,st),_==null?_=l:ze(_,0,8),Fe(new Y(R),y,_);if(!(S=R.c))return null;if(k=S.length-1,M=k*ce+1,k=S[k]){for(;k%10==0;k/=10,M--);for(k=S[0];k>=10;k/=10,M++);}return y&&R.e+1>M&&(M=R.e+1),M},a.shiftedBy=function(y){return ze(y,-io,io),this.times("1e"+y)},a.squareRoot=a.sqrt=function(){var y,_,S,M,k,R=this,N=R.c,E=R.s,C=R.e,L=u+4,D=new Y("0.5");if(E!==1||!N||!N[0])return new Y(!E||E<0&&(!N||N[0])?NaN:N?R:1/0);if(E=Math.sqrt(+Pe(R)),E==0||E==1/0?(_=qt(N),(_.length+C)%2==0&&(_+="0"),E=Math.sqrt(+_),C=Kt((C+1)/2)-(C<0||C%2),E==1/0?_="5e"+C:(_=E.toExponential(),_=_.slice(0,_.indexOf("e")+1)+C),S=new Y(_)):S=new Y(E+""),S.c[0]){for(C=S.e,E=C+L,E<3&&(E=0);;)if(k=S,S=D.times(k.plus(e(R,k,L,1))),qt(k.c).slice(0,E)===(_=qt(S.c)).slice(0,E))if(S.e<C&&--E,_=_.slice(E-3,E+1),_=="9999"||!M&&_=="4999"){if(!M&&(Fe(k,k.e+u+2,0),k.times(k).eq(R))){S=k;break}L+=4,E+=4,M=1}else{(!+_||!+_.slice(1)&&_.charAt(0)=="5")&&(Fe(S,S.e+u+2,1),y=!S.times(S).eq(R));break}}return Fe(S,S.e+u+1,l,y)},a.toExponential=function(y,_){return y!=null&&(ze(y,0,st),y++),Ae(this,y,_,1)},a.toFixed=function(y,_){return y!=null&&(ze(y,0,st),y=y+this.e+1),Ae(this,y,_)},a.toFormat=function(y,_,S){var M,k=this;if(S==null)y!=null&&_&&typeof _=="object"?(S=_,_=null):y&&typeof y=="object"?(S=y,y=_=null):S=I;else if(typeof S!="object")throw Error(Ot+"Argument not an object: "+S);if(M=k.toFixed(y,_),k.c){var R,N=M.split("."),E=+S.groupSize,C=+S.secondaryGroupSize,L=S.groupSeparator||"",D=N[0],q=N[1],te=k.s<0,J=te?D.slice(1):D,pe=J.length;if(C&&(R=E,E=C,C=R,pe-=R),E>0&&pe>0){for(R=pe%E||E,D=J.substr(0,R);R<pe;R+=E)D+=L+J.substr(R,E);C>0&&(D+=L+J.slice(R)),te&&(D="-"+D)}M=q?D+(S.decimalSeparator||"")+((C=+S.fractionGroupSize)?q.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):q):D}return(S.prefix||"")+M+(S.suffix||"")},a.toFraction=function(y){var _,S,M,k,R,N,E,C,L,D,q,te,J=this,pe=J.c;if(y!=null&&(E=new Y(y),!E.isInteger()&&(E.c||E.s!==1)||E.lt(c)))throw Error(Ot+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+Pe(E));if(!pe)return new Y(J);for(_=new Y(c),L=S=new Y(c),M=C=new Y(c),te=qt(pe),R=_.e=te.length-J.e-1,_.c[0]=so[(N=R%ce)<0?ce+N:N],y=!y||E.comparedTo(_)>0?R>0?_:L:E,N=T,T=1/0,E=new Y(te),C.c[0]=0;D=e(E,_,0,1),k=S.plus(D.times(M)),k.comparedTo(y)!=1;)S=M,M=k,L=C.plus(D.times(k=L)),C=k,_=E.minus(D.times(k=_)),E=k;return k=e(y.minus(S),M,0,1),C=C.plus(k.times(L)),S=S.plus(k.times(M)),C.s=L.s=J.s,R=R*2,q=e(L,M,R,l).minus(J).abs().comparedTo(e(C,S,R,l).minus(J).abs())<1?[L,M]:[C,S],T=N,q},a.toNumber=function(){return+Pe(this)},a.toPrecision=function(y,_){return y!=null&&ze(y,1,st),Ae(this,y,_,2)},a.toString=function(y){var _,S=this,M=S.s,k=S.e;return k===null?M?(_="Infinity",M<0&&(_="-"+_)):_="NaN":(y==null?_=k<=h||k>=m?ws(qt(S.c),k):xr(qt(S.c),k,"0"):y===10&&ne?(S=Fe(new Y(S),u+k+1,l),_=xr(qt(S.c),S.e,"0")):(ze(y,2,F.length,"Base"),_=n(xr(qt(S.c),k,"0"),10,y,M,!0)),M<0&&S.c[0]&&(_="-"+_)),_},a.valueOf=a.toJSON=function(){return Pe(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,t!=null&&Y.set(t),Y}function Kt(t){var e=t|0;return t>0||t===e?e:e-1}function qt(t){for(var e,n,s=1,a=t.length,c=t[0]+"";s<a;){for(e=t[s++]+"",n=ce-e.length;n--;e="0"+e);c+=e}for(a=c.length;c.charCodeAt(--a)===48;);return c.slice(0,a+1||1)}function gn(t,e){var n,s,a=t.c,c=e.c,u=t.s,l=e.s,h=t.e,m=e.e;if(!u||!l)return null;if(n=a&&!a[0],s=c&&!c[0],n||s)return n?s?0:-l:u;if(u!=l)return u;if(n=u<0,s=h==m,!a||!c)return s?0:!a^n?1:-1;if(!s)return h>m^n?1:-1;for(l=(h=a.length)<(m=c.length)?h:m,u=0;u<l;u++)if(a[u]!=c[u])return a[u]>c[u]^n?1:-1;return h==m?0:h>m^n?1:-1}function ze(t,e,n,s){if(t<e||t>n||t!==Yt(t))throw Error(Ot+(s||"Argument")+(typeof t=="number"?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _s(t){var e=t.c.length-1;return Kt(t.e/ce)==e&&t.c[e]%2!=0}function ws(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function xr(t,e,n){var s,a;if(e<0){for(a=n+".";++e;a+=n);t=a+t}else if(s=t.length,++e>s){for(a=n,e-=s;--e;a+=n);t+=a}else e<s&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Ze=Tl();const yn=new TextEncoder,ao=new TextDecoder,bs=2**32;function bi(...t){const e=t.reduce((a,{length:c})=>a+c,0),n=new Uint8Array(e);let s=0;for(const a of t)n.set(a,s),s+=a.length;return n}function oo(t,e,n){if(e<0||e>=bs)throw new RangeError(`value must be >= 0 and <= ${bs-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,e&255],n)}function dg(t){const e=Math.floor(t/bs),n=t%bs,s=new Uint8Array(8);return oo(s,e,0),oo(s,n,4),s}function uo(t){const e=new Uint8Array(4);return oo(e,t),e}function pg(t){if(Uint8Array.prototype.toBase64)return t.toBase64();const e=32768,n=[];for(let s=0;s<t.length;s+=e)n.push(String.fromCharCode.apply(null,t.subarray(s,s+e)));return btoa(n.join(""))}function mg(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);const e=atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n}function El(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof t=="string"?t:ao.decode(t),{alphabet:"base64url"});let e=t;e instanceof Uint8Array&&(e=ao.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return mg(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function $t(t){let e=t;return typeof e=="string"&&(e=yn.encode(e)),Uint8Array.prototype.toBase64?e.toBase64({alphabet:"base64url",omitPadding:!0}):pg(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class Al extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,n){super(e,n),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class yt extends Al{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Qr extends Al{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}function Ol(t){switch(t){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new yt(`Unsupported JWE Algorithm: ${t}`)}}const gg=t=>crypto.getRandomValues(new Uint8Array(Ol(t)>>3)),yg=(t,e)=>{if(e.length<<3!==Ol(t))throw new Qr("Invalid Initialization Vector length")},kl=(t,e)=>{const n=t.byteLength<<3;if(n!==e)throw new Qr(`Invalid Content Encryption Key length. Expected ${e} bits, got ${n} bits`)};function Zr(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function Ss(t,e){return t.name===e}function _g(t){return parseInt(t.name.slice(4),10)}function wg(t,e){if(e&&!t.usages.includes(e))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${e}.`)}function Bn(t,e,n){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Ss(t.algorithm,"AES-GCM"))throw Zr("AES-GCM");const s=parseInt(e.slice(1,4),10);if(t.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Ss(t.algorithm,"AES-KW"))throw Zr("AES-KW");const s=parseInt(e.slice(1,4),10);if(t.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"ECDH":{switch(t.algorithm.name){case"ECDH":case"X25519":break;default:throw Zr("ECDH or X25519")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Ss(t.algorithm,"PBKDF2"))throw Zr("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Ss(t.algorithm,"RSA-OAEP"))throw Zr("RSA-OAEP");const s=parseInt(e.slice(9),10)||1;if(_g(t.algorithm.hash)!==s)throw Zr(`SHA-${s}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}wg(t,n)}function Cl(t,e,...n){if(n=n.filter(Boolean),n.length>2){const s=n.pop();t+=`one of type ${n.join(", ")}, or ${s}.`}else n.length===2?t+=`one of type ${n[0]} or ${n[1]}.`:t+=`of type ${n[0]}.`;return e==null?t+=` Received ${e}`:typeof e=="function"&&e.name?t+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(t+=` Received an instance of ${e.constructor.name}`),t}const co=(t,...e)=>Cl("Key must be ",t,...e);function xl(t,e,...n){return Cl(`Key for the ${t} algorithm must be `,e,...n)}function Pl(t){if(!Si(t))throw new Error("CryptoKey instance expected")}function Si(t){return t?.[Symbol.toStringTag]==="CryptoKey"}function lo(t){return t?.[Symbol.toStringTag]==="KeyObject"}const Rl=t=>Si(t)||lo(t),bg=(...t)=>{const e=t.filter(Boolean);if(e.length===0||e.length===1)return!0;let n;for(const s of e){const a=Object.keys(s);if(!n||n.size===0){n=new Set(a);continue}for(const c of a){if(n.has(c))return!1;n.add(c)}}return!0};function Sg(t){return typeof t=="object"&&t!==null}const Dl=t=>{if(!Sg(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function vg(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}function Tg(t,e,n){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,"AES-KW",!0,[n]):(Bn(t,e,n),t)}async function fo(t,e,n){const s=await Tg(e,t,"wrapKey");vg(s,t);const a=await crypto.subtle.importKey("raw",n,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",a,s,"AES-KW"))}const Eg=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,e))};function ho(t){return bi(uo(t.length),t)}async function Ag(t,e,n){const s=e>>3,a=32,c=Math.ceil(s/a),u=new Uint8Array(c*a);for(let l=1;l<=c;l++){const h=new Uint8Array(4+t.length+n.length);h.set(uo(l),0),h.set(t,4),h.set(n,4+t.length);const m=await Eg("sha256",h);u.set(m,(l-1)*a)}return u.slice(0,s)}async function Og(t,e,n,s,a=new Uint8Array(0),c=new Uint8Array(0)){Bn(t,"ECDH"),Bn(e,"ECDH","deriveBits");const u=ho(yn.encode(n)),l=ho(a),h=ho(c),m=uo(s),b=new Uint8Array(0),T=bi(u,l,h,m,b),P=new Uint8Array(await crypto.subtle.deriveBits({name:t.algorithm.name,public:t},e,kg(t)));return Ag(P,s,T)}function kg(t){return t.algorithm.name==="X25519"?256:Math.ceil(parseInt(t.algorithm.namedCurve.slice(-3),10)/8)<<3}function Cg(t){switch(t.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return t.algorithm.name==="X25519"}}function xg(t,e){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]):(Bn(t,e,"deriveBits"),t)}const Pg=(t,e)=>bi(yn.encode(t),new Uint8Array([0]),e);async function Rg(t,e,n,s){if(!(t instanceof Uint8Array)||t.length<8)throw new Qr("PBES2 Salt Input must be 8 or more octets");const a=Pg(e,t),c=parseInt(e.slice(13,16),10),u={hash:`SHA-${e.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:a},l=await xg(s,e);return new Uint8Array(await crypto.subtle.deriveBits(u,l,c))}async function Dg(t,e,n,s=2048,a=crypto.getRandomValues(new Uint8Array(16))){const c=await Rg(a,t,s,e);return{encryptedKey:await fo(t.slice(-6),c,n),p2c:s,p2s:$t(a)}}const Mg=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:n}=e.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}},Lg=t=>{switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new yt(`alg ${t} is not supported either by JOSE or your javascript runtime`)}};async function Ng(t,e,n){return Bn(e,t,"encrypt"),Mg(t,e),new Uint8Array(await crypto.subtle.encrypt(Lg(t),e,n))}function Ml(t){switch(t){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new yt(`Unsupported JWE Algorithm: ${t}`)}}const vi=t=>crypto.getRandomValues(new Uint8Array(Ml(t)>>3));function Ug(t){let e,n;switch(t.kty){case"AKP":{switch(t.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":e={name:t.alg},n=t.priv?["sign"]:["verify"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},n=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},n=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":case"EdDSA":e={name:"Ed25519"},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new yt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const vs=async t=>{if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:e,keyUsages:n}=Ug(t),s={...t};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,e,t.ext??!(t.d||t.priv),t.key_ops??n)};async function Bg(t,e,n){if(!Dl(t))throw new TypeError("JWK must be an object");let s;switch(e??=t.alg,s??=t.ext,t.kty){case"oct":if(typeof t.k!="string"||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return El(t.k);case"RSA":if("oth"in t&&t.oth!==void 0)throw new yt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return vs({...t,alg:e,ext:s});case"AKP":{if(typeof t.alg!="string"||!t.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(e!==void 0&&e!==t.alg)throw new TypeError("JWK alg and alg option value mismatch");return vs({...t,ext:s})}case"EC":case"OKP":return vs({...t,alg:e,ext:s});default:throw new yt('Unsupported "kty" (Key Type) Parameter value')}}async function Ig(t,e,n,s,a){if(!(n instanceof Uint8Array))throw new TypeError(co(n,"Uint8Array"));const c=parseInt(t.slice(1,4),10),u=await crypto.subtle.importKey("raw",n.subarray(c>>3),"AES-CBC",!1,["encrypt"]),l=await crypto.subtle.importKey("raw",n.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),h=new Uint8Array(await crypto.subtle.encrypt({iv:s,name:"AES-CBC"},u,e)),m=bi(a,s,h,dg(a.length<<3)),b=new Uint8Array((await crypto.subtle.sign("HMAC",l,m)).slice(0,c>>3));return{ciphertext:h,tag:b,iv:s}}async function Fg(t,e,n,s,a){let c;n instanceof Uint8Array?c=await crypto.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Bn(n,t,"encrypt"),c=n);const u=new Uint8Array(await crypto.subtle.encrypt({additionalData:a,iv:s,name:"AES-GCM",tagLength:128},c,e)),l=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:l,iv:s}}const Ll=async(t,e,n,s,a)=>{if(!Si(n)&&!(n instanceof Uint8Array))throw new TypeError(co(n,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(s?yg(t,s):s=gg(t),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&kl(n,parseInt(t.slice(-3),10)),Ig(t,e,n,s,a);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&kl(n,parseInt(t.slice(1,4),10)),Fg(t,e,n,s,a);default:throw new yt("Unsupported JWE Content Encryption Algorithm")}};async function Wg(t,e,n,s){const a=t.slice(0,7),c=await Ll(a,n,e,s,new Uint8Array(0));return{encryptedKey:c.ciphertext,iv:$t(c.iv),tag:$t(c.tag)}}const Hg=(t,e,n,s,a)=>{if(a.crit!==void 0&&s?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!s||s.crit===void 0)return new Set;if(!Array.isArray(s.crit)||s.crit.length===0||s.crit.some(u=>typeof u!="string"||u.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let c;n!==void 0?c=new Map([...Object.entries(n),...e.entries()]):c=e;for(const u of s.crit){if(!c.has(u))throw new yt(`Extension Header Parameter "${u}" is not recognized`);if(a[u]===void 0)throw new t(`Extension Header Parameter "${u}" is missing`);if(c.get(u)&&s[u]===void 0)throw new t(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(s.crit)};function po(t){return Dl(t)&&typeof t.kty=="string"}function Yg(t){return t.kty!=="oct"&&(t.kty==="AKP"&&typeof t.priv=="string"||typeof t.d=="string")}function Kg(t){return t.kty!=="oct"&&typeof t.d>"u"&&typeof t.priv>"u"}function qg(t){return t.kty==="oct"&&typeof t.k=="string"}let In;const Nl=async(t,e,n,s=!1)=>{In||=new WeakMap;let a=In.get(t);if(a?.[n])return a[n];const c=await vs({...e,alg:n});return s&&Object.freeze(t),a?a[n]=c:In.set(t,{[n]:c}),c},$g=(t,e)=>{In||=new WeakMap;let n=In.get(t);if(n?.[e])return n[e];const s=t.type==="public",a=!!s;let c;if(t.asymmetricKeyType==="x25519"){switch(e){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}c=t.toCryptoKey(t.asymmetricKeyType,a,s?[]:["deriveBits"])}if(t.asymmetricKeyType==="ed25519"){if(e!=="EdDSA"&&e!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=t.toCryptoKey(t.asymmetricKeyType,a,[s?"verify":"sign"])}switch(t.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(e!==t.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=t.toCryptoKey(t.asymmetricKeyType,a,[s?"verify":"sign"])}}if(t.asymmetricKeyType==="rsa"){let u;switch(e){case"RSA-OAEP":u="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":u="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":u="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":u="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(e.startsWith("RSA-OAEP"))return t.toCryptoKey({name:"RSA-OAEP",hash:u},a,s?["encrypt"]:["decrypt"]);c=t.toCryptoKey({name:e.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:u},a,[s?"verify":"sign"])}if(t.asymmetricKeyType==="ec"){const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(t.asymmetricKeyDetails?.namedCurve);if(!l)throw new TypeError("given KeyObject instance cannot be used for this algorithm");e==="ES256"&&l==="P-256"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e==="ES384"&&l==="P-384"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e==="ES512"&&l==="P-521"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e.startsWith("ECDH-ES")&&(c=t.toCryptoKey({name:"ECDH",namedCurve:l},a,s?[]:["deriveBits"]))}if(!c)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return n?n[e]=c:In.set(t,{[e]:c}),c},Ul=async(t,e)=>{if(t instanceof Uint8Array||Si(t))return t;if(lo(t)){if(t.type==="secret")return t.export();if("toCryptoKey"in t&&typeof t.toCryptoKey=="function")try{return $g(t,e)}catch(s){if(s instanceof TypeError)throw s}let n=t.export({format:"jwk"});return Nl(t,n,e)}if(po(t))return t.k?El(t.k):Nl(t,t,e,!0);throw new Error("unreachable")},Fn=t=>t?.[Symbol.toStringTag],mo=(t,e,n)=>{if(e.use!==void 0){let s;switch(n){case"sign":case"verify":s="sig";break;case"encrypt":case"decrypt":s="enc";break}if(e.use!==s)throw new TypeError(`Invalid key for this operation, its "use" must be "${s}" when present`)}if(e.alg!==void 0&&e.alg!==t)throw new TypeError(`Invalid key for this operation, its "alg" must be "${t}" when present`);if(Array.isArray(e.key_ops)){let s;switch(!0){case n==="verify":case t==="dir":case t.includes("CBC-HS"):s=n;break;case t.startsWith("PBES2"):s="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(t):!t.includes("GCM")&&t.endsWith("KW")?s="wrapKey":s=n;break;case t.startsWith("RSA"):s="wrapKey";break;case n==="decrypt":s=t.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(s&&e.key_ops?.includes?.(s)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${s}" when present`)}return!0},Gg=(t,e,n)=>{if(!(e instanceof Uint8Array)){if(po(e)){if(qg(e)&&mo(t,e,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Rl(e))throw new TypeError(xl(t,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(e.type!=="secret")throw new TypeError(`${Fn(e)} instances for symmetric algorithms must be of type "secret"`)}},Vg=(t,e,n)=>{if(po(e))switch(n){case"decrypt":case"sign":if(Yg(e)&&mo(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Kg(e)&&mo(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Rl(e))throw new TypeError(xl(t,e,"CryptoKey","KeyObject","JSON Web Key"));if(e.type==="secret")throw new TypeError(`${Fn(e)} instances for asymmetric algorithms must not be of type "secret"`);if(e.type==="public")switch(n){case"sign":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm decryption must be of type "private"`)}if(e.type==="private")switch(n){case"verify":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm encryption must be of type "public"`)}},zg=(t,e,n)=>{t.startsWith("HS")||t==="dir"||t.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(t)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(t)?Gg(t,e,n):Vg(t,e,n)},jg=Symbol();async function Jg(t){if(lo(t))if(t.type==="secret")t=t.export();else return t.export({format:"jwk"});if(t instanceof Uint8Array)return{kty:"oct",k:$t(t)};if(!Si(t))throw new TypeError(co(t,"CryptoKey","KeyObject","Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:e,key_ops:n,alg:s,use:a,...c}=await crypto.subtle.exportKey("jwk",t);return c.kty==="AKP"&&(c.alg=s),c}async function Qg(t){return Jg(t)}const Zg=async(t,e,n,s,a={})=>{let c,u,l;switch(t){case"dir":{l=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(Pl(n),!Cg(n))throw new yt("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:h,apv:m}=a;let b;a.epk?b=await Ul(a.epk,t):b=(await crypto.subtle.generateKey(n.algorithm,!0,["deriveBits"])).privateKey;const{x:T,y:P,crv:$,kty:O}=await Qg(b),I=await Og(n,b,t==="ECDH-ES"?e:t,t==="ECDH-ES"?Ml(e):parseInt(t.slice(-5,-2),10),h,m);if(u={epk:{x:T,crv:$,kty:O}},O==="EC"&&(u.epk.y=P),h&&(u.apu=$t(h)),m&&(u.apv=$t(m)),t==="ECDH-ES"){l=I;break}l=s||vi(e);const F=t.slice(-6);c=await fo(F,I,l);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{l=s||vi(e),Pl(n),c=await Ng(t,n,l);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=s||vi(e);const{p2c:h,p2s:m}=a;({encryptedKey:c,...u}=await Dg(t,n,l,h,m));break}case"A128KW":case"A192KW":case"A256KW":{l=s||vi(e),c=await fo(t,n,l);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=s||vi(e);const{iv:h}=a;({encryptedKey:c,...u}=await Wg(t,n,l,h));break}default:throw new yt('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:l,encryptedKey:c,parameters:u}};class Xg{#r;#e;#n;#t;#s;#i;#a;#o;constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this.#r=e}setKeyManagementParameters(e){if(this.#o)throw new TypeError("setKeyManagementParameters can only be called once");return this.#o=e,this}setProtectedHeader(e){if(this.#e)throw new TypeError("setProtectedHeader can only be called once");return this.#e=e,this}setSharedUnprotectedHeader(e){if(this.#n)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this.#n=e,this}setUnprotectedHeader(e){if(this.#t)throw new TypeError("setUnprotectedHeader can only be called once");return this.#t=e,this}setAdditionalAuthenticatedData(e){return this.#s=e,this}setContentEncryptionKey(e){if(this.#i)throw new TypeError("setContentEncryptionKey can only be called once");return this.#i=e,this}setInitializationVector(e){if(this.#a)throw new TypeError("setInitializationVector can only be called once");return this.#a=e,this}async encrypt(e,n){if(!this.#e&&!this.#t&&!this.#n)throw new Qr("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!bg(this.#e,this.#t,this.#n))throw new Qr("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const s={...this.#e,...this.#t,...this.#n};if(Hg(Qr,new Map,n?.crit,this.#e,s),s.zip!==void 0)throw new yt('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:a,enc:c}=s;if(typeof a!="string"||!a)throw new Qr('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof c!="string"||!c)throw new Qr('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let u;if(this.#i&&(a==="dir"||a==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${a}`);zg(a==="dir"?c:a,e,"encrypt");let l;{let I;const F=await Ul(e,a);({cek:l,encryptedKey:u,parameters:I}=await Zg(a,c,F,this.#i,this.#o)),I&&(n&&jg in n?this.#t?this.#t={...this.#t,...I}:this.setUnprotectedHeader(I):this.#e?this.#e={...this.#e,...I}:this.setProtectedHeader(I))}let h,m,b;this.#e?m=yn.encode($t(JSON.stringify(this.#e))):m=yn.encode(""),this.#s?(b=$t(this.#s),h=bi(m,yn.encode("."),yn.encode(b))):h=m;const{ciphertext:T,tag:P,iv:$}=await Ll(c,this.#r,l,this.#a,h),O={ciphertext:$t(T)};return $&&(O.iv=$t($)),P&&(O.tag=$t(P)),u&&(O.encrypted_key=$t(u)),b&&(O.aad=b),this.#e&&(O.protected=ao.decode(m)),this.#n&&(O.unprotected=this.#n),this.#t&&(O.header=this.#t),O}}class e0{#r;constructor(e){this.#r=new Xg(e)}setContentEncryptionKey(e){return this.#r.setContentEncryptionKey(e),this}setInitializationVector(e){return this.#r.setInitializationVector(e),this}setProtectedHeader(e){return this.#r.setProtectedHeader(e),this}setKeyManagementParameters(e){return this.#r.setKeyManagementParameters(e),this}async encrypt(e,n){const s=await this.#r.encrypt(e,n);return[s.protected,s.encrypted_key,s.iv,s.ciphertext,s.tag].join(".")}}let _n;_n={jwkToPublicKey:async t=>await Bg(t,"RSA-OAEP"),encryptPayload:async(t,e)=>{const n=new TextEncoder().encode(t);return await new e0(n).setProtectedHeader({alg:"RSA-OAEP",enc:"A256GCM"}).encrypt(e)}},_n.createJWT=async(t,e=void 0)=>{const n=$s(JSON.stringify(t));let s,a="";if(e){a=$s(JSON.stringify({typ:"JWT",kid:Ff(e),alg:"HS256"}));const c=[a,n].join(".");s=jo(c,e,"base64url")}else a=$s(JSON.stringify({typ:"JWT",alg:"none"}));return[a,n,s].join(".")},_n.parseJWT=t=>{const[e,n,s]=t.split("."),a=JSON.parse(Gs(e)),c=JSON.parse(Gs(n));return{header:a,body:c,signature:s}};//! moment.js
33
+ }`;var ge=Pp(function(){return Re(g,re+"return "+G).apply(n,w)});if(ge.source=G,Ec(ge))throw ge;return ge}function mO(r){return De(r).toLowerCase()}function gO(r){return De(r).toUpperCase()}function yO(r,i,o){if(r=De(r),r&&(o||i===n))return Fh(r);if(!r||!(i=It(i)))return r;var f=fr(r),d=fr(i),g=Wh(f,d),w=Hh(f,d)+1;return fn(f,g,w).join("")}function _O(r,i,o){if(r=De(r),r&&(o||i===n))return r.slice(0,Kh(r)+1);if(!r||!(i=It(i)))return r;var f=fr(r),d=Hh(f,fr(i))+1;return fn(f,0,d).join("")}function wO(r,i,o){if(r=De(r),r&&(o||i===n))return r.replace(Eu,"");if(!r||!(i=It(i)))return r;var f=fr(r),d=Wh(f,fr(i));return fn(f,d).join("")}function bO(r,i){var o=S,f=M;if(je(i)){var d="separator"in i?i.separator:d;o="length"in i?me(i.length):o,f="omission"in i?It(i.omission):f}r=De(r);var g=r.length;if(Xn(r)){var w=fr(r);g=w.length}if(o>=g)return r;var v=o-ei(f);if(v<1)return f;var x=w?fn(w,0,v).join(""):r.slice(0,v);if(d===n)return x+f;if(w&&(v+=x.length-v),Ac(d)){if(r.slice(v).search(d)){var H,K=x;for(d.global||(d=Hu(d.source,De(oh.exec(d))+"g")),d.lastIndex=0;H=d.exec(K);)var G=H.index;x=x.slice(0,G===n?v:G)}}else if(r.indexOf(It(d),v)!=v){var j=x.lastIndexOf(d);j>-1&&(x=x.slice(0,j))}return x+f}function SO(r){return r=De(r),r&&D1.test(r)?r.replace(ih,Jb):r}var vO=oi(function(r,i,o){return r+(o?" ":"")+i.toUpperCase()}),Cc=Rd("toUpperCase");function xp(r,i,o){return r=De(r),i=o?n:i,i===n?$b(r)?Xb(r):Ub(r):r.match(i)||[]}var Pp=ye(function(r,i){try{return Ut(r,n,i)}catch(o){return Ec(o)?o:new ue(o)}}),TO=$r(function(r,i){return Qt(i,function(o){o=kr(o),Kr(r,o,vc(r[o],r))}),r});function EO(r){var i=r==null?0:r.length,o=se();return r=i?Ve(r,function(f){if(typeof f[1]!="function")throw new Zt(u);return[o(f[0]),f[1]]}):[],ye(function(f){for(var d=-1;++d<i;){var g=r[d];if(Ut(g[0],this,f))return Ut(g[1],this,f)}})}function AO(r){return JS(er(r,T))}function xc(r){return function(){return r}}function OO(r,i){return r==null||r!==r?i:r}var kO=Md(),CO=Md(!0);function Mt(r){return r}function Pc(r){return cd(typeof r=="function"?r:er(r,T))}function xO(r){return fd(er(r,T))}function PO(r,i){return hd(r,er(i,T))}var RO=ye(function(r,i){return function(o){return Zi(o,r,i)}}),DO=ye(function(r,i){return function(o){return Zi(r,o,i)}});function Rc(r,i,o){var f=ot(i),d=Ta(i,f);o==null&&!(je(i)&&(d.length||!f.length))&&(o=i,i=r,r=this,d=Ta(i,ot(i)));var g=!(je(o)&&"chain"in o)||!!o.chain,w=Vr(r);return Qt(d,function(v){var x=i[v];r[v]=x,w&&(r.prototype[v]=function(){var H=this.__chain__;if(g||H){var K=r(this.__wrapped__),G=K.__actions__=Pt(this.__actions__);return G.push({func:x,args:arguments,thisArg:r}),K.__chain__=H,K}return x.apply(r,sn([this.value()],arguments))})}),r}function MO(){return ft._===this&&(ft._=sS),this}function Dc(){}function LO(r){return r=me(r),ye(function(i){return dd(i,r)})}var NO=cc(Ve),UO=cc(Lh),BO=cc(Lu);function Rp(r){return gc(r)?Nu(kr(r)):dv(r)}function IO(r){return function(i){return r==null?n:Pn(r,i)}}var FO=Nd(),WO=Nd(!0);function Mc(){return[]}function Lc(){return!1}function HO(){return{}}function YO(){return""}function KO(){return!0}function qO(r,i){if(r=me(r),r<1||r>D)return[];var o=J,f=mt(r,J);i=se(i),r-=J;for(var d=Iu(f,i);++o<r;)i(o);return d}function $O(r){return fe(r)?Ve(r,kr):Ft(r)?[r]:Pt(Qd(De(r)))}function GO(r){var i=++nS;return De(r)+i}var VO=xa(function(r,i){return r+i},0),zO=lc("ceil"),jO=xa(function(r,i){return r/i},1),JO=lc("floor");function QO(r){return r&&r.length?va(r,Mt,ju):n}function ZO(r,i){return r&&r.length?va(r,se(i,2),ju):n}function XO(r){return Bh(r,Mt)}function ek(r,i){return Bh(r,se(i,2))}function tk(r){return r&&r.length?va(r,Mt,Xu):n}function rk(r,i){return r&&r.length?va(r,se(i,2),Xu):n}var nk=xa(function(r,i){return r*i},1),ik=lc("round"),sk=xa(function(r,i){return r-i},0);function ak(r){return r&&r.length?Bu(r,Mt):0}function ok(r,i){return r&&r.length?Bu(r,se(i,2)):0}return p.after=xE,p.ary=up,p.assign=gA,p.assignIn=vp,p.assignInWith=Ya,p.assignWith=yA,p.at=_A,p.before=cp,p.bind=vc,p.bindAll=TO,p.bindKey=lp,p.castArray=HE,p.chain=sp,p.chunk=Jv,p.compact=Qv,p.concat=Zv,p.cond=EO,p.conforms=AO,p.constant=xc,p.countBy=aE,p.create=wA,p.curry=fp,p.curryRight=hp,p.debounce=dp,p.defaults=bA,p.defaultsDeep=SA,p.defer=PE,p.delay=RE,p.difference=Xv,p.differenceBy=eT,p.differenceWith=tT,p.drop=rT,p.dropRight=nT,p.dropRightWhile=iT,p.dropWhile=sT,p.fill=aT,p.filter=uE,p.flatMap=fE,p.flatMapDeep=hE,p.flatMapDepth=dE,p.flatten=tp,p.flattenDeep=oT,p.flattenDepth=uT,p.flip=DE,p.flow=kO,p.flowRight=CO,p.fromPairs=cT,p.functions=CA,p.functionsIn=xA,p.groupBy=pE,p.initial=fT,p.intersection=hT,p.intersectionBy=dT,p.intersectionWith=pT,p.invert=RA,p.invertBy=DA,p.invokeMap=gE,p.iteratee=Pc,p.keyBy=yE,p.keys=ot,p.keysIn=Dt,p.map=Ua,p.mapKeys=LA,p.mapValues=NA,p.matches=xO,p.matchesProperty=PO,p.memoize=Ia,p.merge=UA,p.mergeWith=Tp,p.method=RO,p.methodOf=DO,p.mixin=Rc,p.negate=Fa,p.nthArg=LO,p.omit=BA,p.omitBy=IA,p.once=ME,p.orderBy=_E,p.over=NO,p.overArgs=LE,p.overEvery=UO,p.overSome=BO,p.partial=Tc,p.partialRight=pp,p.partition=wE,p.pick=FA,p.pickBy=Ep,p.property=Rp,p.propertyOf=IO,p.pull=_T,p.pullAll=np,p.pullAllBy=wT,p.pullAllWith=bT,p.pullAt=ST,p.range=FO,p.rangeRight=WO,p.rearg=NE,p.reject=vE,p.remove=vT,p.rest=UE,p.reverse=bc,p.sampleSize=EE,p.set=HA,p.setWith=YA,p.shuffle=AE,p.slice=TT,p.sortBy=CE,p.sortedUniq=PT,p.sortedUniqBy=RT,p.split=fO,p.spread=BE,p.tail=DT,p.take=MT,p.takeRight=LT,p.takeRightWhile=NT,p.takeWhile=UT,p.tap=QT,p.throttle=IE,p.thru=Na,p.toArray=wp,p.toPairs=Ap,p.toPairsIn=Op,p.toPath=$O,p.toPlainObject=Sp,p.transform=KA,p.unary=FE,p.union=BT,p.unionBy=IT,p.unionWith=FT,p.uniq=WT,p.uniqBy=HT,p.uniqWith=YT,p.unset=qA,p.unzip=Sc,p.unzipWith=ip,p.update=$A,p.updateWith=GA,p.values=li,p.valuesIn=VA,p.without=KT,p.words=xp,p.wrap=WE,p.xor=qT,p.xorBy=$T,p.xorWith=GT,p.zip=VT,p.zipObject=zT,p.zipObjectDeep=jT,p.zipWith=JT,p.entries=Ap,p.entriesIn=Op,p.extend=vp,p.extendWith=Ya,Rc(p,p),p.add=VO,p.attempt=Pp,p.camelCase=QA,p.capitalize=kp,p.ceil=zO,p.clamp=zA,p.clone=YE,p.cloneDeep=qE,p.cloneDeepWith=$E,p.cloneWith=KE,p.conformsTo=GE,p.deburr=Cp,p.defaultTo=OO,p.divide=jO,p.endsWith=ZA,p.eq=dr,p.escape=XA,p.escapeRegExp=eO,p.every=oE,p.find=cE,p.findIndex=Xd,p.findKey=vA,p.findLast=lE,p.findLastIndex=ep,p.findLastKey=TA,p.floor=JO,p.forEach=ap,p.forEachRight=op,p.forIn=EA,p.forInRight=AA,p.forOwn=OA,p.forOwnRight=kA,p.get=Oc,p.gt=VE,p.gte=zE,p.has=PA,p.hasIn=kc,p.head=rp,p.identity=Mt,p.includes=mE,p.indexOf=lT,p.inRange=jA,p.invoke=MA,p.isArguments=Mn,p.isArray=fe,p.isArrayBuffer=jE,p.isArrayLike=Rt,p.isArrayLikeObject=et,p.isBoolean=JE,p.isBuffer=hn,p.isDate=QE,p.isElement=ZE,p.isEmpty=XE,p.isEqual=eA,p.isEqualWith=tA,p.isError=Ec,p.isFinite=rA,p.isFunction=Vr,p.isInteger=mp,p.isLength=Wa,p.isMap=gp,p.isMatch=nA,p.isMatchWith=iA,p.isNaN=sA,p.isNative=aA,p.isNil=uA,p.isNull=oA,p.isNumber=yp,p.isObject=je,p.isObjectLike=Je,p.isPlainObject=is,p.isRegExp=Ac,p.isSafeInteger=cA,p.isSet=_p,p.isString=Ha,p.isSymbol=Ft,p.isTypedArray=ci,p.isUndefined=lA,p.isWeakMap=fA,p.isWeakSet=hA,p.join=mT,p.kebabCase=tO,p.last=rr,p.lastIndexOf=gT,p.lowerCase=rO,p.lowerFirst=nO,p.lt=dA,p.lte=pA,p.max=QO,p.maxBy=ZO,p.mean=XO,p.meanBy=ek,p.min=tk,p.minBy=rk,p.stubArray=Mc,p.stubFalse=Lc,p.stubObject=HO,p.stubString=YO,p.stubTrue=KO,p.multiply=nk,p.nth=yT,p.noConflict=MO,p.noop=Dc,p.now=Ba,p.pad=iO,p.padEnd=sO,p.padStart=aO,p.parseInt=oO,p.random=JA,p.reduce=bE,p.reduceRight=SE,p.repeat=uO,p.replace=cO,p.result=WA,p.round=ik,p.runInContext=A,p.sample=TE,p.size=OE,p.snakeCase=lO,p.some=kE,p.sortedIndex=ET,p.sortedIndexBy=AT,p.sortedIndexOf=OT,p.sortedLastIndex=kT,p.sortedLastIndexBy=CT,p.sortedLastIndexOf=xT,p.startCase=hO,p.startsWith=dO,p.subtract=sk,p.sum=ak,p.sumBy=ok,p.template=pO,p.times=qO,p.toFinite=zr,p.toInteger=me,p.toLength=bp,p.toLower=mO,p.toNumber=nr,p.toSafeInteger=mA,p.toString=De,p.toUpper=gO,p.trim=yO,p.trimEnd=_O,p.trimStart=wO,p.truncate=bO,p.unescape=SO,p.uniqueId=GO,p.upperCase=vO,p.upperFirst=Cc,p.each=ap,p.eachRight=op,p.first=rp,Rc(p,(function(){var r={};return Ar(p,function(i,o){Me.call(p.prototype,o)||(r[o]=i)}),r})(),{chain:!1}),p.VERSION=s,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){p[r].placeholder=p}),Qt(["drop","take"],function(r,i){Se.prototype[r]=function(o){o=o===n?1:it(me(o),0);var f=this.__filtered__&&!i?new Se(this):this.clone();return f.__filtered__?f.__takeCount__=mt(o,f.__takeCount__):f.__views__.push({size:mt(o,J),type:r+(f.__dir__<0?"Right":"")}),f},Se.prototype[r+"Right"]=function(o){return this.reverse()[r](o).reverse()}}),Qt(["filter","map","takeWhile"],function(r,i){var o=i+1,f=o==N||o==C;Se.prototype[r]=function(d){var g=this.clone();return g.__iteratees__.push({iteratee:se(d,3),type:o}),g.__filtered__=g.__filtered__||f,g}}),Qt(["head","last"],function(r,i){var o="take"+(i?"Right":"");Se.prototype[r]=function(){return this[o](1).value()[0]}}),Qt(["initial","tail"],function(r,i){var o="drop"+(i?"":"Right");Se.prototype[r]=function(){return this.__filtered__?new Se(this):this[o](1)}}),Se.prototype.compact=function(){return this.filter(Mt)},Se.prototype.find=function(r){return this.filter(r).head()},Se.prototype.findLast=function(r){return this.reverse().find(r)},Se.prototype.invokeMap=ye(function(r,i){return typeof r=="function"?new Se(this):this.map(function(o){return Zi(o,r,i)})}),Se.prototype.reject=function(r){return this.filter(Fa(se(r)))},Se.prototype.slice=function(r,i){r=me(r);var o=this;return o.__filtered__&&(r>0||i<0)?new Se(o):(r<0?o=o.takeRight(-r):r&&(o=o.drop(r)),i!==n&&(i=me(i),o=i<0?o.dropRight(-i):o.take(i-r)),o)},Se.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Se.prototype.toArray=function(){return this.take(J)},Ar(Se.prototype,function(r,i){var o=/^(?:filter|find|map|reject)|While$/.test(i),f=/^(?:head|last)$/.test(i),d=p[f?"take"+(i=="last"?"Right":""):i],g=f||/^find/.test(i);d&&(p.prototype[i]=function(){var w=this.__wrapped__,v=f?[1]:arguments,x=w instanceof Se,H=v[0],K=x||fe(w),G=function(we){var Te=d.apply(p,sn([we],v));return f&&j?Te[0]:Te};K&&o&&typeof H=="function"&&H.length!=1&&(x=K=!1);var j=this.__chain__,re=!!this.__actions__.length,ae=g&&!j,ge=x&&!re;if(!g&&K){w=ge?w:new Se(this);var oe=r.apply(w,v);return oe.__actions__.push({func:Na,args:[G],thisArg:n}),new Xt(oe,j)}return ae&&ge?r.apply(this,v):(oe=this.thru(G),ae?f?oe.value()[0]:oe.value():oe)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(r){var i=oa[r],o=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",f=/^(?:pop|shift)$/.test(r);p.prototype[r]=function(){var d=arguments;if(f&&!this.__chain__){var g=this.value();return i.apply(fe(g)?g:[],d)}return this[o](function(w){return i.apply(fe(w)?w:[],d)})}}),Ar(Se.prototype,function(r,i){var o=p[i];if(o){var f=o.name+"";Me.call(ii,f)||(ii[f]=[]),ii[f].push({name:i,func:o})}}),ii[Ca(n,ne).name]=[{name:"wrapper",func:n}],Se.prototype.clone=SS,Se.prototype.reverse=vS,Se.prototype.value=TS,p.prototype.at=ZT,p.prototype.chain=XT,p.prototype.commit=eE,p.prototype.next=tE,p.prototype.plant=nE,p.prototype.reverse=iE,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=sE,p.prototype.first=p.prototype.head,$i&&(p.prototype[$i]=rE),p}),ti=eS();An?((An.exports=ti)._=ti,Pu._=ti):ft._=ti}).call(lg)})(wi,wi.exports)),wi.exports}var ro=fg();const ut=Sl(ro);var hg=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,no=Math.ceil,Yt=Math.floor,Ot="[BigNumber Error] ",Tl=Ot+"Number primitive has more than 15 significant digits: ",sr=1e14,ce=14,io=9007199254740991,so=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Jr=1e7,st=1e9;function El(t){var e,n,s,a=Y.prototype={constructor:Y,toString:null,valueOf:null},c=new Y(1),u=20,l=4,h=-7,m=21,b=-1e7,T=1e7,P=!1,$=1,O=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz",ne=!0;function Y(y,_){var S,M,k,R,N,E,C,L,D=this;if(!(D instanceof Y))return new Y(y,_);if(_==null){if(y&&y._isBigNumber===!0){D.s=y.s,!y.c||y.e>T?D.c=D.e=null:y.e<b?D.c=[D.e=0]:(D.e=y.e,D.c=y.c.slice());return}if((E=typeof y=="number")&&y*0==0){if(D.s=1/y<0?(y=-y,-1):1,y===~~y){for(R=0,N=y;N>=10;N/=10,R++);R>T?D.c=D.e=null:(D.e=R,D.c=[y]);return}L=String(y)}else{if(!hg.test(L=String(y)))return s(D,L,E);D.s=L.charCodeAt(0)==45?(L=L.slice(1),-1):1}(R=L.indexOf("."))>-1&&(L=L.replace(".","")),(N=L.search(/e/i))>0?(R<0&&(R=N),R+=+L.slice(N+1),L=L.substring(0,N)):R<0&&(R=L.length)}else{if(ze(_,2,F.length,"Base"),_==10&&ne)return D=new Y(y),Fe(D,u+D.e+1,l);if(L=String(y),E=typeof y=="number"){if(y*0!=0)return s(D,L,E,_);if(D.s=1/y<0?(L=L.slice(1),-1):1,Y.DEBUG&&L.replace(/^0\.0*|\./,"").length>15)throw Error(Tl+y)}else D.s=L.charCodeAt(0)===45?(L=L.slice(1),-1):1;for(S=F.slice(0,_),R=N=0,C=L.length;N<C;N++)if(S.indexOf(M=L.charAt(N))<0){if(M=="."){if(N>R){R=C;continue}}else if(!k&&(L==L.toUpperCase()&&(L=L.toLowerCase())||L==L.toLowerCase()&&(L=L.toUpperCase()))){k=!0,N=-1,R=0;continue}return s(D,String(y),E,_)}E=!1,L=n(L,_,10,D.s),(R=L.indexOf("."))>-1?L=L.replace(".",""):R=L.length}for(N=0;L.charCodeAt(N)===48;N++);for(C=L.length;L.charCodeAt(--C)===48;);if(L=L.slice(N,++C)){if(C-=N,E&&Y.DEBUG&&C>15&&(y>io||y!==Yt(y)))throw Error(Tl+D.s*y);if((R=R-N-1)>T)D.c=D.e=null;else if(R<b)D.c=[D.e=0];else{if(D.e=R,D.c=[],N=(R+1)%ce,R<0&&(N+=ce),N<C){for(N&&D.c.push(+L.slice(0,N)),C-=ce;N<C;)D.c.push(+L.slice(N,N+=ce));N=ce-(L=L.slice(N)).length}else N-=C;for(;N--;L+="0");D.c.push(+L)}}else D.c=[D.e=0]}Y.clone=El,Y.ROUND_UP=0,Y.ROUND_DOWN=1,Y.ROUND_CEIL=2,Y.ROUND_FLOOR=3,Y.ROUND_HALF_UP=4,Y.ROUND_HALF_DOWN=5,Y.ROUND_HALF_EVEN=6,Y.ROUND_HALF_CEIL=7,Y.ROUND_HALF_FLOOR=8,Y.EUCLID=9,Y.config=Y.set=function(y){var _,S;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(_="DECIMAL_PLACES")&&(S=y[_],ze(S,0,st,_),u=S),y.hasOwnProperty(_="ROUNDING_MODE")&&(S=y[_],ze(S,0,8,_),l=S),y.hasOwnProperty(_="EXPONENTIAL_AT")&&(S=y[_],S&&S.pop?(ze(S[0],-st,0,_),ze(S[1],0,st,_),h=S[0],m=S[1]):(ze(S,-st,st,_),h=-(m=S<0?-S:S))),y.hasOwnProperty(_="RANGE"))if(S=y[_],S&&S.pop)ze(S[0],-st,-1,_),ze(S[1],1,st,_),b=S[0],T=S[1];else if(ze(S,-st,st,_),S)b=-(T=S<0?-S:S);else throw Error(Ot+_+" cannot be zero: "+S);if(y.hasOwnProperty(_="CRYPTO"))if(S=y[_],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=S;else throw P=!S,Error(Ot+"crypto unavailable");else P=S;else throw Error(Ot+_+" not true or false: "+S);if(y.hasOwnProperty(_="MODULO_MODE")&&(S=y[_],ze(S,0,9,_),$=S),y.hasOwnProperty(_="POW_PRECISION")&&(S=y[_],ze(S,0,st,_),O=S),y.hasOwnProperty(_="FORMAT"))if(S=y[_],typeof S=="object")I=S;else throw Error(Ot+_+" not an object: "+S);if(y.hasOwnProperty(_="ALPHABET"))if(S=y[_],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))ne=S.slice(0,10)=="0123456789",F=S;else throw Error(Ot+_+" invalid: "+S)}else throw Error(Ot+"Object expected: "+y);return{DECIMAL_PLACES:u,ROUNDING_MODE:l,EXPONENTIAL_AT:[h,m],RANGE:[b,T],CRYPTO:P,MODULO_MODE:$,POW_PRECISION:O,FORMAT:I,ALPHABET:F}},Y.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!Y.DEBUG)return!0;var _,S,M=y.c,k=y.e,R=y.s;e:if({}.toString.call(M)=="[object Array]"){if((R===1||R===-1)&&k>=-st&&k<=st&&k===Yt(k)){if(M[0]===0){if(k===0&&M.length===1)return!0;break e}if(_=(k+1)%ce,_<1&&(_+=ce),String(M[0]).length==_){for(_=0;_<M.length;_++)if(S=M[_],S<0||S>=sr||S!==Yt(S))break e;if(S!==0)return!0}}}else if(M===null&&k===null&&(R===null||R===1||R===-1))return!0;throw Error(Ot+"Invalid BigNumber: "+y)},Y.maximum=Y.max=function(){return ve(arguments,-1)},Y.minimum=Y.min=function(){return ve(arguments,1)},Y.random=(function(){var y=9007199254740992,_=Math.random()*y&2097151?function(){return Yt(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var M,k,R,N,E,C=0,L=[],D=new Y(c);if(S==null?S=u:ze(S,0,st),N=no(S/ce),P)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(N*=2));C<N;)E=M[C]*131072+(M[C+1]>>>11),E>=9e15?(k=crypto.getRandomValues(new Uint32Array(2)),M[C]=k[0],M[C+1]=k[1]):(L.push(E%1e14),C+=2);C=N/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(N*=7);C<N;)E=(M[C]&31)*281474976710656+M[C+1]*1099511627776+M[C+2]*4294967296+M[C+3]*16777216+(M[C+4]<<16)+(M[C+5]<<8)+M[C+6],E>=9e15?crypto.randomBytes(7).copy(M,C):(L.push(E%1e14),C+=7);C=N/7}else throw P=!1,Error(Ot+"crypto unavailable");if(!P)for(;C<N;)E=_(),E<9e15&&(L[C++]=E%1e14);for(N=L[--C],S%=ce,N&&S&&(E=so[ce-S],L[C]=Yt(N/E)*E);L[C]===0;L.pop(),C--);if(C<0)L=[R=0];else{for(R=-1;L[0]===0;L.splice(0,1),R-=ce);for(C=1,E=L[0];E>=10;E/=10,C++);C<ce&&(R-=ce-C)}return D.e=R,D.c=L,D}})(),Y.sum=function(){for(var y=1,_=arguments,S=new Y(_[0]);y<_.length;)S=S.plus(_[y++]);return S},n=(function(){var y="0123456789";function _(S,M,k,R){for(var N,E=[0],C,L=0,D=S.length;L<D;){for(C=E.length;C--;E[C]*=M);for(E[0]+=R.indexOf(S.charAt(L++)),N=0;N<E.length;N++)E[N]>k-1&&(E[N+1]==null&&(E[N+1]=0),E[N+1]+=E[N]/k|0,E[N]%=k)}return E.reverse()}return function(S,M,k,R,N){var E,C,L,D,q,te,J,pe,Ne=S.indexOf("."),We=u,le=l;for(Ne>=0&&(D=O,O=0,S=S.replace(".",""),pe=new Y(M),te=pe.pow(S.length-Ne),O=D,pe.c=_(xr(qt(te.c),te.e,"0"),10,k,y),pe.e=pe.c.length),J=_(S,M,k,N?(E=F,y):(E=y,F)),L=D=J.length;J[--D]==0;J.pop());if(!J[0])return E.charAt(0);if(Ne<0?--L:(te.c=J,te.e=L,te.s=R,te=e(te,pe,We,le,k),J=te.c,q=te.r,L=te.e),C=L+We+1,Ne=J[C],D=k/2,q=q||C<0||J[C+1]!=null,q=le<4?(Ne!=null||q)&&(le==0||le==(te.s<0?3:2)):Ne>D||Ne==D&&(le==4||q||le==6&&J[C-1]&1||le==(te.s<0?8:7)),C<1||!J[0])S=q?xr(E.charAt(1),-We,E.charAt(0)):E.charAt(0);else{if(J.length=C,q)for(--k;++J[--C]>k;)J[C]=0,C||(++L,J=[1].concat(J));for(D=J.length;!J[--D];);for(Ne=0,S="";Ne<=D;S+=E.charAt(J[Ne++]));S=xr(S,L,E.charAt(0))}return S}})(),e=(function(){function y(M,k,R){var N,E,C,L,D=0,q=M.length,te=k%Jr,J=k/Jr|0;for(M=M.slice();q--;)C=M[q]%Jr,L=M[q]/Jr|0,N=J*C+L*te,E=te*C+N%Jr*Jr+D,D=(E/R|0)+(N/Jr|0)+J*L,M[q]=E%R;return D&&(M=[D].concat(M)),M}function _(M,k,R,N){var E,C;if(R!=N)C=R>N?1:-1;else for(E=C=0;E<R;E++)if(M[E]!=k[E]){C=M[E]>k[E]?1:-1;break}return C}function S(M,k,R,N){for(var E=0;R--;)M[R]-=E,E=M[R]<k[R]?1:0,M[R]=E*N+M[R]-k[R];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,k,R,N,E){var C,L,D,q,te,J,pe,Ne,We,le,Oe,at,Tr,Fr,Fi,wt,Er,bt=M.s==k.s?1:-1,Be=M.c,Ue=k.c;if(!Be||!Be[0]||!Ue||!Ue[0])return new Y(!M.s||!k.s||(Be?Ue&&Be[0]==Ue[0]:!Ue)?NaN:Be&&Be[0]==0||!Ue?bt*0:bt/0);for(Ne=new Y(bt),We=Ne.c=[],L=M.e-k.e,bt=R+L+1,E||(E=sr,L=Kt(M.e/ce)-Kt(k.e/ce),bt=bt/ce|0),D=0;Ue[D]==(Be[D]||0);D++);if(Ue[D]>(Be[D]||0)&&L--,bt<0)We.push(1),q=!0;else{for(Fr=Be.length,wt=Ue.length,D=0,bt+=2,te=Yt(E/(Ue[0]+1)),te>1&&(Ue=y(Ue,te,E),Be=y(Be,te,E),wt=Ue.length,Fr=Be.length),Tr=wt,le=Be.slice(0,wt),Oe=le.length;Oe<wt;le[Oe++]=0);Er=Ue.slice(),Er=[0].concat(Er),Fi=Ue[0],Ue[1]>=E/2&&Fi++;do{if(te=0,C=_(Ue,le,wt,Oe),C<0){if(at=le[0],wt!=Oe&&(at=at*E+(le[1]||0)),te=Yt(at/Fi),te>1)for(te>=E&&(te=E-1),J=y(Ue,te,E),pe=J.length,Oe=le.length;_(J,le,pe,Oe)==1;)te--,S(J,wt<pe?Er:Ue,pe,E),pe=J.length,C=1;else te==0&&(C=te=1),J=Ue.slice(),pe=J.length;if(pe<Oe&&(J=[0].concat(J)),S(le,J,Oe,E),Oe=le.length,C==-1)for(;_(Ue,le,wt,Oe)<1;)te++,S(le,wt<Oe?Er:Ue,Oe,E),Oe=le.length}else C===0&&(te++,le=[0]);We[D++]=te,le[0]?le[Oe++]=Be[Tr]||0:(le=[Be[Tr]],Oe=1)}while((Tr++<Fr||le[0]!=null)&&bt--);q=le[0]!=null,We[0]||We.splice(0,1)}if(E==sr){for(D=1,bt=We[0];bt>=10;bt/=10,D++);Fe(Ne,R+(Ne.e=D+L*ce-1)+1,N,q)}else Ne.e=L,Ne.r=+q;return Ne}})();function Ae(y,_,S,M){var k,R,N,E,C;if(S==null?S=l:ze(S,0,8),!y.c)return y.toString();if(k=y.c[0],N=y.e,_==null)C=qt(y.c),C=M==1||M==2&&(N<=h||N>=m)?bs(C,N):xr(C,N,"0");else if(y=Fe(new Y(y),_,S),R=y.e,C=qt(y.c),E=C.length,M==1||M==2&&(_<=R||R<=h)){for(;E<_;C+="0",E++);C=bs(C,R)}else if(_-=N+(M===2&&R>N),C=xr(C,R,"0"),R+1>E){if(--_>0)for(C+=".";_--;C+="0");}else if(_+=R-E,_>0)for(R+1==E&&(C+=".");_--;C+="0");return y.s<0&&k?"-"+C:C}function ve(y,_){for(var S,M,k=1,R=new Y(y[0]);k<y.length;k++)M=new Y(y[k]),(!M.s||(S=gn(R,M))===_||S===0&&R.s===_)&&(R=M);return R}function _e(y,_,S){for(var M=1,k=_.length;!_[--k];_.pop());for(k=_[0];k>=10;k/=10,M++);return(S=M+S*ce-1)>T?y.c=y.e=null:S<b?y.c=[y.e=0]:(y.e=S,y.c=_),y}s=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,S=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(R,N,E,C){var L,D=E?N:N.replace(k,"");if(M.test(D))R.s=isNaN(D)?null:D<0?-1:1;else{if(!E&&(D=D.replace(y,function(q,te,J){return L=(J=J.toLowerCase())=="x"?16:J=="b"?2:8,!C||C==L?te:q}),C&&(L=C,D=D.replace(_,"$1").replace(S,"0.$1")),N!=D))return new Y(D,L);if(Y.DEBUG)throw Error(Ot+"Not a"+(C?" base "+C:"")+" number: "+N);R.s=null}R.c=R.e=null}})();function Fe(y,_,S,M){var k,R,N,E,C,L,D,q=y.c,te=so;if(q){e:{for(k=1,E=q[0];E>=10;E/=10,k++);if(R=_-k,R<0)R+=ce,N=_,C=q[L=0],D=Yt(C/te[k-N-1]%10);else if(L=no((R+1)/ce),L>=q.length)if(M){for(;q.length<=L;q.push(0));C=D=0,k=1,R%=ce,N=R-ce+1}else break e;else{for(C=E=q[L],k=1;E>=10;E/=10,k++);R%=ce,N=R-ce+k,D=N<0?0:Yt(C/te[k-N-1]%10)}if(M=M||_<0||q[L+1]!=null||(N<0?C:C%te[k-N-1]),M=S<4?(D||M)&&(S==0||S==(y.s<0?3:2)):D>5||D==5&&(S==4||M||S==6&&(R>0?N>0?C/te[k-N]:0:q[L-1])%10&1||S==(y.s<0?8:7)),_<1||!q[0])return q.length=0,M?(_-=y.e+1,q[0]=te[(ce-_%ce)%ce],y.e=-_||0):q[0]=y.e=0,y;if(R==0?(q.length=L,E=1,L--):(q.length=L+1,E=te[ce-R],q[L]=N>0?Yt(C/te[k-N]%te[N])*E:0),M)for(;;)if(L==0){for(R=1,N=q[0];N>=10;N/=10,R++);for(N=q[0]+=E,E=1;N>=10;N/=10,E++);R!=E&&(y.e++,q[0]==sr&&(q[0]=1));break}else{if(q[L]+=E,q[L]!=sr)break;q[L--]=0,E=1}for(R=q.length;q[--R]===0;q.pop());}y.e>T?y.c=y.e=null:y.e<b&&(y.c=[y.e=0])}return y}function Pe(y){var _,S=y.e;return S===null?y.toString():(_=qt(y.c),_=S<=h||S>=m?bs(_,S):xr(_,S,"0"),y.s<0?"-"+_:_)}return a.absoluteValue=a.abs=function(){var y=new Y(this);return y.s<0&&(y.s=1),y},a.comparedTo=function(y,_){return gn(this,new Y(y,_))},a.decimalPlaces=a.dp=function(y,_){var S,M,k,R=this;if(y!=null)return ze(y,0,st),_==null?_=l:ze(_,0,8),Fe(new Y(R),y+R.e+1,_);if(!(S=R.c))return null;if(M=((k=S.length-1)-Kt(this.e/ce))*ce,k=S[k])for(;k%10==0;k/=10,M--);return M<0&&(M=0),M},a.dividedBy=a.div=function(y,_){return e(this,new Y(y,_),u,l)},a.dividedToIntegerBy=a.idiv=function(y,_){return e(this,new Y(y,_),0,1)},a.exponentiatedBy=a.pow=function(y,_){var S,M,k,R,N,E,C,L,D,q=this;if(y=new Y(y),y.c&&!y.isInteger())throw Error(Ot+"Exponent not an integer: "+Pe(y));if(_!=null&&(_=new Y(_)),E=y.e>14,!q.c||!q.c[0]||q.c[0]==1&&!q.e&&q.c.length==1||!y.c||!y.c[0])return D=new Y(Math.pow(+Pe(q),E?y.s*(2-ws(y)):+Pe(y))),_?D.mod(_):D;if(C=y.s<0,_){if(_.c?!_.c[0]:!_.s)return new Y(NaN);M=!C&&q.isInteger()&&_.isInteger(),M&&(q=q.mod(_))}else{if(y.e>9&&(q.e>0||q.e<-1||(q.e==0?q.c[0]>1||E&&q.c[1]>=24e7:q.c[0]<8e13||E&&q.c[0]<=9999975e7)))return R=q.s<0&&ws(y)?-0:0,q.e>-1&&(R=1/R),new Y(C?1/R:R);O&&(R=no(O/ce+2))}for(E?(S=new Y(.5),C&&(y.s=1),L=ws(y)):(k=Math.abs(+Pe(y)),L=k%2),D=new Y(c);;){if(L){if(D=D.times(q),!D.c)break;R?D.c.length>R&&(D.c.length=R):M&&(D=D.mod(_))}if(k){if(k=Yt(k/2),k===0)break;L=k%2}else if(y=y.times(S),Fe(y,y.e+1,1),y.e>14)L=ws(y);else{if(k=+Pe(y),k===0)break;L=k%2}q=q.times(q),R?q.c&&q.c.length>R&&(q.c.length=R):M&&(q=q.mod(_))}return M?D:(C&&(D=c.div(D)),_?D.mod(_):R?Fe(D,O,l,N):D)},a.integerValue=function(y){var _=new Y(this);return y==null?y=l:ze(y,0,8),Fe(_,_.e+1,y)},a.isEqualTo=a.eq=function(y,_){return gn(this,new Y(y,_))===0},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(y,_){return gn(this,new Y(y,_))>0},a.isGreaterThanOrEqualTo=a.gte=function(y,_){return(_=gn(this,new Y(y,_)))===1||_===0},a.isInteger=function(){return!!this.c&&Kt(this.e/ce)>this.c.length-2},a.isLessThan=a.lt=function(y,_){return gn(this,new Y(y,_))<0},a.isLessThanOrEqualTo=a.lte=function(y,_){return(_=gn(this,new Y(y,_)))===-1||_===0},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return this.s>0},a.isZero=function(){return!!this.c&&this.c[0]==0},a.minus=function(y,_){var S,M,k,R,N=this,E=N.s;if(y=new Y(y,_),_=y.s,!E||!_)return new Y(NaN);if(E!=_)return y.s=-_,N.plus(y);var C=N.e/ce,L=y.e/ce,D=N.c,q=y.c;if(!C||!L){if(!D||!q)return D?(y.s=-_,y):new Y(q?N:NaN);if(!D[0]||!q[0])return q[0]?(y.s=-_,y):new Y(D[0]?N:l==3?-0:0)}if(C=Kt(C),L=Kt(L),D=D.slice(),E=C-L){for((R=E<0)?(E=-E,k=D):(L=C,k=q),k.reverse(),_=E;_--;k.push(0));k.reverse()}else for(M=(R=(E=D.length)<(_=q.length))?E:_,E=_=0;_<M;_++)if(D[_]!=q[_]){R=D[_]<q[_];break}if(R&&(k=D,D=q,q=k,y.s=-y.s),_=(M=q.length)-(S=D.length),_>0)for(;_--;D[S++]=0);for(_=sr-1;M>E;){if(D[--M]<q[M]){for(S=M;S&&!D[--S];D[S]=_);--D[S],D[M]+=sr}D[M]-=q[M]}for(;D[0]==0;D.splice(0,1),--L);return D[0]?_e(y,D,L):(y.s=l==3?-1:1,y.c=[y.e=0],y)},a.modulo=a.mod=function(y,_){var S,M,k=this;return y=new Y(y,_),!k.c||!y.s||y.c&&!y.c[0]?new Y(NaN):!y.c||k.c&&!k.c[0]?new Y(k):($==9?(M=y.s,y.s=1,S=e(k,y,0,3),y.s=M,S.s*=M):S=e(k,y,0,$),y=k.minus(S.times(y)),!y.c[0]&&$==1&&(y.s=k.s),y)},a.multipliedBy=a.times=function(y,_){var S,M,k,R,N,E,C,L,D,q,te,J,pe,Ne,We,le=this,Oe=le.c,at=(y=new Y(y,_)).c;if(!Oe||!at||!Oe[0]||!at[0])return!le.s||!y.s||Oe&&!Oe[0]&&!at||at&&!at[0]&&!Oe?y.c=y.e=y.s=null:(y.s*=le.s,!Oe||!at?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(M=Kt(le.e/ce)+Kt(y.e/ce),y.s*=le.s,C=Oe.length,q=at.length,C<q&&(pe=Oe,Oe=at,at=pe,k=C,C=q,q=k),k=C+q,pe=[];k--;pe.push(0));for(Ne=sr,We=Jr,k=q;--k>=0;){for(S=0,te=at[k]%We,J=at[k]/We|0,N=C,R=k+N;R>k;)L=Oe[--N]%We,D=Oe[N]/We|0,E=J*L+D*te,L=te*L+E%We*We+pe[R]+S,S=(L/Ne|0)+(E/We|0)+J*D,pe[R--]=L%Ne;pe[R]=S}return S?++M:pe.splice(0,1),_e(y,pe,M)},a.negated=function(){var y=new Y(this);return y.s=-y.s||null,y},a.plus=function(y,_){var S,M=this,k=M.s;if(y=new Y(y,_),_=y.s,!k||!_)return new Y(NaN);if(k!=_)return y.s=-_,M.minus(y);var R=M.e/ce,N=y.e/ce,E=M.c,C=y.c;if(!R||!N){if(!E||!C)return new Y(k/0);if(!E[0]||!C[0])return C[0]?y:new Y(E[0]?M:k*0)}if(R=Kt(R),N=Kt(N),E=E.slice(),k=R-N){for(k>0?(N=R,S=C):(k=-k,S=E),S.reverse();k--;S.push(0));S.reverse()}for(k=E.length,_=C.length,k-_<0&&(S=C,C=E,E=S,_=k),k=0;_;)k=(E[--_]=E[_]+C[_]+k)/sr|0,E[_]=sr===E[_]?0:E[_]%sr;return k&&(E=[k].concat(E),++N),_e(y,E,N)},a.precision=a.sd=function(y,_){var S,M,k,R=this;if(y!=null&&y!==!!y)return ze(y,1,st),_==null?_=l:ze(_,0,8),Fe(new Y(R),y,_);if(!(S=R.c))return null;if(k=S.length-1,M=k*ce+1,k=S[k]){for(;k%10==0;k/=10,M--);for(k=S[0];k>=10;k/=10,M++);}return y&&R.e+1>M&&(M=R.e+1),M},a.shiftedBy=function(y){return ze(y,-io,io),this.times("1e"+y)},a.squareRoot=a.sqrt=function(){var y,_,S,M,k,R=this,N=R.c,E=R.s,C=R.e,L=u+4,D=new Y("0.5");if(E!==1||!N||!N[0])return new Y(!E||E<0&&(!N||N[0])?NaN:N?R:1/0);if(E=Math.sqrt(+Pe(R)),E==0||E==1/0?(_=qt(N),(_.length+C)%2==0&&(_+="0"),E=Math.sqrt(+_),C=Kt((C+1)/2)-(C<0||C%2),E==1/0?_="5e"+C:(_=E.toExponential(),_=_.slice(0,_.indexOf("e")+1)+C),S=new Y(_)):S=new Y(E+""),S.c[0]){for(C=S.e,E=C+L,E<3&&(E=0);;)if(k=S,S=D.times(k.plus(e(R,k,L,1))),qt(k.c).slice(0,E)===(_=qt(S.c)).slice(0,E))if(S.e<C&&--E,_=_.slice(E-3,E+1),_=="9999"||!M&&_=="4999"){if(!M&&(Fe(k,k.e+u+2,0),k.times(k).eq(R))){S=k;break}L+=4,E+=4,M=1}else{(!+_||!+_.slice(1)&&_.charAt(0)=="5")&&(Fe(S,S.e+u+2,1),y=!S.times(S).eq(R));break}}return Fe(S,S.e+u+1,l,y)},a.toExponential=function(y,_){return y!=null&&(ze(y,0,st),y++),Ae(this,y,_,1)},a.toFixed=function(y,_){return y!=null&&(ze(y,0,st),y=y+this.e+1),Ae(this,y,_)},a.toFormat=function(y,_,S){var M,k=this;if(S==null)y!=null&&_&&typeof _=="object"?(S=_,_=null):y&&typeof y=="object"?(S=y,y=_=null):S=I;else if(typeof S!="object")throw Error(Ot+"Argument not an object: "+S);if(M=k.toFixed(y,_),k.c){var R,N=M.split("."),E=+S.groupSize,C=+S.secondaryGroupSize,L=S.groupSeparator||"",D=N[0],q=N[1],te=k.s<0,J=te?D.slice(1):D,pe=J.length;if(C&&(R=E,E=C,C=R,pe-=R),E>0&&pe>0){for(R=pe%E||E,D=J.substr(0,R);R<pe;R+=E)D+=L+J.substr(R,E);C>0&&(D+=L+J.slice(R)),te&&(D="-"+D)}M=q?D+(S.decimalSeparator||"")+((C=+S.fractionGroupSize)?q.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):q):D}return(S.prefix||"")+M+(S.suffix||"")},a.toFraction=function(y){var _,S,M,k,R,N,E,C,L,D,q,te,J=this,pe=J.c;if(y!=null&&(E=new Y(y),!E.isInteger()&&(E.c||E.s!==1)||E.lt(c)))throw Error(Ot+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+Pe(E));if(!pe)return new Y(J);for(_=new Y(c),L=S=new Y(c),M=C=new Y(c),te=qt(pe),R=_.e=te.length-J.e-1,_.c[0]=so[(N=R%ce)<0?ce+N:N],y=!y||E.comparedTo(_)>0?R>0?_:L:E,N=T,T=1/0,E=new Y(te),C.c[0]=0;D=e(E,_,0,1),k=S.plus(D.times(M)),k.comparedTo(y)!=1;)S=M,M=k,L=C.plus(D.times(k=L)),C=k,_=E.minus(D.times(k=_)),E=k;return k=e(y.minus(S),M,0,1),C=C.plus(k.times(L)),S=S.plus(k.times(M)),C.s=L.s=J.s,R=R*2,q=e(L,M,R,l).minus(J).abs().comparedTo(e(C,S,R,l).minus(J).abs())<1?[L,M]:[C,S],T=N,q},a.toNumber=function(){return+Pe(this)},a.toPrecision=function(y,_){return y!=null&&ze(y,1,st),Ae(this,y,_,2)},a.toString=function(y){var _,S=this,M=S.s,k=S.e;return k===null?M?(_="Infinity",M<0&&(_="-"+_)):_="NaN":(y==null?_=k<=h||k>=m?bs(qt(S.c),k):xr(qt(S.c),k,"0"):y===10&&ne?(S=Fe(new Y(S),u+k+1,l),_=xr(qt(S.c),S.e,"0")):(ze(y,2,F.length,"Base"),_=n(xr(qt(S.c),k,"0"),10,y,M,!0)),M<0&&S.c[0]&&(_="-"+_)),_},a.valueOf=a.toJSON=function(){return Pe(this)},a._isBigNumber=!0,a[Symbol.toStringTag]="BigNumber",a[Symbol.for("nodejs.util.inspect.custom")]=a.valueOf,t!=null&&Y.set(t),Y}function Kt(t){var e=t|0;return t>0||t===e?e:e-1}function qt(t){for(var e,n,s=1,a=t.length,c=t[0]+"";s<a;){for(e=t[s++]+"",n=ce-e.length;n--;e="0"+e);c+=e}for(a=c.length;c.charCodeAt(--a)===48;);return c.slice(0,a+1||1)}function gn(t,e){var n,s,a=t.c,c=e.c,u=t.s,l=e.s,h=t.e,m=e.e;if(!u||!l)return null;if(n=a&&!a[0],s=c&&!c[0],n||s)return n?s?0:-l:u;if(u!=l)return u;if(n=u<0,s=h==m,!a||!c)return s?0:!a^n?1:-1;if(!s)return h>m^n?1:-1;for(l=(h=a.length)<(m=c.length)?h:m,u=0;u<l;u++)if(a[u]!=c[u])return a[u]>c[u]^n?1:-1;return h==m?0:h>m^n?1:-1}function ze(t,e,n,s){if(t<e||t>n||t!==Yt(t))throw Error(Ot+(s||"Argument")+(typeof t=="number"?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function ws(t){var e=t.c.length-1;return Kt(t.e/ce)==e&&t.c[e]%2!=0}function bs(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function xr(t,e,n){var s,a;if(e<0){for(a=n+".";++e;a+=n);t=a+t}else if(s=t.length,++e>s){for(a=n,e-=s;--e;a+=n);t+=a}else e<s&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Ze=El();const yn=new TextEncoder,ao=new TextDecoder,Ss=2**32;function bi(...t){const e=t.reduce((a,{length:c})=>a+c,0),n=new Uint8Array(e);let s=0;for(const a of t)n.set(a,s),s+=a.length;return n}function oo(t,e,n){if(e<0||e>=Ss)throw new RangeError(`value must be >= 0 and <= ${Ss-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,e&255],n)}function dg(t){const e=Math.floor(t/Ss),n=t%Ss,s=new Uint8Array(8);return oo(s,e,0),oo(s,n,4),s}function uo(t){const e=new Uint8Array(4);return oo(e,t),e}function pg(t){if(Uint8Array.prototype.toBase64)return t.toBase64();const e=32768,n=[];for(let s=0;s<t.length;s+=e)n.push(String.fromCharCode.apply(null,t.subarray(s,s+e)));return btoa(n.join(""))}function mg(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(t);const e=atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n}function Al(t){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof t=="string"?t:ao.decode(t),{alphabet:"base64url"});let e=t;e instanceof Uint8Array&&(e=ao.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return mg(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}function $t(t){let e=t;return typeof e=="string"&&(e=yn.encode(e)),Uint8Array.prototype.toBase64?e.toBase64({alphabet:"base64url",omitPadding:!0}):pg(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class Ol extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,n){super(e,n),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class yt extends Ol{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class Qr extends Ol{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"}function kl(t){switch(t){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new yt(`Unsupported JWE Algorithm: ${t}`)}}const gg=t=>crypto.getRandomValues(new Uint8Array(kl(t)>>3)),yg=(t,e)=>{if(e.length<<3!==kl(t))throw new Qr("Invalid Initialization Vector length")},Cl=(t,e)=>{const n=t.byteLength<<3;if(n!==e)throw new Qr(`Invalid Content Encryption Key length. Expected ${e} bits, got ${n} bits`)};function Zr(t,e="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${e} must be ${t}`)}function vs(t,e){return t.name===e}function _g(t){return parseInt(t.name.slice(4),10)}function wg(t,e){if(e&&!t.usages.includes(e))throw new TypeError(`CryptoKey does not support this operation, its usages must include ${e}.`)}function Bn(t,e,n){switch(e){case"A128GCM":case"A192GCM":case"A256GCM":{if(!vs(t.algorithm,"AES-GCM"))throw Zr("AES-GCM");const s=parseInt(e.slice(1,4),10);if(t.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!vs(t.algorithm,"AES-KW"))throw Zr("AES-KW");const s=parseInt(e.slice(1,4),10);if(t.algorithm.length!==s)throw Zr(s,"algorithm.length");break}case"ECDH":{switch(t.algorithm.name){case"ECDH":case"X25519":break;default:throw Zr("ECDH or X25519")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!vs(t.algorithm,"PBKDF2"))throw Zr("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!vs(t.algorithm,"RSA-OAEP"))throw Zr("RSA-OAEP");const s=parseInt(e.slice(9),10)||1;if(_g(t.algorithm.hash)!==s)throw Zr(`SHA-${s}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}wg(t,n)}function xl(t,e,...n){if(n=n.filter(Boolean),n.length>2){const s=n.pop();t+=`one of type ${n.join(", ")}, or ${s}.`}else n.length===2?t+=`one of type ${n[0]} or ${n[1]}.`:t+=`of type ${n[0]}.`;return e==null?t+=` Received ${e}`:typeof e=="function"&&e.name?t+=` Received function ${e.name}`:typeof e=="object"&&e!=null&&e.constructor?.name&&(t+=` Received an instance of ${e.constructor.name}`),t}const co=(t,...e)=>xl("Key must be ",t,...e);function Pl(t,e,...n){return xl(`Key for the ${t} algorithm must be `,e,...n)}function Rl(t){if(!Si(t))throw new Error("CryptoKey instance expected")}function Si(t){return t?.[Symbol.toStringTag]==="CryptoKey"}function lo(t){return t?.[Symbol.toStringTag]==="KeyObject"}const Dl=t=>Si(t)||lo(t),bg=(...t)=>{const e=t.filter(Boolean);if(e.length===0||e.length===1)return!0;let n;for(const s of e){const a=Object.keys(s);if(!n||n.size===0){n=new Set(a);continue}for(const c of a){if(n.has(c))return!1;n.add(c)}}return!0};function Sg(t){return typeof t=="object"&&t!==null}const Ml=t=>{if(!Sg(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function vg(t,e){if(t.algorithm.length!==parseInt(e.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${e}`)}function Tg(t,e,n){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,"AES-KW",!0,[n]):(Bn(t,e,n),t)}async function fo(t,e,n){const s=await Tg(e,t,"wrapKey");vg(s,t);const a=await crypto.subtle.importKey("raw",n,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",a,s,"AES-KW"))}const Eg=async(t,e)=>{const n=`SHA-${t.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,e))};function ho(t){return bi(uo(t.length),t)}async function Ag(t,e,n){const s=e>>3,a=32,c=Math.ceil(s/a),u=new Uint8Array(c*a);for(let l=1;l<=c;l++){const h=new Uint8Array(4+t.length+n.length);h.set(uo(l),0),h.set(t,4),h.set(n,4+t.length);const m=await Eg("sha256",h);u.set(m,(l-1)*a)}return u.slice(0,s)}async function Og(t,e,n,s,a=new Uint8Array(0),c=new Uint8Array(0)){Bn(t,"ECDH"),Bn(e,"ECDH","deriveBits");const u=ho(yn.encode(n)),l=ho(a),h=ho(c),m=uo(s),b=new Uint8Array(0),T=bi(u,l,h,m,b),P=new Uint8Array(await crypto.subtle.deriveBits({name:t.algorithm.name,public:t},e,kg(t)));return Ag(P,s,T)}function kg(t){return t.algorithm.name==="X25519"?256:Math.ceil(parseInt(t.algorithm.namedCurve.slice(-3),10)/8)<<3}function Cg(t){switch(t.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return t.algorithm.name==="X25519"}}function xg(t,e){return t instanceof Uint8Array?crypto.subtle.importKey("raw",t,"PBKDF2",!1,["deriveBits"]):(Bn(t,e,"deriveBits"),t)}const Pg=(t,e)=>bi(yn.encode(t),new Uint8Array([0]),e);async function Rg(t,e,n,s){if(!(t instanceof Uint8Array)||t.length<8)throw new Qr("PBES2 Salt Input must be 8 or more octets");const a=Pg(e,t),c=parseInt(e.slice(13,16),10),u={hash:`SHA-${e.slice(8,11)}`,iterations:n,name:"PBKDF2",salt:a},l=await xg(s,e);return new Uint8Array(await crypto.subtle.deriveBits(u,l,c))}async function Dg(t,e,n,s=2048,a=crypto.getRandomValues(new Uint8Array(16))){const c=await Rg(a,t,s,e);return{encryptedKey:await fo(t.slice(-6),c,n),p2c:s,p2s:$t(a)}}const Mg=(t,e)=>{if(t.startsWith("RS")||t.startsWith("PS")){const{modulusLength:n}=e.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${t} requires key modulusLength to be 2048 bits or larger`)}},Lg=t=>{switch(t){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new yt(`alg ${t} is not supported either by JOSE or your javascript runtime`)}};async function Ng(t,e,n){return Bn(e,t,"encrypt"),Mg(t,e),new Uint8Array(await crypto.subtle.encrypt(Lg(t),e,n))}function Ll(t){switch(t){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new yt(`Unsupported JWE Algorithm: ${t}`)}}const vi=t=>crypto.getRandomValues(new Uint8Array(Ll(t)>>3));function Ug(t){let e,n;switch(t.kty){case"AKP":{switch(t.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":e={name:t.alg},n=t.priv?["sign"]:["verify"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(t.alg){case"PS256":case"PS384":case"PS512":e={name:"RSA-PSS",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":e={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${t.alg.slice(-3)}`},n=t.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":e={name:"RSA-OAEP",hash:`SHA-${parseInt(t.alg.slice(-3),10)||1}`},n=t.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(t.alg){case"ES256":e={name:"ECDSA",namedCurve:"P-256"},n=t.d?["sign"]:["verify"];break;case"ES384":e={name:"ECDSA",namedCurve:"P-384"},n=t.d?["sign"]:["verify"];break;case"ES512":e={name:"ECDSA",namedCurve:"P-521"},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:"ECDH",namedCurve:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(t.alg){case"Ed25519":case"EdDSA":e={name:"Ed25519"},n=t.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":e={name:t.crv},n=t.d?["deriveBits"]:[];break;default:throw new yt('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new yt('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:e,keyUsages:n}}const Ts=async t=>{if(!t.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:e,keyUsages:n}=Ug(t),s={...t};return s.kty!=="AKP"&&delete s.alg,delete s.use,crypto.subtle.importKey("jwk",s,e,t.ext??!(t.d||t.priv),t.key_ops??n)};async function Bg(t,e,n){if(!Ml(t))throw new TypeError("JWK must be an object");let s;switch(e??=t.alg,s??=t.ext,t.kty){case"oct":if(typeof t.k!="string"||!t.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Al(t.k);case"RSA":if("oth"in t&&t.oth!==void 0)throw new yt('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return Ts({...t,alg:e,ext:s});case"AKP":{if(typeof t.alg!="string"||!t.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(e!==void 0&&e!==t.alg)throw new TypeError("JWK alg and alg option value mismatch");return Ts({...t,ext:s})}case"EC":case"OKP":return Ts({...t,alg:e,ext:s});default:throw new yt('Unsupported "kty" (Key Type) Parameter value')}}async function Ig(t,e,n,s,a){if(!(n instanceof Uint8Array))throw new TypeError(co(n,"Uint8Array"));const c=parseInt(t.slice(1,4),10),u=await crypto.subtle.importKey("raw",n.subarray(c>>3),"AES-CBC",!1,["encrypt"]),l=await crypto.subtle.importKey("raw",n.subarray(0,c>>3),{hash:`SHA-${c<<1}`,name:"HMAC"},!1,["sign"]),h=new Uint8Array(await crypto.subtle.encrypt({iv:s,name:"AES-CBC"},u,e)),m=bi(a,s,h,dg(a.length<<3)),b=new Uint8Array((await crypto.subtle.sign("HMAC",l,m)).slice(0,c>>3));return{ciphertext:h,tag:b,iv:s}}async function Fg(t,e,n,s,a){let c;n instanceof Uint8Array?c=await crypto.subtle.importKey("raw",n,"AES-GCM",!1,["encrypt"]):(Bn(n,t,"encrypt"),c=n);const u=new Uint8Array(await crypto.subtle.encrypt({additionalData:a,iv:s,name:"AES-GCM",tagLength:128},c,e)),l=u.slice(-16);return{ciphertext:u.slice(0,-16),tag:l,iv:s}}const Nl=async(t,e,n,s,a)=>{if(!Si(n)&&!(n instanceof Uint8Array))throw new TypeError(co(n,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(s?yg(t,s):s=gg(t),t){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return n instanceof Uint8Array&&Cl(n,parseInt(t.slice(-3),10)),Ig(t,e,n,s,a);case"A128GCM":case"A192GCM":case"A256GCM":return n instanceof Uint8Array&&Cl(n,parseInt(t.slice(1,4),10)),Fg(t,e,n,s,a);default:throw new yt("Unsupported JWE Content Encryption Algorithm")}};async function Wg(t,e,n,s){const a=t.slice(0,7),c=await Nl(a,n,e,s,new Uint8Array(0));return{encryptedKey:c.ciphertext,iv:$t(c.iv),tag:$t(c.tag)}}const Hg=(t,e,n,s,a)=>{if(a.crit!==void 0&&s?.crit===void 0)throw new t('"crit" (Critical) Header Parameter MUST be integrity protected');if(!s||s.crit===void 0)return new Set;if(!Array.isArray(s.crit)||s.crit.length===0||s.crit.some(u=>typeof u!="string"||u.length===0))throw new t('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let c;n!==void 0?c=new Map([...Object.entries(n),...e.entries()]):c=e;for(const u of s.crit){if(!c.has(u))throw new yt(`Extension Header Parameter "${u}" is not recognized`);if(a[u]===void 0)throw new t(`Extension Header Parameter "${u}" is missing`);if(c.get(u)&&s[u]===void 0)throw new t(`Extension Header Parameter "${u}" MUST be integrity protected`)}return new Set(s.crit)};function po(t){return Ml(t)&&typeof t.kty=="string"}function Yg(t){return t.kty!=="oct"&&(t.kty==="AKP"&&typeof t.priv=="string"||typeof t.d=="string")}function Kg(t){return t.kty!=="oct"&&typeof t.d>"u"&&typeof t.priv>"u"}function qg(t){return t.kty==="oct"&&typeof t.k=="string"}let In;const Ul=async(t,e,n,s=!1)=>{In||=new WeakMap;let a=In.get(t);if(a?.[n])return a[n];const c=await Ts({...e,alg:n});return s&&Object.freeze(t),a?a[n]=c:In.set(t,{[n]:c}),c},$g=(t,e)=>{In||=new WeakMap;let n=In.get(t);if(n?.[e])return n[e];const s=t.type==="public",a=!!s;let c;if(t.asymmetricKeyType==="x25519"){switch(e){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}c=t.toCryptoKey(t.asymmetricKeyType,a,s?[]:["deriveBits"])}if(t.asymmetricKeyType==="ed25519"){if(e!=="EdDSA"&&e!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=t.toCryptoKey(t.asymmetricKeyType,a,[s?"verify":"sign"])}switch(t.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(e!==t.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=t.toCryptoKey(t.asymmetricKeyType,a,[s?"verify":"sign"])}}if(t.asymmetricKeyType==="rsa"){let u;switch(e){case"RSA-OAEP":u="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":u="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":u="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":u="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(e.startsWith("RSA-OAEP"))return t.toCryptoKey({name:"RSA-OAEP",hash:u},a,s?["encrypt"]:["decrypt"]);c=t.toCryptoKey({name:e.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:u},a,[s?"verify":"sign"])}if(t.asymmetricKeyType==="ec"){const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(t.asymmetricKeyDetails?.namedCurve);if(!l)throw new TypeError("given KeyObject instance cannot be used for this algorithm");e==="ES256"&&l==="P-256"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e==="ES384"&&l==="P-384"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e==="ES512"&&l==="P-521"&&(c=t.toCryptoKey({name:"ECDSA",namedCurve:l},a,[s?"verify":"sign"])),e.startsWith("ECDH-ES")&&(c=t.toCryptoKey({name:"ECDH",namedCurve:l},a,s?[]:["deriveBits"]))}if(!c)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return n?n[e]=c:In.set(t,{[e]:c}),c},Bl=async(t,e)=>{if(t instanceof Uint8Array||Si(t))return t;if(lo(t)){if(t.type==="secret")return t.export();if("toCryptoKey"in t&&typeof t.toCryptoKey=="function")try{return $g(t,e)}catch(s){if(s instanceof TypeError)throw s}let n=t.export({format:"jwk"});return Ul(t,n,e)}if(po(t))return t.k?Al(t.k):Ul(t,t,e,!0);throw new Error("unreachable")},Fn=t=>t?.[Symbol.toStringTag],mo=(t,e,n)=>{if(e.use!==void 0){let s;switch(n){case"sign":case"verify":s="sig";break;case"encrypt":case"decrypt":s="enc";break}if(e.use!==s)throw new TypeError(`Invalid key for this operation, its "use" must be "${s}" when present`)}if(e.alg!==void 0&&e.alg!==t)throw new TypeError(`Invalid key for this operation, its "alg" must be "${t}" when present`);if(Array.isArray(e.key_ops)){let s;switch(!0){case n==="verify":case t==="dir":case t.includes("CBC-HS"):s=n;break;case t.startsWith("PBES2"):s="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(t):!t.includes("GCM")&&t.endsWith("KW")?s="wrapKey":s=n;break;case t.startsWith("RSA"):s="wrapKey";break;case n==="decrypt":s=t.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(s&&e.key_ops?.includes?.(s)===!1)throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${s}" when present`)}return!0},Gg=(t,e,n)=>{if(!(e instanceof Uint8Array)){if(po(e)){if(qg(e)&&mo(t,e,n))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Dl(e))throw new TypeError(Pl(t,e,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(e.type!=="secret")throw new TypeError(`${Fn(e)} instances for symmetric algorithms must be of type "secret"`)}},Vg=(t,e,n)=>{if(po(e))switch(n){case"decrypt":case"sign":if(Yg(e)&&mo(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Kg(e)&&mo(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Dl(e))throw new TypeError(Pl(t,e,"CryptoKey","KeyObject","JSON Web Key"));if(e.type==="secret")throw new TypeError(`${Fn(e)} instances for asymmetric algorithms must not be of type "secret"`);if(e.type==="public")switch(n){case"sign":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm decryption must be of type "private"`)}if(e.type==="private")switch(n){case"verify":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw new TypeError(`${Fn(e)} instances for asymmetric algorithm encryption must be of type "public"`)}},zg=(t,e,n)=>{t.startsWith("HS")||t==="dir"||t.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(t)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(t)?Gg(t,e,n):Vg(t,e,n)},jg=Symbol();async function Jg(t){if(lo(t))if(t.type==="secret")t=t.export();else return t.export({format:"jwk"});if(t instanceof Uint8Array)return{kty:"oct",k:$t(t)};if(!Si(t))throw new TypeError(co(t,"CryptoKey","KeyObject","Uint8Array"));if(!t.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:e,key_ops:n,alg:s,use:a,...c}=await crypto.subtle.exportKey("jwk",t);return c.kty==="AKP"&&(c.alg=s),c}async function Qg(t){return Jg(t)}const Zg=async(t,e,n,s,a={})=>{let c,u,l;switch(t){case"dir":{l=n;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(Rl(n),!Cg(n))throw new yt("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:h,apv:m}=a;let b;a.epk?b=await Bl(a.epk,t):b=(await crypto.subtle.generateKey(n.algorithm,!0,["deriveBits"])).privateKey;const{x:T,y:P,crv:$,kty:O}=await Qg(b),I=await Og(n,b,t==="ECDH-ES"?e:t,t==="ECDH-ES"?Ll(e):parseInt(t.slice(-5,-2),10),h,m);if(u={epk:{x:T,crv:$,kty:O}},O==="EC"&&(u.epk.y=P),h&&(u.apu=$t(h)),m&&(u.apv=$t(m)),t==="ECDH-ES"){l=I;break}l=s||vi(e);const F=t.slice(-6);c=await fo(F,I,l);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{l=s||vi(e),Rl(n),c=await Ng(t,n,l);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=s||vi(e);const{p2c:h,p2s:m}=a;({encryptedKey:c,...u}=await Dg(t,n,l,h,m));break}case"A128KW":case"A192KW":case"A256KW":{l=s||vi(e),c=await fo(t,n,l);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=s||vi(e);const{iv:h}=a;({encryptedKey:c,...u}=await Wg(t,n,l,h));break}default:throw new yt('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:l,encryptedKey:c,parameters:u}};class Xg{#r;#e;#n;#t;#s;#i;#a;#o;constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this.#r=e}setKeyManagementParameters(e){if(this.#o)throw new TypeError("setKeyManagementParameters can only be called once");return this.#o=e,this}setProtectedHeader(e){if(this.#e)throw new TypeError("setProtectedHeader can only be called once");return this.#e=e,this}setSharedUnprotectedHeader(e){if(this.#n)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this.#n=e,this}setUnprotectedHeader(e){if(this.#t)throw new TypeError("setUnprotectedHeader can only be called once");return this.#t=e,this}setAdditionalAuthenticatedData(e){return this.#s=e,this}setContentEncryptionKey(e){if(this.#i)throw new TypeError("setContentEncryptionKey can only be called once");return this.#i=e,this}setInitializationVector(e){if(this.#a)throw new TypeError("setInitializationVector can only be called once");return this.#a=e,this}async encrypt(e,n){if(!this.#e&&!this.#t&&!this.#n)throw new Qr("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!bg(this.#e,this.#t,this.#n))throw new Qr("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const s={...this.#e,...this.#t,...this.#n};if(Hg(Qr,new Map,n?.crit,this.#e,s),s.zip!==void 0)throw new yt('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:a,enc:c}=s;if(typeof a!="string"||!a)throw new Qr('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof c!="string"||!c)throw new Qr('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let u;if(this.#i&&(a==="dir"||a==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${a}`);zg(a==="dir"?c:a,e,"encrypt");let l;{let I;const F=await Bl(e,a);({cek:l,encryptedKey:u,parameters:I}=await Zg(a,c,F,this.#i,this.#o)),I&&(n&&jg in n?this.#t?this.#t={...this.#t,...I}:this.setUnprotectedHeader(I):this.#e?this.#e={...this.#e,...I}:this.setProtectedHeader(I))}let h,m,b;this.#e?m=yn.encode($t(JSON.stringify(this.#e))):m=yn.encode(""),this.#s?(b=$t(this.#s),h=bi(m,yn.encode("."),yn.encode(b))):h=m;const{ciphertext:T,tag:P,iv:$}=await Nl(c,this.#r,l,this.#a,h),O={ciphertext:$t(T)};return $&&(O.iv=$t($)),P&&(O.tag=$t(P)),u&&(O.encrypted_key=$t(u)),b&&(O.aad=b),this.#e&&(O.protected=ao.decode(m)),this.#n&&(O.unprotected=this.#n),this.#t&&(O.header=this.#t),O}}class e0{#r;constructor(e){this.#r=new Xg(e)}setContentEncryptionKey(e){return this.#r.setContentEncryptionKey(e),this}setInitializationVector(e){return this.#r.setInitializationVector(e),this}setProtectedHeader(e){return this.#r.setProtectedHeader(e),this}setKeyManagementParameters(e){return this.#r.setKeyManagementParameters(e),this}async encrypt(e,n){const s=await this.#r.encrypt(e,n);return[s.protected,s.encrypted_key,s.iv,s.ciphertext,s.tag].join(".")}}let _n;_n={jwkToPublicKey:async t=>await Bg(t,"RSA-OAEP"),encryptPayload:async(t,e)=>{const n=new TextEncoder().encode(t);return await new e0(n).setProtectedHeader({alg:"RSA-OAEP",enc:"A256GCM"}).encrypt(e)}},_n.createJWT=async(t,e=void 0)=>{const n=Gs(JSON.stringify(t));let s,a="";if(e){a=Gs(JSON.stringify({typ:"JWT",kid:Wf(e),alg:"HS256"}));const c=[a,n].join(".");s=jo(c,e,"base64url")}else a=Gs(JSON.stringify({typ:"JWT",alg:"none"}));return[a,n,s].join(".")},_n.parseJWT=t=>{const[e,n,s]=t.split("."),a=JSON.parse(Vs(e)),c=JSON.parse(Vs(n));return{header:a,body:c,signature:s}};//! moment.js
34
34
  //! version : 2.30.1
35
35
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
36
36
  //! license : MIT
37
37
  //! momentjs.com
38
- var Bl;function z(){return Bl.apply(null,arguments)}function t0(t){Bl=t}function ar(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function wn(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function go(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(ke(t,e))return!1;return!0}function kt(t){return t===void 0}function Pr(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Ti(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function Il(t,e){var n=[],s,a=t.length;for(s=0;s<a;++s)n.push(e(t[s],s));return n}function Xr(t,e){for(var n in e)ke(e,n)&&(t[n]=e[n]);return ke(e,"toString")&&(t.toString=e.toString),ke(e,"valueOf")&&(t.valueOf=e.valueOf),t}function _r(t,e,n,s){return hf(t,e,n,s,!0).utc()}function r0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function de(t){return t._pf==null&&(t._pf=r0()),t._pf}var yo;Array.prototype.some?yo=Array.prototype.some:yo=function(t){var e=Object(this),n=e.length>>>0,s;for(s=0;s<n;s++)if(s in e&&t.call(this,e[s],s,e))return!0;return!1};function _o(t){var e=null,n=!1,s=t._d&&!isNaN(t._d.getTime());if(s&&(e=de(t),n=yo.call(e.parsedDateParts,function(a){return a!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=s;else return s;return t._isValid}function Ts(t){var e=_r(NaN);return t!=null?Xr(de(e),t):de(e).userInvalidated=!0,e}var Fl=z.momentProperties=[],wo=!1;function bo(t,e){var n,s,a,c=Fl.length;if(kt(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),kt(e._i)||(t._i=e._i),kt(e._f)||(t._f=e._f),kt(e._l)||(t._l=e._l),kt(e._strict)||(t._strict=e._strict),kt(e._tzm)||(t._tzm=e._tzm),kt(e._isUTC)||(t._isUTC=e._isUTC),kt(e._offset)||(t._offset=e._offset),kt(e._pf)||(t._pf=de(e)),kt(e._locale)||(t._locale=e._locale),c>0)for(n=0;n<c;n++)s=Fl[n],a=e[s],kt(a)||(t[s]=a);return t}function Ei(t){bo(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wo===!1&&(wo=!0,z.updateOffset(this),wo=!1)}function or(t){return t instanceof Ei||t!=null&&t._isAMomentObject!=null}function Wl(t){z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Gt(t,e){var n=!0;return Xr(function(){if(z.deprecationHandler!=null&&z.deprecationHandler(null,t),n){var s=[],a,c,u,l=arguments.length;for(c=0;c<l;c++){if(a="",typeof arguments[c]=="object"){a+=`
39
- [`+c+"] ";for(u in arguments[0])ke(arguments[0],u)&&(a+=u+": "+arguments[0][u]+", ");a=a.slice(0,-2)}else a=arguments[c];s.push(a)}Wl(t+`
38
+ var Il;function z(){return Il.apply(null,arguments)}function t0(t){Il=t}function ar(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function wn(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function ke(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function go(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(ke(t,e))return!1;return!0}function kt(t){return t===void 0}function Pr(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function Ti(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function Fl(t,e){var n=[],s,a=t.length;for(s=0;s<a;++s)n.push(e(t[s],s));return n}function Xr(t,e){for(var n in e)ke(e,n)&&(t[n]=e[n]);return ke(e,"toString")&&(t.toString=e.toString),ke(e,"valueOf")&&(t.valueOf=e.valueOf),t}function _r(t,e,n,s){return df(t,e,n,s,!0).utc()}function r0(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function de(t){return t._pf==null&&(t._pf=r0()),t._pf}var yo;Array.prototype.some?yo=Array.prototype.some:yo=function(t){var e=Object(this),n=e.length>>>0,s;for(s=0;s<n;s++)if(s in e&&t.call(this,e[s],s,e))return!0;return!1};function _o(t){var e=null,n=!1,s=t._d&&!isNaN(t._d.getTime());if(s&&(e=de(t),n=yo.call(e.parsedDateParts,function(a){return a!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=s;else return s;return t._isValid}function Es(t){var e=_r(NaN);return t!=null?Xr(de(e),t):de(e).userInvalidated=!0,e}var Wl=z.momentProperties=[],wo=!1;function bo(t,e){var n,s,a,c=Wl.length;if(kt(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),kt(e._i)||(t._i=e._i),kt(e._f)||(t._f=e._f),kt(e._l)||(t._l=e._l),kt(e._strict)||(t._strict=e._strict),kt(e._tzm)||(t._tzm=e._tzm),kt(e._isUTC)||(t._isUTC=e._isUTC),kt(e._offset)||(t._offset=e._offset),kt(e._pf)||(t._pf=de(e)),kt(e._locale)||(t._locale=e._locale),c>0)for(n=0;n<c;n++)s=Wl[n],a=e[s],kt(a)||(t[s]=a);return t}function Ei(t){bo(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),wo===!1&&(wo=!0,z.updateOffset(this),wo=!1)}function or(t){return t instanceof Ei||t!=null&&t._isAMomentObject!=null}function Hl(t){z.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Gt(t,e){var n=!0;return Xr(function(){if(z.deprecationHandler!=null&&z.deprecationHandler(null,t),n){var s=[],a,c,u,l=arguments.length;for(c=0;c<l;c++){if(a="",typeof arguments[c]=="object"){a+=`
39
+ [`+c+"] ";for(u in arguments[0])ke(arguments[0],u)&&(a+=u+": "+arguments[0][u]+", ");a=a.slice(0,-2)}else a=arguments[c];s.push(a)}Hl(t+`
40
40
  Arguments: `+Array.prototype.slice.call(s).join("")+`
41
- `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var Hl={};function Yl(t,e){z.deprecationHandler!=null&&z.deprecationHandler(t,e),Hl[t]||(Wl(e),Hl[t]=!0)}z.suppressDeprecationWarnings=!1,z.deprecationHandler=null;function wr(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function n0(t){var e,n;for(n in t)ke(t,n)&&(e=t[n],wr(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function So(t,e){var n=Xr({},t),s;for(s in e)ke(e,s)&&(wn(t[s])&&wn(e[s])?(n[s]={},Xr(n[s],t[s]),Xr(n[s],e[s])):e[s]!=null?n[s]=e[s]:delete n[s]);for(s in t)ke(t,s)&&!ke(e,s)&&wn(t[s])&&(n[s]=Xr({},n[s]));return n}function vo(t){t!=null&&this.set(t)}var To;Object.keys?To=Object.keys:To=function(t){var e,n=[];for(e in t)ke(t,e)&&n.push(e);return n};var i0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function s0(t,e,n){var s=this._calendar[t]||this._calendar.sameElse;return wr(s)?s.call(e,n):s}function br(t,e,n){var s=""+Math.abs(t),a=e-s.length,c=t>=0;return(c?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var Eo=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Es=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ao={},Wn={};function ie(t,e,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),t&&(Wn[t]=a),e&&(Wn[e[0]]=function(){return br(a.apply(this,arguments),e[1],e[2])}),n&&(Wn[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function a0(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function o0(t){var e=t.match(Eo),n,s;for(n=0,s=e.length;n<s;n++)Wn[e[n]]?e[n]=Wn[e[n]]:e[n]=a0(e[n]);return function(a){var c="",u;for(u=0;u<s;u++)c+=wr(e[u])?e[u].call(a,t):e[u];return c}}function As(t,e){return t.isValid()?(e=Kl(e,t.localeData()),Ao[e]=Ao[e]||o0(e),Ao[e](t)):t.localeData().invalidDate()}function Kl(t,e){var n=5;function s(a){return e.longDateFormat(a)||a}for(Es.lastIndex=0;n>=0&&Es.test(t);)t=t.replace(Es,s),Es.lastIndex=0,n-=1;return t}var u0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function c0(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Eo).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[t])}var l0="Invalid date";function f0(){return this._invalidDate}var h0="%d",d0=/\d{1,2}/;function p0(t){return this._ordinal.replace("%d",t)}var m0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function g0(t,e,n,s){var a=this._relativeTime[n];return wr(a)?a(t,e,n,s):a.replace(/%d/i,t)}function y0(t,e){var n=this._relativeTime[t>0?"future":"past"];return wr(n)?n(e):n.replace(/%s/i,e)}var ql={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Vt(t){return typeof t=="string"?ql[t]||ql[t.toLowerCase()]:void 0}function Oo(t){var e={},n,s;for(s in t)ke(t,s)&&(n=Vt(s),n&&(e[n]=t[s]));return e}var _0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function w0(t){var e=[],n;for(n in t)ke(t,n)&&e.push({unit:n,priority:_0[n]});return e.sort(function(s,a){return s.priority-a.priority}),e}var $l=/\d/,Nt=/\d\d/,Gl=/\d{3}/,ko=/\d{4}/,Os=/[+-]?\d{6}/,Ye=/\d\d?/,Vl=/\d\d\d\d?/,zl=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,Co=/\d{1,4}/,Cs=/[+-]?\d{1,6}/,Hn=/\d+/,xs=/[+-]?\d+/,b0=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,S0=/[+-]?\d+(\.\d{1,3})?/,Ai=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Yn=/^[1-9]\d?/,xo=/^([1-9]\d|\d)/,Rs;Rs={};function Q(t,e,n){Rs[t]=wr(e)?e:function(s,a){return s&&n?n:e}}function v0(t,e){return ke(Rs,t)?Rs[t](e._strict,e._locale):new RegExp(T0(t))}function T0(t){return Rr(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,s,a,c){return n||s||a||c}))}function Rr(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zt(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function be(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=zt(e)),n}var Po={};function Le(t,e){var n,s=e,a;for(typeof t=="string"&&(t=[t]),Pr(e)&&(s=function(c,u){u[e]=be(c)}),a=t.length,n=0;n<a;n++)Po[t[n]]=s}function Oi(t,e){Le(t,function(n,s,a,c){a._w=a._w||{},e(n,a._w,a,c)})}function E0(t,e,n){e!=null&&ke(Po,t)&&Po[t](e,n._a,n,t)}function Ds(t){return t%4===0&&t%100!==0||t%400===0}var pt=0,Dr=1,Sr=2,rt=3,ur=4,Mr=5,bn=6,A0=7,O0=8;ie("Y",0,0,function(){var t=this.year();return t<=9999?br(t,4):"+"+t}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),Q("Y",xs),Q("YY",Ye,Nt),Q("YYYY",Co,ko),Q("YYYYY",Cs,Os),Q("YYYYYY",Cs,Os),Le(["YYYYY","YYYYYY"],pt),Le("YYYY",function(t,e){e[pt]=t.length===2?z.parseTwoDigitYear(t):be(t)}),Le("YY",function(t,e){e[pt]=z.parseTwoDigitYear(t)}),Le("Y",function(t,e){e[pt]=parseInt(t,10)});function ki(t){return Ds(t)?366:365}z.parseTwoDigitYear=function(t){return be(t)+(be(t)>68?1900:2e3)};var jl=Kn("FullYear",!0);function k0(){return Ds(this.year())}function Kn(t,e){return function(n){return n!=null?(Jl(this,t,n),z.updateOffset(this,e),this):Ci(this,t)}}function Ci(t,e){if(!t.isValid())return NaN;var n=t._d,s=t._isUTC;switch(e){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Jl(t,e,n){var s,a,c,u,l;if(!(!t.isValid()||isNaN(n))){switch(s=t._d,a=t._isUTC,e){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}c=n,u=t.month(),l=t.date(),l=l===29&&u===1&&!Ds(c)?28:l,a?s.setUTCFullYear(c,u,l):s.setFullYear(c,u,l)}}function C0(t){return t=Vt(t),wr(this[t])?this[t]():this}function x0(t,e){if(typeof t=="object"){t=Oo(t);var n=w0(t),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](t[n[s].unit])}else if(t=Vt(t),wr(this[t]))return this[t](e);return this}function P0(t,e){return(t%e+e)%e}var Xe;Array.prototype.indexOf?Xe=Array.prototype.indexOf:Xe=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Ro(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=P0(e,12);return t+=(e-n)/12,n===1?Ds(t)?29:28:31-n%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),ie("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Q("M",Ye,Yn),Q("MM",Ye,Nt),Q("MMM",function(t,e){return e.monthsShortRegex(t)}),Q("MMMM",function(t,e){return e.monthsRegex(t)}),Le(["M","MM"],function(t,e){e[Dr]=be(t)-1}),Le(["MMM","MMMM"],function(t,e,n,s){var a=n._locale.monthsParse(t,s,n._strict);a!=null?e[Dr]=a:de(n).invalidMonth=t});var R0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ql="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Zl=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,D0=Ai,M0=Ai;function L0(t,e){return t?ar(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Zl).test(e)?"format":"standalone"][t.month()]:ar(this._months)?this._months:this._months.standalone}function N0(t,e){return t?ar(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Zl.test(e)?"format":"standalone"][t.month()]:ar(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function U0(t,e,n){var s,a,c,u=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)c=_r([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(c,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(c,"").toLocaleLowerCase();return n?e==="MMM"?(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:null):(a=Xe.call(this._longMonthsParse,u),a!==-1?a:null):e==="MMM"?(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:(a=Xe.call(this._longMonthsParse,u),a!==-1?a:null)):(a=Xe.call(this._longMonthsParse,u),a!==-1?a:(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:null))}function B0(t,e,n){var s,a,c;if(this._monthsParseExact)return U0.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=_r([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(c="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(c.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[s].test(t))return s;if(n&&e==="MMM"&&this._shortMonthsParse[s].test(t))return s;if(!n&&this._monthsParse[s].test(t))return s}}function Xl(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=be(e);else if(e=t.localeData().monthsParse(e),!Pr(e))return t}var n=e,s=t.date();return s=s<29?s:Math.min(s,Ro(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,s):t._d.setMonth(n,s),t}function ef(t){return t!=null?(Xl(this,t),z.updateOffset(this,!0),this):Ci(this,"Month")}function I0(){return Ro(this.year(),this.month())}function F0(t){return this._monthsParseExact?(ke(this,"_monthsRegex")||tf.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ke(this,"_monthsShortRegex")||(this._monthsShortRegex=D0),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function W0(t){return this._monthsParseExact?(ke(this,"_monthsRegex")||tf.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ke(this,"_monthsRegex")||(this._monthsRegex=M0),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function tf(){function t(h,m){return m.length-h.length}var e=[],n=[],s=[],a,c,u,l;for(a=0;a<12;a++)c=_r([2e3,a]),u=Rr(this.monthsShort(c,"")),l=Rr(this.months(c,"")),e.push(u),n.push(l),s.push(l),s.push(u);e.sort(t),n.sort(t),s.sort(t),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function H0(t,e,n,s,a,c,u){var l;return t<100&&t>=0?(l=new Date(t+400,e,n,s,a,c,u),isFinite(l.getFullYear())&&l.setFullYear(t)):l=new Date(t,e,n,s,a,c,u),l}function xi(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Ms(t,e,n){var s=7+e-n,a=(7+xi(t,0,s).getUTCDay()-e)%7;return-a+s-1}function rf(t,e,n,s,a){var c=(7+n-s)%7,u=Ms(t,s,a),l=1+7*(e-1)+c+u,h,m;return l<=0?(h=t-1,m=ki(h)+l):l>ki(t)?(h=t+1,m=l-ki(t)):(h=t,m=l),{year:h,dayOfYear:m}}function Pi(t,e,n){var s=Ms(t.year(),e,n),a=Math.floor((t.dayOfYear()-s-1)/7)+1,c,u;return a<1?(u=t.year()-1,c=a+Lr(u,e,n)):a>Lr(t.year(),e,n)?(c=a-Lr(t.year(),e,n),u=t.year()+1):(u=t.year(),c=a),{week:c,year:u}}function Lr(t,e,n){var s=Ms(t,e,n),a=Ms(t+1,e,n);return(ki(t)-s+a)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),Q("w",Ye,Yn),Q("ww",Ye,Nt),Q("W",Ye,Yn),Q("WW",Ye,Nt),Oi(["w","ww","W","WW"],function(t,e,n,s){e[s.substr(0,1)]=be(t)});function Y0(t){return Pi(t,this._week.dow,this._week.doy).week}var K0={dow:0,doy:6};function q0(){return this._week.dow}function $0(){return this._week.doy}function G0(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function V0(t){var e=Pi(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),ie("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),ie("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),Q("d",Ye),Q("e",Ye),Q("E",Ye),Q("dd",function(t,e){return e.weekdaysMinRegex(t)}),Q("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Q("dddd",function(t,e){return e.weekdaysRegex(t)}),Oi(["dd","ddd","dddd"],function(t,e,n,s){var a=n._locale.weekdaysParse(t,s,n._strict);a!=null?e.d=a:de(n).invalidWeekday=t}),Oi(["d","e","E"],function(t,e,n,s){e[s]=be(t)});function z0(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function j0(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Do(t,e){return t.slice(e,7).concat(t.slice(0,e))}var J0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),nf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Q0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Z0=Ai,X0=Ai,ey=Ai;function ty(t,e){var n=ar(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Do(n,this._week.dow):t?n[t.day()]:n}function ry(t){return t===!0?Do(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function ny(t){return t===!0?Do(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function iy(t,e,n){var s,a,c,u=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)c=_r([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(c,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(c,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(c,"").toLocaleLowerCase();return n?e==="dddd"?(a=Xe.call(this._weekdaysParse,u),a!==-1?a:null):e==="ddd"?(a=Xe.call(this._shortWeekdaysParse,u),a!==-1?a:null):(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null):e==="dddd"?(a=Xe.call(this._weekdaysParse,u),a!==-1||(a=Xe.call(this._shortWeekdaysParse,u),a!==-1)?a:(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null)):e==="ddd"?(a=Xe.call(this._shortWeekdaysParse,u),a!==-1||(a=Xe.call(this._weekdaysParse,u),a!==-1)?a:(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null)):(a=Xe.call(this._minWeekdaysParse,u),a!==-1||(a=Xe.call(this._weekdaysParse,u),a!==-1)?a:(a=Xe.call(this._shortWeekdaysParse,u),a!==-1?a:null))}function sy(t,e,n){var s,a,c;if(this._weekdaysParseExact)return iy.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=_r([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(c="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(c.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[s].test(t))return s;if(n&&e==="ddd"&&this._shortWeekdaysParse[s].test(t))return s;if(n&&e==="dd"&&this._minWeekdaysParse[s].test(t))return s;if(!n&&this._weekdaysParse[s].test(t))return s}}function ay(t){if(!this.isValid())return t!=null?this:NaN;var e=Ci(this,"Day");return t!=null?(t=z0(t,this.localeData()),this.add(t-e,"d")):e}function oy(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function uy(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=j0(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function cy(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ke(this,"_weekdaysRegex")||(this._weekdaysRegex=Z0),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function ly(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ke(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X0),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fy(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ke(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ey),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Mo(){function t(b,T){return T.length-b.length}var e=[],n=[],s=[],a=[],c,u,l,h,m;for(c=0;c<7;c++)u=_r([2e3,1]).day(c),l=Rr(this.weekdaysMin(u,"")),h=Rr(this.weekdaysShort(u,"")),m=Rr(this.weekdays(u,"")),e.push(l),n.push(h),s.push(m),a.push(l),a.push(h),a.push(m);e.sort(t),n.sort(t),s.sort(t),a.sort(t),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Lo(){return this.hours()%12||12}function hy(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Lo),ie("k",["kk",2],0,hy),ie("hmm",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)+br(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+br(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+br(this.minutes(),2)+br(this.seconds(),2)});function sf(t,e){ie(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}sf("a",!0),sf("A",!1);function af(t,e){return e._meridiemParse}Q("a",af),Q("A",af),Q("H",Ye,xo),Q("h",Ye,Yn),Q("k",Ye,Yn),Q("HH",Ye,Nt),Q("hh",Ye,Nt),Q("kk",Ye,Nt),Q("hmm",Vl),Q("hmmss",zl),Q("Hmm",Vl),Q("Hmmss",zl),Le(["H","HH"],rt),Le(["k","kk"],function(t,e,n){var s=be(t);e[rt]=s===24?0:s}),Le(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Le(["h","hh"],function(t,e,n){e[rt]=be(t),de(n).bigHour=!0}),Le("hmm",function(t,e,n){var s=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s)),de(n).bigHour=!0}),Le("hmmss",function(t,e,n){var s=t.length-4,a=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s,2)),e[Mr]=be(t.substr(a)),de(n).bigHour=!0}),Le("Hmm",function(t,e,n){var s=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s))}),Le("Hmmss",function(t,e,n){var s=t.length-4,a=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s,2)),e[Mr]=be(t.substr(a))});function dy(t){return(t+"").toLowerCase().charAt(0)==="p"}var py=/[ap]\.?m?\.?/i,my=Kn("Hours",!0);function gy(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var of={calendar:i0,longDateFormat:u0,invalidDate:l0,ordinal:h0,dayOfMonthOrdinalParse:d0,relativeTime:m0,months:R0,monthsShort:Ql,week:K0,weekdays:J0,weekdaysMin:Q0,weekdaysShort:nf,meridiemParse:py},$e={},Ri={},Di;function yy(t,e){var n,s=Math.min(t.length,e.length);for(n=0;n<s;n+=1)if(t[n]!==e[n])return n;return s}function uf(t){return t&&t.toLowerCase().replace("_","-")}function _y(t){for(var e=0,n,s,a,c;e<t.length;){for(c=uf(t[e]).split("-"),n=c.length,s=uf(t[e+1]),s=s?s.split("-"):null;n>0;){if(a=Ls(c.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&yy(c,s)>=n-1)break;n--}e++}return Di}function wy(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Ls(t){var e=null,n;if($e[t]===void 0&&typeof module<"u"&&module&&module.exports&&wy(t))try{e=Di._abbr,n=require,n("./locale/"+t),en(e)}catch{$e[t]=null}return $e[t]}function en(t,e){var n;return t&&(kt(e)?n=Nr(t):n=No(t,e),n?Di=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Di._abbr}function No(t,e){if(e!==null){var n,s=of;if(e.abbr=t,$e[t]!=null)Yl("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=$e[t]._config;else if(e.parentLocale!=null)if($e[e.parentLocale]!=null)s=$e[e.parentLocale]._config;else if(n=Ls(e.parentLocale),n!=null)s=n._config;else return Ri[e.parentLocale]||(Ri[e.parentLocale]=[]),Ri[e.parentLocale].push({name:t,config:e}),null;return $e[t]=new vo(So(s,e)),Ri[t]&&Ri[t].forEach(function(a){No(a.name,a.config)}),en(t),$e[t]}else return delete $e[t],null}function by(t,e){if(e!=null){var n,s,a=of;$e[t]!=null&&$e[t].parentLocale!=null?$e[t].set(So($e[t]._config,e)):(s=Ls(t),s!=null&&(a=s._config),e=So(a,e),s==null&&(e.abbr=t),n=new vo(e),n.parentLocale=$e[t],$e[t]=n),en(t)}else $e[t]!=null&&($e[t].parentLocale!=null?($e[t]=$e[t].parentLocale,t===en()&&en(t)):$e[t]!=null&&delete $e[t]);return $e[t]}function Nr(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Di;if(!ar(t)){if(e=Ls(t),e)return e;t=[t]}return _y(t)}function Sy(){return To($e)}function Uo(t){var e,n=t._a;return n&&de(t).overflow===-2&&(e=n[Dr]<0||n[Dr]>11?Dr:n[Sr]<1||n[Sr]>Ro(n[pt],n[Dr])?Sr:n[rt]<0||n[rt]>24||n[rt]===24&&(n[ur]!==0||n[Mr]!==0||n[bn]!==0)?rt:n[ur]<0||n[ur]>59?ur:n[Mr]<0||n[Mr]>59?Mr:n[bn]<0||n[bn]>999?bn:-1,de(t)._overflowDayOfYear&&(e<pt||e>Sr)&&(e=Sr),de(t)._overflowWeeks&&e===-1&&(e=A0),de(t)._overflowWeekday&&e===-1&&(e=O0),de(t).overflow=e),t}var vy=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ty=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ey=/Z|[+-]\d\d(?::?\d\d)?/,Ns=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ay=/^\/?Date\((-?\d+)/i,Oy=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ky={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function cf(t){var e,n,s=t._i,a=vy.exec(s)||Ty.exec(s),c,u,l,h,m=Ns.length,b=Bo.length;if(a){for(de(t).iso=!0,e=0,n=m;e<n;e++)if(Ns[e][1].exec(a[1])){u=Ns[e][0],c=Ns[e][2]!==!1;break}if(u==null){t._isValid=!1;return}if(a[3]){for(e=0,n=b;e<n;e++)if(Bo[e][1].exec(a[3])){l=(a[2]||" ")+Bo[e][0];break}if(l==null){t._isValid=!1;return}}if(!c&&l!=null){t._isValid=!1;return}if(a[4])if(Ey.exec(a[4]))h="Z";else{t._isValid=!1;return}t._f=u+(l||"")+(h||""),Fo(t)}else t._isValid=!1}function Cy(t,e,n,s,a,c){var u=[xy(t),Ql.indexOf(e),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return c&&u.push(parseInt(c,10)),u}function xy(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Py(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ry(t,e,n){if(t){var s=nf.indexOf(t),a=new Date(e[0],e[1],e[2]).getDay();if(s!==a)return de(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dy(t,e,n){if(t)return ky[t];if(e)return 0;var s=parseInt(n,10),a=s%100,c=(s-a)/100;return c*60+a}function lf(t){var e=Oy.exec(Py(t._i)),n;if(e){if(n=Cy(e[4],e[3],e[2],e[5],e[6],e[7]),!Ry(e[1],n,t))return;t._a=n,t._tzm=Dy(e[8],e[9],e[10]),t._d=xi.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),de(t).rfc2822=!0}else t._isValid=!1}function My(t){var e=Ay.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(cf(t),t._isValid===!1)delete t._isValid;else return;if(lf(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:z.createFromInputFallback(t)}z.createFromInputFallback=Gt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function qn(t,e,n){return t??e??n}function Ly(t){var e=new Date(z.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Io(t){var e,n,s=[],a,c,u;if(!t._d){for(a=Ly(t),t._w&&t._a[Sr]==null&&t._a[Dr]==null&&Ny(t),t._dayOfYear!=null&&(u=qn(t._a[pt],a[pt]),(t._dayOfYear>ki(u)||t._dayOfYear===0)&&(de(t)._overflowDayOfYear=!0),n=xi(u,0,t._dayOfYear),t._a[Dr]=n.getUTCMonth(),t._a[Sr]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=s[e]=a[e];for(;e<7;e++)t._a[e]=s[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[rt]===24&&t._a[ur]===0&&t._a[Mr]===0&&t._a[bn]===0&&(t._nextDay=!0,t._a[rt]=0),t._d=(t._useUTC?xi:H0).apply(null,s),c=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[rt]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==c&&(de(t).weekdayMismatch=!0)}}function Ny(t){var e,n,s,a,c,u,l,h,m;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(c=1,u=4,n=qn(e.GG,t._a[pt],Pi(Ke(),1,4).year),s=qn(e.W,1),a=qn(e.E,1),(a<1||a>7)&&(h=!0)):(c=t._locale._week.dow,u=t._locale._week.doy,m=Pi(Ke(),c,u),n=qn(e.gg,t._a[pt],m.year),s=qn(e.w,m.week),e.d!=null?(a=e.d,(a<0||a>6)&&(h=!0)):e.e!=null?(a=e.e+c,(e.e<0||e.e>6)&&(h=!0)):a=c),s<1||s>Lr(n,c,u)?de(t)._overflowWeeks=!0:h!=null?de(t)._overflowWeekday=!0:(l=rf(n,s,a,c,u),t._a[pt]=l.year,t._dayOfYear=l.dayOfYear)}z.ISO_8601=function(){},z.RFC_2822=function(){};function Fo(t){if(t._f===z.ISO_8601){cf(t);return}if(t._f===z.RFC_2822){lf(t);return}t._a=[],de(t).empty=!0;var e=""+t._i,n,s,a,c,u,l=e.length,h=0,m,b;for(a=Kl(t._f,t._locale).match(Eo)||[],b=a.length,n=0;n<b;n++)c=a[n],s=(e.match(v0(c,t))||[])[0],s&&(u=e.substr(0,e.indexOf(s)),u.length>0&&de(t).unusedInput.push(u),e=e.slice(e.indexOf(s)+s.length),h+=s.length),Wn[c]?(s?de(t).empty=!1:de(t).unusedTokens.push(c),E0(c,s,t)):t._strict&&!s&&de(t).unusedTokens.push(c);de(t).charsLeftOver=l-h,e.length>0&&de(t).unusedInput.push(e),t._a[rt]<=12&&de(t).bigHour===!0&&t._a[rt]>0&&(de(t).bigHour=void 0),de(t).parsedDateParts=t._a.slice(0),de(t).meridiem=t._meridiem,t._a[rt]=Uy(t._locale,t._a[rt],t._meridiem),m=de(t).era,m!==null&&(t._a[pt]=t._locale.erasConvertYear(m,t._a[pt])),Io(t),Uo(t)}function Uy(t,e,n){var s;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(s=t.isPM(n),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function By(t){var e,n,s,a,c,u,l=!1,h=t._f.length;if(h===0){de(t).invalidFormat=!0,t._d=new Date(NaN);return}for(a=0;a<h;a++)c=0,u=!1,e=bo({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[a],Fo(e),_o(e)&&(u=!0),c+=de(e).charsLeftOver,c+=de(e).unusedTokens.length*10,de(e).score=c,l?c<s&&(s=c,n=e):(s==null||c<s||u)&&(s=c,n=e,u&&(l=!0));Xr(t,n||e)}function Iy(t){if(!t._d){var e=Oo(t._i),n=e.day===void 0?e.date:e.day;t._a=Il([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Io(t)}}function Fy(t){var e=new Ei(Uo(ff(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ff(t){var e=t._i,n=t._f;return t._locale=t._locale||Nr(t._l),e===null||n===void 0&&e===""?Ts({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),or(e)?new Ei(Uo(e)):(Ti(e)?t._d=e:ar(n)?By(t):n?Fo(t):Wy(t),_o(t)||(t._d=null),t))}function Wy(t){var e=t._i;kt(e)?t._d=new Date(z.now()):Ti(e)?t._d=new Date(e.valueOf()):typeof e=="string"?My(t):ar(e)?(t._a=Il(e.slice(0),function(n){return parseInt(n,10)}),Io(t)):wn(e)?Iy(t):Pr(e)?t._d=new Date(e):z.createFromInputFallback(t)}function hf(t,e,n,s,a){var c={};return(e===!0||e===!1)&&(s=e,e=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(wn(t)&&go(t)||ar(t)&&t.length===0)&&(t=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=a,c._l=n,c._i=t,c._f=e,c._strict=s,Fy(c)}function Ke(t,e,n,s){return hf(t,e,n,s,!1)}var Hy=Gt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Ts()}),Yy=Gt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Ts()});function df(t,e){var n,s;if(e.length===1&&ar(e[0])&&(e=e[0]),!e.length)return Ke();for(n=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][t](n))&&(n=e[s]);return n}function Ky(){var t=[].slice.call(arguments,0);return df("isBefore",t)}function qy(){var t=[].slice.call(arguments,0);return df("isAfter",t)}var $y=function(){return Date.now?Date.now():+new Date},Mi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Gy(t){var e,n=!1,s,a=Mi.length;for(e in t)if(ke(t,e)&&!(Xe.call(Mi,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(s=0;s<a;++s)if(t[Mi[s]]){if(n)return!1;parseFloat(t[Mi[s]])!==be(t[Mi[s]])&&(n=!0)}return!0}function Vy(){return this._isValid}function zy(){return cr(NaN)}function Us(t){var e=Oo(t),n=e.year||0,s=e.quarter||0,a=e.month||0,c=e.week||e.isoWeek||0,u=e.day||0,l=e.hour||0,h=e.minute||0,m=e.second||0,b=e.millisecond||0;this._isValid=Gy(e),this._milliseconds=+b+m*1e3+h*6e4+l*1e3*60*60,this._days=+u+c*7,this._months=+a+s*3+n*12,this._data={},this._locale=Nr(),this._bubble()}function Bs(t){return t instanceof Us}function Wo(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function jy(t,e,n){var s=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),c=0,u;for(u=0;u<s;u++)be(t[u])!==be(e[u])&&c++;return c+a}function pf(t,e){ie(t,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+br(~~(n/60),2)+e+br(~~n%60,2)})}pf("Z",":"),pf("ZZ",""),Q("Z",Ps),Q("ZZ",Ps),Le(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ho(Ps,t)});var Jy=/([\+\-]|\d\d)/gi;function Ho(t,e){var n=(e||"").match(t),s,a,c;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Jy)||["-",0,0],c=+(a[1]*60)+be(a[2]),c===0?0:a[0]==="+"?c:-c)}function Yo(t,e){var n,s;return e._isUTC?(n=e.clone(),s=(or(t)||Ti(t)?t.valueOf():Ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),z.updateOffset(n,!1),n):Ke(t).local()}function Ko(t){return-Math.round(t._d.getTimezoneOffset())}z.updateOffset=function(){};function Qy(t,e,n){var s=this._offset||0,a;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Ho(Ps,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(a=Ko(this)),this._offset=t,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==t&&(!e||this._changeInProgress?_f(this,cr(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Ko(this)}function Zy(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Xy(t){return this.utcOffset(0,t)}function e_(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ko(this),"m")),this}function t_(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Ho(b0,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function r_(t){return this.isValid()?(t=t?Ke(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function n_(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function i_(){if(!kt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return bo(t,this),t=ff(t),t._a?(e=t._isUTC?_r(t._a):Ke(t._a),this._isDSTShifted=this.isValid()&&jy(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function s_(){return this.isValid()?!this._isUTC:!1}function a_(){return this.isValid()?this._isUTC:!1}function mf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var o_=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,u_=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function cr(t,e){var n=t,s=null,a,c,u;return Bs(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Pr(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(s=o_.exec(t))?(a=s[1]==="-"?-1:1,n={y:0,d:be(s[Sr])*a,h:be(s[rt])*a,m:be(s[ur])*a,s:be(s[Mr])*a,ms:be(Wo(s[bn]*1e3))*a}):(s=u_.exec(t))?(a=s[1]==="-"?-1:1,n={y:Sn(s[2],a),M:Sn(s[3],a),w:Sn(s[4],a),d:Sn(s[5],a),h:Sn(s[6],a),m:Sn(s[7],a),s:Sn(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=c_(Ke(n.from),Ke(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),c=new Us(n),Bs(t)&&ke(t,"_locale")&&(c._locale=t._locale),Bs(t)&&ke(t,"_isValid")&&(c._isValid=t._isValid),c}cr.fn=Us.prototype,cr.invalid=zy;function Sn(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function gf(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function c_(t,e){var n;return t.isValid()&&e.isValid()?(e=Yo(e,t),t.isBefore(e)?n=gf(t,e):(n=gf(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function yf(t,e){return function(n,s){var a,c;return s!==null&&!isNaN(+s)&&(Yl(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),c=n,n=s,s=c),a=cr(n,s),_f(this,a,t),this}}function _f(t,e,n,s){var a=e._milliseconds,c=Wo(e._days),u=Wo(e._months);t.isValid()&&(s=s??!0,u&&Xl(t,Ci(t,"Month")+u*n),c&&Jl(t,"Date",Ci(t,"Date")+c*n),a&&t._d.setTime(t._d.valueOf()+a*n),s&&z.updateOffset(t,c||u))}var l_=yf(1,"add"),f_=yf(-1,"subtract");function wf(t){return typeof t=="string"||t instanceof String}function h_(t){return or(t)||Ti(t)||wf(t)||Pr(t)||p_(t)||d_(t)||t===null||t===void 0}function d_(t){var e=wn(t)&&!go(t),n=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,c,u=s.length;for(a=0;a<u;a+=1)c=s[a],n=n||ke(t,c);return e&&n}function p_(t){var e=ar(t),n=!1;return e&&(n=t.filter(function(s){return!Pr(s)&&wf(t)}).length===0),e&&n}function m_(t){var e=wn(t)&&!go(t),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,c;for(a=0;a<s.length;a+=1)c=s[a],n=n||ke(t,c);return e&&n}function g_(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function y_(t,e){arguments.length===1&&(arguments[0]?h_(arguments[0])?(t=arguments[0],e=void 0):m_(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Ke(),s=Yo(n,this).startOf("day"),a=z.calendarFormat(this,s)||"sameElse",c=e&&(wr(e[a])?e[a].call(this,n):e[a]);return this.format(c||this.localeData().calendar(a,this,Ke(n)))}function __(){return new Ei(this)}function w_(t,e){var n=or(t)?t:Ke(t);return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function b_(t,e){var n=or(t)?t:Ke(t);return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function S_(t,e,n,s){var a=or(t)?t:Ke(t),c=or(e)?e:Ke(e);return this.isValid()&&a.isValid()&&c.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(c,n):!this.isAfter(c,n))):!1}function v_(t,e){var n=or(t)?t:Ke(t),s;return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function T_(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function E_(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function A_(t,e,n){var s,a,c;if(!this.isValid())return NaN;if(s=Yo(t,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,e=Vt(e),e){case"year":c=Is(this,s)/12;break;case"month":c=Is(this,s);break;case"quarter":c=Is(this,s)/3;break;case"second":c=(this-s)/1e3;break;case"minute":c=(this-s)/6e4;break;case"hour":c=(this-s)/36e5;break;case"day":c=(this-s-a)/864e5;break;case"week":c=(this-s-a)/6048e5;break;default:c=this-s}return n?c:zt(c)}function Is(t,e){if(t.date()<e.date())return-Is(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),s=t.clone().add(n,"months"),a,c;return e-s<0?(a=t.clone().add(n-1,"months"),c=(e-s)/(s-a)):(a=t.clone().add(n+1,"months"),c=(e-s)/(a-s)),-(n+c)||0}z.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",z.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function O_(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function k_(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):wr(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function C_(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,s,a,c;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",c=e+'[")]',this.format(n+s+a+c)}function x_(t){t||(t=this.isUtc()?z.defaultFormatUtc:z.defaultFormat);var e=As(this,t);return this.localeData().postformat(e)}function P_(t,e){return this.isValid()&&(or(t)&&t.isValid()||Ke(t).isValid())?cr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function R_(t){return this.from(Ke(),t)}function D_(t,e){return this.isValid()&&(or(t)&&t.isValid()||Ke(t).isValid())?cr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function M_(t){return this.to(Ke(),t)}function bf(t){var e;return t===void 0?this._locale._abbr:(e=Nr(t),e!=null&&(this._locale=e),this)}var Sf=Gt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function vf(){return this._locale}var Fs=1e3,$n=60*Fs,Ws=60*$n,Tf=(365*400+97)*24*Ws;function Gn(t,e){return(t%e+e)%e}function Ef(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-Tf:new Date(t,e,n).valueOf()}function Af(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-Tf:Date.UTC(t,e,n)}function L_(t){var e,n;if(t=Vt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Af:Ef,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Gn(e+(this._isUTC?0:this.utcOffset()*$n),Ws);break;case"minute":e=this._d.valueOf(),e-=Gn(e,$n);break;case"second":e=this._d.valueOf(),e-=Gn(e,Fs);break}return this._d.setTime(e),z.updateOffset(this,!0),this}function N_(t){var e,n;if(t=Vt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Af:Ef,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Ws-Gn(e+(this._isUTC?0:this.utcOffset()*$n),Ws)-1;break;case"minute":e=this._d.valueOf(),e+=$n-Gn(e,$n)-1;break;case"second":e=this._d.valueOf(),e+=Fs-Gn(e,Fs)-1;break}return this._d.setTime(e),z.updateOffset(this,!0),this}function U_(){return this._d.valueOf()-(this._offset||0)*6e4}function B_(){return Math.floor(this.valueOf()/1e3)}function I_(){return new Date(this.valueOf())}function F_(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function W_(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function H_(){return this.isValid()?this.toISOString():null}function Y_(){return _o(this)}function K_(){return Xr({},de(this))}function q_(){return de(this).overflow}function $_(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),Q("N",qo),Q("NN",qo),Q("NNN",qo),Q("NNNN",rw),Q("NNNNN",nw),Le(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,s){var a=n._locale.erasParse(t,s,n._strict);a?de(n).era=a:de(n).invalidEra=t}),Q("y",Hn),Q("yy",Hn),Q("yyy",Hn),Q("yyyy",Hn),Q("yo",iw),Le(["y","yy","yyy","yyyy"],pt),Le(["yo"],function(t,e,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[pt]=n._locale.eraYearOrdinalParse(t,a):e[pt]=parseInt(t,10)});function G_(t,e){var n,s,a,c=this._eras||Nr("en")._eras;for(n=0,s=c.length;n<s;++n){switch(typeof c[n].since){case"string":a=z(c[n].since).startOf("day"),c[n].since=a.valueOf();break}switch(typeof c[n].until){case"undefined":c[n].until=1/0;break;case"string":a=z(c[n].until).startOf("day").valueOf(),c[n].until=a.valueOf();break}}return c}function V_(t,e,n){var s,a,c=this.eras(),u,l,h;for(t=t.toUpperCase(),s=0,a=c.length;s<a;++s)if(u=c[s].name.toUpperCase(),l=c[s].abbr.toUpperCase(),h=c[s].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(l===t)return c[s];break;case"NNNN":if(u===t)return c[s];break;case"NNNNN":if(h===t)return c[s];break}else if([u,l,h].indexOf(t)>=0)return c[s]}function z_(t,e){var n=t.since<=t.until?1:-1;return e===void 0?z(t.since).year():z(t.since).year()+(e-t.offset)*n}function j_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].name;return""}function J_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].narrow;return""}function Q_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].abbr;return""}function Z_(){var t,e,n,s,a=this.localeData().eras();for(t=0,e=a.length;t<e;++t)if(n=a[t].since<=a[t].until?1:-1,s=this.clone().startOf("day").valueOf(),a[t].since<=s&&s<=a[t].until||a[t].until<=s&&s<=a[t].since)return(this.year()-z(a[t].since).year())*n+a[t].offset;return this.year()}function X_(t){return ke(this,"_erasNameRegex")||$o.call(this),t?this._erasNameRegex:this._erasRegex}function ew(t){return ke(this,"_erasAbbrRegex")||$o.call(this),t?this._erasAbbrRegex:this._erasRegex}function tw(t){return ke(this,"_erasNarrowRegex")||$o.call(this),t?this._erasNarrowRegex:this._erasRegex}function qo(t,e){return e.erasAbbrRegex(t)}function rw(t,e){return e.erasNameRegex(t)}function nw(t,e){return e.erasNarrowRegex(t)}function iw(t,e){return e._eraYearOrdinalRegex||Hn}function $o(){var t=[],e=[],n=[],s=[],a,c,u,l,h,m=this.eras();for(a=0,c=m.length;a<c;++a)u=Rr(m[a].name),l=Rr(m[a].abbr),h=Rr(m[a].narrow),e.push(u),t.push(l),n.push(h),s.push(u),s.push(l),s.push(h);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Hs(t,e){ie(0,[t,t.length],0,e)}Hs("gggg","weekYear"),Hs("ggggg","weekYear"),Hs("GGGG","isoWeekYear"),Hs("GGGGG","isoWeekYear"),Q("G",xs),Q("g",xs),Q("GG",Ye,Nt),Q("gg",Ye,Nt),Q("GGGG",Co,ko),Q("gggg",Co,ko),Q("GGGGG",Cs,Os),Q("ggggg",Cs,Os),Oi(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,s){e[s.substr(0,2)]=be(t)}),Oi(["gg","GG"],function(t,e,n,s){e[s]=z.parseTwoDigitYear(t)});function sw(t){return Of.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function aw(t){return Of.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function ow(){return Lr(this.year(),1,4)}function uw(){return Lr(this.isoWeekYear(),1,4)}function cw(){var t=this.localeData()._week;return Lr(this.year(),t.dow,t.doy)}function lw(){var t=this.localeData()._week;return Lr(this.weekYear(),t.dow,t.doy)}function Of(t,e,n,s,a){var c;return t==null?Pi(this,s,a).year:(c=Lr(t,s,a),e>c&&(e=c),fw.call(this,t,e,n,s,a))}function fw(t,e,n,s,a){var c=rf(t,e,n,s,a),u=xi(c.year,0,c.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}ie("Q",0,"Qo","quarter"),Q("Q",$l),Le("Q",function(t,e){e[Dr]=(be(t)-1)*3});function hw(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),Q("D",Ye,Yn),Q("DD",Ye,Nt),Q("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Le(["D","DD"],Sr),Le("Do",function(t,e){e[Sr]=be(t.match(Ye)[0])});var kf=Kn("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",ks),Q("DDDD",Gl),Le(["DDD","DDDD"],function(t,e,n){n._dayOfYear=be(t)});function dw(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}ie("m",["mm",2],0,"minute"),Q("m",Ye,xo),Q("mm",Ye,Nt),Le(["m","mm"],ur);var pw=Kn("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ye,xo),Q("ss",Ye,Nt),Le(["s","ss"],Mr);var mw=Kn("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",ks,$l),Q("SS",ks,Nt),Q("SSS",ks,Gl);var tn,Cf;for(tn="SSSS";tn.length<=9;tn+="S")Q(tn,Hn);function gw(t,e){e[bn]=be(("0."+t)*1e3)}for(tn="S";tn.length<=9;tn+="S")Le(tn,gw);Cf=Kn("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function yw(){return this._isUTC?"UTC":""}function _w(){return this._isUTC?"Coordinated Universal Time":""}var V=Ei.prototype;V.add=l_,V.calendar=y_,V.clone=__,V.diff=A_,V.endOf=N_,V.format=x_,V.from=P_,V.fromNow=R_,V.to=D_,V.toNow=M_,V.get=C0,V.invalidAt=q_,V.isAfter=w_,V.isBefore=b_,V.isBetween=S_,V.isSame=v_,V.isSameOrAfter=T_,V.isSameOrBefore=E_,V.isValid=Y_,V.lang=Sf,V.locale=bf,V.localeData=vf,V.max=Yy,V.min=Hy,V.parsingFlags=K_,V.set=x0,V.startOf=L_,V.subtract=f_,V.toArray=F_,V.toObject=W_,V.toDate=I_,V.toISOString=k_,V.inspect=C_,typeof Symbol<"u"&&Symbol.for!=null&&(V[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),V.toJSON=H_,V.toString=O_,V.unix=B_,V.valueOf=U_,V.creationData=$_,V.eraName=j_,V.eraNarrow=J_,V.eraAbbr=Q_,V.eraYear=Z_,V.year=jl,V.isLeapYear=k0,V.weekYear=sw,V.isoWeekYear=aw,V.quarter=V.quarters=hw,V.month=ef,V.daysInMonth=I0,V.week=V.weeks=G0,V.isoWeek=V.isoWeeks=V0,V.weeksInYear=cw,V.weeksInWeekYear=lw,V.isoWeeksInYear=ow,V.isoWeeksInISOWeekYear=uw,V.date=kf,V.day=V.days=ay,V.weekday=oy,V.isoWeekday=uy,V.dayOfYear=dw,V.hour=V.hours=my,V.minute=V.minutes=pw,V.second=V.seconds=mw,V.millisecond=V.milliseconds=Cf,V.utcOffset=Qy,V.utc=Xy,V.local=e_,V.parseZone=t_,V.hasAlignedHourOffset=r_,V.isDST=n_,V.isLocal=s_,V.isUtcOffset=a_,V.isUtc=mf,V.isUTC=mf,V.zoneAbbr=yw,V.zoneName=_w,V.dates=Gt("dates accessor is deprecated. Use date instead.",kf),V.months=Gt("months accessor is deprecated. Use month instead",ef),V.years=Gt("years accessor is deprecated. Use year instead",jl),V.zone=Gt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zy),V.isDSTShifted=Gt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",i_);function ww(t){return Ke(t*1e3)}function bw(){return Ke.apply(null,arguments).parseZone()}function xf(t){return t}var Ce=vo.prototype;Ce.calendar=s0,Ce.longDateFormat=c0,Ce.invalidDate=f0,Ce.ordinal=p0,Ce.preparse=xf,Ce.postformat=xf,Ce.relativeTime=g0,Ce.pastFuture=y0,Ce.set=n0,Ce.eras=G_,Ce.erasParse=V_,Ce.erasConvertYear=z_,Ce.erasAbbrRegex=ew,Ce.erasNameRegex=X_,Ce.erasNarrowRegex=tw,Ce.months=L0,Ce.monthsShort=N0,Ce.monthsParse=B0,Ce.monthsRegex=W0,Ce.monthsShortRegex=F0,Ce.week=Y0,Ce.firstDayOfYear=$0,Ce.firstDayOfWeek=q0,Ce.weekdays=ty,Ce.weekdaysMin=ny,Ce.weekdaysShort=ry,Ce.weekdaysParse=sy,Ce.weekdaysRegex=cy,Ce.weekdaysShortRegex=ly,Ce.weekdaysMinRegex=fy,Ce.isPM=dy,Ce.meridiem=gy;function Ys(t,e,n,s){var a=Nr(),c=_r().set(s,e);return a[n](c,t)}function Pf(t,e,n){if(Pr(t)&&(e=t,t=void 0),t=t||"",e!=null)return Ys(t,e,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Ys(t,s,n,"month");return a}function Go(t,e,n,s){typeof t=="boolean"?(Pr(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Pr(e)&&(n=e,e=void 0),e=e||"");var a=Nr(),c=t?a._week.dow:0,u,l=[];if(n!=null)return Ys(e,(n+c)%7,s,"day");for(u=0;u<7;u++)l[u]=Ys(e,(u+c)%7,s,"day");return l}function Sw(t,e){return Pf(t,e,"months")}function vw(t,e){return Pf(t,e,"monthsShort")}function Tw(t,e,n){return Go(t,e,n,"weekdays")}function Ew(t,e,n){return Go(t,e,n,"weekdaysShort")}function Aw(t,e,n){return Go(t,e,n,"weekdaysMin")}en("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=be(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),z.lang=Gt("moment.lang is deprecated. Use moment.locale instead.",en),z.langData=Gt("moment.langData is deprecated. Use moment.localeData instead.",Nr);var Ur=Math.abs;function Ow(){var t=this._data;return this._milliseconds=Ur(this._milliseconds),this._days=Ur(this._days),this._months=Ur(this._months),t.milliseconds=Ur(t.milliseconds),t.seconds=Ur(t.seconds),t.minutes=Ur(t.minutes),t.hours=Ur(t.hours),t.months=Ur(t.months),t.years=Ur(t.years),this}function Rf(t,e,n,s){var a=cr(e,n);return t._milliseconds+=s*a._milliseconds,t._days+=s*a._days,t._months+=s*a._months,t._bubble()}function kw(t,e){return Rf(this,t,e,1)}function Cw(t,e){return Rf(this,t,e,-1)}function Df(t){return t<0?Math.floor(t):Math.ceil(t)}function xw(){var t=this._milliseconds,e=this._days,n=this._months,s=this._data,a,c,u,l,h;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=Df(Vo(n)+e)*864e5,e=0,n=0),s.milliseconds=t%1e3,a=zt(t/1e3),s.seconds=a%60,c=zt(a/60),s.minutes=c%60,u=zt(c/60),s.hours=u%24,e+=zt(u/24),h=zt(Mf(e)),n+=h,e-=Df(Vo(h)),l=zt(n/12),n%=12,s.days=e,s.months=n,s.years=l,this}function Mf(t){return t*4800/146097}function Vo(t){return t*146097/4800}function Pw(t){if(!this.isValid())return NaN;var e,n,s=this._milliseconds;if(t=Vt(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+s/864e5,n=this._months+Mf(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Vo(this._months)),t){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+t)}}function Br(t){return function(){return this.as(t)}}var Lf=Br("ms"),Rw=Br("s"),Dw=Br("m"),Mw=Br("h"),Lw=Br("d"),Nw=Br("w"),Uw=Br("M"),Bw=Br("Q"),Iw=Br("y"),Fw=Lf;function Ww(){return cr(this)}function Hw(t){return t=Vt(t),this.isValid()?this[t+"s"]():NaN}function vn(t){return function(){return this.isValid()?this._data[t]:NaN}}var Yw=vn("milliseconds"),Kw=vn("seconds"),qw=vn("minutes"),$w=vn("hours"),Gw=vn("days"),Vw=vn("months"),zw=vn("years");function jw(){return zt(this.days()/7)}var Ir=Math.round,Vn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jw(t,e,n,s,a){return a.relativeTime(e||1,!!n,t,s)}function Qw(t,e,n,s){var a=cr(t).abs(),c=Ir(a.as("s")),u=Ir(a.as("m")),l=Ir(a.as("h")),h=Ir(a.as("d")),m=Ir(a.as("M")),b=Ir(a.as("w")),T=Ir(a.as("y")),P=c<=n.ss&&["s",c]||c<n.s&&["ss",c]||u<=1&&["m"]||u<n.m&&["mm",u]||l<=1&&["h"]||l<n.h&&["hh",l]||h<=1&&["d"]||h<n.d&&["dd",h];return n.w!=null&&(P=P||b<=1&&["w"]||b<n.w&&["ww",b]),P=P||m<=1&&["M"]||m<n.M&&["MM",m]||T<=1&&["y"]||["yy",T],P[2]=e,P[3]=+t>0,P[4]=s,Jw.apply(null,P)}function Zw(t){return t===void 0?Ir:typeof t=="function"?(Ir=t,!0):!1}function Xw(t,e){return Vn[t]===void 0?!1:e===void 0?Vn[t]:(Vn[t]=e,t==="s"&&(Vn.ss=e-1),!0)}function e1(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Vn,a,c;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(s=Object.assign({},Vn,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),a=this.localeData(),c=Qw(this,!n,s,a),n&&(c=a.pastFuture(+this,c)),a.postformat(c)}var zo=Math.abs;function zn(t){return(t>0)-(t<0)||+t}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var t=zo(this._milliseconds)/1e3,e=zo(this._days),n=zo(this._months),s,a,c,u,l=this.asSeconds(),h,m,b,T;return l?(s=zt(t/60),a=zt(s/60),t%=60,s%=60,c=zt(n/12),n%=12,u=t?t.toFixed(3).replace(/\.?0+$/,""):"",h=l<0?"-":"",m=zn(this._months)!==zn(l)?"-":"",b=zn(this._days)!==zn(l)?"-":"",T=zn(this._milliseconds)!==zn(l)?"-":"",h+"P"+(c?m+c+"Y":"")+(n?m+n+"M":"")+(e?b+e+"D":"")+(a||s||t?"T":"")+(a?T+a+"H":"")+(s?T+s+"M":"")+(t?T+u+"S":"")):"P0D"}var Ee=Us.prototype;Ee.isValid=Vy,Ee.abs=Ow,Ee.add=kw,Ee.subtract=Cw,Ee.as=Pw,Ee.asMilliseconds=Lf,Ee.asSeconds=Rw,Ee.asMinutes=Dw,Ee.asHours=Mw,Ee.asDays=Lw,Ee.asWeeks=Nw,Ee.asMonths=Uw,Ee.asQuarters=Bw,Ee.asYears=Iw,Ee.valueOf=Fw,Ee._bubble=xw,Ee.clone=Ww,Ee.get=Hw,Ee.milliseconds=Yw,Ee.seconds=Kw,Ee.minutes=qw,Ee.hours=$w,Ee.days=Gw,Ee.weeks=jw,Ee.months=Vw,Ee.years=zw,Ee.humanize=e1,Ee.toISOString=Ks,Ee.toString=Ks,Ee.toJSON=Ks,Ee.locale=bf,Ee.localeData=vf,Ee.toIsoString=Gt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),Ee.lang=Sf,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",xs),Q("X",S0),Le("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),Le("x",function(t,e,n){n._d=new Date(be(t))});//! moment.js
42
- z.version="2.30.1",t0(Ke),z.fn=V,z.min=Ky,z.max=qy,z.now=$y,z.utc=_r,z.unix=ww,z.months=Sw,z.isDate=Ti,z.locale=en,z.invalid=Ts,z.duration=cr,z.isMoment=or,z.weekdays=Tw,z.parseZone=bw,z.localeData=Nr,z.isDuration=Bs,z.monthsShort=vw,z.weekdaysMin=Aw,z.defineLocale=No,z.updateLocale=by,z.locales=Sy,z.weekdaysShort=Ew,z.normalizeUnits=Vt,z.relativeTimeRounding=Zw,z.relativeTimeThreshold=Xw,z.calendarFormat=g_,z.prototype=V,z.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function Nf(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function t1(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4);return e+n}function Uf(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function r1(t){const e=atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n}const Ct=60,Bf=60*Ct,Li=24*Bf,qs=7*Li;function If(){return new Date().getTime()/1e3}function n1(t){return t.split("").map(e=>e.charCodeAt(0))}function $s(t){const e=new TextEncoder().encode(t);return Nf(Uf(e))}function Gs(t){const e=r1(t1(t));return new TextDecoder().decode(e)}async function Ff(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e),s=new Uint8Array(n);let a="";for(let c=0;c<s.length;c++)a+=s[c].toString(16).padStart(2,"0");return a}async function jo(t,e,n="hex"){const s=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,new TextEncoder().encode(t)),c=new Uint8Array(a);if(n==="base64url")return Nf(Uf(c));let u="";for(let l=0;l<c.length;l++)u+=c[l].toString(16).padStart(2,"0");return u}function Jo(t,e=void 0){return _n.createJWT(t,e)}function Wf(t){return _n.parseJWT(t)}function Hf(t){return _n.jwkToPublicKey(t)}function Qo(t,e){return _n.encryptPayload(t,e)}function Zo(t){if(Array.isArray(t))return t.map(Zo);if(t&&typeof t=="object"&&t.constructor===Object){const e={},n=Object.keys(t),s=n.length;for(let a=0;a<s;a+=1)e[ro.camelCase(n[a])]=Zo(t[n[a]]);return e}return t}function Vs(t){if(!t)return!0;try{return JSON.parse(Gs(t.split(".")[1])).exp<If()}catch{return!0}}function Xo(t){return jt("root",t,"non-nullable object",!1)}function eu(t,e){return jt("root",t,"object",e)}function tu(t,e){return jt("root",t,"object",e)}function zs(t,e){!Array.isArray(t)&&t!==null&&t!==void 0&&jt(e,t,"array",!0)}function xt(t,e,n){typeof t=="string"?t.match(/\d+(\.\d+)?/)||jt(n,t,"string",e):typeof t!="number"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"number",e)}function ct(t,e,n){typeof t=="string"?t.match(/\d+(\.\d+)?/)||jt(n,t,"number",e):typeof t!="number"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"number",e)}function Tn(t,e,n){typeof t!="boolean"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"boolean",e)}function Ge(t,e,n){typeof t!="string"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"string",e)}function Yf(t,e){t!=null&&jt(e,t,"null or undefined",!1)}function jt(t,e,n,s){throw s&&(n+=", null, or undefined"),new TypeError("Expected "+n+" at "+t+` but found:
43
- `+JSON.stringify(e))}function X(t){return Ze.isBigNumber(t)?t:t?new Ze(t):new Ze("0")}function En(t,e){return new Ze(e).toFixed(t>0?t:0)}function Ni(t){return typeof t=="number"?t:parseFloat(t)}function jn(t){return typeof t=="number"?t:parseInt(t)}function ru(t){let e=Ni(t);return e<1e10&&(e=e*1e3),new Date(e)}function Kf(t){switch(t.toString().toUpperCase()){case"1S":return 1;case"2S":return 2;case"3S":return 3;case"5S":return 5;case"10S":return 10;case"15S":return 15;case"30S":return 30;case"1":return Ct;case"2":return Ct*2;case"3":return Ct*3;case"5":return Ct*5;case"10":return Ct*10;case"15":return Ct*15;case"30":return Ct*30;case"60":return Ct*60;case"120":return Ct*120;case"240":return Ct*240;case"360":return Ct*360;case"720":return Ct*720;case"D":case"1D":return Li;case"3D":return Li*3;case"W":return qs;case"1W":return qs;case"2W":return qs*2;case"1M":return Li*30}}const js=t=>typeof t=="object"?t:new Date(t*1e3),qf=(t,e)=>{switch(t=z.utc(js(t)),e){case"1":case"2":case"3":return t.endOf("day").unix();case"5":case"10":case"15":return t.endOf("isoWeek").unix();case"30":case"60":case"120":return t.endOf("month").unix();case"240":case"360":case"720":case"D":case"1D":return t.endOf("year").unix()}},i1=(t,e)=>{switch(t=z.utc(js(t)),e){case"1":case"2":case"3":return t.startOf("day").unix();case"5":case"10":case"15":return t.startOf("isoWeek").unix();case"30":case"60":case"120":return t.startOf("month").unix();case"240":case"360":case"720":case"D":case"1D":return t.startOf("year").unix()}};function $f(t){switch(t){case"1":case"2":case"3":return"day";case"5":case"10":case"15":return"week";case"30":case"60":case"120":return"month";case"240":case"360":case"720":case"D":case"1D":return"year";default:throw new Error(`Unsupported resolution: ${t}`)}}function Gf(t,e){let n=z(js(e)),s;switch(t){case"day":s={year:n.year(),month:n.month()+1,day:n.date()};break;case"week":s={year:n.isoWeekYear(),week:n.isoWeek()};break;case"month":s={year:n.year(),month:n.month()+1};break;case"year":s={year:n.year()};break;default:throw new Error(`Unsupported bucketType: ${t}`)}return s}function Vf(t,e,n){const s=[];let a=z.utc(e*1e3);const c=m=>{switch(n){case"day":return m.startOf("day");case"week":return m.startOf("isoWeek");case"month":return m.startOf("month");case"year":return m.startOf("year");default:throw new Error(`Unsupported bucketType: ${n}`)}},u=m=>{switch(n){case"day":return m.subtract(1,"day");case"week":return m.subtract(1,"week");case"month":return m.subtract(1,"month");case"year":return m.subtract(1,"year");default:throw new Error(`Unsupported bucketType: ${n}`)}};let l=c(a);const h=c(z.utc(t*1e3));for(;l>=h;)s.push(l.clone()),l=u(l);return s}function Js(t,e,n){let s=Kf(e),a=typeof n=="object"?n.getTime()/1e3:n;return Math.floor(a/s)*s-s*(t-1)}function zf(t,e){let n=e;if(typeof e=="string"?n=[{query:e,marketProperty:"fullDisplayName"}]:Array.isArray(e)?n=e.map(a=>{if(typeof a=="string")return{query:a,marketProperty:"fullDisplayName"};if(!Array.isArray(a))return a}):n=[e],n.length===0||!n.find(({query:a})=>!!a&&!!a.length))return t;let s=t;return n.forEach(({query:a,marketProperty:c})=>{let u;if(a.match(/[-_:\/\\]+/))try{u=new RegExp(a.replace(/\*/g,".*"),"i")}catch{}const l=a.toLowerCase().split(/[\s]+/).filter(Boolean);s=ut.pickBy(s,(h,m)=>{const b=h[c].toLowerCase();return u&&c==="fullDisplayName"?!!u.exec(h[c]):l.filter(T=>b.includes(T)).length===l.length})}),s}let nu;class s1{static initialize=e=>{nu=e,console.log("Coinray I18n initialized")};static t=(e,n)=>nu?nu.t(`coinray:${e}`,n):`i18n uninitialized. Set the Coinray.I18n.instance. Key: ${e}`}const jf="2.0.4";class a1 extends Error{errorCode;errorMessage;exchange;constructor({code:e,message:n,exchange:s}){super("Request failed"),this.name="CoinrayError",this.errorCode=e,this.errorMessage=n,this.exchange=s}}class xe{static I18n=s1;config;_token;_sessionKey;_credential;_firstOpen;_onTokenExpired;_tokenCheckTimeout;_onError;_onOpen;_socket;_transport;_tickerListeners=new Map;_tickerSymbols=new Map;_tradeListeners={};_tradeSnapshots={};_orderbookListeners={};_orderbookSnapshots={};_candleTradeListeners={};_candleListeners={};_candles={};_timers={};_channels={};_connected;markConnected;_publicKey;_refreshingToken;_nonceOffset;tickersSubscribed=!1;tradesSubscribed=!1;orderBookSubscribed=!1;_timeOffset;_timeOffsetTimeout;_candleCache;_candleCacheCreatedAt;constructor(e,{apiEndpoint:n,orderEndpoint:s,websocketEndpoint:a}={apiEndpoint:"https://api.coinray.eu",orderEndpoint:"https://api.coinray.eu",websocketEndpoint:"wss://ws.coinray.eu/v1"}){this._token=e,this._nonceOffset=0,this._timeOffset=0,this._firstOpen=!0,this.config={apiEndpoint:n||"https://api.coinray.eu",orderEndpoint:s||n||"https://api.coinray.eu",websocketEndpoint:a||"wss://ws.coinray.eu/v1"},this._candleCache=new Map,this.loadTimeOffset().then()}authenticateDevice=(e,n)=>{this._credential=e,this._sessionKey=n};destroy=()=>{this._tradeListeners={},this._orderbookListeners={},this._tickerListeners=new Map,this._tickerSymbols=new Map,this._channels={},this._timeOffsetTimeout&&clearTimeout(this._timeOffsetTimeout),this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this.disconnect()};checkToken=async(e=!0)=>{try{if(Vs(this._token)){if(console.log("Coinray token expired. Can refresh:",!!this._onTokenExpired),!this._onTokenExpired)return!1;this._refreshingToken||(this._refreshingToken=this._onTokenExpired());try{this._token=await this._refreshingToken}catch(n){return console.log("Coinray token could not be refreshed",n),this._refreshingToken=void 0,!1}if(this._refreshingToken=void 0,!Vs(this._token))this.reconnect();else return!1}}catch(n){console.error(n)}return e&&(this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)),!0};setTransport=e=>{this._transport=e};onTokenExpired=e=>{this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this._onTokenExpired=e,this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)};refreshToken=e=>{this._token=e};getNonce=()=>(this._nonceOffset>900&&(this._nonceOffset=0),this._nonceOffset+=1,this.getTime()+this._nonceOffset);getTime=()=>Math.floor(new Date().getTime()/1e3)*1e3+this._timeOffset;loadTimeOffset=async()=>{try{const{result:e}=await this.get("/coinray/time");this._timeOffset=e.time-new Date().getTime()}catch(e){console.error(e)}this._timeOffsetTimeout=setTimeout(this.loadTimeOffset,6e4)};getToken=async()=>{if(await this.checkToken(!1))return this._token;throw new Error("Token is expired. call refreshToken in the onTokenExpired callback")};reconnect=()=>{this._connected&&this.socket.conn.close()};disconnect=()=>{this._socket&&(this._socket.disconnect(),this._socket=void 0),this._connected=void 0};connect=async()=>{if(this._connected){await this._connected;return}else this._connected=new Promise(e=>{this.markConnected=e});this.socket.onOpen(e=>{this._onOpen&&this._onOpen(e)}),this.socket.onError(e=>{this._onError&&this._onError(e)}),this.socket.connect(),this.markConnected()};onOpen=e=>{this._onOpen=e};onError=e=>{this._onError=e};resubscribe=()=>{if(this._firstOpen){this._firstOpen=!1;return}Object.keys(this._tickerListeners).forEach(e=>{this._tickerListeners[e].length>0&&this.getChannel("tickers").push("subscribe",{exchangeCodes:[e]},5e3)}),Object.keys(this._tradeListeners).forEach(e=>{this._tradeListeners[e].length>0&&this.getChannel("trades").push("subscribe",{symbols:e,snapshots:!0},5e3)}),Object.keys(this._orderbookListeners).forEach(e=>{this._orderbookListeners[e].length>0&&this.getChannel("orderbooks").push("subscribe",{symbols:e,snapshots:!0},5e3)})};subscribeTickers=async(e,n=!1,s)=>{if(e.length===0)return!1;if(n&&(this._tickerListeners.clear(),this._tickerSymbols.clear()),this._tickerListeners.has(s)){let c=this._tickerListeners.get(s);e.forEach(u=>c.add(u))}else this._tickerListeners.set(s,new Set(e));e.forEach(c=>{this._tickerSymbols.has(c)||this._tickerSymbols.set(c,new Set),this._tickerSymbols.get(c).add(s)}),await this.connect();const a=this.getChannel("tickers");return a.push("subscribe",{coinraySymbols:e,reset:n},5e3),this.tickersSubscribed||(this.tickersSubscribed=!0,a.on("update",c=>{let{exchange_code:u,tickers:l}=c;const h=l.map(xe._parseTicker);this._tickerListeners.forEach((m,b)=>{const T=h.filter(P=>m.has(P.coinraySymbol));b({type:"tickers:update",exchangeCode:u,tickers:T})})}),a.on("error",c=>console.error(c))),s};unsubscribeAllTickers=()=>{this._tickerListeners.clear(),this._tickerSymbols.clear(),this.getChannel("tickers").push("unsubscribe",{all:!0},5e3)};unsubscribeTickers=(e,n)=>{if(n&&this._tickerListeners.has(n)){let s=this._tickerListeners.get(n),a=[];e.forEach(c=>{s.delete(c),this._tickerSymbols.has(c)&&(this._tickerSymbols.get(c).delete(n),this._tickerSymbols.get(c).size===0&&(this._tickerSymbols.delete(c),a.push(c)))}),s.size===0&&this._tickerListeners.delete(n),a.length>0&&this.getChannel("tickers").push("unsubscribe",{coinraySymbols:a},5e3)}};subscribeTrades=async({coinraySymbol:e},n)=>{if(this._tradeListeners[e]&&this._tradeListeners[e].length>0)return this._tradeListeners[e].includes(n)||this._tradeListeners[e].push(n),n({type:"trades:snapshot",coinraySymbol:e,trades:this._tradeSnapshots[e]}),n;this._tradeSnapshots[e]=[],this._tradeListeners[e]=[n],await this.connect();const s=this.getChannel("trades");return s.push("subscribe",{symbols:e,snapshots:!0},5e3),this.tradesSubscribed||(this.tradesSubscribed=!0,s.on("snapshot",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade);this._tradeSnapshots[a]=l,u.map(h=>h({type:"trades:snapshot",coinraySymbol:a,trades:l}))}),s.on("update",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade),h=[...l,...this._tradeSnapshots[a]],m=new Date(new Date().getTime()-12e4),b=h.filter(({time:T})=>T>m);b.length>100?this._tradeSnapshots[a]=b:this._tradeSnapshots[a]=h.slice(0,100),u.map(T=>T({type:"trades:update",coinraySymbol:a,trades:l}))}),s.on("error",a=>console.error(a))),n};unsubscribeTrades=({coinraySymbol:e},n)=>{n&&this._tradeListeners[e]?(this._tradeListeners[e]=this._tradeListeners[e].filter(s=>s!==n),this._tradeListeners[e].length===0&&this.getChannel("trades").push("unsubscribe",{symbols:e},5e3)):(this._tradeSnapshots[e]=[],this._tradeListeners[e]=[])};subscribeOrderBook=async({coinraySymbol:e},n)=>{if(this._orderbookListeners[e]&&this._orderbookListeners[e].length>0)return this._orderbookListeners[e].includes(n)||this._orderbookListeners[e].push(n),n({type:"orderBook:snapshot",coinraySymbol:e,orderBook:this._orderbookSnapshots[e]}),n;this._orderbookSnapshots[e]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[e]=[n],await this.connect();const s=this.getChannel("orderbooks");return s.push("subscribe",{symbols:e},1e4),this.orderBookSubscribed||(this.orderBookSubscribed=!0,s.on("snapshot",({orderbooks:a})=>{Object.keys(a).forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookSnapshot(a[u]);this._orderbookSnapshots[u]=h,l.map(m=>m({type:"orderBook:snapshot",coinraySymbol:u,orderBook:h}))})}),s.on("update",({orderbooks:a})=>{const c=Object.keys(a);c.length!==0&&c.forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookUpdate(a[u]);this._orderbookSnapshots[u]=xe._updateOrderBook(this._orderbookSnapshots[u],h),l.map(m=>m({type:"orderBook:update",coinraySymbol:u,orderBook:h}))})}),s.on("error",a=>console.error(a))),n};unsubscribeOrderBook=({coinraySymbol:e},n)=>{n&&this._orderbookListeners[e]?(this._orderbookListeners[e]=this._orderbookListeners[e].filter(s=>s!==n),this._orderbookListeners[e].length===0&&this.getChannel("orderbooks").push("unsubscribe",{symbols:e},5e3)):(this._orderbookSnapshots[e]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[e]=[])};subscribeCandles=async({coinraySymbol:e,resolution:n,lastCandle:s},a)=>{const c=`${e}-${n}`;if(this._candleListeners[c]&&this._candleListeners[c].length>0)return this._candleListeners[c].push(a),a;this._candleListeners[c]=[a];const u=({type:l,coinraySymbol:h,trades:m})=>{const b=Object.values(this._candleListeners[c]),T=xe._tradesToLastCandle(n,m),P=T[T.length-1];P&&(this._candles[c]&&l==="trades:snapshot"&&(this._candles[c].skipVolume=!0),this._candles[c]=xe._mergeCandle(this._candles[c],P),b.map($=>$({coinraySymbol:h,resolution:n,candle:this._candles[c],previousCandles:T})))};return this._candleTradeListeners[e]?this._candleTradeListeners[e][c]=u:this._candleTradeListeners[e]={[c]:u},this._candles[c]=s||{time:new Date(0)},await this.subscribeTrades({coinraySymbol:e},u),this.startNewCandleTimer({candleId:c,resolution:n,coinraySymbol:e}),a};startNewCandleTimer=({candleId:e,resolution:n,coinraySymbol:s})=>{this._timers[e]&&clearTimeout(this._timers[e]);let a=Js(0,n,new Date)-new Date().getTime()/1e3;const c=Object.values(this._candleListeners[e]);this._timers[e]=setTimeout(()=>{let u=Js(1,n,new Date)*1e3,l=this._candles[e];l&&u>l.time.getTime()&&(this._candles[e]={time:new Date(u),open:l.close,high:l.close,low:l.close,close:l.close,baseVolume:0,quoteVolume:0,numTrades:0},c.map(h=>h({coinraySymbol:s,resolution:n,candle:this._candles[e],previousCandles:[]}))),this.startNewCandleTimer({candleId:e,resolution:n,coinraySymbol:s})},a*1e3)};unsubscribeCandles=({coinraySymbol:e,resolution:n},s)=>{const a=`${e}-${n}`;s&&this._candleListeners[a]?this._candleListeners[a]=this._candleListeners[a].filter(c=>c!==s):this._candleListeners[a]=[],this._candleListeners[a].length===0&&(this.unsubscribeTrades({coinraySymbol:e},this._candleTradeListeners[e][a]),this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),delete this._candles[a],delete this._candleTradeListeners[e][a])};fetchFirstCandleTime=async({coinraySymbol:e,resolution:n})=>{let{result:{startTime:s}}=await this.get("candles/start-time",{version:"v1",params:{symbol:e,resolution:n}});return s};fetchCandles=async({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c})=>{if(this.flushCache(),n.endsWith("S"))return(await this.getWebsocketCandles(e,n)).filter($=>{let O=$.time.getTime()/1e3;return O>=s&&O<=a});const u=$f(n),l=new Date().getTime()/1e3,h=[];let m=a;if(qf(a,n)>=l){let P=await this.getOpenCandles(c,{version:"v2",params:{symbol:e,resolution:n}});if(P.length>0)m=Math.min(P[0].time.getTime()/1e3,m),h.push(...P);else return[]}let b=Js(2,n,m),T=ro.chunk(Vf(s,b,u),10);for(let P=0;P<T.length;P+=1){let $=T[P].map(F=>{let ne=Gf(u,F),Y={version:"v2",params:{symbol:e,resolution:n,...ne}};return this.getHistoryCandles(Y)}),O=await Promise.all($),I=[];for(let F=0;F<O.length;F+=1)I=O[F].filter(({time:ne})=>ne.getTime()/1e3<m),I.length>0&&(m=Math.min(I[0].time.getTime()/1e3,m),h.unshift(...I));if(I.length===0)break}return h.filter(({time:P})=>{let $=P.getTime()/1e3;return $>=s&&$<=a}).sort((P,$)=>P.time.getTime()-$.time.getTime())};flushCache=()=>{let e=new Date().getTime()/1e3;(!this._candleCacheCreatedAt||e-this._candleCacheCreatedAt>600)&&(this._candleCacheCreatedAt=e,this._candleCache=new Map)};getWebsocketCandles=async(e,n)=>await new Promise(a=>{let c=setTimeout(()=>{this.unsubscribeCandles({coinraySymbol:e,resolution:n},u),a([])},0);const u=({previousCandles:l})=>{clearTimeout(c),this.unsubscribeCandles({coinraySymbol:e,resolution:n},u),a(l)};this.subscribeCandles({coinraySymbol:e,resolution:n},u)});getOpenCandles=async(e,n)=>{const s=this.candleCacheKey({prefix:"O",...n.params});let a=this._candleCache.get(s);if(!e&&a)return a;const c=await this.getWebsocketCandles(n.params.symbol,n.params.resolution),u=ut.keyBy(c,({time:h})=>h.getTime());let{result:l}=await this.get("candles/open",n);if(l.candles){let m=l.candles.map(xe._parseCandle).map(b=>{const T=u[b.time.getTime()];return T?xe._mergeCandle(b,T):b});return this._candleCache.set(s,m),m}else return[]};getHistoryCandles=async e=>{const n=this.candleCacheKey(e.params);let s=this._candleCache.get(n);if(s)return s;{if(e.params.year<2018)return new Promise(c=>c([]));let{result:a}=await this.get("candles/history",e);if(a.candles){let c=a.candles.map(xe._parseCandle);return this._candleCache.set(n,c),c}else return[]}};candleCacheKey=({symbol:e,resolution:n,year:s,month:a="",day:c="",week:u="",prefix:l="C"})=>`${l}/${e}/${n}/${s}/${a}/${c}/${u}`;fetchExchanges=async(e,n)=>{let s=n;return s||({result:{exchanges:s}}=await this.get("exchanges",{version:"v1"})),s.map(e)};fetchMarkets=async(e,n)=>{let s=n;return s||({result:{markets:s}}=await this.get("markets",{version:"v1",params:{exchange:e.code}})),s};createCredential=async(e,n)=>{const s=await this.publicKey();try{const a=await Qo(await Jo({password:n}),s),{result:c}=await this.post("credentials",{secret:n,body:{deviceId:e,encryptedPassword:a}});return c}catch(a){throw a}};wrapApiKey=async(e,n)=>{const s=await this.publicKey();let a;try{if(n)a=e;else{const u=JSON.stringify(e);a=await Qo(await Jo({apiKey:u}),s)}const{result:c}=await this.post("credentials/wrap_api_key",{secret:this._sessionKey,body:{encryptedApiKey:a,credential:this._credential}});return c}catch(c){throw c}};testAccount=async e=>{try{const{result:n}=await this.post("account/test",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};createSmartOrderSignature=async e=>{try{const{result:n}=await this.post("order/smart_order_signature",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{smartOrder:e,credential:this._credential}});return n}catch(n){throw n}};createOrder=async e=>{try{const{result:n}=await this.post("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};updateOrder=async e=>{try{const{result:n}=await this.patch("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};cancelOrder=async e=>{try{const{result:n}=await this.delete("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,orderId:e.orderId.toString(),credential:this._credential}});return n}catch(n){throw n}};createWebSocketToken=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:s}=await this.post("exchanges/ws_token",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{encryptedApiKey:n,exchangeCode:e,credential:this._credential}});return s}catch(s){throw s}};fetchPositions=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:s}=await this.get("futures/positions",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:e,encryptedApiKey:n}});return s}catch(s){throw s}};getBalances=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:{balances:s,positions:a}}=await this.get("account/balances",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:e,encryptedApiKey:n}});return{balances:s.map(xe._parseBalance),positions:a}}catch(s){throw s}};setLeverage=async({coinraySymbol:e,leverage:n,encryptedApiKey:s})=>{try{const{result:a}=await this.post("futures/leverage",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,leverage:n,encryptedApiKey:s}});return a}catch(a){throw a}};setMarginType=async({coinraySymbol:e,marginType:n,encryptedApiKey:s})=>{try{const{result:a}=await this.post("futures/margin_type",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,marginType:n,encryptedApiKey:s}});return a}catch(a){throw a}};async getProxyList({exchangeCode:e,credentialVersion:n}){let s="";e&&(s+=`?exchange=${e.toUpperCase()}`,s+=n?`&version=${n}`:"");const{result:{proxies:a}}=await this.get("credentials/ips"+s);return a}async publicKey(){if(!this._publicKey){const{result:{jwk:e}}=await this.get("credentials/certificate");this._publicKey=await Hf(e)}return this._publicKey}get clientId(){return Wf(this._token).header.kid}get socket(){if(!this._token)throw new Error("Token not present");return this._socket||(this._socket=new cg(this.config.websocketEndpoint,{heartbeatIntervalMs:5e3,transport:this._transport,reconnectAfterMs:()=>Vs(this._token)?3e4:1e3}),this.onOpen(this.resubscribe)),this._socket.params=()=>({reconnect:!0,token:this._token,client:"coinrayjs",version:jf}),this._socket}getChannel(e){if(this.connect(),this._channels[e])return this._channels[e];const n=this.socket.channel(e,{});return this._channels[e]=n,n.join(),n}get=async(e,{apiEndpoint:n=void 0,version:s="v2",headers:a={},params:c={},secret:u=""}={})=>await this._request(e,"GET",{version:s,apiEndpoint:n,headers:a,secret:u,params:c});post=async(e,n)=>await this._request(e,"POST",n);patch=async(e,n)=>await this._request(e,"PATCH",n);delete=async(e,n)=>await this._request(e,"delete",n);async _request(e,n,{apiEndpoint:s,version:a="v2",headers:c={},params:u={},body:l={},secret:h=""}){const m=await this.getToken(),b=Object.entries(u).length>0?"?"+Object.entries(u).map(([O,I])=>I?`${O}=${I}`:void 0).filter(Boolean).join("&"):"",T=this.getNonce(),P=`/api/${a}/${e}${b}`;if(a==="v2"&&!e.startsWith("candles")){const O=[T,n.toUpperCase(),P,n==="GET"?"":JSON.stringify(l)].join(""),I=h!=""?await jo(O,h):"";c={...c,"Cr-Access-Token":`${m}`,"Cr-Nonce":T,"Cr-Signature":I}}const $={method:n,url:(s||this.config.apiEndpoint)+P,timeout:2e4,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${m}`,"Cr-Client-version":jf,...c},data:n==="GET"?void 0:JSON.stringify(l)};try{const O=await Qe($);let I;O.status===200?I=O.data:O.status===204?I={}:I=O.data;const F=Object.fromEntries(Object.entries(O.headers).map(([ne,Y])=>[ne,Array.isArray(Y)?Y.join(", "):String(Y)]));return{result:I,_headers:F}}catch(O){const{response:I}=O;if(I){const{error:F}=I.data;throw new a1(F)}else throw O}}static _parseOrderBookSnapshot({asks:e,bids:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(e),bids:xe._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:e,bids_diff:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(e),bids:xe._parseBidAsk(n)}}static _updateOrderBook(e,{asks:n,bids:s,min_seq:a,max_seq:c}){const u=(l,h)=>{ut.forEach(h,(m,b)=>{m>0?l[b]=m:delete l[b]})};return e.minSeq=a,e.maxSeq=c,u(e.bids,s),u(e.asks,n),e}static _parseBidAsk(e){return Array.isArray(e)?e.reduce((n,[s,a])=>(n[s]=parseFloat(a),n),{}):Object.keys(e).reduce((n,s)=>(n[s]=parseFloat(e[s]),n),{})}static _parseCandle(e){if(e){const[n,s,a,c,u,l,h]=e;return{time:ru(n),open:parseFloat(s),high:parseFloat(a),low:parseFloat(c),close:parseFloat(u),baseVolume:parseFloat(l),quoteVolume:parseFloat(h),numTrades:0}}else throw new Error("Candle")}static _parseTrade([e,n,s,a,c]){return{id:e,time:ru(n),price:parseFloat(s),quantity:parseFloat(a),type:["1","buy"].includes(c.toString())?"buy":"sell"}}static _parseTicker(e){return{askPrice:X(e.a),baseVolume:X(e.bv),bidPrice:X(e.b),btcVolume:X(e.B),coinraySymbol:e.s,highPrice1s:X(e.h),highPrice24h:X(e.H),lastPrice:X(e.c),lowPrice1s:X(e.l),lowPrice24h:X(e.L),openPrice1s:X(e.o),openPrice24h:X(e.O),quoteVolume:X(e.qv),usdVolume:X(e.U)}}static _parseBalance(e){let n={currency:e.currency,available:X(e.available),inOrders:X(e.inOrders),total:X(e.inOrders)};return e.initialMargin&&(n={...n,initialMargin:X(e.initialMargin),openOrderInitialMargin:X(e.openOrderInitialMargin),positionInitialMargin:X(e.positionInitialMargin),unrealizedProfit:X(e.unrealizedProfit),crossWalletBalance:X(e.crossWalletBalance),crossUnrealizedProfit:X(e.crossUnrealizedProfit)}),n}static _tradesToLastCandle(e,n){n.length>0&&n[0].time>n[n.length-1].time&&(n=n.reverse());const s=xe._resolutionToSeconds(e),a=ut.groupBy(n.reverse(),({time:c})=>Math.floor(c.getTime()/s)*s);return ut.sortBy(Object.keys(a),c=>parseInt(c)).reduce((c,u)=>{const l=a[u],h=l[0].time.getTime(),m=new Date(h-h%s);if(l.length===0)return c;let b=l[0],T,P,$,O,I=0,F=0;return c.length===0?T=P=$=O=b.price:T=P=$=O=c[c.length-1].close,l.reverse().map(({price:ne,quantity:Y})=>{P=Math.min(P,ne),$=Math.max($,ne),O=ne,I+=Y,F+=Y*ne}),c.push({time:new Date(m),open:T,high:$,low:P,close:O,baseVolume:I,quoteVolume:F,numTrades:l.length}),c},[])}static _mergeCandle(e,n){return!e||e.time<n.time?n:(e.numTrades+=n.numTrades,e.high=Math.max(e.high,n.high),e.low=Math.min(e.low,n.low),e.close=n.close,e.skipVolume?e.skipVolume=!1:(e.baseVolume+=n.baseVolume,e.quoteVolume+=n.quoteVolume),e)}static _resolutionToSeconds(e){return e.indexOf("W")>0||e.indexOf("D")>0?parseInt(e)*24*60*60*1e3:e.indexOf("S")>0?parseInt(e)*1e3:e==="D"?864e5:parseInt(e)*60*1e3}}class Qs{getExchange;api;id;coinraySymbol;symbol;symbolAlt;quoteCurrency;underlyingQuoteCurrency;baseLogoUrl;baseCurrency;exchangeCode;volume;quoteVolume;btcVolume;usdVolume;websocket;openPrice;highPrice;lowPrice;precisionBase;precisionQuote;precisionPrice;minBase;maxBase;maxBaseMarket;minQuote;maxQuote;minTrade;maxTrade;makerFee;takerFee;change;delistedOn;exchangeUrl;baseToUsd;quoteToUsd;status;note;_supportedOrderTypes;_lastPrice;_askPrice;_bidPrice;updatedAt;getPriceOverrides;static Create(e,n,s){return e==null?Xo(e):typeof e!="object"?eu(e,!1):Array.isArray(e)&&tu(e,!1),xt(e.id,!1,"id"),Ge(e.coinraySymbol,!1,"coinraySymbol"),Ge(e.symbol,!1,"symbol"),Ge(e.symbolAlt,!1,"symbolAlt"),Ge(e.quoteCurrency,!1,"quoteCurrency"),Ge(e.underlyingQuoteCurrency,!1,"underlyingQuoteCurrency"),Ge(e.baseLogoUrl,!0,"baseLogoUrl"),Ge(e.baseCurrency,!1,"baseCurrency"),Ge(e.exchangeCode,!1,"exchangeCode"),Ge(e.status||"",!1,"status"),Ge(e.note||"",!1,"note"),ct(e.volume,!0,"volume"),ct(e.quoteVolume,!0,"quoteVolume"),ct(e.btcVolume,!0,"btcVolume"),ct(e.usdVolume,!0,"usdVolume"),Tn(e.websocket,!1,"websocket"),ct(e.openPrice,!0,"openPrice"),ct(e.highPrice,!0,"highPrice"),ct(e.lowPrice,!0,"lowPrice"),xt(e.precisionBase,!1,"precisionBase"),xt(e.precisionPrice,!1,"precisionPrice"),xt(e.precisionBase,!1,"precisionBase"),xt(e.minBase,!0,"minBase"),xt(e.precisionQuote,!1,"precisionQuote"),xt(e.minQuote,!0,"minQuote"),ct(e.maxBase,!0,"maxBase"),ct(e.maxBaseMarket,!0,"maxBaseMarket"),ct(e.maxQuote,!0,"maxQuote"),ct(e.minTrade,!1,"minTrade"),xt(e.maxTrade,!0,"maxTrade"),e.maxTrade===void 0&&(e.maxTrade=null),xt(e.makerFee,!1,"makerFee"),xt(e.takerFee,!1,"takerFee"),xt(e.change,!1,"change"),Yf(e.delistedOn,"delistedOn"),e.delistedOn===void 0&&(e.delistedOn=null),Ge(e.exchangeUrl,!1,"exchangeUrl"),ct(e.lastPrice,!0,"lastPrice"),ct(e.baseToUsd,!1,"baseToUsd"),ct(e.quoteToUsd,!1,"quoteToUsd"),ct(e.askPrice,!0,"askPrice"),ct(e.bidPrice,!0,"bidPrice"),Ge(e.updatedAt,!1,"updatedAt"),new Qs(e,n,s)}constructor(e,n,s){this.getExchange=()=>s,this.api=n,this.id=e.id,this.coinraySymbol=e.coinraySymbol,this.symbol=e.symbol,this.symbolAlt=e.symbolAlt,this.quoteCurrency=e.quoteCurrency.toUpperCase(),this.underlyingQuoteCurrency=e.underlyingQuoteCurrency.toUpperCase(),this.baseLogoUrl=e.baseLogoUrl,this.baseCurrency=e.baseCurrency.toUpperCase(),this.exchangeCode=e.exchangeCode,this.status=e.status,this.note=e.note,this.volume=X(e.volume),this.quoteVolume=X(e.quoteVolume),this.btcVolume=X(e.btcVolume),this.usdVolume=X(e.usdVolume),this.websocket=e.websocket,this.openPrice=X(e.openPrice),this.highPrice=X(e.highPrice),this.lowPrice=X(e.lowPrice),this.precisionBase=e.precisionBase,this.precisionPrice=e.precisionPrice,this.precisionQuote=e.precisionQuote,this.minQuote=e.minQuote,this.precisionBase=e.precisionBase,this.minBase=e.minBase,this.maxBase=X(e.maxBase),this.maxBaseMarket=X(e.maxBaseMarket).isZero()?this.maxBase:X(e.maxBaseMarket),this.maxQuote=X(e.maxQuote),this.minTrade=X(e.minTrade),this.maxTrade=X(e.maxTrade),this.makerFee=Ni(e.makerFee),this.takerFee=Ni(e.takerFee),this.change=Ni(e.change),this.delistedOn=e.delistedOn,this.exchangeUrl=e.exchangeUrl,this._lastPrice=X(e.lastPrice),this.baseToUsd=X(e.baseToUsd),this.quoteToUsd=X(e.quoteToUsd),this._askPrice=X(e.askPrice),this._bidPrice=X(e.bidPrice),this._supportedOrderTypes=e.supportedOrderTypes,this.updatedAt=e.updatedAt}get tradingDisabled(){return this.status==="INACTIVE"}get tradingEnabled(){return!this.tradingDisabled}get quoteLogoUrl(){return`https://api.coinray.eu/api/v2/explorer/currencies/${this.quoteCurrency}/thumb`}get supportedOrderTypes(){return this._supportedOrderTypes.length>0?this._supportedOrderTypes:this.getExchange().supportedOrderTypes}get isFutures(){return this.getExchange().isFutures}get fullDisplayName(){return[this.exchangeCode,this.displayName].join(": ")}get displayName(){return[this.baseCurrency,this.quoteCurrency].join("/")}get priceOverrides(){return this.getPriceOverrides?this.getPriceOverrides():{}}get lastPrice(){return this.priceOverrides.lastPrice||this._lastPrice}get askPrice(){return this.priceOverrides.askPrice||this._askPrice}get bidPrice(){return this.priceOverrides.bidPrice||this._bidPrice}overridePrices=e=>{this.getPriceOverrides=e};updateLastPrice=e=>{this._lastPrice=e};updateBidAsk=(e,n)=>{this._bidPrice=e,this._askPrice=n};updateTicker=e=>{this._lastPrice=e.lastPrice,this._askPrice=e.askPrice,this._bidPrice=e.bidPrice,this.openPrice=e.openPrice24h,this.highPrice=e.highPrice24h,this.lowPrice=e.lowPrice24h,this.change=this.openPrice.isZero()?0:this.lastPrice.minus(this.openPrice).dividedBy(this.openPrice).multipliedBy(100).toNumber()}}class Ui{api;id;name;code;websocket;active;aliasedTo;tradingEnabled;tradingEnabledFrom;isFutures;isDex;logo;btcVolume;usdVolume;totalMarkets;quoteCurrencies;supportedFeatures;supportedResolutions;supportedOrderTypes;baseCurrencyDominance;apiKeySettings;apiEndpoint;websocketEndpoint;markets;exchangeSymbols;static Create(e,n){if(e==null?Xo(e):typeof e!="object"?eu(e,!1):Array.isArray(e)&&tu(e,!1),xt(e.id,!1,"id"),Ge(e.name,!1,"name"),Ge(e.code,!1,"code"),Tn(e.websocket,!1,"websocket"),Tn(e.active,!1,"active"),Tn(e.tradingEnabled,!1,"tradingEnabled"),Ge(e.tradingEnabledFrom,!1,"tradingEnabledFrom"),Tn(e.isFutures,!0,"isFutures"),Tn(e.isDex,!0,"isDex"),Ge(e.logo,!1,"logo"),Ge(e.btcVolume,!1,"btcVolume"),Ge(e.usdVolume,!1,"usdVolume"),xt(e.totalMarkets,!1,"totalMarkets"),zs(e.quoteCurrencies,"quoteCurrencies"),Ge(e.apiEndpoint,!0,"apiEndpoint"),Ge(e.websocketEndpoint,!0,"websocketEndpoint"),Ge(e.aliasedTo,!0,"aliasedTo"),e.quoteCurrencies)for(let s=0;s<e.quoteCurrencies.length;s++)Ge(e.quoteCurrencies[s],!1,"quoteCurrencies["+s+"]");if(e.quoteCurrencies===void 0&&(e.quoteCurrencies=null),zs(e.supportedResolutions,"supportedResolutions"),zs(e.supportedFeatures,"supportedFeatures"),e.supportedResolutions)for(let s=0;s<e.supportedResolutions.length;s++)Ge(e.supportedResolutions[s],!1,"supportedResolutions["+s+"]");return e.supportedResolutions===void 0&&(e.supportedResolutions=null),new Ui(e,n)}constructor(e,n){this.api=n,this.id=e.id,this.name=e.name,this.code=e.code,this.websocket=e.websocket,this.isFutures=!!e.isFutures,this.isDex=!!e.isDex,this.active=e.active,this.tradingEnabled=e.tradingEnabled,this.tradingEnabledFrom=e.tradingEnabledFrom,this.logo=e.logo,this.btcVolume=X(e.btcVolume),this.usdVolume=X(e.usdVolume),this.totalMarkets=jn(e.totalMarkets),this.quoteCurrencies=e.quoteCurrencies,this.supportedResolutions=e.supportedResolutions,this.supportedFeatures=e.supportedFeatures,this.supportedOrderTypes=e.supportedOrderTypes,this.baseCurrencyDominance=e.baseCurrencyDominance,this.apiKeySettings=e.apiKeySettings,this.markets={},this.exchangeSymbols={},this.apiEndpoint=e.apiEndpoint||n.config.apiEndpoint,this.websocketEndpoint=e.websocketEndpoint||n.config.websocketEndpoint,this.aliasedTo=e.aliasedTo}clone(){return new Ui({api:this.api,id:this.id,name:this.name,code:this.code,websocket:this.websocket,isFutures:this.isFutures,isDex:this.isDex,logo:this.logo,btcVolume:this.btcVolume,usdVolume:this.usdVolume,totalMarkets:this.totalMarkets,quoteCurrencies:this.quoteCurrencies,supportedResolutions:this.supportedResolutions,supportedFeatures:this.supportedFeatures,baseCurrencyDominance:this.baseCurrencyDominance,apiKeySettings:this.apiKeySettings,aliasedTo:this.aliasedTo},this.api)}async loadMarkets(e=void 0){const n=await this.api.fetchMarkets(this,e),s=n.map(a=>{try{return Qs.Create(a,this.api,this)}catch{return new Qs(a,this.api,this)}});return s.length>0&&(this.markets=ut.keyBy(s,"coinraySymbol"),this.exchangeSymbols=ut.keyBy(s,"symbol")),n}getBaseCurrencyDominance(e){return this.baseCurrencyDominance[e]}getMarketByExchangeSymbol(e){return this.exchangeSymbols[e]}getCurrencyPrice(e,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return X(e).dividedBy(a.baseToUsd);if(a.quoteCurrency===n)return X(e).dividedBy(a.quoteToUsd)}return new Ze(0)}getUsdPrice(e,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return a.baseToUsd.multipliedBy(e);if(a.quoteCurrency===n)return a.quoteToUsd.multipliedBy(e)}return new Ze(0)}getMarket(e){return this.markets[e]}}class Jf{listeners;constructor(){this.listeners={}}removeAllListeners(){this.listeners={}}on=(e,n)=>(e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(n),n);off=(e,n)=>{e in this.listeners&&(n?this.listeners[e]=this.listeners[e].filter(s=>s!==n):this.listeners[e]=[])};hasListeners=e=>this.listeners[e]&&this.listeners[e].length>0;dispatchEvent=(e,n={})=>{const s=this.listeners[e];s&&s.length>0&&s.map(a=>a({eventName:e,data:n}))}}class o1{subscriptions;pendingAdditions;pendingRemovals;constructor(){this.subscriptions=new Set,this.pendingAdditions=new Set,this.pendingRemovals=new Set}has(e){return this.subscriptions.has(e)}subscribe(e,n=!1){n&&this.unsubscribeAll();for(let s of e)this.pendingAdditions.add(s),this.pendingRemovals.delete(s)}unsubscribe(e){for(let n of e)this.pendingRemovals.add(n),this.pendingAdditions.delete(n)}unsubscribeAll(){for(let e of this.subscriptions)this.pendingRemovals.add(e);this.pendingAdditions.clear()}processPendingChanges(){for(let e of this.pendingAdditions)this.subscriptions.add(e);for(let e of this.pendingRemovals)this.subscriptions.delete(e);this.pendingAdditions.clear(),this.pendingRemovals.clear()}}class u1 extends Jf{rootApi;apis;exchanges;initialized;refreshRate;refreshTimeout;_refreshingToken;tickerSubscriptions;tickerSubscriptionRefeshTimer;_onTokenExpired;onStoreCache;apiCache;constructor(e,n,s=3e4,a=void 0){super(),this.rootApi=new xe(e,n),this.apis=new Map,this.exchanges={},this.initialized=!1,this.refreshRate=s,this.tickerSubscriptions=new o1,this.tickerSubscriptionRefeshTimer=null,this.rootApi.onTokenExpired(this.refreshToken),this.onStoreCache=a?.onStoreCache,this.apiCache=a?.apiCache}async initialize(){this.initialized||(await this.start(),this.initialized=!0)}getRootApi(){return this.rootApi}authenticateDevice(e,n){this.rootApi.authenticateDevice(e,n)}refreshToken=async()=>{if(this._onTokenExpired){if(this._refreshingToken)return await this._refreshingToken;{this._refreshingToken=this._onTokenExpired();let e=await this._refreshingToken;this._refreshingToken=void 0;for(const n of this.apis.values())n.refreshToken(e);return e}}};onTokenExpired(e){this._onTokenExpired=e}async start(){this.refreshTimeout&&clearTimeout(this.refreshTimeout);try{this.apiCache?(await this.refreshExchanges(this.apiCache),this.refreshExchanges()):await this.refreshExchanges()}catch(e){console.error(e)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)}refreshExchangeInterval=async()=>{try{await this.refreshExchanges()}catch(e){console.error(e)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)};destroy(){for(const e of this.apis.values())try{e.destroy()}catch(n){console.error("Could not destroy coinray",n)}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.initialized=!1}refreshExchanges=async(e=void 0)=>{const n={exchanges:[],markets:{}},s=await this.rootApi.fetchExchanges(c=>(n.exchanges.push(c),this.apis.has(c.code)||this.apis.set(c.code,this.rootApi),Ui.Create(c,this.apis.get(c.code))),e?.exchanges),a=await Promise.all(s.map(async c=>({[c.code]:await c.loadMarkets(e?.markets?.[c.code])})));n.markets=a.reduce((c,u)=>({...c,[Object.keys(u)[0]]:Object.values(u)[0]}),[]),this.exchanges=s.reduce((c,u)=>(c[u.code]=u,c),{}),this.dispatchEvent("marketsUpdated"),!e&&this.onStoreCache&&this.onStoreCache(n)};getProxyList=async(e={})=>await this.rootApi.getProxyList(e);getExchanges(){if(!this.initialized)throw"The cache is not initialized yet";return this.exchanges}getExchange(e){return this.getExchanges()[e]||Ui.Create({id:-1,name:e,code:e,websocket:!1,active:!1,tradingEnabled:!1,tradingEnabledFrom:"",isFutures:!1,isDex:!1,logo:`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
44
- `,btcVolume:"0",usdVolume:"0",totalMarkets:0,quoteCurrencies:[]},this.rootApi)}refreshMarkets=async e=>{await this.exchanges[e].loadMarkets()};searchMarkets(e){return Object.values(this.exchanges).reduce((n,s)=>(n={...n,...zf(s.markets,e)},n),{})}getMarkets(e){switch(typeof e){case"string":return this.getExchange(e).markets;default:return e.reduce((n,s)=>{const a=this.getMarket(s);return a&&(n[s]=a),n},{})}}getMarket=e=>{const n=`${e}`.split("_");if(n.length<3)return;const s=this.getExchange(n[0]);if(s)return s.getMarket(e)};async fetchCandles({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c}){return this.apiForSymbol(e).fetchCandles({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c})}async fetchFirstCandleTime({coinraySymbol:e,resolution:n}){return this.apiForSymbol(e).fetchFirstCandleTime({coinraySymbol:e,resolution:n})}subscribeTickers(e,n=!1){this.tickerSubscriptions.subscribe(e,n),this.scheduleTickerRefresh()}scheduleTickerRefresh(){this.tickerSubscriptionRefeshTimer&&clearTimeout(this.tickerSubscriptionRefeshTimer),this.tickerSubscriptionRefeshTimer=setTimeout(async()=>{await this.flushTickerSubscriptions(),this.tickerSubscriptionRefeshTimer=null},1e3)}unsubscribeAllTickers(){this.tickerSubscriptions.unsubscribeAll(),this.scheduleTickerRefresh()}unsubscribeTickers(e){this.tickerSubscriptions.unsubscribe(e),this.scheduleTickerRefresh()}async flushTickerSubscriptions(){await this.rootApi.subscribeTickers(Array.from(this.tickerSubscriptions.pendingAdditions),!1,this.refreshMarketsFromTickers),this.rootApi.unsubscribeTickers(Array.from(this.tickerSubscriptions.pendingRemovals),this.refreshMarketsFromTickers),this.tickerSubscriptions.processPendingChanges()}refreshMarketsFromTickers=async e=>{const{exchangeCode:n,tickers:s}=e,a=this.getExchange(n);if(a){let c=!1;for(const u of s)if(this.tickerSubscriptions.has(u.coinraySymbol)){const l=a.getMarket(u.coinraySymbol);l&&(l.updateTicker(u),c=!0)}c&&this.dispatchEvent("marketsUpdated")}};async subscribeCandles({coinraySymbol:e,resolution:n,lastCandle:s},a){return this.apiForSymbol(e).subscribeCandles({coinraySymbol:e,resolution:n,lastCandle:s},a)}async unsubscribeCandles({coinraySymbol:e,resolution:n},s){await this.apiForSymbol(e).unsubscribeCandles({coinraySymbol:e,resolution:n},s)}async subscribeOrderBook({coinraySymbol:e},n){await this.apiForSymbol(e).subscribeOrderBook({coinraySymbol:e},n)}async unsubscribeOrderBook({coinraySymbol:e},n){await this.apiForSymbol(e).unsubscribeOrderBook({coinraySymbol:e},n)}async subscribeTrades({coinraySymbol:e},n){await this.apiForSymbol(e).subscribeTrades({coinraySymbol:e},n)}async unsubscribeTrades({coinraySymbol:e},n){await this.apiForSymbol(e).unsubscribeTrades({coinraySymbol:e},n)}apiForSymbol(e){const n=`${e}`.split("_");if(n.length<3)return;const s=n[0];return this.apis.get(s)}}class c1 extends Error{constructor(e){super(e),this.name="MarketNotFoundError"}}const Qf=30*1e3;class l1 extends Jf{coinrayCache;getPriceOverrides;coinraySymbol;orderBook;trades;tradesDelayed;maxTrades;prevTickers={lastPrice:new Ze(0),askPrice:new Ze(0),bidPrice:new Ze(0)};constructor(e,n={}){super(),this.coinrayCache=e,this.maxTrades=n.maxTrades||100,n.getPriceOverrides&&(this.getPriceOverrides=n.getPriceOverrides),this.destroy()}setCoinraySymbol(e){this.dispatchEvent("coinraySymbolWillChange",{coinraySymbol:e}),this.stop(),this.coinraySymbol=e,this.startOrderBook(),this.startTrades(),this.dispatchEvent("coinraySymbolChanged",{coinraySymbol:e})}destroy(){this.coinraySymbol=null,this.removeAllListeners(),this.stop()}stop(){this.stopOrderBook(),this.stopTrades()}getExchange(){return this.coinrayCache.getExchange(this.getMarket().exchangeCode)}getMarket(){if(this.coinraySymbol){const e=this.coinrayCache.getMarket(this.coinraySymbol);return e.overridePrices(this.getPriceOverrides),e}else throw new c1(`Market not found: ${this.coinraySymbol}`)}subscribeCoinraySymbolWillChange(e){return this.on("coinraySymbolWillChange",e)}unsubscribeCoinraySymbolWillChange(e){this.off("coinraySymbolWillChange",e)}subscribeCoinraySymbolChange(e){return this.on("coinraySymbolChanged",e)}unsubscribeCoinraySymbolChange(e){this.off("coinraySymbolChanged",e)}subscribeMarketUpdates=e=>(this.on("marketUpdated",e),this.subscribeOrderBook(this.handleMarketUpdate),this.subscribeTrades(this.handleMarketUpdate),e);updatePrevTicker=({lastPrice:e,bidPrice:n,askPrice:s})=>{e&&(this.prevTickers.lastPrice=X(e)),s&&(this.prevTickers.askPrice=X(s)),n&&(this.prevTickers.bidPrice=X(n))};handleMarketUpdate=({data:{type:e,coinraySymbol:n,...s}})=>{if(this.coinraySymbol!==n){this.unsubscribeOrderBook(this.handleOrderBook),this.unsubscribeTrades(this.handleOrderBook);return}switch(e){case"trades:snapshot":case"trades:update":{const{trades:a}=s;if(a.length===0)break;const c=this.getMarket(),u=X(a[0].price);(!c._lastPrice.eq(u)||!this.prevTickers.lastPrice.eq(u))&&(c.updateLastPrice(u),this.updatePrevTicker({lastPrice:u}),this.dispatchEvent("marketUpdated",{market:c}));break}case"orderBook:snapshot":case"orderBook:update":{const{orderBook:{bids:a,asks:c}}=s,u=this.getMarket();if(a.length===0||c.length===0)break;const l=c[0].price,h=a[0].price,m=!u._askPrice.eq(l)||!u._bidPrice.eq(h),b=!this.prevTickers.askPrice.eq(l)||!this.prevTickers.bidPrice.eq(h);(m||b)&&(u.updateBidAsk(h,l),this.updatePrevTicker({askPrice:l,bidPrice:h}),this.dispatchEvent("marketUpdated",{market:u}));break}}};unsubscribeMarketUpdates=e=>{this.off("marketUpdated",e),this.hasListeners("marketUpdated")||(this.unsubscribeOrderBook(this.handleMarketUpdate),this.unsubscribeTrades(this.handleMarketUpdate))};subscribeOrderBook=e=>(this.on("orderBookUpdated",e),this.startOrderBook(),e);startOrderBook=()=>{this.coinraySymbol&&this.hasListeners("orderBookUpdated")&&this.coinrayCache.subscribeOrderBook({coinraySymbol:this.coinraySymbol},this.handleOrderBook)};stopOrderBook=()=>{this.coinraySymbol&&this.coinrayCache.unsubscribeOrderBook({coinraySymbol:this.coinraySymbol},this.handleOrderBook),this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}}};handleOrderBook=async({type:e,coinraySymbol:n,orderBook:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeOrderBook({coinraySymbol:n},this.handleOrderBook);return}e==="orderBook:snapshot"&&(this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}});const{minSeq:a,maxSeq:c,bids:u,asks:l}=s,h=(m,b)=>{ut.forEach(b,(T,P)=>{T>0?m[P]={price:new Ze(P),quantity:T}:delete m[P]})};if(a-this.orderBook.maxSeq>1){this.stopOrderBook(),this.startOrderBook();return}this.orderBook.minSeq=a,this.orderBook.maxSeq=c,h(this.orderBook.bids,u),h(this.orderBook.asks,l),this.dispatchEvent("orderBookUpdated",{type:e,coinraySymbol:n,orderBook:{minSeq:a,maxSeq:c,bids:Object.values(this.orderBook.bids).sort(({price:m},{price:b})=>b.minus(m)),asks:Object.values(this.orderBook.asks).sort(({price:m},{price:b})=>m.minus(b))}})};unsubscribeOrderBook=e=>{this.off("orderBookUpdated",e),this.hasListeners("orderBookUpdated")||this.stopOrderBook()};subscribeTrades=e=>(this.on("tradesUpdated",e),this.startTrades(),e);startTrades=()=>{this.coinraySymbol&&this.hasListeners("tradesUpdated")&&this.coinrayCache.subscribeTrades({coinraySymbol:this.coinraySymbol},this.handleTrades)};stopTrades=()=>{this.coinraySymbol&&this.coinrayCache.unsubscribeTrades({coinraySymbol:this.coinraySymbol},this.handleTrades),this.trades=[]};handleTrades=({type:e,coinraySymbol:n,trades:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeTrades({coinraySymbol:n},this.handleTrades);return}if(e==="trades:snapshot"&&(this.trades=[]),this.trades=[...s,...this.trades].sort((c,u)=>u.time.getTime()-c.time.getTime()).slice(0,this.maxTrades),this.dispatchEvent("tradesUpdated",{type:e,coinraySymbol:n,trades:this.trades}),!this.trades.length)return;const a=Date.now()-this.trades[0].time.getTime();e==="trades:snapshot"&&this.tradesDelayed?this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):e==="trades:update"&&(this.tradesDelayed&&a<Qf?this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):!this.tradesDelayed&&a>=Qf&&this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!0,delayInMs:a}))};dispatchTradesDelayed=({type:e,coinraySymbol:n,tradesDelayed:s,delayInMs:a})=>{this.tradesDelayed=s,this.dispatchEvent("tradesDelayed",{type:e,coinraySymbol:n,tradesDelayed:s,delayInMs:a})};unsubscribeTrades=e=>{this.off("tradesUpdated",e),this.hasListeners("tradesUpdated")||this.stopTrades()};subscribeTradesDelayed=e=>(this.on("tradesDelayed",e),e);unsubscribeTradesDelayed=e=>{this.off("tradesDelayed",e)}}const f1={"en-US":{validation:{notGreaterThanOrEqualTo:"Can't be less than {{min}}",insufficientFunds:"Insufficient funds"}},nl:{validation:{notGreaterThanOrEqualTo:"Kan niet minder zijn dan {{min}}",insufficientFunds:"Onvoldoende balans"}},ru:{validation:{notGreaterThanOrEqualTo:"Не может быть меньше {{min}}",insufficientFunds:"Недостаточно средств"}}};var Bi={exports:{}};/*!
41
+ `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var Yl={};function Kl(t,e){z.deprecationHandler!=null&&z.deprecationHandler(t,e),Yl[t]||(Hl(e),Yl[t]=!0)}z.suppressDeprecationWarnings=!1,z.deprecationHandler=null;function wr(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function n0(t){var e,n;for(n in t)ke(t,n)&&(e=t[n],wr(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function So(t,e){var n=Xr({},t),s;for(s in e)ke(e,s)&&(wn(t[s])&&wn(e[s])?(n[s]={},Xr(n[s],t[s]),Xr(n[s],e[s])):e[s]!=null?n[s]=e[s]:delete n[s]);for(s in t)ke(t,s)&&!ke(e,s)&&wn(t[s])&&(n[s]=Xr({},n[s]));return n}function vo(t){t!=null&&this.set(t)}var To;Object.keys?To=Object.keys:To=function(t){var e,n=[];for(e in t)ke(t,e)&&n.push(e);return n};var i0={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function s0(t,e,n){var s=this._calendar[t]||this._calendar.sameElse;return wr(s)?s.call(e,n):s}function br(t,e,n){var s=""+Math.abs(t),a=e-s.length,c=t>=0;return(c?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+s}var Eo=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,As=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ao={},Wn={};function ie(t,e,n,s){var a=s;typeof s=="string"&&(a=function(){return this[s]()}),t&&(Wn[t]=a),e&&(Wn[e[0]]=function(){return br(a.apply(this,arguments),e[1],e[2])}),n&&(Wn[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function a0(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function o0(t){var e=t.match(Eo),n,s;for(n=0,s=e.length;n<s;n++)Wn[e[n]]?e[n]=Wn[e[n]]:e[n]=a0(e[n]);return function(a){var c="",u;for(u=0;u<s;u++)c+=wr(e[u])?e[u].call(a,t):e[u];return c}}function Os(t,e){return t.isValid()?(e=ql(e,t.localeData()),Ao[e]=Ao[e]||o0(e),Ao[e](t)):t.localeData().invalidDate()}function ql(t,e){var n=5;function s(a){return e.longDateFormat(a)||a}for(As.lastIndex=0;n>=0&&As.test(t);)t=t.replace(As,s),As.lastIndex=0,n-=1;return t}var u0={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function c0(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Eo).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[t])}var l0="Invalid date";function f0(){return this._invalidDate}var h0="%d",d0=/\d{1,2}/;function p0(t){return this._ordinal.replace("%d",t)}var m0={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function g0(t,e,n,s){var a=this._relativeTime[n];return wr(a)?a(t,e,n,s):a.replace(/%d/i,t)}function y0(t,e){var n=this._relativeTime[t>0?"future":"past"];return wr(n)?n(e):n.replace(/%s/i,e)}var $l={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Vt(t){return typeof t=="string"?$l[t]||$l[t.toLowerCase()]:void 0}function Oo(t){var e={},n,s;for(s in t)ke(t,s)&&(n=Vt(s),n&&(e[n]=t[s]));return e}var _0={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function w0(t){var e=[],n;for(n in t)ke(t,n)&&e.push({unit:n,priority:_0[n]});return e.sort(function(s,a){return s.priority-a.priority}),e}var Gl=/\d/,Nt=/\d\d/,Vl=/\d{3}/,ko=/\d{4}/,ks=/[+-]?\d{6}/,Ye=/\d\d?/,zl=/\d\d\d\d?/,jl=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,Co=/\d{1,4}/,xs=/[+-]?\d{1,6}/,Hn=/\d+/,Ps=/[+-]?\d+/,b0=/Z|[+-]\d\d:?\d\d/gi,Rs=/Z|[+-]\d\d(?::?\d\d)?/gi,S0=/[+-]?\d+(\.\d{1,3})?/,Ai=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Yn=/^[1-9]\d?/,xo=/^([1-9]\d|\d)/,Ds;Ds={};function Q(t,e,n){Ds[t]=wr(e)?e:function(s,a){return s&&n?n:e}}function v0(t,e){return ke(Ds,t)?Ds[t](e._strict,e._locale):new RegExp(T0(t))}function T0(t){return Rr(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,s,a,c){return n||s||a||c}))}function Rr(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function zt(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function be(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=zt(e)),n}var Po={};function Le(t,e){var n,s=e,a;for(typeof t=="string"&&(t=[t]),Pr(e)&&(s=function(c,u){u[e]=be(c)}),a=t.length,n=0;n<a;n++)Po[t[n]]=s}function Oi(t,e){Le(t,function(n,s,a,c){a._w=a._w||{},e(n,a._w,a,c)})}function E0(t,e,n){e!=null&&ke(Po,t)&&Po[t](e,n._a,n,t)}function Ms(t){return t%4===0&&t%100!==0||t%400===0}var pt=0,Dr=1,Sr=2,rt=3,ur=4,Mr=5,bn=6,A0=7,O0=8;ie("Y",0,0,function(){var t=this.year();return t<=9999?br(t,4):"+"+t}),ie(0,["YY",2],0,function(){return this.year()%100}),ie(0,["YYYY",4],0,"year"),ie(0,["YYYYY",5],0,"year"),ie(0,["YYYYYY",6,!0],0,"year"),Q("Y",Ps),Q("YY",Ye,Nt),Q("YYYY",Co,ko),Q("YYYYY",xs,ks),Q("YYYYYY",xs,ks),Le(["YYYYY","YYYYYY"],pt),Le("YYYY",function(t,e){e[pt]=t.length===2?z.parseTwoDigitYear(t):be(t)}),Le("YY",function(t,e){e[pt]=z.parseTwoDigitYear(t)}),Le("Y",function(t,e){e[pt]=parseInt(t,10)});function ki(t){return Ms(t)?366:365}z.parseTwoDigitYear=function(t){return be(t)+(be(t)>68?1900:2e3)};var Jl=Kn("FullYear",!0);function k0(){return Ms(this.year())}function Kn(t,e){return function(n){return n!=null?(Ql(this,t,n),z.updateOffset(this,e),this):Ci(this,t)}}function Ci(t,e){if(!t.isValid())return NaN;var n=t._d,s=t._isUTC;switch(e){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ql(t,e,n){var s,a,c,u,l;if(!(!t.isValid()||isNaN(n))){switch(s=t._d,a=t._isUTC,e){case"Milliseconds":return void(a?s.setUTCMilliseconds(n):s.setMilliseconds(n));case"Seconds":return void(a?s.setUTCSeconds(n):s.setSeconds(n));case"Minutes":return void(a?s.setUTCMinutes(n):s.setMinutes(n));case"Hours":return void(a?s.setUTCHours(n):s.setHours(n));case"Date":return void(a?s.setUTCDate(n):s.setDate(n));case"FullYear":break;default:return}c=n,u=t.month(),l=t.date(),l=l===29&&u===1&&!Ms(c)?28:l,a?s.setUTCFullYear(c,u,l):s.setFullYear(c,u,l)}}function C0(t){return t=Vt(t),wr(this[t])?this[t]():this}function x0(t,e){if(typeof t=="object"){t=Oo(t);var n=w0(t),s,a=n.length;for(s=0;s<a;s++)this[n[s].unit](t[n[s].unit])}else if(t=Vt(t),wr(this[t]))return this[t](e);return this}function P0(t,e){return(t%e+e)%e}var Xe;Array.prototype.indexOf?Xe=Array.prototype.indexOf:Xe=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Ro(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=P0(e,12);return t+=(e-n)/12,n===1?Ms(t)?29:28:31-n%7%2}ie("M",["MM",2],"Mo",function(){return this.month()+1}),ie("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),ie("MMMM",0,0,function(t){return this.localeData().months(this,t)}),Q("M",Ye,Yn),Q("MM",Ye,Nt),Q("MMM",function(t,e){return e.monthsShortRegex(t)}),Q("MMMM",function(t,e){return e.monthsRegex(t)}),Le(["M","MM"],function(t,e){e[Dr]=be(t)-1}),Le(["MMM","MMMM"],function(t,e,n,s){var a=n._locale.monthsParse(t,s,n._strict);a!=null?e[Dr]=a:de(n).invalidMonth=t});var R0="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Zl="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Xl=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,D0=Ai,M0=Ai;function L0(t,e){return t?ar(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Xl).test(e)?"format":"standalone"][t.month()]:ar(this._months)?this._months:this._months.standalone}function N0(t,e){return t?ar(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Xl.test(e)?"format":"standalone"][t.month()]:ar(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function U0(t,e,n){var s,a,c,u=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)c=_r([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(c,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(c,"").toLocaleLowerCase();return n?e==="MMM"?(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:null):(a=Xe.call(this._longMonthsParse,u),a!==-1?a:null):e==="MMM"?(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:(a=Xe.call(this._longMonthsParse,u),a!==-1?a:null)):(a=Xe.call(this._longMonthsParse,u),a!==-1?a:(a=Xe.call(this._shortMonthsParse,u),a!==-1?a:null))}function B0(t,e,n){var s,a,c;if(this._monthsParseExact)return U0.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(a=_r([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),!n&&!this._monthsParse[s]&&(c="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[s]=new RegExp(c.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[s].test(t))return s;if(n&&e==="MMM"&&this._shortMonthsParse[s].test(t))return s;if(!n&&this._monthsParse[s].test(t))return s}}function ef(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=be(e);else if(e=t.localeData().monthsParse(e),!Pr(e))return t}var n=e,s=t.date();return s=s<29?s:Math.min(s,Ro(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,s):t._d.setMonth(n,s),t}function tf(t){return t!=null?(ef(this,t),z.updateOffset(this,!0),this):Ci(this,"Month")}function I0(){return Ro(this.year(),this.month())}function F0(t){return this._monthsParseExact?(ke(this,"_monthsRegex")||rf.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ke(this,"_monthsShortRegex")||(this._monthsShortRegex=D0),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function W0(t){return this._monthsParseExact?(ke(this,"_monthsRegex")||rf.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ke(this,"_monthsRegex")||(this._monthsRegex=M0),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function rf(){function t(h,m){return m.length-h.length}var e=[],n=[],s=[],a,c,u,l;for(a=0;a<12;a++)c=_r([2e3,a]),u=Rr(this.monthsShort(c,"")),l=Rr(this.months(c,"")),e.push(u),n.push(l),s.push(l),s.push(u);e.sort(t),n.sort(t),s.sort(t),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function H0(t,e,n,s,a,c,u){var l;return t<100&&t>=0?(l=new Date(t+400,e,n,s,a,c,u),isFinite(l.getFullYear())&&l.setFullYear(t)):l=new Date(t,e,n,s,a,c,u),l}function xi(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Ls(t,e,n){var s=7+e-n,a=(7+xi(t,0,s).getUTCDay()-e)%7;return-a+s-1}function nf(t,e,n,s,a){var c=(7+n-s)%7,u=Ls(t,s,a),l=1+7*(e-1)+c+u,h,m;return l<=0?(h=t-1,m=ki(h)+l):l>ki(t)?(h=t+1,m=l-ki(t)):(h=t,m=l),{year:h,dayOfYear:m}}function Pi(t,e,n){var s=Ls(t.year(),e,n),a=Math.floor((t.dayOfYear()-s-1)/7)+1,c,u;return a<1?(u=t.year()-1,c=a+Lr(u,e,n)):a>Lr(t.year(),e,n)?(c=a-Lr(t.year(),e,n),u=t.year()+1):(u=t.year(),c=a),{week:c,year:u}}function Lr(t,e,n){var s=Ls(t,e,n),a=Ls(t+1,e,n);return(ki(t)-s+a)/7}ie("w",["ww",2],"wo","week"),ie("W",["WW",2],"Wo","isoWeek"),Q("w",Ye,Yn),Q("ww",Ye,Nt),Q("W",Ye,Yn),Q("WW",Ye,Nt),Oi(["w","ww","W","WW"],function(t,e,n,s){e[s.substr(0,1)]=be(t)});function Y0(t){return Pi(t,this._week.dow,this._week.doy).week}var K0={dow:0,doy:6};function q0(){return this._week.dow}function $0(){return this._week.doy}function G0(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function V0(t){var e=Pi(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}ie("d",0,"do","day"),ie("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),ie("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),ie("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),ie("e",0,0,"weekday"),ie("E",0,0,"isoWeekday"),Q("d",Ye),Q("e",Ye),Q("E",Ye),Q("dd",function(t,e){return e.weekdaysMinRegex(t)}),Q("ddd",function(t,e){return e.weekdaysShortRegex(t)}),Q("dddd",function(t,e){return e.weekdaysRegex(t)}),Oi(["dd","ddd","dddd"],function(t,e,n,s){var a=n._locale.weekdaysParse(t,s,n._strict);a!=null?e.d=a:de(n).invalidWeekday=t}),Oi(["d","e","E"],function(t,e,n,s){e[s]=be(t)});function z0(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function j0(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Do(t,e){return t.slice(e,7).concat(t.slice(0,e))}var J0="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),sf="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Q0="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Z0=Ai,X0=Ai,ey=Ai;function ty(t,e){var n=ar(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Do(n,this._week.dow):t?n[t.day()]:n}function ry(t){return t===!0?Do(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function ny(t){return t===!0?Do(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function iy(t,e,n){var s,a,c,u=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)c=_r([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(c,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(c,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(c,"").toLocaleLowerCase();return n?e==="dddd"?(a=Xe.call(this._weekdaysParse,u),a!==-1?a:null):e==="ddd"?(a=Xe.call(this._shortWeekdaysParse,u),a!==-1?a:null):(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null):e==="dddd"?(a=Xe.call(this._weekdaysParse,u),a!==-1||(a=Xe.call(this._shortWeekdaysParse,u),a!==-1)?a:(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null)):e==="ddd"?(a=Xe.call(this._shortWeekdaysParse,u),a!==-1||(a=Xe.call(this._weekdaysParse,u),a!==-1)?a:(a=Xe.call(this._minWeekdaysParse,u),a!==-1?a:null)):(a=Xe.call(this._minWeekdaysParse,u),a!==-1||(a=Xe.call(this._weekdaysParse,u),a!==-1)?a:(a=Xe.call(this._shortWeekdaysParse,u),a!==-1?a:null))}function sy(t,e,n){var s,a,c;if(this._weekdaysParseExact)return iy.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(a=_r([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(c="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[s]=new RegExp(c.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[s].test(t))return s;if(n&&e==="ddd"&&this._shortWeekdaysParse[s].test(t))return s;if(n&&e==="dd"&&this._minWeekdaysParse[s].test(t))return s;if(!n&&this._weekdaysParse[s].test(t))return s}}function ay(t){if(!this.isValid())return t!=null?this:NaN;var e=Ci(this,"Day");return t!=null?(t=z0(t,this.localeData()),this.add(t-e,"d")):e}function oy(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function uy(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=j0(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function cy(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ke(this,"_weekdaysRegex")||(this._weekdaysRegex=Z0),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function ly(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ke(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X0),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fy(t){return this._weekdaysParseExact?(ke(this,"_weekdaysRegex")||Mo.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ke(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ey),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Mo(){function t(b,T){return T.length-b.length}var e=[],n=[],s=[],a=[],c,u,l,h,m;for(c=0;c<7;c++)u=_r([2e3,1]).day(c),l=Rr(this.weekdaysMin(u,"")),h=Rr(this.weekdaysShort(u,"")),m=Rr(this.weekdays(u,"")),e.push(l),n.push(h),s.push(m),a.push(l),a.push(h),a.push(m);e.sort(t),n.sort(t),s.sort(t),a.sort(t),this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Lo(){return this.hours()%12||12}function hy(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,Lo),ie("k",["kk",2],0,hy),ie("hmm",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+Lo.apply(this)+br(this.minutes(),2)+br(this.seconds(),2)}),ie("Hmm",0,0,function(){return""+this.hours()+br(this.minutes(),2)}),ie("Hmmss",0,0,function(){return""+this.hours()+br(this.minutes(),2)+br(this.seconds(),2)});function af(t,e){ie(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}af("a",!0),af("A",!1);function of(t,e){return e._meridiemParse}Q("a",of),Q("A",of),Q("H",Ye,xo),Q("h",Ye,Yn),Q("k",Ye,Yn),Q("HH",Ye,Nt),Q("hh",Ye,Nt),Q("kk",Ye,Nt),Q("hmm",zl),Q("hmmss",jl),Q("Hmm",zl),Q("Hmmss",jl),Le(["H","HH"],rt),Le(["k","kk"],function(t,e,n){var s=be(t);e[rt]=s===24?0:s}),Le(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Le(["h","hh"],function(t,e,n){e[rt]=be(t),de(n).bigHour=!0}),Le("hmm",function(t,e,n){var s=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s)),de(n).bigHour=!0}),Le("hmmss",function(t,e,n){var s=t.length-4,a=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s,2)),e[Mr]=be(t.substr(a)),de(n).bigHour=!0}),Le("Hmm",function(t,e,n){var s=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s))}),Le("Hmmss",function(t,e,n){var s=t.length-4,a=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s,2)),e[Mr]=be(t.substr(a))});function dy(t){return(t+"").toLowerCase().charAt(0)==="p"}var py=/[ap]\.?m?\.?/i,my=Kn("Hours",!0);function gy(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var uf={calendar:i0,longDateFormat:u0,invalidDate:l0,ordinal:h0,dayOfMonthOrdinalParse:d0,relativeTime:m0,months:R0,monthsShort:Zl,week:K0,weekdays:J0,weekdaysMin:Q0,weekdaysShort:sf,meridiemParse:py},$e={},Ri={},Di;function yy(t,e){var n,s=Math.min(t.length,e.length);for(n=0;n<s;n+=1)if(t[n]!==e[n])return n;return s}function cf(t){return t&&t.toLowerCase().replace("_","-")}function _y(t){for(var e=0,n,s,a,c;e<t.length;){for(c=cf(t[e]).split("-"),n=c.length,s=cf(t[e+1]),s=s?s.split("-"):null;n>0;){if(a=Ns(c.slice(0,n).join("-")),a)return a;if(s&&s.length>=n&&yy(c,s)>=n-1)break;n--}e++}return Di}function wy(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Ns(t){var e=null,n;if($e[t]===void 0&&typeof module<"u"&&module&&module.exports&&wy(t))try{e=Di._abbr,n=require,n("./locale/"+t),en(e)}catch{$e[t]=null}return $e[t]}function en(t,e){var n;return t&&(kt(e)?n=Nr(t):n=No(t,e),n?Di=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Di._abbr}function No(t,e){if(e!==null){var n,s=uf;if(e.abbr=t,$e[t]!=null)Kl("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=$e[t]._config;else if(e.parentLocale!=null)if($e[e.parentLocale]!=null)s=$e[e.parentLocale]._config;else if(n=Ns(e.parentLocale),n!=null)s=n._config;else return Ri[e.parentLocale]||(Ri[e.parentLocale]=[]),Ri[e.parentLocale].push({name:t,config:e}),null;return $e[t]=new vo(So(s,e)),Ri[t]&&Ri[t].forEach(function(a){No(a.name,a.config)}),en(t),$e[t]}else return delete $e[t],null}function by(t,e){if(e!=null){var n,s,a=uf;$e[t]!=null&&$e[t].parentLocale!=null?$e[t].set(So($e[t]._config,e)):(s=Ns(t),s!=null&&(a=s._config),e=So(a,e),s==null&&(e.abbr=t),n=new vo(e),n.parentLocale=$e[t],$e[t]=n),en(t)}else $e[t]!=null&&($e[t].parentLocale!=null?($e[t]=$e[t].parentLocale,t===en()&&en(t)):$e[t]!=null&&delete $e[t]);return $e[t]}function Nr(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Di;if(!ar(t)){if(e=Ns(t),e)return e;t=[t]}return _y(t)}function Sy(){return To($e)}function Uo(t){var e,n=t._a;return n&&de(t).overflow===-2&&(e=n[Dr]<0||n[Dr]>11?Dr:n[Sr]<1||n[Sr]>Ro(n[pt],n[Dr])?Sr:n[rt]<0||n[rt]>24||n[rt]===24&&(n[ur]!==0||n[Mr]!==0||n[bn]!==0)?rt:n[ur]<0||n[ur]>59?ur:n[Mr]<0||n[Mr]>59?Mr:n[bn]<0||n[bn]>999?bn:-1,de(t)._overflowDayOfYear&&(e<pt||e>Sr)&&(e=Sr),de(t)._overflowWeeks&&e===-1&&(e=A0),de(t)._overflowWeekday&&e===-1&&(e=O0),de(t).overflow=e),t}var vy=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ty=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ey=/Z|[+-]\d\d(?::?\d\d)?/,Us=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ay=/^\/?Date\((-?\d+)/i,Oy=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ky={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function lf(t){var e,n,s=t._i,a=vy.exec(s)||Ty.exec(s),c,u,l,h,m=Us.length,b=Bo.length;if(a){for(de(t).iso=!0,e=0,n=m;e<n;e++)if(Us[e][1].exec(a[1])){u=Us[e][0],c=Us[e][2]!==!1;break}if(u==null){t._isValid=!1;return}if(a[3]){for(e=0,n=b;e<n;e++)if(Bo[e][1].exec(a[3])){l=(a[2]||" ")+Bo[e][0];break}if(l==null){t._isValid=!1;return}}if(!c&&l!=null){t._isValid=!1;return}if(a[4])if(Ey.exec(a[4]))h="Z";else{t._isValid=!1;return}t._f=u+(l||"")+(h||""),Fo(t)}else t._isValid=!1}function Cy(t,e,n,s,a,c){var u=[xy(t),Zl.indexOf(e),parseInt(n,10),parseInt(s,10),parseInt(a,10)];return c&&u.push(parseInt(c,10)),u}function xy(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Py(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ry(t,e,n){if(t){var s=sf.indexOf(t),a=new Date(e[0],e[1],e[2]).getDay();if(s!==a)return de(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dy(t,e,n){if(t)return ky[t];if(e)return 0;var s=parseInt(n,10),a=s%100,c=(s-a)/100;return c*60+a}function ff(t){var e=Oy.exec(Py(t._i)),n;if(e){if(n=Cy(e[4],e[3],e[2],e[5],e[6],e[7]),!Ry(e[1],n,t))return;t._a=n,t._tzm=Dy(e[8],e[9],e[10]),t._d=xi.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),de(t).rfc2822=!0}else t._isValid=!1}function My(t){var e=Ay.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(lf(t),t._isValid===!1)delete t._isValid;else return;if(ff(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:z.createFromInputFallback(t)}z.createFromInputFallback=Gt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function qn(t,e,n){return t??e??n}function Ly(t){var e=new Date(z.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Io(t){var e,n,s=[],a,c,u;if(!t._d){for(a=Ly(t),t._w&&t._a[Sr]==null&&t._a[Dr]==null&&Ny(t),t._dayOfYear!=null&&(u=qn(t._a[pt],a[pt]),(t._dayOfYear>ki(u)||t._dayOfYear===0)&&(de(t)._overflowDayOfYear=!0),n=xi(u,0,t._dayOfYear),t._a[Dr]=n.getUTCMonth(),t._a[Sr]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=s[e]=a[e];for(;e<7;e++)t._a[e]=s[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[rt]===24&&t._a[ur]===0&&t._a[Mr]===0&&t._a[bn]===0&&(t._nextDay=!0,t._a[rt]=0),t._d=(t._useUTC?xi:H0).apply(null,s),c=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[rt]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==c&&(de(t).weekdayMismatch=!0)}}function Ny(t){var e,n,s,a,c,u,l,h,m;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(c=1,u=4,n=qn(e.GG,t._a[pt],Pi(Ke(),1,4).year),s=qn(e.W,1),a=qn(e.E,1),(a<1||a>7)&&(h=!0)):(c=t._locale._week.dow,u=t._locale._week.doy,m=Pi(Ke(),c,u),n=qn(e.gg,t._a[pt],m.year),s=qn(e.w,m.week),e.d!=null?(a=e.d,(a<0||a>6)&&(h=!0)):e.e!=null?(a=e.e+c,(e.e<0||e.e>6)&&(h=!0)):a=c),s<1||s>Lr(n,c,u)?de(t)._overflowWeeks=!0:h!=null?de(t)._overflowWeekday=!0:(l=nf(n,s,a,c,u),t._a[pt]=l.year,t._dayOfYear=l.dayOfYear)}z.ISO_8601=function(){},z.RFC_2822=function(){};function Fo(t){if(t._f===z.ISO_8601){lf(t);return}if(t._f===z.RFC_2822){ff(t);return}t._a=[],de(t).empty=!0;var e=""+t._i,n,s,a,c,u,l=e.length,h=0,m,b;for(a=ql(t._f,t._locale).match(Eo)||[],b=a.length,n=0;n<b;n++)c=a[n],s=(e.match(v0(c,t))||[])[0],s&&(u=e.substr(0,e.indexOf(s)),u.length>0&&de(t).unusedInput.push(u),e=e.slice(e.indexOf(s)+s.length),h+=s.length),Wn[c]?(s?de(t).empty=!1:de(t).unusedTokens.push(c),E0(c,s,t)):t._strict&&!s&&de(t).unusedTokens.push(c);de(t).charsLeftOver=l-h,e.length>0&&de(t).unusedInput.push(e),t._a[rt]<=12&&de(t).bigHour===!0&&t._a[rt]>0&&(de(t).bigHour=void 0),de(t).parsedDateParts=t._a.slice(0),de(t).meridiem=t._meridiem,t._a[rt]=Uy(t._locale,t._a[rt],t._meridiem),m=de(t).era,m!==null&&(t._a[pt]=t._locale.erasConvertYear(m,t._a[pt])),Io(t),Uo(t)}function Uy(t,e,n){var s;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(s=t.isPM(n),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function By(t){var e,n,s,a,c,u,l=!1,h=t._f.length;if(h===0){de(t).invalidFormat=!0,t._d=new Date(NaN);return}for(a=0;a<h;a++)c=0,u=!1,e=bo({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[a],Fo(e),_o(e)&&(u=!0),c+=de(e).charsLeftOver,c+=de(e).unusedTokens.length*10,de(e).score=c,l?c<s&&(s=c,n=e):(s==null||c<s||u)&&(s=c,n=e,u&&(l=!0));Xr(t,n||e)}function Iy(t){if(!t._d){var e=Oo(t._i),n=e.day===void 0?e.date:e.day;t._a=Fl([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),Io(t)}}function Fy(t){var e=new Ei(Uo(hf(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function hf(t){var e=t._i,n=t._f;return t._locale=t._locale||Nr(t._l),e===null||n===void 0&&e===""?Es({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),or(e)?new Ei(Uo(e)):(Ti(e)?t._d=e:ar(n)?By(t):n?Fo(t):Wy(t),_o(t)||(t._d=null),t))}function Wy(t){var e=t._i;kt(e)?t._d=new Date(z.now()):Ti(e)?t._d=new Date(e.valueOf()):typeof e=="string"?My(t):ar(e)?(t._a=Fl(e.slice(0),function(n){return parseInt(n,10)}),Io(t)):wn(e)?Iy(t):Pr(e)?t._d=new Date(e):z.createFromInputFallback(t)}function df(t,e,n,s,a){var c={};return(e===!0||e===!1)&&(s=e,e=void 0),(n===!0||n===!1)&&(s=n,n=void 0),(wn(t)&&go(t)||ar(t)&&t.length===0)&&(t=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=a,c._l=n,c._i=t,c._f=e,c._strict=s,Fy(c)}function Ke(t,e,n,s){return df(t,e,n,s,!1)}var Hy=Gt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Es()}),Yy=Gt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Es()});function pf(t,e){var n,s;if(e.length===1&&ar(e[0])&&(e=e[0]),!e.length)return Ke();for(n=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][t](n))&&(n=e[s]);return n}function Ky(){var t=[].slice.call(arguments,0);return pf("isBefore",t)}function qy(){var t=[].slice.call(arguments,0);return pf("isAfter",t)}var $y=function(){return Date.now?Date.now():+new Date},Mi=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Gy(t){var e,n=!1,s,a=Mi.length;for(e in t)if(ke(t,e)&&!(Xe.call(Mi,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(s=0;s<a;++s)if(t[Mi[s]]){if(n)return!1;parseFloat(t[Mi[s]])!==be(t[Mi[s]])&&(n=!0)}return!0}function Vy(){return this._isValid}function zy(){return cr(NaN)}function Bs(t){var e=Oo(t),n=e.year||0,s=e.quarter||0,a=e.month||0,c=e.week||e.isoWeek||0,u=e.day||0,l=e.hour||0,h=e.minute||0,m=e.second||0,b=e.millisecond||0;this._isValid=Gy(e),this._milliseconds=+b+m*1e3+h*6e4+l*1e3*60*60,this._days=+u+c*7,this._months=+a+s*3+n*12,this._data={},this._locale=Nr(),this._bubble()}function Is(t){return t instanceof Bs}function Wo(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function jy(t,e,n){var s=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),c=0,u;for(u=0;u<s;u++)be(t[u])!==be(e[u])&&c++;return c+a}function mf(t,e){ie(t,0,0,function(){var n=this.utcOffset(),s="+";return n<0&&(n=-n,s="-"),s+br(~~(n/60),2)+e+br(~~n%60,2)})}mf("Z",":"),mf("ZZ",""),Q("Z",Rs),Q("ZZ",Rs),Le(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ho(Rs,t)});var Jy=/([\+\-]|\d\d)/gi;function Ho(t,e){var n=(e||"").match(t),s,a,c;return n===null?null:(s=n[n.length-1]||[],a=(s+"").match(Jy)||["-",0,0],c=+(a[1]*60)+be(a[2]),c===0?0:a[0]==="+"?c:-c)}function Yo(t,e){var n,s;return e._isUTC?(n=e.clone(),s=(or(t)||Ti(t)?t.valueOf():Ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),z.updateOffset(n,!1),n):Ke(t).local()}function Ko(t){return-Math.round(t._d.getTimezoneOffset())}z.updateOffset=function(){};function Qy(t,e,n){var s=this._offset||0,a;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Ho(Rs,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(a=Ko(this)),this._offset=t,this._isUTC=!0,a!=null&&this.add(a,"m"),s!==t&&(!e||this._changeInProgress?wf(this,cr(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,z.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:Ko(this)}function Zy(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Xy(t){return this.utcOffset(0,t)}function e_(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ko(this),"m")),this}function t_(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Ho(b0,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function r_(t){return this.isValid()?(t=t?Ke(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function n_(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function i_(){if(!kt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return bo(t,this),t=hf(t),t._a?(e=t._isUTC?_r(t._a):Ke(t._a),this._isDSTShifted=this.isValid()&&jy(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function s_(){return this.isValid()?!this._isUTC:!1}function a_(){return this.isValid()?this._isUTC:!1}function gf(){return this.isValid()?this._isUTC&&this._offset===0:!1}var o_=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,u_=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function cr(t,e){var n=t,s=null,a,c,u;return Is(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:Pr(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(s=o_.exec(t))?(a=s[1]==="-"?-1:1,n={y:0,d:be(s[Sr])*a,h:be(s[rt])*a,m:be(s[ur])*a,s:be(s[Mr])*a,ms:be(Wo(s[bn]*1e3))*a}):(s=u_.exec(t))?(a=s[1]==="-"?-1:1,n={y:Sn(s[2],a),M:Sn(s[3],a),w:Sn(s[4],a),d:Sn(s[5],a),h:Sn(s[6],a),m:Sn(s[7],a),s:Sn(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=c_(Ke(n.from),Ke(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),c=new Bs(n),Is(t)&&ke(t,"_locale")&&(c._locale=t._locale),Is(t)&&ke(t,"_isValid")&&(c._isValid=t._isValid),c}cr.fn=Bs.prototype,cr.invalid=zy;function Sn(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function yf(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function c_(t,e){var n;return t.isValid()&&e.isValid()?(e=Yo(e,t),t.isBefore(e)?n=yf(t,e):(n=yf(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function _f(t,e){return function(n,s){var a,c;return s!==null&&!isNaN(+s)&&(Kl(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),c=n,n=s,s=c),a=cr(n,s),wf(this,a,t),this}}function wf(t,e,n,s){var a=e._milliseconds,c=Wo(e._days),u=Wo(e._months);t.isValid()&&(s=s??!0,u&&ef(t,Ci(t,"Month")+u*n),c&&Ql(t,"Date",Ci(t,"Date")+c*n),a&&t._d.setTime(t._d.valueOf()+a*n),s&&z.updateOffset(t,c||u))}var l_=_f(1,"add"),f_=_f(-1,"subtract");function bf(t){return typeof t=="string"||t instanceof String}function h_(t){return or(t)||Ti(t)||bf(t)||Pr(t)||p_(t)||d_(t)||t===null||t===void 0}function d_(t){var e=wn(t)&&!go(t),n=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a,c,u=s.length;for(a=0;a<u;a+=1)c=s[a],n=n||ke(t,c);return e&&n}function p_(t){var e=ar(t),n=!1;return e&&(n=t.filter(function(s){return!Pr(s)&&bf(t)}).length===0),e&&n}function m_(t){var e=wn(t)&&!go(t),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],a,c;for(a=0;a<s.length;a+=1)c=s[a],n=n||ke(t,c);return e&&n}function g_(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function y_(t,e){arguments.length===1&&(arguments[0]?h_(arguments[0])?(t=arguments[0],e=void 0):m_(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Ke(),s=Yo(n,this).startOf("day"),a=z.calendarFormat(this,s)||"sameElse",c=e&&(wr(e[a])?e[a].call(this,n):e[a]);return this.format(c||this.localeData().calendar(a,this,Ke(n)))}function __(){return new Ei(this)}function w_(t,e){var n=or(t)?t:Ke(t);return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function b_(t,e){var n=or(t)?t:Ke(t);return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function S_(t,e,n,s){var a=or(t)?t:Ke(t),c=or(e)?e:Ke(e);return this.isValid()&&a.isValid()&&c.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(a,n):!this.isBefore(a,n))&&(s[1]===")"?this.isBefore(c,n):!this.isAfter(c,n))):!1}function v_(t,e){var n=or(t)?t:Ke(t),s;return this.isValid()&&n.isValid()?(e=Vt(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(s=n.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function T_(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function E_(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function A_(t,e,n){var s,a,c;if(!this.isValid())return NaN;if(s=Yo(t,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,e=Vt(e),e){case"year":c=Fs(this,s)/12;break;case"month":c=Fs(this,s);break;case"quarter":c=Fs(this,s)/3;break;case"second":c=(this-s)/1e3;break;case"minute":c=(this-s)/6e4;break;case"hour":c=(this-s)/36e5;break;case"day":c=(this-s-a)/864e5;break;case"week":c=(this-s-a)/6048e5;break;default:c=this-s}return n?c:zt(c)}function Fs(t,e){if(t.date()<e.date())return-Fs(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),s=t.clone().add(n,"months"),a,c;return e-s<0?(a=t.clone().add(n-1,"months"),c=(e-s)/(s-a)):(a=t.clone().add(n+1,"months"),c=(e-s)/(a-s)),-(n+c)||0}z.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",z.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function O_(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function k_(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Os(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):wr(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Os(n,"Z")):Os(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function C_(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,s,a,c;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a="-MM-DD[T]HH:mm:ss.SSS",c=e+'[")]',this.format(n+s+a+c)}function x_(t){t||(t=this.isUtc()?z.defaultFormatUtc:z.defaultFormat);var e=Os(this,t);return this.localeData().postformat(e)}function P_(t,e){return this.isValid()&&(or(t)&&t.isValid()||Ke(t).isValid())?cr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function R_(t){return this.from(Ke(),t)}function D_(t,e){return this.isValid()&&(or(t)&&t.isValid()||Ke(t).isValid())?cr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function M_(t){return this.to(Ke(),t)}function Sf(t){var e;return t===void 0?this._locale._abbr:(e=Nr(t),e!=null&&(this._locale=e),this)}var vf=Gt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function Tf(){return this._locale}var Ws=1e3,$n=60*Ws,Hs=60*$n,Ef=(365*400+97)*24*Hs;function Gn(t,e){return(t%e+e)%e}function Af(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-Ef:new Date(t,e,n).valueOf()}function Of(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-Ef:Date.UTC(t,e,n)}function L_(t){var e,n;if(t=Vt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Of:Af,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Gn(e+(this._isUTC?0:this.utcOffset()*$n),Hs);break;case"minute":e=this._d.valueOf(),e-=Gn(e,$n);break;case"second":e=this._d.valueOf(),e-=Gn(e,Ws);break}return this._d.setTime(e),z.updateOffset(this,!0),this}function N_(t){var e,n;if(t=Vt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Of:Af,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Hs-Gn(e+(this._isUTC?0:this.utcOffset()*$n),Hs)-1;break;case"minute":e=this._d.valueOf(),e+=$n-Gn(e,$n)-1;break;case"second":e=this._d.valueOf(),e+=Ws-Gn(e,Ws)-1;break}return this._d.setTime(e),z.updateOffset(this,!0),this}function U_(){return this._d.valueOf()-(this._offset||0)*6e4}function B_(){return Math.floor(this.valueOf()/1e3)}function I_(){return new Date(this.valueOf())}function F_(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function W_(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function H_(){return this.isValid()?this.toISOString():null}function Y_(){return _o(this)}function K_(){return Xr({},de(this))}function q_(){return de(this).overflow}function $_(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ie("N",0,0,"eraAbbr"),ie("NN",0,0,"eraAbbr"),ie("NNN",0,0,"eraAbbr"),ie("NNNN",0,0,"eraName"),ie("NNNNN",0,0,"eraNarrow"),ie("y",["y",1],"yo","eraYear"),ie("y",["yy",2],0,"eraYear"),ie("y",["yyy",3],0,"eraYear"),ie("y",["yyyy",4],0,"eraYear"),Q("N",qo),Q("NN",qo),Q("NNN",qo),Q("NNNN",rw),Q("NNNNN",nw),Le(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,s){var a=n._locale.erasParse(t,s,n._strict);a?de(n).era=a:de(n).invalidEra=t}),Q("y",Hn),Q("yy",Hn),Q("yyy",Hn),Q("yyyy",Hn),Q("yo",iw),Le(["y","yy","yyy","yyyy"],pt),Le(["yo"],function(t,e,n,s){var a;n._locale._eraYearOrdinalRegex&&(a=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[pt]=n._locale.eraYearOrdinalParse(t,a):e[pt]=parseInt(t,10)});function G_(t,e){var n,s,a,c=this._eras||Nr("en")._eras;for(n=0,s=c.length;n<s;++n){switch(typeof c[n].since){case"string":a=z(c[n].since).startOf("day"),c[n].since=a.valueOf();break}switch(typeof c[n].until){case"undefined":c[n].until=1/0;break;case"string":a=z(c[n].until).startOf("day").valueOf(),c[n].until=a.valueOf();break}}return c}function V_(t,e,n){var s,a,c=this.eras(),u,l,h;for(t=t.toUpperCase(),s=0,a=c.length;s<a;++s)if(u=c[s].name.toUpperCase(),l=c[s].abbr.toUpperCase(),h=c[s].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(l===t)return c[s];break;case"NNNN":if(u===t)return c[s];break;case"NNNNN":if(h===t)return c[s];break}else if([u,l,h].indexOf(t)>=0)return c[s]}function z_(t,e){var n=t.since<=t.until?1:-1;return e===void 0?z(t.since).year():z(t.since).year()+(e-t.offset)*n}function j_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].name;return""}function J_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].narrow;return""}function Q_(){var t,e,n,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),s[t].since<=n&&n<=s[t].until||s[t].until<=n&&n<=s[t].since)return s[t].abbr;return""}function Z_(){var t,e,n,s,a=this.localeData().eras();for(t=0,e=a.length;t<e;++t)if(n=a[t].since<=a[t].until?1:-1,s=this.clone().startOf("day").valueOf(),a[t].since<=s&&s<=a[t].until||a[t].until<=s&&s<=a[t].since)return(this.year()-z(a[t].since).year())*n+a[t].offset;return this.year()}function X_(t){return ke(this,"_erasNameRegex")||$o.call(this),t?this._erasNameRegex:this._erasRegex}function ew(t){return ke(this,"_erasAbbrRegex")||$o.call(this),t?this._erasAbbrRegex:this._erasRegex}function tw(t){return ke(this,"_erasNarrowRegex")||$o.call(this),t?this._erasNarrowRegex:this._erasRegex}function qo(t,e){return e.erasAbbrRegex(t)}function rw(t,e){return e.erasNameRegex(t)}function nw(t,e){return e.erasNarrowRegex(t)}function iw(t,e){return e._eraYearOrdinalRegex||Hn}function $o(){var t=[],e=[],n=[],s=[],a,c,u,l,h,m=this.eras();for(a=0,c=m.length;a<c;++a)u=Rr(m[a].name),l=Rr(m[a].abbr),h=Rr(m[a].narrow),e.push(u),t.push(l),n.push(h),s.push(u),s.push(l),s.push(h);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}ie(0,["gg",2],0,function(){return this.weekYear()%100}),ie(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ys(t,e){ie(0,[t,t.length],0,e)}Ys("gggg","weekYear"),Ys("ggggg","weekYear"),Ys("GGGG","isoWeekYear"),Ys("GGGGG","isoWeekYear"),Q("G",Ps),Q("g",Ps),Q("GG",Ye,Nt),Q("gg",Ye,Nt),Q("GGGG",Co,ko),Q("gggg",Co,ko),Q("GGGGG",xs,ks),Q("ggggg",xs,ks),Oi(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,s){e[s.substr(0,2)]=be(t)}),Oi(["gg","GG"],function(t,e,n,s){e[s]=z.parseTwoDigitYear(t)});function sw(t){return kf.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function aw(t){return kf.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function ow(){return Lr(this.year(),1,4)}function uw(){return Lr(this.isoWeekYear(),1,4)}function cw(){var t=this.localeData()._week;return Lr(this.year(),t.dow,t.doy)}function lw(){var t=this.localeData()._week;return Lr(this.weekYear(),t.dow,t.doy)}function kf(t,e,n,s,a){var c;return t==null?Pi(this,s,a).year:(c=Lr(t,s,a),e>c&&(e=c),fw.call(this,t,e,n,s,a))}function fw(t,e,n,s,a){var c=nf(t,e,n,s,a),u=xi(c.year,0,c.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}ie("Q",0,"Qo","quarter"),Q("Q",Gl),Le("Q",function(t,e){e[Dr]=(be(t)-1)*3});function hw(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}ie("D",["DD",2],"Do","date"),Q("D",Ye,Yn),Q("DD",Ye,Nt),Q("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Le(["D","DD"],Sr),Le("Do",function(t,e){e[Sr]=be(t.match(Ye)[0])});var Cf=Kn("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",Cs),Q("DDDD",Vl),Le(["DDD","DDDD"],function(t,e,n){n._dayOfYear=be(t)});function dw(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}ie("m",["mm",2],0,"minute"),Q("m",Ye,xo),Q("mm",Ye,Nt),Le(["m","mm"],ur);var pw=Kn("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ye,xo),Q("ss",Ye,Nt),Le(["s","ss"],Mr);var mw=Kn("Seconds",!1);ie("S",0,0,function(){return~~(this.millisecond()/100)}),ie(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ie(0,["SSS",3],0,"millisecond"),ie(0,["SSSS",4],0,function(){return this.millisecond()*10}),ie(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ie(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ie(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ie(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ie(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Q("S",Cs,Gl),Q("SS",Cs,Nt),Q("SSS",Cs,Vl);var tn,xf;for(tn="SSSS";tn.length<=9;tn+="S")Q(tn,Hn);function gw(t,e){e[bn]=be(("0."+t)*1e3)}for(tn="S";tn.length<=9;tn+="S")Le(tn,gw);xf=Kn("Milliseconds",!1),ie("z",0,0,"zoneAbbr"),ie("zz",0,0,"zoneName");function yw(){return this._isUTC?"UTC":""}function _w(){return this._isUTC?"Coordinated Universal Time":""}var V=Ei.prototype;V.add=l_,V.calendar=y_,V.clone=__,V.diff=A_,V.endOf=N_,V.format=x_,V.from=P_,V.fromNow=R_,V.to=D_,V.toNow=M_,V.get=C0,V.invalidAt=q_,V.isAfter=w_,V.isBefore=b_,V.isBetween=S_,V.isSame=v_,V.isSameOrAfter=T_,V.isSameOrBefore=E_,V.isValid=Y_,V.lang=vf,V.locale=Sf,V.localeData=Tf,V.max=Yy,V.min=Hy,V.parsingFlags=K_,V.set=x0,V.startOf=L_,V.subtract=f_,V.toArray=F_,V.toObject=W_,V.toDate=I_,V.toISOString=k_,V.inspect=C_,typeof Symbol<"u"&&Symbol.for!=null&&(V[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),V.toJSON=H_,V.toString=O_,V.unix=B_,V.valueOf=U_,V.creationData=$_,V.eraName=j_,V.eraNarrow=J_,V.eraAbbr=Q_,V.eraYear=Z_,V.year=Jl,V.isLeapYear=k0,V.weekYear=sw,V.isoWeekYear=aw,V.quarter=V.quarters=hw,V.month=tf,V.daysInMonth=I0,V.week=V.weeks=G0,V.isoWeek=V.isoWeeks=V0,V.weeksInYear=cw,V.weeksInWeekYear=lw,V.isoWeeksInYear=ow,V.isoWeeksInISOWeekYear=uw,V.date=Cf,V.day=V.days=ay,V.weekday=oy,V.isoWeekday=uy,V.dayOfYear=dw,V.hour=V.hours=my,V.minute=V.minutes=pw,V.second=V.seconds=mw,V.millisecond=V.milliseconds=xf,V.utcOffset=Qy,V.utc=Xy,V.local=e_,V.parseZone=t_,V.hasAlignedHourOffset=r_,V.isDST=n_,V.isLocal=s_,V.isUtcOffset=a_,V.isUtc=gf,V.isUTC=gf,V.zoneAbbr=yw,V.zoneName=_w,V.dates=Gt("dates accessor is deprecated. Use date instead.",Cf),V.months=Gt("months accessor is deprecated. Use month instead",tf),V.years=Gt("years accessor is deprecated. Use year instead",Jl),V.zone=Gt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zy),V.isDSTShifted=Gt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",i_);function ww(t){return Ke(t*1e3)}function bw(){return Ke.apply(null,arguments).parseZone()}function Pf(t){return t}var Ce=vo.prototype;Ce.calendar=s0,Ce.longDateFormat=c0,Ce.invalidDate=f0,Ce.ordinal=p0,Ce.preparse=Pf,Ce.postformat=Pf,Ce.relativeTime=g0,Ce.pastFuture=y0,Ce.set=n0,Ce.eras=G_,Ce.erasParse=V_,Ce.erasConvertYear=z_,Ce.erasAbbrRegex=ew,Ce.erasNameRegex=X_,Ce.erasNarrowRegex=tw,Ce.months=L0,Ce.monthsShort=N0,Ce.monthsParse=B0,Ce.monthsRegex=W0,Ce.monthsShortRegex=F0,Ce.week=Y0,Ce.firstDayOfYear=$0,Ce.firstDayOfWeek=q0,Ce.weekdays=ty,Ce.weekdaysMin=ny,Ce.weekdaysShort=ry,Ce.weekdaysParse=sy,Ce.weekdaysRegex=cy,Ce.weekdaysShortRegex=ly,Ce.weekdaysMinRegex=fy,Ce.isPM=dy,Ce.meridiem=gy;function Ks(t,e,n,s){var a=Nr(),c=_r().set(s,e);return a[n](c,t)}function Rf(t,e,n){if(Pr(t)&&(e=t,t=void 0),t=t||"",e!=null)return Ks(t,e,n,"month");var s,a=[];for(s=0;s<12;s++)a[s]=Ks(t,s,n,"month");return a}function Go(t,e,n,s){typeof t=="boolean"?(Pr(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,Pr(e)&&(n=e,e=void 0),e=e||"");var a=Nr(),c=t?a._week.dow:0,u,l=[];if(n!=null)return Ks(e,(n+c)%7,s,"day");for(u=0;u<7;u++)l[u]=Ks(e,(u+c)%7,s,"day");return l}function Sw(t,e){return Rf(t,e,"months")}function vw(t,e){return Rf(t,e,"monthsShort")}function Tw(t,e,n){return Go(t,e,n,"weekdays")}function Ew(t,e,n){return Go(t,e,n,"weekdaysShort")}function Aw(t,e,n){return Go(t,e,n,"weekdaysMin")}en("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=be(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),z.lang=Gt("moment.lang is deprecated. Use moment.locale instead.",en),z.langData=Gt("moment.langData is deprecated. Use moment.localeData instead.",Nr);var Ur=Math.abs;function Ow(){var t=this._data;return this._milliseconds=Ur(this._milliseconds),this._days=Ur(this._days),this._months=Ur(this._months),t.milliseconds=Ur(t.milliseconds),t.seconds=Ur(t.seconds),t.minutes=Ur(t.minutes),t.hours=Ur(t.hours),t.months=Ur(t.months),t.years=Ur(t.years),this}function Df(t,e,n,s){var a=cr(e,n);return t._milliseconds+=s*a._milliseconds,t._days+=s*a._days,t._months+=s*a._months,t._bubble()}function kw(t,e){return Df(this,t,e,1)}function Cw(t,e){return Df(this,t,e,-1)}function Mf(t){return t<0?Math.floor(t):Math.ceil(t)}function xw(){var t=this._milliseconds,e=this._days,n=this._months,s=this._data,a,c,u,l,h;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=Mf(Vo(n)+e)*864e5,e=0,n=0),s.milliseconds=t%1e3,a=zt(t/1e3),s.seconds=a%60,c=zt(a/60),s.minutes=c%60,u=zt(c/60),s.hours=u%24,e+=zt(u/24),h=zt(Lf(e)),n+=h,e-=Mf(Vo(h)),l=zt(n/12),n%=12,s.days=e,s.months=n,s.years=l,this}function Lf(t){return t*4800/146097}function Vo(t){return t*146097/4800}function Pw(t){if(!this.isValid())return NaN;var e,n,s=this._milliseconds;if(t=Vt(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+s/864e5,n=this._months+Lf(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Vo(this._months)),t){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+t)}}function Br(t){return function(){return this.as(t)}}var Nf=Br("ms"),Rw=Br("s"),Dw=Br("m"),Mw=Br("h"),Lw=Br("d"),Nw=Br("w"),Uw=Br("M"),Bw=Br("Q"),Iw=Br("y"),Fw=Nf;function Ww(){return cr(this)}function Hw(t){return t=Vt(t),this.isValid()?this[t+"s"]():NaN}function vn(t){return function(){return this.isValid()?this._data[t]:NaN}}var Yw=vn("milliseconds"),Kw=vn("seconds"),qw=vn("minutes"),$w=vn("hours"),Gw=vn("days"),Vw=vn("months"),zw=vn("years");function jw(){return zt(this.days()/7)}var Ir=Math.round,Vn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jw(t,e,n,s,a){return a.relativeTime(e||1,!!n,t,s)}function Qw(t,e,n,s){var a=cr(t).abs(),c=Ir(a.as("s")),u=Ir(a.as("m")),l=Ir(a.as("h")),h=Ir(a.as("d")),m=Ir(a.as("M")),b=Ir(a.as("w")),T=Ir(a.as("y")),P=c<=n.ss&&["s",c]||c<n.s&&["ss",c]||u<=1&&["m"]||u<n.m&&["mm",u]||l<=1&&["h"]||l<n.h&&["hh",l]||h<=1&&["d"]||h<n.d&&["dd",h];return n.w!=null&&(P=P||b<=1&&["w"]||b<n.w&&["ww",b]),P=P||m<=1&&["M"]||m<n.M&&["MM",m]||T<=1&&["y"]||["yy",T],P[2]=e,P[3]=+t>0,P[4]=s,Jw.apply(null,P)}function Zw(t){return t===void 0?Ir:typeof t=="function"?(Ir=t,!0):!1}function Xw(t,e){return Vn[t]===void 0?!1:e===void 0?Vn[t]:(Vn[t]=e,t==="s"&&(Vn.ss=e-1),!0)}function e1(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Vn,a,c;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(s=Object.assign({},Vn,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),a=this.localeData(),c=Qw(this,!n,s,a),n&&(c=a.pastFuture(+this,c)),a.postformat(c)}var zo=Math.abs;function zn(t){return(t>0)-(t<0)||+t}function qs(){if(!this.isValid())return this.localeData().invalidDate();var t=zo(this._milliseconds)/1e3,e=zo(this._days),n=zo(this._months),s,a,c,u,l=this.asSeconds(),h,m,b,T;return l?(s=zt(t/60),a=zt(s/60),t%=60,s%=60,c=zt(n/12),n%=12,u=t?t.toFixed(3).replace(/\.?0+$/,""):"",h=l<0?"-":"",m=zn(this._months)!==zn(l)?"-":"",b=zn(this._days)!==zn(l)?"-":"",T=zn(this._milliseconds)!==zn(l)?"-":"",h+"P"+(c?m+c+"Y":"")+(n?m+n+"M":"")+(e?b+e+"D":"")+(a||s||t?"T":"")+(a?T+a+"H":"")+(s?T+s+"M":"")+(t?T+u+"S":"")):"P0D"}var Ee=Bs.prototype;Ee.isValid=Vy,Ee.abs=Ow,Ee.add=kw,Ee.subtract=Cw,Ee.as=Pw,Ee.asMilliseconds=Nf,Ee.asSeconds=Rw,Ee.asMinutes=Dw,Ee.asHours=Mw,Ee.asDays=Lw,Ee.asWeeks=Nw,Ee.asMonths=Uw,Ee.asQuarters=Bw,Ee.asYears=Iw,Ee.valueOf=Fw,Ee._bubble=xw,Ee.clone=Ww,Ee.get=Hw,Ee.milliseconds=Yw,Ee.seconds=Kw,Ee.minutes=qw,Ee.hours=$w,Ee.days=Gw,Ee.weeks=jw,Ee.months=Vw,Ee.years=zw,Ee.humanize=e1,Ee.toISOString=qs,Ee.toString=qs,Ee.toJSON=qs,Ee.locale=Sf,Ee.localeData=Tf,Ee.toIsoString=Gt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qs),Ee.lang=vf,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",Ps),Q("X",S0),Le("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),Le("x",function(t,e,n){n._d=new Date(be(t))});//! moment.js
42
+ z.version="2.30.1",t0(Ke),z.fn=V,z.min=Ky,z.max=qy,z.now=$y,z.utc=_r,z.unix=ww,z.months=Sw,z.isDate=Ti,z.locale=en,z.invalid=Es,z.duration=cr,z.isMoment=or,z.weekdays=Tw,z.parseZone=bw,z.localeData=Nr,z.isDuration=Is,z.monthsShort=vw,z.weekdaysMin=Aw,z.defineLocale=No,z.updateLocale=by,z.locales=Sy,z.weekdaysShort=Ew,z.normalizeUnits=Vt,z.relativeTimeRounding=Zw,z.relativeTimeThreshold=Xw,z.calendarFormat=g_,z.prototype=V,z.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function Uf(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function t1(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4);return e+n}function Bf(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function r1(t){const e=atob(t),n=new Uint8Array(e.length);for(let s=0;s<e.length;s++)n[s]=e.charCodeAt(s);return n}const Ct=60,If=60*Ct,Li=24*If,$s=7*Li;function Ff(){return new Date().getTime()/1e3}function n1(t){return t.split("").map(e=>e.charCodeAt(0))}function Gs(t){const e=new TextEncoder().encode(t);return Uf(Bf(e))}function Vs(t){const e=r1(t1(t));return new TextDecoder().decode(e)}async function Wf(t){const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e),s=new Uint8Array(n);let a="";for(let c=0;c<s.length;c++)a+=s[c].toString(16).padStart(2,"0");return a}async function jo(t,e,n="hex"){const s=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,new TextEncoder().encode(t)),c=new Uint8Array(a);if(n==="base64url")return Uf(Bf(c));let u="";for(let l=0;l<c.length;l++)u+=c[l].toString(16).padStart(2,"0");return u}function Jo(t,e=void 0){return _n.createJWT(t,e)}function Hf(t){return _n.parseJWT(t)}function Yf(t){return _n.jwkToPublicKey(t)}function Qo(t,e){return _n.encryptPayload(t,e)}function Zo(t){if(Array.isArray(t))return t.map(Zo);if(t&&typeof t=="object"&&t.constructor===Object){const e={},n=Object.keys(t),s=n.length;for(let a=0;a<s;a+=1)e[ro.camelCase(n[a])]=Zo(t[n[a]]);return e}return t}function zs(t){if(!t)return!0;try{return JSON.parse(Vs(t.split(".")[1])).exp<Ff()}catch{return!0}}function Xo(t){return jt("root",t,"non-nullable object",!1)}function eu(t,e){return jt("root",t,"object",e)}function tu(t,e){return jt("root",t,"object",e)}function js(t,e){!Array.isArray(t)&&t!==null&&t!==void 0&&jt(e,t,"array",!0)}function xt(t,e,n){typeof t=="string"?t.match(/\d+(\.\d+)?/)||jt(n,t,"string",e):typeof t!="number"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"number",e)}function ct(t,e,n){typeof t=="string"?t.match(/\d+(\.\d+)?/)||jt(n,t,"number",e):typeof t!="number"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"number",e)}function Tn(t,e,n){typeof t!="boolean"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"boolean",e)}function Ge(t,e,n){typeof t!="string"&&(!e||e&&t!==null&&t!==void 0)&&jt(n,t,"string",e)}function Kf(t,e){t!=null&&jt(e,t,"null or undefined",!1)}function jt(t,e,n,s){throw s&&(n+=", null, or undefined"),new TypeError("Expected "+n+" at "+t+` but found:
43
+ `+JSON.stringify(e))}function X(t){return Ze.isBigNumber(t)?t:t?new Ze(t):new Ze("0")}function En(t,e){return new Ze(e).toFixed(t>0?t:0)}function Ni(t){return typeof t=="number"?t:parseFloat(t)}function jn(t){return typeof t=="number"?t:parseInt(t)}function ru(t){let e=Ni(t);return e<1e10&&(e=e*1e3),new Date(e)}function qf(t){switch(t.toString().toUpperCase()){case"1S":return 1;case"2S":return 2;case"3S":return 3;case"5S":return 5;case"10S":return 10;case"15S":return 15;case"30S":return 30;case"1":return Ct;case"2":return Ct*2;case"3":return Ct*3;case"5":return Ct*5;case"10":return Ct*10;case"15":return Ct*15;case"30":return Ct*30;case"60":return Ct*60;case"120":return Ct*120;case"240":return Ct*240;case"360":return Ct*360;case"720":return Ct*720;case"D":case"1D":return Li;case"3D":return Li*3;case"W":return $s;case"1W":return $s;case"2W":return $s*2;case"1M":return Li*30}}const Js=t=>typeof t=="object"?t:new Date(t*1e3),$f=(t,e)=>{switch(t=z.utc(Js(t)),e){case"1":case"2":case"3":return t.endOf("day").unix();case"5":case"10":case"15":return t.endOf("isoWeek").unix();case"30":case"60":case"120":return t.endOf("month").unix();case"240":case"360":case"720":case"D":case"1D":return t.endOf("year").unix()}},i1=(t,e)=>{switch(t=z.utc(Js(t)),e){case"1":case"2":case"3":return t.startOf("day").unix();case"5":case"10":case"15":return t.startOf("isoWeek").unix();case"30":case"60":case"120":return t.startOf("month").unix();case"240":case"360":case"720":case"D":case"1D":return t.startOf("year").unix()}};function Gf(t){switch(t){case"1":case"2":case"3":return"day";case"5":case"10":case"15":return"week";case"30":case"60":case"120":return"month";case"240":case"360":case"720":case"D":case"1D":return"year";default:throw new Error(`Unsupported resolution: ${t}`)}}function Vf(t,e){let n=z(Js(e)),s;switch(t){case"day":s={year:n.year(),month:n.month()+1,day:n.date()};break;case"week":s={year:n.isoWeekYear(),week:n.isoWeek()};break;case"month":s={year:n.year(),month:n.month()+1};break;case"year":s={year:n.year()};break;default:throw new Error(`Unsupported bucketType: ${t}`)}return s}function zf(t,e,n){const s=[];let a=z.utc(e*1e3);const c=m=>{switch(n){case"day":return m.startOf("day");case"week":return m.startOf("isoWeek");case"month":return m.startOf("month");case"year":return m.startOf("year");default:throw new Error(`Unsupported bucketType: ${n}`)}},u=m=>{switch(n){case"day":return m.subtract(1,"day");case"week":return m.subtract(1,"week");case"month":return m.subtract(1,"month");case"year":return m.subtract(1,"year");default:throw new Error(`Unsupported bucketType: ${n}`)}};let l=c(a);const h=c(z.utc(t*1e3));for(;l>=h;)s.push(l.clone()),l=u(l);return s}function Qs(t,e,n){let s=qf(e),a=typeof n=="object"?n.getTime()/1e3:n;return Math.floor(a/s)*s-s*(t-1)}function jf(t,e){let n=e;if(typeof e=="string"?n=[{query:e,marketProperty:"fullDisplayName"}]:Array.isArray(e)?n=e.map(a=>{if(typeof a=="string")return{query:a,marketProperty:"fullDisplayName"};if(!Array.isArray(a))return a}):n=[e],n.length===0||!n.find(({query:a})=>!!a&&!!a.length))return t;let s=t;return n.forEach(({query:a,marketProperty:c})=>{let u;if(a.match(/[-_:\/\\]+/))try{u=new RegExp(a.replace(/\*/g,".*"),"i")}catch{}const l=a.toLowerCase().split(/[\s]+/).filter(Boolean);s=ut.pickBy(s,(h,m)=>{const b=h[c].toLowerCase();return u&&c==="fullDisplayName"?!!u.exec(h[c]):l.filter(T=>b.includes(T)).length===l.length})}),s}let nu;class s1{static initialize=e=>{nu=e,console.log("Coinray I18n initialized")};static t=(e,n)=>nu?nu.t(`coinray:${e}`,n):`i18n uninitialized. Set the Coinray.I18n.instance. Key: ${e}`}const Jf="2.0.8";class a1 extends Error{errorCode;errorMessage;exchange;constructor({code:e,message:n,exchange:s}){super("Request failed"),this.name="CoinrayError",this.errorCode=e,this.errorMessage=n,this.exchange=s}}class xe{static I18n=s1;config;_token;_sessionKey;_credential;_firstOpen;_onTokenExpired;_tokenCheckTimeout;_onError;_onOpen;_socket;_transport;_tickerListeners=new Map;_tickerSymbols=new Map;_tradeListeners={};_tradeSnapshots={};_orderbookListeners={};_orderbookSnapshots={};_candleTradeListeners={};_candleListeners={};_candles={};_timers={};_channels={};_connected;markConnected;_publicKey;_refreshingToken;_nonceOffset;tickersSubscribed=!1;tradesSubscribed=!1;orderBookSubscribed=!1;_timeOffset;_timeOffsetTimeout;_candleCache;_candleCacheCreatedAt;constructor(e,{apiEndpoint:n,orderEndpoint:s,websocketEndpoint:a}={apiEndpoint:"https://api.coinray.eu",orderEndpoint:"https://api.coinray.eu",websocketEndpoint:"wss://ws.coinray.eu/v1"}){this._token=e,this._nonceOffset=0,this._timeOffset=0,this._firstOpen=!0,this.config={apiEndpoint:n||"https://api.coinray.eu",orderEndpoint:s||n||"https://api.coinray.eu",websocketEndpoint:a||"wss://ws.coinray.eu/v1"},this._candleCache=new Map,this.loadTimeOffset().then()}authenticateDevice=(e,n)=>{this._credential=e,this._sessionKey=n};destroy=()=>{this._tradeListeners={},this._orderbookListeners={},this._tickerListeners=new Map,this._tickerSymbols=new Map,this._channels={},this._timeOffsetTimeout&&clearTimeout(this._timeOffsetTimeout),this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this.disconnect()};checkToken=async(e=!0)=>{try{if(zs(this._token)){if(console.log("Coinray token expired. Can refresh:",!!this._onTokenExpired),!this._onTokenExpired)return!1;this._refreshingToken||(this._refreshingToken=this._onTokenExpired());try{this._token=await this._refreshingToken}catch(n){return console.log("Coinray token could not be refreshed",n),this._refreshingToken=void 0,!1}if(this._refreshingToken=void 0,!zs(this._token))this.reconnect();else return!1}}catch(n){console.error(n)}return e&&(this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)),!0};setTransport=e=>{this._transport=e};onTokenExpired=e=>{this._tokenCheckTimeout&&clearInterval(this._tokenCheckTimeout),this._onTokenExpired=e,this._tokenCheckTimeout=setTimeout(this.checkToken,5e3)};refreshToken=e=>{this._token=e};getNonce=()=>(this._nonceOffset>900&&(this._nonceOffset=0),this._nonceOffset+=1,this.getTime()+this._nonceOffset);getTime=()=>Math.floor(new Date().getTime()/1e3)*1e3+this._timeOffset;loadTimeOffset=async()=>{try{const{result:e}=await this.get("/coinray/time");this._timeOffset=e.time-new Date().getTime()}catch(e){console.error(e)}this._timeOffsetTimeout=setTimeout(this.loadTimeOffset,6e4)};getToken=async()=>{if(await this.checkToken(!1))return this._token;throw new Error("Token is expired. call refreshToken in the onTokenExpired callback")};reconnect=()=>{this._connected&&this.socket.conn.close()};disconnect=()=>{this._socket&&(this._socket.disconnect(),this._socket=void 0),this._connected=void 0};connect=async()=>{if(this._connected){await this._connected;return}else this._connected=new Promise(e=>{this.markConnected=e});this.socket.onOpen(e=>{this._onOpen&&this._onOpen(e)}),this.socket.onError(e=>{this._onError&&this._onError(e)}),this.socket.connect(),this.markConnected()};onOpen=e=>{this._onOpen=e};onError=e=>{this._onError=e};resubscribe=()=>{if(this._firstOpen){this._firstOpen=!1;return}Object.keys(this._tickerListeners).forEach(e=>{this._tickerListeners[e].length>0&&this.getChannel("tickers").push("subscribe",{exchangeCodes:[e]},5e3)}),Object.keys(this._tradeListeners).forEach(e=>{this._tradeListeners[e].length>0&&this.getChannel("trades").push("subscribe",{symbols:e,snapshots:!0},5e3)}),Object.keys(this._orderbookListeners).forEach(e=>{this._orderbookListeners[e].length>0&&this.getChannel("orderbooks").push("subscribe",{symbols:e,snapshots:!0},5e3)})};subscribeTickers=async(e,n=!1,s)=>{if(e.length===0)return!1;if(n&&(this._tickerListeners.clear(),this._tickerSymbols.clear()),this._tickerListeners.has(s)){let c=this._tickerListeners.get(s);e.forEach(u=>c.add(u))}else this._tickerListeners.set(s,new Set(e));e.forEach(c=>{this._tickerSymbols.has(c)||this._tickerSymbols.set(c,new Set),this._tickerSymbols.get(c).add(s)}),await this.connect();const a=this.getChannel("tickers");return a.push("subscribe",{coinraySymbols:e,reset:n},5e3),this.tickersSubscribed||(this.tickersSubscribed=!0,a.on("update",c=>{let{exchange_code:u,tickers:l}=c;const h=l.map(xe._parseTicker);this._tickerListeners.forEach((m,b)=>{const T=h.filter(P=>m.has(P.coinraySymbol));b({type:"tickers:update",exchangeCode:u,tickers:T})})}),a.on("error",c=>console.error(c))),s};unsubscribeAllTickers=()=>{this._tickerListeners.clear(),this._tickerSymbols.clear(),this.getChannel("tickers").push("unsubscribe",{all:!0},5e3)};unsubscribeTickers=(e,n)=>{if(n&&this._tickerListeners.has(n)){let s=this._tickerListeners.get(n),a=[];e.forEach(c=>{s.delete(c),this._tickerSymbols.has(c)&&(this._tickerSymbols.get(c).delete(n),this._tickerSymbols.get(c).size===0&&(this._tickerSymbols.delete(c),a.push(c)))}),s.size===0&&this._tickerListeners.delete(n),a.length>0&&this.getChannel("tickers").push("unsubscribe",{coinraySymbols:a},5e3)}};subscribeTrades=async({coinraySymbol:e},n)=>{if(this._tradeListeners[e]&&this._tradeListeners[e].length>0)return this._tradeListeners[e].includes(n)||this._tradeListeners[e].push(n),n({type:"trades:snapshot",coinraySymbol:e,trades:this._tradeSnapshots[e]}),n;this._tradeSnapshots[e]=[],this._tradeListeners[e]=[n],await this.connect();const s=this.getChannel("trades");return s.push("subscribe",{symbols:e,snapshots:!0},5e3),this.tradesSubscribed||(this.tradesSubscribed=!0,s.on("snapshot",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade);this._tradeSnapshots[a]=l,u.map(h=>h({type:"trades:snapshot",coinraySymbol:a,trades:l}))}),s.on("update",({symbol:a,trades:c})=>{const u=Object.values(this._tradeListeners[a]),l=c.map(xe._parseTrade),h=[...l,...this._tradeSnapshots[a]],m=new Date(new Date().getTime()-12e4),b=h.filter(({time:T})=>T>m);b.length>100?this._tradeSnapshots[a]=b:this._tradeSnapshots[a]=h.slice(0,100),u.map(T=>T({type:"trades:update",coinraySymbol:a,trades:l}))}),s.on("error",a=>console.error(a))),n};unsubscribeTrades=({coinraySymbol:e},n)=>{n&&this._tradeListeners[e]?(this._tradeListeners[e]=this._tradeListeners[e].filter(s=>s!==n),this._tradeListeners[e].length===0&&this.getChannel("trades").push("unsubscribe",{symbols:e},5e3)):(this._tradeSnapshots[e]=[],this._tradeListeners[e]=[])};subscribeOrderBook=async({coinraySymbol:e},n)=>{if(this._orderbookListeners[e]&&this._orderbookListeners[e].length>0)return this._orderbookListeners[e].includes(n)||this._orderbookListeners[e].push(n),n({type:"orderBook:snapshot",coinraySymbol:e,orderBook:this._orderbookSnapshots[e]}),n;this._orderbookSnapshots[e]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[e]=[n],await this.connect();const s=this.getChannel("orderbooks");return s.push("subscribe",{symbols:e},1e4),this.orderBookSubscribed||(this.orderBookSubscribed=!0,s.on("snapshot",({orderbooks:a})=>{Object.keys(a).forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookSnapshot(a[u]);this._orderbookSnapshots[u]=h,l.map(m=>m({type:"orderBook:snapshot",coinraySymbol:u,orderBook:h}))})}),s.on("update",({orderbooks:a})=>{const c=Object.keys(a);c.length!==0&&c.forEach(u=>{const l=Object.values(this._orderbookListeners[u]),h=xe._parseOrderBookUpdate(a[u]);this._orderbookSnapshots[u]=xe._updateOrderBook(this._orderbookSnapshots[u],h),l.map(m=>m({type:"orderBook:update",coinraySymbol:u,orderBook:h}))})}),s.on("error",a=>console.error(a))),n};unsubscribeOrderBook=({coinraySymbol:e},n)=>{n&&this._orderbookListeners[e]?(this._orderbookListeners[e]=this._orderbookListeners[e].filter(s=>s!==n),this._orderbookListeners[e].length===0&&this.getChannel("orderbooks").push("unsubscribe",{symbols:e},5e3)):(this._orderbookSnapshots[e]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[e]=[])};subscribeCandles=async({coinraySymbol:e,resolution:n,lastCandle:s},a)=>{const c=`${e}-${n}`;if(this._candleListeners[c]&&this._candleListeners[c].length>0)return this._candleListeners[c].push(a),a;this._candleListeners[c]=[a];const u=({type:l,coinraySymbol:h,trades:m})=>{const b=Object.values(this._candleListeners[c]),T=xe._tradesToLastCandle(n,m),P=T[T.length-1];P&&(this._candles[c]&&l==="trades:snapshot"&&(this._candles[c].skipVolume=!0),this._candles[c]=xe._mergeCandle(this._candles[c],P),b.map($=>$({coinraySymbol:h,resolution:n,candle:this._candles[c],previousCandles:T})))};return this._candleTradeListeners[e]?this._candleTradeListeners[e][c]=u:this._candleTradeListeners[e]={[c]:u},this._candles[c]=s||{time:new Date(0)},await this.subscribeTrades({coinraySymbol:e},u),this.startNewCandleTimer({candleId:c,resolution:n,coinraySymbol:e}),a};startNewCandleTimer=({candleId:e,resolution:n,coinraySymbol:s})=>{this._timers[e]&&clearTimeout(this._timers[e]);let a=Qs(0,n,new Date)-new Date().getTime()/1e3;const c=Object.values(this._candleListeners[e]);this._timers[e]=setTimeout(()=>{let u=Qs(1,n,new Date)*1e3,l=this._candles[e];l&&u>l.time.getTime()&&(this._candles[e]={time:new Date(u),open:l.close,high:l.close,low:l.close,close:l.close,baseVolume:0,quoteVolume:0,numTrades:0},c.map(h=>h({coinraySymbol:s,resolution:n,candle:this._candles[e],previousCandles:[]}))),this.startNewCandleTimer({candleId:e,resolution:n,coinraySymbol:s})},a*1e3)};unsubscribeCandles=({coinraySymbol:e,resolution:n},s)=>{const a=`${e}-${n}`;s&&this._candleListeners[a]?this._candleListeners[a]=this._candleListeners[a].filter(c=>c!==s):this._candleListeners[a]=[],this._candleListeners[a].length===0&&(this.unsubscribeTrades({coinraySymbol:e},this._candleTradeListeners[e][a]),this._timers[a]&&(clearTimeout(this._timers[a]),delete this._timers[a]),delete this._candles[a],delete this._candleTradeListeners[e][a])};fetchFirstCandleTime=async({coinraySymbol:e,resolution:n})=>{let{result:{startTime:s}}=await this.get("candles/start-time",{version:"v1",params:{symbol:e,resolution:n}});return s};fetchCandles=async({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c})=>{if(this.flushCache(),n.endsWith("S"))return(await this.getWebsocketCandles(e,n)).filter($=>{let O=$.time.getTime()/1e3;return O>=s&&O<=a});const u=Gf(n),l=new Date().getTime()/1e3,h=[];let m=a;if($f(a,n)>=l){let P=await this.getOpenCandles(c,{version:"v2",params:{symbol:e,resolution:n}});if(P.length>0)m=Math.min(P[0].time.getTime()/1e3,m),h.push(...P);else return[]}let b=Qs(2,n,m),T=ro.chunk(zf(s,b,u),10);for(let P=0;P<T.length;P+=1){let $=T[P].map(F=>{let ne=Vf(u,F),Y={version:"v2",params:{symbol:e,resolution:n,...ne}};return this.getHistoryCandles(Y)}),O=await Promise.all($),I=[];for(let F=0;F<O.length;F+=1)I=O[F].filter(({time:ne})=>ne.getTime()/1e3<m),I.length>0&&(m=Math.min(I[0].time.getTime()/1e3,m),h.unshift(...I));if(I.length===0)break}return h.filter(({time:P})=>{let $=P.getTime()/1e3;return $>=s&&$<=a}).sort((P,$)=>P.time.getTime()-$.time.getTime())};flushCache=()=>{let e=new Date().getTime()/1e3;(!this._candleCacheCreatedAt||e-this._candleCacheCreatedAt>600)&&(this._candleCacheCreatedAt=e,this._candleCache=new Map)};getWebsocketCandles=async(e,n)=>await new Promise(a=>{let c=setTimeout(()=>{this.unsubscribeCandles({coinraySymbol:e,resolution:n},u),a([])},0);const u=({previousCandles:l})=>{clearTimeout(c),this.unsubscribeCandles({coinraySymbol:e,resolution:n},u),a(l)};this.subscribeCandles({coinraySymbol:e,resolution:n},u)});getOpenCandles=async(e,n)=>{const s=this.candleCacheKey({prefix:"O",...n.params});let a=this._candleCache.get(s);if(!e&&a)return a;const c=await this.getWebsocketCandles(n.params.symbol,n.params.resolution),u=ut.keyBy(c,({time:h})=>h.getTime());let{result:l}=await this.get("candles/open",n);if(l.candles){let m=l.candles.map(xe._parseCandle).map(b=>{const T=u[b.time.getTime()];return T?xe._mergeCandle(b,T):b});return this._candleCache.set(s,m),m}else return[]};getHistoryCandles=async e=>{const n=this.candleCacheKey(e.params);let s=this._candleCache.get(n);if(s)return s;{if(e.params.year<2018)return new Promise(c=>c([]));let{result:a}=await this.get("candles/history",e);if(a.candles){let c=a.candles.map(xe._parseCandle);return this._candleCache.set(n,c),c}else return[]}};candleCacheKey=({symbol:e,resolution:n,year:s,month:a="",day:c="",week:u="",prefix:l="C"})=>`${l}/${e}/${n}/${s}/${a}/${c}/${u}`;fetchExchanges=async(e,n)=>{let s=n;return s||({result:{exchanges:s}}=await this.get("exchanges",{version:"v1"})),s.map(e)};fetchMarkets=async(e,n)=>{let s=n;return s||({result:{markets:s}}=await this.get("markets",{version:"v1",params:{exchange:e.code}})),s};createCredential=async(e,n)=>{const s=await this.publicKey();try{const a=await Qo(await Jo({password:n}),s),{result:c}=await this.post("credentials",{secret:n,body:{deviceId:e,encryptedPassword:a}});return c}catch(a){throw a}};wrapApiKey=async(e,n)=>{const s=await this.publicKey();let a;try{if(n)a=e;else{const u=JSON.stringify(e);a=await Qo(await Jo({apiKey:u}),s)}const{result:c}=await this.post("credentials/wrap_api_key",{secret:this._sessionKey,body:{encryptedApiKey:a,credential:this._credential}});return c}catch(c){throw c}};testAccount=async e=>{try{const{result:n}=await this.post("account/test",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};createSmartOrderSignature=async e=>{try{const{result:n}=await this.post("order/smart_order_signature",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{smartOrder:e,credential:this._credential}});return n}catch(n){throw n}};createOrder=async e=>{try{const{result:n}=await this.post("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};updateOrder=async e=>{try{const{result:n}=await this.patch("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return n}catch(n){throw n}};cancelOrder=async e=>{try{const{result:n}=await this.delete("order",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,orderId:e.orderId.toString(),credential:this._credential}});return n}catch(n){throw n}};createWebSocketToken=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:s}=await this.post("exchanges/ws_token",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{encryptedApiKey:n,exchangeCode:e,credential:this._credential}});return s}catch(s){throw s}};fetchPositions=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:s}=await this.get("futures/positions",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:e,encryptedApiKey:n}});return s}catch(s){throw s}};getBalances=async({exchangeCode:e,encryptedApiKey:n})=>{try{const{result:{balances:s,positions:a}}=await this.get("account/balances",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:e,encryptedApiKey:n}});return{balances:s.map(xe._parseBalance),positions:a}}catch(s){throw s}};setLeverage=async({coinraySymbol:e,leverage:n,encryptedApiKey:s})=>{try{const{result:a}=await this.post("futures/leverage",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,leverage:n,encryptedApiKey:s}});return a}catch(a){throw a}};setMarginType=async({coinraySymbol:e,marginType:n,encryptedApiKey:s})=>{try{const{result:a}=await this.post("futures/margin_type",{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,marginType:n,encryptedApiKey:s}});return a}catch(a){throw a}};async getProxyList({exchangeCode:e,credentialVersion:n}){let s="";e&&(s+=`?exchange=${e.toUpperCase()}`,s+=n?`&version=${n}`:"");const{result:{proxies:a}}=await this.get("credentials/ips"+s);return a}async publicKey(){if(!this._publicKey){const{result:{jwk:e}}=await this.get("credentials/certificate");this._publicKey=await Yf(e)}return this._publicKey}get clientId(){return Hf(this._token).header.kid}get socket(){if(!this._token)throw new Error("Token not present");return this._socket||(this._socket=new cg(this.config.websocketEndpoint,{heartbeatIntervalMs:5e3,transport:this._transport,reconnectAfterMs:()=>zs(this._token)?3e4:1e3}),this.onOpen(this.resubscribe)),this._socket.params=()=>({reconnect:!0,token:this._token,client:"coinrayjs",version:Jf}),this._socket}getChannel(e){if(this.connect(),this._channels[e])return this._channels[e];const n=this.socket.channel(e,{});return this._channels[e]=n,n.join(),n}get=async(e,{apiEndpoint:n=void 0,version:s="v2",headers:a={},params:c={},secret:u=""}={})=>await this._request(e,"GET",{version:s,apiEndpoint:n,headers:a,secret:u,params:c});post=async(e,n)=>await this._request(e,"POST",n);patch=async(e,n)=>await this._request(e,"PATCH",n);delete=async(e,n)=>await this._request(e,"delete",n);async _request(e,n,{apiEndpoint:s,version:a="v2",headers:c={},params:u={},body:l={},secret:h=""}){const m=await this.getToken(),b=Object.entries(u).length>0?"?"+Object.entries(u).map(([O,I])=>I?`${O}=${I}`:void 0).filter(Boolean).join("&"):"",T=this.getNonce(),P=`/api/${a}/${e}${b}`;if(a==="v2"&&!e.startsWith("candles")){const O=[T,n.toUpperCase(),P,n==="GET"?"":JSON.stringify(l)].join(""),I=h!=""?await jo(O,h):"";c={...c,"Cr-Access-Token":`${m}`,"Cr-Nonce":T,"Cr-Signature":I}}const $={method:n,url:(s||this.config.apiEndpoint)+P,timeout:2e4,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${m}`,"Cr-Client-version":Jf,...c},data:n==="GET"?void 0:JSON.stringify(l)};try{const O=await Qe($);let I;O.status===200?I=O.data:O.status===204?I={}:I=O.data;const F=Object.fromEntries(Object.entries(O.headers).map(([ne,Y])=>[ne,Array.isArray(Y)?Y.join(", "):String(Y)]));return{result:I,_headers:F}}catch(O){const{response:I}=O;if(I){const{error:F}=I.data;throw new a1(F)}else throw O}}static _parseOrderBookSnapshot({asks:e,bids:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(e),bids:xe._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:e,bids_diff:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:xe._parseBidAsk(e),bids:xe._parseBidAsk(n)}}static _updateOrderBook(e,{asks:n,bids:s,min_seq:a,max_seq:c}){const u=(l,h)=>{ut.forEach(h,(m,b)=>{m>0?l[b]=m:delete l[b]})};return e.minSeq=a,e.maxSeq=c,u(e.bids,s),u(e.asks,n),e}static _parseBidAsk(e){return Array.isArray(e)?e.reduce((n,[s,a])=>(n[s]=parseFloat(a),n),{}):Object.keys(e).reduce((n,s)=>(n[s]=parseFloat(e[s]),n),{})}static _parseCandle(e){if(e){const[n,s,a,c,u,l,h]=e;return{time:ru(n),open:parseFloat(s),high:parseFloat(a),low:parseFloat(c),close:parseFloat(u),baseVolume:parseFloat(l),quoteVolume:parseFloat(h),numTrades:0}}else throw new Error("Candle")}static _parseTrade([e,n,s,a,c]){return{id:e,time:ru(n),price:parseFloat(s),quantity:parseFloat(a),type:["1","buy"].includes(c.toString())?"buy":"sell"}}static _parseTicker(e){return{askPrice:X(e.a),baseVolume:X(e.bv),bidPrice:X(e.b),btcVolume:X(e.B),coinraySymbol:e.s,highPrice1s:X(e.h),highPrice24h:X(e.H),lastPrice:X(e.c),lowPrice1s:X(e.l),lowPrice24h:X(e.L),openPrice1s:X(e.o),openPrice24h:X(e.O),quoteVolume:X(e.qv),usdVolume:X(e.U)}}static _parseBalance(e){let n={currency:e.currency,available:X(e.available),inOrders:X(e.inOrders),total:X(e.inOrders)};return e.initialMargin&&(n={...n,initialMargin:X(e.initialMargin),openOrderInitialMargin:X(e.openOrderInitialMargin),positionInitialMargin:X(e.positionInitialMargin),unrealizedProfit:X(e.unrealizedProfit),crossWalletBalance:X(e.crossWalletBalance),crossUnrealizedProfit:X(e.crossUnrealizedProfit)}),n}static _tradesToLastCandle(e,n){n.length>0&&n[0].time>n[n.length-1].time&&(n=n.reverse());const s=xe._resolutionToSeconds(e),a=ut.groupBy(n.reverse(),({time:c})=>Math.floor(c.getTime()/s)*s);return ut.sortBy(Object.keys(a),c=>parseInt(c)).reduce((c,u)=>{const l=a[u],h=l[0].time.getTime(),m=new Date(h-h%s);if(l.length===0)return c;let b=l[0],T,P,$,O,I=0,F=0;return c.length===0?T=P=$=O=b.price:T=P=$=O=c[c.length-1].close,l.reverse().map(({price:ne,quantity:Y})=>{P=Math.min(P,ne),$=Math.max($,ne),O=ne,I+=Y,F+=Y*ne}),c.push({time:new Date(m),open:T,high:$,low:P,close:O,baseVolume:I,quoteVolume:F,numTrades:l.length}),c},[])}static _mergeCandle(e,n){return!e||e.time<n.time?n:(e.numTrades+=n.numTrades,e.high=Math.max(e.high,n.high),e.low=Math.min(e.low,n.low),e.close=n.close,e.skipVolume?e.skipVolume=!1:(e.baseVolume+=n.baseVolume,e.quoteVolume+=n.quoteVolume),e)}static _resolutionToSeconds(e){return e.indexOf("W")>0||e.indexOf("D")>0?parseInt(e)*24*60*60*1e3:e.indexOf("S")>0?parseInt(e)*1e3:e==="D"?864e5:parseInt(e)*60*1e3}}class iu{listeners;constructor(){this.listeners={}}removeAllListeners(){this.listeners={}}on=(e,n)=>(e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(n),n);off=(e,n)=>{e in this.listeners&&(n?this.listeners[e]=this.listeners[e].filter(s=>s!==n):this.listeners[e]=[])};hasListeners=e=>this.listeners[e]&&this.listeners[e].length>0;dispatchEvent=(e,n={})=>{const s=this.listeners[e];s&&s.length>0&&s.map(a=>a({eventName:e,data:n}))}}class Ui extends iu{getExchange;api;id;coinraySymbol;symbol;symbolAlt;quoteCurrency;underlyingQuoteCurrency;baseLogoUrl;baseCurrency;exchangeCode;volume;quoteVolume;btcVolume;usdVolume;websocket;openPrice;highPrice;lowPrice;precisionBase;precisionQuote;precisionPrice;minBase;maxBase;maxBaseMarket;minQuote;maxQuote;minTrade;maxTrade;makerFee;takerFee;change;delistedOn;exchangeUrl;baseToUsd;quoteToUsd;status;note;_supportedOrderTypes;_lastPrice;_askPrice;_bidPrice;updatedAt;getPriceOverrides;static Create(e,n,s){return e==null?Xo(e):typeof e!="object"?eu(e,!1):Array.isArray(e)&&tu(e,!1),xt(e.id,!1,"id"),Ge(e.coinraySymbol,!1,"coinraySymbol"),Ge(e.symbol,!1,"symbol"),Ge(e.symbolAlt,!1,"symbolAlt"),Ge(e.quoteCurrency,!1,"quoteCurrency"),Ge(e.underlyingQuoteCurrency,!1,"underlyingQuoteCurrency"),Ge(e.baseLogoUrl,!0,"baseLogoUrl"),Ge(e.baseCurrency,!1,"baseCurrency"),Ge(e.exchangeCode,!1,"exchangeCode"),Ge(e.status||"",!1,"status"),Ge(e.note||"",!1,"note"),ct(e.volume,!0,"volume"),ct(e.quoteVolume,!0,"quoteVolume"),ct(e.btcVolume,!0,"btcVolume"),ct(e.usdVolume,!0,"usdVolume"),Tn(e.websocket,!1,"websocket"),ct(e.openPrice,!0,"openPrice"),ct(e.highPrice,!0,"highPrice"),ct(e.lowPrice,!0,"lowPrice"),xt(e.precisionBase,!1,"precisionBase"),xt(e.precisionPrice,!1,"precisionPrice"),xt(e.precisionBase,!1,"precisionBase"),xt(e.minBase,!0,"minBase"),xt(e.precisionQuote,!1,"precisionQuote"),xt(e.minQuote,!0,"minQuote"),ct(e.maxBase,!0,"maxBase"),ct(e.maxBaseMarket,!0,"maxBaseMarket"),ct(e.maxQuote,!0,"maxQuote"),ct(e.minTrade,!1,"minTrade"),xt(e.maxTrade,!0,"maxTrade"),e.maxTrade===void 0&&(e.maxTrade=null),xt(e.makerFee,!1,"makerFee"),xt(e.takerFee,!1,"takerFee"),xt(e.change,!1,"change"),Kf(e.delistedOn,"delistedOn"),e.delistedOn===void 0&&(e.delistedOn=null),Ge(e.exchangeUrl,!1,"exchangeUrl"),ct(e.lastPrice,!0,"lastPrice"),ct(e.baseToUsd,!1,"baseToUsd"),ct(e.quoteToUsd,!1,"quoteToUsd"),ct(e.askPrice,!0,"askPrice"),ct(e.bidPrice,!0,"bidPrice"),Ge(e.updatedAt,!1,"updatedAt"),new Ui(e,n,s)}constructor(e,n,s){super(),this.getExchange=()=>s,this.api=n,this.id=e.id,this.coinraySymbol=e.coinraySymbol,this.symbol=e.symbol,this.symbolAlt=e.symbolAlt,this.quoteCurrency=e.quoteCurrency.toUpperCase(),this.underlyingQuoteCurrency=e.underlyingQuoteCurrency.toUpperCase(),this.baseLogoUrl=e.baseLogoUrl,this.baseCurrency=e.baseCurrency.toUpperCase(),this.exchangeCode=e.exchangeCode,this.status=e.status,this.note=e.note,this.volume=X(e.volume),this.quoteVolume=X(e.quoteVolume),this.btcVolume=X(e.btcVolume),this.usdVolume=X(e.usdVolume),this.websocket=e.websocket,this.openPrice=X(e.openPrice),this.highPrice=X(e.highPrice),this.lowPrice=X(e.lowPrice),this.precisionBase=e.precisionBase,this.precisionPrice=e.precisionPrice,this.precisionQuote=e.precisionQuote,this.minQuote=e.minQuote,this.precisionBase=e.precisionBase,this.minBase=e.minBase,this.maxBase=X(e.maxBase),this.maxBaseMarket=X(e.maxBaseMarket).isZero()?this.maxBase:X(e.maxBaseMarket),this.maxQuote=X(e.maxQuote),this.minTrade=X(e.minTrade),this.maxTrade=X(e.maxTrade),this.makerFee=Ni(e.makerFee),this.takerFee=Ni(e.takerFee),this.change=Ni(e.change),this.delistedOn=e.delistedOn,this.exchangeUrl=e.exchangeUrl,this._lastPrice=X(e.lastPrice),this.baseToUsd=X(e.baseToUsd),this.quoteToUsd=X(e.quoteToUsd),this._askPrice=X(e.askPrice),this._bidPrice=X(e.bidPrice),this._supportedOrderTypes=e.supportedOrderTypes,this.updatedAt=e.updatedAt}get tradingDisabled(){return this.status==="INACTIVE"}get tradingEnabled(){return!this.tradingDisabled}get quoteLogoUrl(){return`https://api.coinray.eu/api/v2/explorer/currencies/${this.quoteCurrency}/thumb`}get supportedOrderTypes(){return this._supportedOrderTypes.length>0?this._supportedOrderTypes:this.getExchange().supportedOrderTypes}get isFutures(){return this.getExchange().isFutures}get fullDisplayName(){return[this.exchangeCode,this.displayName].join(": ")}get displayName(){return[this.baseCurrency,this.quoteCurrency].join("/")}get priceOverrides(){return this.getPriceOverrides?this.getPriceOverrides():{}}get lastPrice(){return this.priceOverrides.lastPrice||this._lastPrice}get askPrice(){return this.priceOverrides.askPrice||this._askPrice}get bidPrice(){return this.priceOverrides.bidPrice||this._bidPrice}overridePrices=e=>{this.getPriceOverrides=e};updateLastPrice=e=>{this._lastPrice=e,this.change=this.openPrice.isZero()?0:this.lastPrice.minus(this.openPrice).dividedBy(this.openPrice).multipliedBy(100).toNumber(),this.dispatchEvent("price")};updateBidAsk=(e,n)=>{this._bidPrice=e,this._askPrice=n,this.dispatchEvent("bidask")};updateTicker=e=>{this.openPrice=e.openPrice24h,this.highPrice=e.highPrice24h,this.lowPrice=e.lowPrice24h,this.updateBidAsk(e.bidPrice,e.askPrice),this.updateLastPrice(e.lastPrice),this.dispatchEvent("ticker")};clone(){const e={...this,volume:this.volume,quoteVolume:this.quoteVolume,btcVolume:this.btcVolume,usdVolume:this.usdVolume,openPrice:this.openPrice,highPrice:this.highPrice,lowPrice:this.lowPrice,lastPrice:this._lastPrice,askPrice:this._askPrice,bidPrice:this._bidPrice,maxBase:this.maxBase,maxBaseMarket:this.maxBaseMarket,maxQuote:this.maxQuote,minTrade:this.minTrade,maxTrade:this.maxTrade,baseToUsd:this.baseToUsd,quoteToUsd:this.quoteToUsd},n=new Ui(e,this.api,this.getExchange());return n.getPriceOverrides=this.getPriceOverrides,n.listeners=this.listeners,n}}class Bi{api;id;name;code;websocket;active;aliasedTo;tradingEnabled;tradingEnabledFrom;isFutures;isDex;logo;btcVolume;usdVolume;totalMarkets;quoteCurrencies;supportedFeatures;supportedResolutions;supportedOrderTypes;baseCurrencyDominance;apiKeySettings;apiEndpoint;websocketEndpoint;markets;exchangeSymbols;static Create(e,n){if(e==null?Xo(e):typeof e!="object"?eu(e,!1):Array.isArray(e)&&tu(e,!1),xt(e.id,!1,"id"),Ge(e.name,!1,"name"),Ge(e.code,!1,"code"),Tn(e.websocket,!1,"websocket"),Tn(e.active,!1,"active"),Tn(e.tradingEnabled,!1,"tradingEnabled"),Ge(e.tradingEnabledFrom,!1,"tradingEnabledFrom"),Tn(e.isFutures,!0,"isFutures"),Tn(e.isDex,!0,"isDex"),Ge(e.logo,!1,"logo"),Ge(e.btcVolume,!1,"btcVolume"),Ge(e.usdVolume,!1,"usdVolume"),xt(e.totalMarkets,!1,"totalMarkets"),js(e.quoteCurrencies,"quoteCurrencies"),Ge(e.apiEndpoint,!0,"apiEndpoint"),Ge(e.websocketEndpoint,!0,"websocketEndpoint"),Ge(e.aliasedTo,!0,"aliasedTo"),e.quoteCurrencies)for(let s=0;s<e.quoteCurrencies.length;s++)Ge(e.quoteCurrencies[s],!1,"quoteCurrencies["+s+"]");if(e.quoteCurrencies===void 0&&(e.quoteCurrencies=null),js(e.supportedResolutions,"supportedResolutions"),js(e.supportedFeatures,"supportedFeatures"),e.supportedResolutions)for(let s=0;s<e.supportedResolutions.length;s++)Ge(e.supportedResolutions[s],!1,"supportedResolutions["+s+"]");return e.supportedResolutions===void 0&&(e.supportedResolutions=null),new Bi(e,n)}constructor(e,n){this.api=n,this.id=e.id,this.name=e.name,this.code=e.code,this.websocket=e.websocket,this.isFutures=!!e.isFutures,this.isDex=!!e.isDex,this.active=e.active,this.tradingEnabled=e.tradingEnabled,this.tradingEnabledFrom=e.tradingEnabledFrom,this.logo=e.logo,this.btcVolume=X(e.btcVolume),this.usdVolume=X(e.usdVolume),this.totalMarkets=jn(e.totalMarkets),this.quoteCurrencies=e.quoteCurrencies,this.supportedResolutions=e.supportedResolutions,this.supportedFeatures=e.supportedFeatures,this.supportedOrderTypes=e.supportedOrderTypes,this.baseCurrencyDominance=e.baseCurrencyDominance,this.apiKeySettings=e.apiKeySettings,this.markets={},this.exchangeSymbols={},this.apiEndpoint=e.apiEndpoint||n.config.apiEndpoint,this.websocketEndpoint=e.websocketEndpoint||n.config.websocketEndpoint,this.aliasedTo=e.aliasedTo}clone(){return new Bi({api:this.api,id:this.id,name:this.name,code:this.code,websocket:this.websocket,isFutures:this.isFutures,isDex:this.isDex,logo:this.logo,btcVolume:this.btcVolume,usdVolume:this.usdVolume,totalMarkets:this.totalMarkets,quoteCurrencies:this.quoteCurrencies,supportedResolutions:this.supportedResolutions,supportedFeatures:this.supportedFeatures,baseCurrencyDominance:this.baseCurrencyDominance,apiKeySettings:this.apiKeySettings,aliasedTo:this.aliasedTo},this.api)}async loadMarkets(e=void 0){const n=await this.api.fetchMarkets(this,e),s=n.map(a=>{try{return Ui.Create(a,this.api,this)}catch{return new Ui(a,this.api,this)}});return s.length>0&&(this.markets=ut.keyBy(s,"coinraySymbol"),this.exchangeSymbols=ut.keyBy(s,"symbol")),n}getBaseCurrencyDominance(e){return this.baseCurrencyDominance[e]}getMarketByExchangeSymbol(e){return this.exchangeSymbols[e]}getCurrencyPrice(e,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return X(e).dividedBy(a.baseToUsd);if(a.quoteCurrency===n)return X(e).dividedBy(a.quoteToUsd)}return new Ze(0)}getUsdPrice(e,n){for(let[s,a]of Object.entries(this.markets)){if(a.baseCurrency===n)return a.baseToUsd.multipliedBy(e);if(a.quoteCurrency===n)return a.quoteToUsd.multipliedBy(e)}return new Ze(0)}getMarket(e){return this.markets[e]}}class o1{subscriptions;pendingAdditions;pendingRemovals;constructor(){this.subscriptions=new Map,this.pendingAdditions=new Map,this.pendingRemovals=new Map}has(e){const n=this.subscriptions.get(e);return n!==void 0&&n.size>0}subscribe(e,n,s=!1){s&&this.unsubscribeAll(e);for(let a of n)this.pendingAdditions.has(a)||this.pendingAdditions.set(a,new Set),this.pendingAdditions.get(a).add(e),this.pendingRemovals.has(a)&&(this.pendingRemovals.get(a).delete(e),this.pendingRemovals.get(a).size===0&&this.pendingRemovals.delete(a))}unsubscribe(e,n){for(let s of n)this.pendingAdditions.has(s)&&(this.pendingAdditions.get(s).delete(e),this.pendingAdditions.get(s).size===0&&this.pendingAdditions.delete(s)),this.pendingRemovals.has(s)||this.pendingRemovals.set(s,new Set),this.pendingRemovals.get(s).add(e)}unsubscribeAll(e){for(let[n,s]of this.subscriptions)s.has(e)&&(this.pendingRemovals.has(n)||this.pendingRemovals.set(n,new Set),this.pendingRemovals.get(n).add(e));this.pendingAdditions.clear()}processPendingChanges(){for(let[e,n]of this.pendingAdditions){this.subscriptions.has(e)||this.subscriptions.set(e,new Set);const s=this.subscriptions.get(e);for(let a of n)s.add(a)}for(let[e,n]of this.pendingRemovals){if(!this.subscriptions.has(e))continue;const s=this.subscriptions.get(e);for(let a of n)s.delete(a);s.size===0&&this.subscriptions.delete(e)}this.pendingAdditions.clear(),this.pendingRemovals.clear()}}class u1 extends iu{rootApi;apis;exchanges;initialized;refreshRate;refreshTimeout;_refreshingToken;tickerSubscriptions;tickerSubscriptionRefeshTimer;_onTokenExpired;onStoreCache;apiCache;constructor(e,n,s=3e4,a=void 0){super(),this.rootApi=new xe(e,n),this.apis=new Map,this.exchanges={},this.initialized=!1,this.refreshRate=s,this.tickerSubscriptions=new o1,this.tickerSubscriptionRefeshTimer=null,this.rootApi.onTokenExpired(this.refreshToken),this.onStoreCache=a?.onStoreCache,this.apiCache=a?.apiCache}async initialize(){this.initialized||(await this.start(),this.initialized=!0)}getRootApi(){return this.rootApi}authenticateDevice(e,n){this.rootApi.authenticateDevice(e,n)}refreshToken=async()=>{if(this._onTokenExpired){if(this._refreshingToken)return await this._refreshingToken;{this._refreshingToken=this._onTokenExpired();let e=await this._refreshingToken;this._refreshingToken=void 0;for(const n of this.apis.values())n.refreshToken(e);return e}}};onTokenExpired(e){this._onTokenExpired=e}async start(){this.refreshTimeout&&clearTimeout(this.refreshTimeout);try{this.apiCache?(await this.refreshExchanges(this.apiCache),this.refreshExchanges()):await this.refreshExchanges()}catch(e){console.error(e)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)}refreshExchangeInterval=async()=>{try{await this.refreshExchanges()}catch(e){console.error(e)}this.refreshTimeout=setTimeout(this.refreshExchangeInterval,this.refreshRate)};destroy(){for(const e of this.apis.values())try{e.destroy()}catch(n){console.error("Could not destroy coinray",n)}this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.initialized=!1}refreshExchanges=async(e=void 0)=>{const n={exchanges:[],markets:{}},s=await this.rootApi.fetchExchanges(c=>(n.exchanges.push(c),this.apis.has(c.code)||this.apis.set(c.code,this.rootApi),Bi.Create(c,this.apis.get(c.code))),e?.exchanges),a=await Promise.all(s.map(async c=>({[c.code]:await c.loadMarkets(e?.markets?.[c.code])})));n.markets=a.reduce((c,u)=>({...c,[Object.keys(u)[0]]:Object.values(u)[0]}),[]),this.exchanges=s.reduce((c,u)=>(c[u.code]=u,c),{}),this.dispatchEvent("marketsUpdated"),!e&&this.onStoreCache&&this.onStoreCache(n)};getProxyList=async(e={})=>await this.rootApi.getProxyList(e);getExchanges(){if(!this.initialized)throw"The cache is not initialized yet";return this.exchanges}getExchange(e){return this.getExchanges()[e]||Bi.Create({id:-1,name:e,code:e,websocket:!1,active:!1,tradingEnabled:!1,tradingEnabledFrom:"",isFutures:!1,isDex:!1,logo:`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
44
+ `,btcVolume:"0",usdVolume:"0",totalMarkets:0,quoteCurrencies:[]},this.rootApi)}refreshMarkets=async e=>{await this.exchanges[e].loadMarkets()};searchMarkets(e){return Object.values(this.exchanges).reduce((n,s)=>(n={...n,...jf(s.markets,e)},n),{})}getMarkets(e){switch(typeof e){case"string":return this.getExchange(e).markets;default:return e.reduce((n,s)=>{const a=this.getMarket(s);return a&&(n[s]=a),n},{})}}getMarket=e=>{const n=`${e}`.split("_");if(n.length<3)return;const s=this.getExchange(n[0]);if(s)return s.getMarket(e)};async fetchCandles({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c}){return this.apiForSymbol(e).fetchCandles({coinraySymbol:e,resolution:n,start:s,end:a,useWebSocket:c})}async fetchFirstCandleTime({coinraySymbol:e,resolution:n}){return this.apiForSymbol(e).fetchFirstCandleTime({coinraySymbol:e,resolution:n})}subscribeTickers(e,n,s=!1){this.tickerSubscriptions.subscribe(e,n,s),this.scheduleTickerRefresh()}scheduleTickerRefresh(){this.tickerSubscriptionRefeshTimer&&clearTimeout(this.tickerSubscriptionRefeshTimer),this.tickerSubscriptionRefeshTimer=setTimeout(async()=>{await this.flushTickerSubscriptions(),this.tickerSubscriptionRefeshTimer=null},1e3)}unsubscribeAllTickers(e){this.tickerSubscriptions.unsubscribeAll(e),this.scheduleTickerRefresh()}unsubscribeTickers(e,n){this.tickerSubscriptions.unsubscribe(e,n),this.scheduleTickerRefresh()}async flushTickerSubscriptions(){const e=[],n=[];for(const s of this.tickerSubscriptions.pendingAdditions.keys())e.push(s);for(const[s,a]of this.tickerSubscriptions.pendingRemovals.entries()){const c=new Set(this.tickerSubscriptions.subscriptions.get(s)||[]);for(const l of a)c.delete(l);const u=this.tickerSubscriptions.pendingAdditions.get(s);if(u)for(const l of u)c.add(l);c.size===0&&n.push(s)}e.length&&await this.rootApi.subscribeTickers(e,!1,this.refreshMarketsFromTickers),n.length&&this.rootApi.unsubscribeTickers(n,this.refreshMarketsFromTickers),this.tickerSubscriptions.processPendingChanges()}refreshMarketsFromTickers=async e=>{const{exchangeCode:n,tickers:s}=e,a=this.getExchange(n);if(a){let c=!1;for(const u of s)if(this.tickerSubscriptions.has(u.coinraySymbol)){const l=a.getMarket(u.coinraySymbol);l&&(l.updateTicker(u),c=!0)}c&&this.dispatchEvent("tickersUpdated",{exchangeCode:n,coinraySymbols:s.map(u=>u.coinraySymbol)})}};async subscribeCandles({coinraySymbol:e,resolution:n,lastCandle:s},a){return this.apiForSymbol(e).subscribeCandles({coinraySymbol:e,resolution:n,lastCandle:s},a)}async unsubscribeCandles({coinraySymbol:e,resolution:n},s){await this.apiForSymbol(e).unsubscribeCandles({coinraySymbol:e,resolution:n},s)}async subscribeOrderBook({coinraySymbol:e},n){await this.apiForSymbol(e).subscribeOrderBook({coinraySymbol:e},n)}async unsubscribeOrderBook({coinraySymbol:e},n){await this.apiForSymbol(e).unsubscribeOrderBook({coinraySymbol:e},n)}async subscribeTrades({coinraySymbol:e},n){await this.apiForSymbol(e).subscribeTrades({coinraySymbol:e},n)}async unsubscribeTrades({coinraySymbol:e},n){await this.apiForSymbol(e).unsubscribeTrades({coinraySymbol:e},n)}apiForSymbol(e){const n=`${e}`.split("_");if(n.length<3)return;const s=n[0];return this.apis.get(s)}}class c1 extends Error{constructor(e){super(e),this.name="MarketNotFoundError"}}const Qf=30*1e3;class l1 extends iu{coinrayCache;getPriceOverrides;coinraySymbol;orderBook;trades;tradesDelayed;maxTrades;prevTickers={lastPrice:new Ze(0),askPrice:new Ze(0),bidPrice:new Ze(0)};constructor(e,n={}){super(),this.coinrayCache=e,this.maxTrades=n.maxTrades||100,n.getPriceOverrides&&(this.getPriceOverrides=n.getPriceOverrides),this.destroy()}setCoinraySymbol(e){this.dispatchEvent("coinraySymbolWillChange",{coinraySymbol:e}),this.stop(),this.coinraySymbol=e,this.startOrderBook(),this.startTrades(),this.dispatchEvent("coinraySymbolChanged",{coinraySymbol:e})}destroy(){this.coinraySymbol=null,this.removeAllListeners(),this.stop()}stop(){this.stopOrderBook(),this.stopTrades()}getExchange(){return this.coinrayCache.getExchange(this.getMarket().exchangeCode)}getMarket(){if(this.coinraySymbol){const e=this.coinrayCache.getMarket(this.coinraySymbol);return e.overridePrices(this.getPriceOverrides),e}else throw new c1(`Market not found: ${this.coinraySymbol}`)}subscribeCoinraySymbolWillChange(e){return this.on("coinraySymbolWillChange",e)}unsubscribeCoinraySymbolWillChange(e){this.off("coinraySymbolWillChange",e)}subscribeCoinraySymbolChange(e){return this.on("coinraySymbolChanged",e)}unsubscribeCoinraySymbolChange(e){this.off("coinraySymbolChanged",e)}subscribeMarketUpdates=e=>(this.on("marketUpdated",e),this.subscribeOrderBook(this.handleMarketUpdate),this.subscribeTrades(this.handleMarketUpdate),e);updatePrevTicker=({lastPrice:e,bidPrice:n,askPrice:s})=>{e&&(this.prevTickers.lastPrice=X(e)),s&&(this.prevTickers.askPrice=X(s)),n&&(this.prevTickers.bidPrice=X(n))};handleMarketUpdate=({data:{type:e,coinraySymbol:n,...s}})=>{if(this.coinraySymbol!==n){this.unsubscribeOrderBook(this.handleOrderBook),this.unsubscribeTrades(this.handleOrderBook);return}switch(e){case"trades:snapshot":case"trades:update":{const{trades:a}=s;if(a.length===0)break;const c=this.getMarket(),u=X(a[0].price);(!c._lastPrice.eq(u)||!this.prevTickers.lastPrice.eq(u))&&(c.updateLastPrice(u),this.updatePrevTicker({lastPrice:u}),this.dispatchEvent("marketUpdated",{market:c}));break}case"orderBook:snapshot":case"orderBook:update":{const{orderBook:{bids:a,asks:c}}=s,u=this.getMarket();if(a.length===0||c.length===0)break;const l=c[0].price,h=a[0].price,m=!u._askPrice.eq(l)||!u._bidPrice.eq(h),b=!this.prevTickers.askPrice.eq(l)||!this.prevTickers.bidPrice.eq(h);(m||b)&&(u.updateBidAsk(h,l),this.updatePrevTicker({askPrice:l,bidPrice:h}),this.dispatchEvent("marketUpdated",{market:u}));break}}};unsubscribeMarketUpdates=e=>{this.off("marketUpdated",e),this.hasListeners("marketUpdated")||(this.unsubscribeOrderBook(this.handleMarketUpdate),this.unsubscribeTrades(this.handleMarketUpdate))};subscribeOrderBook=e=>(this.on("orderBookUpdated",e),this.startOrderBook(),e);startOrderBook=()=>{this.coinraySymbol&&this.hasListeners("orderBookUpdated")&&this.coinrayCache.subscribeOrderBook({coinraySymbol:this.coinraySymbol},this.handleOrderBook)};stopOrderBook=()=>{this.coinraySymbol&&this.coinrayCache.unsubscribeOrderBook({coinraySymbol:this.coinraySymbol},this.handleOrderBook),this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}}};handleOrderBook=async({type:e,coinraySymbol:n,orderBook:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeOrderBook({coinraySymbol:n},this.handleOrderBook);return}e==="orderBook:snapshot"&&(this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}});const{minSeq:a,maxSeq:c,bids:u,asks:l}=s,h=(m,b)=>{ut.forEach(b,(T,P)=>{T>0?m[P]={price:new Ze(P),quantity:T}:delete m[P]})};if(a-this.orderBook.maxSeq>1){this.stopOrderBook(),this.startOrderBook();return}this.orderBook.minSeq=a,this.orderBook.maxSeq=c,h(this.orderBook.bids,u),h(this.orderBook.asks,l),this.dispatchEvent("orderBookUpdated",{type:e,coinraySymbol:n,orderBook:{minSeq:a,maxSeq:c,bids:Object.values(this.orderBook.bids).sort(({price:m},{price:b})=>b.minus(m)),asks:Object.values(this.orderBook.asks).sort(({price:m},{price:b})=>m.minus(b))}})};unsubscribeOrderBook=e=>{this.off("orderBookUpdated",e),this.hasListeners("orderBookUpdated")||this.stopOrderBook()};subscribeTrades=e=>(this.on("tradesUpdated",e),this.startTrades(),e);startTrades=()=>{this.coinraySymbol&&this.hasListeners("tradesUpdated")&&this.coinrayCache.subscribeTrades({coinraySymbol:this.coinraySymbol},this.handleTrades)};stopTrades=()=>{this.coinraySymbol&&this.coinrayCache.unsubscribeTrades({coinraySymbol:this.coinraySymbol},this.handleTrades),this.trades=[]};handleTrades=({type:e,coinraySymbol:n,trades:s})=>{if(this.coinraySymbol!==n){this.coinrayCache.unsubscribeTrades({coinraySymbol:n},this.handleTrades);return}if(e==="trades:snapshot"&&(this.trades=[]),this.trades=[...s,...this.trades].sort((c,u)=>u.time.getTime()-c.time.getTime()).slice(0,this.maxTrades),this.dispatchEvent("tradesUpdated",{type:e,coinraySymbol:n,trades:this.trades}),!this.trades.length)return;const a=Date.now()-this.trades[0].time.getTime();e==="trades:snapshot"&&this.tradesDelayed?this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):e==="trades:update"&&(this.tradesDelayed&&a<Qf?this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!1,delayInMs:a}):!this.tradesDelayed&&a>=Qf&&this.dispatchTradesDelayed({type:e,coinraySymbol:n,tradesDelayed:!0,delayInMs:a}))};dispatchTradesDelayed=({type:e,coinraySymbol:n,tradesDelayed:s,delayInMs:a})=>{this.tradesDelayed=s,this.dispatchEvent("tradesDelayed",{type:e,coinraySymbol:n,tradesDelayed:s,delayInMs:a})};unsubscribeTrades=e=>{this.off("tradesUpdated",e),this.hasListeners("tradesUpdated")||this.stopTrades()};subscribeTradesDelayed=e=>(this.on("tradesDelayed",e),e);unsubscribeTradesDelayed=e=>{this.off("tradesDelayed",e)}}const f1={"en-US":{validation:{notGreaterThanOrEqualTo:"Can't be less than {{min}}",insufficientFunds:"Insufficient funds"}},nl:{validation:{notGreaterThanOrEqualTo:"Kan niet minder zijn dan {{min}}",insufficientFunds:"Onvoldoende balans"}},ru:{validation:{notGreaterThanOrEqualTo:"Не может быть меньше {{min}}",insufficientFunds:"Недостаточно средств"}}};var Ii={exports:{}};/*!
45
45
  * validate.js 0.13.1
46
46
  *
47
47
  * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
48
48
  * Validate.js may be freely distributed under the MIT license.
49
49
  * For all details and documentation:
50
50
  * http://validatejs.org/
51
- */var h1=Bi.exports,Zf;function d1(){return Zf||(Zf=1,(function(t,e){(function(n,s,a){var c=function(l,h,m){m=u.extend({},u.options,m);var b=u.runValidations(l,h,m);if(b.some(function(T){return u.isPromise(T.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(b,m)},u=c;u.extend=function(l){return[].slice.call(arguments,1).forEach(function(h){for(var m in h)l[m]=h[m]}),l},u.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var l=u.format("%{major}.%{minor}.%{patch}",u.version);return u.isEmpty(u.version.metadata)||(l+="+"+u.version.metadata),l}},Promise:typeof Promise<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(l,h,m){var b=[],T,P,$,O,I,F,ne;(u.isDomElement(l)||u.isJqueryElement(l))&&(l=u.collectFormValues(l));for(T in h){$=u.getDeepObjectValue(l,T),O=u.result(h[T],$,l,T,m,h);for(P in O){if(I=u.validators[P],!I)throw ne=u.format("Unknown validator %{name}",{name:P}),new Error(ne);F=O[P],F=u.result(F,$,l,T,m,h),F&&b.push({attribute:T,value:$,validator:P,globalOptions:m,attributes:l,options:F,error:I.call(I,$,F,T,l,m)})}}return b},processValidationResults:function(l,h){l=u.pruneEmptyErrors(l,h),l=u.expandMultipleErrors(l,h),l=u.convertErrorMessages(l,h);var m=h.format||"grouped";if(typeof u.formatters[m]=="function")l=u.formatters[m](l);else throw new Error(u.format("Unknown format %{format}",h));return u.isEmpty(l)?void 0:l},async:function(l,h,m){m=u.extend({},u.async.options,m);var b=m.wrapErrors||function(P){return P};m.cleanAttributes!==!1&&(l=u.cleanAttributes(l,h));var T=u.runValidations(l,h,m);return new u.Promise(function(P,$){u.waitForResults(T).then(function(){var O=u.processValidationResults(T,m);O?$(new b(O,m,l,h)):P(l)},function(O){$(O)})})},single:function(l,h,m){return m=u.extend({},u.single.options,m,{format:"flat",fullMessages:!1}),u({single:l},{single:h},m)},waitForResults:function(l){return l.reduce(function(h,m){return u.isPromise(m.error)?h.then(function(){return m.error.then(function(b){m.error=b||null})}):h},new u.Promise(function(h){h()}))},result:function(l){var h=[].slice.call(arguments,1);return typeof l=="function"&&(l=l.apply(null,h)),l},isNumber:function(l){return typeof l=="number"&&!isNaN(l)},isFunction:function(l){return typeof l=="function"},isInteger:function(l){return u.isNumber(l)&&l%1===0},isBoolean:function(l){return typeof l=="boolean"},isObject:function(l){return l===Object(l)},isDate:function(l){return l instanceof Date},isDefined:function(l){return l!=null},isPromise:function(l){return!!l&&u.isFunction(l.then)},isJqueryElement:function(l){return l&&u.isString(l.jquery)},isDomElement:function(l){return!l||!l.querySelectorAll||!l.querySelector?!1:u.isObject(document)&&l===document?!0:typeof HTMLElement=="object"?l instanceof HTMLElement:l&&typeof l=="object"&&l!==null&&l.nodeType===1&&typeof l.nodeName=="string"},isEmpty:function(l){var h;if(!u.isDefined(l))return!0;if(u.isFunction(l))return!1;if(u.isString(l))return u.EMPTY_STRING_REGEXP.test(l);if(u.isArray(l))return l.length===0;if(u.isDate(l))return!1;if(u.isObject(l)){for(h in l)return!1;return!0}return!1},format:u.extend(function(l,h){return u.isString(l)?l.replace(u.format.FORMAT_REGEXP,function(m,b,T){return b==="%"?"%{"+T+"}":String(h[T])}):l},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(l){return u.isNumber(l)?l*100%1===0?""+l:parseFloat(Math.round(l*100)/100).toFixed(2):u.isArray(l)?l.map(function(h){return u.prettify(h)}).join(", "):u.isObject(l)?u.isDefined(l.toString)?l.toString():JSON.stringify(l):(l=""+l,l.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,m,b){return""+m+" "+b.toLowerCase()}).toLowerCase())},stringifyValue:function(l,h){var m=h&&h.prettify||u.prettify;return m(l)},isString:function(l){return typeof l=="string"},isArray:function(l){return{}.toString.call(l)==="[object Array]"},isHash:function(l){return u.isObject(l)&&!u.isArray(l)&&!u.isFunction(l)},contains:function(l,h){return u.isDefined(l)?u.isArray(l)?l.indexOf(h)!==-1:h in l:!1},unique:function(l){return u.isArray(l)?l.filter(function(h,m,b){return b.indexOf(h)==m}):l},forEachKeyInKeypath:function(l,h,m){if(u.isString(h)){var b="",T,P=!1;for(T=0;T<h.length;++T)switch(h[T]){case".":P?(P=!1,b+="."):(l=m(l,b,!1),b="");break;case"\\":P?(P=!1,b+="\\"):P=!0;break;default:P=!1,b+=h[T];break}return m(l,b,!0)}},getDeepObjectValue:function(l,h){if(u.isObject(l))return u.forEachKeyInKeypath(l,h,function(m,b){if(u.isObject(m))return m[b]})},collectFormValues:function(l,h){var m={},b,T,P,$,O,I;if(u.isJqueryElement(l)&&(l=l[0]),!l)return m;for(h=h||{},$=l.querySelectorAll("input[name], textarea[name]"),b=0;b<$.length;++b)if(P=$.item(b),!u.isDefined(P.getAttribute("data-ignored"))){var F=P.name.replace(/\./g,"\\\\.");I=u.sanitizeFormValue(P.value,h),P.type==="number"?I=I?+I:null:P.type==="checkbox"?P.attributes.value?P.checked||(I=m[F]||null):I=P.checked:P.type==="radio"&&(P.checked||(I=m[F]||null)),m[F]=I}for($=l.querySelectorAll("select[name]"),b=0;b<$.length;++b)if(P=$.item(b),!u.isDefined(P.getAttribute("data-ignored"))){if(P.multiple){I=[];for(T in P.options)O=P.options[T],O&&O.selected&&I.push(u.sanitizeFormValue(O.value,h))}else{var ne=typeof P.options[P.selectedIndex]<"u"?P.options[P.selectedIndex].value:"";I=u.sanitizeFormValue(ne,h)}m[P.name]=I}return m},sanitizeFormValue:function(l,h){return h.trim&&u.isString(l)&&(l=l.trim()),h.nullify!==!1&&l===""?null:l},capitalize:function(l){return u.isString(l)?l[0].toUpperCase()+l.slice(1):l},pruneEmptyErrors:function(l){return l.filter(function(h){return!u.isEmpty(h.error)})},expandMultipleErrors:function(l){var h=[];return l.forEach(function(m){u.isArray(m.error)?m.error.forEach(function(b){h.push(u.extend({},m,{error:b}))}):h.push(m)}),h},convertErrorMessages:function(l,h){h=h||{};var m=[],b=h.prettify||u.prettify;return l.forEach(function(T){var P=u.result(T.error,T.value,T.attribute,T.options,T.attributes,T.globalOptions);if(!u.isString(P)){m.push(T);return}P[0]==="^"?P=P.slice(1):h.fullMessages!==!1&&(P=u.capitalize(b(T.attribute))+" "+P),P=P.replace(/\\\^/g,"^"),P=u.format(P,{value:u.stringifyValue(T.value,h)}),m.push(u.extend({},T,{error:P}))}),m},groupErrorsByAttribute:function(l){var h={};return l.forEach(function(m){var b=h[m.attribute];b?b.push(m):h[m.attribute]=[m]}),h},flattenErrorsToArray:function(l){return l.map(function(h){return h.error}).filter(function(h,m,b){return b.indexOf(h)===m})},cleanAttributes:function(l,h){function m(P,$,O){return u.isObject(P[$])?P[$]:P[$]=O?!0:{}}function b(P){var $={},O;for(O in P)P[O]&&u.forEachKeyInKeypath($,O,m);return $}function T(P,$){if(!u.isObject(P))return P;var O=u.extend({},P),I,F;for(F in P)I=$[F],u.isObject(I)?O[F]=T(O[F],I):I||delete O[F];return O}return!u.isObject(h)||!u.isObject(l)?{}:(h=b(h),T(l,h))},exposeModule:function(l,h,m,b,T){m?(b&&b.exports&&(m=b.exports=l),m.validate=l):(h.validate=l,l.isFunction(T)&&T.amd&&T([],function(){return l}))},warn:function(l){typeof console<"u"&&console.warn&&console.warn("[validate.js] "+l)},error:function(l){typeof console<"u"&&console.error&&console.error("[validate.js] "+l)}}),c.validators={presence:function(l,h){if(h=u.extend({},this.options,h),h.allowEmpty!==!1?!u.isDefined(l):u.isEmpty(l))return h.message||this.message||"can't be blank"},length:function(l,h,m){if(u.isDefined(l)){h=u.extend({},this.options,h);var b=h.is,T=h.maximum,P=h.minimum,$=h.tokenizer||function(ne){return ne},O,I=[];l=$(l);var F=l.length;if(!u.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(u.isNumber(b)&&F!==b&&(O=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",I.push(u.format(O,{count:b}))),u.isNumber(P)&&F<P&&(O=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",I.push(u.format(O,{count:P}))),u.isNumber(T)&&F>T&&(O=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",I.push(u.format(O,{count:T}))),I.length>0)return h.message||I}},numericality:function(l,h,m,b,T){if(u.isDefined(l)){h=u.extend({},this.options,h);var P=[],$,O,I={greaterThan:function(ve,_e){return ve>_e},greaterThanOrEqualTo:function(ve,_e){return ve>=_e},equalTo:function(ve,_e){return ve===_e},lessThan:function(ve,_e){return ve<_e},lessThanOrEqualTo:function(ve,_e){return ve<=_e},divisibleBy:function(ve,_e){return ve%_e===0}},F=h.prettify||T&&T.prettify||u.prettify;if(u.isString(l)&&h.strict){var ne="^-?(0|[1-9]\\d*)";if(h.onlyInteger||(ne+="(\\.\\d+)?"),ne+="$",!new RegExp(ne).test(l))return h.message||h.notValid||this.notValid||this.message||"must be a valid number"}if(h.noStrings!==!0&&u.isString(l)&&!u.isEmpty(l)&&(l=+l),!u.isNumber(l))return h.message||h.notValid||this.notValid||this.message||"is not a number";if(h.onlyInteger&&!u.isInteger(l))return h.message||h.notInteger||this.notInteger||this.message||"must be an integer";for($ in I)if(O=h[$],u.isNumber(O)&&!I[$](l,O)){var Y="not"+u.capitalize($),Ae=h[Y]||this[Y]||this.message||"must be %{type} %{count}";P.push(u.format(Ae,{count:O,type:F($)}))}if(h.odd&&l%2!==1&&P.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&l%2!==0&&P.push(h.notEven||this.notEven||this.message||"must be even"),P.length)return h.message||P}},datetime:u.extend(function(l,h){if(!u.isFunction(this.parse)||!u.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(u.isDefined(l)){h=u.extend({},this.options,h);var m,b=[],T=h.earliest?this.parse(h.earliest,h):NaN,P=h.latest?this.parse(h.latest,h):NaN;if(l=this.parse(l,h),isNaN(l)||h.dateOnly&&l%864e5!==0)return m=h.notValid||h.message||this.notValid||"must be a valid date",u.format(m,{value:arguments[0]});if(!isNaN(T)&&l<T&&(m=h.tooEarly||h.message||this.tooEarly||"must be no earlier than %{date}",m=u.format(m,{value:this.format(l,h),date:this.format(T,h)}),b.push(m)),!isNaN(P)&&l>P&&(m=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",m=u.format(m,{date:this.format(P,h),value:this.format(l,h)}),b.push(m)),b.length)return u.unique(b)}},{parse:null,format:null}),date:function(l,h){return h=u.extend({},h,{dateOnly:!0}),u.validators.datetime.call(u.validators.datetime,l,h)},format:function(l,h){(u.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=u.extend({},this.options,h);var m=h.message||this.message||"is invalid",b=h.pattern,T;if(u.isDefined(l)&&(!u.isString(l)||(u.isString(b)&&(b=new RegExp(h.pattern,h.flags)),T=b.exec(l),!T||T[0].length!=l.length)))return m},inclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is not included in the list";return u.format(m,{value:l})}},exclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is restricted";return u.isString(h.within[l])&&(l=h.within[l]),u.format(m,{value:l})}},email:u.extend(function(l,h){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid email";if(u.isDefined(l)&&(!u.isString(l)||!this.PATTERN.exec(l)))return m},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(l,h,m,b,T){if(u.isDefined(l)){u.isString(h)&&(h={attribute:h}),h=u.extend({},this.options,h);var P=h.message||this.message||"is not equal to %{attribute}";if(u.isEmpty(h.attribute)||!u.isString(h.attribute))throw new Error("The attribute must be a non empty string");var $=u.getDeepObjectValue(b,h.attribute),O=h.comparator||function(F,ne){return F===ne},I=h.prettify||T&&T.prettify||u.prettify;if(!O(l,$,h,m,b))return u.format(P,{attribute:I(h.attribute)})}},url:function(l,h){if(u.isDefined(l)){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid url",b=h.schemes||this.schemes||["http","https"],T=h.allowLocal||this.allowLocal||!1,P=h.allowDataUrl||this.allowDataUrl||!1;if(!u.isString(l))return m;var $="^(?:(?:"+b.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(T?O+="?":$+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",$+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+O+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",P){var I="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",ne="data:(?:"+I+")?(?:;base64)?,"+F;$="(?:"+$+")|(?:^"+ne+"$)"}var Y=new RegExp($,"i");if(!Y.exec(l))return m}},type:u.extend(function(l,h,m,b,T){if(u.isString(h)&&(h={type:h}),!!u.isDefined(l)){var P=u.extend({},this.options,h),$=P.type;if(!u.isDefined($))throw new Error("No type was specified");var O;if(u.isFunction($)?O=$:O=this.types[$],!u.isFunction(O))throw new Error("validate.validators.type.types."+$+" must be a function.");if(!O(l,P,m,b,T)){var I=h.message||this.messages[$]||this.message||P.message||(u.isFunction($)?"must be of the correct type":"must be of type %{type}");return u.isFunction(I)&&(I=I(l,h,m,b,T)),u.format(I,{attribute:u.prettify(m),type:$})}}},{types:{object:function(l){return u.isObject(l)&&!u.isArray(l)},array:u.isArray,integer:u.isInteger,number:u.isNumber,string:u.isString,date:u.isDate,boolean:u.isBoolean},messages:{}})},c.formatters={detailed:function(l){return l},flat:u.flattenErrorsToArray,grouped:function(l){var h;l=u.groupErrorsByAttribute(l);for(h in l)l[h]=u.flattenErrorsToArray(l[h]);return l},constraint:function(l){var h;l=u.groupErrorsByAttribute(l);for(h in l)l[h]=l[h].map(function(m){return m.validator}).sort();return l}},c.exposeModule(c,this,n,s,a)}).call(h1,e,t,null)})(Bi,Bi.exports)),Bi.exports}var p1=d1();const iu=bl(p1);iu.validators.bigNumericality=(t,e,n,s)=>iu.validators.numericality(t&&t.toNumber(),e,s);var rn=(t=>(t.MARKET="MARKET",t.LIMIT="LIMIT",t.LIMIT_LADDER="LIMIT_LADDER",t.STOP_LOSS="STOP_LOSS",t.OCO="OCO",t.STOP_LOSS_LIMIT="STOP_LOSS_LIMIT",t.STOP_LOSS_MARKET="STOP_LOSS_MARKET",t.TAKE_PROFIT="TAKE_PROFIT",t.TAKE_PROFIT_LIMIT="TAKE_PROFIT_LIMIT",t.TAKE_PROFIT_MARKET="TAKE_PROFIT_MARKET",t))(rn||{}),su=(t=>(t.HEDGE_MODE="hedgeMode",t.ORDER_QUOTE_AMOUNT="orderQuoteAmount",t.MARKET_BUY_QUOTE_ONLY="marketBuyQuoteOnly",t.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS="updateLeverageOnlyOnOpenPositions",t.FAST_CONNECT="fastConnect",t.UNIFIED_BALANCE="unifiedBalance",t))(su||{}),au=(t=>(t.NONE="NONE",t.LIST="LIST",t.COMMA="COMMA",t.COMMA_SPACE="COMMA_SPACE",t.SPACE="SPACE",t))(au||{}),ou=(t=>(t.CROSSED="CROSSED",t.ISOLATED="ISOLATED",t))(ou||{}),uu=(t=>(t.OPEN="open",t.CLOSED="closed",t.CANCELED="canceled",t))(uu||{}),_t=(t=>(t.BUY="buy",t.SELL="sell",t))(_t||{}),cu=(t=>(t.GTC="gtc",t.FOK="fok",t.IOC="ioc",t))(cu||{}),vr=(t=>(t.QUOTE="quote",t.BASE="base",t.NONE="none",t))(vr||{});const m1=Object.freeze(Object.defineProperty({__proto__:null,BalanceLimit:vr,ExchangeFeatures:su,IpWhiteList:au,MarginType:ou,OrderSide:_t,OrderStatus:uu,OrderType:rn,TimeInForce:cu},Symbol.toStringTag,{value:"Module"})),lt=[];for(let t=0;t<256;++t)lt.push((t+256).toString(16).slice(1));function g1(t,e=0){return(lt[t[e+0]]+lt[t[e+1]]+lt[t[e+2]]+lt[t[e+3]]+"-"+lt[t[e+4]]+lt[t[e+5]]+"-"+lt[t[e+6]]+lt[t[e+7]]+"-"+lt[t[e+8]]+lt[t[e+9]]+"-"+lt[t[e+10]]+lt[t[e+11]]+lt[t[e+12]]+lt[t[e+13]]+lt[t[e+14]]+lt[t[e+15]]).toLowerCase()}let lu;const y1=new Uint8Array(16);function _1(){if(!lu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");lu=crypto.getRandomValues.bind(crypto)}return lu(y1)}const Xf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function w1(t,e,n){t=t||{};const s=t.random??t.rng?.()??_1();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,g1(s)}function b1(t,e,n){return Xf.randomUUID&&!t?Xf.randomUUID():w1(t)}class fu{id=b1();coinraySymbol;precisionBase;precisionQuote;precisionPrice;minBase;minQuote;makerFee;takerFee;balances;balanceLimit;side;errors;isValid;orderExternalId;reduceOnly;postOnly;timeInForce;constructor(e){this.coinraySymbol=e.coinraySymbol,this.precisionBase=jn(e.precisionBase),this.precisionQuote=jn(e.precisionQuote),this.precisionPrice=jn(e.precisionPrice),this.minBase=X(e.minBase),this.minQuote=X(e.minQuote),this.makerFee=X(e.makerFee),this.takerFee=X(e.takerFee),this.balances=e.balances,this.balanceLimit=e.balanceLimit||vr.NONE,this.side=e.side,this.orderExternalId=e.externalId,this.errors={},this.isValid=!0,this.reduceOnly=e.reduceOnly,this.postOnly=e.postOnly,this.timeInForce=e.timeInForce}startEdit(e){this.orderExternalId=e}updateLockedOn(e){}resetError(){this.errors={},this.isValid=!0}validate(){const e=iu(this,this.constraints());return e?(this.errors=e,this.isValid=!1):this.resetError(),!e}}class Zs extends fu{baseAmount;quoteAmount;price;lockedOn;orderType=rn.LIMIT;constraints(){let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote||0:this.balanceLimit===vr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}}}}constructor(e,n=!0){super(e),this.price=X(e.price||"0"),this.lockedOn=e.lockedOn,this.baseAmount=X(e.baseAmount),this.quoteAmount=X(e.quoteAmount),n&&(this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount))}updateBaseAmount(e){this.baseAmount=e,this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateLockedOn(e){this.lockedOn=e,this.validate()}quoteFee(){return this.quoteAmount.multipliedBy(this.takerFee)}updatePrice(e){this.price=e.decimalPlaces(this.precisionPrice),this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount)}getOrders(){return[this]}}class S1 extends fu{baseAmount;quoteAmount;price;orderType=rn.MARKET;constraints=()=>{let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote||0:this.balanceLimit===vr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:e?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:n?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}}}};constructor(e){super(e),this.updateQuoteAmount(e.quoteAmount),this.updateBaseAmount(e.baseAmount)}updateBaseAmount(e){this.baseAmount=e,e&&(this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN)),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,e&&(this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN)),this.validate()}updatePrice(e){this.price=e.decimalPlaces(this.precisionPrice)}getOrders(){return[this]}}var eh=(t=>(t.LINEAR="LINEAR",t.EXPONENTIAL="EXPONENTIAL",t.FIBONACCI="FIBONACCI",t.CUSTOM="CUSTOM",t))(eh||{}),th=(t=>(t.EQUAL="EQUAL",t.LINEAR="LINEAR",t.LINEAR_REVERSE="LINEAR_REVERSE",t.EXPONENTIAL="EXPONENTIAL",t.EXPONENTIAL_REVERSE="EXPONENTIAL_REVERSE",t.CUSTOM="CUSTOM",t))(th||{});const rh={LINEAR:t=>ut.times(t,e=>1/(t-1)*e),EXPONENTIAL:t=>{const e=2**(t-1);return ut.times(t,n=>n==0?0:2**n/e)},FIBONACCI:t=>[0,.09,.146,.236,.382,.5,.618,.788,.886].slice(0,t-1).concat([1]),CUSTOM:t=>[]},hu=t=>{const e=ut.sum(t);return t.map(n=>n/e)},Xs={EQUAL:t=>{const e=ut.times(t,()=>1);return hu(e)},LINEAR:t=>{const e=ut.times(t,n=>1/t*(n+1));return hu(e)},EXPONENTIAL:t=>{const e=2**t-1,n=ut.times(t,s=>2**s/e);return hu(n)},LINEAR_REVERSE:t=>Xs.LINEAR(t).reverse(),EXPONENTIAL_REVERSE:t=>Xs.EXPONENTIAL(t).reverse(),CUSTOM:t=>[]};class v1 extends fu{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=rn.LIMIT_LADDER;constraints(){let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote:this.balanceLimit===vr.BASE&&(e=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}},otherPrice:{bigNumericality:{greaterThan:0}},numOrders:{numericality:{greaterThanOrEqualTo:2}}}}constructor(e){super(e),this.otherPrice=X(e.otherPrice),this.numOrders=jn(e.numOrders),this.priceScale=e.priceScale||"CUSTOM",this.sizeScale=e.sizeScale||"CUSTOM",this.price=X(e.price||"0"),this.lockedOn=e.lockedOn,this.baseAmount=X(e.baseAmount||"0"),this.quoteAmount=X(e.quoteAmount||"0"),this.priceScales=e.priceScales||rh[this.priceScale](this.numOrders),this.sizeScales=e.sizeScales||Xs[this.sizeScale](this.numOrders),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateNumOrders(e){this.numOrders=e}updatePrice(e,n=.05){if(this.price=e.decimalPlaces(this.precisionPrice),e&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.otherPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updateOtherPrice(e,n=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updatePriceScales(e){this.priceScales=e,this.priceScale="CUSTOM",this.recalculate()}updatePriceScale(e){this.priceScales=rh[e](this.numOrders),this.priceScale=e,this.recalculate()}updateSizeScales(e){this.sizeScales=e,this.sizeScale="CUSTOM",this.recalculate()}updateSizeScale(e){this.sizeScales=Xs[e](this.numOrders),this.sizeScale=e,this.recalculate()}updateLockedOn(e){this.lockedOn=e}recalculate(){this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("quoteAmount");n.length>0?this.baseAmount=ut.reduce(n,(s,a)=>s.plus(a.baseAmount),new Ze(0)):this.baseAmount=new Ze(0)}updateBaseAmount(e){this.baseAmount=e,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("baseAmount");n.length>0?this.quoteAmount=ut.reduce(n,(s,a)=>s.plus(a.quoteAmount),new Ze(0)):this.quoteAmount=new Ze(0)}getOrders(e=this.lockedOn){const n=e==="baseAmount"?this.baseAmount:this.quoteAmount,s=e==="baseAmount"?this.precisionBase:this.precisionQuote;if(!(this.priceScales&&this.priceScales.length>0&&this.sizeScales.length>0&&n.gt(0)))return[];const a=this.priceScales.slice(0,this.numOrders),c=this.sizeScales.slice(0,this.numOrders),u=this.otherPrice.minus(this.price);let l=n;return ut.times(this.numOrders,h=>{let m=n.multipliedBy(c[h]).decimalPlaces(s>0?s:0,Ze.ROUND_DOWN);return l=l.minus(m),h===this.numOrders-1&&(m=m.plus(l)),new Zs({...this,[e]:m,lockedOn:e,price:this.price.plus(u.multipliedBy(a[h])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}}class T1 extends Zs{stopPrice;orderType=rn.STOP_LOSS_LIMIT;constraints(){return{...super.constraints(),stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e),this.stopPrice=X(e.stopPrice)}updatePrice(e,n=.05){if(super.updatePrice(e),e&&this.stopPrice.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.stopPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,n=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}class E1 extends Zs{linkedOrderId;otherPrice;stopPrice;orderType=rn.OCO;constraints(){return{...super.constraints(),otherPrice:{bigNumericality:{greaterThan:0}},stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e,!1),this.otherPrice=X(e.otherPrice),this.stopPrice=X(e.stopPrice),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateQuoteAmount(e){this.quoteAmount=e;let n=this.side===_t.BUY?this.otherPrice:this.price;this.baseAmount=e.dividedBy(n).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateBaseAmount(e){this.baseAmount=e;let n=this.side===_t.BUY?this.otherPrice:this.price;this.quoteAmount=n.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updatePrice(e,n=.05){if(super.updatePrice(e),e&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n*2:1-n*2,a=this.side===_t.BUY?1+n:1-n;this.otherPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateOtherPrice(e,n=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n*2:1+n*2,a=this.side===_t.BUY?1-n:1+n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,n=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n,a=this.side===_t.BUY?1+n:1-n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.otherPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}return ee.BalanceLimit=vr,ee.CoinrayCache=u1,ee.CurrentMarket=l1,ee.DAYS=Li,ee.ExchangeFeatures=su,ee.HOURS=Bf,ee.IpWhiteList=au,ee.LimitLadderOrder=v1,ee.LimitOrder=Zs,ee.MINUTES=Ct,ee.MarginType=ou,ee.MarketOrder=S1,ee.OcoOrder=E1,ee.OrderSide=_t,ee.OrderStatus=uu,ee.OrderType=rn,ee.PriceScales=eh,ee.SizeScales=th,ee.StopLimitOrder=T1,ee.TimeInForce=cu,ee.WEEK=qs,ee.base64UrlDecode=Gs,ee.base64UrlEncode=$s,ee.camelize=Zo,ee.candleTime=Js,ee.checkArray=zs,ee.checkBigNumber=ct,ee.checkBoolean=Tn,ee.checkNull=Yf,ee.checkNumber=xt,ee.checkString=Ge,ee.correctNumberPrecision=En,ee.createJWT=Jo,ee.default=xe,ee.encryptPayload=Qo,ee.errorHelper=jt,ee.filterMarkets=zf,ee.getBucketStartDates=Vf,ee.getTimeParams=Gf,ee.jwkToPublicKey=Hf,ee.jwtExpired=Vs,ee.locales=f1,ee.parseJWT=Wf,ee.resolutionToBucketType=$f,ee.resolutionToDuration=Kf,ee.safeBigNumber=X,ee.safeFloat=Ni,ee.safeInteger=jn,ee.safeTime=ru,ee.sha256hexdigest=Ff,ee.signHMAC=jo,ee.strToArray=n1,ee.throwIsArray=tu,ee.throwNotObject=eu,ee.throwNull2NonNull=Xo,ee.toBucketEnd=qf,ee.toBucketStart=i1,ee.toSafeDate=js,ee.types=m1,ee.unix=If,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ee})({});
51
+ */var h1=Ii.exports,Zf;function d1(){return Zf||(Zf=1,(function(t,e){(function(n,s,a){var c=function(l,h,m){m=u.extend({},u.options,m);var b=u.runValidations(l,h,m);if(b.some(function(T){return u.isPromise(T.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(b,m)},u=c;u.extend=function(l){return[].slice.call(arguments,1).forEach(function(h){for(var m in h)l[m]=h[m]}),l},u.extend(c,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var l=u.format("%{major}.%{minor}.%{patch}",u.version);return u.isEmpty(u.version.metadata)||(l+="+"+u.version.metadata),l}},Promise:typeof Promise<"u"?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(l,h,m){var b=[],T,P,$,O,I,F,ne;(u.isDomElement(l)||u.isJqueryElement(l))&&(l=u.collectFormValues(l));for(T in h){$=u.getDeepObjectValue(l,T),O=u.result(h[T],$,l,T,m,h);for(P in O){if(I=u.validators[P],!I)throw ne=u.format("Unknown validator %{name}",{name:P}),new Error(ne);F=O[P],F=u.result(F,$,l,T,m,h),F&&b.push({attribute:T,value:$,validator:P,globalOptions:m,attributes:l,options:F,error:I.call(I,$,F,T,l,m)})}}return b},processValidationResults:function(l,h){l=u.pruneEmptyErrors(l,h),l=u.expandMultipleErrors(l,h),l=u.convertErrorMessages(l,h);var m=h.format||"grouped";if(typeof u.formatters[m]=="function")l=u.formatters[m](l);else throw new Error(u.format("Unknown format %{format}",h));return u.isEmpty(l)?void 0:l},async:function(l,h,m){m=u.extend({},u.async.options,m);var b=m.wrapErrors||function(P){return P};m.cleanAttributes!==!1&&(l=u.cleanAttributes(l,h));var T=u.runValidations(l,h,m);return new u.Promise(function(P,$){u.waitForResults(T).then(function(){var O=u.processValidationResults(T,m);O?$(new b(O,m,l,h)):P(l)},function(O){$(O)})})},single:function(l,h,m){return m=u.extend({},u.single.options,m,{format:"flat",fullMessages:!1}),u({single:l},{single:h},m)},waitForResults:function(l){return l.reduce(function(h,m){return u.isPromise(m.error)?h.then(function(){return m.error.then(function(b){m.error=b||null})}):h},new u.Promise(function(h){h()}))},result:function(l){var h=[].slice.call(arguments,1);return typeof l=="function"&&(l=l.apply(null,h)),l},isNumber:function(l){return typeof l=="number"&&!isNaN(l)},isFunction:function(l){return typeof l=="function"},isInteger:function(l){return u.isNumber(l)&&l%1===0},isBoolean:function(l){return typeof l=="boolean"},isObject:function(l){return l===Object(l)},isDate:function(l){return l instanceof Date},isDefined:function(l){return l!=null},isPromise:function(l){return!!l&&u.isFunction(l.then)},isJqueryElement:function(l){return l&&u.isString(l.jquery)},isDomElement:function(l){return!l||!l.querySelectorAll||!l.querySelector?!1:u.isObject(document)&&l===document?!0:typeof HTMLElement=="object"?l instanceof HTMLElement:l&&typeof l=="object"&&l!==null&&l.nodeType===1&&typeof l.nodeName=="string"},isEmpty:function(l){var h;if(!u.isDefined(l))return!0;if(u.isFunction(l))return!1;if(u.isString(l))return u.EMPTY_STRING_REGEXP.test(l);if(u.isArray(l))return l.length===0;if(u.isDate(l))return!1;if(u.isObject(l)){for(h in l)return!1;return!0}return!1},format:u.extend(function(l,h){return u.isString(l)?l.replace(u.format.FORMAT_REGEXP,function(m,b,T){return b==="%"?"%{"+T+"}":String(h[T])}):l},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(l){return u.isNumber(l)?l*100%1===0?""+l:parseFloat(Math.round(l*100)/100).toFixed(2):u.isArray(l)?l.map(function(h){return u.prettify(h)}).join(", "):u.isObject(l)?u.isDefined(l.toString)?l.toString():JSON.stringify(l):(l=""+l,l.replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,function(h,m,b){return""+m+" "+b.toLowerCase()}).toLowerCase())},stringifyValue:function(l,h){var m=h&&h.prettify||u.prettify;return m(l)},isString:function(l){return typeof l=="string"},isArray:function(l){return{}.toString.call(l)==="[object Array]"},isHash:function(l){return u.isObject(l)&&!u.isArray(l)&&!u.isFunction(l)},contains:function(l,h){return u.isDefined(l)?u.isArray(l)?l.indexOf(h)!==-1:h in l:!1},unique:function(l){return u.isArray(l)?l.filter(function(h,m,b){return b.indexOf(h)==m}):l},forEachKeyInKeypath:function(l,h,m){if(u.isString(h)){var b="",T,P=!1;for(T=0;T<h.length;++T)switch(h[T]){case".":P?(P=!1,b+="."):(l=m(l,b,!1),b="");break;case"\\":P?(P=!1,b+="\\"):P=!0;break;default:P=!1,b+=h[T];break}return m(l,b,!0)}},getDeepObjectValue:function(l,h){if(u.isObject(l))return u.forEachKeyInKeypath(l,h,function(m,b){if(u.isObject(m))return m[b]})},collectFormValues:function(l,h){var m={},b,T,P,$,O,I;if(u.isJqueryElement(l)&&(l=l[0]),!l)return m;for(h=h||{},$=l.querySelectorAll("input[name], textarea[name]"),b=0;b<$.length;++b)if(P=$.item(b),!u.isDefined(P.getAttribute("data-ignored"))){var F=P.name.replace(/\./g,"\\\\.");I=u.sanitizeFormValue(P.value,h),P.type==="number"?I=I?+I:null:P.type==="checkbox"?P.attributes.value?P.checked||(I=m[F]||null):I=P.checked:P.type==="radio"&&(P.checked||(I=m[F]||null)),m[F]=I}for($=l.querySelectorAll("select[name]"),b=0;b<$.length;++b)if(P=$.item(b),!u.isDefined(P.getAttribute("data-ignored"))){if(P.multiple){I=[];for(T in P.options)O=P.options[T],O&&O.selected&&I.push(u.sanitizeFormValue(O.value,h))}else{var ne=typeof P.options[P.selectedIndex]<"u"?P.options[P.selectedIndex].value:"";I=u.sanitizeFormValue(ne,h)}m[P.name]=I}return m},sanitizeFormValue:function(l,h){return h.trim&&u.isString(l)&&(l=l.trim()),h.nullify!==!1&&l===""?null:l},capitalize:function(l){return u.isString(l)?l[0].toUpperCase()+l.slice(1):l},pruneEmptyErrors:function(l){return l.filter(function(h){return!u.isEmpty(h.error)})},expandMultipleErrors:function(l){var h=[];return l.forEach(function(m){u.isArray(m.error)?m.error.forEach(function(b){h.push(u.extend({},m,{error:b}))}):h.push(m)}),h},convertErrorMessages:function(l,h){h=h||{};var m=[],b=h.prettify||u.prettify;return l.forEach(function(T){var P=u.result(T.error,T.value,T.attribute,T.options,T.attributes,T.globalOptions);if(!u.isString(P)){m.push(T);return}P[0]==="^"?P=P.slice(1):h.fullMessages!==!1&&(P=u.capitalize(b(T.attribute))+" "+P),P=P.replace(/\\\^/g,"^"),P=u.format(P,{value:u.stringifyValue(T.value,h)}),m.push(u.extend({},T,{error:P}))}),m},groupErrorsByAttribute:function(l){var h={};return l.forEach(function(m){var b=h[m.attribute];b?b.push(m):h[m.attribute]=[m]}),h},flattenErrorsToArray:function(l){return l.map(function(h){return h.error}).filter(function(h,m,b){return b.indexOf(h)===m})},cleanAttributes:function(l,h){function m(P,$,O){return u.isObject(P[$])?P[$]:P[$]=O?!0:{}}function b(P){var $={},O;for(O in P)P[O]&&u.forEachKeyInKeypath($,O,m);return $}function T(P,$){if(!u.isObject(P))return P;var O=u.extend({},P),I,F;for(F in P)I=$[F],u.isObject(I)?O[F]=T(O[F],I):I||delete O[F];return O}return!u.isObject(h)||!u.isObject(l)?{}:(h=b(h),T(l,h))},exposeModule:function(l,h,m,b,T){m?(b&&b.exports&&(m=b.exports=l),m.validate=l):(h.validate=l,l.isFunction(T)&&T.amd&&T([],function(){return l}))},warn:function(l){typeof console<"u"&&console.warn&&console.warn("[validate.js] "+l)},error:function(l){typeof console<"u"&&console.error&&console.error("[validate.js] "+l)}}),c.validators={presence:function(l,h){if(h=u.extend({},this.options,h),h.allowEmpty!==!1?!u.isDefined(l):u.isEmpty(l))return h.message||this.message||"can't be blank"},length:function(l,h,m){if(u.isDefined(l)){h=u.extend({},this.options,h);var b=h.is,T=h.maximum,P=h.minimum,$=h.tokenizer||function(ne){return ne},O,I=[];l=$(l);var F=l.length;if(!u.isNumber(F))return h.message||this.notValid||"has an incorrect length";if(u.isNumber(b)&&F!==b&&(O=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",I.push(u.format(O,{count:b}))),u.isNumber(P)&&F<P&&(O=h.tooShort||this.tooShort||"is too short (minimum is %{count} characters)",I.push(u.format(O,{count:P}))),u.isNumber(T)&&F>T&&(O=h.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",I.push(u.format(O,{count:T}))),I.length>0)return h.message||I}},numericality:function(l,h,m,b,T){if(u.isDefined(l)){h=u.extend({},this.options,h);var P=[],$,O,I={greaterThan:function(ve,_e){return ve>_e},greaterThanOrEqualTo:function(ve,_e){return ve>=_e},equalTo:function(ve,_e){return ve===_e},lessThan:function(ve,_e){return ve<_e},lessThanOrEqualTo:function(ve,_e){return ve<=_e},divisibleBy:function(ve,_e){return ve%_e===0}},F=h.prettify||T&&T.prettify||u.prettify;if(u.isString(l)&&h.strict){var ne="^-?(0|[1-9]\\d*)";if(h.onlyInteger||(ne+="(\\.\\d+)?"),ne+="$",!new RegExp(ne).test(l))return h.message||h.notValid||this.notValid||this.message||"must be a valid number"}if(h.noStrings!==!0&&u.isString(l)&&!u.isEmpty(l)&&(l=+l),!u.isNumber(l))return h.message||h.notValid||this.notValid||this.message||"is not a number";if(h.onlyInteger&&!u.isInteger(l))return h.message||h.notInteger||this.notInteger||this.message||"must be an integer";for($ in I)if(O=h[$],u.isNumber(O)&&!I[$](l,O)){var Y="not"+u.capitalize($),Ae=h[Y]||this[Y]||this.message||"must be %{type} %{count}";P.push(u.format(Ae,{count:O,type:F($)}))}if(h.odd&&l%2!==1&&P.push(h.notOdd||this.notOdd||this.message||"must be odd"),h.even&&l%2!==0&&P.push(h.notEven||this.notEven||this.message||"must be even"),P.length)return h.message||P}},datetime:u.extend(function(l,h){if(!u.isFunction(this.parse)||!u.isFunction(this.format))throw new Error("Both the parse and format functions needs to be set to use the datetime/date validator");if(u.isDefined(l)){h=u.extend({},this.options,h);var m,b=[],T=h.earliest?this.parse(h.earliest,h):NaN,P=h.latest?this.parse(h.latest,h):NaN;if(l=this.parse(l,h),isNaN(l)||h.dateOnly&&l%864e5!==0)return m=h.notValid||h.message||this.notValid||"must be a valid date",u.format(m,{value:arguments[0]});if(!isNaN(T)&&l<T&&(m=h.tooEarly||h.message||this.tooEarly||"must be no earlier than %{date}",m=u.format(m,{value:this.format(l,h),date:this.format(T,h)}),b.push(m)),!isNaN(P)&&l>P&&(m=h.tooLate||h.message||this.tooLate||"must be no later than %{date}",m=u.format(m,{date:this.format(P,h),value:this.format(l,h)}),b.push(m)),b.length)return u.unique(b)}},{parse:null,format:null}),date:function(l,h){return h=u.extend({},h,{dateOnly:!0}),u.validators.datetime.call(u.validators.datetime,l,h)},format:function(l,h){(u.isString(h)||h instanceof RegExp)&&(h={pattern:h}),h=u.extend({},this.options,h);var m=h.message||this.message||"is invalid",b=h.pattern,T;if(u.isDefined(l)&&(!u.isString(l)||(u.isString(b)&&(b=new RegExp(h.pattern,h.flags)),T=b.exec(l),!T||T[0].length!=l.length)))return m},inclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is not included in the list";return u.format(m,{value:l})}},exclusion:function(l,h){if(u.isDefined(l)&&(u.isArray(h)&&(h={within:h}),h=u.extend({},this.options,h),!!u.contains(h.within,l))){var m=h.message||this.message||"^%{value} is restricted";return u.isString(h.within[l])&&(l=h.within[l]),u.format(m,{value:l})}},email:u.extend(function(l,h){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid email";if(u.isDefined(l)&&(!u.isString(l)||!this.PATTERN.exec(l)))return m},{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(l,h,m,b,T){if(u.isDefined(l)){u.isString(h)&&(h={attribute:h}),h=u.extend({},this.options,h);var P=h.message||this.message||"is not equal to %{attribute}";if(u.isEmpty(h.attribute)||!u.isString(h.attribute))throw new Error("The attribute must be a non empty string");var $=u.getDeepObjectValue(b,h.attribute),O=h.comparator||function(F,ne){return F===ne},I=h.prettify||T&&T.prettify||u.prettify;if(!O(l,$,h,m,b))return u.format(P,{attribute:I(h.attribute)})}},url:function(l,h){if(u.isDefined(l)){h=u.extend({},this.options,h);var m=h.message||this.message||"is not a valid url",b=h.schemes||this.schemes||["http","https"],T=h.allowLocal||this.allowLocal||!1,P=h.allowDataUrl||this.allowDataUrl||!1;if(!u.isString(l))return m;var $="^(?:(?:"+b.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";if(T?O+="?":$+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",$+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+O+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",P){var I="\\w+\\/[-+.\\w]+(?:;[\\w=]+)*",F="[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*",ne="data:(?:"+I+")?(?:;base64)?,"+F;$="(?:"+$+")|(?:^"+ne+"$)"}var Y=new RegExp($,"i");if(!Y.exec(l))return m}},type:u.extend(function(l,h,m,b,T){if(u.isString(h)&&(h={type:h}),!!u.isDefined(l)){var P=u.extend({},this.options,h),$=P.type;if(!u.isDefined($))throw new Error("No type was specified");var O;if(u.isFunction($)?O=$:O=this.types[$],!u.isFunction(O))throw new Error("validate.validators.type.types."+$+" must be a function.");if(!O(l,P,m,b,T)){var I=h.message||this.messages[$]||this.message||P.message||(u.isFunction($)?"must be of the correct type":"must be of type %{type}");return u.isFunction(I)&&(I=I(l,h,m,b,T)),u.format(I,{attribute:u.prettify(m),type:$})}}},{types:{object:function(l){return u.isObject(l)&&!u.isArray(l)},array:u.isArray,integer:u.isInteger,number:u.isNumber,string:u.isString,date:u.isDate,boolean:u.isBoolean},messages:{}})},c.formatters={detailed:function(l){return l},flat:u.flattenErrorsToArray,grouped:function(l){var h;l=u.groupErrorsByAttribute(l);for(h in l)l[h]=u.flattenErrorsToArray(l[h]);return l},constraint:function(l){var h;l=u.groupErrorsByAttribute(l);for(h in l)l[h]=l[h].map(function(m){return m.validator}).sort();return l}},c.exposeModule(c,this,n,s,a)}).call(h1,e,t,null)})(Ii,Ii.exports)),Ii.exports}var p1=d1();const su=Sl(p1);su.validators.bigNumericality=(t,e,n,s)=>su.validators.numericality(t&&t.toNumber(),e,s);var rn=(t=>(t.MARKET="MARKET",t.LIMIT="LIMIT",t.LIMIT_LADDER="LIMIT_LADDER",t.STOP_LOSS="STOP_LOSS",t.OCO="OCO",t.STOP_LOSS_LIMIT="STOP_LOSS_LIMIT",t.STOP_LOSS_MARKET="STOP_LOSS_MARKET",t.TAKE_PROFIT="TAKE_PROFIT",t.TAKE_PROFIT_LIMIT="TAKE_PROFIT_LIMIT",t.TAKE_PROFIT_MARKET="TAKE_PROFIT_MARKET",t))(rn||{}),au=(t=>(t.HEDGE_MODE="hedgeMode",t.ORDER_QUOTE_AMOUNT="orderQuoteAmount",t.MARKET_BUY_QUOTE_ONLY="marketBuyQuoteOnly",t.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS="updateLeverageOnlyOnOpenPositions",t.FAST_CONNECT="fastConnect",t.UNIFIED_BALANCE="unifiedBalance",t))(au||{}),ou=(t=>(t.NONE="NONE",t.LIST="LIST",t.COMMA="COMMA",t.COMMA_SPACE="COMMA_SPACE",t.SPACE="SPACE",t))(ou||{}),uu=(t=>(t.CROSSED="CROSSED",t.ISOLATED="ISOLATED",t))(uu||{}),cu=(t=>(t.OPEN="open",t.CLOSED="closed",t.CANCELED="canceled",t))(cu||{}),_t=(t=>(t.BUY="buy",t.SELL="sell",t))(_t||{}),lu=(t=>(t.GTC="gtc",t.FOK="fok",t.IOC="ioc",t))(lu||{}),vr=(t=>(t.QUOTE="quote",t.BASE="base",t.NONE="none",t))(vr||{});const m1=Object.freeze(Object.defineProperty({__proto__:null,BalanceLimit:vr,ExchangeFeatures:au,IpWhiteList:ou,MarginType:uu,OrderSide:_t,OrderStatus:cu,OrderType:rn,TimeInForce:lu},Symbol.toStringTag,{value:"Module"})),lt=[];for(let t=0;t<256;++t)lt.push((t+256).toString(16).slice(1));function g1(t,e=0){return(lt[t[e+0]]+lt[t[e+1]]+lt[t[e+2]]+lt[t[e+3]]+"-"+lt[t[e+4]]+lt[t[e+5]]+"-"+lt[t[e+6]]+lt[t[e+7]]+"-"+lt[t[e+8]]+lt[t[e+9]]+"-"+lt[t[e+10]]+lt[t[e+11]]+lt[t[e+12]]+lt[t[e+13]]+lt[t[e+14]]+lt[t[e+15]]).toLowerCase()}let fu;const y1=new Uint8Array(16);function _1(){if(!fu){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");fu=crypto.getRandomValues.bind(crypto)}return fu(y1)}const Xf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function w1(t,e,n){t=t||{};const s=t.random??t.rng?.()??_1();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,g1(s)}function b1(t,e,n){return Xf.randomUUID&&!t?Xf.randomUUID():w1(t)}class hu{id=b1();coinraySymbol;precisionBase;precisionQuote;precisionPrice;minBase;minQuote;makerFee;takerFee;balances;balanceLimit;side;errors;isValid;orderExternalId;reduceOnly;postOnly;timeInForce;constructor(e){this.coinraySymbol=e.coinraySymbol,this.precisionBase=jn(e.precisionBase),this.precisionQuote=jn(e.precisionQuote),this.precisionPrice=jn(e.precisionPrice),this.minBase=X(e.minBase),this.minQuote=X(e.minQuote),this.makerFee=X(e.makerFee),this.takerFee=X(e.takerFee),this.balances=e.balances,this.balanceLimit=e.balanceLimit||vr.NONE,this.side=e.side,this.orderExternalId=e.externalId,this.errors={},this.isValid=!0,this.reduceOnly=e.reduceOnly,this.postOnly=e.postOnly,this.timeInForce=e.timeInForce}startEdit(e){this.orderExternalId=e}updateLockedOn(e){}resetError(){this.errors={},this.isValid=!0}validate(){const e=su(this,this.constraints());return e?(this.errors=e,this.isValid=!1):this.resetError(),!e}}class Zs extends hu{baseAmount;quoteAmount;price;lockedOn;orderType=rn.LIMIT;constraints(){let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote||0:this.balanceLimit===vr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}}}}constructor(e,n=!0){super(e),this.price=X(e.price||"0"),this.lockedOn=e.lockedOn,this.baseAmount=X(e.baseAmount),this.quoteAmount=X(e.quoteAmount),n&&(this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount))}updateBaseAmount(e){this.baseAmount=e,this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateLockedOn(e){this.lockedOn=e,this.validate()}quoteFee(){return this.quoteAmount.multipliedBy(this.takerFee)}updatePrice(e){this.price=e.decimalPlaces(this.precisionPrice),this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount)}getOrders(){return[this]}}class S1 extends hu{baseAmount;quoteAmount;price;orderType=rn.MARKET;constraints=()=>{let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote||0:this.balanceLimit===vr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:e?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:n?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}}}};constructor(e){super(e),this.updateQuoteAmount(e.quoteAmount),this.updateBaseAmount(e.baseAmount)}updateBaseAmount(e){this.baseAmount=e,e&&(this.quoteAmount=this.price.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN)),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,e&&(this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN)),this.validate()}updatePrice(e){this.price=e.decimalPlaces(this.precisionPrice)}getOrders(){return[this]}}var eh=(t=>(t.LINEAR="LINEAR",t.EXPONENTIAL="EXPONENTIAL",t.FIBONACCI="FIBONACCI",t.CUSTOM="CUSTOM",t))(eh||{}),th=(t=>(t.EQUAL="EQUAL",t.LINEAR="LINEAR",t.LINEAR_REVERSE="LINEAR_REVERSE",t.EXPONENTIAL="EXPONENTIAL",t.EXPONENTIAL_REVERSE="EXPONENTIAL_REVERSE",t.CUSTOM="CUSTOM",t))(th||{});const rh={LINEAR:t=>ut.times(t,e=>1/(t-1)*e),EXPONENTIAL:t=>{const e=2**(t-1);return ut.times(t,n=>n==0?0:2**n/e)},FIBONACCI:t=>[0,.09,.146,.236,.382,.5,.618,.788,.886].slice(0,t-1).concat([1]),CUSTOM:t=>[]},du=t=>{const e=ut.sum(t);return t.map(n=>n/e)},Xs={EQUAL:t=>{const e=ut.times(t,()=>1);return du(e)},LINEAR:t=>{const e=ut.times(t,n=>1/t*(n+1));return du(e)},EXPONENTIAL:t=>{const e=2**t-1,n=ut.times(t,s=>2**s/e);return du(n)},LINEAR_REVERSE:t=>Xs.LINEAR(t).reverse(),EXPONENTIAL_REVERSE:t=>Xs.EXPONENTIAL(t).reverse(),CUSTOM:t=>[]};class v1 extends hu{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=rn.LIMIT_LADDER;constraints(){let e,n;return this.balanceLimit===vr.QUOTE?n=this.balances.quote:this.balanceLimit===vr.BASE&&(e=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${xe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${xe.I18n.t("validation.insufficientFunds")}`}},price:{bigNumericality:{greaterThan:0}},otherPrice:{bigNumericality:{greaterThan:0}},numOrders:{numericality:{greaterThanOrEqualTo:2}}}}constructor(e){super(e),this.otherPrice=X(e.otherPrice),this.numOrders=jn(e.numOrders),this.priceScale=e.priceScale||"CUSTOM",this.sizeScale=e.sizeScale||"CUSTOM",this.price=X(e.price||"0"),this.lockedOn=e.lockedOn,this.baseAmount=X(e.baseAmount||"0"),this.quoteAmount=X(e.quoteAmount||"0"),this.priceScales=e.priceScales||rh[this.priceScale](this.numOrders),this.sizeScales=e.sizeScales||Xs[this.sizeScale](this.numOrders),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateNumOrders(e){this.numOrders=e}updatePrice(e,n=.05){if(this.price=e.decimalPlaces(this.precisionPrice),e&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.otherPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updateOtherPrice(e,n=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updatePriceScales(e){this.priceScales=e,this.priceScale="CUSTOM",this.recalculate()}updatePriceScale(e){this.priceScales=rh[e](this.numOrders),this.priceScale=e,this.recalculate()}updateSizeScales(e){this.sizeScales=e,this.sizeScale="CUSTOM",this.recalculate()}updateSizeScale(e){this.sizeScales=Xs[e](this.numOrders),this.sizeScale=e,this.recalculate()}updateLockedOn(e){this.lockedOn=e}recalculate(){this.lockedOn==="baseAmount"?this.updateBaseAmount(this.baseAmount):this.updateQuoteAmount(this.quoteAmount),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("quoteAmount");n.length>0?this.baseAmount=ut.reduce(n,(s,a)=>s.plus(a.baseAmount),new Ze(0)):this.baseAmount=new Ze(0)}updateBaseAmount(e){this.baseAmount=e,this.numOrders=Math.max(2,+this.numOrders);const n=this.getOrders("baseAmount");n.length>0?this.quoteAmount=ut.reduce(n,(s,a)=>s.plus(a.quoteAmount),new Ze(0)):this.quoteAmount=new Ze(0)}getOrders(e=this.lockedOn){const n=e==="baseAmount"?this.baseAmount:this.quoteAmount,s=e==="baseAmount"?this.precisionBase:this.precisionQuote;if(!(this.priceScales&&this.priceScales.length>0&&this.sizeScales.length>0&&n.gt(0)))return[];const a=this.priceScales.slice(0,this.numOrders),c=this.sizeScales.slice(0,this.numOrders),u=this.otherPrice.minus(this.price);let l=n;return ut.times(this.numOrders,h=>{let m=n.multipliedBy(c[h]).decimalPlaces(s>0?s:0,Ze.ROUND_DOWN);return l=l.minus(m),h===this.numOrders-1&&(m=m.plus(l)),new Zs({...this,[e]:m,lockedOn:e,price:this.price.plus(u.multipliedBy(a[h])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}}class T1 extends Zs{stopPrice;orderType=rn.STOP_LOSS_LIMIT;constraints(){return{...super.constraints(),stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e),this.stopPrice=X(e.stopPrice)}updatePrice(e,n=.05){if(super.updatePrice(e),e&&this.stopPrice.eq(0)){const s=this.side===_t.BUY?1-n:1+n;this.stopPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,n=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1+n:1-n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}class E1 extends Zs{linkedOrderId;otherPrice;stopPrice;orderType=rn.OCO;constraints(){return{...super.constraints(),otherPrice:{bigNumericality:{greaterThan:0}},stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e,!1),this.otherPrice=X(e.otherPrice),this.stopPrice=X(e.stopPrice),this.quoteAmount.gt(0)&&this.lockedOn==="quoteAmount"?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateQuoteAmount(e){this.quoteAmount=e;let n=this.side===_t.BUY?this.otherPrice:this.price;this.baseAmount=e.dividedBy(n).decimalPlaces(this.precisionBase>0?this.precisionBase:0,Ze.ROUND_DOWN),this.validate()}updateBaseAmount(e){this.baseAmount=e;let n=this.side===_t.BUY?this.otherPrice:this.price;this.quoteAmount=n.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,Ze.ROUND_DOWN),this.validate()}updatePrice(e,n=.05){if(super.updatePrice(e),e&&this.otherPrice.eq(0)){const s=this.side===_t.BUY?1+n*2:1-n*2,a=this.side===_t.BUY?1+n:1-n;this.otherPrice=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateOtherPrice(e,n=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n*2:1+n*2,a=this.side===_t.BUY?1-n:1+n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,n=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){const s=this.side===_t.BUY?1-n:1+n,a=this.side===_t.BUY?1+n:1-n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.otherPrice=e.multipliedBy(a).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}return ee.BalanceLimit=vr,ee.CoinrayCache=u1,ee.CurrentMarket=l1,ee.DAYS=Li,ee.ExchangeFeatures=au,ee.HOURS=If,ee.IpWhiteList=ou,ee.LimitLadderOrder=v1,ee.LimitOrder=Zs,ee.MINUTES=Ct,ee.MarginType=uu,ee.MarketOrder=S1,ee.OcoOrder=E1,ee.OrderSide=_t,ee.OrderStatus=cu,ee.OrderType=rn,ee.PriceScales=eh,ee.SizeScales=th,ee.StopLimitOrder=T1,ee.TimeInForce=lu,ee.WEEK=$s,ee.base64UrlDecode=Vs,ee.base64UrlEncode=Gs,ee.camelize=Zo,ee.candleTime=Qs,ee.checkArray=js,ee.checkBigNumber=ct,ee.checkBoolean=Tn,ee.checkNull=Kf,ee.checkNumber=xt,ee.checkString=Ge,ee.correctNumberPrecision=En,ee.createJWT=Jo,ee.default=xe,ee.encryptPayload=Qo,ee.errorHelper=jt,ee.filterMarkets=jf,ee.getBucketStartDates=zf,ee.getTimeParams=Vf,ee.jwkToPublicKey=Yf,ee.jwtExpired=zs,ee.locales=f1,ee.parseJWT=Hf,ee.resolutionToBucketType=Gf,ee.resolutionToDuration=qf,ee.safeBigNumber=X,ee.safeFloat=Ni,ee.safeInteger=jn,ee.safeTime=ru,ee.sha256hexdigest=Wf,ee.signHMAC=jo,ee.strToArray=n1,ee.throwIsArray=tu,ee.throwNotObject=eu,ee.throwNull2NonNull=Xo,ee.toBucketEnd=$f,ee.toBucketStart=i1,ee.toSafeDate=Js,ee.types=m1,ee.unix=Ff,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ee})({});
52
52
  //# sourceMappingURL=coinrayjs.js.map