coinrayjs 2.0.17 → 2.0.19
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.es.js +12514 -13343
- package/dist/coinrayjs.es.js.map +1 -1
- package/dist/coinrayjs.js +32 -49
- package/dist/coinrayjs.js.map +1 -1
- package/dist/types/coinray-cache.d.ts +97 -0
- package/dist/types/coinray-cache.d.ts.map +1 -0
- package/dist/types/coinray.d.ts +197 -0
- package/dist/types/coinray.d.ts.map +1 -0
- package/dist/types/crypto.d.ts +2 -0
- package/dist/types/crypto.d.ts.map +1 -0
- package/dist/types/current-market.d.ts +61 -0
- package/dist/types/current-market.d.ts.map +1 -0
- package/dist/types/errors.d.ts +26 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/event-emitter.d.ts +10 -0
- package/dist/types/event-emitter.d.ts.map +1 -0
- package/dist/types/exchange.d.ts +63 -0
- package/dist/types/exchange.d.ts.map +1 -0
- package/dist/types/formula.d.ts +43 -0
- package/dist/types/formula.d.ts.map +1 -0
- package/dist/types/i18n/locales.d.ts +22 -0
- package/dist/types/i18n/locales.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +5 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lru.d.ts +27 -0
- package/dist/types/lru.d.ts.map +1 -0
- package/dist/types/market.d.ts +82 -0
- package/dist/types/market.d.ts.map +1 -0
- package/dist/types/orders/base.d.ts +30 -0
- package/dist/types/orders/base.d.ts.map +1 -0
- package/dist/types/orders/index.d.ts +7 -0
- package/dist/types/orders/index.d.ts.map +1 -0
- package/dist/types/orders/limit-ladder.d.ts +88 -0
- package/dist/types/orders/limit-ladder.d.ts.map +1 -0
- package/dist/types/orders/limit.d.ts +48 -0
- package/dist/types/orders/limit.d.ts.map +1 -0
- package/dist/types/orders/market.d.ts +38 -0
- package/dist/types/orders/market.d.ts.map +1 -0
- package/dist/types/orders/oco.d.ts +55 -0
- package/dist/types/orders/oco.d.ts.map +1 -0
- package/dist/types/orders/stop-limit.d.ts +43 -0
- package/dist/types/orders/stop-limit.d.ts.map +1 -0
- package/dist/types/orders/validate.d.ts +3 -0
- package/dist/types/orders/validate.d.ts.map +1 -0
- package/dist/types/ticker-subscriptions.d.ts +14 -0
- package/dist/types/ticker-subscriptions.d.ts.map +1 -0
- package/dist/types/types.d.ts +257 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/util.d.ts +49 -0
- package/dist/types/util.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/coinrayjs.js
CHANGED
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
var Coinray=(function(ee){"use strict";function Nc(t,e){return function(){return t.apply(e,arguments)}}const{toString:Lp}=Object.prototype,{getPrototypeOf:qa}=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)&&At(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"),At=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=qa(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)&&At(t.pipe),qp=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||At(t.append)&&((e=as(t))==="formdata"||e==="object"&&At(t.toString)&&t.toString()==="[object FormData]"))},$p=ir("URLSearchParams"),[Vp,Gp,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 $a(){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]=$a(n[u],a):us(a)?n[u]=$a({},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&&At(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&&qa(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"&&qa(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(At(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(At(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&&At(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)||At(t))&&At(t.then)&&At(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",At(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:Vp,isRequest:Gp,isResponse:zp,isHeaders:jp,isUndefined:Nn,isDate:Fp,isFile:Wp,isBlob:Hp,isRegExp:um,isFunction:At,isStream:Kp,isURLSearchParams:$p,isTypedArray:nm,isFileList:Yp,forEach:di,merge:$a,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&&At(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(w){return w!==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 Va(t){return U.isPlainObject(t)||U.isArray(t)}function Vc(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=Vc(a),!n&&c?"["+a+"]":a}).join(n?".":""):e}function wm(t){return U.isArray(t)&&!t.some(Va)}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||w,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 w(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=Vc(I),ne.forEach(function(Ae,Se){!(U.isUndefined(Ae)||Ae===null)&&e.append(u===!0?Gc([I],Se,c):u===null?I:I+"[]",m(Ae))}),!1}return Va(O)?!0:(e.append(Gc(F,I,c),m(O)),!1)}const T=[],P=Object.assign(bm,{defaultVisitor:w,convertValue:m,isVisitable:Va});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 vm(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||vm;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},Sm={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"]},za=typeof window<"u"&&typeof document<"u",ja=typeof navigator=="object"&&navigator||void 0,Tm=za&&(!ja||["ReactNative","NativeScript","NS"].indexOf(ja.product)<0),Em=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Am=za&&window.location.href||"http://localhost",dt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:za,hasStandardBrowserEnv:Tm,hasStandardBrowserWebWorkerEnv:Em,navigator:ja,origin:Am},Symbol.toStringTag,{value:"Module"})),...Sm};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(
|
|
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}};Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(Ot.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),U.freezeMethods(Ot);function Qa(t,e){const n=this||pi,s=e||n,a=Ot.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(),w=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 $=w&&m-w;return $?Math.round(P*1e3/$):void 0}}function Im(t,e){let n=0,s=1e3/e,a,c;const u=(m,w=Date.now())=>{n=w,a=null,c&&(clearTimeout(c),c=null),t(...m)};return[(...m)=>{const w=Date.now(),T=w-n;T>=s?u(m,w):(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),w=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&&w?(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 Ot?{...t}:t;function pn(t,e){e=e||{};const n={};function s(m,w,T,P){return U.isPlainObject(m)&&U.isPlainObject(w)?U.merge.call({caseless:P},m,w):U.isPlainObject(w)?U.merge({},w):U.isArray(w)?w.slice():w}function a(m,w,T,P){if(U.isUndefined(w)){if(!U.isUndefined(m))return s(void 0,m,T,P)}else return s(m,w,T,P)}function c(m,w){if(!U.isUndefined(w))return s(void 0,w)}function u(m,w){if(U.isUndefined(w)){if(!U.isUndefined(m))return s(void 0,m)}else return s(void 0,w)}function l(m,w,T){if(T in e)return s(m,w);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,w,T)=>a(al(m),al(w),T,!0)};return U.forEach(Object.keys({...t,...e}),function(w){const T=h[w]||a,P=T(t[w],e[w],w);U.isUndefined(P)&&T!==l||(n[w]=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=Ot.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(([w,T])=>{m.includes(w.toLowerCase())&&u.set(w,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=Ot.from(a.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:m}=a,w,T,P,$,O;function I(){$&&$(),O&&O(),a.cancelToken&&a.cancelToken.unsubscribe(w),a.signal&&a.signal.removeEventListener("abort",w)}let F=new XMLHttpRequest;F.open(a.method.toUpperCase(),a.url,!0),F.timeout=a.timeout;function ne(){if(!F)return;const Ae=Ot.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(Se){const _e=Se&&Se.message?Se.message:"Network Error",We=new he(_e,he.ERR_NETWORK,t,F);We.event=Se||null,s(We),F=null},F.ontimeout=function(){let Se=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _e=a.transitional||Zc;a.timeoutErrorMessage&&(Se=a.timeoutErrorMessage),s(new he(Se,_e.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,t,F)),F=null},c===void 0&&u.setContentType(null),"setRequestHeader"in F&&U.forEach(u.toJSON(),function(Se,_e){F.setRequestHeader(_e,Se)}),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)&&(w=Ae=>{F&&(s(!Ae||Ae.type?new Un(null,t,F):Ae),F.abort(),F=null)},a.cancelToken&&a.cancelToken.subscribe(w),a.signal&&(a.signal.aborted?w():a.signal.addEventListener("abort",w)));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 w=m instanceof Error?m:this.reason;s.abort(w instanceof he?w:new Un(w instanceof Error?w.message:w))}};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},Vm=async function*(t,e){for await(const n of Gm(t))yield*$m(n,e)},Gm=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=Vm(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:w}=await a.next();if(m){l(),h.close();return}let T=w.byteLength;if(n){let P=c+=T;n(P)}h.enqueue(new Uint8Array(w))}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}),w=u&&l&&hl(()=>U.isReadableStream(new s("").body)),T={stream:w&&(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:Se,onDownloadProgress:_e,onUploadProgress:We,responseType:Pe,headers:y,withCredentials:_="same-origin",fetchOptions:v}=ol(O),M=e||fetch;Pe=Pe?(Pe+"").toLowerCase():"text";let k=qm([Y,Ae&&Ae.toAbortSignal()],Se),R=null;const N=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let E;try{if(We&&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[Ue,He]=nl(E,fs(il(We)));ne=ul(J.body,cl,Ue,He)}}U.isString(_)||(_=_?"include":"omit");const C=c&&"credentials"in n.prototype,L={...v,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,v):M(I,L));const q=w&&(Pe==="stream"||Pe==="response");if(w&&(_e||q&&N)){const J={};["status","statusText","headers"].forEach(le=>{J[le]=D[le]});const pe=U.toFiniteNumber(D.headers.get("content-length")),[Ue,He]=_e&&nl(pe,fs(il(_e),!0))||[];D=new s(ul(D.body,cl,Ue,()=>{He&&He(),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:Ot.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,w=Jm;for(;l--;)h=c[l],m=w.get(h),m===void 0&&w.set(h,m=l?new Map:jm(e)),w=m;return m};dl();const Za={http:_m,xhr:Km,fetch:{get:dl}};U.forEach(Za,(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=Za[(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
|
-
`+
|
|
5
|
-
`)
|
|
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=Ot.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 w,T=0,P;if(!h){const O=[gl.bind(this),void 0];for(O.unshift(...l),O.push(...m),P=O.length,w=Promise.resolve(n);T<P;)w=w.then(O[T++],O[T++]);return w}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{w=gl.call(this,$)}catch(O){return Promise.reject(O)}for(T=0,P=m.length;T<P;)w=w.then(m[T++],m[T++]);return w}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 eo={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(eo).forEach(([t,e])=>{eo[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=Ot,Qe.formToJSON=t=>Xc(U.isHTMLForm(t)?new FormData(t):t),Qe.getAdapter=ml.getAdapter,Qe.HttpStatusCode=eo,Qe.default=Qe;const{Axios:pk,AxiosError:mk,CanceledError:gk,isCancel:yk,CancelToken:_k,VERSION:wk,all:bk,Cancel:vk,isAxiosError:Sk,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"},to={longpoll:"longpoll",websocket:"websocket"},ag={complete:4},ro="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(ro)&&(this.authToken=atob(e[1].slice(ro.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("(.*)/"+to.websocket),"$1/"+to.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 w=new Uint8Array(l.byteLength+c.byteLength);return w.set(new Uint8Array(l),0),w.set(new Uint8Array(c),l.byteLength),w.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 w=t.slice(u,t.byteLength);return{join_ref:l,ref:null,topic:h,event:m,payload:w}},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 w=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:w,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}/${to.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",`${ro}${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 vl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wi={exports:{}};/**
|
|
8
|
-
|
|
9
|
-
* Lodash <https://lodash.com/>
|
|
10
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
11
|
-
|
|
12
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
13
|
-
|
|
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,w="__lodash_placeholder__",T=1,P=2,$=4,O=1,I=2,F=1,ne=2,Y=4,Ae=8,Se=16,_e=32,We=64,Pe=128,y=256,_=512,v=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,Ue=J>>>1,He=[["ary",Pe],["bind",F],["bindKey",ne],["curry",Ae],["curryRight",Se],["flip",_],["partial",_e],["partialRight",We],["rearg",y]],le="[object Arguments]",ke="[object Array]",ot="[object AsyncFunction]",Tr="[object Boolean]",Fr="[object Date]",Fi="[object DOMException]",bt="[object Error]",Er="[object Function]",vt="[object GeneratorFunction]",Ie="[object Map]",Be="[object Number]",A1="[object Null]",Wr="[object Object]",nh="[object Promise]",O1="[object Proxy]",Wi="[object RegExp]",lr="[object Set]",Hi="[object String]",ta="[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]",vu="[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,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]/,V1=/\\(\\)?/g,G1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/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,ra=/($^)/,eb=/['\n\r\u2028\u2029\\]/g,na="\\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="["+na+"]",ph="["+dh+"]",ia="["+uh+"]",mh="\\d+",cb="["+ch+"]",gh="["+lh+"]",yh="[^"+na+dh+mh+ch+lh+fh+"]",Ou="\\ud83c[\\udffb-\\udfff]",lb="(?:"+ia+"|"+Ou+")",_h="[^"+na+"]",ku="(?:\\ud83c[\\udde6-\\uddff]){2}",Cu="[\\ud800-\\udbff][\\udc00-\\udfff]",Qn="["+fh+"]",wh="\\u200d",bh="(?:"+gh+"|"+yh+")",fb="(?:"+Qn+"|"+yh+")",vh="(?:"+Au+"(?:d|ll|m|re|s|t|ve))?",Sh="(?:"+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+ia+"?",ia,ku,Cu,ub].join("|")+")",yb=RegExp(Au,"g"),_b=RegExp(ia,"g"),xu=RegExp(Ou+"(?="+Ou+")|"+gb+Ah,"g"),wb=RegExp([Qn+"?"+gh+"+"+vh+"(?="+[ph,Qn,"$"].join("|")+")",fb+"+"+Sh+"(?="+[ph,Qn+bh,"$"].join("|")+")",Qn+"?"+bh+"+"+vh,Qn+"+"+Sh,pb,db,mh,mb].join("|"),"g"),bb=RegExp("["+wh+na+uh+hh+"]"),vb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sb=["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,$e={};$e[pu]=$e[mu]=$e[gu]=$e[yu]=$e[_u]=$e[wu]=$e[bu]=$e[vu]=$e[Su]=!0,$e[le]=$e[ke]=$e[Ki]=$e[Tr]=$e[Jn]=$e[Fr]=$e[bt]=$e[Er]=$e[Ie]=$e[Be]=$e[Wr]=$e[Wi]=$e[lr]=$e[Hi]=$e[Yi]=!1;var Ye={};Ye[le]=Ye[ke]=Ye[Ki]=Ye[Jn]=Ye[Tr]=Ye[Fr]=Ye[pu]=Ye[mu]=Ye[gu]=Ye[yu]=Ye[_u]=Ye[Ie]=Ye[Be]=Ye[Wr]=Ye[Wi]=Ye[lr]=Ye[Hi]=Ye[ta]=Ye[wu]=Ye[bu]=Ye[vu]=Ye[Su]=!0,Ye[bt]=Ye[Er]=Ye[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={"&":"&","<":"<",">":">",'"':""","'":"'"},Ob={"&":"&","<":"<",">":">",""":'"',"'":"'"},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 it=A[ue];W(Z,it,B(it),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 it=A[B];W(it,B,A)&&(Re[ue++]=it)}return Re}function sa(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 Ge(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,it){if(W(ue,Re,it))return Z=Re,!1}),Z}function aa(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):aa(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,it,Fe){B=Z?(Z=!1,Re):W(B,Re,it,Fe)}),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 Ge(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 Ge(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 vb.test(A)}function Vb(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 it=A[B];(it===W||it===w)&&(A[B]=w,Re[ue++]=B)}return Re}function oa(A){var W=-1,B=Array(A.size);return A.forEach(function(Z){B[++W]=Z}),B}function Gb(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 ev=(function A(W){W=W==null?ft:ti.defaults(ft.Object(),W,ti.pick(ft,Sb));var B=W.Array,Z=W.Date,ue=W.Error,Re=W.Function,it=W.Math,Fe=W.Object,Hu=W.RegExp,tv=W.String,Zt=W.TypeError,ua=B.prototype,rv=Re.prototype,ri=Fe.prototype,ca=W["__core-js_shared__"],la=rv.toString,Le=ri.hasOwnProperty,nv=0,qh=(function(){var r=/[^.]+$/.exec(ca&&ca.keys&&ca.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})(),fa=ri.toString,iv=la.call(Fe),sv=ft._,av=Hu("^"+la.call(Le).replace(Tu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ha=kh?W.Buffer:n,on=W.Symbol,da=W.Uint8Array,$h=ha?ha.allocUnsafe:n,pa=Yh(Fe.getPrototypeOf,Fe),Vh=Fe.create,Gh=ri.propertyIsEnumerable,ma=ua.splice,zh=on?on.isConcatSpreadable:n,$i=on?on.iterator:n,On=on?on.toStringTag:n,ga=(function(){try{var r=Rn(Fe,"defineProperty");return r({},"",{}),r}catch{}})(),ov=W.clearTimeout!==ft.clearTimeout&&W.clearTimeout,uv=Z&&Z.now!==ft.Date.now&&Z.now,cv=W.setTimeout!==ft.setTimeout&&W.setTimeout,ya=it.ceil,_a=it.floor,Yu=Fe.getOwnPropertySymbols,lv=ha?ha.isBuffer:n,jh=W.isFinite,fv=ua.join,hv=Yh(Fe.keys,Fe),st=it.max,mt=it.min,dv=Z.now,pv=W.parseInt,Jh=it.random,mv=ua.reverse,Ku=Rn(W,"DataView"),Vi=Rn(W,"Map"),qu=Rn(W,"Promise"),ni=Rn(W,"Set"),Gi=Rn(W,"WeakMap"),zi=Rn(Fe,"create"),wa=Gi&&new Gi,ii={},gv=Dn(Ku),yv=Dn(Vi),_v=Dn(qu),wv=Dn(ni),bv=Dn(Gi),ba=on?on.prototype:n,ji=ba?ba.valueOf:n,Qh=ba?ba.toString:n;function p(r){if(Je(r)&&!fe(r)&&!(r instanceof ve)){if(r instanceof Xt)return r;if(Le.call(r,"__wrapped__"))return Zd(r)}return new Xt(r)}var si=(function(){function r(){}return function(i){if(!je(i))return{};if(Vh)return Vh(i);r.prototype=i;var o=new r;return r.prototype=n,o}})();function va(){}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=va.prototype,p.prototype.constructor=p,Xt.prototype=si(va.prototype),Xt.prototype.constructor=Xt;function ve(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=J,this.__views__=[]}function vv(){var r=new ve(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 Sv(){if(this.__filtered__){var r=new ve(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function Tv(){var r=this.__wrapped__.value(),i=this.__dir__,o=fe(r),f=i<0,d=o?r.length:0,g=NS(0,d,this.__views__),b=g.start,S=g.end,x=S-b,H=f?S:b-1,K=this.__iteratees__,V=K.length,j=0,re=mt(x,this.__takeCount__);if(!o||!f&&d==x&&re==x)return vd(r,this.__actions__);var ae=[];e:for(;x--&&j<re;){H+=i;for(var ge=-1,oe=r[H];++ge<V;){var we=K[ge],Te=we.iteratee,Wt=we.type,Et=Te(oe);if(Wt==E)oe=Et;else if(!Et){if(Wt==N)continue e;break e}}ae[j++]=oe}return ae}ve.prototype=si(va.prototype),ve.prototype.constructor=ve;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 Ev(){this.__data__=zi?zi(null):{},this.size=0}function Av(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function Ov(r){var i=this.__data__;if(zi){var o=i[r];return o===h?n:o}return Le.call(i,r)?i[r]:n}function kv(r){var i=this.__data__;return zi?i[r]!==n:Le.call(i,r)}function Cv(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=Ev,kn.prototype.delete=Av,kn.prototype.get=Ov,kn.prototype.has=kv,kn.prototype.set=Cv;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 xv(){this.__data__=[],this.size=0}function Pv(r){var i=this.__data__,o=Sa(i,r);if(o<0)return!1;var f=i.length-1;return o==f?i.pop():ma.call(i,o,1),--this.size,!0}function Rv(r){var i=this.__data__,o=Sa(i,r);return o<0?n:i[o][1]}function Dv(r){return Sa(this.__data__,r)>-1}function Mv(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=xv,Hr.prototype.delete=Pv,Hr.prototype.get=Rv,Hr.prototype.has=Dv,Hr.prototype.set=Mv;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 Lv(){this.size=0,this.__data__={hash:new kn,map:new(Vi||Hr),string:new kn}}function Nv(r){var i=La(this,r).delete(r);return this.size-=i?1:0,i}function Uv(r){return La(this,r).get(r)}function Bv(r){return La(this,r).has(r)}function Iv(r,i){var o=La(this,r),f=o.size;return o.set(r,i),this.size+=o.size==f?0:1,this}Yr.prototype.clear=Lv,Yr.prototype.delete=Nv,Yr.prototype.get=Uv,Yr.prototype.has=Bv,Yr.prototype.set=Iv;function Cn(r){var i=-1,o=r==null?0:r.length;for(this.__data__=new Yr;++i<o;)this.add(r[i])}function Fv(r){return this.__data__.set(r,h),this}function Wv(r){return this.__data__.has(r)}Cn.prototype.add=Cn.prototype.push=Fv,Cn.prototype.has=Wv;function hr(r){var i=this.__data__=new Hr(r);this.size=i.size}function Hv(){this.__data__=new Hr,this.size=0}function Yv(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}function Kv(r){return this.__data__.get(r)}function qv(r){return this.__data__.has(r)}function $v(r,i){var o=this.__data__;if(o instanceof Hr){var f=o.__data__;if(!Vi||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=Hv,hr.prototype.delete=Yv,hr.prototype.get=Kv,hr.prototype.has=qv,hr.prototype.set=$v;function Zh(r,i){var o=fe(r),f=!o&&Mn(r),d=!o&&!f&&hn(r),g=!o&&!f&&!d&&ci(r),b=o||f||d||g,S=b?Iu(r.length,tv):[],x=S.length;for(var H in r)(i||Le.call(r,H))&&!(b&&(H=="length"||d&&(H=="offset"||H=="parent")||g&&(H=="buffer"||H=="byteLength"||H=="byteOffset")||Vr(H,x)))&&S.push(H);return S}function Xh(r){var i=r.length;return i?r[tc(0,i-1)]:n}function Vv(r,i){return Na(Pt(r),xn(i,0,r.length))}function Gv(r){return Na(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];(!(Le.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 zv(r,i,o,f){return un(r,function(d,g,b){i(f,d,o(d),b)}),f}function ed(r,i){return r&&Or(i,ut(i),r)}function jv(r,i){return r&&Or(i,Dt(i),r)}function Kr(r,i,o){i=="__proto__"&&ga?ga(r,i,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[i]=o}function Vu(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 b,S=i&T,x=i&P,H=i&$;if(o&&(b=d?o(r,f,d,g):o(r)),b!==n)return b;if(!je(r))return r;var K=fe(r);if(K){if(b=BS(r),!S)return Pt(r,b)}else{var V=gt(r),j=V==Er||V==vt;if(hn(r))return Ed(r,S);if(V==Wr||V==le||j&&!d){if(b=x||j?{}:Kd(r),!S)return x?OS(r,jv(b,r)):AS(r,ed(b,r))}else{if(!Ye[V])return d?r:{};b=IS(r,V,S)}}g||(g=new hr);var re=g.get(r);if(re)return re;g.set(r,b),_p(r)?r.forEach(function(oe){b.add(er(oe,i,o,oe,r,g))}):gp(r)&&r.forEach(function(oe,we){b.set(we,er(oe,i,o,we,r,g))});var ae=H?x?hc:fc:x?Dt:ut,ge=K?n:ae(r);return Qt(ge||r,function(oe,we){ge&&(we=oe,oe=r[we]),Ji(b,we,er(oe,i,o,we,r,g))}),b}function Jv(r){var i=ut(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=Fe(r);f--;){var d=o[f],g=i[d],b=r[d];if(b===n&&!(d in r)||!g(b))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=sa,b=!0,S=r.length,x=[],H=i.length;if(!S)return x;o&&(i=Ge(i,Bt(o))),f?(g=Du,b=!1):i.length>=a&&(g=qi,b=!1,i=new Cn(i));e:for(;++d<S;){var K=r[d],V=o==null?K:o(K);if(K=f||K!==0?K:0,b&&V===V){for(var j=H;j--;)if(i[j]===V)continue e;x.push(K)}else g(i,V,f)||x.push(K)}return x}var un=xd(Ar),nd=xd(zu,!0);function Qv(r,i){var o=!0;return un(r,function(f,d,g){return o=!!i(f,d,g),o}),o}function Ta(r,i,o){for(var f=-1,d=r.length;++f<d;){var g=r[f],b=i(g);if(b!=null&&(S===n?b===b&&!Ft(b):o(b,S)))var S=b,x=g}return x}function Zv(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,b=r.length;for(o||(o=WS),d||(d=[]);++g<b;){var S=r[g];i>0&&o(S)?i>1?ht(S,i-1,o,f,d):sn(d,S):f||(d[d.length]=S)}return d}var Gu=Pd(),sd=Pd(!0);function Ar(r,i){return r&&Gu(r,i,ut)}function zu(r,i){return r&&sd(r,i,ut)}function Ea(r,i){return nn(i,function(o){return Gr(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 Fe(r)?LS(r):GS(r)}function ju(r,i){return r>i}function Xv(r,i){return r!=null&&Le.call(r,i)}function eS(r,i){return r!=null&&i in Fe(r)}function tS(r,i,o){return r>=mt(i,o)&&r<st(i,o)}function Ju(r,i,o){for(var f=o?Du:sa,d=r[0].length,g=r.length,b=g,S=B(g),x=1/0,H=[];b--;){var K=r[b];b&&i&&(K=Ge(K,Bt(i))),x=mt(K.length,x),S[b]=!o&&(i||d>=120&&K.length>=120)?new Cn(b&&K):n}K=r[0];var V=-1,j=S[0];e:for(;++V<d&&H.length<x;){var re=K[V],ae=i?i(re):re;if(re=o||re!==0?re:0,!(j?qi(j,ae):f(H,ae,o))){for(b=g;--b;){var ge=S[b];if(!(ge?qi(ge,ae):f(r[b],ae,o)))continue e}j&&j.push(ae),H.push(re)}}return H}function rS(r,i,o,f){return Ar(r,function(d,g,b){i(f,o(d),g,b)}),f}function Zi(r,i,o){i=ln(i,r),r=Gd(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 nS(r){return Je(r)&&St(r)==Ki}function iS(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:sS(r,i,o,f,Xi,d)}function sS(r,i,o,f,d,g){var b=fe(r),S=fe(i),x=b?ke:gt(r),H=S?ke:gt(i);x=x==le?Wr:x,H=H==le?Wr:H;var K=x==Wr,V=H==Wr,j=x==H;if(j&&hn(r)){if(!hn(i))return!1;b=!0,K=!1}if(j&&!K)return g||(g=new hr),b||ci(r)?Wd(r,i,o,f,d,g):DS(r,i,x,o,f,d,g);if(!(o&O)){var re=K&&Le.call(r,"__wrapped__"),ae=V&&Le.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),MS(r,i,o,f,d,g)):!1}function aS(r){return Je(r)&>(r)==Ie}function Qu(r,i,o,f){var d=o.length,g=d,b=!f;if(r==null)return!g;for(r=Fe(r);d--;){var S=o[d];if(b&&S[2]?S[1]!==r[S[0]]:!(S[0]in r))return!1}for(;++d<g;){S=o[d];var x=S[0],H=r[x],K=S[1];if(b&&S[2]){if(H===n&&!(x in r))return!1}else{var V=new hr;if(f)var j=f(H,K,x,r,i,V);if(!(j===n?Xi(K,H,O|I,f,V):j))return!1}}return!0}function ud(r){if(!je(r)||YS(r))return!1;var i=Gr(r)?av:J1;return i.test(Dn(r))}function oS(r){return Je(r)&&St(r)==Wi}function uS(r){return Je(r)&>(r)==lr}function cS(r){return Je(r)&&Ha(r.length)&&!!$e[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 hv(r);var i=[];for(var o in Fe(r))Le.call(r,o)&&o!="constructor"&&i.push(o);return i}function lS(r){if(!je(r))return VS(r);var i=rs(r),o=[];for(var f in r)f=="constructor"&&(i||!Le.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,b){f[++o]=i(d,g,b)}),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 Aa(r,i,o,f,d){r!==i&&Gu(i,function(g,b){if(d||(d=new hr),je(g))fS(r,i,b,o,Aa,f,d);else{var S=f?f(_c(r,b),g,b+"",r,i,d):n;S===n&&(S=g),$u(r,b,S)}},Dt)}function fS(r,i,o,f,d,g,b){var S=_c(r,o),x=_c(i,o),H=b.get(x);if(H){$u(r,o,H);return}var K=g?g(S,x,o+"",r,i,b):n,V=K===n;if(V){var j=fe(x),re=!j&&hn(x),ae=!j&&!re&&ci(x);K=x,j||re||ae?fe(S)?K=S:et(S)?K=Pt(S):re?(V=!1,K=Ed(x,!0)):ae?(V=!1,K=Ad(x,!0)):K=[]:is(x)||Mn(x)?(K=S,Mn(S)?K=vp(S):(!je(S)||Gr(S))&&(K=Kd(x))):V=!1}V&&(b.set(x,K),d(K,x,f,g,b),b.delete(x)),$u(r,o,K)}function dd(r,i){var o=r.length;if(o)return i+=i<0?o:0,Vr(i,o)?r[i]:n}function pd(r,i,o){i.length?i=Ge(i,function(g){return fe(g)?function(b){return Pn(b,g.length===1?g[0]:g)}:g}):i=[Mt];var f=-1;i=Ge(i,Bt(se()));var d=ld(r,function(g,b,S){var x=Ge(i,function(H){return H(g)});return{criteria:x,index:++f,value:g}});return Ib(d,function(g,b){return ES(g,b,o)})}function hS(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 b=i[f],S=Pn(r,b);o(S,b)&&es(g,ln(b,r),S)}return g}function dS(r){return function(i){return Pn(i,r)}}function ec(r,i,o,f){var d=f?Bb:Zn,g=-1,b=i.length,S=r;for(r===i&&(i=Pt(i)),o&&(S=Ge(r,Bt(o)));++g<b;)for(var x=0,H=i[g],K=o?o(H):H;(x=d(S,K,x,f))>-1;)S!==r&&ma.call(S,x,1),ma.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;Vr(d)?ma.call(r,d,1):ic(r,d)}}return r}function tc(r,i){return r+_a(Jh()*(i-r+1))}function pS(r,i,o,f){for(var d=-1,g=st(ya((i-r)/(o||1)),0),b=B(g);g--;)b[f?g:++d]=r,r+=o;return b}function rc(r,i){var o="";if(!r||i<1||i>D)return o;do i%2&&(o+=r),i=_a(i/2),i&&(r+=r);while(i);return o}function ye(r,i){return wc(Vd(r,i,Mt),r+"")}function mS(r){return Xh(li(r))}function gS(r,i){var o=li(r);return Na(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,b=g-1,S=r;S!=null&&++d<g;){var x=kr(i[d]),H=o;if(x==="__proto__"||x==="constructor"||x==="prototype")return r;if(d!=b){var K=S[x];H=f?f(K,x,S):n,H===n&&(H=je(K)?K:Vr(i[d+1])?[]:{})}Ji(S,x,H),S=S[x]}return r}var yd=wa?function(r,i){return wa.set(r,i),r}:Mt,yS=ga?function(r,i){return ga(r,"toString",{configurable:!0,enumerable:!1,value:xc(i),writable:!0})}:Mt;function _S(r){return Na(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 wS(r,i){var o;return un(r,function(f,d,g){return o=i(f,d,g),!o}),!!o}function Oa(r,i,o){var f=0,d=r==null?f:r.length;if(typeof i=="number"&&i===i&&d<=Ue){for(;f<d;){var g=f+d>>>1,b=r[g];b!==null&&!Ft(b)&&(o?b<=i:b<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 b=i!==i,S=i===null,x=Ft(i),H=i===n;d<g;){var K=_a((d+g)/2),V=o(r[K]),j=V!==n,re=V===null,ae=V===V,ge=Ft(V);if(b)var oe=f||ae;else H?oe=ae&&(f||j):S?oe=ae&&j&&(f||!re):x?oe=ae&&j&&!re&&(f||!ge):re||ge?oe=!1:oe=f?V<=i:V<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 b=r[o],S=i?i(b):b;if(!o||!dr(S,x)){var x=S;g[d++]=b===0?0:b}}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 Ge(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=sa,g=r.length,b=!0,S=[],x=S;if(o)b=!1,d=Du;else if(g>=a){var H=i?null:PS(r);if(H)return oa(H);b=!1,d=qi,x=new Cn}else x=i?[]:S;e:for(;++f<g;){var K=r[f],V=i?i(K):K;if(K=o||K!==0?K:0,b&&V===V){for(var j=x.length;j--;)if(x[j]===V)continue e;i&&x.push(V),S.push(K)}else d(x,V,o)||(x!==S&&x.push(V),S.push(K))}return S}function ic(r,i){return i=ln(i,r),r=Gd(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 ka(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 vd(r,i){var o=r;return o instanceof ve&&(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 b=r[d],S=-1;++S<f;)S!=d&&(g[d]=Qi(g[d]||b,r[S],i,o));return cn(ht(g,1),i,o)}function Sd(r,i,o){for(var f=-1,d=r.length,g=i.length,b={};++f<d;){var S=f<g?i[f]:n;o(b,r[f],S)}return b}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(Me(r))}var bS=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=ov||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 da(i).set(new da(r)),i}function vS(r,i){var o=i?uc(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}function SS(r){var i=new r.constructor(r.source,oh.exec(r));return i.lastIndex=r.lastIndex,i}function TS(r){return ji?Fe(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),b=i!==n,S=i===null,x=i===i,H=Ft(i);if(!S&&!H&&!g&&r>i||g&&b&&x&&!S&&!H||f&&b&&x||!o&&x||!d)return 1;if(!f&&!g&&!H&&r<i||H&&o&&d&&!f&&!g||S&&o&&d||!b&&d||!x)return-1}return 0}function ES(r,i,o){for(var f=-1,d=r.criteria,g=i.criteria,b=d.length,S=o.length;++f<b;){var x=Od(d[f],g[f]);if(x){if(f>=S)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,b=o.length,S=-1,x=i.length,H=st(g-b,0),K=B(x+H),V=!f;++S<x;)K[S]=i[S];for(;++d<b;)(V||d<g)&&(K[o[d]]=r[d]);for(;H--;)K[S++]=r[d++];return K}function Cd(r,i,o,f){for(var d=-1,g=r.length,b=-1,S=o.length,x=-1,H=i.length,K=st(g-S,0),V=B(K+H),j=!f;++d<K;)V[d]=r[d];for(var re=d;++x<H;)V[re+x]=i[x];for(;++b<S;)(j||d<g)&&(V[re+o[b]]=r[d++]);return V}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,b=i.length;++g<b;){var S=i[g],x=f?f(o[S],r[S],S,o,r):n;x===n&&(x=r[S]),d?Kr(o,S,x):Ji(o,S,x)}return o}function AS(r,i){return Or(r,mc(r),i)}function OS(r,i){return Or(r,Hd(r),i)}function Ca(r,i){return function(o,f){var d=fe(o)?Rb:zv,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,b=d>2?o[2]:n;for(g=r.length>3&&typeof g=="function"?(d--,g):n,b&&Tt(o[0],o[1],b)&&(g=d<3?n:g,d=1),i=Fe(i);++f<d;){var S=o[f];S&&r(i,S,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,b=Fe(o);(i?g--:++g<d)&&f(b[g],g,b)!==!1;);return o}}function Pd(r){return function(i,o,f){for(var d=-1,g=Fe(i),b=f(i),S=b.length;S--;){var x=b[r?S:++d];if(o(g[x],x,g)===!1)break}return i}}function kS(r,i,o){var f=i&F,d=ts(r);function g(){var b=this&&this!==ft&&this instanceof g?d:r;return b.apply(f?o:this,arguments)}return g}function Rd(r){return function(i){i=Me(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 CS(r,i,o){var f=ts(r);function d(){for(var g=arguments.length,b=B(g),S=g,x=ui(d);S--;)b[S]=arguments[S];var H=g<3&&b[0]!==x&&b[g-1]!==x?[]:an(b,x);if(g-=H.length,g<o)return Ud(r,i,xa,d.placeholder,n,b,H,n,n,o-g);var K=this&&this!==ft&&this instanceof d?f:r;return Ut(K,this,b)}return d}function Dd(r){return function(i,o,f){var d=Fe(i);if(!Rt(i)){var g=se(o,3);i=ut(i),o=function(S){return g(d[S],S,d)}}var b=r(i,o,f);return b>-1?d[g?i[b]:b]: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&&!b&&Ma(g)=="wrapper")var b=new Xt([],!0)}for(f=b?f:o;++f<o;){g=i[f];var S=Ma(g),x=S=="wrapper"?dc(g):n;x&&yc(x[0])&&x[1]==(Pe|Ae|_e|y)&&!x[4].length&&x[9]==1?b=b[Ma(x[0])].apply(b,x[3]):b=g.length==1&&yc(g)?b[S]():b.thru(g)}return function(){var H=arguments,K=H[0];if(b&&H.length==1&&fe(K))return b.plant(K).value();for(var V=0,j=o?i[V].apply(this,H):K;++V<o;)j=i[V].call(this,j);return j}})}function xa(r,i,o,f,d,g,b,S,x,H){var K=i&Pe,V=i&F,j=i&ne,re=i&(Ae|Se),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 Et=ui(oe),Ht=Wb(Te,Et);if(f&&(Te=kd(Te,f,d,re)),g&&(Te=Cd(Te,g,b,re)),we-=Ht,re&&we<H){var tt=an(Te,Et);return Ud(r,i,xa,oe.placeholder,o,Te,tt,S,x,H-we)}var pr=V?o:this,jr=j?pr[r]:r;return we=Te.length,S?Te=zS(Te,S):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 rS(o,r,i(f),{})}}function Pa(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=Ge(i,Bt(se())),ye(function(o){var f=this;return r(i,function(d){return Ut(d,f,o)})})})}function Ra(r,i){i=i===n?" ":It(i);var o=i.length;if(o<2)return o?rc(i,r):i;var f=rc(i,ya(r/ei(i)));return Xn(i)?fn(fr(f),0,r).join(""):f.slice(0,r)}function xS(r,i,o,f){var d=i&F,g=ts(r);function b(){for(var S=-1,x=arguments.length,H=-1,K=f.length,V=B(K+x),j=this&&this!==ft&&this instanceof b?g:r;++H<K;)V[H]=f[H];for(;x--;)V[H++]=arguments[++S];return Ut(j,d?o:this,V)}return b}function Nd(r){return function(i,o,f){return f&&typeof f!="number"&&Tt(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),pS(i,o,f,r)}}function Da(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,b,S,x,H){var K=i&Ae,V=K?b:n,j=K?n:b,re=K?g:n,ae=K?n:g;i|=K?_e:We,i&=~(K?We:_e),i&Y||(i&=-4);var ge=[r,i,d,re,V,ae,j,S,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=it[r];return function(o,f){if(o=nr(o),f=f==null?0:mt(me(f),292),f&&jh(o)){var d=(Me(o)+"e").split("e"),g=i(d[0]+"e"+(+d[1]+f));return d=(Me(g)+"e").split("e"),+(d[0]+"e"+(+d[1]-f))}return i(o)}}var PS=ni&&1/oa(new ni([,-0]))[1]==L?function(r){return new ni(r)}:Dc;function Bd(r){return function(i){var o=gt(i);return o==Ie?Wu(i):o==lr?Gb(i):Fb(i,r(i))}}function qr(r,i,o,f,d,g,b,S){var x=i≠if(!x&&typeof r!="function")throw new Zt(u);var H=f?f.length:0;if(H||(i&=-97,f=d=n),b=b===n?b:st(me(b),0),S=S===n?S:me(S),H-=d?d.length:0,i&We){var K=f,V=d;f=d=n}var j=x?n:dc(r),re=[r,i,o,f,d,K,V,g,b,S];if(j&&$S(re,j),r=re[0],i=re[1],o=re[2],f=re[3],d=re[4],S=re[9]=re[9]===n?x?0:r.length:st(re[9]-H,0),!S&&i&(Ae|Se)&&(i&=-25),!i||i==F)var ae=kS(r,i,o);else i==Ae||i==Se?ae=CS(r,i,S):(i==_e||i==(F|_e))&&!d.length?ae=xS(r,i,o,f):ae=xa.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])&&!Le.call(f,o)?i:r}function Fd(r,i,o,f,d,g){return je(r)&&je(i)&&(g.set(i,r),Aa(r,i,n,Fd,g),g.delete(i)),r}function RS(r){return is(r)?n:r}function Wd(r,i,o,f,d,g){var b=o&O,S=r.length,x=i.length;if(S!=x&&!(b&&x>S))return!1;var H=g.get(r),K=g.get(i);if(H&&K)return H==i&&K==r;var V=-1,j=!0,re=o&I?new Cn:n;for(g.set(r,i),g.set(i,r);++V<S;){var ae=r[V],ge=i[V];if(f)var oe=b?f(ge,ae,V,i,r,g):f(ae,ge,V,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 DS(r,i,o,f,d,g,b){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 da(r),new da(i)));case Tr:case Fr:case Be:return dr(+r,+i);case bt:return r.name==i.name&&r.message==i.message;case Wi:case Hi:return r==i+"";case Ie:var S=Wu;case lr:var x=f&O;if(S||(S=oa),r.size!=i.size&&!x)return!1;var H=b.get(r);if(H)return H==i;f|=I,b.set(r,i);var K=Wd(S(r),S(i),f,d,g,b);return b.delete(r),K;case ta:if(ji)return ji.call(r)==ji.call(i)}return!1}function MS(r,i,o,f,d,g){var b=o&O,S=fc(r),x=S.length,H=fc(i),K=H.length;if(x!=K&&!b)return!1;for(var V=x;V--;){var j=S[V];if(!(b?j in i:Le.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=b;++V<x;){j=S[V];var we=r[j],Te=i[j];if(f)var Wt=b?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 Et=r.constructor,Ht=i.constructor;Et!=Ht&&"constructor"in r&&"constructor"in i&&!(typeof Et=="function"&&Et instanceof Et&&typeof Ht=="function"&&Ht instanceof Ht)&&(ge=!1)}return g.delete(r),g.delete(i),ge}function $r(r){return wc(Vd(r,n,tp),r+"")}function fc(r){return ad(r,ut,mc)}function hc(r){return ad(r,Dt,Hd)}var dc=wa?function(r){return wa.get(r)}:Dc;function Ma(r){for(var i=r.name+"",o=ii[i],f=Le.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=Le.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 La(r,i){var o=r.__data__;return HS(i)?o[typeof i=="string"?"string":"hash"]:o.map}function pc(r){for(var i=ut(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 LS(r){var i=Le.call(r,On),o=r[On];try{r[On]=n;var f=!0}catch{}var d=fa.call(r);return f&&(i?r[On]=o:delete r[On]),d}var mc=Yu?function(r){return r==null?[]:(r=Fe(r),nn(Yu(r),function(i){return Gh.call(r,i)}))}:Mc,Hd=Yu?function(r){for(var i=[];r;)sn(i,mc(r)),r=pa(r);return i}:Mc,gt=St;(Ku&>(new Ku(new ArrayBuffer(1)))!=Jn||Vi&>(new Vi)!=Ie||qu&>(qu.resolve())!=nh||ni&>(new ni)!=lr||Gi&>(new Gi)!=Yi)&&(gt=function(r){var i=St(r),o=i==Wr?r.constructor:n,f=o?Dn(o):"";if(f)switch(f){case gv:return Jn;case yv:return Ie;case _v:return nh;case wv:return lr;case bv:return Yi}return i});function NS(r,i,o){for(var f=-1,d=o.length;++f<d;){var g=o[f],b=g.size;switch(g.type){case"drop":r+=b;break;case"dropRight":i-=b;break;case"take":i=mt(i,r+b);break;case"takeRight":r=st(r,i-b);break}}return{start:r,end:i}}function US(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 b=kr(i[f]);if(!(g=r!=null&&o(r,b)))break;r=r[b]}return g||++f!=d?g:(d=r==null?0:r.length,!!d&&Ha(d)&&Vr(b,d)&&(fe(r)||Mn(r)))}function BS(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&Le.call(r,"index")&&(o.index=r.index,o.input=r.input),o}function Kd(r){return typeof r.constructor=="function"&&!rs(r)?si(pa(r)):{}}function IS(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 vS(r,o);case pu:case mu:case gu:case yu:case _u:case wu:case bu:case vu:case Su:return Ad(r,o);case Ie:return new f;case Be:case Hi:return new f(r);case Wi:return SS(r);case lr:return new f;case ta:return TS(r)}}function FS(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
|
-
|
|
16
|
-
`)}function WS(r){return fe(r)||Mn(r)||!!(zh&&r&&r[zh])}function Vr(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 Tt(r,i,o){if(!je(o))return!1;var f=typeof i;return(f=="number"?Rt(o)&&Vr(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 Fe(i)}function HS(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function yc(r){var i=Ma(r),o=p[i];if(typeof o!="function"||!(i in ve.prototype))return!1;if(r===o)return!0;var f=dc(o);return!!f&&r===f[0]}function YS(r){return!!qh&&qh in r}var KS=ca?Gr: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 Fe(o))}}function qS(r){var i=Fa(r,function(f){return o.size===m&&o.clear(),f}),o=i.cache;return i}function $S(r,i){var o=r[1],f=i[1],d=o|f,g=d<(F|ne|Pe),b=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||b))return r;f&F&&(r[2]=i[2],d|=o&F?0:Y);var S=i[3];if(S){var x=r[3];r[3]=x?kd(x,S,i[4]):S,r[4]=x?an(r[3],w):i[4]}return S=i[5],S&&(x=r[5],r[5]=x?Cd(x,S,i[6]):S,r[6]=x?an(r[5],w):i[6]),S=i[7],S&&(r[7]=S),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 VS(r){var i=[];if(r!=null)for(var o in Fe(r))i.push(o);return i}function GS(r){return fa.call(r)}function Vd(r,i,o){return i=st(i===n?r.length-1:i,0),function(){for(var f=arguments,d=-1,g=st(f.length-i,0),b=B(g);++d<g;)b[d]=f[i+d];d=-1;for(var S=B(i+1);++d<i;)S[d]=f[d];return S[i]=o(b),Ut(r,this,S)}}function Gd(r,i){return i.length<2?r:Pn(r,tr(i,0,-1))}function zS(r,i){for(var o=r.length,f=mt(i.length,o),d=Pt(r);f--;){var g=i[f];r[f]=Vr(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=cv||function(r,i){return ft.setTimeout(r,i)},wc=Jd(yS);function jd(r,i,o){var f=i+"";return wc(r,FS(f,jS(US(f),o)))}function Jd(r){var i=0,o=0;return function(){var f=dv(),d=R-(f-o);if(o=f,d>0){if(++i>=k)return arguments[0]}else i=0;return r.apply(n,arguments)}}function Na(r,i){var o=-1,f=r.length,d=f-1;for(i=i===n?f:i;++o<i;){var g=tc(o,d),b=r[g];r[g]=r[o],r[o]=b}return r.length=i,r}var Qd=qS(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(I1,function(o,f,d,g){i.push(d?g.replace(V1,"$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 la.call(r)}catch{}try{return r+""}catch{}}return""}function jS(r,i){return Qt(He,function(o){var f="_."+o[0];i&o[1]&&!sa(r,f)&&r.push(f)}),r.sort()}function Zd(r){if(r instanceof ve)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 JS(r,i,o){(o?Tt(r,i,o):i===n)?i=1:i=st(me(i),0);var f=r==null?0:r.length;if(!f||i<1)return[];for(var d=0,g=0,b=B(ya(f/i));d<f;)b[g++]=tr(r,d,d+=i);return b}function QS(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 ZS(){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 XS=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?ka(r,se(i,3),!0,!0):[]}function sT(r,i){return r&&r.length?ka(r,se(i,3),!0):[]}function aT(r,i,o,f){var d=r==null?0:r.length;return d?(o&&typeof o!="number"&&Tt(r,i,o)&&(o=0,f=d),Zv(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=st(f+d,0)),aa(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?st(f+d,0):mt(d,f-1)),aa(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=st(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=Ge(r,ac);return i.length&&i[0]===r[0]?Ju(i):[]}),dT=ye(function(r){var i=rr(r),o=Ge(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=Ge(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?"":fv.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?st(f+d,0):mt(d,f-1)),i===i?jb(r,i,d):aa(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 vT=$r(function(r,i){var o=r==null?0:r.length,f=Vu(r,i);return gd(r,Ge(i,function(d){return Vr(d,o)?+d:d}).sort(Od)),f});function ST(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 b=r[f];i(b,f,r)&&(o.push(b),d.push(f))}return gd(r,d),o}function bc(r){return r==null?r:mv.call(r)}function TT(r,i,o){var f=r==null?0:r.length;return f?(o&&typeof o!="number"&&Tt(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 Oa(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=Oa(r,i);if(f<o&&dr(r[f],i))return f}return-1}function kT(r,i){return Oa(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=Oa(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?ka(r,se(i,3),!1,!0):[]}function UT(r,i){return r&&r.length?ka(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 vc(r){if(!(r&&r.length))return[];var i=0;return r=nn(r,function(o){if(et(o))return i=st(o.length,i),!0}),Iu(i,function(o){return Ge(r,Nu(o))})}function ip(r,i){if(!(r&&r.length))return[];var o=vc(r);return i==null?o:Ge(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))}),VT=ye(function(r){var i=rr(r);return i=typeof i=="function"?i:n,sc(nn(r,et),n,i)}),GT=ye(vc);function zT(r,i){return Sd(r||[],i||[],Ji)}function jT(r,i){return Sd(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 Ua(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 Vu(g,r)};return i>1||this.__actions__.length||!(f instanceof ve)||!Vr(o)?this.thru(d):(f=f.slice(o,+o+(i?1:0)),f.__actions__.push({func:Ua,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 va;){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 ve){var i=r;return this.__actions__.length&&(i=new ve(this)),i=i.reverse(),i.__actions__.push({func:Ua,args:[bc],thisArg:n}),new Xt(i,this.__chain__)}return this.thru(bc)}function sE(){return vd(this.__wrapped__,this.__actions__)}var aE=Ca(function(r,i,o){Le.call(r,o)?++r[o]:Kr(r,o,1)});function oE(r,i,o){var f=fe(r)?Lh:Qv;return o&&Tt(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(Ba(r,i),1)}function hE(r,i){return ht(Ba(r,i),L)}function dE(r,i,o){return o=o===n?1:me(o),ht(Ba(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=Ca(function(r,i,o){Le.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=st(d+o,0)),Ya(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(b){g[++f]=d?Ut(i,b,o):Zi(b,i,o)}),g}),yE=Ca(function(r,i,o){Kr(r,o,i)});function Ba(r,i){var o=fe(r)?Ge: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=Ca(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 vE(r,i,o){var f=fe(r)?Mb:Ih,d=arguments.length<3;return f(r,se(i,4),o,d,nd)}function SE(r,i){var o=fe(r)?nn:id;return o(r,Wa(se(i,3)))}function TE(r){var i=fe(r)?Xh:mS;return i(r)}function EE(r,i,o){(o?Tt(r,i,o):i===n)?i=1:i=me(i);var f=fe(r)?Vv:gS;return f(r,i)}function AE(r){var i=fe(r)?Gv:_S;return i(r)}function OE(r){if(r==null)return 0;if(Rt(r))return Ya(r)?ei(r):r.length;var i=gt(r);return i==Ie||i==lr?r.size:Zu(r).length}function kE(r,i,o){var f=fe(r)?Lu:wS;return o&&Tt(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&&Tt(r,i[0],i[1])?i=[]:o>2&&Tt(i[0],i[1],i[2])&&(i=[i[0]]),pd(r,ht(i,1),[])}),Ia=uv||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,Se,n,n,n,n,n,i);return f.placeholder=hp.placeholder,f}function dp(r,i,o){var f,d,g,b,S,x,H=0,K=!1,V=!1,j=!0;if(typeof r!="function")throw new Zt(u);i=nr(i)||0,je(o)&&(K=!!o.leading,V="maxWait"in o,g=V?st(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,b=r.apply(jr,pr),b}function ae(tt){return H=tt,S=ns(we,i),K?re(tt):b}function ge(tt){var pr=tt-x,jr=tt-H,Dp=i-pr;return V?mt(Dp,g-jr):Dp}function oe(tt){var pr=tt-x,jr=tt-H;return x===n||pr>=i||pr<0||V&&jr>=g}function we(){var tt=Ia();if(oe(tt))return Te(tt);S=ns(we,ge(tt))}function Te(tt){return S=n,j&&f?re(tt):(f=d=n,b)}function Wt(){S!==n&&Td(S),H=0,f=x=d=S=n}function Et(){return S===n?b:Te(Ia())}function Ht(){var tt=Ia(),pr=oe(tt);if(f=arguments,d=this,x=tt,pr){if(S===n)return ae(x);if(V)return Td(S),S=ns(we,i),re(x)}return S===n&&(S=ns(we,i)),b}return Ht.cancel=Wt,Ht.flush=Et,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 Fa(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 b=r.apply(this,f);return o.cache=g.set(d,b)||g,b};return o.cache=new(Fa.Cache||Yr),o}Fa.Cache=Yr;function Wa(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=bS(function(r,i){i=i.length==1&&fe(i[0])?Ge(i[0],Bt(se())):Ge(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,We,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:st(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 VE(r,i){return i==null||td(r,i,ut(i))}function dr(r,i){return r===i||r!==r&&i!==i}var GE=Da(ju),zE=Da(function(r,i){return r>=i}),Mn=od((function(){return arguments})())?od:function(r){return Je(r)&&Le.call(r,"callee")&&!Gh.call(r,"callee")},fe=B.isArray,jE=Ch?Bt(Ch):nS;function Rt(r){return r!=null&&Ha(r.length)&&!Gr(r)}function et(r){return Je(r)&&Rt(r)}function JE(r){return r===!0||r===!1||Je(r)&&St(r)==Tr}var hn=lv||Lc,QE=xh?Bt(xh):iS;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==Ie||i==lr)return!r.size;if(rs(r))return!Zu(r).length;for(var o in r)if(Le.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==bt||i==Fi||typeof r.message=="string"&&typeof r.name=="string"&&!is(r)}function rA(r){return typeof r=="number"&&jh(r)}function Gr(r){if(!je(r))return!1;var i=St(r);return i==Er||i==vt||i==ot||i==O1}function mp(r){return typeof r=="number"&&r==me(r)}function Ha(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):aS;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(KS(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)==Be}function is(r){if(!Je(r)||St(r)!=Wr)return!1;var i=pa(r);if(i===null)return!0;var o=Le.call(i,"constructor")&&i.constructor;return typeof o=="function"&&o instanceof o&&la.call(o)==iv}var Ac=Rh?Bt(Rh):oS;function cA(r){return mp(r)&&r>=-D&&r<=D}var _p=Dh?Bt(Dh):uS;function Ya(r){return typeof r=="string"||!fe(r)&&Je(r)&&St(r)==Hi}function Ft(r){return typeof r=="symbol"||Je(r)&&St(r)==ta}var ci=Mh?Bt(Mh):cS;function lA(r){return r===n}function fA(r){return Je(r)&>(r)==Yi}function hA(r){return Je(r)&&St(r)==C1}var dA=Da(Xu),pA=Da(function(r,i){return r<=i});function wp(r){if(!r)return[];if(Rt(r))return Ya(r)?fr(r):Pt(r);if($i&&r[$i])return Vb(r[$i]());var i=gt(r),o=i==Ie?Wu:i==lr?oa: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 vp(r){return Or(r,Dt(r))}function mA(r){return r?xn(me(r),-D,D):r===0?r:0}function Me(r){return r==null?"":It(r)}var gA=ai(function(r,i){if(rs(i)||Rt(i)){Or(i,ut(i),r);return}for(var o in i)Le.call(i,o)&&Ji(r,o,i[o])}),Sp=ai(function(r,i){Or(i,Dt(i),r)}),Ka=ai(function(r,i,o,f){Or(i,Dt(i),r,f)}),yA=ai(function(r,i,o,f){Or(i,ut(i),r,f)}),_A=$r(Vu);function wA(r,i){var o=si(r);return i==null?o:ed(o,i)}var bA=ye(function(r,i){r=Fe(r);var o=-1,f=i.length,d=f>2?i[2]:n;for(d&&Tt(i[0],i[1],d)&&(f=1);++o<f;)for(var g=i[o],b=Dt(g),S=-1,x=b.length;++S<x;){var H=b[S],K=r[H];(K===n||dr(K,ri[H])&&!Le.call(r,H))&&(r[H]=g[H])}return r}),vA=ye(function(r){return r.push(n,Fd),Ut(Tp,n,r)});function SA(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: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&&zu(r,se(i,3))}function CA(r){return r==null?[]:Ea(r,ut(r))}function xA(r){return r==null?[]:Ea(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,Xv)}function kc(r,i){return r!=null&&Yd(r,i,eS)}var RA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=fa.call(i)),r[i]=o},xc(Mt)),DA=Ld(function(r,i,o){i!=null&&typeof i.toString!="function"&&(i=fa.call(i)),Le.call(r,i)?r[i].push(o):r[i]=[o]},se),MA=ye(Zi);function ut(r){return Rt(r)?Zh(r):Zu(r)}function Dt(r){return Rt(r)?Zh(r,!0):lS(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){Aa(r,i,o)}),Tp=ai(function(r,i,o,f){Aa(r,i,o,f)}),BA=$r(function(r,i){var o={};if(r==null)return o;var f=!1;i=Ge(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|$,RS));for(var d=i.length;d--;)ic(o,i[d]);return o});function IA(r,i){return Ep(r,Wa(se(i)))}var FA=$r(function(r,i){return r==null?{}:hS(r,i)});function Ep(r,i){if(r==null)return{};var o=Ge(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=Gr(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(ut),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=Gr(g)?si(pa(r)):{}:o={}}return(d?Qt:Ar)(r,function(b,S,x){return i(o,b,S,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 VA(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,ut(r))}function GA(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),tS(r,i,o)}function JA(r,i,o){if(o&&typeof o!="boolean"&&Tt(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(Me(r).toLowerCase())}function Cp(r){return r=Me(r),r&&r.replace(X1,Hb).replace(_b,"")}function ZA(r,i,o){r=Me(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=Me(r),r&&M1.test(r)?r.replace(sh,Yb):r}function eO(r){return r=Me(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=Me(r),i=me(i);var f=i?ei(r):0;if(!i||f>=i)return r;var d=(i-f)/2;return Ra(_a(d),o)+r+Ra(ya(d),o)}function sO(r,i,o){r=Me(r),i=me(i);var f=i?ei(r):0;return i&&f<i?r+Ra(i-f,o):r}function aO(r,i,o){r=Me(r),i=me(i);var f=i?ei(r):0;return i&&f<i?Ra(i-f,o)+r:r}function oO(r,i,o){return o||i==null?i=0:i&&(i=+i),pv(Me(r).replace(Eu,""),i||0)}function uO(r,i,o){return(o?Tt(r,i,o):i===n)?i=1:i=me(i),rc(Me(r),i)}function cO(){var r=arguments,i=Me(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"&&Tt(r,i,o)&&(i=o=n),o=o===n?J:o>>>0,o?(r=Me(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=Me(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&&Tt(r,i,o)&&(i=n),r=Me(r),i=Ka({},i,f,Id);var d=Ka({},i.imports,f.imports,Id),g=ut(d),b=Fu(d,g),S,x,H=0,K=i.interpolate||ra,V="__p += '",j=Hu((i.escape||ra).source+"|"+K.source+"|"+(K===ah?G1:ra).source+"|"+(i.evaluate||ra).source+"|$","g"),re="//# sourceURL="+(Le.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tb+"]")+`
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'`),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
((__t = (`+Te+`)) == null ? '' : __t) +
|
|
23
|
-
'`),H=Ht+oe.length,oe}),V+=`';
|
|
24
|
-
`;var ae=Le.call(i,"variable")&&i.variable;if(!ae)V=`with (obj) {
|
|
25
|
-
`+V+`
|
|
1
|
+
var Coinray=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=S(),f=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,p=Math.ceil,m=Math.floor,h=`[BigNumber Error] `,g=0x5af3107a4000,_=14,v=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],b=1e7,x=1e9;function S(e){var t,n,r=/^(-?)0([xbo])(?=[^.])/i,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?!-)|^\s+|\s+$/g,o=A.prototype={constructor:A,toString:null,valueOf:null},s=new A(1),c=20,l=4,u=-7,d=21,O=-1e7,k=1e7,re=!1,ie=!0,ae=1,oe=0,se={prefix:``,negativeSign:`-`,positiveSign:``,groupSeparator:`,`,groupSize:3,secondaryGroupSize:0,decimalSeparator:`.`,fractionGroupSeparator:``,fractionGroupSize:0,suffix:``},ce=`0123456789abcdefghijklmnopqrstuvwxyz`;function A(e,t){var n,o,s,c,l=this;if(!(l instanceof A))return new A(e,t);if(c=typeof e,t==null){if(fe(e)){l.s=e.s,!e.c||e.e>k?l.c=l.e=null:e.e<O?l.c=[l.e=0]:(l.e=e.e,l.c=e.c.slice());return}if(c==`number`){if(e*0!=0){l.s=isNaN(e)?null:e<0?-1:1,l.c=l.e=null;return}if(l.s=1/e<0?(e=-e,-1):1,e===~~e){for(n=0,o=e;o>=10;o/=10,n++);n>k?l.c=l.e=null:(l.e=n,l.c=[e]);return}return le(l,String(e))}if(c==`bigint`)return l.s=e<0?(e=-e,-1):1,le(l,String(e));if(c==`string`)s=e;else{if(ie)throw Error(h+`BigNumber, string, number, or BigInt expected: `+e);s=String(e)}if(f.test(s))return l.s=s.charCodeAt(0)==45?(s=s.slice(1),-1):1,le(l,s);if(s=s.replace(a,``),i.test(s)){l.s=isNaN(s)?null:s<0?-1:1,l.c=l.e=null;return}if(s=s.replace(r,function(e,n,r){return t=(r=r.toLowerCase())==`x`?16:r==`b`?2:8,n}),t)return ue(l,s,t,e);if(s=s.replace(/(\d)_(?=\d)/g,`$1`),f.test(s))return l.s=s.charCodeAt(0)==45?(s=s.slice(1),-1):1,le(l,s);if(ie)throw Error(h+`Not a number: `+e);l.s=l.c=l.e=null}else{if(c!=`string`){if(ie)throw Error(h+`String expected: `+e);e=String(e)}T(t,2,ce.length,`Base`),ue(l,e.replace(a,``),t,e)}}A.clone=S,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.EUCLID=9,A.config=A.set=function(e){var t,n;if(e!=null){if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(c=T(e[t],0,x,t)),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(l=T(e[t],0,8,t)),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],te(n)?(T(n[0],-x,0,t),T(n[1],0,x,t),u=n[0],d=n[1]):u=-(d=T(n,-x,x,t)<0?-n:n)),e.hasOwnProperty(t=`RANGE`)){if(n=e[t],n)te(n)?(T(n[0],-x,-1,t),T(n[1],1,x,t),O=n[0],k=n[1]):O=-(k=T(n,-x,x,t)<0?-n:n);else throw Error(h+t+` cannot be zero: `+n)}if(e.hasOwnProperty(t=`CRYPTO`)){if(n=e[t],n===!!n){if(n){if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))re=n;else throw re=!n,Error(h+`crypto unavailable`)}else re=n}else throw Error(h+t+` not true or false: `+n)}if(e.hasOwnProperty(t=`STRICT`)){if(n=e[t],n===!!n)ie=n;else throw Error(h+t+` not true or false: `+n)}if(e.hasOwnProperty(t=`MODULO_MODE`)&&(ae=T(e[t],0,9,t)),e.hasOwnProperty(t=`POW_PRECISION`)&&(oe=T(e[t],0,x,t)),e.hasOwnProperty(t=`FORMAT`)){if(n=e[t],typeof n==`object`)for(t in n)n.hasOwnProperty(t)&&se.hasOwnProperty(t)&&(se[t]=n[t]);else throw Error(h+t+` not an object: `+n)}if(e.hasOwnProperty(t=`ALPHABET`)){if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))ce=n;else throw Error(h+t+` invalid: `+n)}}else throw Error(h+`Object expected: `+e)}return{DECIMAL_PLACES:c,ROUNDING_MODE:l,EXPONENTIAL_AT:[u,d],RANGE:[O,k],CRYPTO:re,STRICT:ie,MODULO_MODE:ae,POW_PRECISION:oe,FORMAT:se,ALPHABET:ce}},A.fromFormat=function(e,t){if(typeof e!=`string`)throw Error(h+`Not a string: `+e);if(t==null)t=se;else if(typeof t!=`object`)throw Error(h+`Argument not an object: `+t);else t=he(t);var n,r,i,a,o=t.negativeSign||`-`,s=t.positiveSign||``,c=t.prefix||``,l=t.suffix||``,u=t.groupSeparator||``,d=t.decimalSeparator||`.`,f=t.fractionGroupSeparator||``;if(c&&e.indexOf(c)===0&&(e=e.slice(c.length)),l&&e.lastIndexOf(l)===e.length-l.length&&(e=e.slice(0,-l.length)),o&&e.indexOf(o)===0?(e=e.slice(o.length),r=!0):s&&e.indexOf(s)===0&&(e=e.slice(s.length)),n=e.indexOf(d),n<0){if(u)for(;e.indexOf(u)>-1;)e=e.replace(u,``)}else{if(i=e.slice(0,n),a=e.slice(n+d.length),u)for(;i.indexOf(u)>-1;)i=i.replace(u,``);if(f)for(;a.indexOf(f)>-1;)a=a.replace(f,``);e=i+`.`+a}return new A(r?`-`+e:e)},A.isBigNumber=function(e){if(!fe(e))return!1;var t,n,r=e.c,i=e.e,a=e.s;if(!te(r))return r===null&&i===null&&(a===null||a===1||a===-1);if(a!==1&&a!==-1||i<-x||i>x||i!==m(i))return!1;if(r[0]===0)return i===0&&r.length===1;if(t=(i+1)%_,t<1&&(t+=_),String(r[0]).length!==t)return!1;for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=g||n!==m(n))return!1;return n!==0},A.maximum=A.max=function(){return pe(arguments,-1)},A.minimum=A.min=function(){return pe(arguments,1)},A.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return m(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,i,a,o,l=0,u=[],d=new A(s);if(e=e==null?c:T(e,0,x),a=p(e/_),re){if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(a*=2));l<a;)o=n[l]*131072+(n[l+1]>>>11),o>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[l]=r[0],n[l+1]=r[1]):(u.push(o%0x5af3107a4000),l+=2);l=a/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(a*=7);l<a;)o=(n[l]&31)*281474976710656+n[l+1]*1099511627776+n[l+2]*4294967296+n[l+3]*16777216+(n[l+4]<<16)+(n[l+5]<<8)+n[l+6],o>=9e15?crypto.randomBytes(7).copy(n,l):(u.push(o%0x5af3107a4000),l+=7);l=a/7}else throw re=!1,Error(h+`crypto unavailable`)}if(!re)for(;l<a;)o=t(),o<9e15&&(u[l++]=o%0x5af3107a4000);for(a=u[--l],e%=_,a&&e&&(o=y[_-e],u[l]=m(a/o)*o);u[l]===0;u.pop(),l--);if(l<0)u=[i=0];else{for(i=-1;u[0]===0;u.splice(0,1),i-=_);for(l=1,o=u[0];o>=10;o/=10,l++);l<_&&(i-=_-l)}return d.e=i,d.c=u,d}})(),A.sum=function(){for(var e=0,t=new A(0);e<arguments.length;)t=t.plus(arguments[e++]);return t};function le(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(--i)===48;);if(t=t.slice(r,++i)){if(i-=r,n=n-r-1,n>k)e.c=e.e=null;else if(n<O)e.c=[e.e=0];else{if(e.e=n,e.c=[],r=(n+1)%_,n<0&&(r+=_),r<i){for(r&&e.c.push(+t.slice(0,r)),i-=_;r<i;)e.c.push(+t.slice(r,r+=_));r=_-(t=t.slice(r)).length}else r-=i;for(;r--;t+=`0`);e.c.push(+t)}}else e.c=[e.e=0]}function ue(e,t,r,i){var a,o,s=ce.slice(0,r),c=0,l=``,u=!1,d=!1,f=!1;for(e.s=t.charCodeAt(0)===45?(t=t.slice(1),-1):1,o=t.length;c<o;c++){if(a=t.charAt(c),s.indexOf(a)>=0){l+=a,d=!0;continue}if(a==`_`){if(d&&c+1<o){d=!1;continue}}else if(a==`.`){if(c==0||!u&&d){if(c+1==o)break;c==0&&(l=`0`),l+=a,u=!0,d=!1;continue}}else if(!f&&(t==t.toUpperCase()&&s==s.toLowerCase()&&(t=t.toLowerCase())||t==t.toLowerCase()&&s==s.toUpperCase()&&(t=t.toUpperCase()))){c=-1,l=``,f=!0,u=d=!1;continue}if(ie)throw Error(h+`Not a base `+r+` number: `+i);e.s=e.c=e.e=null;return}le(e,n(l,r,10,e.s))}n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var u,d,f,p,m,h,g,_,v=r.indexOf(`.`),y=c,b=l;for(v>=0&&(p=oe,oe=0,r=r.replace(`.`,``),_=new A(i),h=_.pow(r.length-v),oe=p,_.c=n(D(w(h.c),h.e,`0`),10,a,e),_.e=_.c.length),g=n(r,i,a,s?(u=ce,e):(u=e,ce)),f=p=g.length;g[--p]==0;g.pop());if(!g[0])return u.charAt(0);if(v<0?--f:(h.c=g,h.e=f,h.s=o,h=t(h,_,y,b,a),g=h.c,m=h.r,f=h.e),d=f+y+1,v=g[d],p=a/2,m=m||d<0||g[d+1]!=null,m=b<4?(v!=null||m)&&(b==0||b==(h.s<0?3:2)):v>p||v==p&&(b==4||m||b==6&&g[d-1]&1||b==(h.s<0?8:7)),d<1||!g[0])r=m?D(u.charAt(1),-y,u.charAt(0)):u.charAt(0);else{if(d<g.length&&(g.length=d),m)for(--a;++g[--d]>a;)g[d]=0,d||(++f,g=[1].concat(g));for(p=g.length;!g[--p];);for(v=0,r=``;v<=p;r+=u.charAt(g[v++]));r=D(r,f,u.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%b,u=t/b|0;for(e=e.slice();c--;)a=e[c]%b,o=e[c]/b|0,r=u*a+o*l,i=l*a+r%b*b+s,s=(i/n|0)+(r/b|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,a,o,s){var c,l,u,d,f,p,h,v,y,b,x,S,w,ee,T,te,ne,E=r.s==i.s?1:-1,D=r.c,O=i.c;if(!D||!D[0]||!O||!O[0])return new A(!r.s||!i.s||(D?O&&D[0]==O[0]:!O)?NaN:D&&D[0]==0||!O?E*0:E/0);for(v=new A(E),y=v.c=[],l=r.e-i.e,E=a+l+1,s||(s=g,l=C(r.e/_)-C(i.e/_),E=E/_|0),u=0;O[u]==(D[u]||0);u++);if(O[u]>(D[u]||0)&&l--,E<0)y.push(1),d=!0;else{for(ee=D.length,te=O.length,u=0,E+=2,f=m(s/(O[0]+1)),f>1&&(O=e(O,f,s),D=e(D,f,s),te=O.length,ee=D.length),w=te,b=D.slice(0,te),x=b.length;x<te;b[x++]=0);ne=O.slice(),ne=[0].concat(ne),T=O[0],O[1]>=s/2&&T++;do{if(f=0,c=t(O,b,te,x),c<0){if(S=b[0],te!=x&&(S=S*s+(b[1]||0)),f=m(S/T),f>1)for(f>=s&&(f=s-1),p=e(O,f,s),h=p.length,x=b.length;t(p,b,h,x)==1;)f--,n(p,te<h?ne:O,h,s),h=p.length,c=1;else f==0&&(c=f=1),p=O.slice(),h=p.length;if(h<x&&(p=[0].concat(p)),n(b,p,x,s),x=b.length,c==-1)for(;t(O,b,te,x)<1;)f++,n(b,te<x?ne:O,x,s),x=b.length}else c===0&&(f++,b=[0]);y[u++]=f,b[0]?b[x++]=D[w]||0:(b=[D[w]],x=1)}while((w++<ee||b[0]!=null)&&E--);d=b[0]!=null,y[0]||y.splice(0,1)}if(s==g){for(u=1,E=y[0];E>=10;E/=10,u++);ge(v,a+(v.e=u+l*_-1)+1,o,d)}else v.e=l,v.r=+d;return v}})();function de(e,t,n,r){var i,a,o,s,c;if(n=n==null?l:T(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=w(e.c),c=r==1||r==2&&(o<=u||o>=d)?E(c,o):D(c,o,`0`);else if(e=ge(new A(e),t,n),a=e.e,c=w(e.c),s=c.length,r==1||r==2&&(t<=a||a<=u)){for(;s<t;c+=`0`,s++);c=E(c,a)}else if(t-=o+(r===2&&a>o),c=D(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function fe(e){return e instanceof A||!!e&&e._isBigNumber===!0}function pe(e,t){for(var n,r,i=1,a=new A(e[0]);i<e.length;i++)r=new A(e[i]),(!r.s||(n=ee(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function me(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*_-1)>k?e.c=e.e=null:n<O?e.c=[e.e=0]:(e.e=n,e.c=t),e}function he(e){var t,n={};for(t in se)se.hasOwnProperty(t)&&(n[t]=e.hasOwnProperty(t)?e[t]:se[t]);return n}function ge(e,t,n,r){var i,a,o,s,c,l,u,d=e.c,f=y;if(d){out:{for(i=1,s=d[0];s>=10;s/=10,i++);if(a=t-i,a<0)a+=_,o=t,c=d[l=0],u=m(c/f[i-o-1]%10);else if(l=p((a+1)/_),l>=d.length){if(r){for(;d.length<=l;d.push(0));c=u=0,i=1,a%=_,o=a-_+1}else break out}else{for(c=s=d[l],i=1;s>=10;s/=10,i++);a%=_,o=a-_+i,u=o<0?0:m(c/f[i-o-1]%10)}if(r=r||t<0||d[l+1]!=null||(o<0?c:c%f[i-o-1]),r=n<4?(u||r)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||r||n==6&&(a>0?o>0?c/f[i-o]:0:d[l-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,r?(t-=e.e+1,d[0]=f[(_-t%_)%_],e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=l,s=1,l--):(d.length=l+1,s=f[_-a],d[l]=o>0?m(c/f[i-o]%f[o])*s:0),r)for(;;)if(l==0){for(a=1,o=d[0];o>=10;o/=10,a++);for(o=d[0]+=s,s=1;o>=10;o/=10,s++);a!=s&&(e.e++,d[0]==g&&(d[0]=1));break}else{if(d[l]+=s,d[l]!=g)break;d[l--]=0,s=1}for(a=d.length;d[--a]===0;d.pop());}e.e>k?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function _e(e){var t,n=e.e;return n===null?e.toString():(t=w(e.c),t=n<=u||n>=d?E(t,n):D(t,n,`0`),e.s<0?`-`+t:t)}return o.absoluteValue=o.abs=function(){var e=new A(this);return e.s<0&&(e.s=1),e},o.comparedTo=function(e,t){return ee(this,new A(e,t))},o.decimalPlaces=o.dp=function(e,t){var n,r,i,a=this;if(e!=null)return ge(new A(a),T(e,-x,x)+a.e+1,t==null?l:T(t,0,8));if(!(n=a.c))return null;if(r=((i=n.length-1)-C(this.e/_))*_,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},o.dividedBy=o.div=function(e,n){return t(this,new A(e,n),c,l)},o.dividedToIntegerBy=o.idiv=function(e,n){return t(this,new A(e,n),0,1)},o.exponentiatedBy=o.pow=function(e,t){var n,r,i,a,o,c,u,d,f,g=this;if(e=new A(e),e.c&&!e.isInteger())throw Error(h+`Exponent not an integer: `+_e(e));if(t!=null&&(t=new A(t)),c=e.e>14,!g.c||!g.c[0]||g.c[0]==1&&!g.e&&g.c.length==1||!e.c||!e.c[0])return f=new A((+_e(g))**(c?e.s*(2-ne(e)):+_e(e))),t?f.mod(t):f;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new A(NaN);r=!u&&g.isInteger()&&t.isInteger(),r&&(g=g.mod(t))}else if(e.e>9&&(g.e>0||g.e<-1||(g.e==0?g.c[0]>1||c&&g.c[1]>=24e7:g.c[0]<8e13||c&&g.c[0]<=9999975e7)))return a=g.s<0&&ne(e)?-0:0,g.e>-1&&(a=1/a),new A(u?1/a:a);else oe&&(a=p(oe/_+2));for(c?(n=new A(.5),u&&(e.s=1),d=ne(e)):(i=Math.abs(+_e(e)),d=i%2),f=new A(s);;){if(d){if(f=f.times(g),!f.c)break;a?f.c.length>a&&(f.c.length=a):r&&(f=f.mod(t))}if(i){if(i=m(i/2),i===0)break;d=i%2}else if(e=e.times(n),ge(e,e.e+1,1),e.e>14)d=ne(e);else{if(i=+_e(e),i===0)break;d=i%2}g=g.times(g),a?g.c&&g.c.length>a&&(g.c.length=a):r&&(g=g.mod(t))}return r?f:(u&&(f=s.div(f)),t?f.mod(t):a?ge(f,oe,l,o):f)},o.integerValue=function(e){var t=new A(this);return ge(t,t.e+1,e==null?l:T(e,0,8))},o.isEqualTo=o.eq=function(e,t){return ee(this,new A(e,t))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(e,t){return ee(this,new A(e,t))>0},o.isGreaterThanOrEqualTo=o.gte=function(e,t){return(t=ee(this,new A(e,t)))===1||t===0},o.isInteger=function(){return!!this.c&&C(this.e/_)>this.c.length-2},o.isLessThan=o.lt=function(e,t){return ee(this,new A(e,t))<0},o.isLessThanOrEqualTo=o.lte=function(e,t){return(t=ee(this,new A(e,t)))===-1||t===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new A(e,t),t=e.s,!s||!t)return new A(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/_,u=e.e/_,d=o.c,f=e.c;if(!c||!u){if(!d||!f)return d?(e.s=-t,e):new A(f?o:NaN);if(!d[0]||!f[0])return f[0]?(e.s=-t,e):new A(d[0]?o:l==3?-0:0)}if(c=C(c),u=C(u),d=d.slice(),s=c-u){for((a=s<0)?(s=-s,i=d):(u=c,i=f),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=d.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(d[t]!=f[t]){a=d[t]<f[t];break}if(a&&(i=d,d=f,f=i,e.s=-e.s),t=(r=f.length)-(n=d.length),t>0)for(;t--;d[n++]=0);for(t=g-1;r>s;){if(d[--r]<f[r]){for(n=r;n&&!d[--n];d[n]=t);--d[n],d[r]+=g}d[r]-=f[r]}for(;d[0]==0;d.splice(0,1),--u);return d[0]?me(e,d,u):(e.s=l==3?-1:1,e.c=[e.e=0],e)},o.modulo=o.mod=function(e,n){var r,i,a=this;return e=new A(e,n),!a.c||!e.s||e.c&&!e.c[0]?new A(NaN):!e.c||a.c&&!a.c[0]?new A(a):(ae==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,ae),e=a.minus(r.times(e)),!e.c[0]&&ae==1&&(e.s=a.s),e)},o.multipliedBy=o.times=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,v,y=this,x=y.c,S=(e=new A(e,t)).c;if(!x||!S||!x[0]||!S[0])return!y.s||!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?e.c=e.e=e.s=null:(e.s*=y.s,!x||!S?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=C(y.e/_)+C(e.e/_),e.s*=y.s,c=x.length,d=S.length,c<d&&(m=x,x=S,S=m,i=c,c=d,d=i),i=c+d,m=[];i--;m.push(0));for(h=g,v=b,i=d;--i>=0;){for(n=0,f=S[i]%v,p=S[i]/v|0,o=c,a=i+o;a>i;)l=x[--o]%v,u=x[o]/v|0,s=p*l+u*f,l=f*l+s%v*v+m[a]+n,n=(l/h|0)+(s/v|0)+p*u,m[a--]=l%h;m[a]=n}return n?++r:m.splice(0,1),me(e,m,r)},o.negated=function(){var e=new A(this);return e.s=-e.s||null,e},o.plus=function(e,t){var n,r=this,i=r.s;if(e=new A(e,t),t=e.s,!i||!t)return new A(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/_,o=e.e/_,s=r.c,c=e.c;if(!a||!o){if(!s||!c)return new A(i/0);if(!s[0]||!c[0])return c[0]?e:new A(s[0]?r:i*0)}if(a=C(a),o=C(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=c):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=c.length,i-t<0&&(n=c,c=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/g|0,s[t]=g===s[t]?0:s[t]%g;return i&&(s=[i].concat(s),++o),me(e,s,o)},o.precision=o.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return ge(new A(a),T(e,1,x),t==null?l:T(t,0,8));if(!(n=a.c))return null;if(i=n.length-1,r=i*_+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},o.shiftedBy=function(e){return this.times(`1e`+T(e,-v,v))},o.squareRoot=o.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,u=o.s,d=o.e,f=c+4,p=new A(`0.5`);if(u!==1||!s||!s[0])return new A(!u||u<0&&(!s||s[0])?NaN:s?o:1/0);if(u=Math.sqrt(+_e(o)),u==0||u==1/0?(n=w(s),(n.length+d)%2==0&&(n+=`0`),u=Math.sqrt(+n),d=C((d+1)/2)-(d<0||d%2),u==1/0?n=`5e`+d:(n=u.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+d),r=new A(n)):r=new A(u+``),r.c[0]){for(d=r.e,u=d+f,u<3&&(u=0);;)if(a=r,r=p.times(a.plus(t(o,a,f,1))),w(a.c).slice(0,u)===(n=w(r.c)).slice(0,u)){if(r.e<d&&--u,n=n.slice(u-3,u+1),n==`9999`||!i&&n==`4999`){if(!i&&(ge(a,a.e+c+2,0),a.times(a).eq(o))){r=a;break}f+=4,u+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(ge(r,r.e+c+2,1),e=!r.times(r).eq(o));break}}}return ge(r,r.e+c+1,l,e)},typeof BigInt==`function`&&(o.toBigInt=function(e){var t=this;return t.c?BigInt(de(t,t.e+1,e)):null}),o.toExponential=function(e,t){return de(this,e==null?e:T(e,0,x)+1,t,1)},o.toFixed=function(e,t){return de(this,e==null?e:T(e,-x,x)+this.e+1,t)},o.toFormat=function(e,t,n){var r,i,a,o,s=this;if(n==null)n=se,e!=null&&(t==null?typeof e==`object`&&!te(e)&&(n=he(e),e=t=null):typeof t==`object`&&(n=he(t),t=null));else if(typeof n!=`object`)throw Error(h+`Argument not an object: `+n);else n=he(n);if(e!=null){if(te(e)&&e.length<=2){if(i=e[0],a=e[1],e=s.dp(),a!=null&&e>T(a,0,x)&&(e=a),i!=null&&T(i,0,x)!==0){if(a!=null&&i>a)throw Error(h+`Minimum must not exceed maximum`);e<i&&(e=i)}}else T(e,-x,x)}if(o=s.toFixed(e,t),r=o.charCodeAt(0)===45,r&&(o=o.slice(1)),s.c){var c,l=o.split(`.`),u=+n.groupSize,d=+n.secondaryGroupSize,f=n.groupSeparator||``,p=l[0],m=l[1],g=p.length;if(d&&(c=u,u=d,d=c,g-=c),u>0&&g>0){for(c=g%u||u,o=p.substr(0,c);c<g;c+=u)o+=f+p.substr(c,u);d>0&&(o+=f+p.slice(c))}else o=p;m&&(c=+n.fractionGroupSize,c&&(m=m.replace(RegExp(`\\d{`+c+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``))),o+=(n.decimalSeparator||``)+m)}return(n.prefix||``)+(r?n.negativeSign||``:s.s>0&&n.positiveSign||``)+o+(n.suffix||``)},o.toFraction=function(e){var n,r,i,a,o,c,l,u,d,f,p,m,g,v,b=this,x=b.c;if(e!=null&&(l=new A(e),!l.isInteger()&&(l.c||l.s!==1)||l.lt(s)))throw Error(h+`Argument `+(l.isInteger()?`out of range: `:`not an integer: `)+_e(l));if(!x)return[new A(b.s||0),new A(0)];for(n=new A(s),d=r=new A(s),i=u=new A(s),m=w(x),o=n.e=m.length-b.e-1,n.c[0]=y[(c=o%_)<0?_+c:c],e=!e||l.comparedTo(n)>0?o>0?n:d:l,c=k,k=1/0,l=new A(m),v=l,g=n,u.c[0]=0;f=t(l,n,0,1),a=r.plus(f.times(i)),a.comparedTo(e)!=1;)r=i,i=a,d=u.plus(f.times(a=d)),u=a,n=l.minus(f.times(a=n)),l=a;return a=t(e.minus(r),i,0,1),u=u.plus(a.times(d)),r=r.plus(a.times(i)),p=d.times(g).minus(v.times(i)).abs().times(r).comparedTo(u.times(g).minus(v.times(r)).abs().times(i))<1?[d,i]:[u,r],p[0].s=b.s,k=c,p},o.toNumber=function(){return+_e(this)},o.toObject=function(){var e=this;return{c:e.c?e.c.slice():null,e:e.e,s:e.s}},o.toPrecision=function(e,t){return de(this,e==null?e:T(e,1,x),t,2)},o.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=u||a>=d?E(w(r.c),a):D(w(r.c),a,`0`):(T(e,2,ce.length,`Base`),t=n(D(w(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},o.valueOf=o.toJSON=function(){return _e(this)},o._isBigNumber=!0,e!=null&&A.set(e),A}function C(e){var t=e|0;return e>0||e===t?t:t-1}function w(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=_-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function ee(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function T(e,t,n,r){if(e<t||e>n||e!==m(e))throw Error(h+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e));return e}function te(e){return{}.toString.call(e)==`[object Array]`}function ne(e){var t=e.c.length-1;return C(e.e/_)==t&&e.c[t]%2!=0}function E(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function D(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}function O(e,t){return function(){return e.apply(t,arguments)}}var{toString:k}=Object.prototype,{getPrototypeOf:re}=Object,{iterator:ie,toStringTag:ae}=Symbol,oe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),se=e=>typeof e==`string`&&(e===`__proto__`||e===`constructor`||e===`prototype`),ce=(e,t,n)=>e===Object.prototype||!n&&t===null,A=e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(se(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&n.writable===!0})},le=(e,t)=>{let n=e,r=[];for(;n!=null;){if(r.indexOf(n)!==-1)return!1;r.push(n);let i=re(n);if(ce(n,i,n===e))return!1;if(oe(n,t))return!0;n=i}return!1},ue=(e,t)=>e!=null&&le(e,t)?e[t]:void 0,de=e=>{if(e==null||typeof e!=`object`&&typeof e!=`function`)return e;let t=re(e);if(t===null&&A(e))return e;let n=Object.create(null),r=Object.create(null),i=[],a=e;for(;a!=null&&i.indexOf(a)===-1;){i.push(a);let o=a===e?t:re(a);if(ce(a,o,a===e))break;let s=Object.getOwnPropertyNames(a);Object.getOwnPropertySymbols&&s.push(...Object.getOwnPropertySymbols(a));for(let t of s)se(t)||oe(r,t)||(n[t]=e[t],r[t]=!0);a=o}return n},fe=(e=>t=>{let n=k.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pe=e=>(e=e.toLowerCase(),t=>fe(t)===e),me=e=>t=>typeof t===e,{isArray:he}=Array,ge=me(`undefined`);function _e(e){return e!==null&&!ge(e)&&e.constructor!==null&&!ge(e.constructor)&&xe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ve=pe(`ArrayBuffer`);function ye(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ve(e.buffer),t}var be=me(`string`),xe=me(`function`),Se=me(`number`),Ce=e=>typeof e==`object`&&!!e,we=e=>e===!0||e===!1,Te=e=>{if(!Ce(e))return!1;let t=re(e);return(t===null||t===Object.prototype||re(t)===null)&&!le(e,ae)&&!le(e,ie)},Ee=e=>{if(!Ce(e)||_e(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},De=pe(`Date`),Oe=pe(`File`),ke=e=>!!(e&&e.uri!==void 0),Ae=e=>e&&e.getParts!==void 0,je=pe(`Blob`),Me=pe(`FileList`),Ne=pe(`Set`),Pe=e=>Ce(e)&&xe(e.pipe);function Fe(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var Ie=Fe(),Le=Ie.FormData===void 0?void 0:Ie.FormData,Re=e=>{if(!e)return!1;if(Le&&e instanceof Le)return!0;let t=re(e);if(!t||t===Object.prototype||!xe(e.append))return!1;let n=fe(e);return n===`formdata`||n===`object`&&xe(e.toString)&&e.toString()===`[object FormData]`},ze=pe(`URLSearchParams`),[Be,Ve,He,Ue]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(pe),We=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function Ge(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),he(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(_e(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function Ke(e,t){if(_e(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-->0;)if(i=n[r],t===i.toLowerCase())return i;return null}var qe=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,Je=e=>!ge(e)&&e!==qe;function Ye(...e){let{caseless:t,skipUndefined:n}=Je(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&Ke(r,i)||i,o=oe(r,a)?r[a]:void 0;Te(o)&&Te(e)?r[a]=Ye(o,e):Te(e)?r[a]=Ye({},e):he(e)?r[a]=e.slice():(!n||!ge(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!n||_e(n)||(Ge(n,i),typeof n!=`object`||he(n)))continue;let r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){let t=r[e];st.call(n,t)&&i(n[t],t)}}return r}var Xe=(e,t,n,{allOwnKeys:r}={})=>(Ge(t,(t,r)=>{n&&xe(t)?Object.defineProperty(e,r,{__proto__:null,value:O(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Ze=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},$e=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-->0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&re(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},et=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},tt=e=>{if(!e)return null;if(he(e))return e;let t=e.length;if(!Se(t))return null;let n=Array(t);for(;t-->0;)n[t]=e[t];return n},nt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&re(Uint8Array)),rt=(e,t)=>{let n=(e&&e[ie]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},it=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},at=pe(`HTMLFormElement`),ot=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:st}=Object.prototype,ct=pe(`RegExp`),lt=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};Ge(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},ut=e=>{lt(e,(t,n)=>{if(xe(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(xe(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},dt=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return he(e)?r(e):r(String(e).split(t)),n},ft=()=>{},pt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function mt(e){return!!(e&&xe(e.append)&&e[ae]===`FormData`&&e[ie])}var ht=e=>{let t=new WeakSet,n=e=>{if(Ce(e)){if(t.has(e))return;if(_e(e))return e;if(!(`toJSON`in e)){t.add(e);let r;if(Ne(e)){r=[];for(let t of e){let e=n(t);!ge(e)&&r.push(e)}}else r=he(e)?[]:{},Ge(e,(e,t)=>{let i=n(e);!ge(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},j=pe(`AsyncFunction`),gt=e=>e&&(Ce(e)||xe(e))&&xe(e.then)&&xe(e.catch),_t=((e,t)=>e?setImmediate:t?((e,t)=>(qe.addEventListener(`message`,({source:n,data:r})=>{n===qe&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),qe.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,xe(qe.postMessage)),vt=typeof queueMicrotask<`u`?queueMicrotask.bind(qe):typeof process<`u`&&process.nextTick||_t,yt=e=>e!=null&&xe(e[ie]),M={isArray:he,isArrayBuffer:ve,isBuffer:_e,isFormData:Re,isArrayBufferView:ye,isString:be,isNumber:Se,isBoolean:we,isObject:Ce,isPlainObject:Te,isEmptyObject:Ee,isReadableStream:Be,isRequest:Ve,isResponse:He,isHeaders:Ue,isUndefined:ge,isDate:De,isFile:Oe,isReactNativeBlob:ke,isReactNative:Ae,isBlob:je,isRegExp:ct,isFunction:xe,isStream:Pe,isURLSearchParams:ze,isTypedArray:nt,isFileList:Me,forEach:Ge,merge:Ye,extend:Xe,trim:We,stripBOM:Ze,inherits:Qe,toFlatObject:$e,kindOf:fe,kindOfTest:pe,endsWith:et,toArray:tt,forEachEntry:rt,matchAll:it,isHTMLForm:at,hasOwnProperty:oe,hasOwnProp:oe,hasOwnInPrototypeChain:le,getSafeProp:ue,toSafeFlatObject:de,reduceDescriptors:lt,freezeMethods:ut,toObjectSet:dt,toCamelCase:ot,noop:ft,toFiniteNumber:pt,findKey:Ke,global:qe,isContextDefined:Je,isSpecCompliantForm:mt,toJSONObject:ht,isAsyncFn:j,isThenable:gt,setImmediate:_t,asap:vt,isIterable:yt,isSafeIterable:e=>e!=null&&le(e,ie)&&yt(e)},bt=M.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`]),xt=e=>{let t={},n,r,i;return e&&e.split(`
|
|
2
|
+
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();let a=M.hasOwnProp(t,n);!n||a&&M.hasOwnProp(bt,n)||(n===`set-cookie`?a?t[n].push(r):t[n]=[r]:t[n]=a?t[n]+`, `+r:r)}),t};function St(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var Ct=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),wt=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Tt(e,t){return M.isArray(e)?e.map(e=>Tt(e,t)):St(String(e).replace(t,``))}var Et=e=>Tt(e,Ct),Dt=e=>Tt(e,wt);function Ot(e){let t=Object.create(null);return M.forEach(e.toJSON(),(e,n)=>{t[n]=Dt(e)}),t}var kt=Symbol(`internals`);function At(e){return e&&String(e).trim().toLowerCase()}function jt(e){return e===!1||e==null?e:M.isArray(e)?e.map(jt):Et(String(e))}function Mt(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var Nt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Pt(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function Ft(e){let t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n=``;for(let r=1;r<t;r++){let i=e.charCodeAt(r);if(i===34||i===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function It(e){let t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){let i=Pt(n.slice(r,e)),a=i.indexOf(`=`);if(a<1)return;let o=Pt(i.slice(0,a));if(!Nt.test(o))return;let s=o.toLowerCase();if(s===`__proto__`||s===`constructor`||s===`prototype`)return;let c=Pt(i.slice(a+1));t[s]=Ft(c)}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?a?a=!1:t===92?a=!0:t===34&&(i=!1):t===34?i=!0:(t===44||t===59)&&(o(e),r=e+1)}return o(n.length),t}var Lt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Rt(e,t,n,r,i){if(M.isFunction(r))return r.call(this,t,n);if(i&&(t=n),M.isString(t)){if(M.isString(r))return t.indexOf(r)!==-1;if(M.isRegExp(r))return r.test(t)}}function zt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function Bt(e,t){let n=M.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Vt=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=At(t);if(!i)return;let a=M.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=jt(e))}let a=(e,t)=>M.forEach(e,(e,n)=>i(e,n,t));if(M.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(M.isString(e)&&(e=e.trim())&&!Lt(e))a(xt(e),t);else if(M.isObject(e)&&M.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!M.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],M.hasOwnProp(n,i)?(r=n[i],n[i]=M.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=At(e),e){let n=M.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return Mt(e);if(M.isFunction(t))return t.call(this,e,n);if(M.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=At(e),e){let n=M.findKey(this,e);return!(!n||this[n]===void 0||t&&!Rt(this,this[n],n,t))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=At(e),e){let i=M.findKey(n,e);i&&(!t||Rt(n,n[i],i,t))&&(delete n[i],r=!0)}}return M.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||Rt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return M.forEach(this,(r,i)=>{let a=M.findKey(n,i);if(a){t[a]=jt(r),delete t[i];return}let o=e?zt(i):String(i).trim();o!==i&&delete t[i],t[o]=jt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return M.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&M.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
|
|
3
|
+
`)}getSetCookie(){let e=this.get(`set-cookie`);return M.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return It(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[kt]=this[kt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=At(e);t[r]||(Bt(n,e),t[r]=!0)}return M.isArray(e)?e.forEach(r):r(e),this}};Vt.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),M.reduceDescriptors(Vt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),M.freezeMethods(Vt);var Ht=`[REDACTED ****]`;function Ut(e){if(M.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(M.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function Wt(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||M.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof Vt&&(e=e.toJSON()),r.push(e);let t;if(M.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);M.isUndefined(r)||(t[n]=r)});else{if(!M.isPlainObject(e)&&Ut(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?Ht:i(a);M.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function Gt(e){try{return String(e)}catch{return``}}function Kt(e){return e.errors.map(e=>{try{return e&&e.message?Gt(e.message):Gt(e)}catch{return``}}).filter(Boolean).join(`; `)||e.name||`AggregateError`}var N=class e extends Error{static from(t,n,r,i,a,o){let s=t.message;!s&&M.isArray(t.errors)&&t.errors.length&&(s=Kt(t));let c=new e(s,n||t.code,r,i,a);return Object.defineProperty(c,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&M.hasOwnProp(e,`redact`)?e.redact:void 0,n=M.isArray(t)&&t.length>0?Wt(e,t):M.toJSONObject(e);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:n,code:this.code,status:this.status}}};N.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,N.ERR_BAD_OPTION=`ERR_BAD_OPTION`,N.ECONNABORTED=`ECONNABORTED`,N.ETIMEDOUT=`ETIMEDOUT`,N.ECONNREFUSED=`ECONNREFUSED`,N.ERR_NETWORK=`ERR_NETWORK`,N.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,N.ERR_DEPRECATED=`ERR_DEPRECATED`,N.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,N.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,N.ERR_CANCELED=`ERR_CANCELED`,N.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,N.ERR_INVALID_URL=`ERR_INVALID_URL`,N.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function qt(e){return M.isPlainObject(e)||M.isArray(e)}function Jt(e){return M.endsWith(e,`[]`)?e.slice(0,-2):e}function Yt(e,t,n){return e?e.concat(t).map(function(e,t){return e=Jt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Xt(e){return M.isArray(e)&&!e.some(qt)}var Zt=M.toFlatObject(M,{},null,function(e){return/^is[A-Z]/.test(e)});function Qt(e,t,n){if(!M.isObject(e))throw TypeError(`target must be an object`);t||=new FormData;let r=(e,t)=>{let r=M.getSafeProp(n,e);return M.isUndefined(r)?t:r},i=r(`metaTokens`,!0),a=r(`visitor`)||h,o=r(`dots`,!1),s=r(`indexes`,!1),c=r(`Blob`)||typeof Blob<`u`&&Blob,l=r(`maxDepth`,100),u=c&&M.isSpecCompliantForm(t),d=[];if(!M.isFunction(a))throw TypeError(`visitor must be a function`);function f(e){if(e===null)return``;if(M.isDate(e))return e.toISOString();if(M.isBoolean(e))return e.toString();if(!u&&M.isBlob(e))throw new N(`Blob is not supported. Use a Buffer instead.`);if(M.isArrayBuffer(e)||M.isTypedArray(e)){if(u&&typeof c==`function`)return new c([e]);throw new N(`Blob is not supported. Use a Buffer instead.`,N.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new N(`Object is too deeply nested (`+e+` levels). Max depth: `+l,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,t){if(l===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!M.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r})}function h(e,n,r){let a=e;if(M.isReactNative(t)&&M.isReactNativeBlob(e))return t.append(Yt(r,n,o),f(e)),!1;if(e&&!r&&typeof e==`object`){if(M.endsWith(n,`{}`))n=i?n:n.slice(0,-2),e=m(e,1);else if(M.isArray(e)&&Xt(e)||(M.isFileList(e)||M.endsWith(n,`[]`))&&(a=M.toArray(e)))return n=Jt(n),a.forEach(function(e,r){!(M.isUndefined(e)||e===null)&&t.append(s===!0?Yt([n],r,o):s===null?n:n+`[]`,f(e))}),!1}return qt(e)?!0:(t.append(Yt(r,n,o),f(e)),!1)}let g=Object.assign(Zt,{defaultVisitor:h,convertValue:f,isVisitable:qt});function _(e,n,r=0){if(!M.isUndefined(e)){if(p(r),d.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));d.push(e),M.forEach(e,function(e,i){(!(M.isUndefined(e)||e===null)&&a.call(t,e,M.isString(i)?i.trim():i,n,g))===!0&&_(e,n?n.concat(i):[i],r+1)}),d.pop()}}if(!M.isObject(e))throw TypeError(`data must be an object`);return _(e),t}function $t(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function en(e,t){this._pairs=[],e&&Qt(e,this,t)}var tn=en.prototype;tn.append=function(e,t){this._pairs.push([e,t])},tn.toString=function(e){let t=e?t=>e.call(this,t,$t):$t;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function nn(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function rn(e,t,n){if(!t)return e;e||=``;let r=M.isFunction(n)?{serialize:n}:n,i=M.getSafeProp(r,`encode`)||nn,a=M.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):M.isURLSearchParams(t)?t.toString():new en(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var an=Symbol(`internals`);function on(e){return e?e.length:0}function sn(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function cn(e,t){let n=e.handlers,r=on(n);n===t.handlersRef?r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()):(t.handlersRef=n,t.handlerEntries.clear()),t.handlersLength=r}var ln=class{constructor(){this.handlers=[],this[an]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){let r={fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null},i=this[an];this.handlers??=[],cn(this,i);let a=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(a,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,a}eject(e){let t=this[an];cn(this,t);let n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(sn(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],cn(this,this[an]))}forEach(e){let t=this[an];cn(this,t),t.iterationDepth++;try{M.forEach(this.handlers,function(t){t!==null&&e(t)})}finally{--t.iterationDepth||(cn(this,t),sn(this.handlers),t.handlersLength=on(this.handlers))}}},un={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},dn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:en,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},fn=c({hasBrowserEnv:()=>pn,hasStandardBrowserEnv:()=>hn,hasStandardBrowserWebWorkerEnv:()=>gn,navigator:()=>mn,origin:()=>_n}),pn=typeof window<`u`&&typeof document<`u`,mn=typeof navigator==`object`&&navigator||void 0,hn=pn&&(!mn||[`ReactNative`,`NativeScript`,`NS`].indexOf(mn.product)<0),gn=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,_n=pn&&window.location.href||`http://localhost`,P={...fn,...dn};function vn(e,t){return Qt(e,new P.classes.URLSearchParams,{visitor:function(e,t,n,r){return P.isNode&&M.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}var yn=100;function bn(e){if(e>yn)throw new N(`FormData field is too deeply nested (`+e+` levels). Max depth: `+yn,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function xn(e){let t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g,r;for(;(r=n.exec(e))!==null;)bn(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Sn(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Cn(e){function t(e,n,r,i){bn(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&M.isArray(r)?r.length:a,s?(M.hasOwnProp(r,a)?r[a]=M.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!M.hasOwnProp(r,a)||!M.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&M.isArray(r[a])&&(r[a]=Sn(r[a])),!o)}if(M.isFormData(e)&&M.isFunction(e.entries)){let n={};return M.forEachEntry(e,(e,r)=>{t(xn(e),r,n,0)}),n}return null}var wn=Object.freeze([`get`,`delete`,`head`,`options`,`post`,`put`,`patch`,`purge`,`link`,`unlink`,`query`]),Tn=(e,t)=>e!=null&&M.hasOwnProp(e,t)?e[t]:void 0;function En(e,t,n){if(M.isString(e))try{return(t||JSON.parse)(e),M.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var Dn={transitional:un,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=M.isObject(e);if(i&&M.isHTMLForm(e)&&(e=new FormData(e)),M.isFormData(e))return r?JSON.stringify(Cn(e)):e;if(M.isArrayBuffer(e)||M.isBuffer(e)||M.isStream(e)||M.isFile(e)||M.isBlob(e)||M.isReadableStream(e))return e;if(M.isArrayBufferView(e))return e.buffer;if(M.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Tn(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return vn(e,t).toString();if((a=M.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Tn(this,`env`),r=n&&n.FormData;return Qt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),En(e)):e}],transformResponse:[function(e){let t=Tn(this,`transitional`)||Dn.transitional,n=t&&t.forcedJSONParsing,r=Tn(this,`responseType`),i=r===`json`;if(M.isResponse(e)||M.isReadableStream(e))return e;if(e&&M.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Tn(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?N.from(e,N.ERR_BAD_RESPONSE,this,null,Tn(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};M.forEach(wn,e=>{Dn.headers[e]={}});function On(e,t){let n=this||Dn,r=t||n,i=Vt.from(r.headers),a=r.data;return M.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function kn(e){return!!(e&&e.__CANCEL__)}var An=class extends N{constructor(e,t,n){super(e??`canceled`,N.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function jn(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new N(`Request failed with status code `+n.status,n.status>=400&&n.status<500?N.ERR_BAD_REQUEST:N.ERR_BAD_RESPONSE,n.config,n.request,n))}var Mn=/[\t\n\r]/g;function Nn(e){if(typeof e!=`string`)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Mn,``)}function Pn(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function Fn(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function In(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i),(...e)=>o(e)]}var Ln=(e,t,n=3)=>{let r=0,i=Fn(50,250);return In(n=>{if(!n||!M.isNumber(n.loaded))return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,o==null?a:Math.min(a,o)),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Rn=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},zn=(e,t=M.asap)=>(...n)=>t(()=>e(...n)),Bn=P.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,P.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(P.origin),P.navigator&&/(msie|trident)/i.test(P.navigator.userAgent)):()=>!0,Vn=P.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];M.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),M.isString(r)&&s.push(`path=${r}`),M.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),M.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Hn(e){return typeof e==`string`&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Un(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+`/`+t.replace(/^\/+/,``)}var Wn=/^https?:(?!\/\/)/i;function Gn(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n=``)=>`${t}${n}${Ht}`)}function Kn(e){let t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ht}@`),n=t.indexOf(`#`),r=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ht}`);return n===-1?r:`${r}#${Gn(t.slice(n+1))}`}function qn(e,t){if(typeof e==`string`){let n=Nn(e);if(Wn.test(n))throw new N(`Invalid URL ${JSON.stringify(Kn(n))}: missing "//" after protocol`,N.ERR_INVALID_URL,t)}}function Jn(e,t,n,r){qn(t,r);let i=!Hn(t);return e&&(i||n===!1)?(qn(e,r),Un(e,t)):t}var Yn=e=>e instanceof Vt?{...e}:e,Xn=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function Zn(e,t){e||={},t||={};let n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return M.isPlainObject(e)&&M.isPlainObject(t)?M.merge.call({caseless:r},e,t):M.isPlainObject(t)?M.merge({},t):M.isArray(t)?t.slice():t}function i(e,t,n,i){if(!M.isUndefined(t))return r(e,t,n,i);if(!M.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!M.isUndefined(t))return r(void 0,t)}function o(e,t){if(!M.isUndefined(t))return r(void 0,t);if(!M.isUndefined(e))return r(void 0,e)}function s(n){let r=M.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!M.isUndefined(r)){if(M.isPlainObject(r)){if(M.hasOwnProp(r,n))return r[n]}else return}let i=M.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(M.isPlainObject(i)&&M.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(M.hasOwnProp(t,a))return r(n,i);if(M.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(Yn(e),Yn(t),n,!0)};return M.forEach(Xn({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=M.hasOwnProp(l,r)?l[r]:i,o=a(M.hasOwnProp(e,r)?e[r]:void 0,M.hasOwnProp(t,r)?t[r]:void 0,r);M.isUndefined(o)&&a!==c||(n[r]=o)}),M.hasOwnProp(t,`validateStatus`)&&M.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(M.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Qn=[`content-type`,`content-length`];function $n(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Qn.includes(t.toLowerCase())&&e.set(t,n)})}var er=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function tr(e){let t=Zn({},e),n=e=>M.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=Vt.from(s),t.url=rn(Jn(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=M.getSafeProp(c,`username`)||``,n=M.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?er(n):``)))}catch(t){throw N.from(t,N.ERR_BAD_OPTION_VALUE,e)}}if(M.isFormData(r)){let e=M.getSafeProp(r,`getHeaders`);P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv||M.isReactNative(r)?s.setContentType(void 0):M.isFunction(e)&&$n(s,e.call(r),n(`formDataHeaderPolicy`))}if(P.hasStandardBrowserEnv&&(M.isFunction(i)&&(i=i(t)),i===!0||i==null&&Bn(t.url))){let e=a&&o&&Vn.read(o);e&&s.set(a,e)}return t}var nr=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=tr(e),i=r.data,a=Vt.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p,m;function h(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let g=new XMLHttpRequest;g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout;function _(i){if(!g)return;if(g.status===0&&(Pn(Nn(r.url))||Pn(P.origin))!==`file`&&!(g.responseURL&&g.responseURL.startsWith(`file:`))){n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),g=null;return}try{i?m&&m(i):p&&p()}catch(e){setTimeout(()=>{throw e})}if(!g)return;let a=Vt.from(`getAllResponseHeaders`in g&&g.getAllResponseHeaders());jn(function(e){t(e),h()},function(e){n(e),h()},{data:!o||o===`text`||o===`json`?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:a,config:e,request:g}),g=null}`onloadend`in g?g.onloadend=_:g.onreadystatechange=function(){g&&g.readyState===4&&(g.status!==0||g.responseURL&&g.responseURL.startsWith(`file:`))&&setTimeout(_)},g.onabort=function(){g&&=(n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),null)},g.onerror=function(t){let r=new N(t&&t.message?t.message:`Network Error`,N.ERR_NETWORK,e,g);r.event=t||null,n(r),h(),g=null},g.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||un;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new N(t,i.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,g)),h(),g=null},i===void 0&&a.setContentType(null),`setRequestHeader`in g&&M.forEach(Ot(a),function(e,t){g.setRequestHeader(t,e)}),M.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),o&&o!==`json`&&(g.responseType=r.responseType),c&&([d,p,m]=Ln(c,!0),g.addEventListener(`progress`,d)),s&&g.upload&&([u,f]=Ln(s),g.upload.addEventListener(`progress`,u),g.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{g&&=(n(!t||t.type?new An(null,e,g):t),g.abort(),h(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let v=Pn(r.url);if(v&&!P.protocols.includes(v)){n(new N(`Unsupported protocol `+v+`:`,N.ERR_BAD_REQUEST,e)),h();return}g.send(i||null)})},rr=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof N?t:new An(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new N(`timeout of ${t}ms exceeded`,N.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>{if(!r){if(e.aborted){i.call(e);return}e.addEventListener(`abort`,i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>M.asap(o),s},ir=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},ar=async function*(e,t){for await(let n of or(e))yield*ir(n,t)},or=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},sr=(e,t,n,r)=>{let i=ar(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},cr=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,lr=(e,t,n)=>t+2<n&&cr(e.charCodeAt(t+1))&&cr(e.charCodeAt(t+2)),ur=e=>e<=57?e-48:(e&223)-55,dr=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,fr=e=>e===9||e===10||e===12||e===13||e===32,pr=e=>{let t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},mr=e=>{let t=e.length,n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},hr=e=>{let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&lr(e,a,t)&&(o=ur(e.charCodeAt(a+1))*16+ur(e.charCodeAt(a+2)),a+=2),!fr(o)){if(o===61){r++;continue}if(!dr(o)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?mr(e):pr(n)},gr=(e,t)=>{if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let n=e.indexOf(`,`);if(n<0)return 0;let r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(n===37&&lr(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};function _r(e){let t=typeof e==`string`?e.indexOf(`#`):-1;return gr(t===-1?e:e.slice(0,t),hr)}var vr=`1.20.0`,yr=65536,br={cache:`default`,redirect:`follow`,referrer:`about:client`,referrerPolicy:``,mode:`cors`,integrity:``,keepalive:!1,priority:`auto`,window:null},{isFunction:xr}=M,Sr=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Cr=e=>{if(!M.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},F=(e,...t)=>{try{return!!e(...t)}catch{return!1}},wr=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},Tr=e=>{let t=M.global!==void 0&&M.global!==null?M.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=M.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?xr(i):typeof fetch==`function`,c=xr(a),l=xr(o);if(!s)return!1;let u=s&&xr(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&F(()=>{let e=!1,t=new a(P.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&F(()=>M.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(M.isBlob(e))return e.size;if(M.isSpecCompliantForm(e))return(await new a(P.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(M.isArrayBufferView(e)||M.isArrayBuffer(e))return e.byteLength;if(M.isURLSearchParams(e)&&(e+=``),M.isString(e))return(await d(e)).byteLength},g=async(e,t)=>M.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:S=`same-origin`,fetchOptions:C,maxContentLength:w,maxBodyLength:ee,maxRedirects:T}=tr(e),te=M.isNumber(w)&&w>-1,ne=M.isNumber(ee)&&ee>-1,E=t=>M.hasOwnProp(e,t)?e[t]:void 0,D=i||fetch;b=b?(b+``).toLowerCase():`text`;let O=rr([l,d&&d.toAbortSignal()],_),k=null,re=O&&O.unsubscribe&&(()=>{O.unsubscribe()}),ie,ae=null,oe=()=>new N(`Request body larger than maxBodyLength limit`,N.ERR_BAD_REQUEST,e,k);try{let i,l=E(`auth`);if(l&&(i={username:M.getSafeProp(l,`username`)||``,password:M.getSafeProp(l,`password`)||``}),wr(t)){let e=new URL(t,P.origin);!i&&(e.username||e.password)&&(i={username:Cr(e.username),password:Cr(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(Sr((i.username||``)+`:`+(i.password||``))))),te&&typeof t==`string`&&t.startsWith(`data:`)&&_r(t)>w)throw new N(`maxContentLength size of `+w+` exceeded`,N.ERR_BAD_RESPONSE,e,k);if(ne&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(ie=e,e>ee))throw oe()}let d=ne&&(M.isReadableStream(s)||M.isStream(s)),_=(e,t,n)=>sr(e,yr,e=>{if(ne&&e>ee)throw ae=oe();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(ie??=await g(x,s),ie!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(M.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&Rn(ie,Ln(zn(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new N(`Stream request bodies are not supported by the current fetch implementation`,N.ERR_NOT_SUPPORT,e,k);M.isString(S)||(S=S?`include`:`omit`);let se=c&&`credentials`in a.prototype;if(M.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+vr,!1);let ce=C==null?C:Object.assign(Object.create(null),C);ce&&(delete ce.body,delete ce.headers,delete ce.method,delete ce.signal,delete ce.duplex,delete ce.credentials);let A=Object.assign(Object.create(null),ce,{signal:O,method:n.toUpperCase(),headers:Ot(x.normalize()),body:s,duplex:`half`,credentials:se?S:void 0});c&&(M.forEach(br,(e,t)=>{A[t]===void 0&&(A[t]=e)}),A.signal===void 0&&(A.signal=null),A.body===void 0&&(A.body=null)),T===0&&(A.redirect=`manual`,ce&&(ce.redirect=`manual`)),k=c&&new a(t,A);let le=await(c?D(k,ce):D(t,A)),ue=Vt.from(le.headers);if(te){let t=M.toFiniteNumber(ue.getContentLength());if(t!=null&&t>w)throw new N(`maxContentLength size of `+w+` exceeded`,N.ERR_BAD_RESPONSE,e,k)}let de=p&&(b===`stream`||b===`response`);if(p&&le.body&&(v||te||de&&re)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=le[e]});let n=M.toFiniteNumber(ue.getContentLength()),[r,i]=v&&Rn(n,Ln(zn(v),!0))||[],a=0;le=new o(sr(le.body,yr,t=>{if(te&&(a=t,a>w))throw new N(`maxContentLength size of `+w+` exceeded`,N.ERR_BAD_RESPONSE,e,k);r&&r(t)},()=>{i&&i(),re&&re()}),t)}b||=`text`;let fe=await m[M.findKey(m,b)||`text`](le,e);if(te&&!p&&!de){let t;if(fe!=null&&(typeof fe.byteLength==`number`?t=fe.byteLength:typeof fe.size==`number`?t=fe.size:typeof fe==`string`&&(t=typeof r==`function`?new r().encode(fe).byteLength:fe.length)),typeof t==`number`&&t>w)throw new N(`maxContentLength size of `+w+` exceeded`,N.ERR_BAD_RESPONSE,e,k)}return!de&&re&&re(),await new Promise((t,n)=>{jn(t,n,{data:fe,headers:Vt.from(le.headers),status:le.status,statusText:le.statusText,config:e,request:k})})}catch(t){if(re&&re(),O&&O.aborted&&O.reason instanceof N){let n=O.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(ae)throw k&&!ae.request&&(ae.request=k),ae;if(t instanceof N)throw k&&!t.request&&(t.request=k),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new N(`Network Error`,N.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw N.from(t,t&&t.code,e,k,t&&t.response)}}},Er=new Map,I=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Er;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Tr(t)),l=c;return c};I();var Dr={http:null,xhr:nr,fetch:{get:I}};M.forEach(Dr,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});var Or=e=>`- ${e}`,kr=e=>M.isFunction(e)||e===null||e===!1;function Ar(e,t){e=M.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!kr(r)&&(i=Dr[(n=String(r)).toLowerCase()],i===void 0))throw new N(`Unknown adapter '${n}'`);if(i&&(M.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new N(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
4
|
+
`+e.map(Or).join(`
|
|
5
|
+
`):` `+Or(e[0]):`as no adapter specified`),N.ERR_NOT_SUPPORT)}return i}var jr={getAdapter:Ar,adapters:Dr};function Mr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new An(null,e)}function Nr(e){let t=M.toSafeFlatObject(e);return Mr(t),t.headers=Vt.from(M.getSafeProp(t,`headers`)),t.data=On.call(t,t.transformRequest),[`post`,`put`,`patch`].indexOf(t.method)!==-1&&t.headers.setContentType(`application/x-www-form-urlencoded`,!1),jr.getAdapter(t.adapter||Dn.adapter,t)(t).then(function(e){Mr(t),t.response=e;try{e.data=On.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Vt.from(e.headers),e},function(e){if(!kn(e)&&(Mr(t),e&&e.response)){t.response=e.response;try{e.response.data=On.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Vt.from(e.response.headers)}return Promise.reject(e)})}var Pr={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Pr[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Fr={};Pr.transitional=function(e,t,n){function r(e,t){return`[Axios v`+vr+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new N(r(i,` has been removed`+(t?` in `+t:``)),N.ERR_DEPRECATED);return t&&!Fr[i]&&(Fr[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),!e||e(n,i,a)}},Pr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Ir(e,t,n){if(typeof e!=`object`||!e)throw new N(`options must be an object`,N.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-->0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new N(`option `+a+` must be `+n,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N(`Unknown option `+a,N.ERR_BAD_OPTION)}}var Lr={assertOptions:Ir,validators:Pr},Rr=Lr.validators,zr=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ln,response:new ln}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack,r=``;if(typeof n==`string`){let e=n.indexOf(`
|
|
6
|
+
`);r=e===-1?``:n.slice(e+1)}if(!e.stack)e.stack=r;else if(r){let t=r.indexOf(`
|
|
7
|
+
`),n=t===-1?-1:r.indexOf(`
|
|
8
|
+
`,t+1),i=n===-1?``:r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
9
|
+
`+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Zn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Lr.assertOptions(n,{silentJSONParsing:Rr.transitional(Rr.boolean),forcedJSONParsing:Rr.transitional(Rr.boolean),clarifyTimeoutError:Rr.transitional(Rr.boolean),legacyInterceptorReqResOrdering:Rr.transitional(Rr.boolean),advertiseZstdAcceptEncoding:Rr.transitional(Rr.boolean),validateStatusUndefinedResolves:Rr.transitional(Rr.boolean)},!1),r!=null&&(M.isFunction(r)?t.paramsSerializer={serialize:r}:Lr.assertOptions(r,{encode:Rr.function,serialize:Rr.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Lr.assertOptions(t,{baseUrl:Rr.spelling(`baseURL`),withXsrfToken:Rr.spelling(`withXSRFToken`)},!0),t.method=(M.getSafeProp(t,`method`)||M.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&M.merge(i.common,i[t.method]);i&&M.forEach(wn.concat(`common`),e=>{delete i[e]}),t.headers=Vt.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||un;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Nr.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);M.isThenable(n)&&(l=Promise.resolve(n).then(()=>Nr.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Nr.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Zn(this.defaults,e),rn(Jn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};M.forEach([`delete`,`get`,`head`,`options`],function(e){zr.prototype[e]=function(t,n){return this.request(Zn(n||{},{method:e,url:t,data:n&&M.hasOwnProp(n,`data`)?n.data:void 0}))}}),M.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(Zn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}zr.prototype[e]=t(),e!==`query`&&(zr.prototype[e+`Form`]=t(!0))});var Br=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new An(e,r,i),t(n.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;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Vr(e){return function(t){return e.apply(null,t)}}function Hr(e){return M.isObject(e)&&e.isAxiosError===!0}var Ur={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ur).forEach(([e,t])=>{Ur[t]===void 0&&(Ur[t]=e)});function Wr(e){let t=new zr(e),n=O(zr.prototype.request,t);return M.extend(n,zr.prototype,t,{allOwnKeys:!0}),M.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Wr(Zn(e,t))},n}var Gr=Wr(Dn);Gr.Axios=zr,Gr.CanceledError=An,Gr.CancelToken=Br,Gr.isCancel=kn,Gr.VERSION=vr,Gr.toFormData=Qt,Gr.AxiosError=N,Gr.Cancel=Gr.CanceledError,Gr.all=function(e){return Promise.all(e)},Gr.spread=Vr,Gr.isAxiosError=Hr,Gr.mergeConfig=Zn,Gr.AxiosHeaders=Vt,Gr.formToJSON=e=>Cn(M.isHTMLForm(e)?new FormData(e):e),Gr.getAdapter=jr.getAdapter,Gr.HttpStatusCode=Ur,Gr.default=Gr;var Kr=e=>typeof e==`function`?e:function(){return e},qr=typeof self<`u`?self:null,Jr=typeof window<`u`?window:null,Yr=qr||Jr||globalThis,Xr=`2.0.0`,Zr={connecting:0,open:1,closing:2,closed:3},Qr=100,$r=1e4,ei=1e3,ti={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},ni={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},ri={longpoll:`longpoll`,websocket:`websocket`},ii={complete:4},ai=`base64url.bearer.phx.`,oi=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,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(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.cancelRefEvent(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},si=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},ci=class{constructor(e,t,n){this.state=ti.closed,this.topic=e,this.params=Kr(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new oi(this,ni.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new si(()=>{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=ti.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,()=>{this.state=ti.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=ti.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=ti.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 oi(this,ni.leave,Kr({}),this.timeout).send(),this.state=ti.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(ni.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(ni.close,e)}onError(e){return this.on(ni.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>n.event!==e||t!==void 0&&t!==n.ref)}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new oi(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ti.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(ni.close,`leave`)},n=new oi(this,ni.leave,Kr({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=ti.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(t=>t.event===e);for(let e=0;e<a.length;e++)a[e].callback(i,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===ti.closed}isErrored(){return this.state===ti.errored}isJoined(){return this.state===ti.joined}isJoining(){return this.state===ti.joining}isLeaving(){return this.state===ti.leaving}},li=class{static request(e,t,n,r,i,a,o){if(Yr.XDomainRequest){let n=new Yr.XDomainRequest;return this.xdomainRequest(n,e,t,r,i,a,o)}if(Yr.XMLHttpRequest){let s=new Yr.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,i,a,o)}if(Yr.fetch&&Yr.AbortController)return this.fetchRequest(e,t,n,r,i,a,o);throw Error(`No suitable XMLHttpRequest implementation found`)}static fetchRequest(e,t,n,r,i,a,o){let s={method:e,headers:n,body:r},c=null;return i&&(c=new AbortController,setTimeout(()=>c.abort(),i),s.signal=c.signal),Yr.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===ii.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},ui=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)},di=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(ai)&&(this.authToken=atob(t[1].slice(ai.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(e),this.readyState=Zr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+ri.websocket),`$1/`+ri.longpoll)}endpointURL(){return li.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=Zr.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===Zr.open||this.readyState===Zr.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Zr.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 Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=ui(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e,t=0){this.awaitingBatchAck=!0;let n=t+Qr,r=e.slice(t,n);this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},r.join(`
|
|
10
|
+
`),()=>this.ontimeout(),t=>{!t||t.status!==200?(this.awaitingBatchAck=!1,this.onerror(t&&t.status),this.closeAndRetry(1011,`internal server error`,!1)):n<e.length?this.batchSend(e,n):this.batchBuffer.length>0?(this.batchSend(this.batchBuffer),this.batchBuffer=[]):this.awaitingBatchAck=!1})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=Zr.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],this.awaitingBatchAck=!1,clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=li.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},fi={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=new TextEncoder,s=o.encode(t),c=o.encode(n),l=o.encode(i),u=o.encode(r);this.assertFieldSize(s.byteLength,`join_ref`),this.assertFieldSize(c.byteLength,`ref`),this.assertFieldSize(l.byteLength,`topic`),this.assertFieldSize(u.byteLength,`event`);let d=this.META_LENGTH+s.byteLength+c.byteLength+l.byteLength+u.byteLength,f=new ArrayBuffer(this.HEADER_LENGTH+d),p=new Uint8Array(f),m=new DataView(f),h=0;m.setUint8(h++,this.KINDS.push),m.setUint8(h++,s.byteLength),m.setUint8(h++,c.byteLength),m.setUint8(h++,l.byteLength),m.setUint8(h++,u.byteLength),p.set(s,h),h+=s.byteLength,p.set(c,h),h+=c.byteLength,p.set(l,h),h+=l.byteLength,p.set(u,h),h+=u.byteLength;var g=new Uint8Array(f.byteLength+a.byteLength);return g.set(p,0),g.set(new Uint8Array(a),f.byteLength),g.buffer},assertFieldSize(e,t){if(e>255)throw Error(`unable to convert ${t} to binary: must be less than or equal to 255 bytes, but is ${e} bytes`)},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:ni.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},pi=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||$r,this.transport=t.transport||Yr.WebSocket||di,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||Yr&&Yr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=fi.encode.bind(fi),this.defaultDecoder=fi.decode.bind(fi),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.transport===di?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let n=null;Jr&&Jr.addEventListener&&(Jr.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Jr.addEventListener(`pageshow`,e=>{n===this.connectClock&&(n=null,this.connect())}),Jr.addEventListener(`visibilitychange`,()=>{this.handleVisibilityChange()}),Jr.document&&Jr.document.addEventListener(`resume`,()=>{this.handleVisibilityChange()})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Kr(t.params||{}),this.endPoint=`${e}/${ri.websocket}`,this.vsn=t.vsn||Xr,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new si(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(()=>this.connect())},this.reconnectAfterMs),this.authToken=t.authToken&&Kr(t.authToken)}get pageHidden(){return Jr&&Jr.document?Jr.document.visibilityState===`hidden`:!1}handleVisibilityChange(){this.pageHidden||!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect())}getLongPollTransport(){return di}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=li.appendParams(li.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=Kr(e)),(!this.conn||this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==di?this.connectWithFallback(di,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case di:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${ai}${btoa(this.authToken()).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),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(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a,o=this.transportName(e),s=t=>{this.log(`transport`,`falling back to ${o}...`,t),this.off([i,a]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return s(`memorized`);this.fallbackTimer=setTimeout(s,t),a=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),s(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(s,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`${this.transportName(this.transport)} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e())}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`),this.triggerChanError(`heartbeat_timeout`),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),ei,`heartbeat timeout`))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===Zr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{});let t=e&&e.code;this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(`connection_closed`),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,t])=>t(e))}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,r])=>{r(e,t,n)}),(t===this.transport||n>0)&&this.triggerChanError(`connection_error`)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(ni.error,{source:`transport`,reason:e})})}connectionState(){switch(this.conn&&this.conn.readyState){case Zr.connecting:return`connecting`;case Zr.open:return`open`;case Zr.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new ci(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return this.ref=e===this.ref?0:e,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(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;i&&i===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`,r);for(let e=0;e<this.channels.length;e++){let o=this.channels[e];o.isMember(t,n,r,a)&&o.trigger(n,r,i,a)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}})}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},mi=s(((e,t)=>{(function(){var n,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=`__lodash_placeholder__`,o=1,s=2,c=8,l=16,u=32,d=64,f=128,p=256,m=512,h=1/0,g=9007199254740991,_=17976931348623157e292,v=NaN,y=4294967295,b=y-1,x=y>>>1,S=[[`ary`,f],[`bind`,o],[`bindKey`,s],[`curry`,c],[`curryRight`,l],[`flip`,m],[`partial`,u],[`partialRight`,d],[`rearg`,p]],C=`[object Arguments]`,w=`[object Array]`,ee=`[object AsyncFunction]`,T=`[object Boolean]`,te=`[object Date]`,ne=`[object DOMException]`,E=`[object Error]`,D=`[object Function]`,O=`[object GeneratorFunction]`,k=`[object Map]`,re=`[object Number]`,ie=`[object Null]`,ae=`[object Object]`,oe=`[object Promise]`,se=`[object Proxy]`,ce=`[object RegExp]`,A=`[object Set]`,le=`[object String]`,ue=`[object Symbol]`,de=`[object Undefined]`,fe=`[object WeakMap]`,pe=`[object WeakSet]`,me=`[object ArrayBuffer]`,he=`[object DataView]`,ge=`[object Float32Array]`,_e=`[object Float64Array]`,ve=`[object Int8Array]`,ye=`[object Int16Array]`,be=`[object Int32Array]`,xe=`[object Uint8Array]`,Se=`[object Uint8ClampedArray]`,Ce=`[object Uint16Array]`,we=`[object Uint32Array]`,Te=/\b__p \+= '';/g,Ee=/\b(__p \+=) '' \+/g,De=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oe=/&(?:amp|lt|gt|quot|#39);/g,ke=/[&<>"']/g,Ae=RegExp(Oe.source),je=RegExp(ke.source),Me=/<%-([\s\S]+?)%>/g,Ne=/<%([\s\S]+?)%>/g,Pe=/<%=([\s\S]+?)%>/g,Fe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,Le=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Re=/[\\^$.*+?()[\]{}|]/g,ze=RegExp(Re.source),Be=/^\s+/,Ve=/\s/,He=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ue=/\{\n\/\* \[wrapped with (.+)\] \*/,We=/,? & /,Ge=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ke=/[()=,{}\[\]\/\s]/,qe=/\\(\\)?/g,Je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ye=/\w*$/,Xe=/^[-+]0x[0-9a-f]+$/i,Ze=/^0b[01]+$/i,Qe=/^\[object .+?Constructor\]$/,$e=/^0o[0-7]+$/i,et=/^(?:0|[1-9]\d*)$/,tt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nt=/($^)/,rt=/['\n\r\u2028\u2029\\]/g,it=`\\ud800-\\udfff`,at=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,ot=`\\u2700-\\u27bf`,st=`a-z\\xdf-\\xf6\\xf8-\\xff`,ct=`\\xac\\xb1\\xd7\\xf7`,lt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,ut=`\\u2000-\\u206f`,dt=` \\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`,ft=`A-Z\\xc0-\\xd6\\xd8-\\xde`,pt=`\\ufe0e\\ufe0f`,mt=ct+lt+ut+dt,ht=`['’]`,j=`[`+it+`]`,gt=`[`+mt+`]`,_t=`[`+at+`]`,vt=`\\d+`,yt=`[`+ot+`]`,M=`[`+st+`]`,bt=`[^`+it+mt+vt+ot+st+ft+`]`,xt=`\\ud83c[\\udffb-\\udfff]`,St=`(?:`+_t+`|`+xt+`)`,Ct=`[^`+it+`]`,wt=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Tt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Et=`[`+ft+`]`,Dt=`\\u200d`,Ot=`(?:`+M+`|`+bt+`)`,kt=`(?:`+Et+`|`+bt+`)`,At=`(?:`+ht+`(?:d|ll|m|re|s|t|ve))?`,jt=`(?:`+ht+`(?:D|LL|M|RE|S|T|VE))?`,Mt=St+`?`,Nt=`[`+pt+`]?`,Pt=`(?:`+Dt+`(?:`+[Ct,wt,Tt].join(`|`)+`)`+Nt+Mt+`)*`,Ft=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,It=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Lt=Nt+Mt+Pt,Rt=`(?:`+[yt,wt,Tt].join(`|`)+`)`+Lt,zt=`(?:`+[Ct+_t+`?`,_t,wt,Tt,j].join(`|`)+`)`,Bt=RegExp(ht,`g`),Vt=RegExp(_t,`g`),Ht=RegExp(xt+`(?=`+xt+`)|`+zt+Lt,`g`),Ut=RegExp([Et+`?`+M+`+`+At+`(?=`+[gt,Et,`$`].join(`|`)+`)`,kt+`+`+jt+`(?=`+[gt,Et+Ot,`$`].join(`|`)+`)`,Et+`?`+Ot+`+`+At,Et+`+`+jt,It,Ft,vt,Rt].join(`|`),`g`),Wt=RegExp(`[`+Dt+it+at+pt+`]`),Gt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Kt=`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`.split(`.`),N=-1,qt={};qt[ge]=qt[_e]=qt[ve]=qt[ye]=qt[be]=qt[xe]=qt[Se]=qt[Ce]=qt[we]=!0,qt[C]=qt[w]=qt[me]=qt[T]=qt[he]=qt[te]=qt[E]=qt[D]=qt[k]=qt[re]=qt[ae]=qt[ce]=qt[A]=qt[le]=qt[fe]=!1;var Jt={};Jt[C]=Jt[w]=Jt[me]=Jt[he]=Jt[T]=Jt[te]=Jt[ge]=Jt[_e]=Jt[ve]=Jt[ye]=Jt[be]=Jt[k]=Jt[re]=Jt[ae]=Jt[ce]=Jt[A]=Jt[le]=Jt[ue]=Jt[xe]=Jt[Se]=Jt[Ce]=Jt[we]=!0,Jt[E]=Jt[D]=Jt[fe]=!1;var Yt={À:`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`},Xt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Zt={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},Qt={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},$t=parseFloat,en=parseInt,tn=typeof global==`object`&&global&&global.Object===Object&&global,nn=typeof self==`object`&&self&&self.Object===Object&&self,rn=tn||nn||Function(`return this`)(),an=typeof e==`object`&&e&&!e.nodeType&&e,on=an&&typeof t==`object`&&t&&!t.nodeType&&t,sn=on&&on.exports===an,cn=sn&&tn.process,ln=function(){try{return on&&on.require&&on.require(`util`).types||cn&&cn.binding&&cn.binding(`util`)}catch{}}(),un=ln&&ln.isArrayBuffer,dn=ln&&ln.isDate,fn=ln&&ln.isMap,pn=ln&&ln.isRegExp,mn=ln&&ln.isSet,hn=ln&&ln.isTypedArray;function gn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _n(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function P(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function vn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function yn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function bn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function xn(e,t){return!!(e!=null&&e.length)&&Nn(e,t,0)>-1}function Sn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Cn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function wn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Tn(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function En(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Dn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var On=Ln(`length`);function kn(e){return e.split(``)}function An(e){return e.match(Ge)||[]}function jn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Mn(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Nn(e,t,n){return t===t?lr(e,t,n):Mn(e,Fn,n)}function Pn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function Fn(e){return e!==e}function In(e,t){var n=e==null?0:e.length;return n?Vn(e,t)/n:v}function Ln(e){return function(t){return t==null?n:t[e]}}function Rn(e){return function(t){return e==null?n:e[t]}}function zn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Bn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Vn(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function Hn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Un(e,t){return Cn(t,function(t){return[t,e[t]]})}function Wn(e){return e&&e.slice(0,pr(e)+1).replace(Be,``)}function Gn(e){return function(t){return e(t)}}function Kn(e,t){return Cn(t,function(t){return e[t]})}function qn(e,t){return e.has(t)}function Jn(e,t){for(var n=-1,r=e.length;++n<r&&Nn(t,e[n],0)>-1;);return n}function Yn(e,t){for(var n=e.length;n--&&Nn(t,e[n],0)>-1;);return n}function Xn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Zn=Rn(Yt),Qn=Rn(Xt);function $n(e){return`\\`+Qt[e]}function er(e,t){return e==null?n:e[t]}function tr(e){return Wt.test(e)}function nr(e){return Gt.test(e)}function rr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function ir(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function ar(e,t){return function(n){return e(t(n))}}function or(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===a)&&(e[n]=a,o[i++]=n)}return o}function sr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function lr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function ur(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function dr(e){return tr(e)?hr(e):On(e)}function fr(e){return tr(e)?gr(e):kn(e)}function pr(e){for(var t=e.length;t--&&Ve.test(e.charAt(t)););return t}var mr=Rn(Zt);function hr(e){for(var t=Ht.lastIndex=0;Ht.test(e);)++t;return t}function gr(e){return e.match(Ht)||[]}function _r(e){return e.match(Ut)||[]}var vr=(function e(t){t=t==null?rn:vr.defaults(rn.Object(),t,vr.pick(rn,Kt));var Ve=t.Array,Ge=t.Date,it=t.Error,at=t.Function,ot=t.Math,st=t.Object,ct=t.RegExp,lt=t.String,ut=t.TypeError,dt=Ve.prototype,ft=at.prototype,pt=st.prototype,mt=t[`__core-js_shared__`],ht=ft.toString,j=pt.hasOwnProperty,gt=0,_t=function(){var e=/[^.]+$/.exec(mt&&mt.keys&&mt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),vt=pt.toString,yt=ht.call(st),M=rn._,bt=ct(`^`+ht.call(j).replace(Re,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),xt=sn?t.Buffer:n,St=t.Symbol,Ct=t.Uint8Array,wt=xt?xt.allocUnsafe:n,Tt=ar(st.getPrototypeOf,st),Et=st.create,Dt=pt.propertyIsEnumerable,Ot=dt.splice,kt=St?St.isConcatSpreadable:n,At=St?St.iterator:n,jt=St?St.toStringTag:n,Mt=function(){try{var e=Vo(st,`defineProperty`);return e({},``,{}),e}catch{}}(),Nt=t.clearTimeout!==rn.clearTimeout&&t.clearTimeout,Pt=Ge&&Ge.now!==rn.Date.now&&Ge.now,Ft=t.setTimeout!==rn.setTimeout&&t.setTimeout,It=ot.ceil,Lt=ot.floor,Rt=st.getOwnPropertySymbols,zt=xt?xt.isBuffer:n,Ht=t.isFinite,Ut=dt.join,Wt=ar(st.keys,st),Gt=ot.max,Yt=ot.min,Xt=Ge.now,Zt=t.parseInt,Qt=ot.random,tn=dt.reverse,nn=Vo(t,`DataView`),an=Vo(t,`Map`),on=Vo(t,`Promise`),cn=Vo(t,`Set`),ln=Vo(t,`WeakMap`),On=Vo(st,`create`),kn=ln&&new ln,Rn={},lr=Ts(nn),hr=Ts(an),gr=Ts(on),yr=Ts(cn),br=Ts(ln),xr=St?St.prototype:n,Sr=xr?xr.valueOf:n,Cr=xr?xr.toString:n;function F(e){if(mu(e)&&!G(e)&&!(e instanceof I)){if(e instanceof Er)return e;if(j.call(e,`__wrapped__`))return Ds(e)}return new Er(e)}var wr=function(){function e(){}return function(t){if(!pu(t))return{};if(Et)return Et(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Tr(){}function Er(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}F.templateSettings={escape:Me,evaluate:Ne,interpolate:Pe,variable:``,imports:{_:F}},F.prototype=Tr.prototype,F.prototype.constructor=F,Er.prototype=wr(Tr.prototype),Er.prototype.constructor=Er;function I(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function Dr(){var e=new I(this.__wrapped__);return e.__actions__=to(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=to(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=to(this.__views__),e}function Or(){if(this.__filtered__){var e=new I(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function kr(){var e=this.__wrapped__.value(),t=this.__dir__,n=G(e),r=t<0,i=n?e.length:0,a=Ko(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=Yt(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ia(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==2)g=b;else if(!b){if(y==1)continue outer;break outer}}m[f++]=g}return m}I.prototype=wr(Tr.prototype),I.prototype.constructor=I;function Ar(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function jr(){this.__data__=On?On(null):{},this.size=0}function Mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Nr(e){var t=this.__data__;if(On){var r=t[e];return r===i?n:r}return j.call(t,e)?t[e]:n}function Pr(e){var t=this.__data__;return On?t[e]!==n:j.call(t,e)}function Fr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=On&&t===n?i:t,this}Ar.prototype.clear=jr,Ar.prototype.delete=Mr,Ar.prototype.get=Nr,Ar.prototype.has=Pr,Ar.prototype.set=Fr;function Ir(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Lr(){this.__data__=[],this.size=0}function Rr(e){var t=this.__data__,n=li(t,e);return n<0?!1:(n==t.length-1?t.pop():Ot.call(t,n,1),--this.size,!0)}function zr(e){var t=this.__data__,r=li(t,e);return r<0?n:t[r][1]}function Br(e){return li(this.__data__,e)>-1}function Vr(e,t){var n=this.__data__,r=li(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Ir.prototype.clear=Lr,Ir.prototype.delete=Rr,Ir.prototype.get=zr,Ir.prototype.has=Br,Ir.prototype.set=Vr;function Hr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ur(){this.size=0,this.__data__={hash:new Ar,map:new(an||Ir),string:new Ar}}function Wr(e){var t=zo(this,e).delete(e);return this.size-=+!!t,t}function Gr(e){return zo(this,e).get(e)}function Kr(e){return zo(this,e).has(e)}function qr(e,t){var n=zo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}Hr.prototype.clear=Ur,Hr.prototype.delete=Wr,Hr.prototype.get=Gr,Hr.prototype.has=Kr,Hr.prototype.set=qr;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Hr;++t<n;)this.add(e[t])}function Yr(e){return this.__data__.set(e,i),this}function Xr(e){return this.__data__.has(e)}Jr.prototype.add=Jr.prototype.push=Yr,Jr.prototype.has=Xr;function Zr(e){var t=this.__data__=new Ir(e);this.size=t.size}function Qr(){this.__data__=new Ir,this.size=0}function $r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ei(e){return this.__data__.get(e)}function ti(e){return this.__data__.has(e)}function ni(e,t){var n=this.__data__;if(n instanceof Ir){var r=n.__data__;if(!an||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hr(r)}return n.set(e,t),this.size=n.size,this}Zr.prototype.clear=Qr,Zr.prototype.delete=$r,Zr.prototype.get=ei,Zr.prototype.has=ti,Zr.prototype.set=ni;function ri(e,t){var n=G(e),r=!n&&Ql(e),i=!n&&!r&&nu(e),a=!n&&!r&&!i&&ku(e),o=n||r||i||a,s=o?Hn(e.length,lt):[],c=s.length;for(var l in e)(t||j.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||$o(l,c)))&&s.push(l);return s}function ii(e){var t=e.length;return t?e[ga(0,t-1)]:n}function ai(e,t){return Ss(to(e),hi(t,0,e.length))}function oi(e){return Ss(to(e))}function si(e,t,r){(r!==n&&!Yl(e[t],r)||r===n&&!(t in e))&&pi(e,t,r)}function ci(e,t,r){var i=e[t];(!(j.call(e,t)&&Yl(i,r))||r===n&&!(t in e))&&pi(e,t,r)}function li(e,t){for(var n=e.length;n--;)if(Yl(e[n][0],t))return n;return-1}function ui(e,t,n,r){return xi(e,function(e,i,a){t(r,e,n(e),a)}),r}function di(e,t){return e&&no(t,ld(t),e)}function fi(e,t){return e&&no(t,ud(t),e)}function pi(e,t,n){t==`__proto__`&&Mt?Mt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function mi(e,t){for(var r=-1,i=t.length,a=Ve(i),o=e==null;++r<i;)a[r]=o?n:rd(e,t[r]);return a}function hi(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function gi(e,t,r,i,a,o){var s,c=t&1,l=t&2,u=t&4;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!pu(e))return e;var d=G(e);if(d){if(s=Yo(e),!c)return to(e,s)}else{var f=Go(e),p=f==D||f==O;if(nu(e))return Ga(e,c);if(f==ae||f==C||p&&!a){if(s=l||p?{}:Xo(e),!c)return l?io(e,fi(s,e)):ro(e,di(s,e))}else{if(!Jt[f])return a?e:{};s=H(e,f,c)}}o||=new Zr;var m=o.get(e);if(m)return m;o.set(e,s),Eu(e)?e.forEach(function(n){s.add(gi(n,t,r,n,e,o))}):hu(e)&&e.forEach(function(n,i){s.set(i,gi(n,t,r,i,e,o))});var h=d?n:(u?l?Fo:Po:l?ud:ld)(e);return P(h||e,function(n,i){h&&(i=n,n=e[i]),ci(s,i,gi(n,t,r,i,e,o))}),s}function _i(e){var t=ld(e);return function(n){return vi(n,e,t)}}function vi(e,t,r){var i=r.length;if(e==null)return!i;for(e=st(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function yi(e,t,i){if(typeof e!=`function`)throw new ut(r);return vs(function(){e.apply(n,i)},t)}function bi(e,t,n,r){var i=-1,a=xn,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=Cn(t,Gn(n))),r?(a=Sn,o=!1):t.length>=200&&(a=qn,o=!1,t=new Jr(t));outer:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=l;f--;)if(t[f]===d)continue outer;c.push(u)}else a(t,d,r)||c.push(u)}return c}var xi=so(Ai),Si=so(ji,!0);function Ci(e,t){var n=!0;return xi(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function wi(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Ou(s):r(s,c)))var c=s,l=o}return l}function Ti(e,t,r,i){var a=e.length;for(r=q(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:q(i),i<0&&(i+=a),i=r>i?0:Lu(i);r<i;)e[r++]=t;return e}function Ei(e,t){var n=[];return xi(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Di(e,t,n,r,i){var a=-1,o=e.length;for(n||=Qo,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?Di(s,t-1,n,r,i):wn(i,s):r||(i[i.length]=s)}return i}var Oi=co(),ki=co(!0);function Ai(e,t){return e&&Oi(e,t,ld)}function ji(e,t){return e&&ki(e,t,ld)}function Mi(e,t){return bn(t,function(t){return uu(e[t])})}function Ni(e,t){t=Va(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[ws(t[r++])];return r&&r==i?e:n}function Pi(e,t,n){var r=t(e);return G(e)?r:wn(r,n(e))}function Fi(e){return e==null?e===n?de:ie:jt&&jt in st(e)?Ho(e):fs(e)}function Ii(e,t){return e>t}function Li(e,t){return e!=null&&j.call(e,t)}function Ri(e,t){return e!=null&&t in st(e)}function zi(e,t,n){return e>=Yt(t,n)&&e<Gt(t,n)}function Bi(e,t,r){for(var i=r?Sn:xn,a=e[0].length,o=e.length,s=o,c=Ve(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Cn(d,Gn(t))),l=Yt(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new Jr(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?qn(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?qn(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function Vi(e,t,n,r){return Ai(e,function(e,i,a){t(r,n(e),i,a)}),r}function Hi(e,t,r){t=Va(t,e),e=ms(e,t);var i=e==null?e:e[ws(Xs(t))];return i==null?n:gn(i,e,r)}function Ui(e){return mu(e)&&Fi(e)==C}function Wi(e){return mu(e)&&Fi(e)==me}function Gi(e){return mu(e)&&Fi(e)==te}function Ki(e,t,n,r,i){return e===t?!0:e==null||t==null||!mu(e)&&!mu(t)?e!==e&&t!==t:qi(e,t,n,r,Ki,i)}function qi(e,t,n,r,i,a){var o=G(e),s=G(t),c=o?w:Go(e),l=s?w:Go(t);c=c==C?ae:c,l=l==C?ae:l;var u=c==ae,d=l==ae,f=c==l;if(f&&nu(e)){if(!nu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Zr,o||ku(e)?Ao(e,t,n,r,i,a):jo(e,t,c,n,r,i,a);if(!(n&1)){var p=u&&j.call(e,`__wrapped__`),m=d&&j.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Zr,i(h,g,n,r,a)}}return f?(a||=new Zr,Mo(e,t,n,r,i,a)):!1}function Ji(e){return mu(e)&&Go(e)==k}function Yi(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=st(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new Zr;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?Ki(d,u,3,i,f):p))return!1}}return!0}function Xi(e){return!pu(e)||is(e)?!1:(uu(e)?bt:Qe).test(Ts(e))}function Zi(e){return mu(e)&&Fi(e)==ce}function Qi(e){return mu(e)&&Go(e)==A}function $i(e){return mu(e)&&fu(e.length)&&!!qt[Fi(e)]}function ea(e){return typeof e==`function`?e:e==null?gf:typeof e==`object`?G(e)?oa(e[0],e[1]):aa(e):kf(e)}function ta(e){if(!os(e))return Wt(e);var t=[];for(var n in st(e))j.call(e,n)&&n!=`constructor`&&t.push(n);return t}function na(e){if(!pu(e))return ds(e);var t=os(e),n=[];for(var r in e)(r!=`constructor`||!t&&j.call(e,r))&&n.push(r);return n}function ra(e,t){return e<t}function ia(e,t){var n=-1,r=eu(e)?Ve(e.length):[];return xi(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function aa(e){var t=Bo(e);return t.length==1&&t[0][2]?cs(t[0][0],t[0][1]):function(n){return n===e||Yi(n,e,t)}}function oa(e,t){return ts(e)&&ss(t)?cs(ws(e),t):function(r){var i=rd(r,e);return i===n&&i===t?ad(r,e):Ki(t,i,3)}}function sa(e,t,r,i,a){e!==t&&Oi(t,function(o,s){if(a||=new Zr,pu(o))ca(e,t,s,r,sa,i,a);else{var c=i?i(gs(e,s),o,s+``,e,t,a):n;c===n&&(c=o),si(e,s,c)}},ud)}function ca(e,t,r,i,a,o,s){var c=gs(e,r),l=gs(t,r),u=s.get(l);if(u){si(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=G(l),m=!p&&nu(l),h=!p&&!m&&ku(l);d=l,p||m||h?G(c)?d=c:K(c)?d=to(c):m?(f=!1,d=Ga(l,!0)):h?(f=!1,d=Xa(l,!0)):d=[]:Cu(l)||Ql(l)?(d=c,Ql(c)?d=zu(c):(!pu(c)||uu(c))&&(d=Xo(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),si(e,r,d)}function la(e,t){var r=e.length;if(r)return t+=t<0?r:0,$o(t,r)?e[t]:n}function ua(e,t,n){t=t.length?Cn(t,function(e){return G(e)?function(t){return Ni(t,e.length===1?e[0]:e)}:e}):[gf];var r=-1;return t=Cn(t,Gn(V())),Bn(ia(e,function(e,n,i){return{criteria:Cn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Qa(e,t,n)})}function da(e,t){return fa(e,t,function(t,n){return ad(e,n)})}function fa(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Ni(e,o);n(s,o)&&xa(a,Va(o,e),s)}return a}function pa(e){return function(t){return Ni(t,e)}}function ma(e,t,n,r){var i=r?Pn:Nn,a=-1,o=t.length,s=e;for(e===t&&(t=to(t)),n&&(s=Cn(e,Gn(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Ot.call(s,c,1),Ot.call(e,c,1);return e}function ha(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;$o(i)?Ot.call(e,i,1):Na(e,i)}}return e}function ga(e,t){return e+Lt(Qt()*(t-e+1))}function _a(e,t,n,r){for(var i=-1,a=Gt(It((t-e)/(n||1)),0),o=Ve(a);a--;)o[r?a:++i]=e,e+=n;return o}function va(e,t){var n=``;if(!e||t<1||t>g)return n;do t%2&&(n+=e),t=Lt(t/2),t&&(e+=e);while(t);return n}function L(e,t){return ys(ps(e,t,gf),e+``)}function ya(e){return ii(Od(e))}function ba(e,t){var n=Od(e);return Ss(n,hi(t,0,n.length))}function xa(e,t,r,i){if(!pu(e))return e;t=Va(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=ws(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=pu(d)?d:$o(t[a+1])?[]:{})}ci(c,l,u),c=c[l]}return e}var Sa=kn?function(e,t){return kn.set(e,t),e}:gf,Ca=Mt?function(e,t){return Mt(e,`toString`,{configurable:!0,enumerable:!1,value:pf(t),writable:!0})}:gf;function wa(e){return Ss(Od(e))}function Ta(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Ve(i);++r<i;)a[r]=e[r+t];return a}function Ea(e,t){var n;return xi(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Da(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=x){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Ou(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Oa(e,t,gf,n)}function Oa(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Ou(t),u=t===n;a<o;){var d=Lt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Ou(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return Yt(o,b)}function ka(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!Yl(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Aa(e){return typeof e==`number`?e:Ou(e)?v:+e}function ja(e){if(typeof e==`string`)return e;if(G(e))return Cn(e,ja)+``;if(Ou(e))return Cr?Cr.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ma(e,t,n){var r=-1,i=xn,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=Sn;else if(a>=200){var l=t?null:To(e);if(l)return sr(l);o=!1,i=qn,c=new Jr}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}function Na(e,t){t=Va(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=ws(t[n]);if(i===`__proto__`&&!j.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ms(e,t);return a==null||delete a[ws(Xs(t))]}function Pa(e,t,n,r){return xa(e,t,n(Ni(e,t)),r)}function Fa(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ta(e,r?0:a,r?a+1:i):Ta(e,r?a+1:0,r?i:a)}function Ia(e,t){var n=e;return n instanceof I&&(n=n.value()),Tn(t,function(e,t){return t.func.apply(t.thisArg,wn([e],t.args))},n)}function La(e,t,n){var r=e.length;if(r<2)return r?Ma(e[0]):[];for(var i=-1,a=Ve(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=bi(a[i]||o,e[s],t,n));return Ma(Di(a,1),t,n)}function Ra(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function za(e){return K(e)?e:[]}function Ba(e){return typeof e==`function`?e:gf}function Va(e,t){return G(e)?e:ts(e,t)?[e]:Cs(J(e))}var Ha=L;function Ua(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ta(e,t,r)}var Wa=Nt||function(e){return rn.clearTimeout(e)};function Ga(e,t){if(t)return e.slice();var n=e.length,r=wt?wt(n):new e.constructor(n);return e.copy(r),r}function Ka(e){var t=new e.constructor(e.byteLength);return new Ct(t).set(new Ct(e)),t}function qa(e,t){var n=t?Ka(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Ja(e){var t=new e.constructor(e.source,Ye.exec(e));return t.lastIndex=e.lastIndex,t}function Ya(e){return Sr?st(Sr.call(e)):{}}function Xa(e,t){var n=t?Ka(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Za(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Ou(e),s=t!==n,c=t===null,l=t===t,u=Ou(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function Qa(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Za(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function $a(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=Gt(a-o,0),u=Ve(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function eo(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=Gt(a-s,0),d=Ve(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function to(e,t){var n=-1,r=e.length;for(t||=Ve(r);++n<r;)t[n]=e[n];return t}function no(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?pi(r,c,l):ci(r,c,l)}return r}function ro(e,t){return no(e,Uo(e),t)}function io(e,t){return no(e,Wo(e),t)}function ao(e,t){return function(n,r){var i=G(n)?_n:ui,a=t?t():{};return i(n,e,V(r,2),a)}}function oo(e){return L(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&es(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=st(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function so(e,t){return function(n,r){if(n==null)return n;if(!eu(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=st(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function co(e){return function(t,n,r){for(var i=-1,a=st(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function lo(e,t,n){var r=t&o,i=po(e);function a(){return(this&&this!==rn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function uo(e){return function(t){t=J(t);var r=tr(t)?fr(t):n,i=r?r[0]:t.charAt(0),a=r?Ua(r,1).join(``):t.slice(1);return i[e]()+a}}function fo(e){return function(t){return Tn(lf(Fd(t).replace(Bt,``)),e,``)}}function po(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=wr(e.prototype),r=e.apply(n,t);return pu(r)?r:n}}function mo(e,t,r){var i=po(e);function a(){for(var o=arguments.length,s=Ve(o),c=o,l=Ro(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:or(s,l);return o-=u.length,o<r?Co(e,t,R,a.placeholder,n,s,u,n,n,r-o):gn(this&&this!==rn&&this instanceof a?i:e,this,s)}return a}function ho(e){return function(t,r,i){var a=st(t);if(!eu(t)){var o=V(r,3);t=ld(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function go(e){return No(function(t){var i=t.length,a=i,o=Er.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!=`function`)throw new ut(r);if(o&&!l&&Lo(s)==`wrapper`)var l=new Er([],!0)}for(a=l?a:i;++a<i;){s=t[a];var d=Lo(s),m=d==`wrapper`?Io(s):n;l=m&&rs(m[0])&&m[1]==(f|c|u|p)&&!m[4].length&&m[9]==1?l[Lo(m[0])].apply(l,m[3]):s.length==1&&rs(s)?l[d]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&e.length==1&&G(n))return l.plant(n).value();for(var r=0,a=i?t[r].apply(this,e):n;++r<i;)a=t[r].call(this,a);return a}})}function R(e,t,r,i,a,u,d,p,h,g){var _=t&f,v=t&o,y=t&s,b=t&(c|l),x=t&m,S=y?n:po(e);function C(){for(var n=arguments.length,o=Ve(n),s=n;s--;)o[s]=arguments[s];if(b)var c=Ro(C),l=Xn(o,c);if(i&&(o=$a(o,i,a,b)),u&&(o=eo(o,u,d,b)),n-=l,b&&n<g){var f=or(o,c);return Co(e,t,R,C.placeholder,r,o,f,p,h,g-n)}var m=v?r:this,w=y?m[e]:e;return n=o.length,p?o=hs(o,p):x&&n>1&&o.reverse(),_&&h<n&&(o.length=h),this&&this!==rn&&this instanceof C&&(w=S||po(w)),w.apply(m,o)}return C}function _o(e,t){return function(n,r){return Vi(n,e,t(r),{})}}function vo(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=ja(r),i=ja(i)):(r=Aa(r),i=Aa(i)),a=e(r,i)}return a}}function yo(e){return No(function(t){return t=Cn(t,Gn(V())),L(function(n){var r=this;return e(t,function(e){return gn(e,r,n)})})})}function z(e,t){t=t===n?` `:ja(t);var r=t.length;if(r<2)return r?va(t,e):t;var i=va(t,It(e/dr(t)));return tr(t)?Ua(fr(i),0,e).join(``):i.slice(0,e)}function bo(e,t,n,r){var i=t&o,a=po(e);function s(){for(var t=-1,o=arguments.length,c=-1,l=r.length,u=Ve(l+o),d=this&&this!==rn&&this instanceof s?a:e;++c<l;)u[c]=r[c];for(;o--;)u[c++]=arguments[++t];return gn(d,i?n:this,u)}return s}function xo(e){return function(t,r,i){return i&&typeof i!=`number`&&es(t,r,i)&&(r=i=n),t=Iu(t),r===n?(r=t,t=0):r=Iu(r),i=i===n?t<r?1:-1:Iu(i),_a(t,r,i,e)}}function So(e){return function(t,n){return(typeof t!=`string`||typeof n!=`string`)&&(t=Ru(t),n=Ru(n)),e(t,n)}}function Co(e,t,r,i,a,l,f,p,m,h){var g=t&c,_=g?f:n,v=g?n:f,y=g?l:n,b=g?n:l;t|=g?u:d,t&=~(g?d:u),t&4||(t&=~(o|s));var x=[e,t,a,y,_,b,v,p,m,h],S=r.apply(n,x);return rs(e)&&_s(S,x),S.placeholder=i,bs(S,e,t)}function wo(e){var t=ot[e];return function(e,n){if(e=Ru(e),n=n==null?0:Yt(q(n),292),n&&Ht(e)){var r=(J(e)+`e`).split(`e`);return r=(J(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var To=cn&&1/sr(new cn([,-0]))[1]==h?function(e){return new cn(e)}:wf;function Eo(e){return function(t){var n=Go(t);return n==k?ir(t):n==A?cr(t):Un(t,e(t))}}function Do(e,t,i,a,f,p,m,h){var g=t&s;if(!g&&typeof e!=`function`)throw new ut(r);var _=a?a.length:0;if(_||(t&=~(u|d),a=f=n),m=m===n?m:Gt(q(m),0),h=h===n?h:q(h),_-=f?f.length:0,t&d){var v=a,y=f;a=f=n}var b=g?n:Io(e),x=[e,t,i,a,f,v,y,p,m,h];if(b&&us(x,b),e=x[0],t=x[1],i=x[2],a=x[3],f=x[4],h=x[9]=x[9]===n?g?0:e.length:Gt(x[9]-_,0),!h&&t&(c|l)&&(t&=~(c|l)),!t||t==o)var S=lo(e,t,i);else S=t==c||t==l?mo(e,t,h):(t==u||t==(o|u))&&!f.length?bo(e,t,i,a):R.apply(n,x);return bs((b?Sa:_s)(S,x),e,t)}function B(e,t,r,i){return e===n||Yl(e,pt[r])&&!j.call(i,r)?t:e}function Oo(e,t,r,i,a,o){return pu(e)&&pu(t)&&(o.set(t,e),sa(e,t,n,Oo,o),o.delete(t)),e}function ko(e){return Cu(e)?n:e}function Ao(e,t,r,i,a,o){var s=r&1,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&2?new Jr:n;for(o.set(e,t),o.set(t,e);++f<c;){var h=e[f],g=t[f];if(i)var _=s?i(g,h,f,t,e,o):i(h,g,f,e,t,o);if(_!==n){if(_)continue;p=!1;break}if(m){if(!Dn(t,function(e,t){if(!qn(m,t)&&(h===e||a(h,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(h===g||a(h,g,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function jo(e,t,n,r,i,a,o){switch(n){case he:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case me:return!(e.byteLength!=t.byteLength||!a(new Ct(e),new Ct(t)));case T:case te:case re:return Yl(+e,+t);case E:return e.name==t.name&&e.message==t.message;case ce:case le:return e==t+``;case k:var s=ir;case A:var c=r&1;if(s||=sr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=Ao(s(e),s(t),r,i,a,o);return o.delete(e),u;case ue:if(Sr)return Sr.call(e)==Sr.call(t)}return!1}function Mo(e,t,r,i,a,o){var s=r&1,c=Po(e),l=c.length;if(l!=Po(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:j.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<l;){d=c[u];var g=e[d],_=t[d];if(i)var v=s?i(_,g,d,t,e,o):i(g,_,d,e,t,o);if(!(v===n?g===_||a(g,_,r,i,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return o.delete(e),o.delete(t),m}function No(e){return ys(ps(e,n,W),e+``)}function Po(e){return Pi(e,ld,Uo)}function Fo(e){return Pi(e,ud,Wo)}var Io=kn?function(e){return kn.get(e)}:wf;function Lo(e){for(var t=e.name+``,n=Rn[t],r=j.call(Rn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Ro(e){return(j.call(F,`placeholder`)?F:e).placeholder}function V(){var e=F.iteratee||_f;return e=e===_f?ea:e,arguments.length?e(arguments[0],arguments[1]):e}function zo(e,t){var n=e.__data__;return ns(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Bo(e){for(var t=ld(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ss(i)]}return t}function Vo(e,t){var r=er(e,t);return Xi(r)?r:n}function Ho(e){var t=j.call(e,jt),r=e[jt];try{e[jt]=n;var i=!0}catch{}var a=vt.call(e);return i&&(t?e[jt]=r:delete e[jt]),a}var Uo=Rt?function(e){return e==null?[]:(e=st(e),bn(Rt(e),function(t){return Dt.call(e,t)}))}:Nf,Wo=Rt?function(e){for(var t=[];e;)wn(t,Uo(e)),e=Tt(e);return t}:Nf,Go=Fi;(nn&&Go(new nn(new ArrayBuffer(1)))!=he||an&&Go(new an)!=k||on&&Go(on.resolve())!=oe||cn&&Go(new cn)!=A||ln&&Go(new ln)!=fe)&&(Go=function(e){var t=Fi(e),r=t==ae?e.constructor:n,i=r?Ts(r):``;if(i)switch(i){case lr:return he;case hr:return k;case gr:return oe;case yr:return A;case br:return fe}return t});function Ko(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=Yt(t,e+o);break;case`takeRight`:e=Gt(e,t-o)}}return{start:e,end:t}}function qo(e){var t=e.match(Ue);return t?t[1].split(We):[]}function Jo(e,t,n){t=Va(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=ws(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&fu(i)&&$o(o,i)&&(G(e)||Ql(e)))}function Yo(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&j.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Xo(e){return typeof e.constructor==`function`&&!os(e)?wr(Tt(e)):{}}function H(e,t,n){var r=e.constructor;switch(t){case me:return Ka(e);case T:case te:return new r(+e);case he:return qa(e,n);case ge:case _e:case ve:case ye:case be:case xe:case Se:case Ce:case we:return Xa(e,n);case k:return new r;case re:case le:return new r(e);case ce:return Ja(e);case A:return new r;case ue:return Ya(e)}}function Zo(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(He,`{
|
|
11
|
+
/* [wrapped with `+t+`] */
|
|
12
|
+
`)}function Qo(e){return G(e)||Ql(e)||!!(kt&&e&&e[kt])}function $o(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&et.test(e))&&e>-1&&e%1==0&&e<t}function es(e,t,n){if(!pu(n))return!1;var r=typeof t;return(r==`number`?eu(n)&&$o(t,n.length):r==`string`&&t in n)?Yl(n[t],e):!1}function ts(e,t){if(G(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Ou(e)?!0:Ie.test(e)||!Fe.test(e)||t!=null&&e in st(t)}function ns(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function rs(e){var t=Lo(e),n=F[t];if(typeof n!=`function`||!(t in I.prototype))return!1;if(e===n)return!0;var r=Io(n);return!!r&&e===r[0]}function is(e){return!!_t&&_t in e}var as=mt?uu:Pf;function os(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||pt)}function ss(e){return e===e&&!pu(e)}function cs(e,t){return function(r){return r!=null&&r[e]===t&&(t!==n||e in st(r))}}function ls(e){var t=jl(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function us(e,t){var n=e[1],r=t[1],i=n|r,l=i<(o|s|f),u=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&t[7].length<=t[8]&&n==c;if(!(l||u))return e;r&o&&(e[2]=t[2],i|=n&o?0:4);var d=t[3];if(d){var m=e[3];e[3]=m?$a(m,d,t[4]):d,e[4]=m?or(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?eo(m,d,t[6]):d,e[6]=m?or(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:Yt(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function ds(e){var t=[];if(e!=null)for(var n in st(e))t.push(n);return t}function fs(e){return vt.call(e)}function ps(e,t,r){return t=Gt(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Gt(n.length-t,0),o=Ve(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Ve(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),gn(e,this,s)}}function ms(e,t){return t.length<2?e:Ni(e,Ta(t,0,-1))}function hs(e,t){for(var r=e.length,i=Yt(t.length,r),a=to(e);i--;){var o=t[i];e[i]=$o(o,r)?a[o]:n}return e}function gs(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var _s=xs(Sa),vs=Ft||function(e,t){return rn.setTimeout(e,t)},ys=xs(Ca);function bs(e,t,n){var r=t+``;return ys(e,Zo(r,Es(qo(r),n)))}function xs(e){var t=0,r=0;return function(){var i=Xt(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ss(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=ga(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Cs=ls(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Le,function(e,n,r,i){t.push(r?i.replace(qe,`$1`):n||e)}),t});function ws(e){if(typeof e==`string`||Ou(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ts(e){if(e!=null){try{return ht.call(e)}catch{}try{return e+``}catch{}}return``}function Es(e,t){return P(S,function(n){var r=`_.`+n[0];t&n[1]&&!xn(e,r)&&e.push(r)}),e.sort()}function Ds(e){if(e instanceof I)return e.clone();var t=new Er(e.__wrapped__,e.__chain__);return t.__actions__=to(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Os(e,t,r){t=(r?es(e,t,r):t===n)?1:Gt(q(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=Ve(It(i/t));a<i;)s[o++]=Ta(e,a,a+=t);return s}function ks(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function As(){var e=arguments.length;if(!e)return[];for(var t=Ve(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return wn(G(n)?to(n):[n],Di(t,1))}var js=L(function(e,t){return K(e)?bi(e,Di(t,1,K,!0)):[]}),Ms=L(function(e,t){var r=Xs(t);return K(r)&&(r=n),K(e)?bi(e,Di(t,1,K,!0),V(r,2)):[]}),Ns=L(function(e,t){var r=Xs(t);return K(r)&&(r=n),K(e)?bi(e,Di(t,1,K,!0),n,r):[]});function Ps(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:q(t),Ta(e,t<0?0:t,i)):[]}function Fs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:q(t),t=i-t,Ta(e,0,t<0?0:t)):[]}function U(e,t){return e&&e.length?Fa(e,V(t,3),!0,!0):[]}function Is(e,t){return e&&e.length?Fa(e,V(t,3),!0):[]}function Ls(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&es(e,t,n)&&(n=0,r=i),Ti(e,t,n,r)):[]}function Rs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:q(n);return i<0&&(i=Gt(r+i,0)),Mn(e,V(t,3),i)}function zs(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=q(r),a=r<0?Gt(i+a,0):Yt(a,i-1)),Mn(e,V(t,3),a,!0)}function W(e){return e!=null&&e.length?Di(e,1):[]}function Bs(e){return e!=null&&e.length?Di(e,h):[]}function Vs(e,t){return e!=null&&e.length?(t=t===n?1:q(t),Di(e,t)):[]}function Hs(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];pi(r,i[0],i[1])}return r}function Us(e){return e&&e.length?e[0]:n}function Ws(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:q(n);return i<0&&(i=Gt(r+i,0)),Nn(e,t,i)}function Gs(e){return e!=null&&e.length?Ta(e,0,-1):[]}var Ks=L(function(e){var t=Cn(e,za);return t.length&&t[0]===e[0]?Bi(t):[]}),qs=L(function(e){var t=Xs(e),r=Cn(e,za);return t===Xs(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Bi(r,V(t,2)):[]}),Js=L(function(e){var t=Xs(e),r=Cn(e,za);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Bi(r,n,t):[]});function Ys(e,t){return e==null?``:Ut.call(e,t)}function Xs(e){var t=e==null?0:e.length;return t?e[t-1]:n}function Zs(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=q(r),a=a<0?Gt(i+a,0):Yt(a,i-1)),t===t?ur(e,t,a):Mn(e,Fn,a,!0)}function Qs(e,t){return e&&e.length?la(e,q(t)):n}var $s=L(ec);function ec(e,t){return e&&e.length&&t&&t.length?ma(e,t):e}function tc(e,t,n){return e&&e.length&&t&&t.length?ma(e,t,V(n,2)):e}function nc(e,t,r){return e&&e.length&&t&&t.length?ma(e,t,n,r):e}var rc=No(function(e,t){var n=e==null?0:e.length,r=mi(e,t);return ha(e,Cn(t,function(e){return $o(e,n)?+e:e}).sort(Za)),r});function ic(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=V(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return ha(e,i),n}function ac(e){return e==null?e:tn.call(e)}function oc(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&es(e,t,r)?(t=0,r=i):(t=t==null?0:q(t),r=r===n?i:q(r)),Ta(e,t,r)):[]}function sc(e,t){return Da(e,t)}function cc(e,t,n){return Oa(e,t,V(n,2))}function lc(e,t){var n=e==null?0:e.length;if(n){var r=Da(e,t);if(r<n&&Yl(e[r],t))return r}return-1}function uc(e,t){return Da(e,t,!0)}function dc(e,t,n){return Oa(e,t,V(n,2),!0)}function fc(e,t){if(e!=null&&e.length){var n=Da(e,t,!0)-1;if(Yl(e[n],t))return n}return-1}function pc(e){return e&&e.length?ka(e):[]}function mc(e,t){return e&&e.length?ka(e,V(t,2)):[]}function hc(e){var t=e==null?0:e.length;return t?Ta(e,1,t):[]}function gc(e,t,r){return e&&e.length?(t=r||t===n?1:q(t),Ta(e,0,t<0?0:t)):[]}function _c(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:q(t),t=i-t,Ta(e,t<0?0:t,i)):[]}function vc(e,t){return e&&e.length?Fa(e,V(t,3),!1,!0):[]}function yc(e,t){return e&&e.length?Fa(e,V(t,3)):[]}var bc=L(function(e){return Ma(Di(e,1,K,!0))}),xc=L(function(e){var t=Xs(e);return K(t)&&(t=n),Ma(Di(e,1,K,!0),V(t,2))}),Sc=L(function(e){var t=Xs(e);return t=typeof t==`function`?t:n,Ma(Di(e,1,K,!0),n,t)});function Cc(e){return e&&e.length?Ma(e):[]}function wc(e,t){return e&&e.length?Ma(e,V(t,2)):[]}function Tc(e,t){return t=typeof t==`function`?t:n,e&&e.length?Ma(e,n,t):[]}function Ec(e){if(!(e&&e.length))return[];var t=0;return e=bn(e,function(e){if(K(e))return t=Gt(e.length,t),!0}),Hn(t,function(t){return Cn(e,Ln(t))})}function Dc(e,t){if(!(e&&e.length))return[];var r=Ec(e);return t==null?r:Cn(r,function(e){return gn(t,n,e)})}var Oc=L(function(e,t){return K(e)?bi(e,t):[]}),kc=L(function(e){return La(bn(e,K))}),Ac=L(function(e){var t=Xs(e);return K(t)&&(t=n),La(bn(e,K),V(t,2))}),jc=L(function(e){var t=Xs(e);return t=typeof t==`function`?t:n,La(bn(e,K),n,t)}),Mc=L(Ec);function Nc(e,t){return Ra(e||[],t||[],ci)}function Pc(e,t){return Ra(e||[],t||[],xa)}var Fc=L(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,Dc(e,r)});function Ic(e){var t=F(e);return t.__chain__=!0,t}function Lc(e,t){return t(e),e}function Rc(e,t){return t(e)}var zc=No(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return mi(t,e)};return t>1||this.__actions__.length||!(i instanceof I)||!$o(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:Rc,args:[a],thisArg:n}),new Er(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function Bc(){return Ic(this)}function Vc(){return new Er(this.value(),this.__chain__)}function Hc(){this.__values__===n&&(this.__values__=Fu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function Uc(){return this}function Wc(e){for(var t,r=this;r instanceof Tr;){var i=Ds(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function Gc(){var e=this.__wrapped__;if(e instanceof I){var t=e;return this.__actions__.length&&(t=new I(this)),t=t.reverse(),t.__actions__.push({func:Rc,args:[ac],thisArg:n}),new Er(t,this.__chain__)}return this.thru(ac)}function Kc(){return Ia(this.__wrapped__,this.__actions__)}var qc=ao(function(e,t,n){j.call(e,n)?++e[n]:pi(e,n,1)});function Jc(e,t,r){var i=G(e)?yn:Ci;return r&&es(e,t,r)&&(t=n),i(e,V(t,3))}function Yc(e,t){return(G(e)?bn:Ei)(e,V(t,3))}var Xc=ho(Rs),Zc=ho(zs);function Qc(e,t){return Di(sl(e,t),1)}function $c(e,t){return Di(sl(e,t),h)}function el(e,t,r){return r=r===n?1:q(r),Di(sl(e,t),r)}function tl(e,t){return(G(e)?P:xi)(e,V(t,3))}function nl(e,t){return(G(e)?vn:Si)(e,V(t,3))}var rl=ao(function(e,t,n){j.call(e,n)?e[n].push(t):pi(e,n,[t])});function il(e,t,n,r){e=eu(e)?e:Od(e),n=n&&!r?q(n):0;var i=e.length;return n<0&&(n=Gt(i+n,0)),Du(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Nn(e,t,n)>-1}var al=L(function(e,t,n){var r=-1,i=typeof t==`function`,a=eu(e)?Ve(e.length):[];return xi(e,function(e){a[++r]=i?gn(t,e,n):Hi(e,t,n)}),a}),ol=ao(function(e,t,n){pi(e,n,t)});function sl(e,t){return(G(e)?Cn:ia)(e,V(t,3))}function cl(e,t,r,i){return e==null?[]:(G(t)||(t=t==null?[]:[t]),r=i?n:r,G(r)||(r=r==null?[]:[r]),ua(e,t,r))}var ll=ao(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function ul(e,t,n){var r=G(e)?Tn:zn,i=arguments.length<3;return r(e,V(t,4),n,i,xi)}function dl(e,t,n){var r=G(e)?En:zn,i=arguments.length<3;return r(e,V(t,4),n,i,Si)}function fl(e,t){return(G(e)?bn:Ei)(e,Ml(V(t,3)))}function pl(e){return(G(e)?ii:ya)(e)}function ml(e,t,r){return t=(r?es(e,t,r):t===n)?1:q(t),(G(e)?ai:ba)(e,t)}function hl(e){return(G(e)?oi:wa)(e)}function gl(e){if(e==null)return 0;if(eu(e))return Du(e)?dr(e):e.length;var t=Go(e);return t==k||t==A?e.size:ta(e).length}function _l(e,t,r){var i=G(e)?Dn:Ea;return r&&es(e,t,r)&&(t=n),i(e,V(t,3))}var vl=L(function(e,t){if(e==null)return[];var n=t.length;return n>1&&es(e,t[0],t[1])?t=[]:n>2&&es(t[0],t[1],t[2])&&(t=[t[0]]),ua(e,Di(t,1),[])}),yl=Pt||function(){return rn.Date.now()};function bl(e,t){if(typeof t!=`function`)throw new ut(r);return e=q(e),function(){if(--e<1)return t.apply(this,arguments)}}function xl(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,Do(e,f,n,n,n,n,t)}function Sl(e,t){var i;if(typeof t!=`function`)throw new ut(r);return e=q(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var Cl=L(function(e,t,n){var r=o;if(n.length){var i=or(n,Ro(Cl));r|=u}return Do(e,r,t,n,i)}),wl=L(function(e,t,n){var r=o|s;if(n.length){var i=or(n,Ro(wl));r|=u}return Do(t,r,e,n,i)});function Tl(e,t,r){t=r?n:t;var i=Do(e,c,n,n,n,n,n,t);return i.placeholder=Tl.placeholder,i}function El(e,t,r){t=r?n:t;var i=Do(e,l,n,n,n,n,n,t);return i.placeholder=El.placeholder,i}function Dl(e,t,i){var a,o,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new ut(r);t=Ru(t)||0,pu(i)&&(f=!!i.leading,p=`maxWait`in i,s=p?Gt(Ru(i.maxWait)||0,t):s,m=`trailing`in i?!!i.trailing:m);function h(t){var r=a,i=o;return a=o=n,d=t,c=e.apply(i,r),c}function g(e){return d=e,l=vs(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?Yt(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=yl();if(v(e))return b(e);l=vs(y,_(e))}function b(e){return l=n,m&&a?h(e):(a=o=n,c)}function x(){l!==n&&Wa(l),d=0,a=u=o=l=n}function S(){return l===n?c:b(yl())}function C(){var e=yl(),r=v(e);if(a=arguments,o=this,u=e,r){if(l===n)return g(u);if(p)return Wa(l),l=vs(y,t),h(u)}return l===n&&(l=vs(y,t)),c}return C.cancel=x,C.flush=S,C}var Ol=L(function(e,t){return yi(e,1,t)}),kl=L(function(e,t,n){return yi(e,Ru(t)||0,n)});function Al(e){return Do(e,m)}function jl(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new ut(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(jl.Cache||Hr),n}jl.Cache=Hr;function Ml(e){if(typeof e!=`function`)throw new ut(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Nl(e){return Sl(2,e)}var Pl=Ha(function(e,t){t=t.length==1&&G(t[0])?Cn(t[0],Gn(V())):Cn(Di(t,1),Gn(V()));var n=t.length;return L(function(r){for(var i=-1,a=Yt(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return gn(e,this,r)})}),Fl=L(function(e,t){return Do(e,u,n,t,or(t,Ro(Fl)))}),Il=L(function(e,t){return Do(e,d,n,t,or(t,Ro(Il)))}),Ll=No(function(e,t){return Do(e,p,n,n,n,t)});function Rl(e,t){if(typeof e!=`function`)throw new ut(r);return t=t===n?t:q(t),L(e,t)}function zl(e,t){if(typeof e!=`function`)throw new ut(r);return t=t==null?0:Gt(q(t),0),L(function(n){var r=n[t],i=Ua(n,0,t);return r&&wn(i,r),gn(e,this,i)})}function Bl(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw new ut(r);return pu(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),Dl(e,t,{leading:i,maxWait:t,trailing:a})}function Vl(e){return xl(e,1)}function Hl(e,t){return Fl(Ba(t),e)}function Ul(){if(!arguments.length)return[];var e=arguments[0];return G(e)?e:[e]}function Wl(e){return gi(e,4)}function Gl(e,t){return t=typeof t==`function`?t:n,gi(e,4,t)}function Kl(e){return gi(e,5)}function ql(e,t){return t=typeof t==`function`?t:n,gi(e,5,t)}function Jl(e,t){return t==null||vi(e,t,ld(t))}function Yl(e,t){return e===t||e!==e&&t!==t}var Xl=So(Ii),Zl=So(function(e,t){return e>=t}),Ql=Ui(function(){return arguments}())?Ui:function(e){return mu(e)&&j.call(e,`callee`)&&!Dt.call(e,`callee`)},G=Ve.isArray,$l=un?Gn(un):Wi;function eu(e){return e!=null&&fu(e.length)&&!uu(e)}function K(e){return mu(e)&&eu(e)}function tu(e){return e===!0||e===!1||mu(e)&&Fi(e)==T}var nu=zt||Pf,ru=dn?Gn(dn):Gi;function iu(e){return mu(e)&&e.nodeType===1&&!Cu(e)}function au(e){if(e==null)return!0;if(eu(e)&&(G(e)||typeof e==`string`||typeof e.splice==`function`||nu(e)||ku(e)||Ql(e)))return!e.length;var t=Go(e);if(t==k||t==A)return!e.size;if(os(e))return!ta(e).length;for(var n in e)if(j.call(e,n))return!1;return!0}function ou(e,t){return Ki(e,t)}function su(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?Ki(e,t,n,r):!!i}function cu(e){if(!mu(e))return!1;var t=Fi(e);return t==E||t==ne||typeof e.message==`string`&&typeof e.name==`string`&&!Cu(e)}function lu(e){return typeof e==`number`&&Ht(e)}function uu(e){if(!pu(e))return!1;var t=Fi(e);return t==D||t==O||t==ee||t==se}function du(e){return typeof e==`number`&&e==q(e)}function fu(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=g}function pu(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function mu(e){return typeof e==`object`&&!!e}var hu=fn?Gn(fn):Ji;function gu(e,t){return e===t||Yi(e,t,Bo(t))}function _u(e,t,r){return r=typeof r==`function`?r:n,Yi(e,t,Bo(t),r)}function vu(e){return Su(e)&&e!=+e}function yu(e){if(as(e))throw new it(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Xi(e)}function bu(e){return e===null}function xu(e){return e==null}function Su(e){return typeof e==`number`||mu(e)&&Fi(e)==re}function Cu(e){if(!mu(e)||Fi(e)!=ae)return!1;var t=Tt(e);if(t===null)return!0;var n=j.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ht.call(n)==yt}var wu=pn?Gn(pn):Zi;function Tu(e){return du(e)&&e>=-g&&e<=g}var Eu=mn?Gn(mn):Qi;function Du(e){return typeof e==`string`||!G(e)&&mu(e)&&Fi(e)==le}function Ou(e){return typeof e==`symbol`||mu(e)&&Fi(e)==ue}var ku=hn?Gn(hn):$i;function Au(e){return e===n}function ju(e){return mu(e)&&Go(e)==fe}function Mu(e){return mu(e)&&Fi(e)==pe}var Nu=So(ra),Pu=So(function(e,t){return e<=t});function Fu(e){if(!e)return[];if(eu(e))return Du(e)?fr(e):to(e);if(At&&e[At])return rr(e[At]());var t=Go(e);return(t==k?ir:t==A?sr:Od)(e)}function Iu(e){return e?(e=Ru(e),e===h||e===-1/0?(e<0?-1:1)*_:e===e?e:0):e===0?e:0}function q(e){var t=Iu(e),n=t%1;return t===t?n?t-n:t:0}function Lu(e){return e?hi(q(e),0,y):0}function Ru(e){if(typeof e==`number`)return e;if(Ou(e))return v;if(pu(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=pu(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Wn(e);var n=Ze.test(e);return n||$e.test(e)?en(e.slice(2),n?2:8):Xe.test(e)?v:+e}function zu(e){return no(e,ud(e))}function Bu(e){return e?hi(q(e),-g,g):e===0?e:0}function J(e){return e==null?``:ja(e)}var Vu=oo(function(e,t){if(os(t)||eu(t)){no(t,ld(t),e);return}for(var n in t)j.call(t,n)&&ci(e,n,t[n])}),Hu=oo(function(e,t){no(t,ud(t),e)}),Uu=oo(function(e,t,n,r){no(t,ud(t),e,r)}),Wu=oo(function(e,t,n,r){no(t,ld(t),e,r)}),Gu=No(mi);function Ku(e,t){var n=wr(e);return t==null?n:di(n,t)}var qu=L(function(e,t){e=st(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&es(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=ud(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||Yl(d,pt[u])&&!j.call(e,u))&&(e[u]=o[u])}return e}),Ju=L(function(e){return e.push(n,Oo),gn(md,n,e)});function Yu(e,t){return jn(e,V(t,3),Ai)}function Xu(e,t){return jn(e,V(t,3),ji)}function Zu(e,t){return e==null?e:Oi(e,V(t,3),ud)}function Qu(e,t){return e==null?e:ki(e,V(t,3),ud)}function $u(e,t){return e&&Ai(e,V(t,3))}function ed(e,t){return e&&ji(e,V(t,3))}function td(e){return e==null?[]:Mi(e,ld(e))}function nd(e){return e==null?[]:Mi(e,ud(e))}function rd(e,t,r){var i=e==null?n:Ni(e,t);return i===n?r:i}function id(e,t){return e!=null&&Jo(e,t,Li)}function ad(e,t){return e!=null&&Jo(e,t,Ri)}var od=_o(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=vt.call(t)),e[t]=n},pf(gf)),sd=_o(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=vt.call(t)),j.call(e,t)?e[t].push(n):e[t]=[n]},V),cd=L(Hi);function ld(e){return eu(e)?ri(e):ta(e)}function ud(e){return eu(e)?ri(e,!0):na(e)}function dd(e,t){var n={};return t=V(t,3),Ai(e,function(e,r,i){pi(n,t(e,r,i),e)}),n}function fd(e,t){var n={};return t=V(t,3),Ai(e,function(e,r,i){pi(n,r,t(e,r,i))}),n}var pd=oo(function(e,t,n){sa(e,t,n)}),md=oo(function(e,t,n,r){sa(e,t,n,r)}),hd=No(function(e,t){var n={};if(e==null)return n;var r=!1;t=Cn(t,function(t){return t=Va(t,e),r||=t.length>1,t}),no(e,Fo(e),n),r&&(n=gi(n,7,ko));for(var i=t.length;i--;)Na(n,t[i]);return n});function gd(e,t){return vd(e,Ml(V(t)))}var _d=No(function(e,t){return e==null?{}:da(e,t)});function vd(e,t){if(e==null)return{};var n=Cn(Fo(e),function(e){return[e]});return t=V(t),fa(e,n,function(e,n){return t(e,n[0])})}function yd(e,t,r){t=Va(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[ws(t[i])];o===n&&(i=a,o=r),e=uu(o)?o.call(e):o}return e}function bd(e,t,n){return e==null?e:xa(e,t,n)}function xd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:xa(e,t,r,i)}var Sd=Eo(ld),Cd=Eo(ud);function wd(e,t,n){var r=G(e),i=r||nu(e)||ku(e);if(t=V(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:pu(e)&&uu(a)?wr(Tt(e)):{}}return(i?P:Ai)(e,function(e,r,i){return t(n,e,r,i)}),n}function Td(e,t){return e==null||Na(e,t)}function Ed(e,t,n){return e==null?e:Pa(e,t,Ba(n))}function Dd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Pa(e,t,Ba(r),i)}function Od(e){return e==null?[]:Kn(e,ld(e))}function kd(e){return e==null?[]:Kn(e,ud(e))}function Ad(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=Ru(r),r=r===r?r:0),t!==n&&(t=Ru(t),t=t===t?t:0),hi(Ru(e),t,r)}function jd(e,t,r){return t=Iu(t),r===n?(r=t,t=0):r=Iu(r),e=Ru(e),zi(e,t,r)}function Md(e,t,r){if(r&&typeof r!=`boolean`&&es(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Iu(e),t===n?(t=e,e=0):t=Iu(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=Qt();return Yt(e+a*(t-e+$t(`1e-`+((a+``).length-1))),t)}return ga(e,t)}var Nd=fo(function(e,t,n){return t=t.toLowerCase(),e+(n?Pd(t):t)});function Pd(e){return cf(J(e).toLowerCase())}function Fd(e){return e=J(e),e&&e.replace(tt,Zn).replace(Vt,``)}function Id(e,t,r){e=J(e),t=ja(t);var i=e.length;r=r===n?i:hi(q(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function Ld(e){return e=J(e),e&&je.test(e)?e.replace(ke,Qn):e}function Rd(e){return e=J(e),e&&ze.test(e)?e.replace(Re,`\\$&`):e}var zd=fo(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Bd=fo(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),Vd=uo(`toLowerCase`);function Hd(e,t,n){e=J(e),t=q(t);var r=t?dr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return z(Lt(i),n)+e+z(It(i),n)}function Ud(e,t,n){e=J(e),t=q(t);var r=t?dr(e):0;return t&&r<t?e+z(t-r,n):e}function Wd(e,t,n){e=J(e),t=q(t);var r=t?dr(e):0;return t&&r<t?z(t-r,n)+e:e}function Gd(e,t,n){return n||t==null?t=0:t&&=+t,Zt(J(e).replace(Be,``),t||0)}function Kd(e,t,r){return t=(r?es(e,t,r):t===n)?1:q(t),va(J(e),t)}function qd(){var e=arguments,t=J(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Jd=fo(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function Yd(e,t,r){return r&&typeof r!=`number`&&es(e,t,r)&&(t=r=n),r=r===n?y:r>>>0,r?(e=J(e),e&&(typeof t==`string`||t!=null&&!wu(t))&&(t=ja(t),!t&&tr(e))?Ua(fr(e),0,r):e.split(t,r)):[]}var Xd=fo(function(e,t,n){return e+(n?` `:``)+cf(t)});function Zd(e,t,n){return e=J(e),n=n==null?0:hi(q(n),0,e.length),t=ja(t),e.slice(n,n+t.length)==t}function Qd(e,t,r){var i=F.templateSettings;r&&es(e,t,r)&&(t=n),e=J(e),t=Wu({},t,i,B);var a=Wu({},t.imports,i.imports,B),o=ld(a),s=Kn(a,o);P(o,function(e){if(Ke.test(e))throw new it("Invalid `imports` option passed into `_.template`")});var c,l,u=0,d=t.interpolate||nt,f=`__p += '`,p=ct((t.escape||nt).source+`|`+d.source+`|`+(d===Pe?Je:nt).source+`|`+(t.evaluate||nt).source+`|$`,`g`),m=`//# sourceURL=`+(j.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++N+`]`)+`
|
|
13
|
+
`;e.replace(p,function(t,n,r,i,a,o){return r||=i,f+=e.slice(u,o).replace(rt,$n),n&&(c=!0,f+=`' +
|
|
14
|
+
__e(`+n+`) +
|
|
15
|
+
'`),a&&(l=!0,f+=`';
|
|
16
|
+
`+a+`;
|
|
17
|
+
__p += '`),r&&(f+=`' +
|
|
18
|
+
((__t = (`+r+`)) == null ? '' : __t) +
|
|
19
|
+
'`),u=o+t.length,t}),f+=`';
|
|
20
|
+
`;var h=j.call(t,`variable`)&&t.variable;if(!h)f=`with (obj) {
|
|
21
|
+
`+f+`
|
|
26
22
|
}
|
|
27
|
-
`;else if(
|
|
28
|
-
`+(
|
|
29
|
-
`)
|
|
23
|
+
`;else if(Ke.test(h))throw new it("Invalid `variable` option passed into `_.template`");f=(l?f.replace(Te,``):f).replace(Ee,`$1`).replace(De,`$1;`),f=`function(`+(h||`obj`)+`) {
|
|
24
|
+
`+(h?``:`obj || (obj = {});
|
|
25
|
+
`)+`var __t, __p = ''`+(c?`, __e = _.escape`:``)+(l?`, __j = Array.prototype.join;
|
|
30
26
|
function print() { __p += __j.call(arguments, '') }
|
|
31
27
|
`:`;
|
|
32
|
-
`)+
|
|
33
|
-
}`;var ge=Pp(function(){return Re(g,re+"return "+V).apply(n,b)});if(ge.source=V,Ec(ge))throw ge;return ge}function mO(r){return Me(r).toLowerCase()}function gO(r){return Me(r).toUpperCase()}function yO(r,i,o){if(r=Me(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),b=Hh(f,d)+1;return fn(f,g,b).join("")}function _O(r,i,o){if(r=Me(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=Me(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=v,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=Me(r);var g=r.length;if(Xn(r)){var b=fr(r);g=b.length}if(o>=g)return r;var S=o-ei(f);if(S<1)return f;var x=b?fn(b,0,S).join(""):r.slice(0,S);if(d===n)return x+f;if(b&&(S+=x.length-S),Ac(d)){if(r.slice(S).search(d)){var H,K=x;for(d.global||(d=Hu(d.source,Me(oh.exec(d))+"g")),d.lastIndex=0;H=d.exec(K);)var V=H.index;x=x.slice(0,V===n?S:V)}}else if(r.indexOf(It(d),S)!=S){var j=x.lastIndexOf(d);j>-1&&(x=x.slice(0,j))}return x+f}function vO(r){return r=Me(r),r&&D1.test(r)?r.replace(ih,Jb):r}var SO=oi(function(r,i,o){return r+(o?" ":"")+i.toUpperCase()}),Cc=Rd("toUpperCase");function xp(r,i,o){return r=Me(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,Sc(r[o],r))}),r});function EO(r){var i=r==null?0:r.length,o=se();return r=i?Ge(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 Jv(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=ut(i),d=Ea(i,f);o==null&&!(je(i)&&(d.length||!f.length))&&(o=i,i=r,r=this,d=Ea(i,ut(i)));var g=!(je(o)&&"chain"in o)||!!o.chain,b=Gr(r);return Qt(d,function(S){var x=i[S];r[S]=x,b&&(r.prototype[S]=function(){var H=this.__chain__;if(g||H){var K=r(this.__wrapped__),V=K.__actions__=Pt(this.__actions__);return V.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._=sv),this}function Dc(){}function LO(r){return r=me(r),ye(function(i){return dd(i,r)})}var NO=cc(Ge),UO=cc(Lh),BO=cc(Lu);function Rp(r){return gc(r)?Nu(kr(r)):dS(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)?Ge(r,kr):Ft(r)?[r]:Pt(Qd(Me(r)))}function VO(r){var i=++nv;return Me(r)+i}var GO=Pa(function(r,i){return r+i},0),zO=lc("ceil"),jO=Pa(function(r,i){return r/i},1),JO=lc("floor");function QO(r){return r&&r.length?Ta(r,Mt,ju):n}function ZO(r,i){return r&&r.length?Ta(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?Ta(r,Mt,Xu):n}function rk(r,i){return r&&r.length?Ta(r,se(i,2),Xu):n}var nk=Pa(function(r,i){return r*i},1),ik=lc("round"),sk=Pa(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=Sp,p.assignInWith=Ka,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=JS,p.compact=QS,p.concat=ZS,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=vA,p.defer=PE,p.delay=RE,p.difference=XS,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=ut,p.keysIn=Dt,p.map=Ba,p.mapKeys=LA,p.mapValues=NA,p.matches=xO,p.matchesProperty=PO,p.memoize=Fa,p.merge=UA,p.mergeWith=Tp,p.method=RO,p.methodOf=DO,p.mixin=Rc,p.negate=Wa,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=vT,p.range=FO,p.rangeRight=WO,p.rearg=NE,p.reject=SE,p.remove=ST,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=Ua,p.toArray=wp,p.toPairs=Ap,p.toPairsIn=Op,p.toPath=$O,p.toPlainObject=vp,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=vc,p.unzipWith=ip,p.update=$A,p.updateWith=VA,p.values=li,p.valuesIn=GA,p.without=KT,p.words=xp,p.wrap=WE,p.xor=qT,p.xorBy=$T,p.xorWith=VT,p.zip=GT,p.zipObject=zT,p.zipObjectDeep=jT,p.zipWith=JT,p.entries=Ap,p.entriesIn=Op,p.extend=Sp,p.extendWith=Ka,Rc(p,p),p.add=GO,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=VE,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=SA,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=GE,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=Gr,p.isInteger=mp,p.isLength=Ha,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=Ya,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=Ia,p.pad=iO,p.padEnd=sO,p.padStart=aO,p.parseInt=oO,p.random=JA,p.reduce=bE,p.reduceRight=vE,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=Me,p.toUpper=gO,p.trim=yO,p.trimEnd=_O,p.trimStart=wO,p.truncate=bO,p.unescape=vO,p.uniqueId=VO,p.upperCase=SO,p.upperFirst=Cc,p.each=ap,p.eachRight=op,p.first=rp,Rc(p,(function(){var r={};return Ar(p,function(i,o){Le.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){ve.prototype[r]=function(o){o=o===n?1:st(me(o),0);var f=this.__filtered__&&!i?new ve(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},ve.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;ve.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":"");ve.prototype[r]=function(){return this[o](1).value()[0]}}),Qt(["initial","tail"],function(r,i){var o="drop"+(i?"":"Right");ve.prototype[r]=function(){return this.__filtered__?new ve(this):this[o](1)}}),ve.prototype.compact=function(){return this.filter(Mt)},ve.prototype.find=function(r){return this.filter(r).head()},ve.prototype.findLast=function(r){return this.reverse().find(r)},ve.prototype.invokeMap=ye(function(r,i){return typeof r=="function"?new ve(this):this.map(function(o){return Zi(o,r,i)})}),ve.prototype.reject=function(r){return this.filter(Wa(se(r)))},ve.prototype.slice=function(r,i){r=me(r);var o=this;return o.__filtered__&&(r>0||i<0)?new ve(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)},ve.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},ve.prototype.toArray=function(){return this.take(J)},Ar(ve.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 b=this.__wrapped__,S=f?[1]:arguments,x=b instanceof ve,H=S[0],K=x||fe(b),V=function(we){var Te=d.apply(p,sn([we],S));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){b=ge?b:new ve(this);var oe=r.apply(b,S);return oe.__actions__.push({func:Ua,args:[V],thisArg:n}),new Xt(oe,j)}return ae&&ge?r.apply(this,S):(oe=this.thru(V),ae?f?oe.value()[0]:oe.value():oe)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(r){var i=ua[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(b){return i.apply(fe(b)?b:[],d)})}}),Ar(ve.prototype,function(r,i){var o=p[i];if(o){var f=o.name+"";Le.call(ii,f)||(ii[f]=[]),ii[f].push({name:i,func:o})}}),ii[xa(n,ne).name]=[{name:"wrapper",func:n}],ve.prototype.clone=vv,ve.prototype.reverse=Sv,ve.prototype.value=Tv,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=ev();An?((An.exports=ti)._=ti,Pu._=ti):ft._=ti}).call(lg)})(wi,wi.exports)),wi.exports}var no=fg();const ct=vl(no);var hg=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,io=Math.ceil,Yt=Math.floor,kt="[BigNumber Error] ",Tl=kt+"Number primitive has more than 15 significant digits: ",sr=1e14,ce=14,so=9007199254740991,ao=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Jr=1e7,at=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,w=-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 v,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<w?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),We(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(v=F.slice(0,_),R=N=0,C=L.length;N<C;N++)if(v.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>so||y!==Yt(y)))throw Error(Tl+D.s*y);if((R=R-N-1)>T)D.c=D.e=null;else if(R<w)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 _,v;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(_="DECIMAL_PLACES")&&(v=y[_],ze(v,0,at,_),u=v),y.hasOwnProperty(_="ROUNDING_MODE")&&(v=y[_],ze(v,0,8,_),l=v),y.hasOwnProperty(_="EXPONENTIAL_AT")&&(v=y[_],v&&v.pop?(ze(v[0],-at,0,_),ze(v[1],0,at,_),h=v[0],m=v[1]):(ze(v,-at,at,_),h=-(m=v<0?-v:v))),y.hasOwnProperty(_="RANGE"))if(v=y[_],v&&v.pop)ze(v[0],-at,-1,_),ze(v[1],1,at,_),w=v[0],T=v[1];else if(ze(v,-at,at,_),v)w=-(T=v<0?-v:v);else throw Error(kt+_+" cannot be zero: "+v);if(y.hasOwnProperty(_="CRYPTO"))if(v=y[_],v===!!v)if(v)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=v;else throw P=!v,Error(kt+"crypto unavailable");else P=v;else throw Error(kt+_+" not true or false: "+v);if(y.hasOwnProperty(_="MODULO_MODE")&&(v=y[_],ze(v,0,9,_),$=v),y.hasOwnProperty(_="POW_PRECISION")&&(v=y[_],ze(v,0,at,_),O=v),y.hasOwnProperty(_="FORMAT"))if(v=y[_],typeof v=="object")I=v;else throw Error(kt+_+" not an object: "+v);if(y.hasOwnProperty(_="ALPHABET"))if(v=y[_],typeof v=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(v))ne=v.slice(0,10)=="0123456789",F=v;else throw Error(kt+_+" invalid: "+v)}else throw Error(kt+"Object expected: "+y);return{DECIMAL_PLACES:u,ROUNDING_MODE:l,EXPONENTIAL_AT:[h,m],RANGE:[w,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 _,v,M=y.c,k=y.e,R=y.s;e:if({}.toString.call(M)=="[object Array]"){if((R===1||R===-1)&&k>=-at&&k<=at&&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(v=M[_],v<0||v>=sr||v!==Yt(v))break e;if(v!==0)return!0}}}else if(M===null&&k===null&&(R===null||R===1||R===-1))return!0;throw Error(kt+"Invalid BigNumber: "+y)},Y.maximum=Y.max=function(){return Se(arguments,-1)},Y.minimum=Y.min=function(){return Se(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(v){var M,k,R,N,E,C=0,L=[],D=new Y(c);if(v==null?v=u:ze(v,0,at),N=io(v/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(kt+"crypto unavailable");if(!P)for(;C<N;)E=_(),E<9e15&&(L[C++]=E%1e14);for(N=L[--C],v%=ce,N&&v&&(E=ao[ce-v],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,v=new Y(_[0]);y<_.length;)v=v.plus(_[y++]);return v},n=(function(){var y="0123456789";function _(v,M,k,R){for(var N,E=[0],C,L=0,D=v.length;L<D;){for(C=E.length;C--;E[C]*=M);for(E[0]+=R.indexOf(v.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(v,M,k,R,N){var E,C,L,D,q,te,J,pe,Ue=v.indexOf("."),He=u,le=l;for(Ue>=0&&(D=O,O=0,v=v.replace(".",""),pe=new Y(M),te=pe.pow(v.length-Ue),O=D,pe.c=_(xr(qt(te.c),te.e,"0"),10,k,y),pe.e=pe.c.length),J=_(v,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(Ue<0?--L:(te.c=J,te.e=L,te.s=R,te=e(te,pe,He,le,k),J=te.c,q=te.r,L=te.e),C=L+He+1,Ue=J[C],D=k/2,q=q||C<0||J[C+1]!=null,q=le<4?(Ue!=null||q)&&(le==0||le==(te.s<0?3:2)):Ue>D||Ue==D&&(le==4||q||le==6&&J[C-1]&1||le==(te.s<0?8:7)),C<1||!J[0])v=q?xr(E.charAt(1),-He,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(Ue=0,v="";Ue<=D;v+=E.charAt(J[Ue++]));v=xr(v,L,E.charAt(0))}return v}})(),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 v(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,Ue,He,le,ke,ot,Tr,Fr,Fi,bt,Er,vt=M.s==k.s?1:-1,Ie=M.c,Be=k.c;if(!Ie||!Ie[0]||!Be||!Be[0])return new Y(!M.s||!k.s||(Ie?Be&&Ie[0]==Be[0]:!Be)?NaN:Ie&&Ie[0]==0||!Be?vt*0:vt/0);for(Ue=new Y(vt),He=Ue.c=[],L=M.e-k.e,vt=R+L+1,E||(E=sr,L=Kt(M.e/ce)-Kt(k.e/ce),vt=vt/ce|0),D=0;Be[D]==(Ie[D]||0);D++);if(Be[D]>(Ie[D]||0)&&L--,vt<0)He.push(1),q=!0;else{for(Fr=Ie.length,bt=Be.length,D=0,vt+=2,te=Yt(E/(Be[0]+1)),te>1&&(Be=y(Be,te,E),Ie=y(Ie,te,E),bt=Be.length,Fr=Ie.length),Tr=bt,le=Ie.slice(0,bt),ke=le.length;ke<bt;le[ke++]=0);Er=Be.slice(),Er=[0].concat(Er),Fi=Be[0],Be[1]>=E/2&&Fi++;do{if(te=0,C=_(Be,le,bt,ke),C<0){if(ot=le[0],bt!=ke&&(ot=ot*E+(le[1]||0)),te=Yt(ot/Fi),te>1)for(te>=E&&(te=E-1),J=y(Be,te,E),pe=J.length,ke=le.length;_(J,le,pe,ke)==1;)te--,v(J,bt<pe?Er:Be,pe,E),pe=J.length,C=1;else te==0&&(C=te=1),J=Be.slice(),pe=J.length;if(pe<ke&&(J=[0].concat(J)),v(le,J,ke,E),ke=le.length,C==-1)for(;_(Be,le,bt,ke)<1;)te++,v(le,bt<ke?Er:Be,ke,E),ke=le.length}else C===0&&(te++,le=[0]);He[D++]=te,le[0]?le[ke++]=Ie[Tr]||0:(le=[Ie[Tr]],ke=1)}while((Tr++<Fr||le[0]!=null)&&vt--);q=le[0]!=null,He[0]||He.splice(0,1)}if(E==sr){for(D=1,vt=He[0];vt>=10;vt/=10,D++);We(Ue,R+(Ue.e=D+L*ce-1)+1,N,q)}else Ue.e=L,Ue.r=+q;return Ue}})();function Ae(y,_,v,M){var k,R,N,E,C;if(v==null?v=l:ze(v,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=We(new Y(y),_,v),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 Se(y,_){for(var v,M,k=1,R=new Y(y[0]);k<y.length;k++)M=new Y(y[k]),(!M.s||(v=gn(R,M))===_||v===0&&R.s===_)&&(R=M);return R}function _e(y,_,v){for(var M=1,k=_.length;!_[--k];_.pop());for(k=_[0];k>=10;k/=10,M++);return(v=M+v*ce-1)>T?y.c=y.e=null:v<w?y.c=[y.e=0]:(y.e=v,y.c=_),y}s=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,_=/^([^.]+)\.$/,v=/^\.([^.]+)$/,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(v,"0.$1")),N!=D))return new Y(D,L);if(Y.DEBUG)throw Error(kt+"Not a"+(C?" base "+C:"")+" number: "+N);R.s=null}R.c=R.e=null}})();function We(y,_,v,M){var k,R,N,E,C,L,D,q=y.c,te=ao;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=io((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=v<4?(D||M)&&(v==0||v==(y.s<0?3:2)):D>5||D==5&&(v==4||M||v==6&&(R>0?N>0?C/te[k-N]:0:q[L-1])%10&1||v==(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<w&&(y.c=[y.e=0])}return y}function Pe(y){var _,v=y.e;return v===null?y.toString():(_=qt(y.c),_=v<=h||v>=m?bs(_,v):xr(_,v,"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 v,M,k,R=this;if(y!=null)return ze(y,0,at),_==null?_=l:ze(_,0,8),We(new Y(R),y+R.e+1,_);if(!(v=R.c))return null;if(M=((k=v.length-1)-Kt(this.e/ce))*ce,k=v[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 v,M,k,R,N,E,C,L,D,q=this;if(y=new Y(y),y.c&&!y.isInteger())throw Error(kt+"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=io(O/ce+2))}for(E?(v=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(v),We(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?We(D,O,l,N):D)},a.integerValue=function(y){var _=new Y(this);return y==null?y=l:ze(y,0,8),We(_,_.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 v,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)-(v=D.length),_>0)for(;_--;D[v++]=0);for(_=sr-1;M>E;){if(D[--M]<q[M]){for(v=M;v&&!D[--v];D[v]=_);--D[v],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 v,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,v=e(k,y,0,3),y.s=M,v.s*=M):v=e(k,y,0,$),y=k.minus(v.times(y)),!y.c[0]&&$==1&&(y.s=k.s),y)},a.multipliedBy=a.times=function(y,_){var v,M,k,R,N,E,C,L,D,q,te,J,pe,Ue,He,le=this,ke=le.c,ot=(y=new Y(y,_)).c;if(!ke||!ot||!ke[0]||!ot[0])return!le.s||!y.s||ke&&!ke[0]&&!ot||ot&&!ot[0]&&!ke?y.c=y.e=y.s=null:(y.s*=le.s,!ke||!ot?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=ke.length,q=ot.length,C<q&&(pe=ke,ke=ot,ot=pe,k=C,C=q,q=k),k=C+q,pe=[];k--;pe.push(0));for(Ue=sr,He=Jr,k=q;--k>=0;){for(v=0,te=ot[k]%He,J=ot[k]/He|0,N=C,R=k+N;R>k;)L=ke[--N]%He,D=ke[N]/He|0,E=J*L+D*te,L=te*L+E%He*He+pe[R]+v,v=(L/Ue|0)+(E/He|0)+J*D,pe[R--]=L%Ue;pe[R]=v}return v?++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 v,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,v=C):(k=-k,v=E),v.reverse();k--;v.push(0));v.reverse()}for(k=E.length,_=C.length,k-_<0&&(v=C,C=E,E=v,_=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 v,M,k,R=this;if(y!=null&&y!==!!y)return ze(y,1,at),_==null?_=l:ze(_,0,8),We(new Y(R),y,_);if(!(v=R.c))return null;if(k=v.length-1,M=k*ce+1,k=v[k]){for(;k%10==0;k/=10,M--);for(k=v[0];k>=10;k/=10,M++);}return y&&R.e+1>M&&(M=R.e+1),M},a.shiftedBy=function(y){return ze(y,-so,so),this.times("1e"+y)},a.squareRoot=a.sqrt=function(){var y,_,v,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),v=new Y(_)):v=new Y(E+""),v.c[0]){for(C=v.e,E=C+L,E<3&&(E=0);;)if(k=v,v=D.times(k.plus(e(R,k,L,1))),qt(k.c).slice(0,E)===(_=qt(v.c)).slice(0,E))if(v.e<C&&--E,_=_.slice(E-3,E+1),_=="9999"||!M&&_=="4999"){if(!M&&(We(k,k.e+u+2,0),k.times(k).eq(R))){v=k;break}L+=4,E+=4,M=1}else{(!+_||!+_.slice(1)&&_.charAt(0)=="5")&&(We(v,v.e+u+2,1),y=!v.times(v).eq(R));break}}return We(v,v.e+u+1,l,y)},a.toExponential=function(y,_){return y!=null&&(ze(y,0,at),y++),Ae(this,y,_,1)},a.toFixed=function(y,_){return y!=null&&(ze(y,0,at),y=y+this.e+1),Ae(this,y,_)},a.toFormat=function(y,_,v){var M,k=this;if(v==null)y!=null&&_&&typeof _=="object"?(v=_,_=null):y&&typeof y=="object"?(v=y,y=_=null):v=I;else if(typeof v!="object")throw Error(kt+"Argument not an object: "+v);if(M=k.toFixed(y,_),k.c){var R,N=M.split("."),E=+v.groupSize,C=+v.secondaryGroupSize,L=v.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+(v.decimalSeparator||"")+((C=+v.fractionGroupSize)?q.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(v.fractionGroupSeparator||"")):q):D}return(v.prefix||"")+M+(v.suffix||"")},a.toFraction=function(y){var _,v,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(kt+"Argument "+(E.isInteger()?"out of range: ":"not an integer: ")+Pe(E));if(!pe)return new Y(J);for(_=new Y(c),L=v=new Y(c),M=C=new Y(c),te=qt(pe),R=_.e=te.length-J.e-1,_.c[0]=ao[(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=v.plus(D.times(M)),k.comparedTo(y)!=1;)v=M,M=k,L=C.plus(D.times(k=L)),C=k,_=E.minus(D.times(k=_)),E=k;return k=e(y.minus(v),M,0,1),C=C.plus(k.times(L)),v=v.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,v,R,l).minus(J).abs())<1?[L,M]:[C,v],T=N,q},a.toNumber=function(){return+Pe(this)},a.toPrecision=function(y,_){return y!=null&&ze(y,1,at),Ae(this,y,_,2)},a.toString=function(y){var _,v=this,M=v.s,k=v.e;return k===null?M?(_="Infinity",M<0&&(_="-"+_)):_="NaN":(y==null?_=k<=h||k>=m?bs(qt(v.c),k):xr(qt(v.c),k,"0"):y===10&&ne?(v=We(new Y(v),u+k+1,l),_=xr(qt(v.c),v.e,"0")):(ze(y,2,F.length,"Base"),_=n(xr(qt(v.c),k,"0"),10,y,M,!0)),M<0&&v.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(kt+(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,oo=new TextDecoder,vs=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 uo(t,e,n){if(e<0||e>=vs)throw new RangeError(`value must be >= 0 and <= ${vs-1}. Received ${e}`);t.set([e>>>24,e>>>16,e>>>8,e&255],n)}function dg(t){const e=Math.floor(t/vs),n=t%vs,s=new Uint8Array(8);return uo(s,e,0),uo(s,n,4),s}function co(t){const e=new Uint8Array(4);return uo(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:oo.decode(t),{alphabet:"base64url"});let e=t;e instanceof Uint8Array&&(e=oo.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 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 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 lo=(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(!vi(t))throw new Error("CryptoKey instance expected")}function vi(t){return t?.[Symbol.toStringTag]==="CryptoKey"}function fo(t){return t?.[Symbol.toStringTag]==="KeyObject"}const Dl=t=>vi(t)||fo(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 vg(t){return typeof t=="object"&&t!==null}const Ml=t=>{if(!vg(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 Sg(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 ho(t,e,n){const s=await Tg(e,t,"wrapKey");Sg(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 po(t){return bi(co(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(co(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=po(yn.encode(n)),l=po(a),h=po(c),m=co(s),w=new Uint8Array(0),T=bi(u,l,h,m,w),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 ho(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 Si=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(lo(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)),w=new Uint8Array((await crypto.subtle.sign("HMAC",l,m)).slice(0,c>>3));return{ciphertext:h,tag:w,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(!vi(n)&&!(n instanceof Uint8Array))throw new TypeError(lo(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 mo(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||vi(t))return t;if(fo(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(mo(t))return t.k?Al(t.k):Ul(t,t,e,!0);throw new Error("unreachable")},Fn=t=>t?.[Symbol.toStringTag],go=(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},Vg=(t,e,n)=>{if(!(e instanceof Uint8Array)){if(mo(e)){if(qg(e)&&go(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"`)}},Gg=(t,e,n)=>{if(mo(e))switch(n){case"decrypt":case"sign":if(Yg(e)&&go(t,e,n))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Kg(e)&&go(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)?Vg(t,e,n):Gg(t,e,n)},jg=Symbol();async function Jg(t){if(fo(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(!vi(t))throw new TypeError(lo(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 w;a.epk?w=await Bl(a.epk,t):w=(await crypto.subtle.generateKey(n.algorithm,!0,["deriveBits"])).privateKey;const{x:T,y:P,crv:$,kty:O}=await Qg(w),I=await Og(n,w,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||Si(e);const F=t.slice(-6);c=await ho(F,I,l);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{l=s||Si(e),Rl(n),c=await Ng(t,n,l);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{l=s||Si(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||Si(e),c=await ho(t,n,l);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{l=s||Si(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,w;this.#e?m=yn.encode($t(JSON.stringify(this.#e))):m=yn.encode(""),this.#s?(w=$t(this.#s),h=bi(m,yn.encode("."),yn.encode(w))):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)),w&&(O.aad=w),this.#e&&(O.protected=oo.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=Vs(JSON.stringify(t));let s,a="";if(e){a=Vs(JSON.stringify({typ:"JWT",kid:Wf(e),alg:"HS256"}));const c=[a,n].join(".");s=Jo(c,e,"base64url")}else a=Vs(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
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//! license : MIT
|
|
37
|
-
//! momentjs.com
|
|
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 Ce(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function yo(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Ce(t,e))return!1;return!0}function Ct(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)Ce(e,n)&&(t[n]=e[n]);return Ce(e,"toString")&&(t.toString=e.toString),Ce(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 _o;Array.prototype.some?_o=Array.prototype.some:_o=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 wo(t){var e=null,n=!1,s=t._d&&!isNaN(t._d.getTime());if(s&&(e=de(t),n=_o.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=[],bo=!1;function vo(t,e){var n,s,a,c=Wl.length;if(Ct(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),Ct(e._i)||(t._i=e._i),Ct(e._f)||(t._f=e._f),Ct(e._l)||(t._l=e._l),Ct(e._strict)||(t._strict=e._strict),Ct(e._tzm)||(t._tzm=e._tzm),Ct(e._isUTC)||(t._isUTC=e._isUTC),Ct(e._offset)||(t._offset=e._offset),Ct(e._pf)||(t._pf=de(e)),Ct(e._locale)||(t._locale=e._locale),c>0)for(n=0;n<c;n++)s=Wl[n],a=e[s],Ct(a)||(t[s]=a);return t}function Ei(t){vo(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),bo===!1&&(bo=!0,z.updateOffset(this),bo=!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 Vt(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
|
-
|
|
40
|
-
Arguments: `+Array.prototype.slice.call(s).join("")+`
|
|
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)Ce(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)Ce(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)Ce(t,s)&&!Ce(e,s)&&wn(t[s])&&(n[s]=Xr({},n[s]));return n}function To(t){t!=null&&this.set(t)}var Eo;Object.keys?Eo=Object.keys:Eo=function(t){var e,n=[];for(e in t)Ce(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 Ao=/(\[[^\[]*\])|(\\)?([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,Oo={},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(Ao),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()),Oo[e]=Oo[e]||o0(e),Oo[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(Ao).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 Gt(t){return typeof t=="string"?$l[t]||$l[t.toLowerCase()]:void 0}function ko(t){var e={},n,s;for(s in t)Ce(t,s)&&(n=Gt(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)Ce(t,n)&&e.push({unit:n,priority:_0[n]});return e.sort(function(s,a){return s.priority-a.priority}),e}var Vl=/\d/,Nt=/\d\d/,Gl=/\d{3}/,Co=/\d{4}/,ks=/[+-]?\d{6}/,Ke=/\d\d?/,zl=/\d\d\d\d?/,jl=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,xo=/\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,v0=/[+-]?\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?/,Po=/^([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 S0(t,e){return Ce(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 Ro={};function Ne(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++)Ro[t[n]]=s}function Oi(t,e){Ne(t,function(n,s,a,c){a._w=a._w||{},e(n,a._w,a,c)})}function E0(t,e,n){e!=null&&Ce(Ro,t)&&Ro[t](e,n._a,n,t)}function Ms(t){return t%4===0&&t%100!==0||t%400===0}var pt=0,Dr=1,vr=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",Ke,Nt),Q("YYYY",xo,Co),Q("YYYYY",xs,ks),Q("YYYYYY",xs,ks),Ne(["YYYYY","YYYYYY"],pt),Ne("YYYY",function(t,e){e[pt]=t.length===2?z.parseTwoDigitYear(t):be(t)}),Ne("YY",function(t,e){e[pt]=z.parseTwoDigitYear(t)}),Ne("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=Gt(t),wr(this[t])?this[t]():this}function x0(t,e){if(typeof t=="object"){t=ko(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=Gt(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 Do(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",Ke,Yn),Q("MM",Ke,Nt),Q("MMM",function(t,e){return e.monthsShortRegex(t)}),Q("MMMM",function(t,e){return e.monthsRegex(t)}),Ne(["M","MM"],function(t,e){e[Dr]=be(t)-1}),Ne(["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,Do(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 Do(this.year(),this.month())}function F0(t){return this._monthsParseExact?(Ce(this,"_monthsRegex")||rf.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Ce(this,"_monthsShortRegex")||(this._monthsShortRegex=D0),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function W0(t){return this._monthsParseExact?(Ce(this,"_monthsRegex")||rf.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Ce(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",Ke,Yn),Q("ww",Ke,Nt),Q("W",Ke,Yn),Q("WW",Ke,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 V0(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function G0(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",Ke),Q("e",Ke),Q("E",Ke),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 Mo(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?Mo(n,this._week.dow):t?n[t.day()]:n}function ry(t){return t===!0?Mo(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function ny(t){return t===!0?Mo(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?(Ce(this,"_weekdaysRegex")||Lo.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Ce(this,"_weekdaysRegex")||(this._weekdaysRegex=Z0),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function ly(t){return this._weekdaysParseExact?(Ce(this,"_weekdaysRegex")||Lo.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=X0),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function fy(t){return this._weekdaysParseExact?(Ce(this,"_weekdaysRegex")||Lo.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ey),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Lo(){function t(w,T){return T.length-w.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 No(){return this.hours()%12||12}function hy(){return this.hours()||24}ie("H",["HH",2],0,"hour"),ie("h",["hh",2],0,No),ie("k",["kk",2],0,hy),ie("hmm",0,0,function(){return""+No.apply(this)+br(this.minutes(),2)}),ie("hmmss",0,0,function(){return""+No.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",Ke,Po),Q("h",Ke,Yn),Q("k",Ke,Yn),Q("HH",Ke,Nt),Q("hh",Ke,Nt),Q("kk",Ke,Nt),Q("hmm",zl),Q("hmmss",jl),Q("Hmm",zl),Q("Hmmss",jl),Ne(["H","HH"],rt),Ne(["k","kk"],function(t,e,n){var s=be(t);e[rt]=s===24?0:s}),Ne(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Ne(["h","hh"],function(t,e,n){e[rt]=be(t),de(n).bigHour=!0}),Ne("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}),Ne("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}),Ne("Hmm",function(t,e,n){var s=t.length-2;e[rt]=be(t.substr(0,s)),e[ur]=be(t.substr(s))}),Ne("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},Ve={},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(Ve[t]===void 0&&typeof module<"u"&&module&&module.exports&&wy(t))try{e=Di._abbr,n=require,n("./locale/"+t),en(e)}catch{Ve[t]=null}return Ve[t]}function en(t,e){var n;return t&&(Ct(e)?n=Nr(t):n=Uo(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 Uo(t,e){if(e!==null){var n,s=uf;if(e.abbr=t,Ve[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=Ve[t]._config;else if(e.parentLocale!=null)if(Ve[e.parentLocale]!=null)s=Ve[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 Ve[t]=new To(So(s,e)),Ri[t]&&Ri[t].forEach(function(a){Uo(a.name,a.config)}),en(t),Ve[t]}else return delete Ve[t],null}function by(t,e){if(e!=null){var n,s,a=uf;Ve[t]!=null&&Ve[t].parentLocale!=null?Ve[t].set(So(Ve[t]._config,e)):(s=Ns(t),s!=null&&(a=s._config),e=So(a,e),s==null&&(e.abbr=t),n=new To(e),n.parentLocale=Ve[t],Ve[t]=n),en(t)}else Ve[t]!=null&&(Ve[t].parentLocale!=null?(Ve[t]=Ve[t].parentLocale,t===en()&&en(t)):Ve[t]!=null&&delete Ve[t]);return Ve[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 vy(){return Eo(Ve)}function Bo(t){var e,n=t._a;return n&&de(t).overflow===-2&&(e=n[Dr]<0||n[Dr]>11?Dr:n[vr]<1||n[vr]>Do(n[pt],n[Dr])?vr: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>vr)&&(e=vr),de(t)._overflowWeeks&&e===-1&&(e=A0),de(t)._overflowWeekday&&e===-1&&(e=O0),de(t).overflow=e),t}var Sy=/^\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]],Io=[["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=Sy.exec(s)||Ty.exec(s),c,u,l,h,m=Us.length,w=Io.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=w;e<n;e++)if(Io[e][1].exec(a[3])){l=(a[2]||" ")+Io[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||""),Wo(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=Vt("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 Fo(t){var e,n,s=[],a,c,u;if(!t._d){for(a=Ly(t),t._w&&t._a[vr]==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[vr]=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(qe(),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(qe(),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 Wo(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,w;for(a=ql(t._f,t._locale).match(Ao)||[],w=a.length,n=0;n<w;n++)c=a[n],s=(e.match(S0(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])),Fo(t),Bo(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=vo({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[a],Wo(e),wo(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=ko(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)}),Fo(t)}}function Fy(t){var e=new Ei(Bo(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(Bo(e)):(Ti(e)?t._d=e:ar(n)?By(t):n?Wo(t):Wy(t),wo(t)||(t._d=null),t))}function Wy(t){var e=t._i;Ct(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)}),Fo(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)&&yo(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 qe(t,e,n,s){return df(t,e,n,s,!1)}var Hy=Vt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=qe.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Es()}),Yy=Vt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=qe.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 qe();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 Vy(t){var e,n=!1,s,a=Mi.length;for(e in t)if(Ce(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 Gy(){return this._isValid}function zy(){return cr(NaN)}function Bs(t){var e=ko(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,w=e.millisecond||0;this._isValid=Vy(e),this._milliseconds=+w+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 Ho(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),Ne(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Yo(Rs,t)});var Jy=/([\+\-]|\d\d)/gi;function Yo(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 Ko(t,e){var n,s;return e._isUTC?(n=e.clone(),s=(or(t)||Ti(t)?t.valueOf():qe(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),z.updateOffset(n,!1),n):qe(t).local()}function qo(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=Yo(Rs,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(a=qo(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:qo(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(qo(this),"m")),this}function t_(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Yo(b0,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function r_(t){return this.isValid()?(t=t?qe(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(!Ct(this._isDSTShifted))return this._isDSTShifted;var t={},e;return vo(t,this),t=hf(t),t._a?(e=t._isUTC?_r(t._a):qe(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[vr])*a,h:be(s[rt])*a,m:be(s[ur])*a,s:be(s[Mr])*a,ms:be(Ho(s[bn]*1e3))*a}):(s=u_.exec(t))?(a=s[1]==="-"?-1:1,n={y:vn(s[2],a),M:vn(s[3],a),w:vn(s[4],a),d:vn(s[5],a),h:vn(s[6],a),m:vn(s[7],a),s:vn(s[8],a)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=c_(qe(n.from),qe(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),c=new Bs(n),Is(t)&&Ce(t,"_locale")&&(c._locale=t._locale),Is(t)&&Ce(t,"_isValid")&&(c._isValid=t._isValid),c}cr.fn=Bs.prototype,cr.invalid=zy;function vn(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=Ko(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=Ho(e._days),u=Ho(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)&&!yo(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||Ce(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)&&!yo(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||Ce(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||qe(),s=Ko(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,qe(n)))}function __(){return new Ei(this)}function w_(t,e){var n=or(t)?t:qe(t);return this.isValid()&&n.isValid()?(e=Gt(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:qe(t);return this.isValid()&&n.isValid()?(e=Gt(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function v_(t,e,n,s){var a=or(t)?t:qe(t),c=or(e)?e:qe(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 S_(t,e){var n=or(t)?t:qe(t),s;return this.isValid()&&n.isValid()?(e=Gt(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=Ko(t,this),!s.isValid())return NaN;switch(a=(s.utcOffset()-this.utcOffset())*6e4,e=Gt(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()||qe(t).isValid())?cr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function R_(t){return this.from(qe(),t)}function D_(t,e){return this.isValid()&&(or(t)&&t.isValid()||qe(t).isValid())?cr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function M_(t){return this.to(qe(),t)}function vf(t){var e;return t===void 0?this._locale._abbr:(e=Nr(t),e!=null&&(this._locale=e),this)}var Sf=Vt("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 Vn(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=Gt(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-=Vn(e+(this._isUTC?0:this.utcOffset()*$n),Hs);break;case"minute":e=this._d.valueOf(),e-=Vn(e,$n);break;case"second":e=this._d.valueOf(),e-=Vn(e,Ws);break}return this._d.setTime(e),z.updateOffset(this,!0),this}function N_(t){var e,n;if(t=Gt(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-Vn(e+(this._isUTC?0:this.utcOffset()*$n),Hs)-1;break;case"minute":e=this._d.valueOf(),e+=$n-Vn(e,$n)-1;break;case"second":e=this._d.valueOf(),e+=Ws-Vn(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 wo(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",$o),Q("NN",$o),Q("NNN",$o),Q("NNNN",rw),Q("NNNNN",nw),Ne(["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),Ne(["y","yy","yyy","yyyy"],pt),Ne(["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 V_(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 G_(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 Ce(this,"_erasNameRegex")||Vo.call(this),t?this._erasNameRegex:this._erasRegex}function ew(t){return Ce(this,"_erasAbbrRegex")||Vo.call(this),t?this._erasAbbrRegex:this._erasRegex}function tw(t){return Ce(this,"_erasNarrowRegex")||Vo.call(this),t?this._erasNarrowRegex:this._erasRegex}function $o(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 Vo(){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",Ke,Nt),Q("gg",Ke,Nt),Q("GGGG",xo,Co),Q("gggg",xo,Co),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",Vl),Ne("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",Ke,Yn),Q("DD",Ke,Nt),Q("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),Ne(["D","DD"],vr),Ne("Do",function(t,e){e[vr]=be(t.match(Ke)[0])});var Cf=Kn("Date",!0);ie("DDD",["DDDD",3],"DDDo","dayOfYear"),Q("DDD",Cs),Q("DDDD",Gl),Ne(["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",Ke,Po),Q("mm",Ke,Nt),Ne(["m","mm"],ur);var pw=Kn("Minutes",!1);ie("s",["ss",2],0,"second"),Q("s",Ke,Po),Q("ss",Ke,Nt),Ne(["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,Vl),Q("SS",Cs,Nt),Q("SSS",Cs,Gl);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")Ne(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 G=Ei.prototype;G.add=l_,G.calendar=y_,G.clone=__,G.diff=A_,G.endOf=N_,G.format=x_,G.from=P_,G.fromNow=R_,G.to=D_,G.toNow=M_,G.get=C0,G.invalidAt=q_,G.isAfter=w_,G.isBefore=b_,G.isBetween=v_,G.isSame=S_,G.isSameOrAfter=T_,G.isSameOrBefore=E_,G.isValid=Y_,G.lang=Sf,G.locale=vf,G.localeData=Tf,G.max=Yy,G.min=Hy,G.parsingFlags=K_,G.set=x0,G.startOf=L_,G.subtract=f_,G.toArray=F_,G.toObject=W_,G.toDate=I_,G.toISOString=k_,G.inspect=C_,typeof Symbol<"u"&&Symbol.for!=null&&(G[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),G.toJSON=H_,G.toString=O_,G.unix=B_,G.valueOf=U_,G.creationData=$_,G.eraName=j_,G.eraNarrow=J_,G.eraAbbr=Q_,G.eraYear=Z_,G.year=Jl,G.isLeapYear=k0,G.weekYear=sw,G.isoWeekYear=aw,G.quarter=G.quarters=hw,G.month=tf,G.daysInMonth=I0,G.week=G.weeks=V0,G.isoWeek=G.isoWeeks=G0,G.weeksInYear=cw,G.weeksInWeekYear=lw,G.isoWeeksInYear=ow,G.isoWeeksInISOWeekYear=uw,G.date=Cf,G.day=G.days=ay,G.weekday=oy,G.isoWeekday=uy,G.dayOfYear=dw,G.hour=G.hours=my,G.minute=G.minutes=pw,G.second=G.seconds=mw,G.millisecond=G.milliseconds=xf,G.utcOffset=Qy,G.utc=Xy,G.local=e_,G.parseZone=t_,G.hasAlignedHourOffset=r_,G.isDST=n_,G.isLocal=s_,G.isUtcOffset=a_,G.isUtc=gf,G.isUTC=gf,G.zoneAbbr=yw,G.zoneName=_w,G.dates=Vt("dates accessor is deprecated. Use date instead.",Cf),G.months=Vt("months accessor is deprecated. Use month instead",tf),G.years=Vt("years accessor is deprecated. Use year instead",Jl),G.zone=Vt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Zy),G.isDSTShifted=Vt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",i_);function ww(t){return qe(t*1e3)}function bw(){return qe.apply(null,arguments).parseZone()}function Pf(t){return t}var xe=To.prototype;xe.calendar=s0,xe.longDateFormat=c0,xe.invalidDate=f0,xe.ordinal=p0,xe.preparse=Pf,xe.postformat=Pf,xe.relativeTime=g0,xe.pastFuture=y0,xe.set=n0,xe.eras=V_,xe.erasParse=G_,xe.erasConvertYear=z_,xe.erasAbbrRegex=ew,xe.erasNameRegex=X_,xe.erasNarrowRegex=tw,xe.months=L0,xe.monthsShort=N0,xe.monthsParse=B0,xe.monthsRegex=W0,xe.monthsShortRegex=F0,xe.week=Y0,xe.firstDayOfYear=$0,xe.firstDayOfWeek=q0,xe.weekdays=ty,xe.weekdaysMin=ny,xe.weekdaysShort=ry,xe.weekdaysParse=sy,xe.weekdaysRegex=cy,xe.weekdaysShortRegex=ly,xe.weekdaysMinRegex=fy,xe.isPM=dy,xe.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 vw(t,e){return Rf(t,e,"months")}function Sw(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=Vt("moment.lang is deprecated. Use moment.locale instead.",en),z.langData=Vt("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(zo(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(zo(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 zo(t){return t*146097/4800}function Pw(t){if(!this.isValid())return NaN;var e,n,s=this._milliseconds;if(t=Gt(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(zo(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=Gt(t),this.isValid()?this[t+"s"]():NaN}function Sn(t){return function(){return this.isValid()?this._data[t]:NaN}}var Yw=Sn("milliseconds"),Kw=Sn("seconds"),qw=Sn("minutes"),$w=Sn("hours"),Vw=Sn("days"),Gw=Sn("months"),zw=Sn("years");function jw(){return zt(this.days()/7)}var Ir=Math.round,Gn={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")),w=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||w<=1&&["w"]||w<n.w&&["ww",w]),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 Gn[t]===void 0?!1:e===void 0?Gn[t]:(Gn[t]=e,t==="s"&&(Gn.ss=e-1),!0)}function e1(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=Gn,a,c;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(s=Object.assign({},Gn,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 jo=Math.abs;function zn(t){return(t>0)-(t<0)||+t}function qs(){if(!this.isValid())return this.localeData().invalidDate();var t=jo(this._milliseconds)/1e3,e=jo(this._days),n=jo(this._months),s,a,c,u,l=this.asSeconds(),h,m,w,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)?"-":"",w=zn(this._days)!==zn(l)?"-":"",T=zn(this._milliseconds)!==zn(l)?"-":"",h+"P"+(c?m+c+"Y":"")+(n?m+n+"M":"")+(e?w+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=Gy,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=Vw,Ee.weeks=jw,Ee.months=Gw,Ee.years=zw,Ee.humanize=e1,Ee.toISOString=qs,Ee.toString=qs,Ee.toJSON=qs,Ee.locale=vf,Ee.localeData=Tf,Ee.toIsoString=Vt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qs),Ee.lang=Sf,ie("X",0,0,"unix"),ie("x",0,0,"valueOf"),Q("x",Ps),Q("X",v0),Ne("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),Ne("x",function(t,e,n){n._d=new Date(be(t))});//! moment.js
|
|
42
|
-
z.version="2.30.1",t0(qe),z.fn=G,z.min=Ky,z.max=qy,z.now=$y,z.utc=_r,z.unix=ww,z.months=vw,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=Sw,z.weekdaysMin=Aw,z.defineLocale=Uo,z.updateLocale=by,z.locales=vy,z.weekdaysShort=Ew,z.normalizeUnits=Gt,z.relativeTimeRounding=Zw,z.relativeTimeThreshold=Xw,z.calendarFormat=g_,z.prototype=G,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 xt=60,If=60*xt,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 Vs(t){const e=new TextEncoder().encode(t);return Uf(Bf(e))}function Gs(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 Qo(t,e=void 0){return _n.createJWT(t,e)}function Hf(t){return _n.parseJWT(t)}function Yf(t){return _n.jwkToPublicKey(t)}function Zo(t,e){return _n.encryptPayload(t,e)}function Xo(t){if(Array.isArray(t))return t.map(Xo);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[no.camelCase(n[a])]=Xo(t[n[a]]);return e}return t}function zs(t){if(!t)return!0;try{return JSON.parse(Gs(t.split(".")[1])).exp<Ff()}catch{return!0}}function eu(t){return jt("root",t,"non-nullable object",!1)}function tu(t,e){return jt("root",t,"object",e)}function ru(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 _t(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 nt(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 De(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 Js(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 xt;case"2":return xt*2;case"3":return xt*3;case"5":return xt*5;case"10":return xt*10;case"15":return xt*15;case"30":return xt*30;case"60":return xt*60;case"120":return xt*120;case"240":return xt*240;case"360":return xt*360;case"720":return xt*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 Qs=t=>typeof t=="object"?t:new Date(t*1e3),$f=(t,e)=>{switch(t=z.utc(Qs(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(Qs(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 Vf(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(Qs(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 Zs(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=ct.pickBy(s,(h,m)=>{const w=h[c];if(w==null)return!1;const T=w.toLowerCase();return u&&c==="fullDisplayName"?!!u.exec(h[c]):l.filter(P=>T.includes(P)).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.15";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 Oe{static I18n=s1;config;_token;_sessionKey;_credential;_firstOpen;_onTokenExpired;_tokenCheckTimeout;_onError;_onOpen;_socket;_transport;_tickerListeners=new Map;_tickerSymbols=new Map;_tradeListeners={};_tradeSnapshots={};_bigTradeListeners={};_orderbookListeners={};_orderbookSnapshots={};_candleTradeListeners={};_candleListeners={};_candles={};_timers={};_channels={};_connected;markConnected;_publicKey;_refreshingToken;_nonceOffset;tickersSubscribed=!1;tradesSubscribed=!1;bigTradesSubscribed=!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._bigTradeListeners={},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._bigTradeListeners).forEach(e=>{this._bigTradeListeners[e].length>0&&this.getChannel("big_trades").push("subscribe",{symbols:e},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(Oe._parseTicker);this._tickerListeners.forEach((m,w)=>{const T=h.filter(P=>m.has(P.coinraySymbol));w({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(Oe._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(Oe._parseTrade),h=[...l,...this._tradeSnapshots[a]],m=new Date(new Date().getTime()-12e4),w=h.filter(({time:T})=>T>m);w.length>100?this._tradeSnapshots[a]=w: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]=[])};subscribeBigTrades=async({coinraySymbol:e},n)=>{if(this._bigTradeListeners[e]&&this._bigTradeListeners[e].length>0)return this._bigTradeListeners[e].includes(n)||this._bigTradeListeners[e].push(n),n;this._bigTradeListeners[e]=[n],await this.connect();const s=this.getChannel("big_trades");return s.push("subscribe",{symbols:e},5e3),this.bigTradesSubscribed||(this.bigTradesSubscribed=!0,s.on("update",({symbol:a,trades:c})=>{const u=Object.values(this._bigTradeListeners[a]||{}),l=c.map(Oe._parseTrade);u.map(h=>h({type:"bigTrades:update",coinraySymbol:a,trades:l}))}),s.on("error",a=>console.error(a))),n};unsubscribeBigTrades=({coinraySymbol:e},n)=>{n&&this._bigTradeListeners[e]?(this._bigTradeListeners[e]=this._bigTradeListeners[e].filter(s=>s!==n),this._bigTradeListeners[e].length===0&&this.getChannel("big_trades").push("unsubscribe",{symbols:e},5e3)):this._bigTradeListeners[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=Oe._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=Oe._parseOrderBookUpdate(a[u]);this._orderbookSnapshots[u]=Oe._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 w=Object.values(this._candleListeners[c]),T=Oe._tradesToLastCandle(n,m),P=T[T.length-1];P&&(this._candles[c]&&l==="trades:snapshot"&&(this._candles[c].skipVolume=!0),this._candles[c]=Oe._mergeCandle(this._candles[c],P),w.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=Zs(0,n,new Date)-new Date().getTime()/1e3;const c=Object.values(this._candleListeners[e]);this._timers[e]=setTimeout(()=>{let u=Zs(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=Vf(n),l=new Date().getTime()/1e3,h=[];let m=a+1;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 w=Zs(2,n,m),T=no.chunk(zf(s,w,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=ct.keyBy(c,({time:h})=>h.getTime());let{result:l}=await this.get("candles/open",n);if(l.candles){let m=l.candles.map(Oe._parseCandle).map(w=>{const T=u[w.time.getTime()];return T?Oe._mergeCandle(w,T):w});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(Oe._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}`;fetchTradeFlow=async({coinraySymbol:e,resolution:n,start:s,end:a})=>{const{result:c}=await this.get("candles/trade-flow",{version:"v2",params:{symbol:e,resolution:n,start_time:s,end_time:a}});return(c.buckets||[]).map(u=>({time:Js(u.time),buyVolume:parseFloat(u.buyVolume),sellVolume:parseFloat(u.sellVolume),buyQuoteVolume:parseFloat(u.buyQuoteVolume),sellQuoteVolume:parseFloat(u.sellQuoteVolume),buyCount:u.buyCount,sellCount:u.sellCount,cvd:parseFloat(u.cvd)}))};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 Zo(await Qo({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 Zo(await Qo({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(Oe._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(),w=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}${w}`;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:Oe._parseBidAsk(e),bids:Oe._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:e,bids_diff:n,min_seq:s,max_seq:a}){return{minSeq:s,maxSeq:a,asks:Oe._parseBidAsk(e),bids:Oe._parseBidAsk(n)}}static _updateOrderBook(e,{asks:n,bids:s,min_seq:a,max_seq:c}){const u=(l,h)=>{ct.forEach(h,(m,w)=>{m>0?l[w]=m:delete l[w]})};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:Js(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:Js(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=Oe._resolutionToSeconds(e),a=ct.groupBy(n.reverse(),({time:c})=>Math.floor(c.getTime()/s)*s);return ct.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 w=l[0],T,P,$,O,I=0,F=0;return c.length===0?T=P=$=O=w.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;futuresSettings;symbolTv;tradingSessions;syntheticTrades;marketCap;_groupName;getPriceOverrides;static Create(e,n,s){if(e==null?eu(e):typeof e!="object"?tu(e,!1):Array.isArray(e)&&ru(e,!1),_t(e.id,!1,"id"),De(e.coinraySymbol,!1,"coinraySymbol"),De(e.symbol,!1,"symbol"),De(e.symbolAlt,!1,"symbolAlt"),De(e.quoteCurrency,!1,"quoteCurrency"),De(e.underlyingQuoteCurrency,!1,"underlyingQuoteCurrency"),De(e.baseLogoUrl,!0,"baseLogoUrl"),De(e.baseCurrency,!1,"baseCurrency"),De(e.exchangeCode,!1,"exchangeCode"),De(e.status||"",!1,"status"),De(e.note||"",!1,"note"),nt(e.volume,!0,"volume"),nt(e.quoteVolume,!0,"quoteVolume"),nt(e.btcVolume,!0,"btcVolume"),nt(e.usdVolume,!0,"usdVolume"),Tn(e.websocket,!1,"websocket"),nt(e.openPrice,!0,"openPrice"),nt(e.highPrice,!0,"highPrice"),nt(e.lowPrice,!0,"lowPrice"),_t(e.precisionBase,!1,"precisionBase"),_t(e.precisionPrice,!1,"precisionPrice"),_t(e.precisionBase,!1,"precisionBase"),_t(e.minBase,!0,"minBase"),_t(e.precisionQuote,!1,"precisionQuote"),_t(e.minQuote,!0,"minQuote"),nt(e.maxBase,!0,"maxBase"),nt(e.maxBaseMarket,!0,"maxBaseMarket"),nt(e.maxQuote,!0,"maxQuote"),nt(e.minTrade,!1,"minTrade"),_t(e.maxTrade,!0,"maxTrade"),e.maxTrade===void 0&&(e.maxTrade=null),_t(e.makerFee,!1,"makerFee"),_t(e.takerFee,!1,"takerFee"),_t(e.change,!1,"change"),Kf(e.delistedOn,"delistedOn"),e.delistedOn===void 0&&(e.delistedOn=null),De(e.exchangeUrl,!1,"exchangeUrl"),nt(e.lastPrice,!0,"lastPrice"),nt(e.baseToUsd,!1,"baseToUsd"),nt(e.quoteToUsd,!1,"quoteToUsd"),nt(e.askPrice,!0,"askPrice"),nt(e.bidPrice,!0,"bidPrice"),De(e.updatedAt,!1,"updatedAt"),De(e.symbolTv,!0,"symbolTv"),De(e.groupName,!0,"groupName"),nt(e.marketCap,!0,"marketCap"),e.futuresSettings!==null&&e.futuresSettings!==void 0){const a=e.futuresSettings;De(a.tenor,!1,"futuresSettings.tenor"),De(a.margin,!1,"futuresSettings.margin"),De(a.expiresAt,!0,"futuresSettings.expiresAt"),_t(a.fundingIntervalSeconds,!0,"futuresSettings.fundingIntervalSeconds"),nt(a.maxLeverage,!0,"futuresSettings.maxLeverage"),De(a.groupName,!0,"futuresSettings.groupName")}return new Ui(e,n,s)}constructor(e,n,s){if(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,this.symbolTv=e.symbolTv,this._groupName=e.groupName,this.tradingSessions=e.tradingSessions??null,this.syntheticTrades=e.syntheticTrades??!1,this.marketCap=X(e.marketCap),e.futuresSettings!==null&&e.futuresSettings!==void 0){const a=e.futuresSettings;this.futuresSettings={tenor:a.tenor,margin:a.margin,expiresAt:a.expiresAt?new Date(a.expiresAt):null,fundingIntervalSeconds:a.fundingIntervalSeconds??null,maxLeverage:a.maxLeverage!==null&&a.maxLeverage!==void 0?X(a.maxLeverage):null,groupName:a.groupName??void 0}}}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 groupName(){return this._groupName??this.futuresSettings?.groupName}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,marketCap:this.marketCap,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,groupName:this._groupName},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?eu(e):typeof e!="object"?tu(e,!1):Array.isArray(e)&&ru(e,!1),_t(e.id,!1,"id"),De(e.name,!1,"name"),De(e.code,!1,"code"),Tn(e.websocket,!1,"websocket"),Tn(e.active,!1,"active"),Tn(e.tradingEnabled,!1,"tradingEnabled"),De(e.tradingEnabledFrom,!1,"tradingEnabledFrom"),Tn(e.isFutures,!0,"isFutures"),Tn(e.isDex,!0,"isDex"),De(e.logo,!1,"logo"),De(e.btcVolume,!1,"btcVolume"),De(e.usdVolume,!1,"usdVolume"),_t(e.totalMarkets,!1,"totalMarkets"),js(e.quoteCurrencies,"quoteCurrencies"),De(e.apiEndpoint,!0,"apiEndpoint"),De(e.websocketEndpoint,!0,"websocketEndpoint"),De(e.aliasedTo,!0,"aliasedTo"),e.quoteCurrencies)for(let s=0;s<e.quoteCurrencies.length;s++)De(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++)De(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=ct.keyBy(s,"coinraySymbol"),this.exchangeSymbols=ct.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 Oe(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),w=!this.prevTickers.askPrice.eq(l)||!this.prevTickers.bidPrice.eq(h);(m||w)&&(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,w)=>{ct.forEach(w,(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:w})=>w.minus(m)),asks:Object.values(this.orderBook.asks).sort(({price:m},{price:w})=>m.minus(w))}})};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
|
-
* validate.js 0.13.1
|
|
46
|
-
*
|
|
47
|
-
* (c) 2013-2019 Nicklas Ansman, 2013 Wrapp
|
|
48
|
-
* Validate.js may be freely distributed under the MIT license.
|
|
49
|
-
* For all details and documentation:
|
|
50
|
-
* http://validatejs.org/
|
|
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 w=u.runValidations(l,h,m);if(w.some(function(T){return u.isPromise(T.error)}))throw new Error("Use validate.async if you want support for promises");return c.processValidationResults(w,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 w=[],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&&w.push({attribute:T,value:$,validator:P,globalOptions:m,attributes:l,options:F,error:I.call(I,$,F,T,l,m)})}}return w},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 w=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 w(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(w){m.error=w||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,w,T){return w==="%"?"%{"+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,w){return""+m+" "+w.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,w){return w.indexOf(h)==m}):l},forEachKeyInKeypath:function(l,h,m){if(u.isString(h)){var w="",T,P=!1;for(T=0;T<h.length;++T)switch(h[T]){case".":P?(P=!1,w+="."):(l=m(l,w,!1),w="");break;case"\\":P?(P=!1,w+="\\"):P=!0;break;default:P=!1,w+=h[T];break}return m(l,w,!0)}},getDeepObjectValue:function(l,h){if(u.isObject(l))return u.forEachKeyInKeypath(l,h,function(m,w){if(u.isObject(m))return m[w]})},collectFormValues:function(l,h){var m={},w,T,P,$,O,I;if(u.isJqueryElement(l)&&(l=l[0]),!l)return m;for(h=h||{},$=l.querySelectorAll("input[name], textarea[name]"),w=0;w<$.length;++w)if(P=$.item(w),!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]"),w=0;w<$.length;++w)if(P=$.item(w),!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(w){h.push(u.extend({},m,{error:w}))}):h.push(m)}),h},convertErrorMessages:function(l,h){h=h||{};var m=[],w=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(w(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 w=h[m.attribute];w?w.push(m):h[m.attribute]=[m]}),h},flattenErrorsToArray:function(l){return l.map(function(h){return h.error}).filter(function(h,m,w){return w.indexOf(h)===m})},cleanAttributes:function(l,h){function m(P,$,O){return u.isObject(P[$])?P[$]:P[$]=O?!0:{}}function w(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=w(h),T(l,h))},exposeModule:function(l,h,m,w,T){m?(w&&w.exports&&(m=w.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 w=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(w)&&F!==w&&(O=h.wrongLength||this.wrongLength||"is the wrong length (should be %{count} characters)",I.push(u.format(O,{count:w}))),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,w,T){if(u.isDefined(l)){h=u.extend({},this.options,h);var P=[],$,O,I={greaterThan:function(Se,_e){return Se>_e},greaterThanOrEqualTo:function(Se,_e){return Se>=_e},equalTo:function(Se,_e){return Se===_e},lessThan:function(Se,_e){return Se<_e},lessThanOrEqualTo:function(Se,_e){return Se<=_e},divisibleBy:function(Se,_e){return Se%_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,w=[],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)}),w.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)}),w.push(m)),w.length)return u.unique(w)}},{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",w=h.pattern,T;if(u.isDefined(l)&&(!u.isString(l)||(u.isString(w)&&(w=new RegExp(h.pattern,h.flags)),T=w.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,w,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(w,h.attribute),O=h.comparator||function(F,ne){return F===ne},I=h.prettify||T&&T.prettify||u.prettify;if(!O(l,$,h,m,w))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",w=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 $="^(?:(?:"+w.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,w,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,w,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,w,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=vl(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.HEDGE_MODE_ONLY="hedgeModeOnly",t.ORDER_QUOTE_AMOUNT="orderQuoteAmount",t.MARKET_BUY_QUOTE_ONLY="marketBuyQuoteOnly",t.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS="updateLeverageOnlyOnOpenPositions",t.IGNORE_LEVERAGE_ON_QUICK_SYNC="ignoreLeverageOnQuickSync",t.MULTIPLE_MARGIN_TYPE_POSITIONS="multipleMarginTypePositions",t.SET_LEVERAGE_NOT_AVAILABLE="setLeverageNotAvailable",t.SET_MARGIN_TYPE_NOT_AVAILABLE="setMarginTypeNotAvailable",t.FIXED_CROSSED_LEVERAGE="fixedCrossedLeverage",t.FAST_CONNECT="fastConnect",t.UNIFIED_BALANCE="unifiedBalance",t.NO_API_KEY_LINK="noApiKeyLink",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||{}),wt=(t=>(t.BUY="buy",t.SELL="sell",t))(wt||{}),lu=(t=>(t.GTC="gtc",t.FOK="fok",t.IOC="ioc",t))(lu||{}),Sr=(t=>(t.QUOTE="quote",t.BASE="base",t.NONE="none",t))(Sr||{});const m1=Object.freeze(Object.defineProperty({__proto__:null,BalanceLimit:Sr,ExchangeFeatures:au,IpWhiteList:ou,MarginType:uu,OrderSide:wt,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||Sr.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 Xs extends hu{baseAmount;quoteAmount;price;lockedOn;orderType=rn.LIMIT;constraints(){let e,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote||0:this.balanceLimit===Sr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.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 v1 extends hu{baseAmount;quoteAmount;price;orderType=rn.MARKET;constraints=()=>{let e,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote||0:this.balanceLimit===Sr.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:e?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:n?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.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=>ct.times(t,e=>1/(t-1)*e),EXPONENTIAL:t=>{const e=2**(t-1);return ct.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=ct.sum(t);return t.map(n=>n/e)},ea={EQUAL:t=>{const e=ct.times(t,()=>1);return du(e)},LINEAR:t=>{const e=ct.times(t,n=>1/t*(n+1));return du(e)},EXPONENTIAL:t=>{const e=2**t-1,n=ct.times(t,s=>2**s/e);return du(n)},LINEAR_REVERSE:t=>ea.LINEAR(t).reverse(),EXPONENTIAL_REVERSE:t=>ea.EXPONENTIAL(t).reverse(),CUSTOM:t=>[]};class S1 extends hu{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=rn.LIMIT_LADDER;constraints(){let e,n;return this.balanceLimit===Sr.QUOTE?n=this.balances.quote:this.balanceLimit===Sr.BASE&&(e=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.I18n.t("validation.insufficientFunds")}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${Oe.I18n.t("validation.notGreaterThanOrEqualTo",{min:En(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:n?n.toNumber():void 0,notLessThanOrEqualTo:`^${Oe.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||ea[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===wt.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===wt.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=ea[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=ct.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=ct.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 ct.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 Xs({...this,[e]:m,lockedOn:e,price:this.price.plus(u.multipliedBy(a[h])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}}class T1 extends Xs{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===wt.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===wt.BUY?1+n:1-n;this.price=e.multipliedBy(s).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}}class E1 extends Xs{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===wt.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===wt.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===wt.BUY?1+n*2:1-n*2,a=this.side===wt.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===wt.BUY?1-n*2:1+n*2,a=this.side===wt.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===wt.BUY?1-n:1+n,a=this.side===wt.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=Sr,ee.CoinrayCache=u1,ee.CurrentMarket=l1,ee.DAYS=Li,ee.ExchangeFeatures=au,ee.HOURS=If,ee.IpWhiteList=ou,ee.LimitLadderOrder=S1,ee.LimitOrder=Xs,ee.MINUTES=xt,ee.MarginType=uu,ee.MarketOrder=v1,ee.OcoOrder=E1,ee.OrderSide=wt,ee.OrderStatus=cu,ee.OrderType=rn,ee.PriceScales=eh,ee.SizeScales=th,ee.StopLimitOrder=T1,ee.TimeInForce=lu,ee.WEEK=$s,ee.base64UrlDecode=Gs,ee.base64UrlEncode=Vs,ee.camelize=Xo,ee.candleTime=Zs,ee.checkArray=js,ee.checkBigNumber=nt,ee.checkBoolean=Tn,ee.checkNull=Kf,ee.checkNumber=_t,ee.checkString=De,ee.correctNumberPrecision=En,ee.createJWT=Qo,ee.default=Oe,ee.encryptPayload=Zo,ee.errorHelper=jt,ee.filterMarkets=jf,ee.getBucketStartDates=zf,ee.getTimeParams=Gf,ee.jwkToPublicKey=Yf,ee.jwtExpired=zs,ee.locales=f1,ee.parseJWT=Hf,ee.resolutionToBucketType=Vf,ee.resolutionToDuration=qf,ee.safeBigNumber=X,ee.safeFloat=Ni,ee.safeInteger=jn,ee.safeTime=Js,ee.sha256hexdigest=Wf,ee.signHMAC=Jo,ee.strToArray=n1,ee.throwIsArray=ru,ee.throwNotObject=tu,ee.throwNull2NonNull=eu,ee.toBucketEnd=$f,ee.toBucketStart=i1,ee.toSafeDate=Qs,ee.types=m1,ee.unix=Ff,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ee})({});
|
|
52
|
-
//# sourceMappingURL=coinrayjs.js.map
|
|
28
|
+
`)+f+`return __p
|
|
29
|
+
}`;var g=uf(function(){return at(o,m+`return `+f).apply(n,s)});if(g.source=f,cu(g))throw g;return g}function $d(e){return J(e).toLowerCase()}function ef(e){return J(e).toUpperCase()}function tf(e,t,r){if(e=J(e),e&&(r||t===n))return Wn(e);if(!e||!(t=ja(t)))return e;var i=fr(e),a=fr(t);return Ua(i,Jn(i,a),Yn(i,a)+1).join(``)}function nf(e,t,r){if(e=J(e),e&&(r||t===n))return e.slice(0,pr(e)+1);if(!e||!(t=ja(t)))return e;var i=fr(e);return Ua(i,0,Yn(i,fr(t))+1).join(``)}function rf(e,t,r){if(e=J(e),e&&(r||t===n))return e.replace(Be,``);if(!e||!(t=ja(t)))return e;var i=fr(e);return Ua(i,Jn(i,fr(t))).join(``)}function af(e,t){var r=30,i=`...`;if(pu(t)){var a=`separator`in t?t.separator:a;r=`length`in t?q(t.length):r,i=`omission`in t?ja(t.omission):i}e=J(e);var o=e.length;if(tr(e)){var s=fr(e);o=s.length}if(r>=o)return e;var c=r-dr(i);if(c<1)return i;var l=s?Ua(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),wu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=ct(a.source,J(Ye.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(ja(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function of(e){return e=J(e),e&&Ae.test(e)?e.replace(Oe,mr):e}var sf=fo(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),cf=uo(`toUpperCase`);function lf(e,t,r){return e=J(e),t=r?n:t,t===n?nr(e)?_r(e):An(e):e.match(t)||[]}var uf=L(function(e,t){try{return gn(e,n,t)}catch(e){return cu(e)?e:new it(e)}}),df=No(function(e,t){return P(t,function(t){t=ws(t),pi(e,t,Cl(e[t],e))}),e});function Y(e){var t=e==null?0:e.length,n=V();return e=t?Cn(e,function(e){if(typeof e[1]!=`function`)throw new ut(r);return[n(e[0]),e[1]]}):[],L(function(n){for(var r=-1;++r<t;){var i=e[r];if(gn(i[0],this,n))return gn(i[1],this,n)}})}function ff(e){return _i(gi(e,1))}function pf(e){return function(){return e}}function mf(e,t){return e==null||e!==e?t:e}var X=go(),hf=go(!0);function gf(e){return e}function _f(e){return ea(typeof e==`function`?e:gi(e,1))}function vf(e){return aa(gi(e,1))}function yf(e,t){return oa(e,gi(t,1))}var bf=L(function(e,t){return function(n){return Hi(n,e,t)}}),xf=L(function(e,t){return function(n){return Hi(e,n,t)}});function Sf(e,t,n){var r=ld(t),i=Mi(t,r);n==null&&(!pu(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=Mi(t,ld(t)));var a=!(pu(n)&&`chain`in n)||!!n.chain,o=uu(e);return P(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=to(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,wn([this.value()],arguments))})}),e}function Cf(){return rn._===this&&(rn._=M),this}function wf(){}function Tf(e){return e=q(e),L(function(t){return la(t,e)})}var Ef=yo(Cn),Df=yo(yn),Of=yo(Dn);function kf(e){return ts(e)?Ln(ws(e)):pa(e)}function Af(e){return function(t){return e==null?n:Ni(e,t)}}var jf=xo(),Mf=xo(!0);function Nf(){return[]}function Pf(){return!1}function Ff(){return{}}function If(){return``}function Lf(){return!0}function Rf(e,t){if(e=q(e),e<1||e>g)return[];var n=y,r=Yt(e,y);t=V(t),e-=y;for(var i=Hn(r,t);++n<e;)t(n);return i}function zf(e){return G(e)?Cn(e,ws):Ou(e)?[e]:to(Cs(J(e)))}function Bf(e){var t=++gt;return J(e)+t}var Vf=vo(function(e,t){return e+t},0),Hf=wo(`ceil`),Uf=vo(function(e,t){return e/t},1),Wf=wo(`floor`);function Gf(e){return e&&e.length?wi(e,gf,Ii):n}function Kf(e,t){return e&&e.length?wi(e,V(t,2),Ii):n}function qf(e){return In(e,gf)}function Jf(e,t){return In(e,V(t,2))}function Yf(e){return e&&e.length?wi(e,gf,ra):n}function Xf(e,t){return e&&e.length?wi(e,V(t,2),ra):n}var Zf=vo(function(e,t){return e*t},1),Qf=wo(`round`),$f=vo(function(e,t){return e-t},0);function ep(e){return e&&e.length?Vn(e,gf):0}function tp(e,t){return e&&e.length?Vn(e,V(t,2)):0}return F.after=bl,F.ary=xl,F.assign=Vu,F.assignIn=Hu,F.assignInWith=Uu,F.assignWith=Wu,F.at=Gu,F.before=Sl,F.bind=Cl,F.bindAll=df,F.bindKey=wl,F.castArray=Ul,F.chain=Ic,F.chunk=Os,F.compact=ks,F.concat=As,F.cond=Y,F.conforms=ff,F.constant=pf,F.countBy=qc,F.create=Ku,F.curry=Tl,F.curryRight=El,F.debounce=Dl,F.defaults=qu,F.defaultsDeep=Ju,F.defer=Ol,F.delay=kl,F.difference=js,F.differenceBy=Ms,F.differenceWith=Ns,F.drop=Ps,F.dropRight=Fs,F.dropRightWhile=U,F.dropWhile=Is,F.fill=Ls,F.filter=Yc,F.flatMap=Qc,F.flatMapDeep=$c,F.flatMapDepth=el,F.flatten=W,F.flattenDeep=Bs,F.flattenDepth=Vs,F.flip=Al,F.flow=X,F.flowRight=hf,F.fromPairs=Hs,F.functions=td,F.functionsIn=nd,F.groupBy=rl,F.initial=Gs,F.intersection=Ks,F.intersectionBy=qs,F.intersectionWith=Js,F.invert=od,F.invertBy=sd,F.invokeMap=al,F.iteratee=_f,F.keyBy=ol,F.keys=ld,F.keysIn=ud,F.map=sl,F.mapKeys=dd,F.mapValues=fd,F.matches=vf,F.matchesProperty=yf,F.memoize=jl,F.merge=pd,F.mergeWith=md,F.method=bf,F.methodOf=xf,F.mixin=Sf,F.negate=Ml,F.nthArg=Tf,F.omit=hd,F.omitBy=gd,F.once=Nl,F.orderBy=cl,F.over=Ef,F.overArgs=Pl,F.overEvery=Df,F.overSome=Of,F.partial=Fl,F.partialRight=Il,F.partition=ll,F.pick=_d,F.pickBy=vd,F.property=kf,F.propertyOf=Af,F.pull=$s,F.pullAll=ec,F.pullAllBy=tc,F.pullAllWith=nc,F.pullAt=rc,F.range=jf,F.rangeRight=Mf,F.rearg=Ll,F.reject=fl,F.remove=ic,F.rest=Rl,F.reverse=ac,F.sampleSize=ml,F.set=bd,F.setWith=xd,F.shuffle=hl,F.slice=oc,F.sortBy=vl,F.sortedUniq=pc,F.sortedUniqBy=mc,F.split=Yd,F.spread=zl,F.tail=hc,F.take=gc,F.takeRight=_c,F.takeRightWhile=vc,F.takeWhile=yc,F.tap=Lc,F.throttle=Bl,F.thru=Rc,F.toArray=Fu,F.toPairs=Sd,F.toPairsIn=Cd,F.toPath=zf,F.toPlainObject=zu,F.transform=wd,F.unary=Vl,F.union=bc,F.unionBy=xc,F.unionWith=Sc,F.uniq=Cc,F.uniqBy=wc,F.uniqWith=Tc,F.unset=Td,F.unzip=Ec,F.unzipWith=Dc,F.update=Ed,F.updateWith=Dd,F.values=Od,F.valuesIn=kd,F.without=Oc,F.words=lf,F.wrap=Hl,F.xor=kc,F.xorBy=Ac,F.xorWith=jc,F.zip=Mc,F.zipObject=Nc,F.zipObjectDeep=Pc,F.zipWith=Fc,F.entries=Sd,F.entriesIn=Cd,F.extend=Hu,F.extendWith=Uu,Sf(F,F),F.add=Vf,F.attempt=uf,F.camelCase=Nd,F.capitalize=Pd,F.ceil=Hf,F.clamp=Ad,F.clone=Wl,F.cloneDeep=Kl,F.cloneDeepWith=ql,F.cloneWith=Gl,F.conformsTo=Jl,F.deburr=Fd,F.defaultTo=mf,F.divide=Uf,F.endsWith=Id,F.eq=Yl,F.escape=Ld,F.escapeRegExp=Rd,F.every=Jc,F.find=Xc,F.findIndex=Rs,F.findKey=Yu,F.findLast=Zc,F.findLastIndex=zs,F.findLastKey=Xu,F.floor=Wf,F.forEach=tl,F.forEachRight=nl,F.forIn=Zu,F.forInRight=Qu,F.forOwn=$u,F.forOwnRight=ed,F.get=rd,F.gt=Xl,F.gte=Zl,F.has=id,F.hasIn=ad,F.head=Us,F.identity=gf,F.includes=il,F.indexOf=Ws,F.inRange=jd,F.invoke=cd,F.isArguments=Ql,F.isArray=G,F.isArrayBuffer=$l,F.isArrayLike=eu,F.isArrayLikeObject=K,F.isBoolean=tu,F.isBuffer=nu,F.isDate=ru,F.isElement=iu,F.isEmpty=au,F.isEqual=ou,F.isEqualWith=su,F.isError=cu,F.isFinite=lu,F.isFunction=uu,F.isInteger=du,F.isLength=fu,F.isMap=hu,F.isMatch=gu,F.isMatchWith=_u,F.isNaN=vu,F.isNative=yu,F.isNil=xu,F.isNull=bu,F.isNumber=Su,F.isObject=pu,F.isObjectLike=mu,F.isPlainObject=Cu,F.isRegExp=wu,F.isSafeInteger=Tu,F.isSet=Eu,F.isString=Du,F.isSymbol=Ou,F.isTypedArray=ku,F.isUndefined=Au,F.isWeakMap=ju,F.isWeakSet=Mu,F.join=Ys,F.kebabCase=zd,F.last=Xs,F.lastIndexOf=Zs,F.lowerCase=Bd,F.lowerFirst=Vd,F.lt=Nu,F.lte=Pu,F.max=Gf,F.maxBy=Kf,F.mean=qf,F.meanBy=Jf,F.min=Yf,F.minBy=Xf,F.stubArray=Nf,F.stubFalse=Pf,F.stubObject=Ff,F.stubString=If,F.stubTrue=Lf,F.multiply=Zf,F.nth=Qs,F.noConflict=Cf,F.noop=wf,F.now=yl,F.pad=Hd,F.padEnd=Ud,F.padStart=Wd,F.parseInt=Gd,F.random=Md,F.reduce=ul,F.reduceRight=dl,F.repeat=Kd,F.replace=qd,F.result=yd,F.round=Qf,F.runInContext=e,F.sample=pl,F.size=gl,F.snakeCase=Jd,F.some=_l,F.sortedIndex=sc,F.sortedIndexBy=cc,F.sortedIndexOf=lc,F.sortedLastIndex=uc,F.sortedLastIndexBy=dc,F.sortedLastIndexOf=fc,F.startCase=Xd,F.startsWith=Zd,F.subtract=$f,F.sum=ep,F.sumBy=tp,F.template=Qd,F.times=Rf,F.toFinite=Iu,F.toInteger=q,F.toLength=Lu,F.toLower=$d,F.toNumber=Ru,F.toSafeInteger=Bu,F.toString=J,F.toUpper=ef,F.trim=tf,F.trimEnd=nf,F.trimStart=rf,F.truncate=af,F.unescape=of,F.uniqueId=Bf,F.upperCase=sf,F.upperFirst=cf,F.each=tl,F.eachRight=nl,F.first=Us,Sf(F,function(){var e={};return Ai(F,function(t,n){j.call(F.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),F.VERSION=`4.18.1`,P([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){F[e].placeholder=F}),P([`drop`,`take`],function(e,t){I.prototype[e]=function(r){r=r===n?1:Gt(q(r),0);var i=this.__filtered__&&!t?new I(this):this.clone();return i.__filtered__?i.__takeCount__=Yt(r,i.__takeCount__):i.__views__.push({size:Yt(r,y),type:e+(i.__dir__<0?`Right`:``)}),i},I.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),P([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;I.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:V(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),P([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);I.prototype[e]=function(){return this[n](1).value()[0]}}),P([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);I.prototype[e]=function(){return this.__filtered__?new I(this):this[n](1)}}),I.prototype.compact=function(){return this.filter(gf)},I.prototype.find=function(e){return this.filter(e).head()},I.prototype.findLast=function(e){return this.reverse().find(e)},I.prototype.invokeMap=L(function(e,t){return typeof e==`function`?new I(this):this.map(function(n){return Hi(n,e,t)})}),I.prototype.reject=function(e){return this.filter(Ml(V(e)))},I.prototype.slice=function(e,t){e=q(e);var r=this;return r.__filtered__&&(e>0||t<0)?new I(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=q(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},I.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},I.prototype.toArray=function(){return this.take(y)},Ai(I.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=F[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(F.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof I,l=s[0],u=c||G(t),d=function(e){var t=a.apply(F,wn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new I(this);var g=e.apply(t,s);return g.__actions__.push({func:Rc,args:[d],thisArg:n}),new Er(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),P([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=dt[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);F.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(G(i)?i:[],e)}return this[n](function(n){return t.apply(G(n)?n:[],e)})}}),Ai(I.prototype,function(e,t){var n=F[t];if(n){var r=n.name+``;j.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}}),Rn[R(n,s).name]=[{name:`wrapper`,func:n}],I.prototype.clone=Dr,I.prototype.reverse=Or,I.prototype.value=kr,F.prototype.at=zc,F.prototype.chain=Bc,F.prototype.commit=Vc,F.prototype.next=Hc,F.prototype.plant=Wc,F.prototype.reverse=Gc,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=Kc,F.prototype.first=F.prototype.head,At&&(F.prototype[At]=Uc),F})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(rn._=vr,define(function(){return vr})):on?((on.exports=vr)._=vr,an._=vr):rn._=vr}).call(e)})),hi=new TextEncoder,gi=new TextDecoder;new TextDecoder(`utf-8`,{fatal:!0});var _i=2**32;function vi(...e){let t=e.reduce((e,{length:t})=>e+t,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function yi(e,t,n){if(t<0||t>=_i)throw RangeError(`value must be >= 0 and <= ${_i-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,t&255],n)}function bi(e){let t=Math.floor(e/_i),n=e%_i,r=new Uint8Array(8);return yi(r,t,0),yi(r,n,4),r}function xi(e){let t=new Uint8Array(4);return yi(t,e),t}function Si(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r>127)throw TypeError(`non-ASCII string encountered in encode()`);t[n]=r}return t}var Ci=(e,t=`algorithm.name`)=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);function wi(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}function Ti(e,t){let{modulusLength:n}=t.algorithm;if(typeof n!=`number`||n<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}function Ei(e,t,n){let r=e.algorithm;if(r.name!==t.name)throw Ci(t.name);if(t.hash&&r.hash?.name!==t.hash)throw Ci(t.hash,`algorithm.hash`);if(t.namedCurve&&r.namedCurve!==t.namedCurve)throw Ci(t.namedCurve,`algorithm.namedCurve`);if(t.length!==void 0&&r.length!==t.length)throw Ci(t.length,`algorithm.length`);wi(e,n)}function Di(e,t,...n){if(n.length>2){let t=n.pop();e+=`one of type ${n.join(`, `)}, or ${t}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t==`function`&&t.name?e+=` Received function ${t.name}`:typeof t==`object`&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Oi=(e,...t)=>Di(`Key must be `,e,...t),ki=(e,t,...n)=>Di(`Key for the ${e} algorithm must be `,t,...n),Ai=class extends Error{static code=`ERR_JOSE_GENERIC`;code=`ERR_JOSE_GENERIC`;constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},ji=class extends Ai{static code=`ERR_JOSE_NOT_SUPPORTED`;code=`ERR_JOSE_NOT_SUPPORTED`},Mi=class extends Ai{static code=`ERR_JWE_INVALID`;code=`ERR_JWE_INVALID`};function Ni(e){if(!Pi(e))throw Error(`CryptoKey instance expected`)}var Pi=e=>{if(e?.[Symbol.toStringTag]===`CryptoKey`)return!0;try{return e instanceof CryptoKey}catch{return!1}},Fi=e=>e?.[Symbol.toStringTag]===`KeyObject`,Ii=e=>Pi(e)||Fi(e),Li=e=>crypto.getRandomValues(new Uint8Array(e.cekBits>>3));function Ri(e,t){let n=e.byteLength<<3;if(n!==t)throw new Mi(`Invalid Content Encryption Key length. Expected ${t} bits, got ${n} bits`)}var zi=e=>crypto.getRandomValues(new Uint8Array(e.ivBits>>3));function Bi(e,t){if(t.length<<3!==e.ivBits)throw new Mi(`Invalid Initialization Vector length`)}async function Vi(e,t,n){if(!(t instanceof Uint8Array))throw TypeError(Oi(t,`Uint8Array`));let r=e.cekBits>>1;return[await crypto.subtle.importKey(`raw`,t.subarray(r>>3),`AES-CBC`,!1,[n]),await crypto.subtle.importKey(`raw`,t.subarray(0,r>>3),{hash:`SHA-${r<<1}`,name:`HMAC`},!1,[`sign`]),r]}async function Hi(e,t,n){return new Uint8Array((await crypto.subtle.sign(`HMAC`,e,t)).slice(0,n>>3))}async function Ui(e,t,n,r,i){let[a,o,s]=await Vi(e,n,`encrypt`),c=new Uint8Array(await crypto.subtle.encrypt({iv:r,name:`AES-CBC`},a,t));return{ciphertext:c,tag:await Hi(o,vi(i,r,c,bi(i.length*8)),s),iv:r}}async function Wi(e,t,n,r,i){let a=n instanceof Uint8Array?await crypto.subtle.importKey(`raw`,n,`AES-GCM`,!1,[`encrypt`]):(Ei(n,e.subtle,`encrypt`),n),o=new Uint8Array(await crypto.subtle.encrypt({additionalData:i,iv:r,name:`AES-GCM`,tagLength:128},a,t)),s=o.slice(-16);return{ciphertext:o.slice(0,-16),tag:s,iv:r}}async function Gi(e,t,n,r,i){if(!Pi(n)&&!(n instanceof Uint8Array))throw TypeError(Oi(n,`CryptoKey`,`KeyObject`,`Uint8Array`,`JSON Web Key`));return r?Bi(e,r):r=zi(e),n instanceof Uint8Array&&Ri(n,e.cekBits),e.cbc?Ui(e,t,n,r,i):Wi(e,t,n,r,i)}function Ki(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=32768,n=[];for(let r=0;r<e.length;r+=t)n.push(String.fromCharCode.apply(null,e.subarray(r,r+t)));return btoa(n.join(``))}function qi(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var Ji=`The input to be decoded is not correctly encoded.`;function Yi(e){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64(typeof e==`string`?e:gi.decode(e),{alphabet:`base64url`})}catch(e){throw TypeError(Ji,{cause:e})}let t=e;if(t instanceof Uint8Array&&(t=gi.decode(t)),t.includes(`+`)||t.includes(`/`))throw TypeError(Ji);t=t.replace(/-/g,`+`).replace(/_/g,`/`);try{return qi(t)}catch{throw TypeError(Ji)}}function Xi(e){let t=e;return typeof t==`string`&&(t=hi.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:`base64url`,omitPadding:!0}):Ki(t).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}function Zi(e,t){if(!(e instanceof Uint8Array))throw TypeError(`${t} must be an instance of Uint8Array`)}function Qi(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function $i(...e){let t=new Set;for(let n of e)if(n)for(let e of Object.keys(n)){if(t.has(e))return!1;t.add(e)}return!0}var ea=Symbol();function ta(e,t){if(e!==void 0)throw TypeError(`${t} can only be called once`)}async function na(e,t){let n=`SHA-${e.slice(-3)}`;return new Uint8Array(await crypto.subtle.digest(n,t))}async function ra(e,t){if(t.kty===`RSA`&&`oth`in t&&t.oth!==void 0)throw new ji(`RSA JWK "oth" (Other Primes Info) Parameter value is not supported`);if(!e.kty.includes(t.kty))throw new ji(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`);let n=e.resolve?.({kty:t.kty,crv:t.crv})??e.subtle,r=!!(t.d||t.priv),i={...t};return i.kty!==`AKP`&&delete i.alg,delete i.use,crypto.subtle.importKey(`jwk`,i,n,t.ext??!r,t.key_ops??e.usages[+!!r])}function ia(e){return{__proto__:null,...e}}function aa(e){let t=ia(e);if(t.ext!==void 0&&typeof t.ext!=`boolean`)throw TypeError(`"ext" (Extractable) Parameter must be a boolean`);if(t.key_ops!==void 0){let e=t.key_ops,n=Array.isArray(e)?[...e]:void 0;if(!n||n.some(e=>typeof e!=`string`)||new Set(n).size!==n.length)throw TypeError(`"key_ops" (Key Operations) Parameter must be an array of unique strings`);t.key_ops=n}return t}var oa=e=>e[Symbol.toStringTag],sa=(e,t,n)=>{let{alg:r}=e;if(t.use!==void 0){let e=n===`sign`||n===`verify`?`sig`:`enc`;if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(t.alg!==void 0&&t.alg!==r)throw TypeError(`Invalid key for this operation, its "alg" must be "${r}" when present`);if(Array.isArray(t.key_ops)){let r=n===`encrypt`||n===`decrypt`?e.ops?.[n===`encrypt`?0:1]:n;if(r&&!t.key_ops.includes(r))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${r}" when present`)}};function ca(e,t,n){let{alg:r,secret:i}=e,a=n===`decrypt`||n===`sign`;if(i&&t instanceof Uint8Array)return[la,t];if(Qi(t)){let o=aa(t);if(typeof o.kty!=`string`)throw TypeError(i?ki(r,t,`CryptoKey`,`KeyObject`,`JSON Web Key`,`Uint8Array`):ki(r,t,`CryptoKey`,`KeyObject`,`JSON Web Key`));if(!(i?o.kty===`oct`&&typeof o.k==`string`:o.kty!==`oct`&&(a?o.kty===`AKP`&&typeof o.priv==`string`||typeof o.d==`string`:o.d===void 0&&o.priv===void 0)))throw TypeError(i?`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`:`JSON Web Key for this operation must be a ${a?`private`:`public`} JWK`);return sa(e,o,n),[fa,t,o]}if(!Ii(t))throw TypeError(i?ki(r,t,`CryptoKey`,`KeyObject`,`JSON Web Key`,`Uint8Array`):ki(r,t,`CryptoKey`,`KeyObject`,`JSON Web Key`));if(i){if(t.type!==`secret`)throw TypeError(`${oa(t)} instances for symmetric algorithms must be of type "secret"`)}else{if(t.type===`secret`)throw TypeError(`${oa(t)} instances for asymmetric algorithms must not be of type "secret"`);let e=a?`private`:`public`;if((t.type===`public`||t.type===`private`)&&t.type!==e){let r=n===`sign`?`signing`:n===`verify`?`verifying`:`${n.slice(0,-1)}tion`;throw TypeError(`${oa(t)} instances for asymmetric algorithm ${r} must be of type "${e}"`)}}return Pi(t)?[ua,t]:[da,t]}var la=0,ua=1,da=2,fa=3,pa,ma={__proto__:null,prime256v1:`P-256`,secp384r1:`P-384`,secp521r1:`P-521`};function ha(e,t,n){pa||=new WeakMap;let r=pa.get(e);return n&&(r?r[t]=n:pa.set(e,{[t]:n})),n??r?.[t]}var ga=async(e,t,n)=>ha(e,n.alg)??ha(e,n.alg,await ra(n,{...t,alg:n.alg})),_a=(e,t)=>{let n=ha(e,t.alg);if(n)return n;let r=e.type===`public`,i=t.usages[+!r],{asymmetricKeyType:a}=e,o=ma[e.asymmetricKeyDetails?.namedCurve],s=t.resolve?.({crv:o,asymmetricKeyType:a})??t.subtle;return ha(e,t.alg,e.toCryptoKey(s,r,i))};async function va(e,t,n){let r=ca(e,t,n);switch(r[0]){case la:case ua:return r[1];case fa:{let t=r[1],n=r[2];if(n.kty===`oct`)return Yi(n.k);if(!Object.isFrozen(t)){let{key_ops:e}=t;Array.isArray(e)&&Object.freeze(e),Object.freeze(t)}return ga(t,n,e)}case da:{let t=r[1];return t.type===`secret`?t.export():`toCryptoKey`in t&&typeof t.toCryptoKey==`function`?_a(t,e):ga(t,t.export({format:`jwk`}),e)}}}function L(e){let t={__proto__:null};for(let n in e)t[n]={...e[n],alg:n};return t}var ya=[[`encrypt`,`wrapKey`],[`decrypt`,`unwrapKey`]],ba=[[],[`deriveBits`]],xa=[[],[]];function Sa(e){return{kty:[`RSA`],subtle:{name:`RSA-OAEP`,hash:`SHA-${e}`},usages:ya,ops:[`wrapKey`,`unwrapKey`]}}function Ca(){return{kty:[`EC`,`OKP`],subtle:{name:`ECDH`},resolve:({kty:e,crv:t,asymmetricKeyType:n})=>{if(t===`X25519`||n===`x25519`)return{name:`X25519`};if(e===`OKP`)throw new ji(`Invalid or unsupported JWK "alg" (Algorithm) Parameter value`);return{name:`ECDH`,namedCurve:t}},usages:ba,ops:[void 0,`deriveBits`]}}function wa(e,t=!1){return{kty:[`oct`],secret:!0,subtle:{name:t?`AES-GCM`:`AES-KW`,length:e},usages:xa,ops:t?[`encrypt`,`decrypt`]:[`wrapKey`,`unwrapKey`]}}function Ta(){return{kty:[`oct`],secret:!0,subtle:{name:`PBKDF2`},usages:xa,ops:[`deriveBits`,`deriveBits`]}}var Ea=L({dir:{kty:[`oct`],secret:!0,subtle:{name:`AES-GCM`},usages:xa,ops:[`encrypt`,`decrypt`]},"RSA-OAEP":Sa(1),"RSA-OAEP-256":Sa(256),"RSA-OAEP-384":Sa(384),"RSA-OAEP-512":Sa(512),"ECDH-ES":Ca(),"ECDH-ES+A128KW":Ca(),"ECDH-ES+A192KW":Ca(),"ECDH-ES+A256KW":Ca(),A128KW:wa(128),A192KW:wa(192),A256KW:wa(256),A128GCMKW:wa(128,!0),A192GCMKW:wa(192,!0),A256GCMKW:wa(256,!0),"PBES2-HS256+A128KW":Ta(),"PBES2-HS384+A192KW":Ta(),"PBES2-HS512+A256KW":Ta()}),Da=[`encrypt`,`decrypt`];function Oa(e,t=!1){return{kty:[`oct`],secret:!0,subtle:{name:t?`AES-CBC`:`AES-GCM`,length:e},usages:xa,ops:Da,cekBits:e,ivBits:t?128:96,cbc:t}}var ka=L({A128GCM:Oa(128),A192GCM:Oa(192),A256GCM:Oa(256),"A128CBC-HS256":Oa(256,!0),"A192CBC-HS384":Oa(384,!0),"A256CBC-HS512":Oa(512,!0)});function Aa(e,t){throw new ji(`Invalid or unsupported "${e}" (JWE ${t}) header value`)}function ja(e){return(typeof e==`string`?Ea[e]:void 0)??Aa(`alg`,`Algorithm`)}function Ma(e){return(typeof e==`string`?ka[e]:void 0)??Aa(`enc`,`Encryption Algorithm`)}function Na(e,t){if(e.algorithm.name!==`ECDH`&&e.algorithm.name!==`X25519`)throw TypeError(`CryptoKey does not support this operation, its algorithm.name must be ECDH or X25519`);wi(e,t)}async function Pa(e,t,n){let r=ja(t).subtle,i=e instanceof Uint8Array?await crypto.subtle.importKey(`raw`,e,`AES-KW`,!0,[n]):e;return Ei(i,r,n),i}async function Fa(e,t,n){let r=await Pa(t,e,`wrapKey`),i=await crypto.subtle.importKey(`raw`,n,{hash:`SHA-256`,name:`HMAC`},!0,[`sign`]);return new Uint8Array(await crypto.subtle.wrapKey(`raw`,i,r,`AES-KW`))}function Ia(e,t,n){Ei(t,ja(e).subtle,n),Ti(e,t)}function La(e,t){return e instanceof Uint8Array?crypto.subtle.importKey(`raw`,e,`PBKDF2`,!1,[`deriveBits`]):(Ei(e,ja(t).subtle,`deriveBits`),e)}async function Ra(e,t,n,r){if(!(e instanceof Uint8Array)||e.length<8)throw new Mi(`PBES2 Salt Input must be 8 or more octets`);if(!Number.isSafeInteger(n)||Math.sign(n)!==1)throw new Mi(`PBES2 Count Input must be a positive integer`);let i=vi(Si(t),Uint8Array.of(0),e),a=parseInt(t.slice(13,16),10),o={hash:`SHA-${t.slice(8,11)}`,iterations:n,name:`PBKDF2`,salt:i},s=await La(r,t);return new Uint8Array(await crypto.subtle.deriveBits(o,s,a))}function za(e){return vi(xi(e.length),e)}async function Ba(e,t,n){let r=t>>3,i=Math.ceil(r/32),a=new Uint8Array(i*32);for(let t=1;t<=i;t++){let r=await na(`sha256`,vi(xi(t),e,n));a.set(r,(t-1)*32)}return a.slice(0,r)}async function Va(e,t,n,r,i=new Uint8Array,a=new Uint8Array){Na(e),Na(t,`deriveBits`);let o=vi(za(Si(n)),za(i),za(a),xi(r));return Ba(new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,e.algorithm.name===`X25519`?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3)),r,o)}function Ha(e){Ni(e);let t=e.algorithm.namedCurve;if(t!==`P-256`&&t!==`P-384`&&t!==`P-521`&&e.algorithm.name!==`X25519`)throw new ji(`ECDH with the provided key is not allowed or not supported by your javascript runtime`)}async function Ua(e,t,n,r,i={}){let a,o,s,c=ja(e);if(e===`dir`)return[n,void 0,void 0];switch(c.subtle.name){case`ECDH`:{Ha(n);let{apu:l,apv:u}=i;l!==void 0&&Zi(l,`"apu"`),u!==void 0&&Zi(u,`"apv"`);let d;d=i.epk===void 0?(await crypto.subtle.generateKey(n.algorithm,!0,[`deriveBits`])).privateKey:await va(c,i.epk,`decrypt`);let f=crypto.subtle,p=d;if(!p.extractable){if(typeof f.getPublicKey!=`function`)throw TypeError(`CryptoKey for "epk" must be extractable`);p=await f.getPublicKey(d,[])}let{x:m,y:h,crv:g,kty:_}=await f.exportKey(`jwk`,p),v=await Va(n,d,e===`ECDH-ES`?t.alg:e,e===`ECDH-ES`?t.cekBits:parseInt(e.slice(-5,-2),10),l,u);if(o={epk:{x:m,crv:g,kty:_}},_===`EC`&&(o.epk.y=h),l&&(o.apu=Xi(l)),u&&(o.apv=Xi(u)),e===`ECDH-ES`){s=v;break}s=r||Li(t),a=await Fa(e.slice(-6),v,s);break}case`RSA-OAEP`:s=r||Li(t),Ni(n),Ia(e,n,`encrypt`),a=new Uint8Array(await crypto.subtle.encrypt(`RSA-OAEP`,n,s));break;case`PBKDF2`:{s=r||Li(t);let{p2c:c=2048,p2s:l=crypto.getRandomValues(new Uint8Array(16))}=i,u=await Ra(l,e,c,n);a=await Fa(e.slice(-6),u,s),o={p2c:c,p2s:Xi(l)};break}case`AES-KW`:s=r||Li(t),a=await Fa(e,n,s);break;case`AES-GCM`:{s=r||Li(t);let{iv:c}=i,l=await Gi(Ma(e.slice(0,-2)),s,n,c,new Uint8Array);a=l.ciphertext,o={iv:Xi(l.iv),tag:Xi(l.tag)};break}}return[s,a,o]}var Wa={__proto__:null};function Ga(e,t){let{crit:n}=t??{};if(Array.isArray(n)&&new Set(n).size!==n.length)throw new e(`"crit" (Critical) Header Parameter MUST NOT contain duplicate values`)}function Ka(e,t,n,r,i){if(i.crit!==void 0&&r?.crit===void 0)throw new e(`"crit" (Critical) Header Parameter MUST be integrity protected`);if(!r||r.crit===void 0)return[];if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(e=>typeof e!=`string`||e.length===0))throw new e(`"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present`);let a=n===void 0?t:{__proto__:null,...n,...t};for(let t of r.crit){if(!(t in a))throw new ji(`Extension Header Parameter "${t}" is not recognized`);if(!Object.hasOwn(i,t)||i[t]===void 0)throw new e(`Extension Header Parameter "${t}" is missing`);if(a[t]&&(!Object.hasOwn(r,t)||r[t]===void 0))throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return r.crit}function qa(e,t){let n,r;try{n=JSON.stringify(t),r=JSON.parse(n)}catch(t){throw new e(`JOSE Header is not valid JSON`,{cause:t})}if(!Qi(r))throw new e(`JOSE Header is not a JSON object`);return[r,n]}function Ja(e,t){if(e.zip!==void 0&&e.zip!==`DEF`)throw new ji(`Unsupported JWE "zip" (Compression Algorithm) Header Parameter value.`);if(e.zip!==void 0&&!t?.zip)throw new Mi(`JWE "zip" (Compression Algorithm) Header Parameter MUST be in a protected header.`)}function Ya(e){if(globalThis[e]===void 0)throw new ji(`JWE "zip" (Compression Algorithm) Header Parameter requires the ${e} API.`)}async function Xa(e){Ya(`CompressionStream`);let t=new CompressionStream(`deflate-raw`),n=t.writable.getWriter();n.write(e).catch(()=>{}),n.close().catch(()=>{});let r=[],i=t.readable.getReader();for(;;){let{value:e,done:t}=await i.read();if(t)break;r.push(e)}return vi(...r)}function Za(e,t,n){if(!$i(e,t,n))throw new Mi(`JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint`)}function Qa(e){let[,t,n,r,i,a,o,s,c]=e;if(i!==void 0&&Zi(i,`JWE Additional Authenticated Data`),a!==void 0&&Zi(a,`JWE Content Encryption Key`),o!==void 0&&Zi(o,`JWE Initialization Vector`),t!==void 0&&(t=qa(Mi,t)[0],e[1]=t),n!==void 0&&(n=qa(Mi,n)[0],e[2]=n),r!==void 0&&(r=qa(Mi,r)[0],e[3]=r),s!==void 0&&!Qi(s))throw TypeError(`JWE Key Management Parameters must be an object`);Za(t,n,r);let l={...t,...n,...r};Ga(Mi,t),Ka(Mi,Wa,c,t,l),Ja(l,t);let{alg:u,enc:d}=l;if(typeof u!=`string`||!u)throw new Mi(`JWE "alg" (Algorithm) Header Parameter missing or invalid`);if(typeof d!=`string`||!d)throw new Mi(`JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid`);return[l,u,d,Ma(d)]}async function $a(e,t,n){let[r,i,,a]=t,[o,s,c,l,u,d,f,p,,m]=e,h=s,g=c;if(d&&(i===`dir`||i===`ECDH-ES`))throw TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${i}`);let _=ja(i),[v,y,b]=await Ua(i,a,await va(i===`dir`?a:_,n,`encrypt`),d,p);b&&(m?g=g?{...g,...b}:b:h=h?{...h,...b}:b,Za(h,g,l));let x,S;h?(x=Xi(JSON.stringify(h)),S=Si(x)):(x=``,S=new Uint8Array);let C,w;u?.byteLength?(w=Xi(u),C=vi(S,Si(`.`),Si(w))):C=S;let ee=o;r.zip===`DEF`&&(ee=await Xa(ee).catch(e=>{throw new Mi(`Failed to compress plaintext`,{cause:e})}));let{ciphertext:T,tag:te,iv:ne}=await Gi(a,ee,v,f,C),E={ciphertext:Xi(T)};return ne&&(E.iv=Xi(ne)),te&&(E.tag=Xi(te)),y&&(E.encrypted_key=Xi(y)),w&&(E.aad=w),h&&(E.protected=x),l&&(E.unprotected=l),g&&(E.header=g),E}async function eo(e,t,n){if(!e[1]&&!e[2]&&!e[3])throw new Mi(`either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()`);return n!==void 0&&(e[8]=n?.crit,e[9]=n?ea in n:!1),$a(e,Qa(e),t)}var to=[[`verify`],[`sign`]];function no(e){let t={name:`HMAC`,hash:`SHA-${e}`};return{kty:[`oct`],secret:!0,subtle:t,signing:t,usages:to}}function ro(e,t){let n={name:t?`RSA-PSS`:`RSASSA-PKCS1-v1_5`,hash:`SHA-${e}`};return{kty:[`RSA`],subtle:n,signing:t?{...n,saltLength:t}:n,usages:to,minRsaBits:2048}}function io(e,t){return{kty:[`EC`],crv:e,subtle:{name:`ECDSA`,namedCurve:e},signing:{name:`ECDSA`,hash:`SHA-${t}`},usages:to}}function ao(){let e={name:`Ed25519`};return{kty:[`OKP`],crv:`Ed25519`,subtle:e,signing:e,usages:to}}function oo(e){let t={name:`ML-DSA-${e}`};return{kty:[`AKP`],subtle:t,signing:t,usages:to}}var so=L({HS256:no(256),HS384:no(384),HS512:no(512),RS256:ro(256),RS384:ro(384),RS512:ro(512),PS256:ro(256,32),PS384:ro(384,48),PS512:ro(512,64),ES256:io(`P-256`,256),ES384:io(`P-384`,384),ES512:io(`P-521`,512),EdDSA:ao(),Ed25519:ao(),"ML-DSA-44":oo(44),"ML-DSA-65":oo(65),"ML-DSA-87":oo(87)}),co=class{#e;#t;#n;#r;#i;constructor(e){Zi(e,`plaintext`),this.#e=e}setContentEncryptionKey(e){return ta(this.#n,`setContentEncryptionKey`),this.#n=e,this}setInitializationVector(e){return ta(this.#r,`setInitializationVector`),this.#r=e,this}setProtectedHeader(e){return ta(this.#t,`setProtectedHeader`),this.#t=e,this}setKeyManagementParameters(e){return ta(this.#i,`setKeyManagementParameters`),this.#i=e,this}async encrypt(e,t){let n=await eo([this.#e,this.#t,void 0,void 0,void 0,this.#n,this.#r,this.#i,void 0,!1],e,t);return[n.protected,n.encrypted_key,n.iv,n.ciphertext,n.tag].join(`.`)}};function lo(e=`JWK "alg" (Algorithm) Parameter`){throw new ji(`Invalid or unsupported ${e} value`)}function uo(e,t){return(typeof e==`string`?so[e]??Ea[e]:void 0)??lo(t)}function fo(e){if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`"extractable" option must be a boolean`);return e}async function po(e,t,n){if(!Qi(e))throw TypeError(`JWK must be an object`);let r=aa(e),i=fo(n?.extractable),{alg:a}=r;t??=a;let o=i??r.ext;if(r.kty!==`oct`&&!t)throw TypeError(`"alg" argument is required when "jwk.alg" is not present`);switch(r.kty){case`oct`:if(typeof r.k!=`string`)throw TypeError(`missing "k" (Key Value) Parameter value`);return Yi(r.k);case`AKP`:if(typeof a!=`string`||!a)throw TypeError(`missing "alg" (Algorithm) Parameter value`);if(t!==a)throw TypeError(`JWK alg and alg option value mismatch`);return ra(uo(t),{...r,ext:o});case`RSA`:case`EC`:case`OKP`:return ra(uo(t),{...r,alg:t,ext:o});default:throw new ji(`Unsupported "kty" (Key Type) Parameter value`)}}var mo=u(mi(),1),ho={jwkToPublicKey:async e=>await po(e,`RSA-OAEP`),encryptPayload:async(e,t)=>await new co(new TextEncoder().encode(e)).setProtectedHeader({alg:`RSA-OAEP`,enc:`A256GCM`}).encrypt(t)};ho.createJWT=async(e,t=void 0)=>{let n=xp(JSON.stringify(e)),r,i=``;return t?(i=xp(JSON.stringify({typ:`JWT`,kid:Cp(t),alg:`HS256`})),r=wp([i,n].join(`.`),t,`base64url`)):i=xp(JSON.stringify({typ:`JWT`,alg:`none`})),[i,n,r].join(`.`)},ho.parseJWT=e=>{let[t,n,r]=e.split(`.`);return{header:JSON.parse(Sp(t)),body:JSON.parse(Sp(n)),signature:r}};var go;function R(){return go.apply(null,arguments)}function _o(e){go=e}function vo(e){return e instanceof Array||Object.prototype.toString.call(e)===`[object Array]`}function yo(e){return e!=null&&Object.prototype.toString.call(e)===`[object Object]`}function z(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function bo(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;for(var t in e)if(z(e,t))return!1;return!0}function xo(e){return e===void 0}function So(e){return typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`}function Co(e){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`}function wo(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function To(e,t){for(var n in t)z(t,n)&&(e[n]=t[n]);return z(t,`toString`)&&(e.toString=t.toString),z(t,`valueOf`)&&(e.valueOf=t.valueOf),e}function Eo(e,t,n,r){return eu(e,t,n,r,!0).utc()}function Do(){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 B(e){return e._pf??=Do(),e._pf}var Oo=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function ko(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=B(e),n=Oo.call(t.parsedDateParts,function(e){return e!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function Ao(e){var t=Eo(NaN);return e==null?B(t).userInvalidated=!0:To(B(t),e),t}var jo=R.momentProperties=[],Mo=!1;function No(e,t){var n,r,i,a=jo.length;if(xo(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),xo(t._i)||(e._i=t._i),xo(t._f)||(e._f=t._f),xo(t._l)||(e._l=t._l),xo(t._strict)||(e._strict=t._strict),xo(t._tzm)||(e._tzm=t._tzm),xo(t._isUTC)||(e._isUTC=t._isUTC),xo(t._offset)||(e._offset=t._offset),xo(t._pf)||(e._pf=B(t)),xo(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=jo[n],i=t[r],xo(i)||(e[r]=i);return e}function Po(e){No(this,e),this._d=new Date(e._d==null?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),Mo===!1&&(Mo=!0,R.updateOffset(this),Mo=!1)}function Fo(e){return e instanceof Po||e!=null&&e._isAMomentObject!=null}function Io(e){R.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+e)}function Lo(e,t){var n=!0;return To(function(){if(R.deprecationHandler!=null&&R.deprecationHandler(null,e),n){var r=[],i,a,o,s=arguments.length;for(a=0;a<s;a++){if(i=``,typeof arguments[a]==`object`){for(o in i+=`
|
|
30
|
+
[`+a+`] `,arguments[0])z(arguments[0],o)&&(i+=o+`: `+arguments[0][o]+`, `);i=i.slice(0,-2)}else i=arguments[a];r.push(i)}Io(e+`
|
|
31
|
+
Arguments: `+Array.prototype.slice.call(r).join(``)+`
|
|
32
|
+
`+Error().stack),n=!1}return t.apply(this,arguments)},t)}var Ro={};function V(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),Ro[e]||(Io(t),Ro[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function zo(e){return typeof Function<`u`&&e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}function Bo(e){var t,n;for(n in e)z(e,n)&&(t=e[n],zo(t)?this[n]=t:this[`_`+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function Vo(e,t){var n=To({},e),r;for(r in t)z(t,r)&&(yo(e[r])&&yo(t[r])?(n[r]={},To(n[r],e[r]),To(n[r],t[r])):t[r]==null?delete n[r]:n[r]=t[r]);for(r in e)z(e,r)&&!z(t,r)&&yo(e[r])&&(n[r]=To({},n[r]));return n}function Ho(e){e!=null&&this.set(e)}var Uo=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)z(e,t)&&n.push(t);return n},Wo={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`};function Go(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return zo(r)?r.call(t,n):r}function Ko(e,t,n){var r=``+Math.abs(e),i=t-r.length;return(e>=0?n?`+`:``:`-`)+(10**Math.max(0,i)).toString().substr(1)+r}var qo=/(\[[^\[]*\])|(\\)?([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,Jo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yo={},Xo={};function H(e,t,n,r){var i=r;typeof r==`string`&&(i=function(){return this[r]()}),e&&(Xo[e]=i),t&&(Xo[t[0]]=function(){return Ko(i.apply(this,arguments),t[1],t[2])}),n&&(Xo[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function Zo(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,``):e.replace(/\\/g,``)}function Qo(e){for(var t=e.match(qo),n=0,r=t.length;n<r;n++)Xo[t[n]]?t[n]=Xo[t[n]]:t[n]=Zo(t[n]);return function(n){for(var i=``,a=0;a<r;a++)i+=zo(t[a])?t[a].call(n,e):t[a];return i}}function $o(e,t){return e.isValid()?(t=es(t,e.localeData()),Yo[t]=Yo[t]||Qo(t),Yo[t](e)):e.localeData().invalidDate()}function es(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(Jo.lastIndex=0;n>=0&&Jo.test(e);)e=e.replace(Jo,r),Jo.lastIndex=0,--n;return e}var ts={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 ns(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(qo).map(function(e){return e===`MMMM`||e===`MM`||e===`DD`||e===`dddd`?e.slice(1):e}).join(``),this._longDateFormat[e])}var rs=`Invalid date`;function is(){return this._invalidDate}var as=`%d`,os=/\d{1,2}/;function ss(e){return this._ordinal.replace(`%d`,e)}var cs={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 ls(e,t,n,r){var i=this._relativeTime[n];return zo(i)?i(e,t,n,r):i.replace(/%d/i,e)}function us(e,t){var n=this._relativeTime[e>0?`future`:`past`];return zo(n)?n(t):n.replace(/%s/i,t)}var ds={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 fs(e){return typeof e==`string`?ds[e]||ds[e.toLowerCase()]:void 0}function ps(e){var t={},n,r;for(r in e)z(e,r)&&(n=fs(r),n&&(t[n]=e[r]));return t}var ms={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 hs(e){var t=[],n;for(n in e)z(e,n)&&t.push({unit:n,priority:ms[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}var gs=/\d/,_s=/\d\d/,vs=/\d{3}/,ys=/\d{4}/,bs=/[+-]?\d{6}/,xs=/\d\d?/,Ss=/\d\d\d\d?/,Cs=/\d\d\d\d\d\d?/,ws=/\d{1,3}/,Ts=/\d{1,4}/,Es=/[+-]?\d{1,6}/,Ds=/\d+/,Os=/[+-]?\d+/,ks=/Z|[+-]\d\d:?\d\d/gi,As=/Z|[+-]\d\d(?::?\d\d)?/gi,js=/[+-]?\d+(\.\d{1,3})?/,Ms=/[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,Ns=/^[1-9]\d?/,Ps=/^([1-9]\d|\d)/,Fs={};function U(e,t,n){Fs[e]=zo(t)?t:function(e,r){return e&&n?n:t}}function Is(e,t){return z(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Ls(e))}function Ls(e){return Rs(e.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function Rs(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function zs(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=zs(t)),n}var Bs={};function Vs(e,t){var n,r=t,i;for(typeof e==`string`&&(e=[e]),So(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n<i;n++)Bs[e[n]]=r}function Hs(e,t){Vs(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Us(e,t,n){t!=null&&z(Bs,e)&&Bs[e](t,n._a,n,e)}function Ws(e){return e%4==0&&e%100!=0||e%400==0}var Gs=0,Ks=1,qs=2,Js=3,Ys=4,Xs=5,Zs=6,Qs=7,$s=8;H(`Y`,0,0,function(){var e=this.year();return e<=9999?Ko(e,4):`+`+e}),H(0,[`YY`,2],0,function(){return this.year()%100}),H(0,[`YYYY`,4],0,`year`),H(0,[`YYYYY`,5],0,`year`),H(0,[`YYYYYY`,6,!0],0,`year`),U(`Y`,Os),U(`YY`,xs,_s),U(`YYYY`,Ts,ys),U(`YYYYY`,Es,bs),U(`YYYYYY`,Es,bs),Vs([`YYYYY`,`YYYYYY`],Gs),Vs(`YYYY`,function(e,t){t[Gs]=e.length===2?R.parseTwoDigitYear(e):W(e)}),Vs(`YY`,function(e,t){t[Gs]=R.parseTwoDigitYear(e)}),Vs(`Y`,function(e,t){t[Gs]=parseInt(e,10)});function ec(e){return Ws(e)?366:365}R.parseTwoDigitYear=function(e){return W(e)+(W(e)>68?1900:2e3)};var tc=rc(`FullYear`,!0);function nc(){return Ws(this.year())}function rc(e,t){return function(n){return n==null?ic(this,e):(ac(this,e,n),R.updateOffset(this,t),this)}}function ic(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case`Milliseconds`:return r?n.getUTCMilliseconds():n.getMilliseconds();case`Seconds`:return r?n.getUTCSeconds():n.getSeconds();case`Minutes`:return r?n.getUTCMinutes():n.getMinutes();case`Hours`:return r?n.getUTCHours():n.getHours();case`Date`:return r?n.getUTCDate():n.getDate();case`Day`:return r?n.getUTCDay():n.getDay();case`Month`:return r?n.getUTCMonth():n.getMonth();case`FullYear`:return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function ac(e,t,n){var r,i,a,o,s;if(e.isValid()&&!isNaN(n)){switch(r=e._d,i=e._isUTC,t){case`Milliseconds`:i?r.setUTCMilliseconds(n):r.setMilliseconds(n);return;case`Seconds`:i?r.setUTCSeconds(n):r.setSeconds(n);return;case`Minutes`:i?r.setUTCMinutes(n):r.setMinutes(n);return;case`Hours`:i?r.setUTCHours(n):r.setHours(n);return;case`Date`:i?r.setUTCDate(n):r.setDate(n);return;case`FullYear`:break;default:return}a=n,o=e.month(),s=e.date(),s=s===29&&o===1&&!Ws(a)?28:s,i?r.setUTCFullYear(a,o,s):r.setFullYear(a,o,s)}}function oc(e){return e=fs(e),zo(this[e])?this[e]():this}function sc(e,t){if(typeof e==`object`){e=ps(e);var n=hs(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=fs(e),zo(this[e]))return this[e](t);return this}function cc(e,t){return(e%t+t)%t}var lc=Array.prototype.indexOf?Array.prototype.indexOf:function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function uc(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=cc(t,12);return e+=(t-n)/12,n===1?Ws(e)?29:28:31-n%7%2}H(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),H(`MMM`,0,0,function(e){return this.localeData().monthsShort(this,e)}),H(`MMMM`,0,0,function(e){return this.localeData().months(this,e)}),U(`M`,xs,Ns),U(`MM`,xs,_s),U(`MMM`,function(e,t){return t.monthsShortRegex(e)}),U(`MMMM`,function(e,t){return t.monthsRegex(e)}),Vs([`M`,`MM`],function(e,t){t[Ks]=W(e)-1}),Vs([`MMM`,`MMMM`],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i==null?B(n).invalidMonth=e:t[Ks]=i});var dc=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),fc=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),pc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,mc=Ms,hc=Ms;function gc(e,t){return e?vo(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||pc).test(t)?`format`:`standalone`][e.month()]:vo(this._months)?this._months:this._months.standalone}function _c(e,t){return e?vo(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[pc.test(t)?`format`:`standalone`][e.month()]:vo(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function vc(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Eo([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,``).toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,``).toLocaleLowerCase();return n?t===`MMM`?(i=lc.call(this._shortMonthsParse,o),i===-1?null:i):(i=lc.call(this._longMonthsParse,o),i===-1?null:i):t===`MMM`?(i=lc.call(this._shortMonthsParse,o),i===-1?(i=lc.call(this._longMonthsParse,o),i===-1?null:i):i):(i=lc.call(this._longMonthsParse,o),i===-1?(i=lc.call(this._shortMonthsParse,o),i===-1?null:i):i)}function yc(e,t,n){var r,i,a;if(this._monthsParseExact)return vc.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(i=Eo([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=RegExp(`^`+this.months(i,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[r]=RegExp(`^`+this.monthsShort(i,``).replace(`.`,``)+`$`,`i`)),!n&&!this._monthsParse[r]&&(a=`^`+this.months(i,``)+`|^`+this.monthsShort(i,``),this._monthsParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`MMMM`&&this._longMonthsParse[r].test(e)||n&&t===`MMM`&&this._shortMonthsParse[r].test(e)||!n&&this._monthsParse[r].test(e))return r}function bc(e,t){if(!e.isValid())return e;if(typeof t==`string`){if(/^\d+$/.test(t))t=W(t);else if(t=e.localeData().monthsParse(t),!So(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,uc(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function xc(e){return e==null?ic(this,`Month`):(bc(this,e),R.updateOffset(this,!0),this)}function Sc(){return uc(this.year(),this.month())}function Cc(e){return this._monthsParseExact?(z(this,`_monthsRegex`)||Tc.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(z(this,`_monthsShortRegex`)||(this._monthsShortRegex=mc),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function wc(e){return this._monthsParseExact?(z(this,`_monthsRegex`)||Tc.call(this),e?this._monthsStrictRegex:this._monthsRegex):(z(this,`_monthsRegex`)||(this._monthsRegex=hc),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Tc(){function e(e,t){return t.length-e.length}for(var t=[],n=[],r=[],i=0,a,o,s;i<12;i++)a=Eo([2e3,i]),o=Rs(this.monthsShort(a,``)),s=Rs(this.months(a,``)),t.push(o),n.push(s),r.push(s),r.push(o);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function Ec(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function Dc(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Oc(e,t,n){var r=7+t-n;return-((7+Dc(e,0,r).getUTCDay()-t)%7)+r-1}function kc(e,t,n,r,i){var a=(7+n-r)%7,o=Oc(e,r,i),s=1+7*(t-1)+a+o,c,l;return s<=0?(c=e-1,l=ec(c)+s):s>ec(e)?(c=e+1,l=s-ec(e)):(c=e,l=s),{year:c,dayOfYear:l}}function Ac(e,t,n){var r=Oc(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+jc(o,t,n)):i>jc(e.year(),t,n)?(a=i-jc(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function jc(e,t,n){var r=Oc(e,t,n),i=Oc(e+1,t,n);return(ec(e)-r+i)/7}H(`w`,[`ww`,2],`wo`,`week`),H(`W`,[`WW`,2],`Wo`,`isoWeek`),U(`w`,xs,Ns),U(`ww`,xs,_s),U(`W`,xs,Ns),U(`WW`,xs,_s),Hs([`w`,`ww`,`W`,`WW`],function(e,t,n,r){t[r.substr(0,1)]=W(e)});function Mc(e){return Ac(e,this._week.dow,this._week.doy).week}var Nc={dow:0,doy:6};function Pc(){return this._week.dow}function Fc(){return this._week.doy}function Ic(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,`d`)}function Lc(e){var t=Ac(this,1,4).week;return e==null?t:this.add((e-t)*7,`d`)}H(`d`,0,`do`,`day`),H(`dd`,0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H(`ddd`,0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H(`dddd`,0,0,function(e){return this.localeData().weekdays(this,e)}),H(`e`,0,0,`weekday`),H(`E`,0,0,`isoWeekday`),U(`d`,xs),U(`e`,xs),U(`E`,xs),U(`dd`,function(e,t){return t.weekdaysMinRegex(e)}),U(`ddd`,function(e,t){return t.weekdaysShortRegex(e)}),U(`dddd`,function(e,t){return t.weekdaysRegex(e)}),Hs([`dd`,`ddd`,`dddd`],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i==null?B(n).invalidWeekday=e:t.d=i}),Hs([`d`,`e`,`E`],function(e,t,n,r){t[r]=W(e)});function Rc(e,t){return typeof e==`string`?isNaN(e)?(e=t.weekdaysParse(e),typeof e==`number`?e:null):parseInt(e,10):e}function zc(e,t){return typeof e==`string`?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Bc(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Vc=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),Hc=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),Uc=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),Wc=Ms,Gc=Ms,Kc=Ms;function qc(e,t){var n=vo(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?`format`:`standalone`];return e===!0?Bc(n,this._week.dow):e?n[e.day()]:n}function Jc(e){return e===!0?Bc(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Yc(e){return e===!0?Bc(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Xc(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Eo([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,``).toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,``).toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,``).toLocaleLowerCase();return n?t===`dddd`?(i=lc.call(this._weekdaysParse,o),i===-1?null:i):t===`ddd`?(i=lc.call(this._shortWeekdaysParse,o),i===-1?null:i):(i=lc.call(this._minWeekdaysParse,o),i===-1?null:i):t===`dddd`?(i=lc.call(this._weekdaysParse,o),i!==-1||(i=lc.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=lc.call(this._minWeekdaysParse,o),i===-1?null:i)):t===`ddd`?(i=lc.call(this._shortWeekdaysParse,o),i!==-1||(i=lc.call(this._weekdaysParse,o),i!==-1)?i:(i=lc.call(this._minWeekdaysParse,o),i===-1?null:i)):(i=lc.call(this._minWeekdaysParse,o),i!==-1||(i=lc.call(this._weekdaysParse,o),i!==-1)?i:(i=lc.call(this._shortWeekdaysParse,o),i===-1?null:i))}function Zc(e,t,n){var r,i,a;if(this._weekdaysParseExact)return Xc.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(i=Eo([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp(`^`+this.weekdays(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[r]=RegExp(`^`+this.weekdaysShort(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[r]=RegExp(`^`+this.weekdaysMin(i,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[r]||(a=`^`+this.weekdays(i,``)+`|^`+this.weekdaysShort(i,``)+`|^`+this.weekdaysMin(i,``),this._weekdaysParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`dddd`&&this._fullWeekdaysParse[r].test(e)||n&&t===`ddd`&&this._shortWeekdaysParse[r].test(e)||n&&t===`dd`&&this._minWeekdaysParse[r].test(e)||!n&&this._weekdaysParse[r].test(e))return r}function Qc(e){if(!this.isValid())return e==null?NaN:this;var t=ic(this,`Day`);return e==null?t:(e=Rc(e,this.localeData()),this.add(e-t,`d`))}function $c(e){if(!this.isValid())return e==null?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,`d`)}function el(e){if(!this.isValid())return e==null?NaN:this;if(e!=null){var t=zc(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function tl(e){return this._weekdaysParseExact?(z(this,`_weekdaysRegex`)||il.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(z(this,`_weekdaysRegex`)||(this._weekdaysRegex=Wc),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function nl(e){return this._weekdaysParseExact?(z(this,`_weekdaysRegex`)||il.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(z(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=Gc),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function rl(e){return this._weekdaysParseExact?(z(this,`_weekdaysRegex`)||il.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(z(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=Kc),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function il(){function e(e,t){return t.length-e.length}for(var t=[],n=[],r=[],i=[],a=0,o,s,c,l;a<7;a++)o=Eo([2e3,1]).day(a),s=Rs(this.weekdaysMin(o,``)),c=Rs(this.weekdaysShort(o,``)),l=Rs(this.weekdays(o,``)),t.push(s),n.push(c),r.push(l),i.push(s),i.push(c),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=RegExp(`^(`+i.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function al(){return this.hours()%12||12}function ol(){return this.hours()||24}H(`H`,[`HH`,2],0,`hour`),H(`h`,[`hh`,2],0,al),H(`k`,[`kk`,2],0,ol),H(`hmm`,0,0,function(){return``+al.apply(this)+Ko(this.minutes(),2)}),H(`hmmss`,0,0,function(){return``+al.apply(this)+Ko(this.minutes(),2)+Ko(this.seconds(),2)}),H(`Hmm`,0,0,function(){return``+this.hours()+Ko(this.minutes(),2)}),H(`Hmmss`,0,0,function(){return``+this.hours()+Ko(this.minutes(),2)+Ko(this.seconds(),2)});function sl(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}sl(`a`,!0),sl(`A`,!1);function cl(e,t){return t._meridiemParse}U(`a`,cl),U(`A`,cl),U(`H`,xs,Ps),U(`h`,xs,Ns),U(`k`,xs,Ns),U(`HH`,xs,_s),U(`hh`,xs,_s),U(`kk`,xs,_s),U(`hmm`,Ss),U(`hmmss`,Cs),U(`Hmm`,Ss),U(`Hmmss`,Cs),Vs([`H`,`HH`],Js),Vs([`k`,`kk`],function(e,t,n){var r=W(e);t[Js]=r===24?0:r}),Vs([`a`,`A`],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Vs([`h`,`hh`],function(e,t,n){t[Js]=W(e),B(n).bigHour=!0}),Vs(`hmm`,function(e,t,n){var r=e.length-2;t[Js]=W(e.substr(0,r)),t[Ys]=W(e.substr(r)),B(n).bigHour=!0}),Vs(`hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[Js]=W(e.substr(0,r)),t[Ys]=W(e.substr(r,2)),t[Xs]=W(e.substr(i)),B(n).bigHour=!0}),Vs(`Hmm`,function(e,t,n){var r=e.length-2;t[Js]=W(e.substr(0,r)),t[Ys]=W(e.substr(r))}),Vs(`Hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[Js]=W(e.substr(0,r)),t[Ys]=W(e.substr(r,2)),t[Xs]=W(e.substr(i))});function ll(e){return(e+``).toLowerCase().charAt(0)===`p`}var ul=/[ap]\.?m?\.?/i,dl=rc(`Hours`,!0);function fl(e,t,n){return e>11?n?`pm`:`PM`:n?`am`:`AM`}var pl={calendar:Wo,longDateFormat:ts,invalidDate:rs,ordinal:as,dayOfMonthOrdinalParse:os,relativeTime:cs,months:dc,monthsShort:fc,week:Nc,weekdays:Vc,weekdaysMin:Uc,weekdaysShort:Hc,meridiemParse:ul},ml={},hl={},gl;function _l(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function vl(e){return e&&e.toLowerCase().replace(`_`,`-`)}function yl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=vl(e[t]).split(`-`),n=a.length,r=vl(e[t+1]),r=r?r.split(`-`):null;n>0;){if(i=xl(a.slice(0,n).join(`-`)),i)return i;if(r&&r.length>=n&&_l(a,r)>=n-1)break;n--}t++}return gl}function bl(e){return!!(e&&e.match(`^[^/\\\\]*$`))}function xl(e){var t=null,n;if(ml[e]===void 0&&typeof module<`u`&&module&&module.exports&&bl(e))try{t=gl._abbr,n=require,n(`./locale/`+e),Sl(t)}catch{ml[e]=null}return ml[e]}function Sl(e,t){var n;return e&&(n=xo(t)?Tl(e):Cl(e,t),n?gl=n:typeof console<`u`&&console.warn&&console.warn(`Locale `+e+` not found. Did you forget to load it?`)),gl._abbr}function Cl(e,t){if(t!==null){var n,r=pl;if(t.abbr=e,ml[e]!=null)V(`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.`),r=ml[e]._config;else if(t.parentLocale!=null){if(ml[t.parentLocale]!=null)r=ml[t.parentLocale]._config;else if(n=xl(t.parentLocale),n!=null)r=n._config;else return hl[t.parentLocale]||(hl[t.parentLocale]=[]),hl[t.parentLocale].push({name:e,config:t}),null}return ml[e]=new Ho(Vo(r,t)),hl[e]&&hl[e].forEach(function(e){Cl(e.name,e.config)}),Sl(e),ml[e]}return delete ml[e],null}function wl(e,t){if(t!=null){var n,r,i=pl;ml[e]!=null&&ml[e].parentLocale!=null?ml[e].set(Vo(ml[e]._config,t)):(r=xl(e),r!=null&&(i=r._config),t=Vo(i,t),r??(t.abbr=e),n=new Ho(t),n.parentLocale=ml[e],ml[e]=n),Sl(e)}else ml[e]!=null&&(ml[e].parentLocale==null?ml[e]!=null&&delete ml[e]:(ml[e]=ml[e].parentLocale,e===Sl()&&Sl(e)));return ml[e]}function Tl(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return gl;if(!vo(e)){if(t=xl(e),t)return t;e=[e]}return yl(e)}function El(){return Uo(ml)}function Dl(e){var t,n=e._a;return n&&B(e).overflow===-2&&(t=n[Ks]<0||n[Ks]>11?Ks:n[qs]<1||n[qs]>uc(n[Gs],n[Ks])?qs:n[Js]<0||n[Js]>24||n[Js]===24&&(n[Ys]!==0||n[Xs]!==0||n[Zs]!==0)?Js:n[Ys]<0||n[Ys]>59?Ys:n[Xs]<0||n[Xs]>59?Xs:n[Zs]<0||n[Zs]>999?Zs:-1,B(e)._overflowDayOfYear&&(t<Gs||t>qs)&&(t=qs),B(e)._overflowWeeks&&t===-1&&(t=Qs),B(e)._overflowWeekday&&t===-1&&(t=$s),B(e).overflow=t),e}var Ol=/^\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)?)?$/,kl=/^\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)?)?$/,Al=/Z|[+-]\d\d(?::?\d\d)?/,jl=[[`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]],Ml=[[`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/]],Nl=/^\/?Date\((-?\d+)/i,Pl=/^(?:(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}))$/,Fl={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Il(e){var t,n,r=e._i,i=Ol.exec(r)||kl.exec(r),a,o,s,c,l=jl.length,u=Ml.length;if(i){for(B(e).iso=!0,t=0,n=l;t<n;t++)if(jl[t][1].exec(i[1])){o=jl[t][0],a=jl[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=u;t<n;t++)if(Ml[t][1].exec(i[3])){s=(i[2]||` `)+Ml[t][0];break}if(s==null){e._isValid=!1;return}}if(!a&&s!=null){e._isValid=!1;return}if(i[4]){if(Al.exec(i[4]))c=`Z`;else{e._isValid=!1;return}}e._f=o+(s||``)+(c||``),Jl(e)}else e._isValid=!1}function Ll(e,t,n,r,i,a){var o=[Rl(e),fc.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}function Rl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function zl(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Bl(e,t,n){return e&&Hc.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay()?(B(n).weekdayMismatch=!0,n._isValid=!1,!1):!0}function Vl(e,t,n){if(e)return Fl[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}function Hl(e){var t=Pl.exec(zl(e._i)),n;if(t){if(n=Ll(t[4],t[3],t[2],t[5],t[6],t[7]),!Bl(t[1],n,e))return;e._a=n,e._tzm=Vl(t[8],t[9],t[10]),e._d=Dc.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),B(e).rfc2822=!0}else e._isValid=!1}function Ul(e){var t=Nl.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Il(e),e._isValid===!1)delete e._isValid;else return;if(Hl(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=Lo(`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(e){e._d=new Date(e._i+(e._useUTC?` UTC`:``))});function Wl(e,t,n){return e??t??n}function Gl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Kl(e){var t,n,r=[],i,a,o;if(!e._d){for(i=Gl(e),e._w&&e._a[qs]==null&&e._a[Ks]==null&&ql(e),e._dayOfYear!=null&&(o=Wl(e._a[Gs],i[Gs]),(e._dayOfYear>ec(o)||e._dayOfYear===0)&&(B(e)._overflowDayOfYear=!0),n=Dc(o,0,e._dayOfYear),e._a[Ks]=n.getUTCMonth(),e._a[qs]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?+(t===2):e._a[t];e._a[Js]===24&&e._a[Ys]===0&&e._a[Xs]===0&&e._a[Zs]===0&&(e._nextDay=!0,e._a[Js]=0),e._d=(e._useUTC?Dc:Ec).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Js]=24),e._w&&e._w.d!==void 0&&e._w.d!==a&&(B(e).weekdayMismatch=!0)}}function ql(e){var t=e._w,n,r,i,a,o,s,c,l;t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Wl(t.GG,e._a[Gs],Ac(K(),1,4).year),r=Wl(t.W,1),i=Wl(t.E,1),(i<1||i>7)&&(c=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,l=Ac(K(),a,o),n=Wl(t.gg,e._a[Gs],l.year),r=Wl(t.w,l.week),t.d==null?t.e==null?i=a:(i=t.e+a,(t.e<0||t.e>6)&&(c=!0)):(i=t.d,(i<0||i>6)&&(c=!0))),r<1||r>jc(n,a,o)?B(e)._overflowWeeks=!0:c==null?(s=kc(n,r,i,a,o),e._a[Gs]=s.year,e._dayOfYear=s.dayOfYear):B(e)._overflowWeekday=!0}R.ISO_8601=function(){},R.RFC_2822=function(){};function Jl(e){if(e._f===R.ISO_8601){Il(e);return}if(e._f===R.RFC_2822){Hl(e);return}e._a=[],B(e).empty=!0;var t=``+e._i,n,r,i,a,o,s=t.length,c=0,l,u;for(i=es(e._f,e._locale).match(qo)||[],u=i.length,n=0;n<u;n++)a=i[n],r=(t.match(Is(a,e))||[])[0],r&&(o=t.substr(0,t.indexOf(r)),o.length>0&&B(e).unusedInput.push(o),t=t.slice(t.indexOf(r)+r.length),c+=r.length),Xo[a]?(r?B(e).empty=!1:B(e).unusedTokens.push(a),Us(a,r,e)):e._strict&&!r&&B(e).unusedTokens.push(a);B(e).charsLeftOver=s-c,t.length>0&&B(e).unusedInput.push(t),e._a[Js]<=12&&B(e).bigHour===!0&&e._a[Js]>0&&(B(e).bigHour=void 0),B(e).parsedDateParts=e._a.slice(0),B(e).meridiem=e._meridiem,e._a[Js]=Yl(e._locale,e._a[Js],e._meridiem),l=B(e).era,l!==null&&(e._a[Gs]=e._locale.erasConvertYear(l,e._a[Gs])),Kl(e),Dl(e)}function Yl(e,t,n){var r;return n==null?t:e.meridiemHour==null?e.isPM==null?t:(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):e.meridiemHour(t,n)}function Xl(e){var t,n,r,i,a,o,s=!1,c=e._f.length;if(c===0){B(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,o=!1,t=No({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Jl(t),ko(t)&&(o=!0),a+=B(t).charsLeftOver,a+=B(t).unusedTokens.length*10,B(t).score=a,s?a<r&&(r=a,n=t):(r==null||a<r||o)&&(r=a,n=t,o&&(s=!0));To(e,n||t)}function Zl(e){if(!e._d){var t=ps(e._i),n=t.day===void 0?t.date:t.day;e._a=wo([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Kl(e)}}function Ql(e){var t=new Po(Dl(G(e)));return t._nextDay&&=(t.add(1,`d`),void 0),t}function G(e){var t=e._i,n=e._f;return e._locale=e._locale||Tl(e._l),t===null||n===void 0&&t===``?Ao({nullInput:!0}):(typeof t==`string`&&(e._i=t=e._locale.preparse(t)),Fo(t)?new Po(Dl(t)):(Co(t)?e._d=t:vo(n)?Xl(e):n?Jl(e):$l(e),ko(e)||(e._d=null),e))}function $l(e){var t=e._i;xo(t)?e._d=new Date(R.now()):Co(t)?e._d=new Date(t.valueOf()):typeof t==`string`?Ul(e):vo(t)?(e._a=wo(t.slice(0),function(e){return parseInt(e,10)}),Kl(e)):yo(t)?Zl(e):So(t)?e._d=new Date(t):R.createFromInputFallback(e)}function eu(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(yo(e)&&bo(e)||vo(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,Ql(a)}function K(e,t,n,r){return eu(e,t,n,r,!1)}var tu=Lo(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=K.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Ao()}),nu=Lo(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=K.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Ao()});function ru(e,t){var n,r;if(t.length===1&&vo(t[0])&&(t=t[0]),!t.length)return K();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function iu(){return ru(`isBefore`,[].slice.call(arguments,0))}function au(){return ru(`isAfter`,[].slice.call(arguments,0))}var ou=function(){return Date.now?Date.now():+new Date},su=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`];function cu(e){var t,n=!1,r,i=su.length;for(t in e)if(z(e,t)&&(lc.call(su,t)===-1||e[t]!=null&&isNaN(e[t])))return!1;for(r=0;r<i;++r)if(e[su[r]]){if(n)return!1;parseFloat(e[su[r]])!==W(e[su[r]])&&(n=!0)}return!0}function lu(){return this._isValid}function uu(){return Nu(NaN)}function du(e){var t=ps(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=cu(t),this._milliseconds=+u+l*1e3+c*6e4+s*1e3*60*60,this._days=+o+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=Tl(),this._bubble()}function fu(e){return e instanceof du}function pu(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function mu(e,t,n){for(var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&W(e[o])!==W(t[o]))&&a++;return a+i}function hu(e,t){H(e,0,0,function(){var e=this.utcOffset(),n=`+`;return e<0&&(e=-e,n=`-`),n+Ko(~~(e/60),2)+t+Ko(~~e%60,2)})}hu(`Z`,`:`),hu(`ZZ`,``),U(`Z`,As),U(`ZZ`,As),Vs([`Z`,`ZZ`],function(e,t,n){n._useUTC=!0,n._tzm=_u(As,e)});var gu=/([\+\-]|\d\d)/gi;function _u(e,t){var n=(t||``).match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+``).match(gu)||[`-`,0,0],a=+(i[1]*60)+W(i[2]),a===0?0:i[0]===`+`?a:-a)}function vu(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Fo(e)||Co(e)?e.valueOf():K(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):K(e).local()}function yu(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function bu(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e==null?NaN:this;if(e!=null){if(typeof e==`string`){if(e=_u(As,e),e===null)return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=yu(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,`m`),r!==e&&(!t||this._changeInProgress?Lu(this,Nu(e-r,`m`),1,!1):this._changeInProgress||=(this._changeInProgress=!0,R.updateOffset(this,!0),null)),this}return this._isUTC?r:yu(this)}function xu(e,t){return e==null?-this.utcOffset():(typeof e!=`string`&&(e=-e),this.utcOffset(e,t),this)}function Su(e){return this.utcOffset(0,e)}function Cu(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(yu(this),`m`)),this}function wu(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var e=_u(ks,this._i);e==null?this.utcOffset(0,!0):this.utcOffset(e)}return this}function Tu(e){return this.isValid()?(e=e?K(e).utcOffset():0,(this.utcOffset()-e)%60==0):!1}function Eu(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Du(){if(!xo(this._isDSTShifted))return this._isDSTShifted;var e={},t;return No(e,this),e=G(e),e._a?(t=e._isUTC?Eo(e._a):K(e._a),this._isDSTShifted=this.isValid()&&mu(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ou(){return this.isValid()?!this._isUTC:!1}function ku(){return this.isValid()?this._isUTC:!1}function Au(){return this.isValid()?this._isUTC&&this._offset===0:!1}var ju=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Mu=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Nu(e,t){var n=e,r=null,i,a,o;return fu(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:So(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=ju.exec(e))?(i=r[1]===`-`?-1:1,n={y:0,d:W(r[qs])*i,h:W(r[Js])*i,m:W(r[Ys])*i,s:W(r[Xs])*i,ms:W(pu(r[Zs]*1e3))*i}):(r=Mu.exec(e))?(i=r[1]===`-`?-1:1,n={y:Pu(r[2],i),M:Pu(r[3],i),w:Pu(r[4],i),d:Pu(r[5],i),h:Pu(r[6],i),m:Pu(r[7],i),s:Pu(r[8],i)}):n==null?n={}:typeof n==`object`&&(`from`in n||`to`in n)&&(o=Iu(K(n.from),K(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),a=new du(n),fu(e)&&z(e,`_locale`)&&(a._locale=e._locale),fu(e)&&z(e,`_isValid`)&&(a._isValid=e._isValid),a}Nu.fn=du.prototype,Nu.invalid=uu;function Pu(e,t){var n=e&&parseFloat(e.replace(`,`,`.`));return(isNaN(n)?0:n)*t}function Fu(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,`M`).isAfter(t)&&--n.months,n.milliseconds=+t-e.clone().add(n.months,`M`),n}function Iu(e,t){var n;return e.isValid()&&t.isValid()?(t=vu(t,e),e.isBefore(t)?n=Fu(e,t):(n=Fu(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function q(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(V(t,`moment().`+t+`(period, number) is deprecated. Please use moment().`+t+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),a=n,n=r,r=a),i=Nu(n,r),Lu(this,i,e),this}}function Lu(e,t,n,r){var i=t._milliseconds,a=pu(t._days),o=pu(t._months);e.isValid()&&(r??=!0,o&&bc(e,ic(e,`Month`)+o*n),a&&ac(e,`Date`,ic(e,`Date`)+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||o))}var Ru=q(1,`add`),zu=q(-1,`subtract`);function Bu(e){return typeof e==`string`||e instanceof String}function J(e){return Fo(e)||Co(e)||Bu(e)||So(e)||Hu(e)||Vu(e)||e==null}function Vu(e){var t=yo(e)&&!bo(e),n=!1,r=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],i,a,o=r.length;for(i=0;i<o;i+=1)a=r[i],n||=z(e,a);return t&&n}function Hu(e){var t=vo(e),n=!1;return t&&(n=e.filter(function(t){return!So(t)&&Bu(e)}).length===0),t&&n}function Uu(e){for(var t=yo(e)&&!bo(e),n=!1,r=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],i=0,a;i<r.length;i+=1)a=r[i],n||=z(e,a);return t&&n}function Wu(e,t){var n=e.diff(t,`days`,!0);return n<-6?`sameElse`:n<-1?`lastWeek`:n<0?`lastDay`:n<1?`sameDay`:n<2?`nextDay`:n<7?`nextWeek`:`sameElse`}function Gu(e,t){arguments.length===1&&(arguments[0]?J(arguments[0])?(e=arguments[0],t=void 0):Uu(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||K(),r=vu(n,this).startOf(`day`),i=R.calendarFormat(this,r)||`sameElse`,a=t&&(zo(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,K(n)))}function Ku(){return new Po(this)}function qu(e,t){var n=Fo(e)?e:K(e);return this.isValid()&&n.isValid()?(t=fs(t)||`millisecond`,t===`millisecond`?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Ju(e,t){var n=Fo(e)?e:K(e);return this.isValid()&&n.isValid()?(t=fs(t)||`millisecond`,t===`millisecond`?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Yu(e,t,n,r){var i=Fo(e)?e:K(e),a=Fo(t)?t:K(t);return this.isValid()&&i.isValid()&&a.isValid()?(r||=`()`,(r[0]===`(`?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===`)`?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Xu(e,t){var n=Fo(e)?e:K(e),r;return this.isValid()&&n.isValid()?(t=fs(t)||`millisecond`,t===`millisecond`?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Zu(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qu(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function $u(e,t,n){var r,i,a;if(!this.isValid()||(r=vu(e,this),!r.isValid()))return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=fs(t),t){case`year`:a=ed(this,r)/12;break;case`month`:a=ed(this,r);break;case`quarter`:a=ed(this,r)/3;break;case`second`:a=(this-r)/1e3;break;case`minute`:a=(this-r)/6e4;break;case`hour`:a=(this-r)/36e5;break;case`day`:a=(this-r-i)/864e5;break;case`week`:a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:zs(a)}function ed(e,t){if(e.date()<t.date())return-ed(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,`months`),i,a;return t-r<0?(i=e.clone().add(n-1,`months`),a=(t-r)/(r-i)):(i=e.clone().add(n+1,`months`),a=(t-r)/(i-r)),-(n+a)||0}R.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,R.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`;function td(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function nd(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?$o(n,t?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):zo(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,$o(n,`Z`)):$o(n,t?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function rd(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var e=`moment`,t=``,n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,t=`Z`),n=`[`+e+`("]`,r=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,i=`-MM-DD[T]HH:mm:ss.SSS`,a=t+`[")]`,this.format(n+r+i+a)}function id(e){e||=this.isUtc()?R.defaultFormatUtc:R.defaultFormat;var t=$o(this,e);return this.localeData().postformat(t)}function ad(e,t){return this.isValid()&&(Fo(e)&&e.isValid()||K(e).isValid())?Nu({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function od(e){return this.from(K(),e)}function sd(e,t){return this.isValid()&&(Fo(e)&&e.isValid()||K(e).isValid())?Nu({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function cd(e){return this.to(K(),e)}function ld(e){var t;return e===void 0?this._locale._abbr:(t=Tl(e),t!=null&&(this._locale=t),this)}var ud=Lo(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(e){return e===void 0?this.localeData():this.locale(e)});function dd(){return this._locale}var fd=1e3,pd=60*fd,md=60*pd,hd=3506328*md;function gd(e,t){return(e%t+t)%t}function _d(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hd:new Date(e,t,n).valueOf()}function vd(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hd:Date.UTC(e,t,n)}function yd(e){var t,n;if(e=fs(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(n=this._isUTC?vd:_d,e){case`year`:t=n(this.year(),0,1);break;case`quarter`:t=n(this.year(),this.month()-this.month()%3,1);break;case`month`:t=n(this.year(),this.month(),1);break;case`week`:t=n(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:t=n(this.year(),this.month(),this.date());break;case`hour`:t=this._d.valueOf(),t-=gd(t+(this._isUTC?0:this.utcOffset()*pd),md);break;case`minute`:t=this._d.valueOf(),t-=gd(t,pd);break;case`second`:t=this._d.valueOf(),t-=gd(t,fd)}return this._d.setTime(t),R.updateOffset(this,!0),this}function bd(e){var t,n;if(e=fs(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(n=this._isUTC?vd:_d,e){case`year`:t=n(this.year()+1,0,1)-1;break;case`quarter`:t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:t=n(this.year(),this.month()+1,1)-1;break;case`week`:t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:t=n(this.year(),this.month(),this.date()+1)-1;break;case`hour`:t=this._d.valueOf(),t+=md-gd(t+(this._isUTC?0:this.utcOffset()*pd),md)-1;break;case`minute`:t=this._d.valueOf(),t+=pd-gd(t,pd)-1;break;case`second`:t=this._d.valueOf(),t+=fd-gd(t,fd)-1}return this._d.setTime(t),R.updateOffset(this,!0),this}function xd(){return this._d.valueOf()-(this._offset||0)*6e4}function Sd(){return Math.floor(this.valueOf()/1e3)}function Cd(){return new Date(this.valueOf())}function wd(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Td(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ed(){return this.isValid()?this.toISOString():null}function Dd(){return ko(this)}function Od(){return To({},B(this))}function kd(){return B(this).overflow}function Ad(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H(`N`,0,0,`eraAbbr`),H(`NN`,0,0,`eraAbbr`),H(`NNN`,0,0,`eraAbbr`),H(`NNNN`,0,0,`eraName`),H(`NNNNN`,0,0,`eraNarrow`),H(`y`,[`y`,1],`yo`,`eraYear`),H(`y`,[`yy`,2],0,`eraYear`),H(`y`,[`yyy`,3],0,`eraYear`),H(`y`,[`yyyy`,4],0,`eraYear`),U(`N`,Vd),U(`NN`,Vd),U(`NNN`,Vd),U(`NNNN`,Hd),U(`NNNNN`,Ud),Vs([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?B(n).era=i:B(n).invalidEra=e}),U(`y`,Ds),U(`yy`,Ds),U(`yyy`,Ds),U(`yyyy`,Ds),U(`yo`,Wd),Vs([`y`,`yy`,`yyy`,`yyyy`],Gs),Vs([`yo`],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),t[Gs]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,i):parseInt(e,10)});function jd(e,t){var n,r,i,a=this._eras||Tl(`en`)._eras;for(n=0,r=a.length;n<r;++n)switch(typeof a[n].since==`string`&&(i=R(a[n].since).startOf(`day`),a[n].since=i.valueOf()),typeof a[n].until){case`undefined`:a[n].until=1/0;break;case`string`:i=R(a[n].until).startOf(`day`).valueOf(),a[n].until=i.valueOf()}return a}function Md(e,t,n){var r,i,a=this.eras(),o,s,c;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(o=a[r].name.toUpperCase(),s=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case`N`:case`NN`:case`NNN`:if(s===e)return a[r];break;case`NNNN`:if(o===e)return a[r];break;case`NNNNN`:if(c===e)return a[r]}else if([o,s,c].indexOf(e)>=0)return a[r]}function Nd(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}function Pd(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return``}function Fd(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return``}function Id(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return``}function Ld(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf(`day`).valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-R(i[e].since).year())*n+i[e].offset;return this.year()}function Rd(e){return z(this,`_erasNameRegex`)||Gd.call(this),e?this._erasNameRegex:this._erasRegex}function zd(e){return z(this,`_erasAbbrRegex`)||Gd.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bd(e){return z(this,`_erasNarrowRegex`)||Gd.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vd(e,t){return t.erasAbbrRegex(e)}function Hd(e,t){return t.erasNameRegex(e)}function Ud(e,t){return t.erasNarrowRegex(e)}function Wd(e,t){return t._eraYearOrdinalRegex||Ds}function Gd(){var e=[],t=[],n=[],r=[],i,a,o,s,c,l=this.eras();for(i=0,a=l.length;i<a;++i)o=Rs(l[i].name),s=Rs(l[i].abbr),c=Rs(l[i].narrow),t.push(o),e.push(s),n.push(c),r.push(o),r.push(s),r.push(c);this._erasRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+e.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`)}H(0,[`gg`,2],0,function(){return this.weekYear()%100}),H(0,[`GG`,2],0,function(){return this.isoWeekYear()%100});function Kd(e,t){H(0,[e,e.length],0,t)}Kd(`gggg`,`weekYear`),Kd(`ggggg`,`weekYear`),Kd(`GGGG`,`isoWeekYear`),Kd(`GGGGG`,`isoWeekYear`),U(`G`,Os),U(`g`,Os),U(`GG`,xs,_s),U(`gg`,xs,_s),U(`GGGG`,Ts,ys),U(`gggg`,Ts,ys),U(`GGGGG`,Es,bs),U(`ggggg`,Es,bs),Hs([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(e,t,n,r){t[r.substr(0,2)]=W(e)}),Hs([`gg`,`GG`],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function qd(e){return $d.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Jd(e){return $d.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yd(){return jc(this.year(),1,4)}function Xd(){return jc(this.isoWeekYear(),1,4)}function Zd(){var e=this.localeData()._week;return jc(this.year(),e.dow,e.doy)}function Qd(){var e=this.localeData()._week;return jc(this.weekYear(),e.dow,e.doy)}function $d(e,t,n,r,i){var a;return e==null?Ac(this,r,i).year:(a=jc(e,r,i),t>a&&(t=a),ef.call(this,e,t,n,r,i))}function ef(e,t,n,r,i){var a=kc(e,t,n,r,i),o=Dc(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}H(`Q`,0,`Qo`,`quarter`),U(`Q`,gs),Vs(`Q`,function(e,t){t[Ks]=(W(e)-1)*3});function tf(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}H(`D`,[`DD`,2],`Do`,`date`),U(`D`,xs,Ns),U(`DD`,xs,_s),U(`Do`,function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),Vs([`D`,`DD`],qs),Vs(`Do`,function(e,t){t[qs]=W(e.match(xs)[0])});var nf=rc(`Date`,!0);H(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),U(`DDD`,ws),U(`DDDD`,vs),Vs([`DDD`,`DDDD`],function(e,t,n){n._dayOfYear=W(e)});function rf(e){var t=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return e==null?t:this.add(e-t,`d`)}H(`m`,[`mm`,2],0,`minute`),U(`m`,xs,Ps),U(`mm`,xs,_s),Vs([`m`,`mm`],Ys);var af=rc(`Minutes`,!1);H(`s`,[`ss`,2],0,`second`),U(`s`,xs,Ps),U(`ss`,xs,_s),Vs([`s`,`ss`],Xs);var of=rc(`Seconds`,!1);H(`S`,0,0,function(){return~~(this.millisecond()/100)}),H(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),H(0,[`SSS`,3],0,`millisecond`),H(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),H(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),H(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),H(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),H(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),H(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),U(`S`,ws,gs),U(`SS`,ws,_s),U(`SSS`,ws,vs);for(var sf=`SSSS`,cf;sf.length<=9;sf+=`S`)U(sf,Ds);function lf(e,t){t[Zs]=W((`0.`+e)*1e3)}for(sf=`S`;sf.length<=9;sf+=`S`)Vs(sf,lf);cf=rc(`Milliseconds`,!1),H(`z`,0,0,`zoneAbbr`),H(`zz`,0,0,`zoneName`);function uf(){return this._isUTC?`UTC`:``}function df(){return this._isUTC?`Coordinated Universal Time`:``}var Y=Po.prototype;Y.add=Ru,Y.calendar=Gu,Y.clone=Ku,Y.diff=$u,Y.endOf=bd,Y.format=id,Y.from=ad,Y.fromNow=od,Y.to=sd,Y.toNow=cd,Y.get=oc,Y.invalidAt=kd,Y.isAfter=qu,Y.isBefore=Ju,Y.isBetween=Yu,Y.isSame=Xu,Y.isSameOrAfter=Zu,Y.isSameOrBefore=Qu,Y.isValid=Dd,Y.lang=ud,Y.locale=ld,Y.localeData=dd,Y.max=nu,Y.min=tu,Y.parsingFlags=Od,Y.set=sc,Y.startOf=yd,Y.subtract=zu,Y.toArray=wd,Y.toObject=Td,Y.toDate=Cd,Y.toISOString=nd,Y.inspect=rd,typeof Symbol<`u`&&Symbol.for!=null&&(Y[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),Y.toJSON=Ed,Y.toString=td,Y.unix=Sd,Y.valueOf=xd,Y.creationData=Ad,Y.eraName=Pd,Y.eraNarrow=Fd,Y.eraAbbr=Id,Y.eraYear=Ld,Y.year=tc,Y.isLeapYear=nc,Y.weekYear=qd,Y.isoWeekYear=Jd,Y.quarter=Y.quarters=tf,Y.month=xc,Y.daysInMonth=Sc,Y.week=Y.weeks=Ic,Y.isoWeek=Y.isoWeeks=Lc,Y.weeksInYear=Zd,Y.weeksInWeekYear=Qd,Y.isoWeeksInYear=Yd,Y.isoWeeksInISOWeekYear=Xd,Y.date=nf,Y.day=Y.days=Qc,Y.weekday=$c,Y.isoWeekday=el,Y.dayOfYear=rf,Y.hour=Y.hours=dl,Y.minute=Y.minutes=af,Y.second=Y.seconds=of,Y.millisecond=Y.milliseconds=cf,Y.utcOffset=bu,Y.utc=Su,Y.local=Cu,Y.parseZone=wu,Y.hasAlignedHourOffset=Tu,Y.isDST=Eu,Y.isLocal=Ou,Y.isUtcOffset=ku,Y.isUtc=Au,Y.isUTC=Au,Y.zoneAbbr=uf,Y.zoneName=df,Y.dates=Lo(`dates accessor is deprecated. Use date instead.`,nf),Y.months=Lo(`months accessor is deprecated. Use month instead`,xc),Y.years=Lo(`years accessor is deprecated. Use year instead`,tc),Y.zone=Lo(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,xu),Y.isDSTShifted=Lo(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,Du);function ff(e){return K(e*1e3)}function pf(){return K.apply(null,arguments).parseZone()}function mf(e){return e}var X=Ho.prototype;X.calendar=Go,X.longDateFormat=ns,X.invalidDate=is,X.ordinal=ss,X.preparse=mf,X.postformat=mf,X.relativeTime=ls,X.pastFuture=us,X.set=Bo,X.eras=jd,X.erasParse=Md,X.erasConvertYear=Nd,X.erasAbbrRegex=zd,X.erasNameRegex=Rd,X.erasNarrowRegex=Bd,X.months=gc,X.monthsShort=_c,X.monthsParse=yc,X.monthsRegex=wc,X.monthsShortRegex=Cc,X.week=Mc,X.firstDayOfYear=Fc,X.firstDayOfWeek=Pc,X.weekdays=qc,X.weekdaysMin=Yc,X.weekdaysShort=Jc,X.weekdaysParse=Zc,X.weekdaysRegex=tl,X.weekdaysShortRegex=nl,X.weekdaysMinRegex=rl,X.isPM=ll,X.meridiem=fl;function hf(e,t,n,r){var i=Tl(),a=Eo().set(r,t);return i[n](a,e)}function gf(e,t,n){if(So(e)&&(t=e,e=void 0),e||=``,t!=null)return hf(e,t,n,`month`);var r,i=[];for(r=0;r<12;r++)i[r]=hf(e,r,n,`month`);return i}function _f(e,t,n,r){typeof e==`boolean`?(So(t)&&(n=t,t=void 0),t||=``):(t=e,n=t,e=!1,So(t)&&(n=t,t=void 0),t||=``);var i=Tl(),a=e?i._week.dow:0,o,s=[];if(n!=null)return hf(t,(n+a)%7,r,`day`);for(o=0;o<7;o++)s[o]=hf(t,(o+a)%7,r,`day`);return s}function vf(e,t){return gf(e,t,`months`)}function yf(e,t){return gf(e,t,`monthsShort`)}function bf(e,t,n){return _f(e,t,n,`weekdays`)}function xf(e,t,n){return _f(e,t,n,`weekdaysShort`)}function Sf(e,t,n){return _f(e,t,n,`weekdaysMin`)}Sl(`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(e){var t=e%10;return e+(W(e%100/10)===1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)}}),R.lang=Lo(`moment.lang is deprecated. Use moment.locale instead.`,Sl),R.langData=Lo(`moment.langData is deprecated. Use moment.localeData instead.`,Tl);var Cf=Math.abs;function wf(){var e=this._data;return this._milliseconds=Cf(this._milliseconds),this._days=Cf(this._days),this._months=Cf(this._months),e.milliseconds=Cf(e.milliseconds),e.seconds=Cf(e.seconds),e.minutes=Cf(e.minutes),e.hours=Cf(e.hours),e.months=Cf(e.months),e.years=Cf(e.years),this}function Tf(e,t,n,r){var i=Nu(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ef(e,t){return Tf(this,e,t,1)}function Df(e,t){return Tf(this,e,t,-1)}function Of(e){return e<0?Math.floor(e):Math.ceil(e)}function kf(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Of(jf(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=zs(e/1e3),r.seconds=i%60,a=zs(i/60),r.minutes=a%60,o=zs(a/60),r.hours=o%24,t+=zs(o/24),c=zs(Af(t)),n+=c,t-=Of(jf(c)),s=zs(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function Af(e){return e*4800/146097}function jf(e){return e*146097/4800}function Mf(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=fs(e),e===`month`||e===`quarter`||e===`year`)switch(t=this._days+r/864e5,n=this._months+Af(t),e){case`month`:return n;case`quarter`:return n/3;case`year`:return n/12}else switch(t=this._days+Math.round(jf(this._months)),e){case`week`:return t/7+r/6048e5;case`day`:return t+r/864e5;case`hour`:return t*24+r/36e5;case`minute`:return t*1440+r/6e4;case`second`:return t*86400+r/1e3;case`millisecond`:return Math.floor(t*864e5)+r;default:throw Error(`Unknown unit `+e)}}function Nf(e){return function(){return this.as(e)}}var Pf=Nf(`ms`),Ff=Nf(`s`),If=Nf(`m`),Lf=Nf(`h`),Rf=Nf(`d`),zf=Nf(`w`),Bf=Nf(`M`),Vf=Nf(`Q`),Hf=Nf(`y`),Uf=Pf;function Wf(){return Nu(this)}function Gf(e){return e=fs(e),this.isValid()?this[e+`s`]():NaN}function Kf(e){return function(){return this.isValid()?this._data[e]:NaN}}var qf=Kf(`milliseconds`),Jf=Kf(`seconds`),Yf=Kf(`minutes`),Xf=Kf(`hours`),Zf=Kf(`days`),Qf=Kf(`months`),$f=Kf(`years`);function ep(){return zs(this.days()/7)}var tp=Math.round,np={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rp(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ip(e,t,n,r){var i=Nu(e).abs(),a=tp(i.as(`s`)),o=tp(i.as(`m`)),s=tp(i.as(`h`)),c=tp(i.as(`d`)),l=tp(i.as(`M`)),u=tp(i.as(`w`)),d=tp(i.as(`y`)),f=a<=n.ss&&[`s`,a]||a<n.s&&[`ss`,a]||o<=1&&[`m`]||o<n.m&&[`mm`,o]||s<=1&&[`h`]||s<n.h&&[`hh`,s]||c<=1&&[`d`]||c<n.d&&[`dd`,c];return n.w!=null&&(f=f||u<=1&&[`w`]||u<n.w&&[`ww`,u]),f=f||l<=1&&[`M`]||l<n.M&&[`MM`,l]||d<=1&&[`y`]||[`yy`,d],f[2]=t,f[3]=+e>0,f[4]=r,rp.apply(null,f)}function ap(e){return e===void 0?tp:typeof e==`function`&&(tp=e,!0)}function op(e,t){return np[e]===void 0?!1:t===void 0?np[e]:(np[e]=t,e===`s`&&(np.ss=t-1),!0)}function sp(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=np,i,a;return typeof e==`object`&&(t=e,e=!1),typeof e==`boolean`&&(n=e),typeof t==`object`&&(r=Object.assign({},np,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ip(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var cp=Math.abs;function lp(e){return(e>0)-(e<0)||+e}function up(){if(!this.isValid())return this.localeData().invalidDate();var e=cp(this._milliseconds)/1e3,t=cp(this._days),n=cp(this._months),r,i,a,o,s=this.asSeconds(),c,l,u,d;return s?(r=zs(e/60),i=zs(r/60),e%=60,r%=60,a=zs(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,``):``,c=s<0?`-`:``,l=lp(this._months)===lp(s)?``:`-`,u=lp(this._days)===lp(s)?``:`-`,d=lp(this._milliseconds)===lp(s)?``:`-`,c+`P`+(a?l+a+`Y`:``)+(n?l+n+`M`:``)+(t?u+t+`D`:``)+(i||r||e?`T`:``)+(i?d+i+`H`:``)+(r?d+r+`M`:``)+(e?d+o+`S`:``)):`P0D`}var Z=du.prototype;Z.isValid=lu,Z.abs=wf,Z.add=Ef,Z.subtract=Df,Z.as=Mf,Z.asMilliseconds=Pf,Z.asSeconds=Ff,Z.asMinutes=If,Z.asHours=Lf,Z.asDays=Rf,Z.asWeeks=zf,Z.asMonths=Bf,Z.asQuarters=Vf,Z.asYears=Hf,Z.valueOf=Uf,Z._bubble=kf,Z.clone=Wf,Z.get=Gf,Z.milliseconds=qf,Z.seconds=Jf,Z.minutes=Yf,Z.hours=Xf,Z.days=Zf,Z.weeks=ep,Z.months=Qf,Z.years=$f,Z.humanize=sp,Z.toISOString=up,Z.toString=up,Z.toJSON=up,Z.locale=ld,Z.localeData=dd,Z.toIsoString=Lo(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,up),Z.lang=ud,H(`X`,0,0,`unix`),H(`x`,0,0,`valueOf`),U(`x`,Os),U(`X`,js),Vs(`X`,function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),Vs(`x`,function(e,t,n){n._d=new Date(W(e))}),R.version=`2.30.1`,_o(K),R.fn=Y,R.min=iu,R.max=au,R.now=ou,R.utc=Eo,R.unix=ff,R.months=vf,R.isDate=Co,R.locale=Sl,R.invalid=Ao,R.duration=Nu,R.isMoment=Fo,R.weekdays=bf,R.parseZone=pf,R.localeData=Tl,R.isDuration=fu,R.monthsShort=yf,R.weekdaysMin=Sf,R.defineLocale=Cl,R.updateLocale=wl,R.locales=El,R.weekdaysShort=xf,R.normalizeUnits=fs,R.relativeTimeRounding=ap,R.relativeTimeThreshold=op,R.calendarFormat=Wu,R.prototype=Y,R.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 dp(e){return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/g,``)}function fp(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return t+(t.length%4==0?``:`=`.repeat(4-t.length%4))}function pp(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function mp(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var hp=60,gp=3600,_p=24*gp,vp=7*_p;function yp(){return new Date().getTime()/1e3}function bp(e){return e.split(``).map(e=>e.charCodeAt(0))}function xp(e){return dp(pp(new TextEncoder().encode(e)))}function Sp(e){let t=mp(fp(e));return new TextDecoder().decode(t)}async function Cp(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n),i=``;for(let e=0;e<r.length;e++)i+=r[e].toString(16).padStart(2,`0`);return i}async function wp(e,t,n=`hex`){let r=await crypto.subtle.importKey(`raw`,new TextEncoder().encode(t),{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,new TextEncoder().encode(e)),a=new Uint8Array(i);if(n===`base64url`)return dp(pp(a));let o=``;for(let e=0;e<a.length;e++)o+=a[e].toString(16).padStart(2,`0`);return o}function Tp(e,t=void 0){return ho.createJWT(e,t)}function Ep(e){return ho.parseJWT(e)}function Dp(e){return ho.jwkToPublicKey(e)}function Op(e,t){return ho.encryptPayload(e,t)}function kp(e){if(Array.isArray(e))return e.map(kp);if(e&&typeof e==`object`&&e.constructor===Object){let t={},n=Object.keys(e),r=n.length;for(let i=0;i<r;i+=1)t[(0,mo.camelCase)(n[i])]=kp(e[n[i]]);return t}return e}function Ap(e){if(!e)return!0;try{return JSON.parse(Sp(e.split(`.`)[1])).exp<yp()}catch{return!0}}function jp(e){return zp(`root`,e,`non-nullable object`,!1)}function Mp(e,t){return zp(`root`,e,`object`,t)}function Np(e,t){return zp(`root`,e,`object`,t)}function Pp(e,t){!Array.isArray(e)&&e!=null&&zp(t,e,`array`,!0)}function Fp(e,t,n){typeof e==`string`?e.match(/\d+(\.\d+)?/)||zp(n,e,`string`,t):typeof e!=`number`&&(!t||t&&e!=null)&&zp(n,e,`number`,t)}function Ip(e,t,n){typeof e==`string`?e.match(/\d+(\.\d+)?/)||zp(n,e,`number`,t):typeof e!=`number`&&(!t||t&&e!=null)&&zp(n,e,`number`,t)}function Lp(e,t,n){typeof e!=`boolean`&&(!t||t&&e!=null)&&zp(n,e,`boolean`,t)}function Q(e,t,n){typeof e!=`string`&&(!t||t&&e!=null)&&zp(n,e,`string`,t)}function Rp(e,t){e!=null&&zp(t,e,`null or undefined`,!1)}function zp(e,t,n,r){throw r&&(n+=`, null, or undefined`),TypeError(`Expected `+n+` at `+e+` but found:
|
|
33
|
+
`+JSON.stringify(t))}function $(e){return d.isBigNumber(e)?e:e?new d(e):new d(`0`)}function Bp(e,t){return new d(t).toFixed(e>0?e:0)}function Vp(e){return typeof e==`number`?e:parseFloat(e)}function Hp(e){return typeof e==`number`?e:parseInt(e)}function Up(e){let t=Vp(e);return t<10**10&&(t*=1e3),new Date(t)}function Wp(e){switch(e.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 60;case`2`:return 120;case`3`:return 180;case`5`:return 300;case`10`:return 600;case`15`:return 900;case`30`:return 1800;case`60`:return 3600;case`120`:return 7200;case`240`:return 14400;case`360`:return 21600;case`720`:return 43200;case`D`:case`1D`:return _p;case`3D`:return _p*3;case`W`:return vp;case`1W`:return vp;case`2W`:return vp*2;case`1M`:return _p*30}}var Gp=e=>typeof e==`object`?e:new Date(e*1e3),Kp=(e,t)=>{switch(e=R.utc(Gp(e)),t){case`1`:case`2`:case`3`:return e.endOf(`day`).unix();case`5`:case`10`:case`15`:return e.endOf(`isoWeek`).unix();case`30`:case`60`:case`120`:return e.endOf(`month`).unix();case`240`:case`360`:case`720`:case`D`:case`1D`:return e.endOf(`year`).unix()}},qp=(e,t)=>{switch(e=R.utc(Gp(e)),t){case`1`:case`2`:case`3`:return e.startOf(`day`).unix();case`5`:case`10`:case`15`:return e.startOf(`isoWeek`).unix();case`30`:case`60`:case`120`:return e.startOf(`month`).unix();case`240`:case`360`:case`720`:case`D`:case`1D`:return e.startOf(`year`).unix()}};function Jp(e){switch(e){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 Error(`Unsupported resolution: ${e}`)}}function Yp(e,t){let n=R(Gp(t)),r;switch(e){case`day`:r={year:n.year(),month:n.month()+1,day:n.date()};break;case`week`:r={year:n.isoWeekYear(),week:n.isoWeek()};break;case`month`:r={year:n.year(),month:n.month()+1};break;case`year`:r={year:n.year()};break;default:throw Error(`Unsupported bucketType: ${e}`)}return r}function Xp(e,t,n){let r=[],i=R.utc(t*1e3),a=e=>{switch(n){case`day`:return e.startOf(`day`);case`week`:return e.startOf(`isoWeek`);case`month`:return e.startOf(`month`);case`year`:return e.startOf(`year`);default:throw Error(`Unsupported bucketType: ${n}`)}},o=e=>{switch(n){case`day`:return e.subtract(1,`day`);case`week`:return e.subtract(1,`week`);case`month`:return e.subtract(1,`month`);case`year`:return e.subtract(1,`year`);default:throw Error(`Unsupported bucketType: ${n}`)}},s=a(i),c=a(R.utc(e*1e3));for(;s>=c;)r.push(s.clone()),s=o(s);return r}function Zp(e,t,n){let r=Wp(t),i=typeof n==`object`?n.getTime()/1e3:n;return Math.floor(i/r)*r-r*(e-1)}function Qp(e,t){let n=t;if(n=typeof t==`string`?[{query:t,marketProperty:`fullDisplayName`}]:Array.isArray(t)?t.map(e=>{if(typeof e==`string`)return{query:e,marketProperty:`fullDisplayName`};if(!Array.isArray(e))return e}):[t],n.length===0||!n.find(({query:e})=>!!e&&!!e.length))return e;let r=e;return n.forEach(({query:e,marketProperty:t})=>{let n;if(e.match(/[-_:\/\\]+/))try{n=new RegExp(e.replace(/\*/g,`.*`),`i`)}catch{}let i=e.toLowerCase().split(/[\s]+/).filter(Boolean);r=mo.default.pickBy(r,(e,r)=>{let a=e[t];if(a==null)return!1;let o=a.toLowerCase();return n&&t===`fullDisplayName`?!!n.exec(e[t]):i.filter(e=>o.includes(e)).length===i.length})}),r}var $p=void 0,em=class{static initialize=e=>{$p=e,console.log(`Coinray I18n initialized`)};static t=(e,t)=>$p?$p.t(`coinray:${e}`,t):`i18n uninitialized. Set the Coinray.I18n.instance. Key: ${e}`},tm=`2.0.19`,nm=class extends Error{errorCode;errorMessage;exchange;status;constructor({code:e,message:t,exchange:n}){super(`Request failed`),this.name=`CoinrayError`,this.errorCode=e,this.errorMessage=t,this.exchange=n}},rm=class e{static I18n=em;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:t,orderEndpoint:n,websocketEndpoint:r}={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:t||`https://api.coinray.eu`,orderEndpoint:n||t||`https://api.coinray.eu`,websocketEndpoint:r||`wss://ws.coinray.eu/v1`},this._candleCache=new Map,this.loadTimeOffset().then()}authenticateDevice=(e,t)=>{this._credential=e,this._sessionKey=t};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(Ap(this._token)){if(console.log(`Coinray token expired. Can refresh:`,!!this._onTokenExpired),!this._onTokenExpired)return!1;this._refreshingToken||=this._onTokenExpired();try{this._token=await this._refreshingToken}catch(e){return console.log(`Coinray token could not be refreshed`,e),this._refreshingToken=void 0,!1}if(this._refreshingToken=void 0,!Ap(this._token))this.reconnect();else return!1}}catch(e){console.error(e)}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{let{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 Error(`Token is expired. call refreshToken in the onTokenExpired callback`)};reconnect=()=>{this._connected&&this.socket.conn.close()};disconnect=()=>{this._socket&&=(this._socket.disconnect(),void 0),this._connected=void 0};connect=async()=>{if(this._connected){await this._connected;return}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(t,n=!1,r)=>{if(t.length===0)return!1;if(n&&(this._tickerListeners.clear(),this._tickerSymbols.clear()),this._tickerListeners.has(r)){let e=this._tickerListeners.get(r);t.forEach(t=>e.add(t))}else this._tickerListeners.set(r,new Set(t));t.forEach(e=>{this._tickerSymbols.has(e)||this._tickerSymbols.set(e,new Set),this._tickerSymbols.get(e).add(r)}),await this.connect();let i=this.getChannel(`tickers`);return i.push(`subscribe`,{coinraySymbols:t,reset:n},5e3),this.tickersSubscribed?r:(this.tickersSubscribed=!0,i.on(`update`,t=>{let{exchange_code:n,tickers:r}=t,i=r.map(e._parseTicker);this._tickerListeners.forEach((e,t)=>{let r=i.filter(t=>e.has(t.coinraySymbol));t({type:`tickers:update`,exchangeCode:n,tickers:r})})}),i.on(`error`,e=>console.error(e)),r)};unsubscribeAllTickers=()=>{this._tickerListeners.clear(),this._tickerSymbols.clear(),this.getChannel(`tickers`).push(`unsubscribe`,{all:!0},5e3)};unsubscribeTickers=(e,t)=>{if(t&&this._tickerListeners.has(t)){let n=this._tickerListeners.get(t),r=[];e.forEach(e=>{n.delete(e),this._tickerSymbols.has(e)&&(this._tickerSymbols.get(e).delete(t),this._tickerSymbols.get(e).size===0&&(this._tickerSymbols.delete(e),r.push(e)))}),n.size===0&&this._tickerListeners.delete(t),r.length>0&&this.getChannel(`tickers`).push(`unsubscribe`,{coinraySymbols:r},5e3)}};subscribeTrades=async({coinraySymbol:t},n)=>{if(this._tradeListeners[t]&&this._tradeListeners[t].length>0)return this._tradeListeners[t].includes(n)||this._tradeListeners[t].push(n),n({type:`trades:snapshot`,coinraySymbol:t,trades:this._tradeSnapshots[t]}),n;this._tradeSnapshots[t]=[],this._tradeListeners[t]=[n],await this.connect();let r=this.getChannel(`trades`);return r.push(`subscribe`,{symbols:t,snapshots:!0},5e3),this.tradesSubscribed?n:(this.tradesSubscribed=!0,r.on(`snapshot`,({symbol:t,trades:n})=>{let r=Object.values(this._tradeListeners[t]),i=n.map(e._parseTrade);this._tradeSnapshots[t]=i,r.map(e=>e({type:`trades:snapshot`,coinraySymbol:t,trades:i}))}),r.on(`update`,({symbol:t,trades:n})=>{let r=Object.values(this._tradeListeners[t]),i=n.map(e._parseTrade),a=[...i,...this._tradeSnapshots[t]],o=new Date(new Date().getTime()-12e4),s=a.filter(({time:e})=>e>o);s.length>100?this._tradeSnapshots[t]=s:this._tradeSnapshots[t]=a.slice(0,100),r.map(e=>e({type:`trades:update`,coinraySymbol:t,trades:i}))}),r.on(`error`,e=>console.error(e)),n)};unsubscribeTrades=({coinraySymbol:e},t)=>{t&&this._tradeListeners[e]?(this._tradeListeners[e]=this._tradeListeners[e].filter(e=>e!==t),this._tradeListeners[e].length===0&&this.getChannel(`trades`).push(`unsubscribe`,{symbols:e},5e3)):(this._tradeSnapshots[e]=[],this._tradeListeners[e]=[])};subscribeOrderBook=async({coinraySymbol:t},n)=>{if(this._orderbookListeners[t]&&this._orderbookListeners[t].length>0)return this._orderbookListeners[t].includes(n)||this._orderbookListeners[t].push(n),n({type:`orderBook:snapshot`,coinraySymbol:t,orderBook:this._orderbookSnapshots[t]}),n;this._orderbookSnapshots[t]={minSeq:0,maxSeq:0,bids:{},asks:{}},this._orderbookListeners[t]=[n],await this.connect();let r=this.getChannel(`orderbooks`);return r.push(`subscribe`,{symbols:t},1e4),this.orderBookSubscribed?n:(this.orderBookSubscribed=!0,r.on(`snapshot`,({orderbooks:t})=>{Object.keys(t).forEach(n=>{let r=Object.values(this._orderbookListeners[n]),i=e._parseOrderBookSnapshot(t[n]);this._orderbookSnapshots[n]=i,r.map(e=>e({type:`orderBook:snapshot`,coinraySymbol:n,orderBook:i}))})}),r.on(`update`,({orderbooks:t})=>{let n=Object.keys(t);n.length!==0&&n.forEach(n=>{let r=Object.values(this._orderbookListeners[n]),i=e._parseOrderBookUpdate(t[n]);this._orderbookSnapshots[n]=e._updateOrderBook(this._orderbookSnapshots[n],i),r.map(e=>e({type:`orderBook:update`,coinraySymbol:n,orderBook:i}))})}),r.on(`error`,e=>console.error(e)),n)};unsubscribeOrderBook=({coinraySymbol:e},t)=>{t&&this._orderbookListeners[e]?(this._orderbookListeners[e]=this._orderbookListeners[e].filter(e=>e!==t),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:t,resolution:n,lastCandle:r},i)=>{let a=`${t}-${n}`;if(this._candleListeners[a]&&this._candleListeners[a].length>0)return this._candleListeners[a].push(i),i;this._candleListeners[a]=[i];let o=({type:t,coinraySymbol:r,trades:i})=>{let o=Object.values(this._candleListeners[a]),s=e._tradesToLastCandle(n,i),c=s[s.length-1];c&&(this._candles[a]&&t===`trades:snapshot`&&(this._candles[a].skipVolume=!0),this._candles[a]=e._mergeCandle(this._candles[a],c),o.map(e=>e({coinraySymbol:r,resolution:n,candle:this._candles[a],previousCandles:s})))};return this._candleTradeListeners[t]?this._candleTradeListeners[t][a]=o:this._candleTradeListeners[t]={[a]:o},this._candles[a]=r||{time:new Date(0)},await this.subscribeTrades({coinraySymbol:t},o),this.startNewCandleTimer({candleId:a,resolution:n,coinraySymbol:t}),i};startNewCandleTimer=({candleId:e,resolution:t,coinraySymbol:n})=>{this._timers[e]&&clearTimeout(this._timers[e]);let r=Zp(0,t,new Date)-new Date().getTime()/1e3,i=Object.values(this._candleListeners[e]);this._timers[e]=setTimeout(()=>{let r=Zp(1,t,new Date)*1e3,a=this._candles[e];a&&r>a.time.getTime()&&(this._candles[e]={time:new Date(r),open:a.close,high:a.close,low:a.close,close:a.close,baseVolume:0,quoteVolume:0,numTrades:0},i.map(r=>r({coinraySymbol:n,resolution:t,candle:this._candles[e],previousCandles:[]}))),this.startNewCandleTimer({candleId:e,resolution:t,coinraySymbol:n})},r*1e3)};unsubscribeCandles=({coinraySymbol:e,resolution:t},n)=>{let r=`${e}-${t}`;n&&this._candleListeners[r]?this._candleListeners[r]=this._candleListeners[r].filter(e=>e!==n):this._candleListeners[r]=[],this._candleListeners[r].length===0&&(this.unsubscribeTrades({coinraySymbol:e},this._candleTradeListeners[e][r]),this._timers[r]&&(clearTimeout(this._timers[r]),delete this._timers[r]),delete this._candles[r],delete this._candleTradeListeners[e][r])};fetchFirstCandleTime=async({coinraySymbol:e,resolution:t})=>{let{result:{startTime:n}}=await this.get(`candles/start-time`,{version:`v1`,params:{symbol:e,resolution:t}});return n};fetchCandles=async({coinraySymbol:e,resolution:t,start:n,end:r,useWebSocket:i})=>{if(this.flushCache(),t.endsWith(`S`))return(await this.getWebsocketCandles(e,t)).filter(e=>{let t=e.time.getTime()/1e3;return t>=n&&t<=r});let a=Jp(t),o=new Date().getTime()/1e3,s=[],c=r+1;if(Kp(r,t)>=o){let n=await this.getOpenCandles(i,{version:`v2`,params:{symbol:e,resolution:t}});if(n.length>0)c=Math.min(n[0].time.getTime()/1e3,c),s.push(...n);else return[]}let l=Zp(2,t,c),u=(0,mo.chunk)(Xp(n,l,a),10);for(let n=0;n<u.length;n+=1){let r=u[n].map(n=>{let r={version:`v2`,params:{symbol:e,resolution:t,...Yp(a,n)}};return this.getHistoryCandles(r)}),i=await Promise.all(r),o=[];for(let e=0;e<i.length;e+=1)o=i[e].filter(({time:e})=>e.getTime()/1e3<c),o.length>0&&(c=Math.min(o[0].time.getTime()/1e3,c),s.unshift(...o));if(o.length===0)break}return s.filter(({time:e})=>{let t=e.getTime()/1e3;return t>=n&&t<=r}).sort((e,t)=>e.time.getTime()-t.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,t)=>await new Promise(n=>{let r=setTimeout(()=>{this.unsubscribeCandles({coinraySymbol:e,resolution:t},i),n([])},0),i=({previousCandles:a})=>{clearTimeout(r),this.unsubscribeCandles({coinraySymbol:e,resolution:t},i),n(a)};this.subscribeCandles({coinraySymbol:e,resolution:t},i)});getOpenCandles=async(t,n)=>{let r=this.candleCacheKey({prefix:`O`,...n.params}),i=this._candleCache.get(r);if(!t&&i)return i;let a=await this.getWebsocketCandles(n.params.symbol,n.params.resolution),o=mo.default.keyBy(a,({time:e})=>e.getTime()),{result:s}=await this.get(`candles/open`,n);if(s.candles){let t=s.candles.map(e._parseCandle).map(t=>{let n=o[t.time.getTime()];return n?e._mergeCandle(t,n):t});return this._candleCache.set(r,t),t}return[]};getHistoryCandles=async t=>{let n=this.candleCacheKey(t.params),r=this._candleCache.get(n);if(r)return r;{if(t.params.year<2018)return new Promise(e=>e([]));let{result:r}=await this.get(`candles/history`,t);if(r.candles){let t=r.candles.map(e._parseCandle);return this._candleCache.set(n,t),t}return[]}};candleCacheKey=({symbol:e,resolution:t,year:n,month:r=``,day:i=``,week:a=``,prefix:o=`C`})=>`${o}/${e}/${t}/${n}/${r}/${i}/${a}`;fetchExchanges=async(e,t)=>{let n=t;return n||({result:{exchanges:n}}=await this.get(`exchanges`,{version:`v1`})),n.map(e)};fetchMarkets=async(e,t)=>{let n=t;return n||({result:{markets:n}}=await this.get(`markets`,{version:`v1`,params:{exchange:e.code}})),n};fetchTickers=async t=>{let{result:{tickers:n}}=await this.get(`tickers`,{version:`v1`,params:{exchanges:[...t].sort().join(`,`)}});return mo.default.mapValues(n||{},t=>t.map(e._parseTickerSnapshot))};fetchStaticMarkets=async(e,t)=>{let{result:n,_headers:r,_status:i}=await this.get(`markets/static`,{version:`v1`,params:{exchange:e},headers:t?{"If-None-Match":t}:{}});return i===304?{markets:null,etag:t}:{markets:n.markets,etag:r.etag}};createCredential=async(e,t)=>{let n=await this.publicKey();try{let r=await Op(await Tp({password:t}),n),{result:i}=await this.post(`credentials`,{secret:t,body:{deviceId:e,encryptedPassword:r}});return i}catch(e){throw e}};wrapApiKey=async(e,t)=>{let n=await this.publicKey(),r;try{r=t?e:await Op(await Tp({apiKey:JSON.stringify(e)}),n);let{result:i}=await this.post(`credentials/wrap_api_key`,{secret:this._sessionKey,body:{encryptedApiKey:r,credential:this._credential}});return i}catch(e){throw e}};testAccount=async e=>{try{let{result:t}=await this.post(`account/test`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return t}catch(e){throw e}};createSmartOrderSignature=async e=>{try{let{result:t}=await this.post(`order/smart_order_signature`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{smartOrder:e,credential:this._credential}});return t}catch(e){throw e}};createOrder=async e=>{try{let{result:t}=await this.post(`order`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return t}catch(e){throw e}};updateOrder=async e=>{try{let{result:t}=await this.patch(`order`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,credential:this._credential}});return t}catch(e){throw e}};cancelOrder=async e=>{try{let{result:t}=await this.delete(`order`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{...e,orderId:e.orderId.toString(),credential:this._credential}});return t}catch(e){throw e}};createWebSocketToken=async({exchangeCode:e,encryptedApiKey:t})=>{try{let{result:n}=await this.post(`exchanges/ws_token`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{encryptedApiKey:t,exchangeCode:e,credential:this._credential}});return n}catch(e){throw e}};fetchPositions=async({exchangeCode:e,encryptedApiKey:t})=>{try{let{result:n}=await this.get(`futures/positions`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:e,encryptedApiKey:t}});return n}catch(e){throw e}};getBalances=async({exchangeCode:t,encryptedApiKey:n})=>{try{let{result:{balances:r,positions:i}}=await this.get(`account/balances`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,params:{credential:this._credential,exchangeCode:t,encryptedApiKey:n}});return{balances:r.map(e._parseBalance),positions:i}}catch(e){throw e}};setLeverage=async({coinraySymbol:e,leverage:t,encryptedApiKey:n})=>{try{let{result:r}=await this.post(`futures/leverage`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,leverage:t,encryptedApiKey:n}});return r}catch(e){throw e}};setMarginType=async({coinraySymbol:e,marginType:t,encryptedApiKey:n})=>{try{let{result:r}=await this.post(`futures/margin_type`,{secret:this._sessionKey,apiEndpoint:this.config.orderEndpoint,body:{credential:this._credential,coinraySymbol:e,marginType:t,encryptedApiKey:n}});return r}catch(e){throw e}};async getProxyList({exchangeCode:e,credentialVersion:t}){let n=``;e&&(n+=`?exchange=${e.toUpperCase()}`,n+=t?`&version=${t}`:``);let{result:{proxies:r}}=await this.get(`credentials/ips`+n);return r}async publicKey(){if(!this._publicKey){let{result:{jwk:e}}=await this.get(`credentials/certificate`);this._publicKey=await Dp(e)}return this._publicKey}get clientId(){return Ep(this._token).header.kid}get socket(){if(!this._token)throw Error(`Token not present`);return this._socket||(this._socket=new pi(this.config.websocketEndpoint,{heartbeatIntervalMs:5e3,transport:this._transport,reconnectAfterMs:()=>Ap(this._token)?3e4:1e3}),this.onOpen(this.resubscribe)),this._socket.params=()=>({reconnect:!0,token:this._token,client:`coinrayjs`,version:tm}),this._socket}getChannel(e){if(this.connect(),this._channels[e])return this._channels[e];let t=this.socket.channel(e,{});return this._channels[e]=t,t.join(),t}get=async(e,{apiEndpoint:t=void 0,version:n=`v2`,headers:r={},params:i={},secret:a=``}={})=>await this._request(e,`GET`,{version:n,apiEndpoint:t,headers:r,secret:a,params:i});post=async(e,t)=>await this._request(e,`POST`,t);patch=async(e,t)=>await this._request(e,`PATCH`,t);delete=async(e,t)=>await this._request(e,`delete`,t);async _request(e,t,{apiEndpoint:n,version:r=`v2`,headers:i={},params:a={},body:o={},secret:s=``}){let c=await this.getToken(),l=Object.entries(a).length>0?`?`+Object.entries(a).map(([e,t])=>t?`${e}=${t}`:void 0).filter(Boolean).join(`&`):``,u=this.getNonce(),d=`/api/${r}/${e}${l}`;if(r===`v2`&&!e.startsWith(`candles`)){let e=[u,t.toUpperCase(),d,t===`GET`?``:JSON.stringify(o)].join(``),n=s==``?``:await wp(e,s);i={...i,"Cr-Access-Token":`${c}`,"Cr-Nonce":u,"Cr-Signature":n}}let f={method:t,url:(n||this.config.apiEndpoint)+d,timeout:2e4,headers:{Accept:`application/json`,"Content-Type":`application/json`,Authorization:`Bearer ${c}`,"Cr-Client-version":tm,...i},data:t===`GET`?void 0:JSON.stringify(o),validateStatus:e=>e>=200&&e<300||e===304};try{let e=await Gr(f),t;t=e.status===200?e.data:e.status===204?{}:e.data;let n=Object.fromEntries(Object.entries(e.headers).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]));return{result:t,_headers:n,_status:e.status}}catch(e){let{response:t}=e;if(t){let e=new nm(t.data?.error||{});throw e.status=t.status,e}throw e}}static _parseOrderBookSnapshot({asks:t,bids:n,min_seq:r,max_seq:i}){return{minSeq:r,maxSeq:i,asks:e._parseBidAsk(t),bids:e._parseBidAsk(n)}}static _parseOrderBookUpdate({asks_diff:t,bids_diff:n,min_seq:r,max_seq:i}){return{minSeq:r,maxSeq:i,asks:e._parseBidAsk(t),bids:e._parseBidAsk(n)}}static _updateOrderBook(e,{asks:t,bids:n,min_seq:r,max_seq:i}){let a=(e,t)=>{mo.default.forEach(t,(t,n)=>{t>0?e[n]=t:delete e[n]})};return e.minSeq=r,e.maxSeq=i,a(e.bids,n),a(e.asks,t),e}static _parseBidAsk(e){return Array.isArray(e)?e.reduce((e,[t,n])=>(e[t]=parseFloat(n),e),{}):Object.keys(e).reduce((t,n)=>(t[n]=parseFloat(e[n]),t),{})}static _parseCandle(e){if(e){let[t,n,r,i,a,o,s]=e;return{time:Up(t),open:parseFloat(n),high:parseFloat(r),low:parseFloat(i),close:parseFloat(a),baseVolume:parseFloat(o),quoteVolume:parseFloat(s),numTrades:0}}throw Error(`Candle`)}static _parseTrade([e,t,n,r,i]){return{id:e,time:Up(t),price:parseFloat(n),quantity:parseFloat(r),type:[`1`,`buy`].includes(i.toString())?`buy`:`sell`}}static _parseTicker(e){return{askPrice:$(e.a),baseVolume:$(e.BV),baseVolume1s:$(e.bv),bidPrice:$(e.b),btcVolume:$(e.B),coinraySymbol:e.s,highPrice1s:$(e.h),highPrice24h:$(e.H),lastPrice:$(e.c),lowPrice1s:$(e.l),lowPrice24h:$(e.L),openPrice1s:$(e.o),openPrice24h:$(e.O),quoteVolume:$(e.QV),quoteVolume1s:$(e.qv),usdVolume:$(e.U)}}static _parseTickerSnapshot(e){return{coinraySymbol:e.s,lastPrice:$(e.c),askPrice:$(e.a),bidPrice:$(e.b),openPrice24h:$(e.O),highPrice24h:$(e.H),lowPrice24h:$(e.L),baseVolume:$(e.BV),quoteVolume:$(e.QV),btcVolume:$(e.B),usdVolume:$(e.U),baseToUsd:$(e.bu),quoteToUsd:$(e.qu),marketCap:$(e.mc)}}static _parseBalance(e){let t={currency:e.currency,available:$(e.available),inOrders:$(e.inOrders),total:$(e.inOrders)};return e.initialMargin&&(t={...t,initialMargin:$(e.initialMargin),openOrderInitialMargin:$(e.openOrderInitialMargin),positionInitialMargin:$(e.positionInitialMargin),unrealizedProfit:$(e.unrealizedProfit),crossWalletBalance:$(e.crossWalletBalance),crossUnrealizedProfit:$(e.crossUnrealizedProfit)}),t}static _tradesToLastCandle(t,n){n.length>0&&n[0].time>n[n.length-1].time&&(n=n.reverse());let r=e._resolutionToSeconds(t),i=mo.default.groupBy(n.reverse(),({time:e})=>Math.floor(e.getTime()/r)*r);return mo.default.sortBy(Object.keys(i),e=>parseInt(e)).reduce((e,t)=>{let n=i[t],a=n[0].time.getTime(),o=new Date(a-a%r);if(n.length===0)return e;let s=n[0],c,l,u,d,f=0,p=0;return c=l=u=d=e.length===0?s.price:e[e.length-1].close,n.reverse().map(({price:e,quantity:t})=>{l=Math.min(l,e),u=Math.max(u,e),d=e,f+=t,p+=t*e}),e.push({time:new Date(o),open:c,high:u,low:l,close:d,baseVolume:f,quoteVolume:p,numTrades:n.length}),e},[])}static _mergeCandle(e,t){return!e||e.time<t.time?t:(e.numTrades+=t.numTrades,e.high=Math.max(e.high,t.high),e.low=Math.min(e.low,t.low),e.close=t.close,e.skipVolume?e.skipVolume=!1:(e.baseVolume+=t.baseVolume,e.quoteVolume+=t.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}},im=class{listeners;constructor(){this.listeners={}}removeAllListeners(){this.listeners={}}on=(e,t)=>(e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push(t),t);off=(e,t)=>{e in this.listeners&&(t?this.listeners[e]=this.listeners[e].filter(e=>e!==t):this.listeners[e]=[])};hasListeners=e=>this.listeners[e]&&this.listeners[e].length>0;dispatchEvent=(e,t={})=>{let n=this.listeners[e];n&&n.length>0&&n.map(n=>n({eventName:e,data:t}))}},am=class e extends im{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;futuresSettings;symbolTv;tradingSessions;syntheticTrades;marketCap;_groupName;getPriceOverrides;static Create(t,n,r){return e.checkStatic(t),e.checkDynamic(t),new e(t,n,r)}static checkStatic(e){if(e==null?jp(e):typeof e==`object`?Array.isArray(e)&&Np(e,!1):Mp(e,!1),Fp(e.id,!1,`id`),Q(e.coinraySymbol,!1,`coinraySymbol`),Q(e.symbol,!1,`symbol`),Q(e.symbolAlt,!1,`symbolAlt`),Q(e.quoteCurrency,!1,`quoteCurrency`),Q(e.underlyingQuoteCurrency,!1,`underlyingQuoteCurrency`),Q(e.baseLogoUrl,!0,`baseLogoUrl`),Q(e.baseCurrency,!1,`baseCurrency`),Q(e.exchangeCode,!1,`exchangeCode`),Q(e.status||``,!1,`status`),Q(e.note||``,!1,`note`),Lp(e.websocket,!1,`websocket`),Fp(e.precisionBase,!1,`precisionBase`),Fp(e.precisionPrice,!1,`precisionPrice`),Fp(e.minBase,!0,`minBase`),Fp(e.precisionQuote,!1,`precisionQuote`),Fp(e.minQuote,!0,`minQuote`),Ip(e.maxBase,!0,`maxBase`),Ip(e.maxBaseMarket,!0,`maxBaseMarket`),Ip(e.maxQuote,!0,`maxQuote`),Ip(e.minTrade,!1,`minTrade`),Fp(e.maxTrade,!0,`maxTrade`),e.maxTrade===void 0&&(e.maxTrade=null),Fp(e.makerFee,!1,`makerFee`),Fp(e.takerFee,!1,`takerFee`),Rp(e.delistedOn,`delistedOn`),e.delistedOn===void 0&&(e.delistedOn=null),Q(e.exchangeUrl,!1,`exchangeUrl`),Q(e.symbolTv,!0,`symbolTv`),Q(e.groupName,!0,`groupName`),e.futuresSettings!==null&&e.futuresSettings!==void 0){let t=e.futuresSettings;Q(t.tenor,!1,`futuresSettings.tenor`),Q(t.margin,!1,`futuresSettings.margin`),Q(t.expiresAt,!0,`futuresSettings.expiresAt`),Fp(t.fundingIntervalSeconds,!0,`futuresSettings.fundingIntervalSeconds`),Ip(t.maxLeverage,!0,`futuresSettings.maxLeverage`),Q(t.groupName,!0,`futuresSettings.groupName`)}}static checkDynamic(e){Ip(e.volume,!0,`volume`),Ip(e.quoteVolume,!0,`quoteVolume`),Ip(e.btcVolume,!0,`btcVolume`),Ip(e.usdVolume,!0,`usdVolume`),Ip(e.openPrice,!0,`openPrice`),Ip(e.highPrice,!0,`highPrice`),Ip(e.lowPrice,!0,`lowPrice`),Fp(e.change,!1,`change`),Ip(e.lastPrice,!0,`lastPrice`),Ip(e.baseToUsd,!1,`baseToUsd`),Ip(e.quoteToUsd,!1,`quoteToUsd`),Ip(e.askPrice,!0,`askPrice`),Ip(e.bidPrice,!0,`bidPrice`),Q(e.updatedAt,!1,`updatedAt`),Ip(e.marketCap,!0,`marketCap`)}constructor(e,t,n){super(),this.getExchange=()=>n,this.api=t,this._assignStatic(e),this.volume=$(e.volume),this.quoteVolume=$(e.quoteVolume),this.btcVolume=$(e.btcVolume),this.usdVolume=$(e.usdVolume),this.openPrice=$(e.openPrice),this.highPrice=$(e.highPrice),this.lowPrice=$(e.lowPrice),this.change=Vp(e.change)||0,this._lastPrice=$(e.lastPrice),this.baseToUsd=$(e.baseToUsd),this.quoteToUsd=$(e.quoteToUsd),this._askPrice=$(e.askPrice),this._bidPrice=$(e.bidPrice),this.updatedAt=e.updatedAt,this.marketCap=$(e.marketCap)}assignStatic=t=>{e.checkStatic(t),this._assignStatic(t)};_assignStatic(e){if(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.websocket=e.websocket,this.precisionBase=e.precisionBase,this.precisionPrice=e.precisionPrice,this.precisionQuote=e.precisionQuote,this.minQuote=e.minQuote,this.minBase=e.minBase,this.maxBase=$(e.maxBase),this.maxBaseMarket=$(e.maxBaseMarket).isZero()?this.maxBase:$(e.maxBaseMarket),this.maxQuote=$(e.maxQuote),this.minTrade=$(e.minTrade),this.maxTrade=$(e.maxTrade),this.makerFee=Vp(e.makerFee),this.takerFee=Vp(e.takerFee),this.delistedOn=e.delistedOn,this.exchangeUrl=e.exchangeUrl,this._supportedOrderTypes=e.supportedOrderTypes,this.symbolTv=e.symbolTv,this._groupName=e.groupName,this.tradingSessions=e.tradingSessions??null,this.syntheticTrades=e.syntheticTrades??!1,this.futuresSettings=void 0,e.futuresSettings!==null&&e.futuresSettings!==void 0){let t=e.futuresSettings;this.futuresSettings={tenor:t.tenor,margin:t.margin,expiresAt:t.expiresAt?new Date(t.expiresAt):null,fundingIntervalSeconds:t.fundingIntervalSeconds??null,maxLeverage:t.maxLeverage!==null&&t.maxLeverage!==void 0?$(t.maxLeverage):null,groupName:t.groupName??void 0}}}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 groupName(){return this._groupName??this.futuresSettings?.groupName}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,t)=>{this._bidPrice=e,this._askPrice=t,this.dispatchEvent(`bidask`)};updateTicker=e=>{this.openPrice=e.openPrice24h,this.highPrice=e.highPrice24h,this.lowPrice=e.lowPrice24h,this.volume=e.baseVolume,this.quoteVolume=e.quoteVolume,this.btcVolume=e.btcVolume,this.usdVolume=e.usdVolume,this.updateBidAsk(e.bidPrice,e.askPrice),this.updateLastPrice(e.lastPrice),this.dispatchEvent(`ticker`)};applySnapshot=(e,t=!1)=>{t||(this._lastPrice=e.lastPrice,this._bidPrice=e.bidPrice,this._askPrice=e.askPrice,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()),this.volume=e.baseVolume,this.quoteVolume=e.quoteVolume,this.btcVolume=e.btcVolume,this.usdVolume=e.usdVolume,this.baseToUsd=e.baseToUsd,this.quoteToUsd=e.quoteToUsd,this.marketCap=e.marketCap,this.dispatchEvent(`ticker`)};clone(){let t={...this,volume:this.volume,quoteVolume:this.quoteVolume,btcVolume:this.btcVolume,usdVolume:this.usdVolume,marketCap:this.marketCap,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,groupName:this._groupName},n=new e(t,this.api,this.getExchange());return n.getPriceOverrides=this.getPriceOverrides,n.listeners=this.listeners,n}},om=class e{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(t,n){return e.check(t),new e(t,n)}static check(e){if(e==null?jp(e):typeof e==`object`?Array.isArray(e)&&Np(e,!1):Mp(e,!1),Fp(e.id,!1,`id`),Q(e.name,!1,`name`),Q(e.code,!1,`code`),Lp(e.websocket,!1,`websocket`),Lp(e.active,!1,`active`),Lp(e.tradingEnabled,!1,`tradingEnabled`),Q(e.tradingEnabledFrom,!1,`tradingEnabledFrom`),Lp(e.isFutures,!0,`isFutures`),Lp(e.isDex,!0,`isDex`),Q(e.logo,!1,`logo`),Q(e.btcVolume,!1,`btcVolume`),Q(e.usdVolume,!1,`usdVolume`),Fp(e.totalMarkets,!1,`totalMarkets`),Pp(e.quoteCurrencies,`quoteCurrencies`),Q(e.apiEndpoint,!0,`apiEndpoint`),Q(e.websocketEndpoint,!0,`websocketEndpoint`),Q(e.aliasedTo,!0,`aliasedTo`),e.quoteCurrencies)for(let t=0;t<e.quoteCurrencies.length;t++)Q(e.quoteCurrencies[t],!1,`quoteCurrencies[`+t+`]`);if(e.quoteCurrencies===void 0&&(e.quoteCurrencies=null),Pp(e.supportedResolutions,`supportedResolutions`),Pp(e.supportedFeatures,`supportedFeatures`),e.supportedResolutions)for(let t=0;t<e.supportedResolutions.length;t++)Q(e.supportedResolutions[t],!1,`supportedResolutions[`+t+`]`);e.supportedResolutions===void 0&&(e.supportedResolutions=null)}constructor(e,t){this.api=t,this.markets={},this.exchangeSymbols={},this._assign(e)}update(t){e.check(t),this._assign(t)}_assign(e){let t=this.api;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=$(e.btcVolume),this.usdVolume=$(e.usdVolume),this.totalMarkets=Hp(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.apiEndpoint=e.apiEndpoint||t.config.apiEndpoint,this.websocketEndpoint=e.websocketEndpoint||t.config.websocketEndpoint,this.aliasedTo=e.aliasedTo}clone(){return new e({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){let t=await this.api.fetchMarkets(this,e),n=t.map(e=>{try{return am.Create(e,this.api,this)}catch{return new am(e,this.api,this)}});return n.length>0&&(this.markets=mo.default.keyBy(n,`coinraySymbol`),this.exchangeSymbols=mo.default.keyBy(n,`symbol`)),t}mergeStatic(e){let t=[],n=[];if(e.length===0)return{added:t,removed:n};let r={};for(let n of e){let e=this.markets[n.coinraySymbol];try{e?(e.assignStatic(n),r[n.coinraySymbol]=e):(am.checkStatic(n),r[n.coinraySymbol]=new am(n,this.api,this),t.push(n.coinraySymbol))}catch(t){console.error(t),e&&(r[n.coinraySymbol]=e)}}for(let[e,t]of Object.entries(this.markets))r[e]||(t.removeAllListeners(),n.push(e));return this.markets=r,this.exchangeSymbols=mo.default.keyBy(Object.values(r),`symbol`),{added:t,removed:n}}getBaseCurrencyDominance(e){return this.baseCurrencyDominance[e]}getMarketByExchangeSymbol(e){return this.exchangeSymbols[e]}getCurrencyPrice(e,t){for(let[n,r]of Object.entries(this.markets))if(r.baseCurrency===t)return $(e).dividedBy(r.baseToUsd);else if(r.quoteCurrency===t)return $(e).dividedBy(r.quoteToUsd);return new d(0)}getUsdPrice(e,t){for(let[n,r]of Object.entries(this.markets))if(r.baseCurrency===t)return r.baseToUsd.multipliedBy(e);else if(r.quoteCurrency===t)return r.quoteToUsd.multipliedBy(e);return new d(0)}getMarket(e){return this.markets[e]}},sm=class{subscriptions;pendingAdditions;pendingRemovals;constructor(){this.subscriptions=new Map,this.pendingAdditions=new Map,this.pendingRemovals=new Map}has(e){let t=this.subscriptions.get(e);return t!==void 0&&t.size>0}subscribe(e,t,n=!1){n&&this.unsubscribeAll(e);for(let n of t)this.pendingAdditions.has(n)||this.pendingAdditions.set(n,new Set),this.pendingAdditions.get(n).add(e),this.pendingRemovals.has(n)&&(this.pendingRemovals.get(n).delete(e),this.pendingRemovals.get(n).size===0&&this.pendingRemovals.delete(n))}unsubscribe(e,t){for(let n of t)this.pendingAdditions.has(n)&&(this.pendingAdditions.get(n).delete(e),this.pendingAdditions.get(n).size===0&&this.pendingAdditions.delete(n)),this.pendingRemovals.has(n)||this.pendingRemovals.set(n,new Set),this.pendingRemovals.get(n).add(e)}unsubscribeAll(e){for(let[t,n]of this.subscriptions)n.has(e)&&(this.pendingRemovals.has(t)||this.pendingRemovals.set(t,new Set),this.pendingRemovals.get(t).add(e));for(let[t,n]of this.pendingAdditions)n.delete(e),n.size===0&&this.pendingAdditions.delete(t)}exchangeCodes(){let e=new Set;for(let t of this.subscriptions.keys())e.add(t.split(`_`)[0]);return e}processPendingChanges(){for(let[e,t]of this.pendingAdditions){this.subscriptions.has(e)||this.subscriptions.set(e,new Set);let n=this.subscriptions.get(e);for(let e of t)n.add(e)}for(let[e,t]of this.pendingRemovals){if(!this.subscriptions.has(e))continue;let n=this.subscriptions.get(e);for(let e of t)n.delete(e);n.size===0&&this.subscriptions.delete(e)}this.pendingAdditions.clear(),this.pendingRemovals.clear()}},cm=10,lm=/\s*(?:(\d+(?:\.\d+)?(?![A-Za-z0-9_.]))|([A-Za-z0-9_.:]+(?:-[A-Za-z0-9_.:]+)*)|([-+*/()×÷]))\s*/y,um={"+":`+`,"-":`−`,"*":`×`,"/":`÷`},dm=e=>/[\s+*/()×÷]/.test(`${e}`);function fm(e){let t=[];for(lm.lastIndex=0;lm.lastIndex<e.length;){let n=lm.lastIndex,r=lm.exec(e);if(!r)throw Error(`Invalid formula at "${e.slice(n)}"`);if(r[1]!==void 0)t.push({kind:`num`,value:r[1]});else if(r[2]!==void 0){if(r[2].split(`_`).length<3)throw Error(`Invalid market "${r[2]}" in formula`);t.push({kind:`leg`,value:r[2]})}else t.push({kind:`op`,value:r[3]===`×`?`*`:r[3]===`÷`?`/`:r[3]})}return t}function pm(e){let t=fm(e),n=0,r=()=>t[n]?.kind===`op`?t[n].value:void 0,i=()=>{let e=a();for(;r()===`+`||r()===`-`;)e={type:`op`,op:t[n++].value,left:e,right:a()};return e},a=()=>{let e=o();for(;r()===`*`||r()===`/`;)e={type:`op`,op:t[n++].value,left:e,right:o()};return e},o=()=>r()===`-`?(n++,{type:`neg`,arg:o()}):s(),s=()=>{let e=t[n++];if(!e)throw Error(`Invalid formula: unexpected end`);if(e.kind===`num`)return{type:`num`,value:Number(e.value)};if(e.kind===`leg`)return{type:`leg`,symbol:e.value};if(e.value===`(`){let e=i();if(t[n++]?.value!==`)`)throw Error(`Invalid formula: missing )`);return e}throw Error(`Invalid formula: unexpected "${e.value}"`)},c=i();if(n<t.length)throw Error(`Invalid formula: unexpected "${t[n].value}"`);let l=mm(c);if(l.length===0)throw Error(`Invalid formula: no markets`);if(l.length>cm)throw Error(`Invalid formula: max ${cm} markets`);return c}function mm(e,t=[]){return e.type===`leg`&&!t.includes(e.symbol)&&t.push(e.symbol),e.type===`neg`&&mm(e.arg,t),e.type===`op`&&(mm(e.left,t),mm(e.right,t)),t}function hm(e,t){switch(e.type){case`num`:return e.value;case`leg`:return t(e.symbol);case`neg`:return-hm(e.arg,t);case`op`:{let n=hm(e.left,t),r=hm(e.right,t);return e.op===`+`?n+r:e.op===`-`?n-r:e.op===`*`?n*r:r===0?NaN:n/r}}}var gm=(e,t)=>({time:t,open:e.close,high:e.close,low:e.close,close:e.close,baseVolume:0,quoteVolume:0,numTrades:0});function _m(e,t,n){let r=n=>hm(e,e=>Number(t[e][n])),i=r(`open`),a=r(`close`),o=r(`high`),s=r(`low`);return[i,a,o,s].every(Number.isFinite)?{time:n,open:i,close:a,high:Math.max(i,a,o,s),low:Math.min(i,a,o,s),baseVolume:0,quoteVolume:0,numTrades:0}:null}function vm(e,t){if(e.some(e=>!t[e]?.length))return[];let n=Math.max(...e.map(e=>t[e][0].time.getTime())),r=[...new Set(e.flatMap(e=>t[e].map(e=>e.time.getTime())))].filter(e=>e>=n).sort((e,t)=>e-t),i={},a={};return r.map(n=>{let r={};for(let o of e){let e=t[o];for(i[o]??=0;i[o]<e.length&&e[i[o]].time.getTime()<=n;)a[o]=e[i[o]++];r[o]=a[o].time.getTime()===n?a[o]:gm(a[o],new Date(n))}return{time:new Date(n),legs:r}})}function ym(e,t){return vm(mm(e),t).map(({time:t,legs:n})=>_m(e,n,t)).filter(e=>e!==null)}function bm(e,t){let n=mm(e);if(n.some(e=>t[e]?.close===void 0))return null;let r=Math.max(...n.map(e=>t[e].time.getTime())),i={};for(let e of n)i[e]=t[e].time.getTime()===r?t[e]:gm(t[e],new Date(r));return _m(e,i,new Date(r))}function xm(e){return!Number.isFinite(e)||e===0?8:Math.min(12,Math.max(2,4-Math.floor(Math.log10(Math.abs(e)))))}function Sm(e,t){let n=pm(e),r=mm(n),i={};for(let e of r){let n=t(e);if(!n)throw Error(`Unknown market ${e}`);i[e]=n}let a=new Set(r.map(e=>i[e].exchangeCode)).size>1;return{name:fm(e).map(({kind:e,value:t})=>{if(e===`leg`){let e=i[t];return`${a?`${e.exchangeCode}:`:``}${e.baseCurrency}/${e.quoteCurrency}`}return um[t]?` ${um[t]} `:t}).join(``).replace(/\( /g,`(`).replace(/^ − /,`−`),legs:r,pricePrecision:xm(hm(n,e=>i[e].lastPrice?.toNumber()??NaN))}}var Cm=12e4,wm=6e5,Tm=6e5,Em=6e5,Dm=250,Om=10,km=e=>mo.default.uniq((Array.isArray(e)?e:[e]).map(e=>`${e}`.split(`_`)[0])),Am=class extends im{rootApi;apis;exchanges;initialized;refreshRate;_refreshingToken;tickerSubscriptions;tickerSubscriptionRefeshTimer;_onTokenExpired;onStoreCache;apiCache;rawCache={exchanges:[],markets:{}};destroyed=!1;formulaSubs=new Map;loopsStarted=!1;tickersTimer;staticTimer;exchangesTimer;liveLoadTimer;activationTimer;activationPromise=null;activationResolve;pinned=new Set;leases=new Map;graceUntil=new Map;active=new Set;pendingActivation=new Set;liveMarkets=new Map;staticEtags=new Map;staticCheckedAt=new Map;endpointDownUntil={tickers:0,static:0};constructor(e,t,n=3e4,r=void 0){super(),this.rootApi=new rm(e,t),this.apis=new Map,this.exchanges={},this.initialized=!1,this.refreshRate=n,this.tickerSubscriptions=new sm,this.tickerSubscriptionRefeshTimer=null,this.rootApi.onTokenExpired(this.refreshToken),this.onStoreCache=r?.onStoreCache,this.apiCache=r?.apiCache}async initialize(){this.initialized||=(await this.start(),!0)}getRootApi(){return this.rootApi}authenticateDevice(e,t){this.rootApi.authenticateDevice(e,t)}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(let t of this.apis.values())t.refreshToken(e);return e}}};onTokenExpired(e){this._onTokenExpired=e}async start(){if(this.apiCache)try{await this.refreshExchanges(this.apiCache),this.liveLoad();return}catch(e){console.error(e)}finally{this.apiCache=void 0}await this.liveLoad()}liveLoad=async()=>{try{await this.refreshExchanges(),this.startLoops()}catch(e){console.error(e),this.destroyed||(this.liveLoadTimer=setTimeout(this.liveLoad,this.refreshRate))}};startLoops(){if(this.destroyed||this.loopsStarted)return;this.recomputeActive(),this.loopsStarted=!0;let e=Date.now();for(let t of Object.keys(this.exchanges))this.staticCheckedAt.set(t,e);this.loop(`tickersTimer`,this.tickersTick,this.refreshRate),this.loop(`staticTimer`,this.staticTick,wm),this.loop(`exchangesTimer`,this.refreshExchangeList,Tm)}loop(e,t,n){this.destroyed||(this[e]=setTimeout(async()=>{try{await t()}catch(e){console.error(e)}this.loop(e,t,n)},n))}destroy(){this.destroyed=!0;for(let e of this.apis.values())try{e.destroy()}catch(e){console.error(`Could not destroy coinray`,e)}for(let e of[this.tickersTimer,this.staticTimer,this.exchangesTimer,this.liveLoadTimer,this.activationTimer,this.tickerSubscriptionRefeshTimer])clearTimeout(e);this.activationResolve?.(),this.initialized=!1}refreshExchanges=async(e=void 0)=>{let t={exchanges:[],markets:{}},n=await this.rootApi.fetchExchanges(e=>(t.exchanges.push(e),this.apis.has(e.code)||this.apis.set(e.code,this.rootApi),om.Create(e,this.apis.get(e.code))),e?.exchanges),r=await Promise.all(n.map(async t=>({[t.code]:await t.loadMarkets(e?.markets?.[t.code])})));this.destroyed||(t.markets=r.reduce((e,t)=>({...e,...t}),{}),this.exchanges=n.reduce((e,t)=>(e[t.code]=t,e),{}),this.rawCache=t,this.dispatchEvent(`marketsUpdated`,{exchangeCodes:Object.keys(this.exchanges)}),e||this.storeCache())};storeCache(){this.onStoreCache&&this.onStoreCache(this.rawCache)}setActiveExchanges(e){this.pinned=new Set(km(e)),this.recomputeActive()}touchExchange(e){let t=km(e);for(let e of t)this.leases.set(e,(this.leases.get(e)||0)+1);this.recomputeActive();let n=!1;return()=>{if(!n){n=!0;for(let e of t){let t=(this.leases.get(e)||0)-1;t>0?this.leases.set(e,t):this.leases.delete(e)}this.recomputeActive()}}}async ensureFresh(e){let t=km(e).filter(e=>this.exchanges[e]);if(t.length===0)return;let n=this.touchExchange(t);try{await this.scheduleActivation(t)}finally{n()}}getActiveExchanges(){return[...this.recomputeActive()].sort()}retainLiveMarket(e){this.liveMarkets.set(e,(this.liveMarkets.get(e)||0)+1);let t=!1;return()=>{if(t)return;t=!0;let n=(this.liveMarkets.get(e)||0)-1;n>0?this.liveMarkets.set(e,n):this.liveMarkets.delete(e)}}isLive(e){return this.tickerSubscriptions.has(e)||this.liveMarkets.has(e)}recomputeActive(){let e=Date.now(),t=new Set([...this.pinned,...this.leases.keys(),...this.tickerSubscriptions.exchangeCodes()]);for(let e of t)this.graceUntil.delete(e);for(let n of this.active)!t.has(n)&&!this.graceUntil.has(n)&&this.graceUntil.set(n,e+Cm);for(let[n,r]of this.graceUntil)r<=e?this.graceUntil.delete(n):t.add(n);let n=new Set([...t].filter(e=>this.exchanges[e]));if(this.loopsStarted){let e=[...n].filter(e=>!this.active.has(e));e.length&&this.scheduleActivation(e)}return this.active=n,n}scheduleActivation(e){if(this.destroyed)return Promise.resolve();for(let t of e)this.pendingActivation.add(t);return this.activationPromise||=new Promise(e=>{this.activationResolve=e,this.activationTimer=setTimeout(async()=>{let t=[...this.pendingActivation];this.pendingActivation.clear(),this.activationPromise=null;try{await this.fetchTickers(t);let e=Date.now(),n=t.filter(t=>e-(this.staticCheckedAt.get(t)||0)>=wm);Promise.all(n.map(this.revalidateStatic)).then(e=>e.some(Boolean)&&this.storeCache()),this.destroyed||this.dispatchEvent(`marketsUpdated`,{exchangeCodes:t})}catch(e){console.error(e)}e()},Dm)}),this.activationPromise}tickersTick=async()=>{let e=[...this.recomputeActive()].sort();await this.fetchTickers(e),this.destroyed||this.dispatchEvent(`marketsUpdated`,{exchangeCodes:e})};staticTick=async()=>{(await Promise.all([...this.recomputeActive()].map(this.revalidateStatic))).some(Boolean)&&this.storeCache()};fetchTickers=async e=>{this.destroyed||await Promise.all(mo.default.chunk([...e].sort(),Om).map(async e=>{if(Date.now()<this.endpointDownUntil.tickers)return Promise.all(e.map(this.refreshMarkets));try{let t=await this.rootApi.fetchTickers(e);if(this.endpointDownUntil.tickers=0,this.destroyed)return;for(let[e,n]of Object.entries(t)){let t=this.exchanges[e];if(t)for(let e of n)t.markets[e.coinraySymbol]?.applySnapshot(e,this.isLive(e.coinraySymbol))}}catch(t){this.markEndpointDown(`tickers`,t)?await Promise.all(e.map(this.refreshMarkets)):console.error(t)}}))};revalidateStatic=async e=>{let t=this.exchanges[e];if(!t||this.destroyed)return!1;if(Date.now()<this.endpointDownUntil.static)return await this.refreshMarkets(e),!0;try{let{markets:n,etag:r}=await this.rootApi.fetchStaticMarkets(e,this.staticEtags.get(e));if(this.endpointDownUntil.static=0,this.staticCheckedAt.set(e,Date.now()),this.destroyed||!n)return!1;r&&this.staticEtags.set(e,r);let i=mo.default.keyBy(this.rawCache.markets[e]||[],`coinraySymbol`),a=n.map(e=>({...i[e.coinraySymbol],...e})),{added:o}=t.mergeStatic(a);return a.length&&(this.rawCache.markets[e]=a),o.length&&this.scheduleActivation([e]),this.dispatchEvent(`marketsUpdated`,{exchangeCodes:[e]}),!0}catch(t){return this.markEndpointDown(`static`,t)?(await this.refreshMarkets(e),!0):(console.error(t),!1)}};markEndpointDown(e,t){return t?.status===404||t?.isAxiosError&&!t.response?(this.endpointDownUntil[e]||console.warn(`CoinrayCache: ${e} endpoint unavailable (${t?.message}), falling back to /markets`),this.endpointDownUntil[e]=Date.now()+Em,!0):!1}refreshExchangeList=async()=>{let e=await this.rootApi.fetchExchanges(e=>e,void 0);if(this.destroyed)return;let t={},n=[];for(let r of e){this.apis.has(r.code)||this.apis.set(r.code,this.rootApi);let e=this.exchanges[r.code];try{e?(e.update(r),t[r.code]=e):(t[r.code]=om.Create(r,this.apis.get(r.code)),n.push(r.code))}catch(n){console.error(n),e&&(t[r.code]=e)}}let r=Object.keys(this.exchanges).filter(e=>!t[e]);this.exchanges=t,this.rawCache.exchanges=e;for(let e of r)delete this.rawCache.markets[e];await Promise.all(n.map(this.refreshMarkets)),(n.length||r.length)&&(this.dispatchEvent(`marketsUpdated`,{exchangeCodes:n}),this.storeCache())};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]||om.Create({id:-1,name:e,code:e,websocket:!1,active:!1,tradingEnabled:!1,tradingEnabledFrom:``,isFutures:!1,isDex:!1,logo:`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
|
|
34
|
+
`,btcVolume:`0`,usdVolume:`0`,totalMarkets:0,quoteCurrencies:[]},this.rootApi)}refreshMarkets=async e=>{let t=this.exchanges[e];if(t&&!this.destroyed)try{let n=await t.loadMarkets();n.length&&(this.rawCache.markets[e]=n),this.staticCheckedAt.set(e,Date.now())}catch(e){console.error(e)}};searchMarkets(e){return Object.values(this.exchanges).reduce((t,n)=>(t={...t,...Qp(n.markets,e)},t),{})}getMarkets(e){switch(typeof e){case`string`:return this.getExchange(e).markets;default:return e.reduce((e,t)=>{let n=this.getMarket(t);return n&&(e[t]=n),e},{})}}getMarket=e=>{let t=`${e}`.split(`_`);if(t.length<3)return;let n=this.getExchange(t[0]);if(n)return n.getMarket(e)};async fetchCandles({coinraySymbol:e,resolution:t,start:n,end:r,useWebSocket:i}){if(dm(e)){let{node:a,legs:o}=this.parseFormulaSymbol(e),s=await Promise.all(o.map(e=>this.fetchCandles({coinraySymbol:e,resolution:t,start:n,end:r,useWebSocket:i})));return ym(a,mo.default.zipObject(o,s))}return this.apiForSymbol(e).fetchCandles({coinraySymbol:e,resolution:t,start:n,end:r,useWebSocket:i})}async fetchFirstCandleTime({coinraySymbol:e,resolution:t}){if(dm(e)){let{legs:n}=this.parseFormulaSymbol(e),r=await Promise.all(n.map(e=>this.fetchFirstCandleTime({coinraySymbol:e,resolution:t})));return mo.default.maxBy(r,e=>new Date(e).getTime())}return this.apiForSymbol(e).fetchFirstCandleTime({coinraySymbol:e,resolution:t})}subscribeTickers(e,t,n=!1){this.tickerSubscriptions.subscribe(e,t,n),this.scheduleTickerRefresh()}scheduleTickerRefresh(){this.destroyed||(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,t){this.tickerSubscriptions.unsubscribe(e,t),this.scheduleTickerRefresh()}async flushTickerSubscriptions(){let e=[],t=[];for(let t of this.tickerSubscriptions.pendingAdditions.keys())e.push(t);for(let[e,n]of this.tickerSubscriptions.pendingRemovals.entries()){let r=new Set(this.tickerSubscriptions.subscriptions.get(e)||[]);for(let e of n)r.delete(e);let i=this.tickerSubscriptions.pendingAdditions.get(e);if(i)for(let e of i)r.add(e);r.size===0&&t.push(e)}e.length&&await this.rootApi.subscribeTickers(e,!1,this.refreshMarketsFromTickers),t.length&&this.rootApi.unsubscribeTickers(t,this.refreshMarketsFromTickers),this.tickerSubscriptions.processPendingChanges(),this.recomputeActive()}refreshMarketsFromTickers=async e=>{let{exchangeCode:t,tickers:n}=e,r=this.getExchange(t);if(r){let e=!1;for(let t of n)if(this.tickerSubscriptions.has(t.coinraySymbol)){let n=r.getMarket(t.coinraySymbol);n&&(n.updateTicker(t),e=!0)}e&&this.dispatchEvent(`tickersUpdated`,{exchangeCode:t,coinraySymbols:n.map(e=>e.coinraySymbol)})}};async subscribeCandles({coinraySymbol:e,resolution:t,lastCandle:n},r){if(dm(e)){let{node:n,legs:i}=this.parseFormulaSymbol(e),a={},o=i.map(i=>[i,({candle:o})=>{a[i]=o;let s=bm(n,a);s&&r({coinraySymbol:e,resolution:t,candle:s,previousCandles:[]})}]),s=`${e}-${t}`;return this.formulaSubs.has(s)||this.formulaSubs.set(s,new Map),this.formulaSubs.get(s).set(r,o),await Promise.all(o.map(([e,n])=>this.subscribeCandles({coinraySymbol:e,resolution:t},n))),r}return this.apiForSymbol(e).subscribeCandles({coinraySymbol:e,resolution:t,lastCandle:n},r)}async unsubscribeCandles({coinraySymbol:e,resolution:t},n){if(dm(e)){let r=this.formulaSubs.get(`${e}-${t}`);if(!r)return;for(let e of n?[n]:[...r.keys()]){for(let[n,i]of r.get(e)??[])await this.unsubscribeCandles({coinraySymbol:n,resolution:t},i);r.delete(e)}return}await this.apiForSymbol(e).unsubscribeCandles({coinraySymbol:e,resolution:t},n)}async subscribeOrderBook({coinraySymbol:e},t){if(dm(e))throw Error(`Not supported for formula symbols`);await this.apiForSymbol(e).subscribeOrderBook({coinraySymbol:e},t)}async unsubscribeOrderBook({coinraySymbol:e},t){await this.apiForSymbol(e).unsubscribeOrderBook({coinraySymbol:e},t)}async subscribeTrades({coinraySymbol:e},t){if(dm(e))throw Error(`Not supported for formula symbols`);await this.apiForSymbol(e).subscribeTrades({coinraySymbol:e},t)}async unsubscribeTrades({coinraySymbol:e},t){await this.apiForSymbol(e).unsubscribeTrades({coinraySymbol:e},t)}formulaSymbolInfo(e){return Sm(e,this.getMarket)}parseFormulaSymbol(e){let t=pm(e),n=mm(t),r=n.find(e=>!this.apiForSymbol(e));if(r)throw Error(`Unknown exchange for ${r}`);return{node:t,legs:n}}apiForSymbol(e){let t=`${e}`.split(`_`);if(t.length<3)return;let n=t[0];return this.apis.get(n)}},jm=class extends Error{constructor(e){super(e),this.name=`MarketNotFoundError`}},Mm=class extends im{coinrayCache;getPriceOverrides;coinraySymbol;orderBook;trades;tradesDelayed;maxTrades;releaseLiveMarket;prevTickers={lastPrice:new d(0),askPrice:new d(0),bidPrice:new d(0)};constructor(e,t={}){super(),this.coinrayCache=e,this.maxTrades=t.maxTrades||100,t.getPriceOverrides&&(this.getPriceOverrides=t.getPriceOverrides),this.destroy()}setCoinraySymbol(e){this.dispatchEvent(`coinraySymbolWillChange`,{coinraySymbol:e}),this.stop(),this.releaseLiveMarket?.(),this.releaseLiveMarket=e?this.coinrayCache.retainLiveMarket?.(e):void 0,this.coinraySymbol=e,this.startOrderBook(),this.startTrades(),this.dispatchEvent(`coinraySymbolChanged`,{coinraySymbol:e})}destroy(){this.releaseLiveMarket?.(),this.releaseLiveMarket=void 0,this.coinraySymbol=null,this.removeAllListeners(),this.stop()}stop(){this.stopOrderBook(),this.stopTrades()}getExchange(){return this.coinrayCache.getExchange(this.getMarket().exchangeCode)}getMarket(){if(this.coinraySymbol){let e=this.coinrayCache.getMarket(this.coinraySymbol);return e.overridePrices(this.getPriceOverrides),e}throw new jm(`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:t,askPrice:n})=>{e&&(this.prevTickers.lastPrice=$(e)),n&&(this.prevTickers.askPrice=$(n)),t&&(this.prevTickers.bidPrice=$(t))};handleMarketUpdate=({data:{type:e,coinraySymbol:t,...n}})=>{if(this.coinraySymbol!==t){this.unsubscribeOrderBook(this.handleOrderBook),this.unsubscribeTrades(this.handleOrderBook);return}switch(e){case`trades:snapshot`:case`trades:update`:{let{trades:e}=n;if(e.length===0)break;let t=this.getMarket(),r=$(e[0].price);(!t._lastPrice.eq(r)||!this.prevTickers.lastPrice.eq(r))&&(t.updateLastPrice(r),this.updatePrevTicker({lastPrice:r}),this.dispatchEvent(`marketUpdated`,{market:t}));break}case`orderBook:snapshot`:case`orderBook:update`:{let{orderBook:{bids:e,asks:t}}=n,r=this.getMarket();if(e.length===0||t.length===0)break;let i=t[0].price,a=e[0].price,o=!r._askPrice.eq(i)||!r._bidPrice.eq(a),s=!this.prevTickers.askPrice.eq(i)||!this.prevTickers.bidPrice.eq(a);(o||s)&&(r.updateBidAsk(a,i),this.updatePrevTicker({askPrice:i,bidPrice:a}),this.dispatchEvent(`marketUpdated`,{market:r}));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:t,orderBook:n})=>{if(this.coinraySymbol!==t){this.coinrayCache.unsubscribeOrderBook({coinraySymbol:t},this.handleOrderBook);return}e===`orderBook:snapshot`&&(this.orderBook={minSeq:void 0,maxSeq:void 0,bids:{},asks:{}});let{minSeq:r,maxSeq:i,bids:a,asks:o}=n,s=(e,t)=>{mo.default.forEach(t,(t,n)=>{t>0?e[n]={price:new d(n),quantity:t}:delete e[n]})};if(r-this.orderBook.maxSeq>1){this.stopOrderBook(),this.startOrderBook();return}this.orderBook.minSeq=r,this.orderBook.maxSeq=i,s(this.orderBook.bids,a),s(this.orderBook.asks,o),this.dispatchEvent(`orderBookUpdated`,{type:e,coinraySymbol:t,orderBook:{minSeq:r,maxSeq:i,bids:Object.values(this.orderBook.bids).sort(({price:e},{price:t})=>t.minus(e)),asks:Object.values(this.orderBook.asks).sort(({price:e},{price:t})=>e.minus(t))}})};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:t,trades:n})=>{if(this.coinraySymbol!==t){this.coinrayCache.unsubscribeTrades({coinraySymbol:t},this.handleTrades);return}if(e===`trades:snapshot`&&(this.trades=[]),this.trades=[...n,...this.trades].sort((e,t)=>t.time.getTime()-e.time.getTime()).slice(0,this.maxTrades),this.dispatchEvent(`tradesUpdated`,{type:e,coinraySymbol:t,trades:this.trades}),!this.trades.length)return;let r=Date.now()-this.trades[0].time.getTime();e===`trades:snapshot`&&this.tradesDelayed?this.dispatchTradesDelayed({type:e,coinraySymbol:t,tradesDelayed:!1,delayInMs:r}):e===`trades:update`&&(this.tradesDelayed&&r<3e4?this.dispatchTradesDelayed({type:e,coinraySymbol:t,tradesDelayed:!1,delayInMs:r}):!this.tradesDelayed&&r>=3e4&&this.dispatchTradesDelayed({type:e,coinraySymbol:t,tradesDelayed:!0,delayInMs:r}))};dispatchTradesDelayed=({type:e,coinraySymbol:t,tradesDelayed:n,delayInMs:r})=>{this.tradesDelayed=n,this.dispatchEvent(`tradesDelayed`,{type:e,coinraySymbol:t,tradesDelayed:n,delayInMs:r})};unsubscribeTrades=e=>{this.off(`tradesUpdated`,e),this.hasListeners(`tradesUpdated`)||this.stopTrades()};subscribeTradesDelayed=e=>(this.on(`tradesDelayed`,e),e);unsubscribeTradesDelayed=e=>{this.off(`tradesDelayed`,e)}},Nm={"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:`Недостаточно средств`}}},Pm=u(s(((e,t)=>{(function(e,t,n){"use strict";var r=function(e,t,n){n=i.extend({},i.options,n);var a=i.runValidations(e,t,n);if(a.some(function(e){return i.isPromise(e.error)}))throw Error(`Use validate.async if you want support for promises`);return r.processValidationResults(a,n)},i=r;i.extend=function(e){return[].slice.call(arguments,1).forEach(function(t){for(var n in t)e[n]=t[n]}),e},i.extend(r,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var e=i.format(`%{major}.%{minor}.%{patch}`,i.version);return i.isEmpty(i.version.metadata)||(e+=`+`+i.version.metadata),e}},Promise:typeof Promise<`u`?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(e,t,n){var r=[],a,o,s,c,l,u,d;for(a in(i.isDomElement(e)||i.isJqueryElement(e))&&(e=i.collectFormValues(e)),t)for(o in s=i.getDeepObjectValue(e,a),c=i.result(t[a],s,e,a,n,t),c){if(l=i.validators[o],!l)throw d=i.format(`Unknown validator %{name}`,{name:o}),Error(d);u=c[o],u=i.result(u,s,e,a,n,t),u&&r.push({attribute:a,value:s,validator:o,globalOptions:n,attributes:e,options:u,error:l.call(l,s,u,a,e,n)})}return r},processValidationResults:function(e,t){e=i.pruneEmptyErrors(e,t),e=i.expandMultipleErrors(e,t),e=i.convertErrorMessages(e,t);var n=t.format||`grouped`;if(typeof i.formatters[n]==`function`)e=i.formatters[n](e);else throw Error(i.format(`Unknown format %{format}`,t));return i.isEmpty(e)?void 0:e},async:function(e,t,n){n=i.extend({},i.async.options,n);var r=n.wrapErrors||function(e){return e};n.cleanAttributes!==!1&&(e=i.cleanAttributes(e,t));var a=i.runValidations(e,t,n);return new i.Promise(function(o,s){i.waitForResults(a).then(function(){var c=i.processValidationResults(a,n);c?s(new r(c,n,e,t)):o(e)},function(e){s(e)})})},single:function(e,t,n){return n=i.extend({},i.single.options,n,{format:`flat`,fullMessages:!1}),i({single:e},{single:t},n)},waitForResults:function(e){return e.reduce(function(e,t){return i.isPromise(t.error)?e.then(function(){return t.error.then(function(e){t.error=e||null})}):e},new i.Promise(function(e){e()}))},result:function(e){var t=[].slice.call(arguments,1);return typeof e==`function`&&(e=e.apply(null,t)),e},isNumber:function(e){return typeof e==`number`&&!isNaN(e)},isFunction:function(e){return typeof e==`function`},isInteger:function(e){return i.isNumber(e)&&e%1==0},isBoolean:function(e){return typeof e==`boolean`},isObject:function(e){return e===Object(e)},isDate:function(e){return e instanceof Date},isDefined:function(e){return e!=null},isPromise:function(e){return!!e&&i.isFunction(e.then)},isJqueryElement:function(e){return e&&i.isString(e.jquery)},isDomElement:function(e){return!e||!e.querySelectorAll||!e.querySelector?!1:i.isObject(document)&&e===document?!0:typeof HTMLElement==`object`?e instanceof HTMLElement:e&&typeof e==`object`&&!!e&&e.nodeType===1&&typeof e.nodeName==`string`},isEmpty:function(e){var t;if(!i.isDefined(e))return!0;if(i.isFunction(e))return!1;if(i.isString(e))return i.EMPTY_STRING_REGEXP.test(e);if(i.isArray(e))return e.length===0;if(i.isDate(e))return!1;if(i.isObject(e)){for(t in e)return!1;return!0}return!1},format:i.extend(function(e,t){return i.isString(e)?e.replace(i.format.FORMAT_REGEXP,function(e,n,r){return n===`%`?`%{`+r+`}`:String(t[r])}):e},{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(e){return i.isNumber(e)?e*100%1==0?``+e:parseFloat(Math.round(e*100)/100).toFixed(2):i.isArray(e)?e.map(function(e){return i.prettify(e)}).join(`, `):i.isObject(e)?i.isDefined(e.toString)?e.toString():JSON.stringify(e):(e=``+e,e.replace(/([^\s])\.([^\s])/g,`$1 $2`).replace(/\\+/g,``).replace(/[_-]/g,` `).replace(/([a-z])([A-Z])/g,function(e,t,n){return``+t+` `+n.toLowerCase()}).toLowerCase())},stringifyValue:function(e,t){return(t&&t.prettify||i.prettify)(e)},isString:function(e){return typeof e==`string`},isArray:function(e){return{}.toString.call(e)===`[object Array]`},isHash:function(e){return i.isObject(e)&&!i.isArray(e)&&!i.isFunction(e)},contains:function(e,t){return i.isDefined(e)?i.isArray(e)?e.indexOf(t)!==-1:t in e:!1},unique:function(e){return i.isArray(e)?e.filter(function(e,t,n){return n.indexOf(e)==t}):e},forEachKeyInKeypath:function(e,t,n){if(i.isString(t)){var r=``,a,o=!1;for(a=0;a<t.length;++a)switch(t[a]){case`.`:o?(o=!1,r+=`.`):(e=n(e,r,!1),r=``);break;case`\\`:o?(o=!1,r+=`\\`):o=!0;break;default:o=!1,r+=t[a]}return n(e,r,!0)}},getDeepObjectValue:function(e,t){if(i.isObject(e))return i.forEachKeyInKeypath(e,t,function(e,t){if(i.isObject(e))return e[t]})},collectFormValues:function(e,t){var n={},r,a,o,s,c,l;if(i.isJqueryElement(e)&&(e=e[0]),!e)return n;for(t||={},s=e.querySelectorAll(`input[name], textarea[name]`),r=0;r<s.length;++r)if(o=s.item(r),!i.isDefined(o.getAttribute(`data-ignored`))){var u=o.name.replace(/\./g,`\\\\.`);l=i.sanitizeFormValue(o.value,t),o.type===`number`?l=l?+l:null:o.type===`checkbox`?o.attributes.value?o.checked||(l=n[u]||null):l=o.checked:o.type===`radio`&&(o.checked||(l=n[u]||null)),n[u]=l}for(s=e.querySelectorAll(`select[name]`),r=0;r<s.length;++r)if(o=s.item(r),!i.isDefined(o.getAttribute(`data-ignored`))){if(o.multiple)for(a in l=[],o.options)c=o.options[a],c&&c.selected&&l.push(i.sanitizeFormValue(c.value,t));else{var d=o.options[o.selectedIndex]===void 0?``:o.options[o.selectedIndex].value;l=i.sanitizeFormValue(d,t)}n[o.name]=l}return n},sanitizeFormValue:function(e,t){return t.trim&&i.isString(e)&&(e=e.trim()),t.nullify!==!1&&e===``?null:e},capitalize:function(e){return i.isString(e)?e[0].toUpperCase()+e.slice(1):e},pruneEmptyErrors:function(e){return e.filter(function(e){return!i.isEmpty(e.error)})},expandMultipleErrors:function(e){var t=[];return e.forEach(function(e){i.isArray(e.error)?e.error.forEach(function(n){t.push(i.extend({},e,{error:n}))}):t.push(e)}),t},convertErrorMessages:function(e,t){t||={};var n=[],r=t.prettify||i.prettify;return e.forEach(function(e){var a=i.result(e.error,e.value,e.attribute,e.options,e.attributes,e.globalOptions);if(!i.isString(a)){n.push(e);return}a[0]===`^`?a=a.slice(1):t.fullMessages!==!1&&(a=i.capitalize(r(e.attribute))+` `+a),a=a.replace(/\\\^/g,`^`),a=i.format(a,{value:i.stringifyValue(e.value,t)}),n.push(i.extend({},e,{error:a}))}),n},groupErrorsByAttribute:function(e){var t={};return e.forEach(function(e){var n=t[e.attribute];n?n.push(e):t[e.attribute]=[e]}),t},flattenErrorsToArray:function(e){return e.map(function(e){return e.error}).filter(function(e,t,n){return n.indexOf(e)===t})},cleanAttributes:function(e,t){function n(e,t,n){return i.isObject(e[t])?e[t]:e[t]=n?!0:{}}function r(e){var t={},r;for(r in e)e[r]&&i.forEachKeyInKeypath(t,r,n);return t}function a(e,t){if(!i.isObject(e))return e;var n=i.extend({},e),r,o;for(o in e)r=t[o],i.isObject(r)?n[o]=a(n[o],r):r||delete n[o];return n}return!i.isObject(t)||!i.isObject(e)?{}:(t=r(t),a(e,t))},exposeModule:function(e,t,n,r,i){n?(r&&r.exports&&(n=r.exports=e),n.validate=e):(t.validate=e,e.isFunction(i)&&i.amd&&i([],function(){return e}))},warn:function(e){typeof console<`u`&&console.warn&&console.warn(`[validate.js] `+e)},error:function(e){typeof console<`u`&&console.error&&console.error(`[validate.js] `+e)}}),r.validators={presence:function(e,t){if(t=i.extend({},this.options,t),t.allowEmpty===!1?i.isEmpty(e):!i.isDefined(e))return t.message||this.message||`can't be blank`},length:function(e,t,n){if(i.isDefined(e)){t=i.extend({},this.options,t);var r=t.is,a=t.maximum,o=t.minimum,s=t.tokenizer||function(e){return e},c,l=[];e=s(e);var u=e.length;if(!i.isNumber(u))return t.message||this.notValid||`has an incorrect length`;if(i.isNumber(r)&&u!==r&&(c=t.wrongLength||this.wrongLength||`is the wrong length (should be %{count} characters)`,l.push(i.format(c,{count:r}))),i.isNumber(o)&&u<o&&(c=t.tooShort||this.tooShort||`is too short (minimum is %{count} characters)`,l.push(i.format(c,{count:o}))),i.isNumber(a)&&u>a&&(c=t.tooLong||this.tooLong||`is too long (maximum is %{count} characters)`,l.push(i.format(c,{count:a}))),l.length>0)return t.message||l}},numericality:function(e,t,n,r,a){if(i.isDefined(e)){t=i.extend({},this.options,t);var o=[],s,c,l={greaterThan:function(e,t){return e>t},greaterThanOrEqualTo:function(e,t){return e>=t},equalTo:function(e,t){return e===t},lessThan:function(e,t){return e<t},lessThanOrEqualTo:function(e,t){return e<=t},divisibleBy:function(e,t){return e%t===0}},u=t.prettify||a&&a.prettify||i.prettify;if(i.isString(e)&&t.strict){var d=`^-?(0|[1-9]\\d*)`;if(t.onlyInteger||(d+=`(\\.\\d+)?`),d+=`$`,!new RegExp(d).test(e))return t.message||t.notValid||this.notValid||this.message||`must be a valid number`}if(t.noStrings!==!0&&i.isString(e)&&!i.isEmpty(e)&&(e=+e),!i.isNumber(e))return t.message||t.notValid||this.notValid||this.message||`is not a number`;if(t.onlyInteger&&!i.isInteger(e))return t.message||t.notInteger||this.notInteger||this.message||`must be an integer`;for(s in l)if(c=t[s],i.isNumber(c)&&!l[s](e,c)){var f=`not`+i.capitalize(s),p=t[f]||this[f]||this.message||`must be %{type} %{count}`;o.push(i.format(p,{count:c,type:u(s)}))}if(t.odd&&e%2!=1&&o.push(t.notOdd||this.notOdd||this.message||`must be odd`),t.even&&e%2!=0&&o.push(t.notEven||this.notEven||this.message||`must be even`),o.length)return t.message||o}},datetime:i.extend(function(e,t){if(!i.isFunction(this.parse)||!i.isFunction(this.format))throw Error(`Both the parse and format functions needs to be set to use the datetime/date validator`);if(i.isDefined(e)){t=i.extend({},this.options,t);var n,r=[],a=t.earliest?this.parse(t.earliest,t):NaN,o=t.latest?this.parse(t.latest,t):NaN;if(e=this.parse(e,t),isNaN(e)||t.dateOnly&&e%864e5!=0)return n=t.notValid||t.message||this.notValid||`must be a valid date`,i.format(n,{value:arguments[0]});if(!isNaN(a)&&e<a&&(n=t.tooEarly||t.message||this.tooEarly||`must be no earlier than %{date}`,n=i.format(n,{value:this.format(e,t),date:this.format(a,t)}),r.push(n)),!isNaN(o)&&e>o&&(n=t.tooLate||t.message||this.tooLate||`must be no later than %{date}`,n=i.format(n,{date:this.format(o,t),value:this.format(e,t)}),r.push(n)),r.length)return i.unique(r)}},{parse:null,format:null}),date:function(e,t){return t=i.extend({},t,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,e,t)},format:function(e,t){(i.isString(t)||t instanceof RegExp)&&(t={pattern:t}),t=i.extend({},this.options,t);var n=t.message||this.message||`is invalid`,r=t.pattern,a;if(i.isDefined(e)&&(!i.isString(e)||(i.isString(r)&&(r=new RegExp(t.pattern,t.flags)),a=r.exec(e),!a||a[0].length!=e.length)))return n},inclusion:function(e,t){if(i.isDefined(e)&&(i.isArray(t)&&(t={within:t}),t=i.extend({},this.options,t),!i.contains(t.within,e))){var n=t.message||this.message||`^%{value} is not included in the list`;return i.format(n,{value:e})}},exclusion:function(e,t){if(i.isDefined(e)&&(i.isArray(t)&&(t={within:t}),t=i.extend({},this.options,t),i.contains(t.within,e))){var n=t.message||this.message||`^%{value} is restricted`;return i.isString(t.within[e])&&(e=t.within[e]),i.format(n,{value:e})}},email:i.extend(function(e,t){t=i.extend({},this.options,t);var n=t.message||this.message||`is not a valid email`;if(i.isDefined(e)&&(!i.isString(e)||!this.PATTERN.exec(e)))return n},{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(e,t,n,r,a){if(i.isDefined(e)){i.isString(t)&&(t={attribute:t}),t=i.extend({},this.options,t);var o=t.message||this.message||`is not equal to %{attribute}`;if(i.isEmpty(t.attribute)||!i.isString(t.attribute))throw Error(`The attribute must be a non empty string`);var s=i.getDeepObjectValue(r,t.attribute),c=t.comparator||function(e,t){return e===t},l=t.prettify||a&&a.prettify||i.prettify;if(!c(e,s,t,n,r))return i.format(o,{attribute:l(t.attribute)})}},url:function(e,t){if(i.isDefined(e)){t=i.extend({},this.options,t);var n=t.message||this.message||`is not a valid url`,r=t.schemes||this.schemes||[`http`,`https`],a=t.allowLocal||this.allowLocal||!1,o=t.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(e))return n;var s=`^(?:(?:`+r.join(`|`)+`)://)(?:\\S+(?::\\S*)?@)?(?:`,c=`(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))`;if(a?c+=`?`:s+=`(?!(?: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})`,s+=`(?:[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]+)*`+c+`)(?::\\d{2,5})?(?:[/?#]\\S*)?$`,o&&(s=`(?:`+s+`)|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)`),!new RegExp(s,`i`).exec(e))return n}},type:i.extend(function(e,t,n,r,a){if(i.isString(t)&&(t={type:t}),i.isDefined(e)){var o=i.extend({},this.options,t),s=o.type;if(!i.isDefined(s))throw Error(`No type was specified`);var c=i.isFunction(s)?s:this.types[s];if(!i.isFunction(c))throw Error(`validate.validators.type.types.`+s+` must be a function.`);if(!c(e,o,n,r,a)){var l=t.message||this.messages[s]||this.message||o.message||(i.isFunction(s)?`must be of the correct type`:`must be of type %{type}`);return i.isFunction(l)&&(l=l(e,t,n,r,a)),i.format(l,{attribute:i.prettify(n),type:s})}}},{types:{object:function(e){return i.isObject(e)&&!i.isArray(e)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(e){return e},flat:i.flattenErrorsToArray,grouped:function(e){for(var t in e=i.groupErrorsByAttribute(e),e)e[t]=i.flattenErrorsToArray(e[t]);return e},constraint:function(e){for(var t in e=i.groupErrorsByAttribute(e),e)e[t]=e[t].map(function(e){return e.validator}).sort();return e}},r.exposeModule(r,this,e,t,n)}).call(e,e===void 0?null:e,t===void 0?null:t,typeof define<`u`?define:null)}))(),1);Pm.default.validators.bigNumericality=(e,t,n,r)=>Pm.default.validators.numericality(e&&e.toNumber(),t,r);var Fm=Pm.default,Im=c({BalanceLimit:()=>Wm,ExchangeFeatures:()=>Rm,IpWhiteList:()=>zm,MarginType:()=>Bm,OrderSide:()=>Hm,OrderStatus:()=>Vm,OrderType:()=>Lm,TimeInForce:()=>Um}),Lm=function(e){return e.MARKET=`MARKET`,e.LIMIT=`LIMIT`,e.LIMIT_LADDER=`LIMIT_LADDER`,e.STOP_LOSS=`STOP_LOSS`,e.OCO=`OCO`,e.STOP_LOSS_LIMIT=`STOP_LOSS_LIMIT`,e.STOP_LOSS_MARKET=`STOP_LOSS_MARKET`,e.TAKE_PROFIT=`TAKE_PROFIT`,e.TAKE_PROFIT_LIMIT=`TAKE_PROFIT_LIMIT`,e.TAKE_PROFIT_MARKET=`TAKE_PROFIT_MARKET`,e}({}),Rm=function(e){return e.HEDGE_MODE=`hedgeMode`,e.HEDGE_MODE_ONLY=`hedgeModeOnly`,e.ORDER_QUOTE_AMOUNT=`orderQuoteAmount`,e.MARKET_BUY_QUOTE_ONLY=`marketBuyQuoteOnly`,e.UPDATE_LEVERAGE_ONLY_ON_OPEN_POSITIONS=`updateLeverageOnlyOnOpenPositions`,e.IGNORE_LEVERAGE_ON_QUICK_SYNC=`ignoreLeverageOnQuickSync`,e.MULTIPLE_MARGIN_TYPE_POSITIONS=`multipleMarginTypePositions`,e.SET_LEVERAGE_NOT_AVAILABLE=`setLeverageNotAvailable`,e.SET_MARGIN_TYPE_NOT_AVAILABLE=`setMarginTypeNotAvailable`,e.FIXED_CROSSED_LEVERAGE=`fixedCrossedLeverage`,e.FAST_CONNECT=`fastConnect`,e.UNIFIED_BALANCE=`unifiedBalance`,e.NO_API_KEY_LINK=`noApiKeyLink`,e}({}),zm=function(e){return e.NONE=`NONE`,e.LIST=`LIST`,e.COMMA=`COMMA`,e.COMMA_SPACE=`COMMA_SPACE`,e.SPACE=`SPACE`,e}({}),Bm=function(e){return e.CROSSED=`CROSSED`,e.ISOLATED=`ISOLATED`,e}({}),Vm=function(e){return e.OPEN=`open`,e.CLOSED=`closed`,e.CANCELED=`canceled`,e}({}),Hm=function(e){return e.BUY=`buy`,e.SELL=`sell`,e}({}),Um=function(e){return e.GTC=`gtc`,e.FOK=`fok`,e.IOC=`ioc`,e}({}),Wm=function(e){return e.QUOTE=`quote`,e.BASE=`base`,e.NONE=`none`,e}({}),Gm=[];for(let e=0;e<256;++e)Gm.push((e+256).toString(16).slice(1));function Km(e,t=0){return(Gm[e[t+0]]+Gm[e[t+1]]+Gm[e[t+2]]+Gm[e[t+3]]+`-`+Gm[e[t+4]]+Gm[e[t+5]]+`-`+Gm[e[t+6]]+Gm[e[t+7]]+`-`+Gm[e[t+8]]+Gm[e[t+9]]+`-`+Gm[e[t+10]]+Gm[e[t+11]]+Gm[e[t+12]]+Gm[e[t+13]]+Gm[e[t+14]]+Gm[e[t+15]]).toLowerCase()}var qm=new Uint8Array(16);function Jm(){return crypto.getRandomValues(qm)}function Ym(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Xm(e,t,n)}function Xm(e,t,n){e||={};let r=e.random??e.rng?.()??Jm();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Km(r)}var Zm=class{id=Ym();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=Hp(e.precisionBase),this.precisionQuote=Hp(e.precisionQuote),this.precisionPrice=Hp(e.precisionPrice),this.minBase=$(e.minBase),this.minQuote=$(e.minQuote),this.makerFee=$(e.makerFee),this.takerFee=$(e.takerFee),this.balances=e.balances,this.balanceLimit=e.balanceLimit||Wm.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(){let e=Fm(this,this.constraints());return e?(this.errors=e,this.isValid=!1):this.resetError(),!e}},Qm=class extends Zm{baseAmount;quoteAmount;price;lockedOn;orderType=Lm.LIMIT;constraints(){let e,t;return this.balanceLimit===Wm.QUOTE?t=this.balances.quote||0:this.balanceLimit===Wm.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${rm.I18n.t(`validation.insufficientFunds`)}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${rm.I18n.t(`validation.insufficientFunds`)}`}},price:{bigNumericality:{greaterThan:0}}}}constructor(e,t=!0){super(e),this.price=$(e.price||`0`),this.lockedOn=e.lockedOn,this.baseAmount=$(e.baseAmount),this.quoteAmount=$(e.quoteAmount),t&&(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,d.ROUND_DOWN),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,d.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]}},$m=class extends Zm{baseAmount;quoteAmount;price;orderType=Lm.MARKET;constraints=()=>{let e,t;return this.balanceLimit===Wm.QUOTE?t=this.balances.quote||0:this.balanceLimit===Wm.BASE&&(e=this.balances.base||0),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:e?this.minBase.toNumber():void 0,notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${rm.I18n.t(`validation.insufficientFunds`)}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:t?this.minQuote.toNumber():void 0,notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${rm.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,d.ROUND_DOWN)),this.validate()}updateQuoteAmount(e){this.quoteAmount=e,e&&(this.baseAmount=e.dividedBy(this.price).decimalPlaces(this.precisionBase>0?this.precisionBase:0,d.ROUND_DOWN)),this.validate()}updatePrice(e){this.price=e.decimalPlaces(this.precisionPrice)}getOrders(){return[this]}},eh=function(e){return e.LINEAR=`LINEAR`,e.EXPONENTIAL=`EXPONENTIAL`,e.FIBONACCI=`FIBONACCI`,e.CUSTOM=`CUSTOM`,e}({}),th=function(e){return e.EQUAL=`EQUAL`,e.LINEAR=`LINEAR`,e.LINEAR_REVERSE=`LINEAR_REVERSE`,e.EXPONENTIAL=`EXPONENTIAL`,e.EXPONENTIAL_REVERSE=`EXPONENTIAL_REVERSE`,e.CUSTOM=`CUSTOM`,e}({}),nh={[eh.LINEAR]:e=>mo.default.times(e,t=>1/(e-1)*t),[eh.EXPONENTIAL]:e=>{let t=2**(e-1);return mo.default.times(e,e=>e==0?0:2**e/t)},[eh.FIBONACCI]:e=>[0,.09,.146,.236,.382,.5,.618,.788,.886].slice(0,e-1).concat([1]),[eh.CUSTOM]:e=>[]},rh=e=>{let t=mo.default.sum(e);return e.map(e=>e/t)},ih={[th.EQUAL]:e=>rh(mo.default.times(e,()=>1)),[th.LINEAR]:e=>rh(mo.default.times(e,t=>1/e*(t+1))),[th.EXPONENTIAL]:e=>{let t=2**e-1;return rh(mo.default.times(e,e=>2**e/t))},[th.LINEAR_REVERSE]:e=>ih[th.LINEAR](e).reverse(),[th.EXPONENTIAL_REVERSE]:e=>ih[th.EXPONENTIAL](e).reverse(),[th.CUSTOM]:e=>[]},ah=class extends Zm{baseAmount;quoteAmount;price;lockedOn;otherPrice;numOrders;priceScale;sizeScale;priceScales;sizeScales;orderType=Lm.LIMIT_LADDER;constraints(){let e,t;return this.balanceLimit===Wm.QUOTE?t=this.balances.quote:this.balanceLimit===Wm.BASE&&(e=this.balances.base),{baseAmount:{bigNumericality:{greaterThanOrEqualTo:this.minBase.toNumber(),notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionBase,this.minBase)})}`,lessThanOrEqualTo:e?e.toNumber():void 0,notLessThanOrEqualTo:`^${rm.I18n.t(`validation.insufficientFunds`)}`}},quoteAmount:{bigNumericality:{greaterThanOrEqualTo:this.minQuote.toNumber(),notGreaterThanOrEqualTo:`^${rm.I18n.t(`validation.notGreaterThanOrEqualTo`,{min:Bp(this.precisionQuote,this.minQuote)})}`,lessThanOrEqualTo:t?t.toNumber():void 0,notLessThanOrEqualTo:`^${rm.I18n.t(`validation.insufficientFunds`)}`}},price:{bigNumericality:{greaterThan:0}},otherPrice:{bigNumericality:{greaterThan:0}},numOrders:{numericality:{greaterThanOrEqualTo:2}}}}constructor(e){super(e),this.otherPrice=$(e.otherPrice),this.numOrders=Hp(e.numOrders),this.priceScale=e.priceScale||eh.CUSTOM,this.sizeScale=e.sizeScale||th.CUSTOM,this.price=$(e.price||`0`),this.lockedOn=e.lockedOn,this.baseAmount=$(e.baseAmount||`0`),this.quoteAmount=$(e.quoteAmount||`0`),this.priceScales=e.priceScales||nh[this.priceScale](this.numOrders),this.sizeScales=e.sizeScales||ih[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,t=.05){if(this.price=e.decimalPlaces(this.precisionPrice),e&&this.otherPrice.eq(0)){let n=this.side===Hm.BUY?1+t:1-t;this.otherPrice=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updateOtherPrice(e,t=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){let n=this.side===Hm.BUY?1-t:1+t;this.price=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}this.recalculate()}updatePriceScales(e){this.priceScales=e,this.priceScale=eh.CUSTOM,this.recalculate()}updatePriceScale(e){this.priceScales=nh[e](this.numOrders),this.priceScale=e,this.recalculate()}updateSizeScales(e){this.sizeScales=e,this.sizeScale=th.CUSTOM,this.recalculate()}updateSizeScale(e){this.sizeScales=ih[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);let t=this.getOrders(`quoteAmount`);this.baseAmount=t.length>0?mo.default.reduce(t,(e,t)=>e.plus(t.baseAmount),new d(0)):new d(0)}updateBaseAmount(e){this.baseAmount=e,this.numOrders=Math.max(2,+this.numOrders);let t=this.getOrders(`baseAmount`);this.quoteAmount=t.length>0?mo.default.reduce(t,(e,t)=>e.plus(t.quoteAmount),new d(0)):new d(0)}getOrders(e=this.lockedOn){let t=e===`baseAmount`?this.baseAmount:this.quoteAmount,n=e===`baseAmount`?this.precisionBase:this.precisionQuote;if(!(this.priceScales&&this.priceScales.length>0&&this.sizeScales.length>0&&t.gt(0)))return[];let r=this.priceScales.slice(0,this.numOrders),i=this.sizeScales.slice(0,this.numOrders),a=this.otherPrice.minus(this.price),o=t;return mo.default.times(this.numOrders,s=>{let c=t.multipliedBy(i[s]).decimalPlaces(n>0?n:0,d.ROUND_DOWN);return o=o.minus(c),s===this.numOrders-1&&(c=c.plus(o)),new Qm({...this,[e]:c,lockedOn:e,price:this.price.plus(a.multipliedBy(r[s])).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)})})}},oh=class extends Qm{stopPrice;orderType=Lm.STOP_LOSS_LIMIT;constraints(){return{...super.constraints(),stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e),this.stopPrice=$(e.stopPrice)}updatePrice(e,t=.05){if(super.updatePrice(e),e&&this.stopPrice.eq(0)){let n=this.side===Hm.BUY?1-t:1+t;this.stopPrice=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,t=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){let n=this.side===Hm.BUY?1+t:1-t;this.price=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}},sh=class extends Qm{linkedOrderId;otherPrice;stopPrice;orderType=Lm.OCO;constraints(){return{...super.constraints(),otherPrice:{bigNumericality:{greaterThan:0}},stopPrice:{bigNumericality:{greaterThan:0}}}}constructor(e){super(e,!1),this.otherPrice=$(e.otherPrice),this.stopPrice=$(e.stopPrice),this.quoteAmount.gt(0)&&this.lockedOn===`quoteAmount`?this.updateQuoteAmount(this.quoteAmount):this.updateBaseAmount(this.baseAmount)}updateQuoteAmount(e){this.quoteAmount=e;let t=this.side===Hm.BUY?this.otherPrice:this.price;this.baseAmount=e.dividedBy(t).decimalPlaces(this.precisionBase>0?this.precisionBase:0,d.ROUND_DOWN),this.validate()}updateBaseAmount(e){this.baseAmount=e;let t=this.side===Hm.BUY?this.otherPrice:this.price;this.quoteAmount=t.multipliedBy(this.baseAmount).decimalPlaces(this.precisionQuote>0?this.precisionQuote:0,d.ROUND_DOWN),this.validate()}updatePrice(e,t=.05){if(super.updatePrice(e),e&&this.otherPrice.eq(0)){let n=this.side===Hm.BUY?1+t*2:1-t*2,r=this.side===Hm.BUY?1+t:1-t;this.otherPrice=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(r).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateOtherPrice(e,t=.05){if(this.otherPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){let n=this.side===Hm.BUY?1-t*2:1+t*2,r=this.side===Hm.BUY?1-t:1+t;this.price=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.stopPrice=e.multipliedBy(r).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}updateStopPrice(e,t=.05){if(this.stopPrice=e.decimalPlaces(this.precisionPrice),e&&this.price.eq(0)){let n=this.side===Hm.BUY?1-t:1+t,r=this.side===Hm.BUY?1+t:1-t;this.price=e.multipliedBy(n).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0),this.otherPrice=e.multipliedBy(r).decimalPlaces(this.precisionPrice>0?this.precisionPrice:0)}}};d.set({STRICT:!1});var ch=rm;return e.BalanceLimit=Wm,e.CoinrayCache=Am,e.CurrentMarket=Mm,e.DAYS=_p,e.ExchangeFeatures=Rm,e.HOURS=gp,e.IpWhiteList=zm,e.LimitLadderOrder=ah,e.LimitOrder=Qm,e.MINUTES=hp,e.MarginType=Bm,e.MarketOrder=$m,e.OcoOrder=sh,e.OrderSide=Hm,e.OrderStatus=Vm,e.OrderType=Lm,e.PriceScales=eh,e.SizeScales=th,e.StopLimitOrder=oh,e.TimeInForce=Um,e.WEEK=vp,e.alignCandles=vm,e.base64UrlDecode=Sp,e.base64UrlEncode=xp,e.camelize=kp,e.candleTime=Zp,e.checkArray=Pp,e.checkBigNumber=Ip,e.checkBoolean=Lp,e.checkNull=Rp,e.checkNumber=Fp,e.checkString=Q,e.combineCandles=_m,e.correctNumberPrecision=Bp,e.createJWT=Tp,e.default=ch,e.encryptPayload=Op,e.errorHelper=zp,e.evalFormula=hm,e.filterMarkets=Qp,e.formulaCandles=ym,e.formulaLegs=mm,e.formulaPrecision=xm,e.formulaSymbolInfo=Sm,e.getBucketStartDates=Xp,e.getTimeParams=Yp,e.isFormula=dm,e.jwkToPublicKey=Dp,e.jwtExpired=Ap,e.latestFormulaCandle=bm,e.locales=Nm,e.parseFormula=pm,e.parseJWT=Ep,e.resolutionToBucketType=Jp,e.resolutionToDuration=Wp,e.safeBigNumber=$,e.safeFloat=Vp,e.safeInteger=Hp,e.safeTime=Up,e.sha256hexdigest=Cp,e.signHMAC=wp,e.strToArray=bp,e.throwIsArray=Np,e.throwNotObject=Mp,e.throwNull2NonNull=jp,e.toBucketEnd=Kp,e.toBucketStart=qp,e.toSafeDate=Gp,Object.defineProperty(e,"types",{enumerable:!0,get:function(){return Im}}),e.unix=yp,e})({});
|
|
35
|
+
//# sourceMappingURL=coinrayjs.js.map
|